/* ══════════════════════════════════════════════════════
   Variables
══════════════════════════════════════════════════════ */
:root {
  --primary:       #8B2635;
  --primary-dark:  #5C1520;
  --primary-light: #A03040;
  --gold:          #C4952A;
  --gold-light:    #E8C97A;
  --gold-pale:     #FBF3DC;
  --bg:            #F9F5EC;
  --surface:       #FFFFFF; 
  --text:          #1E1209; 
  --text-muted:    #6B5B4E;
  --border:        #DDD0B8;
  --shadow:        0 2px 10px rgba(0,0,0,.07); 
  --shadow-lg:     0 8px 28px rgba(0,0,0,.11); 
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    .2s ease;
}

/* ══════════════════════════════════════════════════════
   Reset / Base
══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ══════════════════════════════════════════════════════
   Layout helpers
══════════════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container.narrow { max-width: 740px; }

/* ══════════════════════════════════════════════════════
   Header / Nav
══════════════════════════════════════════════════════ */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .9rem;
  padding-bottom: .9rem;
}

/* Logo */
.logo { display: flex; align-items: center; gap: .15rem; text-decoration: none; }
.logo-img { height: 42px; width: auto; display: block; object-fit: contain; }
.logo-main { font-size: 1.6rem; font-weight: 900; color: var(--gold-light); letter-spacing: -.02em; }
.logo-dot  { font-size: 1.6rem; font-weight: 900; color: var(--gold); }
.logo-sub  { font-size: 1rem; font-weight: 400; color: rgba(255,255,255,.65); }

/* Nav list */
.nav-list {
  display: flex;
  align-items: center;
  gap: .15rem;
}
.nav-link {
  display: block;
  padding: .45rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.82);
  font-size: .97rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.14);
  color: #fff;
}

/* "More pages" dropdown — holds dynamically-added custom CMS pages so the
   main nav doesn't grow unbounded as pages are added in the admin. */
.nav-item-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-caret { font-size: .7rem; transition: transform var(--transition); }
.nav-item-dropdown.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  min-width: 200px;
  background: var(--primary-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  z-index: 850;
}
.nav-item-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu .nav-link { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ══════════════════════════════════════════════════════
   Hero
══════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 55%, #9B3040 100%);
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='52' viewBox='0 0 52 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26 0L52 26L26 52L0 26Z' fill='none' stroke='white' stroke-opacity='.04' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; line-height: 0; }
.hero-wave svg { width: 100%; }

.badge-today {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .28rem 1rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: .6rem;
  letter-spacing: -.02em;
}
.hero-mishnayot-count {
  display: inline-block;
  font-size: .42em;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: 0;
}
.hero-sub {
  font-size: 1.2rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 2rem;
}

/* ══════════════════════════════════════════════════════
   Buttons
══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: .97rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(196,149,42,.35);
}
.btn-gold:hover {
  background: #B8890A;
  border-color: #B8890A;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(196,149,42,.45);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-muted { border-color: var(--border); color: var(--text-muted); }
.btn-muted:hover { background: var(--border); color: var(--text); }
.btn-lg { padding: .8rem 2rem; font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════
   Sections
══════════════════════════════════════════════════════ */
.section { padding: 4rem 0; }
.section-alt { background: var(--surface); }
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 2.25rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin: .45rem auto 0;
}

/* ══════════════════════════════════════════════════════
   Home – Sedarim grid
══════════════════════════════════════════════════════ */
.sedarim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.1rem;
}
.seder-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.seder-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.seder-icon { font-size: 2.4rem; }
.seder-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.seder-desc { font-size: .82rem; color: var(--text-muted); }
.seder-count { font-size: .8rem; background: var(--gold-pale); color: var(--gold); padding: .15rem .7rem; border-radius: 100px; font-weight: 600; }

