/* ============================================================
   Architecture Practice — /architecture
   Loaded *after* learn.css, which supplies the shared header,
   hero, card, deck, feed and pagination system. Only the pieces
   that do not exist elsewhere live here: the quiz interaction,
   the glossary table, and the streak widgets.
   ============================================================ */

:root {
  --arch-accent: #0a0a0a;
  --arch-line: #e2e2e2;
}

/* A single hairline of difference from /learn, so the two sections are
   distinguishable at a glance without becoming two design systems. */
.arch-header { border-bottom-width: 2px; }
.arch-header .learn-logo-mark { font-size: 1.15rem; }

/* ── Hub: today's three ─────────────────────────────────────── */
.arch-today-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.arch-today-card {
  border: 1px solid var(--arch-line); background: var(--white);
  padding: 1.6rem; display: flex; flex-direction: column; gap: .85rem;
  transition: border-color .2s, box-shadow .2s;
}
.arch-today-card:hover { border-color: var(--ink); box-shadow: 0 16px 40px rgba(0,0,0,.07); }
.arch-today-card > header {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  border-bottom: 1px solid var(--fog); padding-bottom: .7rem;
}
.arch-today-card h3 { font-size: 1.08rem; line-height: 1.35; }
.arch-today-card > footer {
  margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--fog);
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  flex-wrap: wrap;
}

.arch-today-kicker {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--silver);
}
.arch-today-topic {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite);
  border-bottom: 1px solid var(--cloud); align-self: flex-start; padding-bottom: 1px;
}
.arch-today-topic:hover { color: var(--ink); border-color: var(--ink); }
.arch-today-more {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--silver);
}
.arch-today-more:hover { color: var(--ink); }
.arch-empty-note { color: var(--silver); font-size: .85rem; }

.arch-term-body, .arch-answer-body { font-size: .9rem; }
.arch-term-body > *:first-child, .arch-answer-body > *:first-child { margin-top: 0; }

.arch-aka {
  font-size: .78rem; color: var(--silver); font-style: italic;
}

/* ── Answer disclosure ──────────────────────────────────────── */
.arch-answer { border-top: 1px solid var(--fog); padding-top: .9rem; }
.arch-answer > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 500;
  border: 1px solid var(--ink); padding: .55rem .95rem;
  transition: background .18s, color .18s;
}
.arch-answer > summary::-webkit-details-marker { display: none; }
.arch-answer > summary::after { content: '↓'; font-size: .8rem; }
.arch-answer > summary:hover { background: var(--ink); color: #fff; }
.arch-answer[open] > summary::after { content: '↑'; }
.arch-answer .arch-answer-hide, .arch-answer[open] .arch-answer-show { display: none; }
.arch-answer[open] .arch-answer-hide { display: inline; }
.arch-answer-body { margin-top: 1.1rem; }

.arch-answer--full > summary { padding: .8rem 1.4rem; font-size: .72rem; }
.arch-answer--full .arch-answer-body { font-size: 1rem; }

/* ── Multiple choice ────────────────────────────────────────── */
.arch-mcq { margin-bottom: 2rem; }
.arch-options { list-style: none; display: grid; gap: .5rem; margin: .7rem 0 0; padding: 0; }
.arch-option {
  width: 100%; display: flex; align-items: flex-start; gap: .7rem; text-align: left;
  padding: .75rem .9rem; border: 1px solid var(--arch-line); background: var(--white);
  font-family: var(--font-sans); font-size: .88rem; color: var(--ink); cursor: pointer;
  line-height: 1.5; transition: border-color .16s, background .16s;
}
.arch-option:hover:not(.is-right):not(.is-wrong) { border-color: var(--ink); background: var(--snow); }
.arch-option-key {
  flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--cloud); font-family: var(--font-mono); font-size: .66rem;
  font-weight: 600;
}
.arch-option.is-right { border-color: var(--ink); background: var(--ink); color: #fff; }
.arch-option.is-right .arch-option-key { border-color: rgba(255,255,255,.5); }
.arch-option.is-wrong { border-color: var(--mist); color: var(--silver); text-decoration: line-through; }
.arch-option[disabled] { cursor: default; }
.arch-mcq-note {
  margin-top: .8rem; font-size: .82rem; color: var(--graphite);
  border-left: 2px solid var(--ink); padding-left: .8rem;
}

/* ── Hub mini flashcard ─────────────────────────────────────── */
.arch-mini-card {
  border: 1px solid var(--arch-line); background: var(--snow);
  padding: 1.1rem; cursor: pointer; transition: border-color .18s, background .18s;
}
.arch-mini-card:hover { border-color: var(--ink); background: var(--white); }
.arch-mini-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.arch-mini-front { font-size: .95rem; font-weight: 600; line-height: 1.45; }
.arch-mini-hint { margin-top: .5rem; font-size: .78rem; color: var(--silver); font-style: italic; }
.arch-mini-cue {
  display: block; margin-top: .8rem; font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--mist);
}
.arch-mini-back { display: none; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--cloud); }
.arch-mini-card[aria-expanded="true"] .arch-mini-back { display: block; }
.arch-mini-card[aria-expanded="true"] .arch-mini-cue { visibility: hidden; }

