/* DevPeek — Formats lookup page. Built from brand-core tokens only. */

.section.section-lookup {
  padding-top: 24px;
}

.hero .hero-note {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Lookup form --- */
.lookup {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

.lookup-field {
  display: grid;
  gap: var(--space-xs);
}

.lookup-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lookup input,
.lookup select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--motion-fast) var(--ease-standard);
}

.lookup input {
  font-family: var(--font-mono);
}

.lookup input:focus-visible,
.lookup select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.lookup select:disabled {
  color: var(--text-muted);
}

.lookup-browse {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.lookup-noscript {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Result --- */
.result {
  max-width: 1100px;
  margin: var(--space-xl) auto 0;
  /* A shared link scrolls here; keep the title clear of the fixed header. */
  scroll-margin-top: 96px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.result-title code {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
}

.result-files {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

.result-files code {
  font-family: var(--font-mono);
}

.result-miss {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  line-height: 1.55;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

/* `display: grid` would otherwise beat the hidden attribute. */
.compare[hidden],
.result-miss[hidden] {
  display: none;
}

.compare-panel {
  margin: 0;
  min-width: 0;
}

.compare-panel figcaption {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.compare-panel img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.compare-note {
  margin-top: var(--space-sm);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* --- The full table --- */
.formats-tables h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-sm);
}

.formats-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.45;
}

.formats-table th:nth-child(1) { width: 30%; }
.formats-table th:nth-child(2) { width: 22%; }
.formats-table th:nth-child(3) { width: 14%; }

.formats-table th,
.formats-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.formats-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.formats-table td code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.formats-table tr:target td {
  background: var(--accent-glow);
}

/* --- Narrow screens --- */
@media (max-width: 768px) {
  .lookup-browse,
  .compare {
    grid-template-columns: 1fr;
  }

  .formats-table thead {
    display: none;
  }

  .formats-table tr {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .formats-table td {
    border: 0;
    padding: 0;
  }

  .formats-table td:nth-child(2) {
    color: var(--text-secondary);
  }
}
