/* ============================================
   Congregation Ahavas Tefilah — Shared Styles v3
   Hamburger drawer nav, navy typographic hero, wave divider
   ============================================ */

:root {
  --white: #ffffff;
  --offwhite: #faf9f5;
  --ink: #1c1b19;
  --ink-soft: #55524a;
  --ink-faint: #8a867b;
  --line: #ebe8e1;
  --navy: #1b2a41;
  --navy-deep: #121e30;
  --brass: #a17f3d;
  --brass-bright: #c9a75c;
  --radius: 3px;

  --font-display: "Frank Ruhl Libre", "Georgia", serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.4em;
  font-weight: 600;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.menu-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 19px;
  height: 2px;
  background: var(--ink);
}

/* ---------- Drawer nav ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18,30,48,0.4);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(340px, 84vw);
  background: var(--white);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding: 20px 8px;
  box-shadow: 6px 0 28px rgba(18,30,48,0.18);
}

.drawer.open { transform: translateX(0); }

.drawer-close {
  width: 42px;
  height: 42px;
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  margin: 4px 8px 8px;
  align-self: flex-start;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
  border-top: 1px solid var(--line);
}

.drawer-nav a {
  display: block;
  padding: 18px 16px;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.drawer-nav a:hover { color: var(--brass); }
.drawer-nav a.active { color: var(--brass); font-weight: 700; }

.drawer-footer {
  margin-top: auto;
  padding: 20px 24px 8px;
  font-size: 0.86rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

.drawer-footer a { color: var(--ink-soft); font-weight: 600; }

/* ---------- Hero (no photo, typographic + wave) ---------- */

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  padding: 64px 0 0;
  overflow: hidden;
  text-align: center;
}

.hero-plaque {
  display: inline-block;
  background: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  margin-bottom: 32px;
}

.hero-plaque img {
  display: block;
  width: 150px;
  height: auto;
}

.hero .eyebrow {
  color: var(--brass-bright);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 0 auto 16px;
  max-width: 20ch;
}

.hero .lede {
  color: rgba(255,255,255,0.78);
  max-width: 46ch;
  margin: 0 auto 32px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-wave {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity .15s ease;
}

.btn-gold {
  background: var(--brass);
  color: var(--white);
}
.btn-gold:hover { background: #8a6c33; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-deep); }

/* ---------- Bands ---------- */

.band { padding: 56px 0; }
.band + .band { border-top: 1px solid var(--line); }
.band-tint { background: var(--offwhite); }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
}

.section-heading .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 800px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 { font-size: 1.08rem; margin-bottom: 8px; }

.card .meta {
  font-size: 0.74rem;
  color: var(--brass);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ---------- Schedule table ---------- */

.luach {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.luach-header {
  background: var(--navy);
  color: var(--white);
  padding: 15px 22px;
  font-size: 1.02rem;
  font-weight: 600;
}

.luach table { width: 100%; border-collapse: collapse; }

.luach th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brass);
  font-weight: 700;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--offwhite);
}

.luach td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink);
}

.luach tr:nth-child(even) td { background: #fdfcfa; }
.luach tr:last-child td { border-bottom: none; }
.luach td.time { font-weight: 600; white-space: nowrap; }
.luach td.day { font-weight: 600; color: var(--ink); }

.placeholder-note {
  font-size: 0.86rem;
  background: var(--offwhite);
  border-left: 3px solid var(--brass);
  padding: 12px 16px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Info list ---------- */

.info-list { list-style: none; margin: 0; padding: 0; }

.info-list li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.info-list .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brass);
  min-width: 100px;
  font-weight: 700;
  padding-top: 2px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ---------- Page hero (interior pages) ---------- */

.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 48px 0 60px;
  position: relative;
}

.page-hero .eyebrow {
  color: var(--brass-bright);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-hero h1 { color: var(--white); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.page-hero p { color: rgba(255,255,255,0.78); max-width: 60ch; }

.page-hero .hero-wave { position: absolute; bottom: -1px; left: 0; }

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.7);
  padding: 30px 0;
  font-size: 0.85rem;
  text-align: center;
}

footer.site-footer img {
  width: 90px;
  height: auto;
  margin-bottom: 14px;
  border-radius: var(--radius);
}

.content-footer-spacer { height: 0; }

/* ============================================
   Homepage Zmanim Widget + SMS Sign-Up + Minyan Table
   ============================================ */