/* Home – Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.feature-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: .4rem; }
.feature-card p  { font-size: .9rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   Page title
══════════════════════════════════════════════════════ */
.page-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin: 2rem 0 1.75rem;
  letter-spacing: -.01em;
}
.mishnayot-count {
  display: inline-block;
  font-size: .6em;
  font-weight: 600;
  color: #8a6512;
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  padding: .2em .65em;
  vertical-align: middle;
  margin-right: .4em;
  letter-spacing: 0;
}

/* ══════════════════════════════════════════════════════
   Breadcrumb
══════════════════════════════════════════════════════ */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .7rem 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .88rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ══════════════════════════════════════════════════════
   Perek page – split layout (media right | text left)
══════════════════════════════════════════════════════ */
.perek-layout {
  display: grid;
  grid-template-columns: 360px 1fr; /* RTL: 360px = right (media), 1fr = left (text) */
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2rem;
}
.perek-layout.media-only {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

/* ── Media column (right in RTL) ── */
.media-col { position: sticky; top: 80px; }

/* Toggle tabs */
.media-toggle {
  display: flex;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-bottom: none;
}
.toggle-btn {
  flex: 1;
  padding: .6rem .5rem;
  background: var(--gold-pale);
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-btn.active {
  background: var(--primary);
  color: #fff;
}
.toggle-btn:not(.active):hover {
  background: var(--border);
  color: var(--text);
}

/* Media panels */
.media-panel { display: none; }
.media-panel.active { display: block; }

/* Video */
.video-wrap {
  background: #000;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.has-both .video-panel .video-wrap {
  border-radius: 0 0 var(--radius) var(--radius);
}
.media-col:not(.has-both) .video-panel .video-wrap {
  border-radius: var(--radius);
}
.main-video { width: 100%; display: block; }

/* Audio */
.audio-inner {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 1.2rem;
}
.has-both .audio-panel .audio-inner {
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: none;
}
.media-col:not(.has-both) .audio-panel .audio-inner {
  border-radius: var(--radius);
}
.audio-track { margin-bottom: 1.1rem; }
.audio-track:last-child { margin-bottom: 0; }
.audio-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.audio-track audio { width: 100%; }

.no-media {
  background: var(--gold-pale);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
}
.no-media span { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* ── In memory ── */
.in-memory {
  background: linear-gradient(135deg, #FFF8F0, #FFF3E0);
  border: 1px solid #F0C890;
  border-right: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
}
.in-memory-label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; color: var(--gold); }
.in-memory p { font-weight: 600; font-size: .97rem; }

/* ── Chapter nav ── */
.chapter-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Text column: page viewer (left in RTL) ── */

.page-viewer {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.page-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.page-counter { font-size: .88rem; color: var(--text-muted); font-weight: 600; }
.zoom-hint    { font-size: .78rem; color: var(--text-muted); }

.page-viewer-body { position: relative; }
.viewer-slide { display: none; }
.viewer-slide.active { display: block; transition: transform 0.15s ease; will-change: transform; }

.page-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: filter .3s;
}
.page-img.lazy  { filter: blur(8px); }
.page-img.loaded { filter: none; }

.page-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: .5rem;
}
.page-nav-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: .4rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.page-nav-btn:disabled {
  opacity: .3;
  cursor: default;
}
.page-nav-btn:not(:disabled):hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
} 
.page-nav-counter {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 600; 
}

/* Lightbox is rendered by PhotoSwipe (loaded on demand) — see app.js.
   PhotoSwipe's slide-offset math assumes an LTR coordinate system; since the
   page is dir="rtl", its inherited direction flips swipe distance/arrow
   semantics (skips slides, reversed next/prev). Force LTR on its own root
   so it behaves exactly as the library expects, independent of the page. */
.pswp { direction: ltr; }

.text-source-credit {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .6rem;
}

/* ══════════════════════════════════════════════════════
   List page
══════════════════════════════════════════════════════ */
.seder-section { margin-bottom: 2.75rem; }
.seder-section-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .9rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--gold);
}
.seder-section-icon { font-size: 1.6rem; }
.seder-section-header h2 { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.seder-section-header h2 a { color: inherit; }
.seder-section-header h2 a:hover { color: var(--primary-dark); }
.seder-section-count { margin-right: auto; font-size: .82rem; color: var(--text-muted); background: var(--gold-pale); padding: .15rem .7rem; border-radius: 100px; }

.masachtot-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: .3rem 1rem;
  font-size: .9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
}
.chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.masachtot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
}
.masechet-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.masechet-card:hover { border-color: var(--gold); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.masechet-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: .3rem; }
.masechet-card span { font-size: .82rem; color: var(--text-muted); }

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .9rem;
}
.chapter-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: all var(--transition);
}
.chapter-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.chapter-name { font-size: 1rem; font-weight: 700; }
.chapter-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge {
  font-size: .72rem;
  padding: .18rem .6rem;
  border-radius: 100px;
  font-weight: 600;
}
.badge-video { background: #FEF3C7; color: #92400E; }
.badge-audio { background: #D1FAE5; color: #065F46; }
.badge-text  { background: #EDE9FE; color: #5B21B6; }

/* ══════════════════════════════════════════════════════
   Home – Hero extras
══════════════════════════════════════════════════════ */
.hero-date-line {
  font-size: .97rem;
  color: rgba(255,255,255,.7);
  margin-bottom: .5rem;
  font-weight: 400;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.4);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.7);
  color: #fff;
}

/* ══════════════════════════════════════════════════════
   Home – Haskamot carousel
══════════════════════════════════════════════════════ */
.haskamot-carousel {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.haskamot-track { overflow: hidden; }
.haskama-slide { display: none; text-align: center; animation: haskFadeIn .35s ease; }
.haskama-slide.active { display: block; }
@keyframes haskFadeIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.haskama-full-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.haskama-placeholder {
  background: var(--gold-pale);
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  padding: 2rem;
}
.haskama-caption { margin-top: 1.1rem; }
.haskama-caption-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.haskama-caption-role { font-size: .88rem; color: var(--text-muted); margin-top: .2rem; }
.haskama-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--primary);
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.haskama-nav:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.haskama-prev { right: -22px; }
.haskama-next { left:  -22px; }
.haskama-dots {
  display: flex;
  gap: .55rem;
  justify-content: center;
  margin-top: 1.25rem;
}
.haskama-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition);
}
.haskama-dot.active { background: var(--gold); }
@media (max-width: 600px) {
  .haskama-prev { right: 4px; }
  .haskama-next { left:  4px; }
  .haskama-nav { width: 36px; height: 36px; font-size: 1.4rem; }
}

