/* Guide pages: the places hub, one page per site, and the phrasebook.
   Only the tokens from base.css, which already carries light and dark. */

/* ---- Header ------------------------------------------------------------ */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head-row { display: flex; align-items: center; gap: 1rem; height: 64px; }
.site-head-tools { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }
.site-head .btn { min-height: 42px; padding: .5rem 1.05rem; font-size: .95rem; }
.lang-btn { text-decoration: none; }
@media (max-width: 440px) {
  .site-head .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-head .btn { padding-inline: .85rem; font-size: .88rem; }
}

/* ---- Frame ------------------------------------------------------------- */
.guide-main { padding-block: clamp(1.25rem, 3vw, 2.25rem) clamp(3rem, 7vw, 5rem); }
.guide :target { scroll-margin-top: 84px; }
.guide section[id] { scroll-margin-top: 84px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 0; margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); font-size: .9rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-inline-end: .5rem; color: var(--ink-4); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.guide-hero { display: grid; gap: .85rem; justify-items: start; max-width: 33.5em; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.guide-hero h1 { font-size: var(--step-5); }
.guide-alt { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .8rem; color: var(--ink-2); }
.guide-alt .he { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.3; }
[dir="rtl"] .guide-alt { font-size: 1.15rem; }
.translit { color: var(--ink-3); font-style: italic; }
.chip { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: .92rem; color: var(--ink-2); }
.toc { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.toc a { padding: .4rem .9rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: .95rem; text-decoration: none; }
.toc a:hover { background: var(--brand-tint-2); }
.see-all a, .back a { color: var(--brand); font-weight: 600; }

/* ---- Sections ---------------------------------------------------------- */
.guide-section { max-width: 33.5em; padding-block: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.guide-section.wide { max-width: none; }
.guide-section h2 { font-size: var(--step-4); margin-bottom: 1.25rem; }
.guide-section h3 { font-size: var(--step-2); margin: 2.2rem 0 .9rem; }
.guide-section p { color: var(--ink-2); }
.history-block + .history-block { margin-top: .4rem; }
.history-block h3 { margin-top: 1.6rem; }
.see-all { margin-top: 1.5rem; }

/* ---- Practical facts --------------------------------------------------- */
.facts { margin: 0; padding: .3rem 1.25rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.facts div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .2rem 1.25rem; padding-block: .95rem; }
.facts div + div { border-top: 1px solid var(--line); }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .facts div { grid-template-columns: minmax(0, 1fr); } }

/* ---- Etiquette and tip ------------------------------------------------- */
.etiquette { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.etiquette li { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 1rem; align-items: start; color: var(--ink-2); }
.etiquette .tag { justify-self: start; margin-top: .18rem; padding: .12rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.etiquette .do .tag { background: var(--brand-tint); color: var(--brand); }
.etiquette .avoid .tag { background: var(--flame-tint); color: var(--flame); }
@media (max-width: 400px) { .etiquette li { grid-template-columns: minmax(0, 1fr); gap: .35rem; } }
.tip { margin-top: 2rem; padding: 1.2rem 1.4rem; border-radius: var(--r-card); background: var(--brand-tint); }
.tip h3 { margin: 0 0 .45rem; font-size: var(--step-1); }
.guide-section .tip p { color: var(--ink); }
/* The line under a visit section: the facts change, staff decide on the day. */
.guide-note { margin-top: 1.5rem; font-size: .95rem; color: var(--ink-2); }

/* ---- Phrase and word rows ---------------------------------------------- */
.lang-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.lang-list li { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: .15rem 1.25rem; padding-block: .9rem; border-bottom: 1px solid var(--line); }
.lang-list .he { grid-column: 1; grid-row: 1 / span 3; font-size: 1.5rem; line-height: 1.35; }
.lang-list .tr, .lang-list .en, .lang-list .note { grid-column: 2; }
.lang-list .tr { color: var(--ink-3); font-style: italic; }
.lang-list .en { color: var(--ink); }
.lang-list .note { color: var(--ink-3); font-size: .93rem; }
[dir="ltr"] .lang-list .he { text-align: left; }
@media (max-width: 560px) {
  .lang-list li { grid-template-columns: minmax(0, 1fr); }
  .lang-list .he, .lang-list .tr, .lang-list .en, .lang-list .note { grid-column: 1; grid-row: auto; }
}
[dir="rtl"] .lang-list .en { text-align: right; }

/* ---- Previous / next --------------------------------------------------- */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 33.5em; margin-top: clamp(2rem, 5vw, 3rem); }
.pager a { display: grid; gap: .2rem; align-content: start; padding: 1rem 1.2rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
.pager a:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.pager .dir { font-size: .85rem; color: var(--ink-3); }
.pager strong { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.pager .next { text-align: end; }
@media (max-width: 520px) { .pager { grid-template-columns: minmax(0, 1fr); } }
.back { margin-top: 1.25rem; }

/* ---- Hub --------------------------------------------------------------- */
.region { padding-block: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.region h2 { font-size: var(--step-3); }
.region > p { color: var(--ink-2); max-width: 30.5em; margin-top: .6rem; }
.cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.card a { display: grid; gap: .3rem; align-content: start; height: 100%; padding: 1.1rem 1.25rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: box-shadow .2s var(--ease); }
.card a:hover { box-shadow: inset 0 0 0 1px var(--ink-3), 0 18px 40px -28px rgba(var(--shadow-rgb), var(--shadow-a)); }
.card .where { font-size: .85rem; color: var(--ink-3); }
.card strong { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.card .he { font-size: 1.2rem; color: var(--ink-2); }
[dir="ltr"] .card .he { text-align: left; }
.card .one { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }

/* ---- Phrasebook tables ------------------------------------------------- */
.group-blurb { max-width: 30.5em; }
.table-wrap { overflow-x: auto; margin-top: 1.25rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.table-wrap:focus-visible { outline-offset: 2px; }
.phrase-table { width: 100%; min-width: 50rem; border-collapse: collapse; font-size: .95rem; }
.phrase-table th, .phrase-table td { padding: .8rem 1rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.phrase-table tbody tr:last-child > * { border-bottom: 0; }
.phrase-table thead th { font-size: .8rem; font-weight: 700; color: var(--ink-3); background: var(--inset); white-space: nowrap; }
.phrase-table .he-cell { width: 13rem; font-family: var(--f-display); font-size: 1.35rem; font-weight: 500; line-height: 1.35; color: var(--ink); }
[dir="ltr"] .phrase-table .he-cell { text-align: left; }
.phrase-table .tr { color: var(--ink-2); font-style: italic; }
.phrase-table td { color: var(--ink); }
.phrase-table .lit, .phrase-table .note { display: block; margin-top: .3rem; color: var(--ink-3); font-size: .88rem; }
.phrase-table .reg { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.phrase-table .reply > span { display: block; }
.phrase-table .reply .he { font-size: 1.15rem; text-align: left; }
.phrase-table .reply .tr { font-size: .88rem; }
.phrase-table .none { color: var(--ink-4); }
/* On a phone the five columns would put the meaning off-screen, so each row
   becomes a card: the Hebrew, how to say it, what it means, then the reply. */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; background: transparent; box-shadow: none; border-radius: 0; }
  .phrase-table { min-width: 0; }
  .phrase-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .phrase-table, .phrase-table tbody, .phrase-table th, .phrase-table td { display: block; }
  .phrase-table tr { display: grid; gap: .3rem; justify-items: start; margin-bottom: .75rem; padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
  .phrase-table th, .phrase-table td { width: 100%; padding: 0; border: 0; }
  .phrase-table .he-cell { width: 100%; font-size: 1.6rem; }
  .phrase-table .reply { margin-top: .45rem; padding-top: .6rem; border-top: 1px solid var(--line); }
  .phrase-table .reply::before { content: attr(data-label); display: block; margin-bottom: .15rem; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
  .phrase-table .reply.is-empty { display: none; }
}

/* ---- Footer ------------------------------------------------------------ */
.guide-foot { border-top: 1px solid var(--line); padding-block: 2.25rem; font-size: .92rem; color: var(--ink-3); }
.guide-foot-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.guide-foot p { max-width: 29.5em; }

/* The waitlist on a guide page: its own section, aligned to the column. */
.guide-get { padding-block: 3rem 5rem; }
.guide-get h2 { font-size: var(--step-3); }
.guide-get .waitlist { margin-inline: 0; }
.guide-get .lede { margin-top: 1rem; }
.guide-get .wrap { padding-inline: 0; }
.guide-section h2 { overflow-wrap: break-word; }
@media (max-width: 19.9em) { .site-head .btn { display: none; } }
html { scroll-padding-top: 80px; }

/* ---- Shared by every family (tools/shell.mjs and the family modules) ------ */

.foot-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.foot-nav a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.foot-nav a:hover { color: var(--ink); text-decoration: underline; }
.guide-foot-row { align-items: flex-start; }
.guide-foot-row > p { flex-basis: 100%; }

.updated { margin-top: 2.5rem; font-size: .9rem; color: var(--ink-3); }
.credit { margin-top: 1rem; max-width: 33.5em; font-size: .88rem; line-height: 1.55; color: var(--ink-3); }
.credit a { color: var(--ink-2); text-underline-offset: 3px; }
/* "CC BY-SA" breaking at its hyphen reads as garbage inside Hebrew. */
.credit a[lang="en"] { white-space: nowrap; }

/* A hero picture: the app's cut-paper art, full column width. */
.guide-art { margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); max-width: 33.5em; border-radius: var(--r-card); overflow: hidden; background: var(--paper-deep); }
.guide-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }

/* A card with a picture on top (hubs). */
.card a > img { width: calc(100% + 2.5rem); max-width: none; margin: -1.1rem -1.25rem .6rem; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--paper-deep); }
.card .tag-line { font-size: .82rem; font-weight: 700; color: var(--brand); }

/* An app screenshot on a hub page, framed like the phone it came from. */
.app-shot { margin: 0; width: min(100%, 240px); border: 7px solid var(--phone-bezel); border-radius: 34px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(var(--shadow-rgb), .45); }
.app-shot img { width: 100%; height: auto; }
.app-shot + figcaption, .shot-cap { margin-top: 1rem; font-size: .88rem; color: var(--ink-3); max-width: 14.75em; }
.hub-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.hub-top { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
@media (max-width: 760px) { .hub-top { grid-template-columns: minmax(0, 1fr); } .hub-top .app-shot, .hub-top figure { justify-self: center; } }

/* ---- Verses ------------------------------------------------------------- */
/* A verse: the pointed Hebrew large and right to left, then its reference,
   its transliteration (English pages) and its plain meaning. */
.verse { margin: 1.25rem 0; padding: 1.2rem 1.4rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.verse-he { font-family: var(--f-display); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.55; direction: rtl; text-align: right; color: var(--ink); }
.verse-ref { margin-top: .35rem; font-size: .88rem; font-weight: 600; color: var(--ink-3); }
.verse-tr { margin-top: .6rem; color: var(--ink-3); font-style: italic; }
.verse-plain { margin-top: .5rem; color: var(--ink); }
[dir="ltr"] .verse-ref { text-align: right; }
/* A few words of a verse, quoted inside a story. */
.quote { margin: .9rem 0 0; padding-inline-start: 1rem; border-inline-start: 3px solid var(--brand-tint-2); font-family: var(--f-display); font-size: 1.35rem; line-height: 1.5; color: var(--ink); }
.quote cite { display: block; font-family: var(--f-body); font-style: normal; font-size: .85rem; color: var(--ink-3); }

/* The three explanations of a verse: the teen's open, the others a tap away,
   every word of all three in the page. */
.regs { display: grid; gap: .6rem; margin-top: 1rem; }
.reg-block { border-radius: var(--r-md); background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); }
.reg-block > summary { cursor: pointer; list-style: none; padding: .7rem 1rem; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: .5rem; }
.reg-block > summary::-webkit-details-marker { display: none; }
.reg-block > summary::before { content: "+"; content: "+" / ""; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: var(--brand-tint); font-size: .95rem; line-height: 1; }
.reg-block[open] > summary::before { content: "−"; content: "−" / ""; }
.reg-block > :not(summary) { padding: 0 1rem .9rem; color: var(--ink-2); }
.reg-block > p + p { margin-top: .6rem; }

/* Words of a verse, with root and meaning. */
.gloss { list-style: none; margin: .6rem 0 0; display: grid; gap: 0; padding: .2rem 1rem; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gloss li { padding-block: .6rem; }
.gloss li + li { border-top: 1px solid var(--line); }
.gloss li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: .1rem 1rem; }
.gloss .he { font-size: 1.3rem; line-height: 1.35; }
[dir="ltr"] .gloss .he { text-align: left; }
.gloss .root { font-size: .85rem; color: var(--ink-3); }
@media (max-width: 520px) { .gloss li { grid-template-columns: minmax(0, 1fr); } }

/* Questions with the answer a tap away. */
.qa-list { display: grid; gap: .8rem; margin-top: 1rem; }
.qa-list > div { padding: 1rem 1.2rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.qa-list .q { font-weight: 700; color: var(--ink); }
.qa-list ol { margin: .6rem 0 0; padding-inline-start: 1.4rem; color: var(--ink-2); }
.qa-list details { margin-top: .6rem; }
.qa-list summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: .45rem; }
.qa-list summary::-webkit-details-marker { display: none; }
.qa-list summary::before { content: "+"; content: "+" / ""; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: var(--brand-tint); font-size: .95rem; line-height: 1; }
.qa-list details[open] summary::before { content: "−"; content: "−" / ""; }
.qa-list details p { margin-top: .4rem; color: var(--ink-2); }

/* What to wear, site by site. */
.facts.wear dt { display: grid; gap: .1rem; align-content: start; }
.facts.wear dt a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.facts.wear dt .where { font-weight: 500; font-size: .85rem; color: var(--ink-3); }
.facts.wear dd p + p { margin-top: .35rem; }
.facts.wear .also { font-size: .92rem; color: var(--ink-3); }
.facts.wear div { grid-template-columns: 12rem minmax(0, 1fr); }
@media (max-width: 560px) { .facts.wear div { grid-template-columns: minmax(0, 1fr); } }
.used-in { margin-top: .6rem; font-size: .92rem; color: var(--ink-3); }
.used-in a { color: var(--ink-2); }
.phrase-table tr:target > * { background: var(--brand-tint); }
.lang-list a.he { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }

/* A calendar table. */
.cal { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cal th, .cal td { padding: .6rem .8rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.cal thead th { font-size: .8rem; color: var(--ink-3); background: var(--inset); }
.cal tr.now > * { background: var(--brand-tint); }
.cal .heb { color: var(--ink-3); }

/* An app screenshot in each theme: the page carries both, and shows the one
   that matches the visitor's theme, whether chosen on the home page (data-theme)
   or by the system. */
.only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none; }
  :root:not([data-theme="light"]) .only-dark { display: block; }
}

/* The era line under a place is a sentence, not a tag: on a phone it wraps,
   so it takes a card's corners rather than a pill's. */
.guide-hero .chip { border-radius: var(--r-md); padding: .45rem .85rem; line-height: 1.45; text-wrap: pretty; }