.zmanim-widget {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: 10px;
  padding: 28px 20px 24px;
  color: var(--white);
  margin: 0 0 28px;
  overflow: hidden;
}

.zmanim-widget .zw-status {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
  min-height: 16px;
}

.zmanim-widget .zw-parsha-he {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  font-weight: 700;
  direction: rtl;
  margin: 2px 0 2px;
}

.zmanim-widget .zw-parsha-en {
  text-align: center;
  font-size: 0.95rem;
  color: var(--brass-bright);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.zw-countdown {
  text-align: center;
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  font-weight: 600;
  color: var(--brass-bright);
  margin: 6px 0 18px;
  min-height: 1.4em;
}

.zw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .zw-grid { grid-template-columns: 1fr; }
}

.zw-cell {
  background: rgba(255,255,255,0.05);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.zw-cell .zw-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
}

.zw-cell .zw-time {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
}

.zw-announcement {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(201,167,92,0.12);
  border: 1px solid rgba(201,167,92,0.35);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  color: var(--white);
}

.zw-announcement:empty { display: none; }

/* Weekday minyan table (compact) */
.mini-luach {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 10px;
}
.mini-luach th, .mini-luach td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.mini-luach th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  font-weight: 600;
}
.mini-luach td.time { font-weight: 600; white-space: nowrap; }

/* Inline SMS sign-up box */
.signup-inline {
  background: var(--offwhite);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.signup-inline label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 14px;
  margin-bottom: 6px;
}
.signup-inline input[type=text], .signup-inline input[type=tel] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-family: var(--font-body);
}
.signup-inline .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}
.signup-inline .consent-row input[type=checkbox] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.signup-inline .consent-row label {
  font-weight: 400;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}
.signup-inline button {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--navy);
  color: var(--white);
}
.signup-inline button:active { background: var(--navy-deep); }
.signup-inline .fine-print {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 12px;
  line-height: 1.5;
}
.signup-success {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 20px;
  background: #eef8f0;
  border: 1px solid #bfe3c8;
  border-radius: 10px;
  text-align: center;
}

@media (max-width: 800px) {
  .zmanim-widget { padding: 22px 14px 18px; margin-left: -4px; margin-right: -4px; }
  .zw-cell { padding: 12px 14px; }
}

/* Weekday mincha strip (dark cards, matches zmanim widget) */
.wd-strip-head {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,0.55);
  margin: 20px 0 10px;
}
.wd-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.wd-box {
  flex: 1 1 0;
  min-width: 64px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}
.wd-box.today {
  box-shadow: inset 0 0 0 2px var(--brass-bright);
  background: rgba(201,167,92,0.12);
}
.wd-box .wd-day { font-size: 0.72rem; color: var(--brass-bright); font-weight: 600; margin-bottom: 2px; }
.wd-box .wd-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,0.55); }
.wd-box .wd-time { font-size: 0.85rem; font-weight: 700; color: var(--white); }

@media (max-width: 420px) {
  .wd-box { min-width: 56px; padding: 8px 4px; }
  .wd-box .wd-time { font-size: 0.75rem; }
}

/* Download button + printable zmanim sheet */
.zw-download-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--brass);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.zw-download-btn:active { background: var(--brass-bright); }
.zw-download-row { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.zw-download-row .zw-download-btn { margin-top: 0; }
.zw-download-link { text-align: center; text-decoration: none; box-sizing: border-box; }
@media (min-width: 480px) {
  .zw-download-row { flex-direction: row; }
  .zw-download-row .zw-download-btn { flex: 1; }
}

#printSheet { display: none; }

@media print {
  body > *:not(.print-visible) { display: none !important; }
  .print-visible { display: block !important; }
  #printSheet {
    position: static;
    width: 100%;
    background: #fff;
    color: #111;
    padding: 22px 44px 30px;
  }
  #printSheet .ps-logo-wrap { text-align: center; margin-bottom: 6px; }
  #printSheet .ps-logo-wrap img { max-width: 220px; width: 100%; }
  #printSheet .ps-divider { width: 60%; margin: 6px auto 10px; border: none; border-top: 1px solid #111; }
  #printSheet .ps-parsha { text-align: center; font-size: 2.6rem; font-weight: 700; direction: rtl; font-family: 'EB Garamond', 'Frank Ruhl Libre', serif; text-decoration: underline; text-underline-offset: 12px; margin-bottom: 14px; }
  #printSheet .ps-top-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  #printSheet .ps-top-col { padding: 0 20px; }
  #printSheet .ps-top-col:first-child { border-right: 1px solid #ccc; padding-left: 0; }
  #printSheet .ps-top-col:last-child { padding-right: 0; }
  #printSheet .ps-day-head { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #333; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 2px solid #111; }
  #printSheet .ps-time-line { font-size: 1.15rem; line-height: 1.85; }
  #printSheet .ps-time-line .ps-lbl { color: #111; }
  #printSheet .ps-time-line .ps-val { color: #111; }
  #printSheet .ps-time-line.ps-small { font-size: 0.92rem; color: #444; line-height: 1.5; }
  #printSheet .ps-bottom-section { text-align: center; padding-top: 28px; padding-bottom: 16px; border-top: 1px solid #bbb; margin-top: 28px; }
  #printSheet .ps-bottom-section .ps-day-head { display: inline-block; }
  #printSheet .ps-ann-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid #ddd; text-align: center; }
  #printSheet .ps-ann-heading { font-size: 0.75rem; font-style: italic; text-transform: uppercase; letter-spacing: .12em; color: #888; margin-bottom: 8px; }
  #printSheet .ps-footer { margin-top: 14px; padding-top: 14px; text-align: center; font-size: 1rem; font-weight: 600; color: #111; line-height: 1.8; border-top: 1px solid #bbb; }
  #printSheet .ps-footer a { color: #1a6b3a; }
  @page { size: letter portrait; margin: 0; }
}

