/* AlphaHUD theme explorer v1 — company evidence before market rankings. */

.theme-reading-page .topbar {
  grid-template-columns: 240px 1fr auto;
}

.theme-reading-page .header-asof {
  min-width: 108px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--ar-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.theme-library-main,
.theme-detail-main {
  padding: 0;
}

.theme-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  gap: 78px;
  align-items: end;
  min-height: 520px;
  padding: 82px 0 68px;
  border-bottom: 1px solid var(--ar-line-strong);
}

.theme-library-copy h1,
.theme-reading-title h1 {
  margin: 22px 0 24px;
  color: var(--ar-ink);
  font: 500 clamp(54px, 5.4vw, 78px)/1.08 var(--ar-serif);
  letter-spacing: -.055em;
}

.theme-library-copy > p,
.theme-reading-title > p {
  max-width: 680px;
  margin: 0;
  color: var(--ar-ink-soft);
  font-size: 18px;
  line-height: 1.85;
}

.theme-catalog-ledger {
  padding: 8px 0 6px 30px;
  border-left: 1px solid var(--ar-line-strong);
}

.theme-catalog-ledger > span,
.theme-evidence-ledger > span {
  color: var(--ar-blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.theme-catalog-ledger dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  margin: 19px 0 16px;
}

.theme-catalog-ledger dl > div {
  padding: 15px 0;
  border-top: 1px solid var(--ar-line);
}

.theme-catalog-ledger dt,
.theme-evidence-ledger dt,
.theme-identity-list dt {
  color: var(--ar-muted);
  font-size: 11px;
}

.theme-catalog-ledger dd {
  margin: 4px 0 0;
  color: var(--ar-ink);
  font: 500 27px/1.2 var(--ar-serif);
  font-variant-numeric: tabular-nums;
}

.theme-catalog-ledger small {
  color: var(--ar-muted);
  font-size: 11px;
}

.theme-directory-section {
  padding: 78px 0 72px;
  border-bottom: 1px solid var(--ar-line-strong);
}

.theme-directory-intro,
.theme-members-heading,
.theme-boundary {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  gap: 72px;
  align-items: end;
}

.theme-directory-intro h2,
.theme-members-heading h2,
.theme-boundary h2 {
  max-width: 600px;
  margin: 11px 0 0;
  color: var(--ar-ink);
  font: 500 clamp(31px, 3.1vw, 44px)/1.28 var(--ar-serif);
  letter-spacing: -.035em;
}

.theme-directory-intro > p,
.theme-members-heading > p,
.theme-boundary > div:last-child {
  margin: 0;
  color: var(--ar-muted);
  font-size: 14px;
  line-height: 1.85;
}

.theme-directory-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin: 45px 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.theme-directory-search {
  display: grid;
  gap: 7px;
}

.theme-directory-search > span {
  color: var(--ar-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.theme-directory-search input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid var(--ar-line-strong);
  border-radius: 0;
  color: var(--ar-ink);
  background: rgba(255, 255, 255, .38);
  font: 15px/1 var(--ar-sans);
}

.theme-directory-search input::placeholder { color: var(--ar-faint); }
.theme-directory-search input:focus {
  outline: 2px solid rgba(49, 95, 118, .32);
  outline-offset: 2px;
  border-color: var(--ar-blue);
}

.theme-scope-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--ar-line-strong);
}

.theme-scope-tabs button {
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  color: var(--ar-muted);
  background: transparent;
  font: 700 12px/1 var(--ar-sans);
  white-space: nowrap;
}

.theme-scope-tabs button + button { border-left: 1px solid var(--ar-line); }
.theme-scope-tabs button.active { color: #f8f6ef; background: var(--ar-ink); }
.theme-scope-tabs button:focus-visible,
.theme-load-more button:focus-visible,
.theme-detail-drawer summary:focus-visible {
  outline: 2px solid var(--ar-blue);
  outline-offset: 3px;
}

.theme-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 13px 0 20px;
  color: var(--ar-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--ar-line-strong);
}

.theme-result-meta span:first-child { color: var(--ar-ink-soft); font-weight: 700; }

.theme-evidence-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-evidence-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 288px;
  flex-direction: column;
  padding: 29px 30px 27px 0;
  border-bottom: 1px solid var(--ar-line);
  color: var(--ar-ink);
  background: transparent;
  transition: background-color .2s ease, padding .2s ease;
}

.theme-evidence-card:nth-child(even) {
  padding-right: 0;
  padding-left: 30px;
  border-left: 1px solid var(--ar-line);
}

.theme-evidence-card:hover {
  color: var(--ar-ink);
  background: rgba(255, 255, 255, .28);
  text-decoration: none;
}

.theme-evidence-card-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ar-muted);
  font-size: 11px;
}

.theme-evidence-card-head span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.theme-evidence-card-head em { font-style: normal; }

.theme-evidence-card h3 {
  margin: 19px 0 18px;
  color: var(--ar-ink);
  font: 500 29px/1.25 var(--ar-serif);
  letter-spacing: -.025em;
}

