/*
  Kolenu-Nitzavim — the whole visual system.

  A calm white page. Light blue and warm beige are background tints and rules
  only, never text. Blue survives as the accent on links, the join button and
  hairlines.

  THE BINDING CONSTRAINT IS LEGIBILITY, NOT TASTE.

  The people reading this are older and many of them do not see well. That sits
  ahead of any aesthetic preference, and it is why:

    - no text is below 4.5:1, and body text is at 7:1 or better
    - body text is 18px with a 1.7 line-height; secondary text never below 16px;
      uppercase labels never below 13px
    - nothing is communicated by colour alone
    - every tap target is at least 44x44, and the join button much bigger
    - 400 is the lightest font weight in the file
    - links inside prose are underlined

  #6E7C93 is 4.23:1 on white and must never come back. It was doing the eyebrows,
  the captions and the timezone line — exactly the text these readers need most.

  `npm run audit` checks all of that in a real browser. Run it after any change
  in here.

  ---------------------------------------------------------------------------
  CLASS NAMES

  Four surfaces share this file, so everything that is not genuinely global
  carries the prefix of the surface that owns it:

    (none)   global: .wrap, .he, .visually-hidden
    .site-   chrome shared by every public page: nav, footer, buttons, notices
    .home-   the front page only
    .page-   the reading pages, /about and /join
    .admin-  the admin screen — in admin/admin.css, not here

  Descendant names inside a prefixed block (.home-next .name) are scoped by
  their parent and need no prefix of their own.

  This exists because `.panel` meant one thing on the front page and another on
  /admin, and the admin screen quietly turned into blue boxes.

  ---------------------------------------------------------------------------
  Nothing is loaded from a CDN. The typefaces are the ones already on the
  device, because a font that fails at 05:55 is a font we cannot use.
*/

:root {
  /*
    THE DESIGN LAYER.

    Everything that makes this look the way it looks is a token in this block.
    The block below it puts the original design back — see "Reverting" in
    README.md. Nothing outside these two blocks differs between the two, which
    is what makes the revert honest rather than approximate.

    The direction: a quiet institution. Warm paper rather than screen-white, a
    warm near-black, and one deep ink-blue that reads as considered rather than
    as a default link colour. Nothing ornamental, nothing devotional — the
    restraint is the point, and it is also what an older reader needs.
  */

  /* Colour. Every value measured: the worst pairing anywhere is 6.67:1 against
     a 4.5 floor, and the accent is 8.90:1 — deeper than the blue it replaces,
     so this is a legibility gain as well as a visual one. */
  --paper:      #FDFCF9;   /* warm off-white; screen-white is clinical and glares */
  --tint-warm:  #F2EEE3;
  --tint-cool:  #E9EFF6;
  --rule:       #D9D3C5;
  --rule-cool:  #C7D5E5;
  --ink:        #1A1A15;   /* warm near-black — 17.0:1 on paper */
  --ink-2:      #454842;   /*  9.1:1, and as light as text ever gets */
  --accent:     #1B4B73;   /*  8.9:1 */
  --live:       #8A3B14;   /*  7.5:1 — semantic only: a service happening now */
  --on-accent:  #FDFCF9;

  /*
    Type. Charter and Iowan Old Style are on every Apple device and Constantia
    on every Windows one; all three are better cut for running text than the
    Georgia most stacks fall back to, and none of them costs a request.
  */
  --serif:  Charter, "Iowan Old Style", "Bitstream Charter", Constantia,
            "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:   ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;

  /*
    Hebrew, named properly.

    Nothing here is self-hosted — every face is whatever the device already has,
    so this list is the only thing standing between pointed Hebrew and a
    fallback that drops the nikud or piles it on the letter. Ordered by what
    actually ships, serif first, every entry a real face with nikud coverage on
    a platform we care about.

    A bare `serif` last would land on a Latin face with no Hebrew at all on some
    systems, which is how vowel points turn into boxes.
  */
  --hebrew: "Frank Ruhl Libre", FrankRuehl, "Noto Serif Hebrew",
            "Times New Roman", "New Peninim MT", "Arial Hebrew",
            "Noto Sans Hebrew", David, serif;

  /* Detail. Tighter tracking on display sizes, looser on small caps — the two
     things that most separate set type from default type. */
  --tracking-display: -0.021em;
  --tracking-label:    0.115em;
  --weight-display:    400;

  /* Geometry. Nearly square corners and hairlines: printed, not chrome. */
  --radius:        2px;
  --btn-border-w:  1px;
  --panel-top-w:   0px;    /* the old 4px accent bar read as a dashboard card */
  --panel-side-w:  3px;    /* an accent rule down the side instead */
  --head-rule-w:   30px;   /* the short rule under a section eyebrow */
  --num-w:         7ch;    /* the 192 beside the wordmark */

  /*
    Rhythm, and the one number this site has a reason to use.

    Kolenu, Nitzavim and Kavatz all come to 192, which is why the number is in
    the logo. So the page is measured in it rather than in round numbers pulled
    out of the air: the content is 192 x 6 wide, the label column is 192, the
    gutter is 192 / 4, and the space between sections is 192 / 2. Nobody will
    ever notice, and that is rather the point — it is the difference between
    proportions that were chosen and proportions that were typed.
  */
  --measure:    1152px;   /* 192 x 6 */
  --label-col:   192px;
  --label-gap:    48px;   /* 192 / 4 */
  --section-y:  clamp(48px, 6vw, 96px);   /* 192 / 2 at full size */
  --panel-p:    28px;

  /* Older names, kept so nothing referring to them breaks. */
  --muted: var(--ink-2);
  --panel: var(--tint-warm);
  --alert: var(--live);
}