/* ============================================
   Monthly Schedule
   ============================================ */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
}
.month-nav button {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}
.month-nav .month-label { font-family: var(--font-display); font-size: 1.3rem; min-width: 200px; text-align: center; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.cal-dow {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 4px;
}
.cal-dow.cal-dow-heb { font-family: var(--font-display); font-size: 1rem; letter-spacing: normal; }
.cal-cell {
  background: var(--white);
  min-height: 118px;
  padding: 6px 6px 8px;
  font-size: 0.72rem;
}
.cal-cell.empty { background: var(--offwhite); }
.cal-cell.today { background: rgba(201,167,92,0.10); }
.cal-cell .cd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cal-cell .cd-num { font-weight: 700; font-size: 0.85rem; }
.cal-cell .cd-hebnum { font-size: 0.68rem; color: var(--ink-faint); direction: rtl; }
.cal-cell.shabbos { background: rgba(27,42,65,0.06); }
.cal-cell.holiday-day { background: rgba(17,17,17,0.07); }
.cal-cell.holiday-day.shabbos { background: rgba(17,17,17,0.12); }
.cal-cell .cd-line { line-height: 1.5; }
.cal-cell .cd-label { color: var(--ink-faint); }
.cal-cell .cd-val { font-weight: 600; }
.cal-cell .cd-parsha { font-size: 0.68rem; color: var(--brass); font-weight: 700; margin-bottom: 2px; direction: rtl; }

.month-download-btn {
  display: block;
  margin: 20px auto 0;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--brass);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Mobile: stacked day list instead of a 7-col grid */
@media (max-width: 700px) {
  .cal-grid { display: none; }
  .cal-list { display: flex; flex-direction: column; gap: 8px; }
  .cal-list .cl-row {
    display: flex;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--white);
  }
  .cal-list .cl-row.shabbos { background: rgba(27,42,65,0.06); }
  .cal-list .cl-row.holiday-day { background: rgba(17,17,17,0.07); }
  .cal-list .cl-row.holiday-day.shabbos { background: rgba(17,17,17,0.12); }
  .cal-list .cl-row.today { border-color: var(--brass-bright); background: rgba(201,167,92,0.10); }
  .cal-list .cl-date { flex-shrink: 0; width: 54px; text-align: center; }
  .cal-list .cl-date .cl-dow { font-size: 0.65rem; text-transform: uppercase; color: var(--ink-faint); }
  .cal-list .cl-date .cl-dow.cl-dow-heb { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--ink); }
  .cal-list .cl-date .cl-num { font-weight: 700; font-size: 1.1rem; }
  .cal-list .cl-body { flex: 1; font-size: 0.85rem; }
  .cal-list .cl-parsha { font-size: 0.72rem; color: var(--brass); font-weight: 700; margin-bottom: 2px; direction: rtl; }
  .cal-list .cl-line { line-height: 1.5; }
  .cal-list .cl-label { color: var(--ink-faint); }
  .cal-list .cl-val { font-weight: 600; }
}
@media (min-width: 701px) {
  .cal-list { display: none; }
}

