/* Lakewood Shiurim — a weekly bulletin, set for the phone. */
:root {
  --paper: #fbf7ee;
  --paper-2: #f3ebda;
  --paper-3: #ece1c8;
  --ink: #14213d;
  --ink-2: #33405a;
  --muted: #5b6475;
  --rule: #dccfb0;
  --gold: #b48a3c;        /* decorative only */
  --gold-text: #7a5718;   /* gold for text on paper (AA) */
  --gold-on-ink: #d8b46a; /* gold for text on navy (AA) */
  --serif: "Cormorant Garamond", "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --serif-he: "Frank Ruhl Libre", "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", "Assistant", -apple-system, "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  --wrap: 44rem;
  --nav-h: 4.25rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
[lang="he"], [dir="rtl"] { font-family: var(--sans); }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 .75em; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 36rem; }
.visually-hidden, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-js .js-only { display: none !important; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 50; border-radius: 6px; }
.skip:focus { left: .5rem; }

/* Masthead */
.masthead {
  background: var(--ink); color: var(--paper); text-align: center;
  padding: calc(2.25rem + env(safe-area-inset-top)) 0 1.75rem;
  border-bottom: 3px double var(--gold);
}
.kicker {
  font: 600 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-on-ink); margin-bottom: .9rem;
}
.masthead h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: .01em;
  font-size: clamp(2.6rem, 11vw, 3.9rem); line-height: 1.02;
}
.rule { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: .9rem auto .8rem; width: 11rem; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--gold); opacity: .8; }
.rule span { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold-on-ink); }
.tagline { font: 500 1.3rem/1.35 var(--serif); color: #eae3d2; margin: 0 auto .5rem; max-width: 22rem; }
.dateline { font-size: .9rem; color: #c9c4b6; margin: 0; min-height: 1.4em; }
.dateline [lang="he"] { color: var(--gold-on-ink); }

/* Day navigation */
.daynav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 247, 238, .96); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top);
}
.daynav-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.55fr) minmax(0, 1.2fr);
  gap: 2px; padding-top: .45rem; padding-bottom: .45rem; padding-left: .5rem; padding-right: .5rem;
}
.daynav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 3.25rem; border-radius: 8px; text-decoration: none; color: var(--ink-2);
  font: 600 .95rem/1.1 var(--sans);
}
.daynav a .dh { font: 500 .78rem/1.2 var(--serif-he); color: var(--muted); margin-top: .15rem; }
.daynav a:hover { background: var(--paper-2); }
.daynav a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.daynav a[aria-current="true"] .dh { color: var(--gold-on-ink); }
.daynav a.is-today::after {
  content: ""; position: absolute; top: .32rem; right: .32rem; width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.daynav a.nav-week { border-left: 1px solid var(--rule); border-radius: 0 8px 8px 0; }
.daynav a.nav-week[aria-current="true"] { border-left-color: transparent; border-radius: 8px; }

/* Toolbar */
.toolbar { display: flex; gap: .6rem; align-items: center; padding-top: 1.1rem; }
.search {
  flex: 1; display: flex; align-items: center; gap: .5rem; min-height: 2.9rem;
  background: #fff; border: 1px solid var(--rule); border-radius: 999px; padding: 0 1rem; color: var(--muted);
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(180, 138, 60, .2); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); padding: .55rem 0; }
.search input::placeholder { color: #7c8392; }
.saved-btn {
  min-height: 2.9rem; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--rule); background: #fff;
  font: 600 .95rem var(--sans); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.saved-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Day sections */
#listings { padding-top: .5rem; padding-bottom: 1rem; }
.day { padding-top: 1.4rem; }
.day + .day { margin-top: .75rem; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 2px solid var(--ink); }
.day-head h2 { font: 600 1.95rem/1.1 var(--serif); }
.today-tag {
  display: inline-block; vertical-align: middle; margin-left: .4rem; transform: translateY(-.15em);
  font: 700 .68rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-text); border: 1px solid var(--gold); border-radius: 999px; padding: .32rem .55rem .28rem;
}
.day-meta { margin: 0; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.day-meta [lang="he"] { font-family: var(--serif-he); font-size: 1.05em; color: var(--gold-text); }
.day-meta .dot { color: var(--gold); }

/* Listing */
.shiur {
  display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); column-gap: 1rem;
  padding: 1.15rem 0 1.1rem; border-bottom: 1px solid var(--rule);
}
.shiur.has-flyer { grid-template-columns: 4.6rem minmax(0, 1fr) 4.5rem; }
.shiur-time { display: flex; flex-direction: column; padding-top: .1rem; }
.shiur-time .t { font: 600 1.7rem/1 var(--serif); font-variant-numeric: lining-nums; }
.shiur-time .ap { font: 700 .7rem/1.4 var(--sans); letter-spacing: .12em; color: var(--gold-text); margin-top: .15rem; }
.shiur-time .tend { font-size: .78rem; color: var(--muted); line-height: 1.3; margin-top: .2rem; }
.shiur-time .tnote { font-size: .8rem; line-height: 1.3; color: var(--ink-2); margin-top: .3rem; }
.shiur-time .tnote:first-child { font: 600 1rem/1.25 var(--sans); color: var(--ink); margin-top: 0; }
.shiur-title { font: 700 1.14rem/1.3 var(--sans); }
.shiur-he { font: 500 1.15rem/1.4 var(--serif-he); margin: .15rem 0 0; color: var(--ink); }
.shiur-speaker { margin: .3rem 0 0; font: 500 1.17rem/1.3 var(--serif); font-weight: 600; color: var(--ink-2); }
.shiur-speaker [lang="he"] { font-family: var(--serif-he); font-weight: 500; font-size: .95em; }
.shiur-speaker .sep { color: var(--gold); }
.shiur-loc { margin: .3rem 0 0; color: var(--ink-2); font-size: .98rem; }
.shiur-loc .addr, .shiur-loc .town { color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 0; padding: 0; }
.tags li { font-size: .8rem; line-height: 1; padding: .38rem .6rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.shiur-notes { margin: .55rem 0 0; font-size: .93rem; color: var(--muted); }
.shiur-actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; margin-left: -.35rem; }
.act {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: 0 .35rem;
  font: 600 .9rem var(--sans); color: var(--ink-2); background: none; border: 0; cursor: pointer; text-decoration: none; border-radius: 6px;
}
.act:hover { color: var(--ink); background: var(--paper-2); }
.act svg { color: var(--gold-text); }
.act-save[aria-pressed="true"] { color: var(--gold-text); }
.act-save[aria-pressed="true"] svg path { fill: currentColor; }
.shiur-flyer { align-self: start; display: block; border-radius: 4px; overflow: hidden; border: 1px solid var(--rule); box-shadow: 0 1px 2px rgba(20, 33, 61, .1); background: #fff; }
.shiur-flyer img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.shiur--example { position: relative; border: 1px dashed var(--gold); border-radius: var(--radius); padding: 2.4rem 1rem 1rem; background: rgba(255, 255, 255, .55); }
.shiur--example .shiur-title, .shiur--example .shiur-speaker, .shiur--example .shiur-loc, .shiur--example .shiur-he { color: var(--muted); font-style: italic; }
.shiur--example .shiur-he { font-style: normal; }
.example-label {
  position: absolute; top: .8rem; left: 1rem; margin: 0;
  font: 700 .7rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text);
}

