/* Haight Creek Monthly — reader styles.
   Three voices on purpose: serif for what is meant to be read slowly,
   sans for logistics, mono for anything with a number in it. */

:root{
  --paper:#F3F5F2;
  --surface:#FFFFFF;
  --surface-2:#EBEEE9;
  --ink:#16201D;
  --ink-2:#3A4642;
  --muted:#69756F;
  --line:#DCE2DC;
  --line-strong:#C3CCC4;
  --accent:#1E5F57;
  --accent-soft:#DCEAE6;
  --brass:#96682A;
  --brass-soft:#F0E4CF;
  --shadow:0 1px 2px rgba(22,32,29,.05);

  --f-display:"Newsreader",Georgia,"Times New Roman",serif;
  --f-body:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;

  --measure:34rem;
  --pad:1.25rem;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:#0E1412; --surface:#151D1A; --surface-2:#1C2623;
    --ink:#E9EEEB; --ink-2:#C3CDC8; --muted:#8B9893;
    --line:#26312D; --line-strong:#374440;
    --accent:#74C4B6; --accent-soft:#1B322D;
    --brass:#D6A85E; --brass-soft:#2E2617;
    --shadow:0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"]{
  --paper:#0E1412; --surface:#151D1A; --surface-2:#1C2623;
  --ink:#E9EEEB; --ink-2:#C3CDC8; --muted:#8B9893;
  --line:#26312D; --line-strong:#374440;
  --accent:#74C4B6; --accent-soft:#1B322D;
  --brass:#D6A85E; --brass-soft:#2E2617;
  --shadow:0 1px 2px rgba(0,0,0,.4);
}

*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:var(--f-body);font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-underline-offset:.18em;text-decoration-thickness:.06em;}
a:focus-visible,summary:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px;}
h1,h2,h3{text-wrap:balance;margin:0;}

#progress{position:fixed;top:0;left:0;height:2px;width:0;background:var(--accent);z-index:60;transition:width .08s linear;}
.wrap{max-width:calc(var(--measure) + 2*var(--pad));margin:0 auto;padding:0 var(--pad);}

/* masthead */
.masthead{background:var(--surface);border-bottom:1px solid var(--line);padding:2.25rem 0 1.5rem;}
.masthead .wrap{display:flex;flex-direction:column;gap:.9rem;}
.unit{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:0;}
.wordmark{font-family:var(--f-display);font-weight:500;font-size:clamp(2.1rem,9vw,2.9rem);line-height:1.02;letter-spacing:-.02em;}
.wordmark em{font-style:italic;color:var(--accent);}
.wordmark a{color:inherit;text-decoration:none;}
.issue-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem .85rem;font-family:var(--f-mono);font-size:.75rem;color:var(--muted);padding-top:.35rem;border-top:1px solid var(--line);}
.issue-row .no{color:var(--ink-2);font-weight:500;}
/* The issue's name doubles as the way to reach the others. */
select.pick{
  font-family:var(--f-mono);font-size:.75rem;color:var(--ink-2);font-weight:500;
  background:transparent;border:0;border-bottom:1px dotted var(--line-strong);
  padding:0 1rem 1px 0;cursor:pointer;appearance:none;-webkit-appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 5px) 60%,calc(100% - 1px) 60%;
  background-size:4px 4px,4px 4px;background-repeat:no-repeat;
}
select.pick:hover{color:var(--accent);}
.dot{width:3px;height:3px;border-radius:50%;background:var(--line-strong);display:inline-block;}

.modes{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;padding:.85rem 0 0;}
.modes .label{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);}
/* Deliberately the same shape as the pills in the rail below — it is one of
   them, lifted out so the summary is always one press away. Filling it in made
   it read as the current section, which it is not. */