/* Print version of the monthly calendar — border-based (no reliance on "Background graphics" print option) */
#monthPrintSheet { display: none; }
@media print {
  body > *:not(.print-visible) { display: none !important; }
  .print-visible { display: block !important; }
  #monthPrintSheet {
    position: static;
    width: 100%;
    height: 8.2in;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #111;
    padding: 0.06in;
    box-sizing: border-box;
  }
  #monthPrintSheet .mp-header { text-align: center; margin-bottom: 5px; border-bottom: 1px solid #999; padding-bottom: 4px; flex-shrink: 0; }
  #monthPrintSheet .mp-header img { max-height: 85px; width: auto; display: block; margin: 0 auto 3px; }
  #monthPrintSheet .mp-addr { font-size: 0.62rem; letter-spacing: .03em; color: #555; margin-bottom: 4px; }
  #monthPrintSheet .mp-months { font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; }
  #monthPrintSheet .mp-months .mp-heb { direction: rtl; }
  #monthPrintSheet .mp-grid { width: 100%; border-collapse: collapse; table-layout: fixed; flex-shrink: 0; }
  #monthPrintSheet .mp-grid tr { break-inside: avoid; page-break-inside: avoid; }
  #monthPrintSheet .mp-dow { text-align: center; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: #444; padding: 4px; border: 1px solid #999; }
  #monthPrintSheet .mp-dow.mp-dow-heb { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: normal; color: #111; }
  #monthPrintSheet .mp-cell {
    height: 0.92in;
    padding: 4px 6px;
    font-size: 0.6rem;
    line-height: 1.3;
    border: 1px solid #999;
    vertical-align: top;
    text-align: left;
  }
  #monthPrintSheet .mp-cell.empty { }
  #monthPrintSheet .mp-cell.shabbos .mp-num { text-decoration: underline; text-underline-offset: 2px; }
  /* Grey fill for any day with a Yom Tov / fast / Rosh Chodesh — forced to print even if the
     browser's "print background graphics" option is off, so it still shows in B&W printouts. */
  #monthPrintSheet .mp-cell.holiday-day {
    background: #e3e3e3;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }
  #monthPrintSheet .mp-cell-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #999; margin-bottom: 2px; padding-bottom: 1px; }
  #monthPrintSheet .mp-num { font-weight: 700; font-size: 0.72rem; }
  #monthPrintSheet .mp-hebnum { font-size: 0.6rem; direction: rtl; }
  #monthPrintSheet .mp-parsha { font-size: 0.6rem; font-weight: 700; margin-top: 1px; direction: rtl; }
  #monthPrintSheet .mp-holiday, #monthPrintSheet .mp-fast { font-size: 0.52rem; }
  #monthPrintSheet .mp-footer {
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 8px;
    border-top: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
    flex-shrink: 0;
  }
  #monthPrintSheet .mp-footer-text { text-align: center; font-size: 0.58rem; font-weight: 600; color: #111; line-height: 1.3; }
  #monthPrintSheet .mp-footer-text a { color: #111; }
  #monthPrintSheet .mp-footer-qr { text-align: center; }
  #monthPrintSheet .mp-footer-qr img { width: 0.62in; height: 0.62in; display: block; margin: 0 auto; }
  @page { size: letter landscape; margin: 0.15in; }
}

/* Hebrew date + holiday/fast markers on the monthly calendar */

.cal-cell .cd-holiday { font-size: 0.68rem; font-weight: 700; color: var(--brass); direction: rtl; margin: 2px 0; }
.cal-cell .cd-fast { font-size: 0.66rem; font-weight: 700; color: #a13d3d; direction: rtl; font-style: italic; margin: 2px 0; }

.cal-list .cl-date .cl-hebnum { font-size: 0.62rem; color: var(--ink-faint); direction: rtl; margin-top: 1px; }
.cal-list .cl-holiday { font-size: 0.78rem; font-weight: 700; color: var(--brass); direction: rtl; margin: 2px 0; }
.cal-list .cl-fast { font-size: 0.76rem; font-weight: 700; color: #a13d3d; direction: rtl; font-style: italic; margin: 2px 0; }

#monthPrintSheet .mp-hebdate { font-size: 0.55rem; color: #555; direction: rtl; }
#monthPrintSheet .mp-holiday { font-size: 0.6rem; font-weight: 700; direction: rtl; }
#monthPrintSheet .mp-fast { font-size: 0.58rem; font-weight: 700; font-style: italic; direction: rtl; }
