/* Layout: one missal-like reading column. Verse numbers sit in a narrow red margin;
   each reading closes with a blue Notes panel. The season color tints the accent. */
:root {
  --bg: #fbfcf9;
  --surface: #ffffff;
  --fg: #1d2420;
  --muted: #5d6b63;
  --line: #dfe5df;
  --rubric: #a3271f;            /* missal red: headings, verse numbers */
  --note: #1f4e8c;              /* deep blue: notes */
  --note-bg: #eef3fa;
  --season: #1f5c3f;            /* liturgical color, set per page below */
  --season-soft: #e6f0ea;
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
[data-season="advent"], [data-season="lent"] { --season: #5b3a8c; --season-soft: #efe9f7; }
[data-season="christmas"], [data-season="easter"] { --season: #9a6b12; --season-soft: #f7efdc; }
[data-season="red"] { --season: #a3271f; --season-soft: #f8e7e5; }
[data-season="rose"] { --season: #b0457a; --season-soft: #f8e6ef; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714; --surface: #18201b; --fg: #e5ece7; --muted: #9db0a5; --line: #2b362f;
    --rubric: #f08a7e; --note: #9dbfee; --note-bg: #17202c; --season: #7cc49e; --season-soft: #1d2d24;
    color-scheme: dark;
  }
  [data-season="advent"], [data-season="lent"] { --season: #b8a0e0; --season-soft: #241d30; }
  [data-season="christmas"], [data-season="easter"] { --season: #e0b45c; --season-soft: #2b2416; }
  [data-season="red"] { --season: #f08a7e; --season-soft: #2e1b19; }
  [data-season="rose"] { --season: #ec9cc3; --season-soft: #2e1b25; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* our display rules (e.g. .celebration grid) must not unhide tabs */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--body); }
a { color: var(--season); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--season); outline-offset: 2px; border-radius: 4px; }

/* Language switch: show only the chosen language's spans */
html[data-lang="en"] .tl, html[data-lang="tl"] .en { display: none !important; }

.top { border-bottom: 1px solid var(--line); }
.top-inner, main, .foot { max-width: 780px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--fg); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 44px; }
.lang { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 99px; gap: 2px; }
.lang button { font: 600 14px var(--body); border: 0; background: none; color: var(--muted); padding: 5px 12px; min-height: 44px; border-radius: 99px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--season); color: var(--bg); }

main { padding-block: 32px 48px; display: grid; gap: 40px; }
.eyebrow { margin: 0 0 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--season); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--season); display: inline-block; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.12; margin: 0; text-wrap: balance; }
.lede { color: var(--muted); max-width: 62ch; margin: 14px 0 0; font-size: 18px; }

/* Home */
.list h2 { font-family: var(--display); font-size: 24px; margin: 0 0 12px; }
.sundays { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.sundays li a { display: grid; grid-template-columns: 11em 1fr; gap: 2px 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.sundays li a:hover .row-title { color: var(--season); }
.row-date { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: span 2; }
.row-title { font-family: var(--display); font-weight: 700; font-size: 19px; }
.row-cites { color: var(--muted); font-size: 14px; }
.sundays li.is-next .row-date { color: var(--season); font-weight: 700; }
.sundays li.is-next a { background: var(--season-soft); }
.sub { font-family: var(--display); font-size: 20px; margin: 20px 0 6px; }
.foot .looks { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
.pn { display: flex; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
[data-theme="bulletin"] .actions { justify-content: center; }
.pager a { display: grid; align-content: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.pager [rel=next] { text-align: right; }
.pager small { font-weight: 400; color: var(--muted); font-size: 14px; }
.sunday > .pager.top { margin-bottom: -24px; }
.pager.top a { display: block; line-height: 44px; }
.row-date { display: flex; align-items: baseline; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { font: 700 16px var(--body); color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; padding: 10px 14px 8px; display: grid; gap: 0; white-space: nowrap; }
.tabs a small { font-weight: 400; font-size: 13px; }
.tabs a[aria-current] { color: var(--fg); border-bottom-color: var(--season); }
.season-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.season-tabs a, .season-tabs .off { min-height: 44px; font: 600 14px var(--body); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.season-tabs .off { color: var(--muted); background: none; border-style: dashed; }
.season-tabs a small { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.season-tabs [aria-current] { border-color: var(--season); box-shadow: inset 0 0 0 1px var(--season); }
.list-title { font-size: clamp(26px, 5vw, 36px); }
.row-alt { grid-column: 2; font-size: 14px; color: var(--muted); font-style: italic; }
@media (max-width: 560px) { .row-alt { grid-column: auto; } }
.variant-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-tabs button { min-height: 44px; font: 600 15px var(--body); padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.variant-tabs button[aria-selected="true"] { border-color: var(--season); color: var(--fg); box-shadow: inset 0 0 0 1px var(--season); }
.celebration { display: block; } /* block, not grid: a sticky grid item could not leave its row */
.celebration > * + * { margin-top: 40px; }
.celebration > .jump { margin-top: 8px; }
.celebration + .celebration { margin-top: 24px; }
.has-variants .celebration + .celebration { margin-top: 0; }
.about { margin: 0; color: var(--muted); max-width: 62ch; }
.empty { color: var(--muted); padding: 18px 4px; margin: 0; }
.featured .featured-list { border: 0; }
.featured .card a { border: 1px solid var(--line); border-left: 4px solid var(--season); border-radius: 0 10px 10px 0; background: var(--surface); padding: 18px; }
@media (max-width: 560px) { .sundays li a { grid-template-columns: 1fr; } .row-date { grid-row: auto; } }

/* Sunday page */
.sunday { display: grid; gap: 40px; }
.sunday-head { display: grid; gap: 10px; padding-bottom: 20px; border-bottom: 2px solid var(--fg); }
.meta { margin: 0; color: var(--muted); font-size: 15px; }
.jump { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; display: flex; gap: 8px; padding-block: 8px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--line); }
.jump a, .print { flex: none; display: inline-flex; align-items: center; justify-self: start; min-height: 44px; font: 600 14px var(--body); padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; cursor: pointer; }
.jump a:hover { border-color: var(--season); color: var(--season); }

.reading { display: grid; gap: 14px; scroll-margin-top: 72px; }
.verse, .note { scroll-margin-top: 80px; }
.verse:target, .note:target { background: var(--season-soft); }
.reading h2 { margin: 0; font-family: var(--display); font-size: 26px; color: var(--rubric); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.reading h2 .cite { font-weight: 500; font-style: italic; font-size: 19px; color: var(--muted); }
.links { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.verses { display: grid; }
.verse { display: grid; grid-template-columns: 2.6em 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.verse:last-child { border-bottom: 0; }
.vnum { color: var(--rubric); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; padding-top: 3px; }
.vbody { min-width: 0; }
.vtext { margin: 0 0 8px; font-family: var(--display); font-size: 20px; line-height: 1.5; }
.q { margin: 0; padding-left: 1.2em; display: grid; gap: 2px; }
.q li::marker { color: var(--season); }

.notes { background: var(--note-bg); border-left: 3px solid var(--note); border-radius: 0 10px 10px 0; padding: 16px 18px; display: grid; gap: 8px; color: var(--note); }
.notes h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.note { display: grid; grid-template-columns: 2.6em 1fr; gap: 12px; font-size: 15px; }
.note > a { text-align: right; font-weight: 700; color: inherit; font-variant-numeric: tabular-nums; text-decoration: underline dotted; }
.vnum a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
@media (pointer: coarse) { .vnum a, .note > a { display: block; min-height: 44px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.note span { font-style: italic; min-width: 0; }
.back { margin: 0; }

.foot { padding-block: 20px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }


/* Header switches (look + language) */
@media (max-width: 480px) { .lang button { padding: 5px 9px; font-size: 13px; } }

/* ---------- Parish bulletin look ----------
   Printed-handout feel: warm paper, one serif throughout, ruled masthead,
   and on wide screens verse text on the left with its questions on the right. */
[data-theme="bulletin"] {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --fg: #1b1a17;
  --muted: #5f5a50;
  --line: #d9d2c3;
  --rubric: #1b1a17;
  --note: #1f4e8c;
  --note-bg: #fffdf8;
  --body: "Alegreya", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  [data-theme="bulletin"] { --bg: #1b1a17; --surface: #23211d; --fg: #ece6da; --muted: #b3ab9b; --line: #3a362f; --rubric: #ece6da; --note: #9dbfee; --note-bg: #23211d; }
}
[data-theme="bulletin"] body { font-size: 18px; }
[data-theme="bulletin"] .top { border-bottom: 3px double var(--fg); }
[data-theme="bulletin"] .brand { font-variant: small-caps; letter-spacing: .06em; font-size: 22px; }
[data-theme="bulletin"] .lang { border-radius: 2px; border-color: var(--fg); }
[data-theme="bulletin"] .lang button { border-radius: 2px; font-family: var(--body); }
[data-theme="bulletin"] .lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
[data-theme="bulletin"] .top-inner, [data-theme="bulletin"] main, [data-theme="bulletin"] .foot { max-width: 1020px; }
[data-theme="bulletin"] .eyebrow { color: var(--muted); letter-spacing: .18em; }
[data-theme="bulletin"] .dot { border-radius: 0; transform: rotate(45deg); width: 8px; height: 8px; }
[data-theme="bulletin"] h1 { text-align: center; font-weight: 500; }
[data-theme="bulletin"] .hero, [data-theme="bulletin"] .sunday-head { text-align: center; justify-items: center; }
[data-theme="bulletin"] .lede, [data-theme="bulletin"] .about { margin-inline: auto; }
[data-theme="bulletin"] .sunday-head { border-bottom: 3px double var(--fg); }
[data-theme="bulletin"] .jump { justify-content: safe center; }
[data-theme="bulletin"] .jump a, [data-theme="bulletin"] .print,
[data-theme="bulletin"] .season-tabs a, [data-theme="bulletin"] .season-tabs .off, [data-theme="bulletin"] .variant-tabs button { border-radius: 2px; font-family: var(--body); }
[data-theme="bulletin"] .reading h2 { justify-content: center; text-align: center; font-variant: small-caps; letter-spacing: .04em; border-block: 1px solid var(--fg); padding-block: 6px; }
[data-theme="bulletin"] .links { text-align: center; }
[data-theme="bulletin"] .notes { border: 1px solid var(--note); border-radius: 2px; }
[data-theme="bulletin"] .featured .card a { border-radius: 2px; border-left-width: 1px; border-color: var(--fg); }
@media (min-width: 820px) {
  [data-theme="bulletin"] .verse { grid-template-columns: 2.6em minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 24px; }
  [data-theme="bulletin"] .vbody { display: contents; }
  [data-theme="bulletin"] .vtext { margin: 0; }
  [data-theme="bulletin"] .q { border-left: 1px solid var(--line); padding-left: 1.6em; align-self: start; }
  [data-theme="bulletin"] .notes { columns: 2; column-gap: 32px; display: block; }
  [data-theme="bulletin"] .notes h3 { column-span: all; margin-bottom: 8px; }
  [data-theme="bulletin"] .note { break-inside: avoid; margin-bottom: 8px; }
}

/* Print last, so paper colors beat the dark and Bulletin tokens above. */
@media print {
  :root, [data-theme="bulletin"], [data-season] {
    --bg: #fff; --surface: #fff; --fg: #000; --muted: #444; --line: #bbb;
    --rubric: #8a1f18; --note: #1f4e8c; --note-bg: #fff; --season: #1f5c3f; --season-soft: #fff;
    color-scheme: light;
  }
  body, [data-theme] body { font-size: 11.5pt; background: #fff; }
  .top, .jump, .back, .foot, .links, .pager, .print, .variant-tabs { display: none !important; }
  main { padding: 0; gap: 18pt; max-width: none; }
  h1 { font-size: 22pt; }
  .vtext { font-size: 12.5pt; }
  .vnum a, .note > a { text-decoration: none; }
  .verse { break-inside: avoid; padding: 6pt 0; }
  .notes { break-inside: avoid-page; border: 1px solid #1f4e8c; }
  .reading { break-before: page; }
  .reading:first-of-type { break-before: auto; }
}