/* ══════════════════════════════════════════════════════
   Home – App download / contact
══════════════════════════════════════════════════════ */
.section-sub { text-align: center; color: var(--text-muted); margin-top: -.5rem; margin-bottom: 1.5rem; font-size: 1.05rem; }
.app-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.contact-link { color: var(--primary); font-weight: 600; }
.contact-link:hover { color: var(--gold); }

/* ══════════════════════════════════════════════════════
   Home – Store banner
══════════════════════════════════════════════════════ */
.store-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 3rem 0;
}
.store-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.store-text h2 { font-size: 1.6rem; font-weight: 800; color: var(--gold-light); margin-bottom: .3rem; }
.store-text p  { color: rgba(255,255,255,.75); font-size: 1rem; }

/* ══════════════════════════════════════════════════════
   Luach (calendar)
══════════════════════════════════════════════════════ */
.luach-top { text-align: center; padding: 2rem 0 .5rem; }
.luach-sub { text-align: center; color: var(--text-muted); margin-top: -.5rem; margin-bottom: 1.5rem; }

.luach-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.luach-month-title {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.luach-heb-month {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.luach-greg-sub {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-muted);
}
.luach-nav-btn { white-space: nowrap; font-size: .9rem; padding: .45rem 1rem; }
.luach-today-hint { text-align: center; margin-bottom: .75rem; }
.btn-sm { padding: .3rem .8rem; font-size: .85rem; }

.luach-grid-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.luach-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  table-layout: fixed;
}
.luach-table th {
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: .55rem .3rem;
  text-align: center;
  letter-spacing: .03em;
}
.dow-shabbat { background: var(--primary-dark) !important; }