.empty { padding: 1.4rem 0 .6rem; color: var(--muted); }
.empty-title { font: 600 1.25rem/1.3 var(--serif); color: var(--ink-2); margin-bottom: .3rem; }
.empty p { margin-bottom: .3rem; }

.welcome { padding: 1.6rem 0 .5rem; }
.welcome-lead { font: 500 1.45rem/1.35 var(--serif); color: var(--ink); }
.welcome > p { color: var(--ink-2); }
.welcome .shiur--example { margin: 1.25rem 0 1.4rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; text-decoration: none; cursor: pointer;
  font: 600 1rem var(--sans); letter-spacing: .01em;
}
.btn:hover { background: #1f2f52; }
.btn-light { background: var(--paper); color: var(--ink); margin-top: 1rem; }
.btn-light:hover { background: #fff; }

/* Announcements / flyers */
.flyers { padding: 2rem 0 1rem; }
.flyers-top { padding: 1.4rem 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.section-head h2 { font: 600 1.6rem/1.15 var(--serif); }
.section-head p { margin: 0; font-size: .9rem; color: var(--muted); }
.flyer-strip {
  list-style: none; margin: 0 -1.25rem; padding: .2rem 1.25rem .9rem; display: grid; grid-auto-flow: column;
  grid-auto-columns: 8.75rem; gap: .9rem; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.flyer-strip li { scroll-snap-align: start; }
.flyer { display: block; text-decoration: none; color: var(--ink-2); }
.flyer img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); background: #fff; box-shadow: 0 1px 3px rgba(20, 33, 61, .12); }
.flyer-cap { display: block; margin-top: .45rem; font-size: .86rem; line-height: 1.3; }
.flyers-empty {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.1rem; align-items: start;
  padding: 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2);
}
.flyers-empty p { color: var(--ink-2); margin-bottom: .4rem; }
.flyers-empty .empty-title { color: var(--ink); }
.flyer-frame { aspect-ratio: 3 / 4; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: .7rem .55rem; display: flex; flex-direction: column; gap: .4rem; box-shadow: 2px 3px 0 var(--paper-3); }
.flyer-frame span { height: 4px; background: var(--rule); border-radius: 2px; }
.flyer-frame span:first-child { width: 70%; margin: 0 auto .2rem; height: 6px; background: var(--gold); opacity: .6; }
.flyer-frame span:nth-child(3) { width: 80%; }

/* Send-in */
.send { margin-top: 2rem; padding: 2.5rem 0 2.75rem; background: var(--paper-2); border-top: 1px solid var(--rule); }
.send h2 { font: 600 2rem/1.15 var(--serif); margin-bottom: .6rem; }
.send-lead { color: var(--ink-2); }
.form { margin-top: 1.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .88rem; margin-left: .25rem; }
.field input:not([type="file"]), .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid #cdbf9d; border-radius: 8px; padding: .75rem .85rem; min-height: 3rem;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(180, 138, 60, .22); }
.field input[type="file"] { width: 100%; font: inherit; font-size: .95rem; padding: .6rem; background: #fff; border: 1px dashed #cdbf9d; border-radius: 8px; }
.field input[type="file"]::file-selector-button { font: 600 .9rem var(--sans); border: 0; background: var(--ink); color: var(--paper); padding: .55rem .9rem; border-radius: 999px; margin-right: .75rem; cursor: pointer; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 34rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.fine { font-size: .85rem; color: var(--muted); }
.send-alt { margin-top: 1.4rem; font-size: .92rem; color: var(--muted); }

/* Footer */
.footer { padding: 2rem 0 calc(2.5rem + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: .92rem; border-top: 3px double var(--gold); }
.footer-name { font: 600 1.4rem/1.2 var(--serif); color: var(--ink); margin-bottom: .3rem; }
.footer p { margin-bottom: .25rem; }

/* Flyer viewer */
.report-dialog { padding: 0; border: 0; max-width: min(28rem, 100vw); width: 100%; background: var(--paper); color: var(--ink); border-radius: 12px; }
.report-dialog::backdrop { background: rgba(14, 22, 40, .82); }
.report-dialog .form { margin: 0; padding: 1.25rem 1.35rem 1.5rem; }
.report-dialog h2 { font: 600 1.7rem/1.15 var(--serif); margin-bottom: .5rem; }
.report-reasons { border: 0; padding: 0; margin: 0 0 1rem; }
.report-reasons legend { font-weight: 600; font-size: .95rem; margin-bottom: .45rem; }
.report-reasons label {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 400; margin: 0; padding: .35rem 0; min-height: 2.75rem; cursor: pointer;
}
.report-dialog .report-reasons input[type="radio"] {
  width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; margin: 0;
  flex: none; accent-color: var(--ink);
}
.report-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .5rem; }
.report-actions .btn-light { margin-top: 0; border: 1px solid var(--ink); }
.report-status { margin: 0 0 .75rem; }
.report-status.is-error { color: #7a1f1f; }
.flyer-dialog { padding: 0; border: 0; max-width: min(46rem, 100vw); max-height: 100dvh; width: 100%; background: var(--paper); color: var(--ink); border-radius: 12px; }
.flyer-dialog::backdrop { background: rgba(14, 22, 40, .82); }
.flyer-dialog-bar { position: sticky; top: 0; display: flex; align-items: center; gap: .9rem; padding: .6rem .75rem .6rem 1rem; background: var(--paper); border-bottom: 1px solid var(--rule); }
.flyer-dialog-cap { flex: 1; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flyer-dialog-bar a { font-size: .92rem; }
.flyer-dialog-bar button { min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font: 600 .92rem var(--sans); cursor: pointer; }
.flyer-dialog img { width: 100%; height: auto; }

.thanks .masthead { min-height: 100dvh; display: flex; align-items: center; border-bottom: 0; }
.thanks .masthead .wrap { width: 100%; }

@media (min-width: 48rem) {
  body { font-size: 1.0625rem; }
  .daynav a { font-size: 1rem; }
  .shiur { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .shiur.has-flyer { grid-template-columns: 5.5rem minmax(0, 1fr) 6rem; }
  .flyer-strip { grid-auto-columns: 10.5rem; }
}
@media (max-width: 22.5rem) {
  .daynav a { font-size: .84rem; }
  .shiur { grid-template-columns: 3.9rem minmax(0, 1fr); column-gap: .8rem; }
  .shiur.has-flyer { grid-template-columns: 3.9rem minmax(0, 1fr) 3.6rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .daynav a, .act, .btn, .search { transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
}
@media print {
  .daynav, .toolbar, .send, .shiur-actions, .skip { display: none !important; }
  .masthead { background: none; color: var(--ink); }
}

/* Filters: three quiet pills (native pickers on iPhone) */
.filters { display: flex; gap: .5rem; padding-top: .7rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.pill { position: relative; flex: 0 0 auto; display: inline-flex; }
.pill select {
  appearance: none; -webkit-appearance: none; font: 600 .92rem var(--sans); color: var(--ink-2);
  min-height: 2.6rem; padding: 0 2rem 0 .95rem; border-radius: 999px; border: 1px solid var(--rule); background: transparent; cursor: pointer; max-width: 13rem;
}
.pill::after { content: ""; position: absolute; right: .85rem; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); color: var(--gold-text); pointer-events: none; }
.pill select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pill.is-set select { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.is-set::after { color: var(--gold-on-ink); }
.pill-clear, .linklike { flex: 0 0 auto; background: none; border: 0; padding: 0 .5rem; min-height: 2.6rem; font: 600 .92rem var(--sans); color: var(--gold-text); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.linklike { padding: 0; min-height: 0; font-size: inherit; }
.field select { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #cdbf9d; border-radius: 8px; padding: .75rem .85rem; min-height: 3rem; }
.shiur-cat { margin: 0 0 .2rem; font: 700 .72rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); }
.shiur-loc .area::before { content: "· "; color: var(--gold); }

/* Installed on the home screen: status bar sits over navy, never over ivory */
@media (display-mode: standalone) {
  .daynav { background: linear-gradient(to bottom, var(--ink) 0, var(--ink) env(safe-area-inset-top), rgba(251, 247, 238, .97) env(safe-area-inset-top)); }
  body { overscroll-behavior-y: none; }
}

/* refinements */
.tagline { text-wrap: balance; }
.shiur-he { text-align: left; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; overflow: visible; }
.pill { min-width: 0; }
.pill select { width: 100%; max-width: none; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding-left: .8rem; padding-right: 1.7rem; }
.pill::after { right: .75rem; }
@media (max-width: 30rem) { .section-head p { display: none; } }

/* Contact us */
.masthead-actions { display: flex; justify-content: center; gap: .75rem; margin-top: 1.2rem; flex-wrap: wrap; }
.masthead .btn-light { margin-top: 0; }
.contact { border-top: 3px double var(--gold); background: var(--paper); }
.footer a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.send-alt a { color: var(--ink); font-weight: 600; }

/* Standalone pages (privacy policy) */
.legal { padding: 2rem 0 3rem; }
.legal h2 {
  font: 600 1.45rem/1.25 var(--serif);
  color: var(--ink);
  margin: 2rem 0 .55rem;
}
.legal h3 {
  font: 600 1.05rem/1.35 var(--sans);
  color: var(--ink);
  margin: 1.15rem 0 .35rem;
}
.legal p, .legal li { color: var(--ink-2); }
.legal ul { margin: 0 0 1rem 1.2rem; padding: 0; }
.legal li { margin: 0 0 .25rem; }
