/* pages.css: the article pages built by tools/build.py (the guides, the
   profile pages, the research stories) and the footer they share. It sits on
   top of site.css and uses its tokens; nothing here moves. */

/* key facts: a term and its value, two across on a wide screen */
.kv { display: grid; grid-template-columns: 1fr; gap: 0; margin-block-start: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kv > div { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 12px; padding: 12px 16px; border-block-end: 1px solid var(--faint); }
.kv > div:last-child { border-block-end: 0; }
.kv dt { font-weight: 700; color: var(--bone); }
.kv dd { margin: 0; color: var(--mute); }

/* sources: numbered, small, every one a link that says what it is */
.src { margin-block-start: 12px; padding-inline-start: 1.5em; display: grid; gap: 8px; font-size: 15px; color: var(--mute); }
.src li::marker { color: var(--cyan); font-weight: 700; }
.src a { overflow-wrap: anywhere; white-space: normal; }

/* a link in running text may wrap on a phone: a long title must not push the page sideways */
.guide .link--inline { white-space: normal; }
.guide code { font-family: var(--f-mono); font-size: .92em; color: var(--bone); background: rgba(160, 190, 255, .1); padding: 1px 6px; border-radius: 6px; }
.guide__table caption.sr { position: absolute; }
.guide__table th[scope="row"] { background: none; color: var(--bone); font-weight: 700; min-inline-size: 132px; }
.guide__table td { vertical-align: top; }

/* "more on this": the next pages, as rows you can press */
.rel { list-style: none; margin-block-start: 14px; padding: 0; display: grid; gap: 8px; }
.rel a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid rgba(160, 190, 255, .16); border-radius: 14px; background: rgba(11, 17, 30, .86); text-decoration: none; transition: border-color .25s, background-color .25s; }
.rel a:hover { border-color: rgba(56, 182, 255, .42); background: rgba(13, 23, 42, .92); }
.rel b { font-weight: 700; font-size: 17.5px; color: var(--bone); }
.rel span { color: var(--mute); font-size: 15.5px; line-height: 1.5; }
.rel b .ltr, .rel span .ltr { display: inline; }

/* who wrote the page, and who checked it */
.byline { display: flex; align-items: center; gap: 12px; margin-block-start: 18px; padding-block: 12px; border-block: 1px solid var(--faint); }
.byline img { inline-size: 44px; block-size: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; flex: none; }
.byline p { margin: 0 !important; font-size: 15px; line-height: 1.45; }

/* the profile at the top of a person's page */
.profile { display: grid; grid-template-columns: 1fr; gap: 18px; margin-block-start: 22px; align-items: start; }
.profile__pic { inline-size: min(100%, 300px); aspect-ratio: 3 / 4; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); }
.profile__pic img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 12%; }
.profile .kv { margin-block-start: 0; }