.mode-btn{
  font-size:.813rem;padding:.34rem .8rem;border-radius:999px;cursor:pointer;
  font-family:inherit;text-decoration:none;display:inline-block;white-space:nowrap;
  background:var(--surface);border:1px solid var(--line-strong);color:var(--ink-2);
}
.mode-btn:hover{color:var(--accent);border-color:var(--accent);}
/* The long-page escape hatch. A link, not a button: most people never want it. */
.flat{
  font-family:inherit;font-size:.813rem;background:none;border:0;padding:.4rem 0;cursor:pointer;
  color:var(--muted);text-decoration:underline;text-underline-offset:.2em;text-decoration-thickness:.06em;
}
.flat:hover{color:var(--accent);}

/* jump nav */
nav.jump{position:sticky;top:0;z-index:50;background:color-mix(in srgb,var(--paper) 88%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);}
nav.jump ul{display:flex;gap:.4rem;list-style:none;padding:.6rem var(--pad);overflow-x:auto;scrollbar-width:none;max-width:calc(var(--measure) + 2*var(--pad));margin:0 auto;}
nav.jump ul::-webkit-scrollbar{display:none;}
nav.jump a{display:block;white-space:nowrap;text-decoration:none;font-size:.813rem;color:var(--muted);padding:.3rem .7rem;border-radius:999px;border:1px solid transparent;}
nav.jump a.current{color:var(--ink);background:var(--surface);border-color:var(--line-strong);}

/* at a glance */
.glance{padding:1.75rem 0 .5rem;}
.eyebrow{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin:0 0 .55rem;font-weight:500;}
.glance h2{font-family:var(--f-display);font-size:1.45rem;font-weight:500;margin-bottom:.9rem;}
ol.dates{list-style:none;margin:0;padding:0;}
ol.dates li{display:grid;grid-template-columns:5.1rem 1fr;gap:.85rem;padding:.7rem 0;border-top:1px solid var(--line);align-items:baseline;}
ol.dates li:last-child{border-bottom:1px solid var(--line);}
ol.dates .d{font-family:var(--f-mono);font-size:.75rem;font-variant-numeric:tabular-nums;color:var(--brass);}
ol.dates .t{font-size:.938rem;color:var(--ink-2);}
ol.dates a{color:inherit;text-decoration:none;border-bottom:1px solid var(--line-strong);}
ol.dates a:hover{border-color:var(--accent);color:var(--accent);}
ol.dates .where{color:var(--muted);font-size:.813rem;}

/* sections */
section.sec{padding:2.25rem 0 1.9rem;border-top:1px solid var(--line);scroll-margin-top:3.6rem;}
section.sec h2{font-family:var(--f-display);font-weight:500;font-size:clamp(1.5rem,5.5vw,1.85rem);line-height:1.18;letter-spacing:-.01em;}
.byline{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.11em;text-transform:uppercase;color:var(--muted);margin:.5rem 0 0;}
.lede{font-family:var(--f-display);font-size:1.125rem;line-height:1.55;color:var(--ink-2);margin:.95rem 0 0;}
/* Two separate things in one section. The previous editor drew this rule by
   hand in InDesign for exactly this reason: without it a member reads the
   second message as a continuation of the first. */
hr.between{border:0;border-top:1px solid var(--line);margin:2.25rem 0 0;}
.attach{margin:1.1rem 0 0;font-family:var(--f-body);}
.attach .ext{font-family:var(--f-mono);font-size:.625rem;letter-spacing:.1em;color:var(--muted);border:1px solid var(--line);border-radius:2px;padding:.1rem .3rem;margin-left:.35rem;vertical-align:.08em;}
.sec h3{font-family:var(--f-display);font-size:1.25rem;line-height:1.25;margin:1.5rem 0 0;letter-spacing:-.01em;}
hr.between + h3{margin-top:1.75rem;}
.meta{font-size:.875rem;color:var(--muted);margin-top:.45rem;}
.prose{font-family:var(--f-display);font-size:1.0625rem;line-height:1.68;color:var(--ink-2);}
.prose p{margin:.9rem 0 0;}
.prose p:first-child{margin-top:0;}
blockquote{margin:1.1rem 0 0;padding:0 0 0 1rem;border-left:2px solid var(--accent);font-family:var(--f-display);font-style:italic;color:var(--ink-2);}