/*
  THE ORIGINAL DESIGN.

  Put data-theme="original" on <html> and the site goes back exactly as it was.
  `npm run theme original` does that across every page; `npm run theme refined`
  undoes it. design/styles-original.css is the untouched file it came from.
*/
:root[data-theme="original"] {
  --paper:      #FFFFFF;
  --tint-warm:  #F7F4ED;
  --tint-cool:  #EDF3FA;
  --rule:       #DFD9CD;
  --rule-cool:  #CFDBEA;
  --ink:        #14181D;
  --ink-2:      #3D4854;
  --accent:     #1F5FA8;
  --live:       #8F3F12;
  --on-accent:  #FFFFFF;

  --serif:  ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", Palatino,
            "Times New Roman", serif;

  --tracking-display: -0.012em;
  --tracking-label:    0.14em;
  --weight-display:    400;

  --radius:        3px;
  --btn-border-w:  2px;
  --panel-top-w:   4px;
  --panel-side-w:  0px;
  --head-rule-w:   0px;
  --num-w:         0ch;

  --measure:    1120px;
  --label-col:      0px;
  --label-gap:      0px;
  --section-y:     52px;
  --panel-p:       24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14140F;
    --tint-warm:  #1E1C16;
    --tint-cool:  #161D26;
    --rule:       #343025;
    --rule-cool:  #2A3A4C;
    --ink:        #F0EEE6;   /* 15.9:1 */
    --ink-2:      #B9B7AC;   /*  9.2:1 */
    --accent:     #8FBBEA;   /*  9.2:1 */
    --live:       #EC9A62;   /*  8.2:1 */
    --on-accent:  #14140F;
  }

  :root[data-theme="original"] {
    --paper:      #10141A;
    --tint-warm:  #1B1813;
    --tint-cool:  #141C27;
    --rule:       #332D23;
    --rule-cool:  #28394E;
    --ink:        #EDF0F4;
    --ink-2:      #B6C0CC;
    --accent:     #82B4F2;
    --live:       #EC9A62;
    --on-accent:  #10141A;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.7 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: var(--weight-display);
  line-height: 1.14;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

p { margin: 0; }

a { color: inherit; }

.he {
  font-family: var(--hebrew);
  direction: rtl;
  unicode-bidi: isolate;
  font-weight: 400;
}

.wrap {
  width: min(var(--measure), 100%);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ====================================================== site: shared chrome */

/* The small uppercase label. 13px is the floor for this audience, and it is
   ink-2, never a grey that only just passes. */
.site-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
}

.site-section-head { margin-bottom: 30px; }

/* A short accent rule under the eyebrow. Zero-width in the original theme, so
   it simply is not there when the tokens are reverted. */
.site-section-head .site-eyebrow::after {
  content: "";
  display: block;
  width: var(--head-rule-w);
  height: 2px;
  margin-top: 12px;
  background: var(--accent);
}

.site-section-head h2 { margin-top: 14px; font-size: clamp(27px, 2.7vw, 34px); }

.site-note {
  margin-top: 18px;
  padding-left: 14px;
  border-left: 3px solid var(--rule);
  color: var(--ink-2);
  font-size: 16px;
  max-width: 60ch;
}

/*
  44px is the floor for anything tappable. The join button is much bigger than
  that, because it is the one thing on the page that has to be hit first time,
  in the dark, at six in the morning.
*/
.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border: var(--btn-border-w) solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: 500 17px/1.4 var(--sans);
  letter-spacing: 0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.site-btn-ghost { background: transparent; color: var(--accent); }
.site-btn:hover { opacity: 0.9; }

.site-btn-join {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 30rem;
  min-height: 66px;
  padding: 19px 26px;
  border: var(--btn-border-w) solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 20px/1.3 var(--sans);
  letter-spacing: 0.005em;
  text-align: center;
  text-decoration: none;
}

.site-btn-join:hover { opacity: 0.9; }

/* A service with no link yet, a community not open yet. Same footprint, no
   promise. */
.site-no-join {
  max-width: 30rem;
  padding: 17px 19px;
  border: 1px dashed var(--rule-cool);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 17px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Solid, not translucent: body text sliding under a blurred bar is exactly
     the kind of thing that costs this audience the line they were reading. */
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 8px;
}

.site-nav .brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 4px;
  text-decoration: none;
}