.theme-evidence-counts {
  display: flex;
  gap: 34px;
}

.theme-evidence-counts > div { display: flex; align-items: baseline; gap: 7px; }
.theme-evidence-counts strong {
  color: var(--ar-blue);
  font: 500 30px/1 var(--ar-serif);
  font-variant-numeric: tabular-nums;
}
.theme-evidence-counts span { color: var(--ar-muted); font-size: 12px; }

.theme-evidence-unavailable {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border-left: 2px solid var(--ar-warm);
  background: rgba(166, 107, 63, .06);
}
.theme-evidence-unavailable strong { color: #7d5131; font-size: 13px; }
.theme-evidence-unavailable span { color: var(--ar-muted); font-size: 12px; }

.theme-selection-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 11px;
  min-height: 44px;
  margin: 22px 0 18px;
  color: var(--ar-muted);
  font-size: 11px;
}

.theme-selection-reasons span::before { content: "·"; margin-right: 5px; color: var(--ar-faint); }
.theme-selection-reasons .theme-selection-note::before { content: ""; margin: 0; }

.theme-evidence-cta {
  margin-top: auto;
  color: var(--ar-blue);
  font-size: 12px;
  font-weight: 700;
}

.theme-directory-empty,
.theme-member-empty,
.theme-directory-message {
  padding: 44px 0;
  color: var(--ar-muted);
  font-size: 14px;
}

.theme-load-more {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-top: 24px;
  color: var(--ar-muted);
  font-size: 12px;
}

.theme-load-more button {
  min-width: 132px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ar-line-strong);
  color: var(--ar-ink);
  background: transparent;
  font: 700 12px/1 var(--ar-sans);
}

.theme-load-more button:hover { background: rgba(255, 255, 255, .42); }

.theme-boundary {
  margin: 0 -28px;
  padding: 66px 28px;
  color: #eef3f1;
  background: var(--ar-ink);
}

.theme-boundary h2 { color: #f4f1e9; }
.theme-boundary .chapter-kicker { color: #9eb9bd; }
.theme-boundary > div:last-child { color: #bdc6c6; }
.theme-boundary p { margin: 0; }
.theme-boundary p + p { margin-top: 12px; }

/* Detail */

.theme-breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding-top: 16px;
  color: var(--ar-muted);
  font-size: 12px;
}

.theme-breadcrumbs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ar-blue);
}

.theme-reading-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 58px 72px;
  min-height: 500px;
  padding: 66px 0 62px;
  border-bottom: 1px solid var(--ar-line-strong);
  background: transparent;
  box-shadow: none;
}

.theme-reading-title h1 { margin-top: 18px; }

.theme-evidence-ledger {
  align-self: end;
  padding: 8px 0 7px 28px;
  border-left: 1px solid var(--ar-line-strong);
}

.theme-evidence-ledger[data-available="false"] > span { color: var(--ar-warm); }

.theme-evidence-ledger dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 0;
  border-top: 1px solid var(--ar-line);
}

.theme-evidence-ledger dl > div { padding: 15px 10px 9px 0; }
.theme-evidence-ledger dd {
  margin: 5px 0 0;
  color: var(--ar-ink);
  font: 500 26px/1 var(--ar-serif);
  font-variant-numeric: tabular-nums;
}
.theme-evidence-ledger > p { margin: 12px 0 0; color: var(--ar-muted); font-size: 12px; }

.theme-detail-drawers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ar-line);
}

.theme-detail-drawer { min-width: 0; border-bottom: 1px solid var(--ar-line); }
.theme-detail-drawer + .theme-detail-drawer { border-left: 1px solid var(--ar-line); }
.theme-detail-drawer summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  color: var(--ar-ink-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.theme-detail-drawer + .theme-detail-drawer summary { padding-left: 20px; }
.theme-detail-drawer summary::-webkit-details-marker { display: none; }
.theme-detail-drawer summary::after { content: "+"; color: var(--ar-blue); font-size: 18px; font-weight: 400; }
.theme-detail-drawer[open] summary::after { content: "−"; }

.theme-source-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-right: 20px;
  background: var(--ar-line);
}
.theme-detail-drawer + .theme-detail-drawer .theme-identity-list { margin-left: 20px; }
.theme-source-metrics > div { padding: 13px; background: var(--ar-paper); }
.theme-source-metrics span { display: block; color: var(--ar-muted); font-size: 10px; }
.theme-source-metrics strong { display: block; margin-top: 4px; color: var(--ar-ink); font-size: 13px; }
.theme-detail-drawer > p { margin: 14px 20px 18px 0; color: var(--ar-muted); font-size: 11px; }