/* a stage on a path: the grade or the step, then what happens in it */
.path-steps { list-style: none; margin-block-start: 16px; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.path-steps > li { position: relative; padding: 14px 16px; padding-inline-start: 58px; border: 1px solid rgba(160, 190, 255, .16); border-radius: 14px; background: rgba(11, 17, 30, .86); color: var(--mute); counter-increment: step; }
.path-steps > li::before { content: counter(step); position: absolute; inset-inline-start: 14px; inset-block-start: 14px; inline-size: 32px; block-size: 32px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; font-size: 16px; color: var(--ink); background: var(--cyan); }
.path-steps b { display: block; font-size: 17.5px; }

/* the footer on these pages: the whole site in three short lists */
.foot--hub .foot__cols { display: grid; grid-template-columns: 1fr; gap: 18px; }
.foot__h { font-weight: 700; color: var(--bone); font-size: 15.5px; }
.foot--hub ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.foot--hub ul .link { min-block-size: 40px; font-size: 15px; }
.foot--hub ul .link[aria-current="page"] { color: var(--mute); text-decoration: none; }
.foot--hub .links--legal { margin-block-start: 18px; padding-block-start: 12px; border-block-start: 1px solid var(--faint); }

@media (min-width: 720px) {
  .kv { grid-template-columns: 1fr 1fr; }
  .kv > div:nth-last-child(2):nth-child(odd) { border-block-end: 0; }
  .kv > div:nth-child(odd) { border-inline-end: 1px solid var(--faint); }
  .kv--one { grid-template-columns: 1fr; }
  .kv--one > div:nth-child(odd) { border-inline-end: 0; }
  .rel { grid-template-columns: 1fr 1fr; }
  .profile { grid-template-columns: 260px 1fr; gap: 26px; }
  .foot--hub .foot__cols { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}

/* ── the readiness check: seven lines for the parent, twelve questions for the teen ── */
.ready--tool { margin-block-start: 18px; }
.guide pre { margin-block-start: 10px; padding: 12px 14px; overflow-x: auto; text-align: left; font-family: var(--f-mono); font-size: 15px; line-height: 1.55; color: #dfe9ff; background: #060b16; border: 1px solid var(--faint); border-radius: 12px; }
.guide pre code { padding: 0; background: none; font-size: inherit; }
.kq { display: grid; gap: 12px; margin-block-start: 18px; }
.kq__topic { margin-block-start: 18px !important; }
.kq__q { min-inline-size: 0; margin: 0; padding: 16px 16px 12px; border: 1px solid rgba(160, 190, 255, .18); border-radius: var(--r-card); background: rgba(11, 17, 30, .86); display: grid; gap: 8px; transition: border-color .25s; }
.kq__q legend { float: inline-start; inline-size: 100%; padding: 0; margin-block-end: 2px; font-weight: 700; font-size: 17.5px; line-height: 1.4; color: var(--bone); }
.kq__q > :not(legend) { clear: both; }
.kq__q label { position: relative; display: flex; align-items: center; gap: 12px; min-block-size: 48px; padding: 8px 12px; border: 1px solid rgba(160, 190, 255, .22); border-radius: 12px; background: rgba(4, 8, 16, .5); color: var(--bone); cursor: pointer; transition: border-color .2s, background-color .2s; }
.kq__q label:hover { border-color: rgba(238, 241, 246, .5); }
.kq__q input { flex: none; inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--blue); }
.kq__q label:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.kq__q label.is-right { border-color: #38d49a; background: rgba(20, 90, 64, .32); }
.kq__q label.is-wrong { border-color: #ff7b7b; background: rgba(110, 28, 28, .3); }
.kq__q label.is-right::after { content: "נכון"; margin-inline-start: auto; font-weight: 700; font-size: 14.5px; color: #7df0c0; }
.kq__q label.is-wrong::after { content: "לא"; margin-inline-start: auto; font-weight: 700; font-size: 14.5px; color: #ffb0b0; }
.kq__q[data-state] label:not(.is-right):not(.is-wrong) { opacity: .62; }
.kq__q[data-state="right"] { border-color: rgba(56, 212, 154, .5); }
.kq__q[data-state="wrong"] { border-color: rgba(255, 123, 123, .45); }
.kq__q details { margin-block-start: 2px; }
.kq__q summary { display: inline-flex; align-items: center; min-block-size: 40px; font-weight: 700; font-size: 15.5px; color: #9fd9ff; cursor: pointer; }
.kq__q details p { margin-block-start: 4px; }
.kq__out { margin-block-start: 10px; padding: 22px 20px; border: 1px solid rgba(56, 182, 255, .5); border-radius: var(--r-card); background: linear-gradient(180deg, rgba(14, 30, 62, .94), rgba(8, 13, 26, .96)); }
.kq__out:focus { outline: none; }
.kq__head { margin-block-start: 0 !important; font-weight: 900; font-size: clamp(22px, 5.8vw, 28px) !important; }
.kq__say { font-weight: 700; color: var(--bone) !important; font-size: 18px; }
.kq__topics { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.kq__topics li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 12px; border: 1px solid var(--faint); border-radius: 12px; }
.kq__topics li[data-level="full"] { border-color: rgba(56, 212, 154, .5); }
.kq__topics li[data-level="low"] { border-color: rgba(255, 176, 32, .5); }
.kq__topics span { color: var(--mute); }
.kq__next { margin-block-start: 14px !important; }
.kq__out .pair { margin-block-start: 16px; }
@media (max-width: 420px) { .kq__out .pair { grid-template-columns: 1fr; } }


/* ── a table on a phone: one card per row ──────────────────────────────────
   Four columns do not fit 390px, and a table that scrolls sideways hides half
   of what it compares. Under 700px each row stands as a card: the row's name
   on top, then every cell with its column's name beside it. */
@media (max-width: 699px) {
  .guide__table--stack { overflow: visible; border: 0; border-radius: 0; }
  .guide__table--stack table { display: block; min-inline-size: 0; font-size: 16px; }
  .guide__table--stack thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .guide__table--stack tbody { display: grid; gap: 10px; }
  .guide__table--stack tr { display: block; padding: 14px 16px 8px; border: 1px solid rgba(160, 190, 255, .18); border-radius: 14px; background: rgba(11, 17, 30, .86); }
  .guide__table--stack th[scope="row"] { display: block; min-inline-size: 0; padding: 0 0 8px; border: 0; font-weight: 900; font-size: 18px; line-height: 1.3; }
  .guide__table--stack td { display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-block-end: 0; border-block-start: 1px solid var(--faint); }
  .guide__table--stack td::before { content: attr(data-label); font-weight: 700; font-size: 14.5px; line-height: 1.5; color: var(--bone); }
  .guide__table--stack td .link--inline { padding-block: 0; }
}