details{margin-top:1.1rem;}
details>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:.45rem;font-family:var(--f-mono);font-size:.75rem;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);padding:.35rem 0;}
details>summary::-webkit-details-marker{display:none;}
details>summary::after{content:"";width:.4rem;height:.4rem;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform .18s ease;}
details[open]>summary::after{transform:translateY(1px) rotate(-135deg);}
details>.body{padding-top:.6rem;}

/* people — the monogram is the no-consent state, same cell either way */
.people{display:grid;grid-template-columns:repeat(auto-fill,minmax(8.5rem,1fr));gap:.75rem;margin:1.15rem 0 1.5rem;}
.person{background:var(--surface);border:1px solid var(--line);padding:0 0 .9rem;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:.4rem;overflow:hidden;}
.person>*:not(.face){margin-left:.85rem;margin-right:.85rem;}
/* A face at 2.4rem was a thumbnail. These are people the reader knows — give
   them the same square the printed newsletter always gave them. The monogram
   fills exactly the same square, so a pending consent still leaves no hole. */
.face{width:100%;aspect-ratio:1/1;display:grid;place-items:center;font-family:var(--f-mono);font-size:1.75rem;font-weight:500;background:var(--accent-soft);color:var(--accent);overflow:hidden;}
.person .nm{margin-top:.35rem;}
.person.home .face{background:var(--brass-soft);color:var(--brass);}
.face img{width:100%;height:100%;object-fit:cover;display:block;}
.person .nm{font-weight:600;font-size:.938rem;line-height:1.25;}
.person .ms{font-size:.813rem;color:var(--ink-2);line-height:1.4;}
.person .wd{font-size:.75rem;color:var(--muted);}
.tag{align-self:flex-start;margin-top:.15rem;font-family:var(--f-mono);font-size:.625rem;letter-spacing:.1em;text-transform:uppercase;padding:.2rem .45rem;border:1px solid var(--line-strong);color:var(--muted);}
.tag.go{color:var(--accent);border-color:var(--accent);}
.tag.home{color:var(--brass);border-color:var(--brass);}

/* blocks a section can be built from */

/* A flyer or a drawing, sized to the column rather than to a face. */
figure.shot{margin:1.3rem 0 0;}
figure.shot img{display:block;width:100%;height:auto;border:1px solid var(--line);background:var(--surface);}
figure.shot figcaption{margin-top:.45rem;font-size:.813rem;color:var(--muted);}

/* "Sign Up", "Start the Challenge" — a link that was always meant to be a
   button, rather than a URL sitting in the middle of a sentence. */
p.cta{margin:1.2rem 0 0;}
p.cta a{
  display:inline-block;text-decoration:none;font-weight:500;font-size:.938rem;
  padding:.6rem 1.2rem;border-radius:999px;
  background:var(--accent);color:var(--paper);border:1px solid var(--accent);
}
p.cta a:hover{filter:brightness(1.08);}

/* Baptisms; a presidency coming in and going out. Names and a small note. */
.namelist{margin-top:1.3rem;}
.namelist h3{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);font-weight:500;margin:0 0 .5rem;}
.namelist ul{list-style:none;margin:0;padding:0;}
.namelist li{display:flex;gap:.6rem;align-items:baseline;padding:.45rem 0;border-top:1px solid var(--line);}
.namelist li:last-child{border-bottom:1px solid var(--line);}
.namelist .n{font-size:.938rem;color:var(--ink-2);}
.namelist .w{font-family:var(--f-mono);font-size:.75rem;color:var(--muted);}