.theme-identity-list { margin: 0 0 18px; }
.theme-identity-list > div { padding: 11px 0; border-top: 1px solid var(--ar-line); }
.theme-identity-list dd { margin: 4px 0 0; color: var(--ar-ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.theme-identity-list code { color: var(--ar-blue); font: 10px/1.55 ui-monospace, "SFMono-Regular", Consolas, monospace; }

.theme-members-section {
  padding: 76px 0 70px;
  border-bottom: 1px solid var(--ar-line-strong);
}

.theme-members-heading { margin-bottom: 38px; }
.theme-members-heading > p { text-align: right; }

.theme-member-list { border-top: 1px solid var(--ar-line-strong); }

.theme-member-card {
  display: grid;
  grid-template-columns: minmax(180px, .38fr) minmax(0, 1fr);
  gap: 24px 48px;
  padding: 30px 0 28px;
  border-bottom: 1px solid var(--ar-line);
}

.theme-member-card > header {
  display: grid;
  align-content: start;
  gap: 15px;
}

.theme-member-card > header > div { display: grid; gap: 7px; }
.theme-member-card > header span,
.theme-member-reason > span {
  color: var(--ar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.theme-member-card > header a {
  display: inline-flex;
  min-height: 44px;
  flex-direction: column;
  justify-content: center;
  color: var(--ar-ink);
}
.theme-member-card > header a:hover { color: var(--ar-blue); text-decoration: none; }
.theme-member-card > header strong { font: 500 23px/1.25 var(--ar-serif); }
.theme-member-card > header small { margin-top: 3px; color: var(--ar-muted); font-size: 10px; }

.theme-member-reason p {
  margin: 8px 0 0;
  color: var(--ar-ink-soft);
  font-size: 14px;
  line-height: 1.9;
}

.theme-member-card > footer {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 13px;
  border-top: 1px dotted var(--ar-line);
  color: var(--ar-muted);
  font-size: 11px;
}
.theme-member-card > footer em { margin-left: 3px; font-style: normal; font-weight: 700; }

@media (max-width: 980px) {
  .theme-library-hero,
  .theme-reading-hero { gap: 48px; }
  .theme-directory-intro,
  .theme-members-heading,
  .theme-boundary { gap: 42px; }
  .theme-evidence-card { min-height: 310px; }
}

@media (max-width: 760px) {
  .theme-reading-page .topbar { grid-template-columns: 1fr auto; }
  .theme-reading-page .header-asof { grid-column: 2; grid-row: 1; min-width: auto; }

  .theme-library-hero,
  .theme-reading-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: 0;
    padding: 58px 0 52px;
  }

  .theme-library-copy h1,
  .theme-reading-title h1 { font-size: 45px; }
  .theme-library-copy > p,
  .theme-reading-title > p { font-size: 16px; }

  .theme-catalog-ledger,
  .theme-evidence-ledger {
    padding: 22px 0 0;
    border-top: 1px solid var(--ar-line-strong);
    border-left: 0;
  }

  .theme-directory-section,
  .theme-members-section { padding: 56px 0; }

  .theme-directory-intro,
  .theme-members-heading,
  .theme-boundary { grid-template-columns: 1fr; gap: 20px; }
  .theme-directory-intro h2,
  .theme-members-heading h2,
  .theme-boundary h2 { font-size: 30px; }
  .theme-members-heading > p { text-align: left; }

  .theme-directory-controls { grid-template-columns: 1fr; margin-top: 34px; }
  .theme-scope-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .theme-scope-tabs button { padding: 0 10px; }

  .theme-result-meta { align-items: flex-start; flex-direction: column; gap: 4px; }

  .theme-evidence-directory { grid-template-columns: 1fr; }
  .theme-evidence-card,
  .theme-evidence-card:nth-child(even) {
    min-height: 270px;
    padding: 26px 0 24px;
    border-left: 0;
  }

  .theme-boundary { margin: 0 -15px; padding: 52px 28px; }

  .theme-breadcrumbs { padding-top: 10px; }
  .theme-reading-hero { padding-top: 42px; }
  .theme-detail-drawers { grid-template-columns: 1fr; }
  .theme-detail-drawer + .theme-detail-drawer { border-left: 0; }
  .theme-detail-drawer + .theme-detail-drawer summary { padding-left: 0; }
  .theme-detail-drawer + .theme-detail-drawer .theme-identity-list { margin-left: 0; }
  .theme-source-metrics { margin-right: 0; }

  .theme-member-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 27px 0;
  }
  .theme-member-card > header { grid-template-columns: 1fr auto; gap: 18px; }
  .theme-member-card > header > span { padding-top: 4px; text-align: right; }
  .theme-member-card > footer { grid-column: 1; }
}

@media (max-width: 390px) {
  .theme-library-copy h1,
  .theme-reading-title h1 { font-size: 40px; }
  .theme-catalog-ledger dl { gap: 0 16px; }
  .theme-evidence-counts { gap: 24px; }
  .theme-source-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-boundary { margin-inline: -12px; padding-inline: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-reading-page *,
  .theme-reading-page *::before,
  .theme-reading-page *::after { transition-duration: .01ms !important; }
}
