/* convert-ts documentation site — Bauhaus-flavored theme matching the icon artwork. */

:root {
  --color-bg: #f4f4f2;
  --color-card: #ffffff;
  --color-ink: #1f1f1f;
  --color-blue: #3a86ef;
  --color-red: #e5383b;
  --color-yellow: #fed100;
  --color-muted: #5c5c58;
  --shadow: 8px 8px 0 rgba(17, 17, 17, 0.15);
  --border: 3px solid var(--color-ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-card);
  border-bottom: var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-ink);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  display: block;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--color-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.15rem 0.1rem;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--color-yellow);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--color-blue);
}

/* Main layout */

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.hero {
  text-align: center;
  margin: 1rem 0 2rem;
}

.hero-image {
  width: min(100%, 620px);
  height: auto;
}

.tagline {
  font-size: 1.1rem;
  color: var(--color-muted);
  margin: 0.75rem 0 0;
}

.card {
  background: var(--color-card);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.card h1 {
  margin-top: 0;
}

/* Converter */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-grow {
  flex: 1 1 20rem;
}

.field-boundary input {
  width: 9rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}

input,
select {
  font: inherit;
  color: var(--color-ink);
  background: var(--color-bg);
  border: 2px solid var(--color-ink);
  padding: 0.5rem 0.6rem;
  border-radius: 0;
}

input:focus,
select:focus {
  outline: 3px solid var(--color-blue);
  outline-offset: 1px;
}

.hint {
  border-left: 6px solid var(--color-red);
  background: #fdecec;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
}

.results {
  width: 100%;
  border-collapse: collapse;
}

.results th {
  text-align: left;
  border-bottom: 3px solid var(--color-blue);
  padding: 0.4rem 0.6rem;
}

.results td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #d9d9d4;
  vertical-align: middle;
}

.results td.value {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  word-break: break-all;
}

.copy-button,
.example {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-card);
  border: 2px solid var(--color-ink);
  padding: 0.3rem 0.8rem;
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.15);
}

.copy-button:hover,
.example:hover {
  background: var(--color-yellow);
}

.copy-button:active,
.example:active {
  box-shadow: none;
  transform: translate(3px, 3px);
}

.copy-button.copied {
  background: var(--color-blue);
  color: #fff;
  border-color: var(--color-blue);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Documentation page */

.docs-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  max-width: 72rem;
}

.docs-nav {
  position: sticky;
  top: 1.5rem;
  margin-bottom: 0;
}

.docs-nav h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--color-ink);
  text-decoration: none;
  border-left: 6px solid transparent;
}

.docs-nav a:hover {
  background: var(--color-bg);
}

.docs-nav a.active {
  border-left-color: var(--color-blue);
  background: var(--color-bg);
  font-weight: 600;
}

.doc-content {
  margin-bottom: 0;
  overflow-wrap: break-word;
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
  border-bottom: 2px solid #d9d9d4;
  padding-bottom: 0.2rem;
}

.doc-content code {
  background: var(--color-bg);
  padding: 0.1rem 0.3rem;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.doc-content pre {
  background: var(--color-ink);
  color: #f4f4f2;
  padding: 1rem;
  overflow-x: auto;
}

.doc-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.doc-content table {
  border-collapse: collapse;
  width: 100%;
}

.doc-content th,
.doc-content td {
  border: 1px solid #d9d9d4;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.doc-content th {
  background: var(--color-bg);
}

.doc-content blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 6px solid var(--color-yellow);
  background: var(--color-bg);
}

.doc-content img {
  max-width: 100%;
}

.doc-content hr {
  border: none;
  border-top: 2px solid #d9d9d4;
  margin: 2rem 0;
}

/* Footer */

.site-footer {
  text-align: center;
  color: var(--color-muted);
  padding: 1.5rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-muted);
}

@media (max-width: 50rem) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
  }
}