.luach-table td {
  border: 1px solid var(--border);
  vertical-align: top;
  padding: 0;
  height: 115px;
}
.luach-cell {
  padding: .4rem .45rem;
  display: flex;
  flex-direction: column;
  gap: .12rem;
  height: 100%;
}

/* Primary: Hebrew day in gematriya */
.luach-heb-day {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  font-family: inherit;
}

/* Secondary: Gregorian day/month — small and muted */
.luach-greg-date {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1;
}

.luach-holiday-name {
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-pale);
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 1px;
}
.luach-parasha-name {
  font-size: .68rem;
  font-weight: 700;
  color: #5B4BA0;
  background: rgba(91,75,160,.12);
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 1px;
}
.luach-perek-link {
  font-size: .85rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.luach-perek-link:hover { color: var(--gold); text-decoration: underline; }
.luach-mish-count {
  display: inline-block;
  font-size: .62em;
  font-weight: 700;
  color: #8a6512;
  background: var(--gold-pale);
  border-radius: 999px;
  padding: 0 .35em;
  margin-right: .25em;
  vertical-align: middle;
}

.luach-cycle-badge {
  font-size: .62rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 1px;
  white-space: nowrap;
}
td.luach-siyum   { outline: 2px solid var(--gold); outline-offset: -2px; }
td.luach-techila { outline: 2px solid var(--gold-light, #E8C97A); outline-offset: -2px; }

.luach-empty { background: rgba(0,0,0,.025); }

/* Responsive day-of-week headers */
.dow-abbr { display: none; }
.dow-full  { display: inline; }

/* Today highlight */
.luach-today {
  background: #FFF8E0 !important;
  box-shadow: inset 0 0 0 2px var(--gold);
}
.luach-today .luach-heb-day { color: var(--gold); }

/* Shabbat column */
.luach-shabbat { background: #F4F0FF; }
.luach-shabbat .luach-heb-day { color: #5B4BA0; }

/* Holiday */
.luach-holiday { background: #FFF9F0; }

/* Legend */
.luach-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: .5rem 0 2rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-swatch {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}
.legend-today   { background: #FFF8E0; border-color: var(--gold); }
.legend-shabbat { background: #F4F0FF; }
.legend-holiday { background: #FFF9F0; }

@media (max-width: 700px) {
  .luach-table { min-width: 400px; }
  .luach-table td { height: 90px; }
  .luach-heb-day { font-size: 1.1rem; }
  .luach-perek-link { font-size: .75rem; }
}
@media (max-width: 480px) {
  .luach-table { min-width: 0; width: 100%; }
  .luach-table td { height: 68px; }
  .luach-table th { font-size: .68rem; padding: .35rem .1rem; }
  .dow-abbr { display: inline; }
  .dow-full  { display: none; }
  .luach-heb-day  { font-size: .95rem; }
  .luach-greg-date { font-size: .6rem; }
  .luach-holiday-name, .luach-parasha-name { font-size: .58rem; }
  .luach-perek-link { font-size: .68rem; }
  .luach-cell { padding: .25rem .15rem; gap: .08rem; }
}

/* Luach PDF button */
.luach-pdf-btn { margin-top: .75rem; display: inline-flex; align-items: center; gap: .4rem; }

/* ══════════════════════════════════════════════════════
   CMS custom pages
══════════════════════════════════════════════════════ */
.cms-content {
  line-height: 1.8;
  font-size: 1rem;
  color: var(--text);
}
.cms-content h1,.cms-content h2,.cms-content h3,.cms-content h4 {
  font-weight: 700;
  color: var(--primary);
  margin: 1.75rem 0 .75rem;
  line-height: 1.3;
}
.cms-content h1 { font-size: 1.9rem; }
.cms-content h2 { font-size: 1.45rem; }
.cms-content h3 { font-size: 1.15rem; }
.cms-content p  { margin-bottom: 1.1rem; }
.cms-content ul,.cms-content ol { padding-right: 1.75rem; margin-bottom: 1rem; }
.cms-content li { margin-bottom: .35rem; }
.cms-content a  { color: var(--primary); text-decoration: underline; }
.cms-content a:hover { color: var(--gold); }
.cms-content img { max-width: 100%; height: auto; border-radius: 6px; margin: .5rem 0; }
.cms-content table { border-collapse: collapse; width: 100%; margin-bottom: 1.25rem; }
.cms-content th,.cms-content td { border: 1px solid #ddd; padding: .55rem .9rem; }
.cms-content th { background: var(--primary); color: #fff; font-weight: 700; }
.cms-content blockquote {
  border-right: 4px solid var(--gold);
  margin: 1rem 0;
  padding: .75rem 1.25rem;
  background: var(--gold-pale);
  border-radius: 0 4px 4px 0;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════
   About page
══════════════════════════════════════════════════════ */
.about-hero {
  background: var(--primary);
  padding: 4rem 0 3rem;
  text-align: center;
}
.about-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; color: var(--gold-light); margin-bottom: .5rem; }
.about-hero p  { color: rgba(255,255,255,.75); font-size: 1.1rem; }

.about-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
  padding: 3.5rem 0;
}
.about-text { font-size: 1.05rem; line-height: 2; color: var(--text); }
.about-text h2 { color: var(--primary); font-size: 1.3rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
.about-text p  { margin-bottom: 1rem; }
.about-img-wrap {
  position: sticky;
  top: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-img-wrap img { width: 100%; height: auto; display: block; }

@media (max-width: 800px) {
  .about-body { grid-template-columns: 1fr; }
  .about-img-wrap { position: static; }
  .store-banner { flex-direction: column; text-align: center; }
  .haskamot-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════
   Contact
══════════════════════════════════════════════════════ */
.contact-form { margin: 0; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .94rem;
  margin-bottom: .4rem;
  color: var(--text);
}
.required { color: var(--primary); }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  direction: rtl;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,38,53,.1);
}

.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 500; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ══════════════════════════════════════════════════════
   Footer
══════════════════════════════════════════════════════ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.75);
  padding: 3rem 0 0;
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
}
.footer-logo { font-size: 1.5rem; font-weight: 900; color: var(--gold-light); margin-bottom: .3rem; }
.footer-logo span { font-size: .85rem; font-weight: 400; opacity: .6; }
.footer-tagline { font-size: .88rem; opacity: .65; margin-bottom: .5rem; }
.footer-contact { font-size: .88rem; }
.footer-contact a { color: var(--gold-light); }
.footer-contact a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: center; gap: 1.5rem; }
.footer-heading { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gold-light); margin-bottom: .9rem; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.1rem 0;
  text-align: center;
  font-size: .82rem;
  opacity: .5;
}

/* ══════════════════════════════════════════════════════
   Responsive
══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Perek: stack to single column — media on top, text below */
  .perek-layout {
    grid-template-columns: 1fr;
  }
  .media-col {
    position: static;
    order: 0;
  }
  .text-col {
    order: 1;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 700px) {
  .hamburger { display: flex; }

  .site-header { position: relative; }
  .header-inner { position: relative; }
  nav { position: static; }
  .nav-list {
    display: none;
    position: absolute;
    top: calc(100% + .9rem);
    right: 0; left: 0;
    background: var(--primary-dark);
    flex-direction: column;
    align-items: stretch;
    padding: .75rem;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 800;
  }
  .nav-list.open { display: flex; }
  .nav-link { padding: .65rem 1rem; }

  /* On mobile the dropdown sits inline in the already-vertical menu instead
     of floating absolutely, so it just expands/collapses in place. */
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
  .nav-dropdown-menu {
    position: static;
    display: none;
    background: rgba(0,0,0,.15);
    margin-top: .3rem;
    box-shadow: none;
  }
  .nav-item-dropdown.open .nav-dropdown-menu { display: block; }

  .sedarim-grid { grid-template-columns: repeat(2, 1fr); }
  .chapters-grid { grid-template-columns: 1fr; }
  .masachtot-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 3.5rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }
}

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

/* ══════════════════════════════════════════════════════
   Custom-page carousel
══════════════════════════════════════════════════════ */
.page-carousel {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--gold-pale);
}
.pcar-track { position: relative; }
.pcar-slide { display: none; }
.pcar-slide.active { display: block; }
.pcar-slide img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: contain;
}
.pcar-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.42);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .15s;
}
.pcar-btn:hover:not(:disabled) { background: rgba(0,0,0,.7); }
.pcar-btn:disabled { opacity: .3; cursor: default; }
.pcar-prev { right: .6rem; }
.pcar-next { left:  .6rem; }
.pcar-dots {
  display: flex;
  justify-content: center;
  gap: .4rem;
  padding: .55rem;
  background: rgba(0,0,0,.07);
}
.pcar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.22);
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.pcar-dot.active { background: var(--primary); }

/* Side carousel (left / right) */
.cms-with-side-carousel {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
.cms-with-side-carousel .page-carousel {
  flex: 0 0 42%;
  margin-bottom: 0;
}
.cms-with-side-carousel .cms-content { flex: 1; min-width: 0; }

@media (max-width: 640px) {
  .cms-with-side-carousel { flex-direction: column; }
  .cms-with-side-carousel .page-carousel { flex: none; width: 100%; }
}

/* Home-page PDF download section */
.pdf-dl-section { text-align: center; }
.pdf-dl-btn {
  font-size: 1.05rem;
  padding: .9rem 2rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border-radius: 8px;
}

/* ══════════════════════════════════════════════════════
   Home-page builder — custom blocks
══════════════════════════════════════════════════════ */
.custom-block-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: -.5rem 0 1.25rem;
}
.custom-block-img {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
}
.custom-block-side {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.custom-block-side .custom-block-img {
  flex: 0 0 42%;
}
.custom-block-side .custom-block-text {
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) {
  .custom-block-side { flex-direction: column; }
  .custom-block-side .custom-block-img { flex: none; width: 100%; }
}

/* ══════════════════════════════════════════════════════
   Shiurim directory
══════════════════════════════════════════════════════ */
.shiur-filters {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.shiur-filters input[type="text"] {
  flex: 1 1 280px;
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  background: #fff;
}
.shiur-filters select {
  padding: .72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  background: #fff;
  min-width: 160px;
}
.shiur-filters input:focus,
.shiur-filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,38,53,.1);
}
.shiur-empty { text-align: center; color: var(--text-muted); padding: 2rem 0; }
.shiur-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.shiur-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.shiur-card-district {
  display: inline-block;
  background: var(--gold-pale);
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 100px;
  margin-bottom: .6rem;
}
.shiur-card-teacher { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: .35rem; }
.shiur-card-venue,
.shiur-card-schedule {
  font-size: .92rem;
  color: var(--text);
  margin-bottom: .3rem;
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  overflow-wrap: anywhere;
  min-width: 0;
}
.shiur-card-venue a,
.shiur-card-schedule a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}
.shiur-card-venue i,
.shiur-card-schedule i { color: var(--text-muted); margin-top: .15rem; }
.shiur-card-contact {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.shiur-card-contact a {
  font-size: .88rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.shiur-card-contact a:hover { color: var(--primary-dark); }

/* ══════════════════════════════════════════════════════
   Perek – Talmudic measures accordion
══════════════════════════════════════════════════════ */
.measures-accordion {
  margin-top: 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.measures-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: var(--gold-pale);
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: background var(--transition);
}
.measures-toggle:hover { background: var(--border); }
.measures-toggle i.fa-scale-balanced { color: var(--gold); margin-left: .5rem; }
.measures-toggle-icon { transition: transform var(--transition); }
.measures-toggle[aria-expanded="true"] .measures-toggle-icon { transform: rotate(180deg); }

.measures-panel { padding: 1.5rem; }
.measures-panel[hidden] { display: none; }

.measures-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.measures-tab-btn {
  padding: .45rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: 'Heebo', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.measures-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.measures-tab-btn:not(.active):hover { border-color: var(--primary); color: var(--primary); }

.measures-table-panel { display: none; }
.measures-table-panel.active { display: block; }

.measures-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.measures-table th,
.measures-table td {
  padding: .6rem .75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.measures-table th {
  background: var(--gold-pale);
  color: var(--primary);
  font-weight: 700;
}
.measures-table td:first-child,
.measures-table th:first-child { text-align: right; font-weight: 600; color: var(--text); }
.measures-table tbody tr:hover { background: var(--gold-pale); }

.measures-cards { display: none; }

.measures-note {
  margin-top: 1.25rem;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 700px) {
  .measures-table { display: none; }
  .measures-cards { display: flex; flex-direction: column; gap: .75rem; }
  .measures-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    background: var(--surface);
  }
  .measures-card-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.02rem;
    margin-bottom: .5rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
  }
  .measures-card-line {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    font-size: .9rem;
    padding: .2rem 0;
  }
  .measures-card-label { color: var(--text-muted); }
  .measures-card-value { font-weight: 600; color: var(--text); }
  .measures-tabs { gap: .4rem; }
  .measures-tab-btn { font-size: .82rem; padding: .4rem .8rem; }
}

/* ══════════════════════════════════════════════════════
   Measures calculator page
══════════════════════════════════════════════════════ */
.calc-hero {
  background: var(--primary);
  padding: 4rem 0 3rem;
  text-align: center;
}
.calc-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; color: var(--gold-light); margin-bottom: .5rem; }
.calc-hero p  { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin: 2.5rem 0 2rem;
}
.calc-tab-btn {
  padding: .55rem 1.25rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: 'Heebo', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.calc-tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.calc-tab-btn:not(.active):hover { border-color: var(--primary); color: var(--primary); }

.calc-category { display: none; max-width: 720px; margin: 0 auto 3rem; }
.calc-category.active { display: block; }

.calc-method-toggle {
  display: flex;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-bottom: none;
}
.calc-method-btn {
  flex: 1;
  padding: .65rem .5rem;
  background: var(--gold-pale);
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.calc-method-btn.active { background: var(--primary); color: #fff; }
.calc-method-btn:not(.active):hover { background: var(--border); color: var(--text); }

.calc-input-row {
  display: flex;
  gap: .75rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.calc-method-toggle + .calc-input-row { border-radius: 0 0 var(--radius) var(--radius); }
.calc-amount,
.calc-unit {
  font-family: 'Heebo', sans-serif;
  font-size: 1.05rem;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.calc-amount { flex: 1; min-width: 0; }
.calc-unit { flex: 1.2; min-width: 0; }
.calc-amount:focus,
.calc-unit:focus { outline: none; border-color: var(--primary); }

.calc-results { margin-top: 1.5rem; }
.calc-base-result {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--gold-pale);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.calc-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .85rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.calc-result-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.calc-result-unit { font-size: .85rem; color: var(--text-muted); }

@media (max-width: 480px) {
  .calc-input-row { flex-direction: column; }
  .calc-results-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-base-result { font-size: 1.2rem; }
}