/* ── Difficulty / kind chips ────────────────────────────────── */
.arch-flag {
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--graphite);
  border: 1px solid var(--cloud); padding: .18rem .45rem;
}
.arch-kind {
  display: inline-block; font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--graphite);
  border: 1px solid var(--cloud); padding: .18rem .45rem; white-space: nowrap;
}
.arch-kind--pattern  { border-color: var(--graphite); color: var(--ink); }
.arch-kind--protocol { border-color: var(--silver); }
.arch-kind--tool     { background: var(--fog); }
.arch-kind--metric   { border-style: dashed; }
.arch-kind--practice { border-color: var(--mist); }
/* Case studies are the one kind worth spotting at a glance in a long glossary
   table — they are the entries people browse rather than look up. */
.arch-kind--case-study { background: var(--ink); color: #fff; border-color: var(--ink); }

.arch-diff-tabs {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem;
}
.arch-diff-tabs .label { margin: 0 .4rem 0 0; }
.arch-diff-tab {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite);
  border: 1px solid var(--arch-line); padding: .35rem .7rem;
  transition: background .16s, color .16s, border-color .16s;
}
.arch-diff-tab:hover { border-color: var(--ink); color: var(--ink); }
.arch-diff-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.arch-diff-tab .num { margin-left: .4rem; color: inherit; opacity: .6; }

.arch-doc-flags { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ── Quiz list ──────────────────────────────────────────────── */
.arch-quiz-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--arch-line); }
.arch-quiz-row { border-bottom: 1px solid var(--arch-line); }
.arch-quiz-link { display: block; padding: 1.35rem 0; transition: padding-left .2s; }
.arch-quiz-link:hover { padding-left: .7rem; }
.arch-quiz-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.arch-quiz-topic {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--silver);
}
.arch-quiz-row h2 { font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.arch-quiz-link:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.arch-quiz-foot {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .6rem;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; color: var(--silver);
}

/* ── Glossary table ─────────────────────────────────────────── */
.arch-term-wrap { border: 1px solid var(--arch-line); }
.arch-term-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.arch-term-table thead th {
  text-align: left; background: var(--fog); border-bottom: 1px solid var(--arch-line);
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--graphite); font-weight: 500; padding: 0;
}
.arch-term-table thead th a { display: block; padding: .8rem 1rem; }
.arch-term-table thead th a:hover { background: var(--cloud); color: var(--ink); }
.arch-term-table thead th.is-sorted { color: var(--ink); }
.arch-term-table thead th.is-sorted a::after { content: ' ↓'; }
.arch-term-table thead th.arch-col-what { padding: .8rem 1rem; }
.arch-term-table tbody tr { border-bottom: 1px solid var(--fog); }
.arch-term-table tbody tr:last-child { border-bottom: 0; }
.arch-term-table tbody tr:hover { background: var(--snow); }
.arch-term-table th[scope="row"], .arch-term-table td { padding: .75rem 1rem; vertical-align: top; text-align: left; }
.arch-term-table th[scope="row"] { font-weight: 600; white-space: nowrap; }
.arch-term-name { border-bottom: 1px solid transparent; }
.arch-term-row:hover .arch-term-name { border-color: var(--ink); }
.arch-term-aka {
  display: block; font-weight: 400; font-size: .68rem; color: var(--silver);
  font-style: italic; white-space: normal;
}
.arch-col-topic a { color: var(--graphite); border-bottom: 1px solid var(--cloud); }
.arch-col-topic a:hover { color: var(--ink); border-color: var(--ink); }
.arch-col-what { color: var(--graphite); line-height: 1.55; min-width: 260px; }
.arch-term-noresults { margin-top: 1.2rem; color: var(--silver); font-size: .88rem; }
.arch-term-noresults a { border-bottom: 1px solid var(--ink); color: var(--ink); }
@media (max-width: 720px) {
  .arch-term-table .arch-col-kind, .arch-term-table .arch-col-topic { display: none; }
  .arch-term-table th[scope="row"] { white-space: normal; }
}