/*
  Frank's logo, not a typeset wordmark. The Hebrew is the dominant element,
  which was his first request. It is an outlined SVG from public/brand/, drawn
  once and not restyled here: see design/logo/README.md.

  56px tall on a wide screen and 44px on a phone, where it is the whole first
  row of the bar.
*/
.site-logo { display: block; width: auto; height: 56px; }

/*
  On the dark theme the header shows kolenu-logo-horizontal-reverse.svg, through
  a <picture> in each page: the same drawing in the reverse logo's own colours.
  See design/logo/README.md.
*/
.site-nav .brand picture { display: block; }

.site-footer-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }

/* The Hebrew name, larger than the Latin beside it and never broken across a
   line: at 375px it takes a line of its own before it would wrap. */
.site-footer-name .he { font-size: 26px; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.site-footer-name .lat { white-space: nowrap; }

.site-footer .num {
  display: inline-block;
  max-width: var(--num-w);
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--accent);
}

.site-navlinks { display: flex; align-items: center; gap: 4px; }

.site-navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
}

.site-navlinks a:hover { color: var(--accent); text-decoration: underline; }

.site-navlinks a.cta {
  margin-left: 6px;
  padding: 10px 18px;
  border: var(--btn-border-w) solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}

/* The current page is named, not just coloured. */
.site-navlinks a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/*
  The language switch, FR | EN, on every public page. Each is a real link to
  the same page in that language (lang.js keeps the choice). The current one is
  named by aria-current and shown bold and underlined, not by colour alone.
*/
.site-lang { display: flex; align-items: center; flex-shrink: 0; }

/* On a wide screen the links and the switch sit together on the right. */
.site-nav:not(.admin-topbar) .site-navlinks { margin-left: auto; }

.site-lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 6px;
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
}

.site-lang a:hover { color: var(--accent); text-decoration: underline; }

.site-lang a[aria-current="true"] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-lang-sep { color: var(--ink-2); font-size: 17px; }

.site-announcements { border-bottom: 1px solid var(--rule); background: var(--tint-warm); }
.site-announcements .wrap { padding-block: 20px; }
.site-announcement + .site-announcement { margin-top: 14px; }
.site-announcement .site-eyebrow { margin-bottom: 4px; }
.site-announcement p { font-size: 18px; max-width: 70ch; }

.site-footer { border-top: 1px solid var(--rule); }

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-block: 32px 44px;
  font-size: 16px;
  color: var(--ink-2);
}

.site-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* 44 in both directions, not just height — "Join" is a short word. */
.site-footer .links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

/* ========================================================= home: front page */

.home-hero { border-bottom: 1px solid var(--rule); }

.home-hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
  padding-block: var(--section-y);
}

.home-hero h1 { margin-top: 14px; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.08; }
.home-hero h1 em { font-style: normal; color: var(--accent); }

.home-lede {
  margin-top: 22px;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.6;
}

.home-who {
  display: grid;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  max-width: 48ch;
  font-size: 17px;
  color: var(--ink-2);
}

.home-who b { color: var(--ink); font-weight: 600; }

.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* --------------------------------------------- the next-service panel */

/*
  The panel. In the original theme a 4px accent bar sat across the top, which is
  the shape of every dashboard card ever made; here the accent runs down the
  side instead and the box is quieter. Both are token-width, so reverting puts
  the bar back and takes the side rule away.
*/
.home-next {
  border: 1px solid var(--rule-cool);
  border-top: var(--panel-top-w) solid var(--accent);
  border-left: var(--panel-side-w) solid var(--accent);
  border-radius: var(--radius);
  background: var(--tint-cool);
}

.home-next .top {
  padding: var(--panel-p) var(--panel-p) calc(var(--panel-p) - 4px);
  border-bottom: 1px solid var(--rule-cool);
}

.home-next .name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font: 500 clamp(28px, 3vw, 36px)/1.05 var(--serif);
}