/* Save the Date, and anything else that should not be read past. */
aside.callout{margin-top:1.3rem;padding:1rem 1.1rem;border:1px solid var(--brass);background:var(--brass-soft);}
aside.callout .eyebrow{color:var(--brass);}
aside.callout p{margin:.5rem 0 0;font-size:.938rem;line-height:1.6;color:var(--ink-2);}
aside.callout p:first-of-type{margin-top:0;}

/* calendar + reading */
.scroller{overflow-x:auto;}
table.cal{width:100%;border-collapse:collapse;margin-top:1rem;font-size:.938rem;}
table.cal td{padding:.6rem 0;border-top:1px solid var(--line);vertical-align:baseline;}
table.cal tr:last-child td{border-bottom:1px solid var(--line);}
table.cal td.date{font-family:var(--f-mono);font-size:.75rem;color:var(--brass);font-variant-numeric:tabular-nums;width:4.6rem;white-space:nowrap;}
table.cal td.time{font-family:var(--f-mono);font-size:.75rem;color:var(--muted);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}

ul.cfm{list-style:none;margin:1rem 0 0;padding:0;}
ul.cfm li{display:grid;grid-template-columns:8.5rem 1fr;gap:.75rem;padding:.55rem 0;border-top:1px solid var(--line);align-items:baseline;}
ul.cfm li:last-child{border-bottom:1px solid var(--line);}
ul.cfm .wk{font-family:var(--f-mono);font-size:.75rem;color:var(--muted);font-variant-numeric:tabular-nums;}

.hymn{text-align:center;padding:2.5rem var(--pad);border-top:1px solid var(--line);}
.hymn q{font-family:var(--f-display);font-style:italic;font-size:1.25rem;line-height:1.5;color:var(--accent);quotes:none;}
.hymn .src{display:block;margin-top:.8rem;font-family:var(--f-mono);font-size:.688rem;letter-spacing:.11em;text-transform:uppercase;color:var(--muted);}

footer{border-top:1px solid var(--line);background:var(--surface-2);padding:1.9rem 0 2.6rem;}
footer p{font-size:.813rem;color:var(--muted);margin:.55rem 0 0;line-height:1.55;}
footer p:first-child{margin-top:0;}
footer .sig{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.11em;text-transform:uppercase;color:var(--ink-2);}
footer a{color:var(--muted);}

/* archive */
.archive{padding:1.75rem 0;}
.archive h2{font-family:var(--f-display);font-weight:500;font-size:1.45rem;margin-bottom:.9rem;}
ul.issues{list-style:none;margin:0;padding:0;}
ul.issues li{border-top:1px solid var(--line);}
ul.issues li:last-child{border-bottom:1px solid var(--line);}
ul.issues a{display:flex;justify-content:space-between;gap:1rem;padding:.85rem 0;text-decoration:none;color:var(--ink);align-items:baseline;}
ul.issues a:hover{color:var(--accent);}
ul.issues .n{font-family:var(--f-mono);font-size:.75rem;color:var(--muted);}

/* ------------------------------------------------------------ one at a time
   The home screen lists what is in the issue; choosing a section shows that
   section alone. Without JavaScript none of this applies and the whole issue
   renders as one document, which is the honest fallback. */
[hidden]{display:none !important;}

.contents{padding:1.6rem 0 .25rem;}
.contents .eyebrow{color:var(--muted);}
ul.toc{list-style:none;margin:0;padding:0;}
ul.toc li{border-top:1px solid var(--line);}
ul.toc li:last-child{border-bottom:1px solid var(--line);}
ul.toc a{
  display:grid;grid-template-columns:1fr .55rem;grid-template-areas:"k c" "v c";
  gap:.22rem 1rem;align-items:center;padding:.85rem 0;
  text-decoration:none;color:inherit;
}
ul.toc .k{grid-area:k;font-family:var(--f-mono);font-size:.688rem;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);}
ul.toc .v{grid-area:v;font-family:var(--f-display);font-size:1.0625rem;line-height:1.45;color:var(--ink-2);}
ul.toc a::after{
  content:"";grid-area:c;justify-self:end;width:.45rem;height:.45rem;
  border-right:1.5px solid var(--line-strong);border-bottom:1.5px solid var(--line-strong);
  transform:rotate(-45deg);
}
ul.toc a:hover .v,ul.toc a:focus-visible .v{color:var(--accent);}
ul.toc a:hover::after{border-color:var(--accent);}