.arch-term-grid {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.arch-term-card {
  border: 1px solid var(--arch-line); background: var(--white); padding: 1.1rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .18s, transform .18s;
}
.arch-term-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.arch-term-card h3 { font-size: .95rem; }
.arch-term-card p { font-size: .82rem; color: var(--graphite); line-height: 1.55; }

/* ── Streaks ────────────────────────────────────────────────── */
.arch-streak-banner {
  display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem;
  border: 1px solid var(--ink); background: var(--white); padding: .9rem 1.1rem;
}
.arch-streak-flame { font-size: 1.1rem; line-height: 1; color: var(--ink); }
.arch-streak-banner strong { display: block; font-size: .92rem; }
.arch-streak-banner span { font-size: .78rem; color: var(--silver); }
.arch-streak-dots { display: flex; gap: 4px; margin-left: auto; }
.arch-streak-dots i {
  width: 9px; height: 9px; border: 1px solid var(--cloud); display: block;
}
.arch-streak-dots i.on { background: var(--ink); border-color: var(--ink); }

.arch-streak-chip {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--graphite);
  border: 1px solid var(--ink); padding: .4rem .65rem;
}
.arch-streak-chip b { color: var(--ink); }

.arch-stat-streak .learn-stat-num { color: #fff; }

.arch-card-diff { margin-bottom: .4rem; }

/* ── Topic page ─────────────────────────────────────────────── */
.arch-syllabus { display: flex; flex-wrap: wrap; gap: .5rem; }
.arch-topic-stats { margin-top: 1.5rem; }
.arch-topic-stats .learn-stat-num { color: var(--ink); }
.arch-topic-stats .learn-stat-label { color: var(--silver); }

.arch-aside-title { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.arch-aside-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.arch-aside-blurb { font-size: .8rem; color: var(--graphite); line-height: 1.55; margin-bottom: .8rem; }
.arch-aside-terms { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.arch-aside-terms a {
  font-size: .82rem; color: var(--graphite); border-bottom: 1px solid transparent;
}
.arch-aside-terms a:hover { color: var(--ink); border-color: var(--ink); }

/* The admin coverage registry (`.ar-*`) is styled in style.css, not here — the
   admin dashboard loads only that stylesheet, so rules placed in this file
   never reached it. */

/* ── Topic grid (area page, topic neighbours) ────────────────── */
.arch-topic-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.arch-topic-card {
  border: 1px solid var(--arch-line); background: var(--white); padding: 1.1rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .18s, transform .18s;
}
.arch-topic-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.arch-topic-card h3 { font-size: .95rem; line-height: 1.35; }
.arch-topic-card p { font-size: .8rem; color: var(--graphite); line-height: 1.55; }
/* An empty topic is still a real part of the curriculum, so it is shown rather
   than hidden — muted, and honest about having nothing in it. */
.arch-topic-card.is-empty { background: var(--snow); border-style: dashed; }
.arch-topic-card.is-empty h3 { color: var(--graphite); }
.arch-topic-counts {
  margin-top: auto; display: flex; flex-wrap: wrap; gap: .7rem;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--silver);
}
.arch-topic-counts strong { color: var(--ink); }
.arch-topic-empty {
  margin-top: auto; font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--mist);
}