.home-next .name .he { font-size: 0.9em; font-weight: 400; color: var(--ink-2); }
.home-next .time { margin-top: 10px; font: 400 clamp(40px, 4.6vw, 52px)/1.05 var(--serif); }
.home-next .when { margin-top: 8px; font-size: 18px; color: var(--ink); }
.home-next .zone { margin-top: 4px; font-size: 16px; color: var(--ink-2); }
.home-next .bot {
  display: grid;
  gap: 14px;
  padding: calc(var(--panel-p) - 8px) var(--panel-p) var(--panel-p);
}
.home-next .foot { font-size: 16px; color: var(--ink-2); }

/*
  "Happening now" is words first. The dot is decoration and is hidden from
  assistive technology; remove it and the meaning is still there.
*/
.home-livepill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--live);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-livedot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); flex: 0 0 auto; }

@media (prefers-reduced-motion: no-preference) {
  .home-livedot { animation: home-pulse 2.4s ease-in-out infinite; }
}

@keyframes home-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ------------------------------------------------------------ the day */

.home-triad { border-bottom: 1px solid var(--rule); }
.home-triad .wrap { padding-block: var(--section-y); }

.home-trow { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }

.home-svc { padding: 28px 28px 28px 0; border-right: 1px solid var(--rule); }
.home-svc:last-child { border-right: 0; padding-right: 0; }
.home-svc:not(:first-child) { padding-left: 28px; }

.home-svc .he { font-size: 32px; line-height: 1.3; color: var(--accent); }
.home-svc h3 { margin-top: 10px; font-size: 23px; font-weight: 500; }
.home-svc .t { margin-top: 6px; font: 400 28px/1.2 var(--serif); }
.home-svc .zone { margin-top: 2px; font-size: 16px; color: var(--ink-2); }
.home-svc .mins { margin-top: 2px; font-size: 16px; color: var(--ink-2); }

/* ----------------------------------------------------------- cities */

.home-cities { border-bottom: 1px solid var(--rule); background: var(--tint-cool); }
.home-cities .wrap { padding-block: var(--section-y); }

/* Six cities. In the refined theme these become three by two — see below. */
.home-citygrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin-top: 26px;
  border: 1px solid var(--rule-cool);
  background: var(--rule-cool);
}

.home-city { padding: 22px; background: var(--paper); }
.home-city .n { font-size: 17px; color: var(--ink-2); }
/* Never two lines. At phone width the cell is about 128px wide and "06:00 AM"
   at 30px does not fit, so every city read "06:00 / AM". */
.home-city .v {
  margin-top: 4px;
  font: 400 clamp(24px, 6.4vw, 30px)/1.05 var(--serif);
  white-space: nowrap;
}
.home-city .o { margin-top: 6px; font-size: 16px; color: var(--ink-2); }

/* The visitor's own row is named "Where you are" in words. The tint is a
   second signal, never the only one. */