/* walking the issue without going back up to the pills */
.pager{display:flex;align-items:flex-start;gap:1rem;margin-top:2.4rem;padding-top:1.1rem;border-top:1px solid var(--line);}
.step{display:flex;flex-direction:column;gap:.15rem;text-decoration:none;max-width:47%;}
.step.gap{visibility:hidden;}
.step.next{margin-left:auto;text-align:right;}
.step .w{font-family:var(--f-mono);font-size:.688rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);}
.step .n{font-size:.938rem;font-weight:500;line-height:1.3;color:var(--accent);}

body.focus section.sec{border-top:0;padding-top:1.5rem;}
body.focus .glance{padding-top:1.6rem;}

/* ------------------------------------------------------------------- print

   The PDF export, without a PDF library. Every browser can already print to
   PDF, and a print stylesheet keeps that working in ten years with nothing
   installed — which is the same reason nothing else here has a dependency.

   The reading mode hides every section but one. Printing wants all of them, so
   the panels are forced back regardless of what is on screen. */
@media print {
  /* Zero page margins are what stops the browser printing its own header and
     footer — the URL and the date it was printed, which have no business on a
     newsletter. The margins come back as padding instead, and because each
     section already starts its own page, every page gets them. */
  @page { margin: 0; }

  html, body { background: #fff !important; color: #111 !important; font-size: 11pt; }

  /* Screen furniture: none of it means anything on paper. */
  #progress, nav.jump, .modes, .pager, .issue-row a, footer a { display: none !important; }

  [data-panel][hidden] { display: block !important; }

  .wrap { max-width: none; padding: 0 14mm; }
  .masthead { border-bottom: 1.5pt solid #111; padding: 14mm 0 8pt; }
  .wordmark { font-size: 26pt; }
  .wordmark em { color: inherit; }

  /* Each organization starts its own page, the way the printed issue read. */
  section.sec { break-before: page; border-top: 0; padding: 14mm 0; }
  .home { break-before: auto; padding-bottom: 10mm; }
  section.sec:first-of-type { break-before: auto; }

  h2, .lede, .eyebrow { break-after: avoid; }
  .person, ol.dates li, ul.cfm li, table.cal tr { break-inside: avoid; }

  .glance, .contents { break-inside: avoid; }
  .people { grid-template-columns: repeat(4, 1fr); }
  .face { font-size: 14pt; }

  .prose, .lede { color: #111; }
  .eyebrow, ol.dates .d, table.cal td.date { color: #555; }

  /* A printed page cannot be tapped, so say where a link went. */
  .prose a[href^="http"]::after,
  .meta a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }

  .hymn { break-inside: avoid; border-top: .5pt solid #999; }
  footer { border-top: .5pt solid #999; background: none; padding: 8pt 0 14mm; }
  select.pick { appearance: none; border: 0; background: none; padding: 0; }
  footer p { color: #444; font-size: 8.5pt; }
}

@media (prefers-reduced-motion: reduce){
  *{transition-duration:.01ms !important;animation-duration:.01ms !important;}
  html{scroll-behavior:auto;}
}

/* The two looks, offered side by side so neither is a trap. */
.looks{display:inline-flex;gap:.35rem;align-items:center;}
.looks a{font-family:var(--f-mono);font-size:.625rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);text-decoration:none;border:1px solid var(--line);border-radius:999px;padding:.3rem .6rem;}
.looks a:hover,.looks a:focus-visible{border-color:var(--accent);color:var(--accent);}