.home-city.you { background: var(--tint-warm); border-left: 4px solid var(--accent); }
.home-city.you .n { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------- the name band */

/* Pale beige. The dark navy band this replaces put light text on a dark field
   for six paragraphs, which is the hardest thing to read on the page. */
.home-band { border-bottom: 1px solid var(--rule); background: var(--tint-warm); }
.home-band .wrap { padding-block: calc(var(--section-y) * 1.15); }
.home-band .intro { margin-top: 18px; max-width: 58ch; font-size: 18px; color: var(--ink-2); }

/* The logo as the centrepiece of the section about the name. */
.home-logo { margin: 36px auto 8px; width: 100%; max-width: 560px; }
.home-logo img { display: block; width: 100%; height: auto; }

.home-gem {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 40px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.home-word { padding: 30px 26px; background: var(--paper); }

/*
  direction:rtl orders the glyphs; text-align:left puts the word over its own
  gloss. Right-aligned it floated to the card edge, a column away from the line
  that explains it. This is a Hebrew specimen inside an English explanation —
  unlike the verse below, which is running Hebrew prose and stays right-aligned.
*/
.home-word .w {
  font-family: var(--hebrew);
  direction: rtl;
  text-align: left;
  font-size: 72px;
  line-height: 1.2;
  white-space: nowrap;
}

.home-word .gloss { margin-top: 10px; font-size: 17px; color: var(--ink-2); }

.home-word .sum {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-2);
}

/*
  Each letter-and-value is its own flex item, and so is "= 192".

  Flex items are ordered by the DOM, not by the bidi algorithm. Written as plain
  text the same line paints backwards, which is the first thing a Hebrew reader
  would notice. `npm run audit` measures it.
*/
.home-lv { display: inline-flex; align-items: baseline; gap: 4px; }
.home-lv .he { font-size: 18px; color: var(--ink); }
.home-word .sum .eq { color: var(--accent); font-weight: 600; font-size: 17px; }

/*
  "= 192" gets its own line in the refined theme. In the narrower content column
  two of the three cards wrapped and one did not, which looked like an accident.
  On its own row it is consistent, and it reads better: the letters, then the
  total.
*/
:root:not([data-theme="original"]) .home-word .sum .eq { flex: 1 0 100%; margin-top: 4px; }

.home-equals { display: flex; align-items: baseline; flex-wrap: wrap; gap: 20px; margin-top: 36px; }
.home-equals .big { font: 400 clamp(52px, 7vw, 88px)/0.95 var(--serif); color: var(--accent); }
.home-equals p { max-width: 42ch; font-size: 18px; color: var(--ink-2); }

/* Pointed Hebrew set inside a run of English. At the surrounding 18px the
   nikud are a smudge; this is the smallest it can be and still be read. */
.home-he-inline { font-size: 26px; line-height: 1; vertical-align: -0.12em; color: var(--ink); }

.home-verse {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

/* Running Hebrew prose: right-aligned, explicitly, so a later change to
   alignment elsewhere cannot quietly flip it. */
.home-verse .he { text-align: right; font-size: 28px; line-height: 1.9; }
.home-verse .en { font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.home-verse cite { display: block; margin-top: 14px; font-size: 16px; font-style: normal; }

/* -------------------------------------------------------------- the week */

.home-week .wrap { padding-block: var(--section-y); }

.home-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 26px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.home-day { padding: 20px 18px; background: var(--paper); }
.home-day.off { background: var(--tint-warm); }

.home-day .dn {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.home-day ul { display: grid; gap: 16px; margin: 14px 0 0; padding: 0; list-style: none; }

/*
  Time above name, not beside it. Seven day-columns leave about 150px each, and
  "07:00 AM Shacharit" does not fit on one line at a size this audience can
  read. Side by side, the name was either pushed out of the column or broken one
  letter per line.
*/
.home-day li { display: grid; gap: 0; font-size: 17px; }
.home-day li .tm { font: 400 19px/1.4 var(--serif); white-space: nowrap; }
.home-day li .nm { line-height: 1.4; }
.home-day .none { margin-top: 14px; font-size: 16px; color: var(--ink-2); }

/* A cancellation is struck through AND says so in words. */
.home-day li.is-off .tm { text-decoration: line-through; color: var(--ink-2); }
.home-day li.is-off .nm { color: var(--ink-2); }
.home-day li .why { display: block; margin-top: 2px; font-size: 16px; color: var(--ink-2); }

/* ------------------------------------------------------------- the video */

/* This week's parasha. Only shown once Frank has uploaded one. */
.home-video { border-bottom: 1px solid var(--rule); }
.home-video .wrap { padding-block: var(--section-y); }
.home-video-body { max-width: 46rem; margin-top: 26px; }

/*
  The browser's own player, deliberately: its controls are the ones the visitor
  already knows from every other video on their phone, they work with a screen
  reader, and they cost nothing to load. The black is the letterbox a video
  sits in, in either theme, not a colour of the design.
*/
.home-video-player,
.page-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
}

.home-video .site-note { margin-top: 14px; }
.home-video .site-note:empty { display: none; }
.home-video-more { margin-top: 14px; font-size: 18px; }
.home-video-more a {
  display: inline-block;
  padding-block: 10px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* /archive: one article per week. */
.page-video { margin: 0 0 40px; }
.page-video h3 { margin: 0 0 4px; }
.page-prose .page-video-when { margin: 0 0 14px; color: var(--ink-2); font-size: 17px; }

/* -------------------------------------------------------------- joining */

.home-joining { border-top: 1px solid var(--rule); background: var(--tint-warm); }

.home-joining .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-block: var(--section-y);
}

.home-joining h2 { font-size: 28px; }
.home-joining p { margin-top: 16px; max-width: 46ch; font-size: 18px; color: var(--ink-2); }

.home-steps { display: grid; gap: 16px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: s; }

.home-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  font-size: 17px;
}

.home-steps li::before {
  counter-increment: s;
  content: counter(s);
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 600 17px/1 var(--sans);
}

/* ================================================ page: /about and /join */

/*
  Same chrome, same scale and rhythm as the front page. The measure is narrower
  because this is running prose rather than a schedule, but it sits in the same
  1120px wrap so the nav, the section rules and the footer line up across pages.
*/

.page-header { border-bottom: 1px solid var(--rule); }
.page-header .wrap { padding-block: var(--section-y) calc(var(--section-y) * 0.7); }
.page-header h1 { margin-top: 12px; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; }

.page-lede {
  margin-top: 22px;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.6;
}

.page-body > .wrap { padding-block: calc(var(--section-y) * 0.75) var(--section-y); }

.page-prose { max-width: 38rem; }
.page-prose h2 { margin: 44px 0 14px; font-size: clamp(24px, 2.4vw, 28px); }
.page-prose h2:first-child { margin-top: 0; }
.page-prose h3 { margin: 30px 0 10px; font-size: 22px; line-height: 1.3; }

/* The name in Hebrew inside a sentence: visibly larger than the English beside
   it, without prising the lines apart. */
.page-he-name { font-size: 1.6em; line-height: 1; vertical-align: -0.08em; }

/* Pointed Hebrew quoted in a sentence: at body size the nikud are a smudge. */
.page-he-inline { font-size: 1.45em; line-height: 1; vertical-align: -0.08em; }

/*
  /about is a run of short sections, each labelled in the margin the way the
  front page's are, with a rule between them. The label is the section's h2,
  set as an eyebrow.
*/
.page-section .wrap { padding-block: calc(var(--section-y) * 0.6); }
.page-section + .page-section { border-top: 1px solid var(--rule); }
.page-body > .page-section:last-child .wrap { padding-bottom: var(--section-y); }

.page-section-label {
  margin: 0 0 16px;
  font-family: var(--sans);
  line-height: 1.45;
  letter-spacing: var(--tracking-label);
}

.page-section-label::after {
  content: "";
  display: block;
  width: var(--head-rule-w);
  height: 2px;
  margin-top: 12px;
  background: var(--accent);
}

.page-section .page-prose > p:last-child { margin-bottom: 0; }

/*
  The FAQ. A warm band like the front page's name section, and each question a
  single line that opens to Frank's answer, so the ten of them read as a list
  before they read as a wall. The whole line is the tap target.
*/
.page-faq { background: var(--tint-warm); }

.page-faq-intro { color: var(--ink-2); }

.page-faq-list { margin-top: 8px; border-top: 1px solid var(--rule); }

.page-faq-item { border-bottom: 1px solid var(--rule); scroll-margin-top: 96px; }

.page-faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}

.page-faq-item > summary::-webkit-details-marker { display: none; }

.page-prose .page-faq-item h3 { margin: 0; font-size: 21px; line-height: 1.35; }

/* Open and closed are told apart by the sign, not by colour. */
.page-faq-item > summary::after {
  content: "+";
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: var(--btn-border-w) solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 400 24px/1 var(--sans);
}

.page-faq-item[open] > summary::after { content: "\2212"; }

.page-faq-item > summary:hover h3 { color: var(--accent); }

.page-faq-answer { padding: 0 56px 12px 0; }
.page-prose p { margin: 0 0 22px; font-size: 18px; }
.page-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/*
  `.page-prose a` outranks `.site-btn-join` on specificity, which painted the
  WhatsApp button accent-on-accent — blue text on a blue field, invisible. The
  button keeps its own colours inside prose. `npm run audit` caught this; it is
  exactly the kind of thing that survives a visual check because the button is
  still there, just unreadable.
*/
.page-prose a.site-btn-join {
  color: var(--on-accent);
  text-decoration: none;
  margin: 0 0 24px;
}
.page-prose .site-no-join { margin: 0 0 24px; }

.page-loading { margin: 0 0 22px; color: var(--ink-2); }

/* ==================================================================== 404 */

.page-404 .wrap { padding-block: 64px 72px; }
.page-404 h1 { font-size: clamp(32px, 4vw, 48px); }
.page-404 p { margin-top: 20px; max-width: 46ch; font-size: 20px; color: var(--ink-2); }
.page-404 .home-actions { margin-top: 32px; }


@media (min-width: 901px) {
  /*
    Three by two, not auto-fit. Once the label margin took 192px out of the
    content column, auto-fit put five cities on one row and left New York alone
    beside a slab of empty tint.
  */
  :root:not([data-theme="original"]) .home-citygrid { grid-template-columns: repeat(3, 1fr); }

  /*
    The week is a table, and seven days do not fit in a column that has had
    192px taken out of it — auto-fit put five on one row and two beside a grey
    slab. So the label keeps its margin, the heading keeps the content column,
    and the table alone spans the full measure. 1152 / 7 is 164px a day, which
    is enough for the time and the name stacked.
  */
}

/*
  The week as seven columns needs the full measure: below about 1,120px the
  columns cannot hold a time and a day name, and the table either pushed the
  page wider than the window or clipped the times. So seven columns from
  1,200px, and one day per row below that (see the next block).
*/
@media (min-width: 1200px) {
  :root:not([data-theme="original"]) .home-week .home-days {
    grid-column: 1 / -1;
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 1199px) {
  /*
    One day per row. Two or four columns left empty cells (seven days divide
    by neither) and made you read the week in a zig-zag. A single column is a
    timetable, which is what this is, and with the width to spare the time
    goes back beside the service name.
  */
  .home-days { grid-template-columns: 1fr; }
  .home-day li { grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: baseline; }
  .home-day li .why { grid-column: 2; }
}

/* ============================================ the label margin (refined only)

  Section labels move out of the content column and into a 192px margin of their
  own, with a hairline running the height of the section between the two. It is
  the device a printed prospectus uses, and it is what stops the page reading as
  a stack of blocks.

  Scoped to :root:not([data-theme="original"]) so that reverting the theme
  removes it entirely rather than approximately, and held above 900px because
  below that there is no margin to put anything in — the label goes back above
  its heading, which is the right answer on a phone anyway.
*/

@media (min-width: 901px) {
  :root:not([data-theme="original"]) .home-triad .wrap,
  :root:not([data-theme="original"]) .home-cities .wrap,
  :root:not([data-theme="original"]) .home-band .wrap,
  :root:not([data-theme="original"]) .home-week .wrap,
  :root:not([data-theme="original"]) .home-video .wrap,
  :root:not([data-theme="original"]) .page-header .wrap,
  :root:not([data-theme="original"]) .page-body > .wrap,
  :root:not([data-theme="original"]) .page-section .wrap {
    position: relative;
    display: grid;
    grid-template-columns: var(--label-col) minmax(0, 1fr);
    column-gap: var(--label-gap);
    align-items: start;
  }

  /* The hairline, run as a pseudo-element so it spans the whole section rather
     than only the head. */
  :root:not([data-theme="original"]) .home-triad .wrap::before,
  :root:not([data-theme="original"]) .home-cities .wrap::before,
  :root:not([data-theme="original"]) .home-band .wrap::before,
  :root:not([data-theme="original"]) .home-week .wrap::before,
  :root:not([data-theme="original"]) .home-video .wrap::before,
  :root:not([data-theme="original"]) .page-header .wrap::before,
  :root:not([data-theme="original"]) .page-section .wrap::before {
    content: "";
    position: absolute;
    top: var(--section-y);
    bottom: var(--section-y);
    left: calc(20px + var(--label-col) + (var(--label-gap) / 2));
    width: 1px;
    background: var(--rule);
  }

  /* Everything sits in the content column … */
  :root:not([data-theme="original"]) .home-triad .wrap > *,
  :root:not([data-theme="original"]) .home-cities .wrap > *,
  :root:not([data-theme="original"]) .home-band .wrap > *,
  :root:not([data-theme="original"]) .home-week .wrap > *,
  :root:not([data-theme="original"]) .home-video .wrap > *,
  :root:not([data-theme="original"]) .page-header .wrap > *,
  :root:not([data-theme="original"]) .page-body > .wrap > *,
  :root:not([data-theme="original"]) .page-section .wrap > * {
    grid-column: 2;
  }

  /* The sections are tighter than the front page's, so the hairline is too. */
  :root:not([data-theme="original"]) .page-section .wrap::before {
    top: calc(var(--section-y) * 0.6);
    bottom: calc(var(--section-y) * 0.6);
  }

  :root:not([data-theme="original"]) .page-section .wrap > .page-section-label {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0.35em;
  }

  /* … except the label, which is what this is all for. display:contents on the
     head promotes the eyebrow and the heading to grid items in their own right,
     so they can sit on one row in different columns. */
  :root:not([data-theme="original"]) .home-triad .site-section-head,
  :root:not([data-theme="original"]) .home-cities .site-section-head,
  :root:not([data-theme="original"]) .home-band .site-section-head,
  :root:not([data-theme="original"]) .home-week .site-section-head,
  :root:not([data-theme="original"]) .home-video .site-section-head,
  :root:not([data-theme="original"]) .page-header .site-section-head {
    display: contents;
  }

  :root:not([data-theme="original"]) .home-triad .site-section-head > .site-eyebrow,
  :root:not([data-theme="original"]) .home-cities .site-section-head > .site-eyebrow,
  :root:not([data-theme="original"]) .home-band .site-section-head > .site-eyebrow,
  :root:not([data-theme="original"]) .home-week .site-section-head > .site-eyebrow,
  :root:not([data-theme="original"]) .home-video .site-section-head > .site-eyebrow,
  :root:not([data-theme="original"]) .page-header > .wrap > .site-eyebrow {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0.55em;
  }

  :root:not([data-theme="original"]) .home-triad .site-section-head > h2,
  :root:not([data-theme="original"]) .home-cities .site-section-head > h2,
  :root:not([data-theme="original"]) .home-band .site-section-head > h2,
  :root:not([data-theme="original"]) .home-week .site-section-head > h2,
  :root:not([data-theme="original"]) .home-video .site-section-head > h2 {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  /* The reading pages put their eyebrow straight in the wrap, not in a head. */
  :root:not([data-theme="original"]) .page-header .wrap > h1 { grid-row: 1; }
}

/* ------------------------------------------------------- narrow screens */

@media (max-width: 900px) {
  .home-hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-block: 36px 40px; }

  /*
    On a phone the next service comes straight after the headline, above the
    rest of the copy. Somebody opening this at six in the morning wants the time
    and the button, not the pitch, and should not have to scroll past it.
  */
  .home-hero-text { display: contents; }
  .home-hero-lead { order: 1; }
  .home-next { order: 2; }
  .home-hero-body { order: 3; }
  .home-hero-body .home-who { margin-top: 0; }

  .home-trow { grid-template-columns: 1fr; }
  .home-svc { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .home-svc:not(:first-child) { padding-left: 0; }
  .home-svc:last-child { border-bottom: 0; }
  .home-gem { grid-template-columns: 1fr; }
  .home-verse { grid-template-columns: 1fr; gap: 20px; }
  .home-joining .wrap { grid-template-columns: 1fr; gap: 36px; }
}

/*
  The language switch, below 1000px. It does not fit beside the links, in
  French least of all, so it takes a row of its own above the logo, and the
  bar's negative `top` lets that row scroll away while the rest stays: the
  sticky part of the bar is no taller than it was before the switch. -48px is
  the wrap's top padding and the switch's 44px, less 4px so the logo row keeps
  a little air above it.
*/
@media (max-width: 1000px) {
  .site-nav:not(.admin-topbar):has(.site-lang) { top: -48px; }
  .site-nav:not(.admin-topbar) .wrap:has(.site-lang) { flex-wrap: wrap; row-gap: 0; }
  .site-nav .site-lang { order: -1; flex-basis: 100%; justify-content: flex-end; }
}

@media (max-width: 700px) {
  .site-nav .wrap { flex-wrap: wrap; row-gap: 2px; padding-block: 6px; }
  /* The logo keeps its own width, so the dark theme's plate fits the logo
     rather than running the width of the bar. The links still take the next
     row, because they are 100% wide. */
  .site-nav .brand { width: auto; min-height: 44px; }
  .site-navlinks { width: 100%; flex-wrap: wrap; gap: 2px; padding-bottom: 6px; }
  .site-navlinks a { padding: 10px 10px; font-size: 16px; }
  .site-navlinks a.cta { margin-left: auto; }

  /*
    Four links and the button do not fit on one row at phone width, and the bar
    is sticky, so a third row would sit over a fifth of the screen for good. The
    button goes up beside the logo instead, and the links have the row below to
    themselves. display:contents makes the links items of the bar itself, so
    they can be ordered around the line break. Not the admin bar, which has its
    own second row.
  */
  .site-nav:not(.admin-topbar) .wrap { justify-content: flex-start; column-gap: 2px; }
  .site-nav:not(.admin-topbar) .site-navlinks { display: contents; }
  .site-nav:not(.admin-topbar) .site-navlinks a.cta { order: 1; }
  .site-nav:not(.admin-topbar) .wrap::after { content: ""; order: 2; flex-basis: 100%; }
  .site-nav:not(.admin-topbar) .site-navlinks a:not(.cta) { order: 3; margin-bottom: 6px; }


  /* French labels are longer: four of them have to fit one row at 375px. */
  html[lang="fr"] .site-nav:not(.admin-topbar) .site-navlinks a:not(.cta) { padding-inline: 8px; }
  .home-word .w { font-size: 58px; }
  .site-logo { height: 44px; }
  .home-verse .he { font-size: 28px; }
  .home-band .wrap { padding-block: 44px; }
  .page-header .wrap { padding-block: 32px 30px; }
  .page-body > .wrap { padding-block: 32px 40px; }
  .page-section .wrap { padding-block: 32px; }
}

/* The same two French rows on a 360px Android phone, the narrowest common width. */
@media (max-width: 380px) {
  html[lang="fr"] .site-nav:not(.admin-topbar) .site-navlinks a:not(.cta) { padding-inline: 6px; }
  html[lang="fr"] .site-nav:not(.admin-topbar) .site-navlinks a.cta { padding-inline: 10px; }
}
