/* ── Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Antidot';
  src: url('/static/fonts/osantidottr-regular-web.woff2') format('woff2'),
       url('/static/fonts/osantidottr-regular-web.woff') format('woff');
  font-weight: 400;
}
@font-face {
  font-family: 'Antidot';
  src: url('/static/fonts/osantidottr-light-web.woff2') format('woff2'),
       url('/static/fonts/osantidottr-light-web.woff') format('woff');
  font-weight: 300;
}
@font-face {
  font-family: 'Antidot';
  src: url('/static/fonts/osantidottr-semibold-web.woff2') format('woff2'),
       url('/static/fonts/osantidottr-semibold-web.woff') format('woff');
  font-weight: 600;
}
@font-face {
  font-family: 'Antidot';
  src: url('/static/fonts/osantidottr-bold-web.woff2') format('woff2'),
       url('/static/fonts/osantidottr-bold-web.woff') format('woff');
  font-weight: 700;
}
@font-face {
  font-family: 'Antidot';
  src: url('/static/fonts/osantidottr-extralight-web.woff2') format('woff2'),
       url('/static/fonts/osantidottr-extralight-web.woff') format('woff');
  font-weight: 200;
}

/* ── Color tokens ───────────────────────────────────── */
:root {
  --c-teal:   #2D92AD;
  --c-navy:   #154862;
  --c-olive:  #5E7144;
  --c-orange: #E17D24;
  --c-bg:     #f4f6f8;
  --c-white:  #ffffff;
  --c-gray:   #f0f2f5;
  --c-border: #e4e8ee;
  --c-text:   #154862;
  --c-muted:  #8a9bb0;
  --shadow-sm: 0 2px 10px rgba(21,72,98,.07);
  --shadow-md: 0 6px 24px rgba(21,72,98,.10);
  --shadow-lg: 0 12px 36px rgba(21,72,98,.13);
}

/* ── Global ─────────────────────────────────────────── */
body {
  background: var(--c-bg);
  font-family: 'Heebo', Arial, sans-serif;
  color: var(--c-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Sticky footer: push the footer to the bottom on short pages. */
body > .container.py-4 { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6,
.subject-card-name,
.mega-nav-btn,
.section-label,
.grade-bar-question,
.grade-bar-lbl,
.grade-btn {
  font-family: 'Antidot', Arial, sans-serif;
}

a { color: var(--c-teal); }
a:hover { color: var(--c-navy); }

/* ── Navbar ─────────────────────────────────────────── */
.navbar-meitarim {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: 10px 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 200;
}
.navbar-meitarim .logo img { height: 58px; }

.search-bar {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.search-bar input {
  border-radius: 24px;
  padding: 9px 20px;
  border: 1.5px solid var(--c-border);
  font-size: .95rem;
  font-family: 'Heebo', Arial, sans-serif;
  width: 100%;
  background: var(--c-gray);
  color: var(--c-text);
  transition: border-color .2s, box-shadow .2s;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(45,146,173,.12);
  background: var(--c-white);
}
.search-bar input::placeholder { color: var(--c-muted); }
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
}

.btn-site {
  background: var(--c-teal);
  color: var(--c-white) !important;
  border-radius: 22px;
  padding: 8px 22px;
  font-size: .9rem;
  font-family: 'Heebo', Arial, sans-serif;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  text-decoration: none !important;
  transition: background .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(45,146,173,.25);
}
.btn-site:hover { background: var(--c-navy); box-shadow: var(--shadow-md); }
/* מעבר לספריית העל-יסודי — הירוק הראשי של אותו אתר (#5F7044 שם) */
.btn-site.btn-site-green {
  background: #5F7044;
  box-shadow: 0 2px 8px rgba(95,112,68,.28);
}
.btn-site.btn-site-green:hover { background: #4b5936; }

.nav-link-plain {
  color: var(--c-muted);
  font-size: .88rem;
  text-decoration: none;
  transition: color .15s;
}
.nav-link-plain:hover { color: var(--c-navy); }

/* ── Manage dropdown (navbar) ───────────────────────── */
.nav-manage { position: relative; }
.nav-manage-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'Heebo', Arial, sans-serif;
}
.nav-manage-arrow { font-size: .6rem; vertical-align: middle; }
.nav-manage-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 185px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  z-index: 300;
}
.nav-manage-menu.open { display: block; }
.nav-manage-menu a {
  display: block;
  padding: 7px 16px;
  color: var(--c-text);
  font-size: .88rem;
  text-decoration: none;
}
.nav-manage-menu a:hover { background: var(--c-gray); color: var(--c-navy); }
.nav-manage-header {
  padding: 8px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: .75rem;
  font-weight: 600;
}
.nav-manage-header:first-child { border-top: none; margin-top: 0; }

/* Clickable item names in manage lists — drill into children */
.manage-name-link {
  color: var(--c-text);
  text-decoration: none;
}
.manage-name-link:hover { color: var(--c-teal); text-decoration: underline; }

/* ── Mega menu nav bar ──────────────────────────────── */
.mega-nav {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  position: relative;
  z-index: 100;
}
.mega-nav-inner {
  display: flex;
  flex-direction: row;
  gap: 0;
  justify-content: center;
}
.mega-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-navy);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.mega-nav-btn:hover,
.mega-nav-btn.active {
  color: var(--c-teal);
  border-bottom-color: transparent;
  background: transparent;
}
.mega-nav-btn .arrow {
  font-size: .65rem;
  transition: transform .2s;
  color: var(--c-muted);
}
.mega-nav-btn.active .arrow { transform: rotate(180deg); color: var(--c-teal); }

.mega-dropdown {
  display: none;
  position: absolute;
  right: 0; left: 0;
  top: 100%;
  background: var(--c-white);
  box-shadow: var(--shadow-lg);
  border-top: none;
  border-radius: 0 0 16px 16px;
  z-index: 99;
  padding: 28px 32px;
}
.mega-dropdown.open { display: block; }
.mega-dropdown-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.mega-sub-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.mega-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--c-white);
  text-decoration: none;
  color: var(--c-navy);
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s, transform .12s, box-shadow .15s;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.mega-sub-item:hover {
  background: var(--c-gray);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45,146,173,.3);
}
.mega-sub-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mega-sub-item .sub-name {
  color: var(--c-navy);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mega-grade-tags {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .68rem;
  font-weight: 300;
  color: var(--c-orange);
}

/* ── Grade filter ───────────────────────────────────── */
.grade-bar {
  background: var(--c-white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 22px 28px 24px;
  margin-bottom: 28px;
}
.grade-bar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 16px;
  gap: 12px;
}
.grade-bar-question {
  font-size: 1.1rem;
  color: var(--c-muted);
  font-weight: 600;
  letter-spacing: .01em;
}
.grade-bar-labels {
  display: flex;
  flex-direction: row;
  width: 100%;
}
.grade-bar-lbl {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 2px solid;
  letter-spacing: .01em;
}
.grade-bar-lbl:nth-child(1) { flex: 6; }
.grade-bar-lbl:nth-child(2) { flex: 3; }
.grade-bar-lbl:nth-child(3) { flex: 3; }
.yesodi-lbl   { color: var(--c-teal);   border-color: var(--c-teal); }
.beinayim-lbl { color: var(--c-olive);  border-color: var(--c-olive); }
.elyon-lbl    { color: var(--c-orange); border-color: var(--c-orange); }

.grade-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 14px;
}
.grade-segment {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
}
.yesodi-seg   { flex: 6; }
.beinayim-seg { flex: 3; }
.elyon-seg    { flex: 3; }

/* מצב זמני — מוצג רק יסודי (א–ו), ממורכז. להסיר את המחלקה מהתבנית כשמחזירים חטיבה ותיכון */
.grade-bar.yesodi-only .grade-bar-labels { justify-content: center; }
.grade-bar.yesodi-only .grade-bar-lbl { flex: 0 0 auto; padding: 0 40px 6px; }
.grade-bar.yesodi-only .grade-row { justify-content: center; }
.grade-bar.yesodi-only .yesodi-seg { flex: 0 0 auto; }

.grade-divider {
  width: 1px;
  height: 64px;
  background: var(--c-border);
  margin: 0 12px;
  flex-shrink: 0;
}
.grade-btn {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--c-white);
  text-decoration: none;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 1px 6px rgba(21,72,98,.09);
  border: 1.5px solid var(--c-border);
}
.grade-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.grade-btn.yesodi   { color: var(--c-teal);   border-color: rgba(45,146,173,.3); }
.grade-btn.beinayim { color: var(--c-olive);  border-color: rgba(94,113,68,.3); }
.grade-btn.elyon    { color: var(--c-orange); border-color: rgba(225,125,36,.3); }
.grade-btn.heritage { color: var(--c-orange); border-color: rgba(225,125,36,.35);
                      font-size: .95rem; line-height: 1.1; text-align: center; }

/* Grade buttons inside 'sections' pages (topic heading → grade buttons) */
.section-grade-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 1100px;   /* align with .month-heading column */
  margin: 14px auto 0;
}
.grade-btn.wide { width: auto; padding: 0 26px; }

/* ── Subject cards ──────────────────────────────────── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}
@media (max-width: 900px) { .subjects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .subjects-grid { grid-template-columns: 1fr; } }

.subject-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: block;
  background: var(--c-white);
  transition: transform .18s, box-shadow .18s;
}
.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.subject-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.subject-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--c-gray);
}
.subject-card-name {
  padding: 14px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-navy);
  text-align: center;
  background: var(--c-white);
  border-top: 1px solid var(--c-border);
}

/* ── Enrichment section (העשרה למורות ומורים) ───────── */
/* Homepage featured squares — editor-configurable, above the enrichment row */
.featured-section {
  background: #e5ebf1;
  border-radius: 20px;
  padding: 28px 24px 32px;
  margin-bottom: 36px;
}
.featured-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-navy);
  text-align: center;
  margin-bottom: 20px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
/* "על סדר היום": stay 2-per-row (2×2) on mobile too — no single-column drop */
@media (max-width: 900px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--c-white);
  text-decoration: none;
  color: inherit;
  transition: transform .18s, box-shadow .18s;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
/* "חדש" badge — toggled per square in /manage/featured */
.featured-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 0;
  z-index: 2;
  background: #f5a623;
  color: var(--c-navy);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
  padding: 6px 12px 6px 10px;
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  pointer-events: none;
}
.featured-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.featured-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: #eef2f6;
}
.featured-card-title {
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy);
  text-align: center;
}

.enrichment-section {
  margin-bottom: 36px;
}
.enrichment-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-navy);
  text-align: center;
  margin-bottom: 20px;
}
.enrichment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .enrichment-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .enrichment-grid { grid-template-columns: 1fr; } }

.enrichment-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--c-white);
  transition: transform .18s, box-shadow .18s;
}
.enrichment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.enrichment-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.enrichment-card-title {
  padding: 14px 14px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0;
}
.enrichment-card-text {
  padding: 8px 14px 0;
  font-size: .9rem;
  color: var(--c-muted);
  margin: 0;
  flex: 1;
}
.enrichment-card-btn {
  display: block;
  margin: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--c-teal);
  color: var(--c-white);
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: opacity .15s;
}
.enrichment-card-btn:hover { opacity: .85; color: var(--c-white); }

/* ── Sub-subjects page grid ─────────────────────────── */
.sub-subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* same breathing room as the numbered unit grid */
  gap: 2rem;
  margin-bottom: 32px;
  /* see the note on .units-archive-grid — keeps the picture square */
  --card-h: 100px;
}
@media (max-width: 800px) { .sub-subjects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sub-subjects-grid { grid-template-columns: 1fr; } }

.sub-subject-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--c-white);
  text-decoration: none;
  color: var(--c-navy);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: background .15s, transform .12s, box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.sub-subject-card:hover {
  background: var(--c-gray);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45,146,173,.3);
  color: var(--c-navy);
}
/* redirect sub-categories that lead to ארון הספרים — light turquoise */
.sub-subject-card.aron-ref-sub { background: #c4e7ec !important; border-color: #c4e7ec; }
.sub-subject-card.aron-ref-sub:hover { background: #b4dfe6 !important; }
.sub-subject-subtitle.aron-ref-tag {
  margin-top: 6px;
  font-size: .74rem;
  font-weight: 700;
  color: #016471;
  opacity: .85;
}
.sub-subject-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sub-subject-name { flex: 1; font-size: 1.05rem; font-weight: 700; }
.sub-subject-count {
  font-size: .75rem;
  color: var(--c-white);
  background: var(--c-teal);
  border-radius: 20px;
  padding: 1px 8px;
  flex-shrink: 0;
}

/* ── Grade tags ─────────────────────────────────────── */
.grade-tag {
  display: inline;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 400;
  color: var(--c-orange);
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .15s;
}
.grade-tag:hover { opacity: .7; }
.gt-yesodi, .gt-beinayim, .gt-elyon { color: var(--c-orange); }

.grade-tags {
  display: block;
  margin-top: 6px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 400;
  color: var(--c-orange);
  line-height: 1.4;
}

/* ── Unit cards ─────────────────────────────────────── */
.unit-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  background: var(--c-white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  transition: transform .15s, box-shadow .15s;
  height: 100%;
  color: var(--c-navy);
}
.unit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
/* Cross-listed card from ארון הספרים — light-turquoise tint so it reads as a
   guest unit from another program. */
.unit-card.aron-ref-card {
  background: #c4e7ec;
  border-color: #c4e7ec;
}
.unit-card.aron-ref-card:hover { background: #b4dfe6; box-shadow: 0 12px 28px rgba(1,127,141,.18); }
/* Cross-listed "בשבילי התנ״ך" card — very light blue tint, distinct border. */
.unit-card.tanach-ref-card {
  background: #f2f8fd;
  border: 1.5px solid var(--c-teal);
}
.unit-card.tanach-ref-card:hover { box-shadow: 0 12px 28px rgba(41,128,185,.18); }
/* the inner body is white by default — make it transparent on ref cards so the
   card's own tinted background shows through (otherwise only the edge is tinted). */
.unit-card.aron-ref-card .unit-card-body,
.unit-card.tanach-ref-card .unit-card-body { background: transparent; }
.aron-ref-badge {
  align-self: flex-start;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #a9761a;
  background: #fff;
  border: 1px solid rgba(223,160,41,.5);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.unit-card-img {
  width: 110px; height: 100%; min-height: 100px;
  object-fit: cover; display: block; flex-shrink: 0;
}
.unit-card-img-placeholder {
  width: 110px; min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--c-gray); flex-shrink: 0;
}
.unit-card-number {
  width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Just Another Hand', 'Antidot', cursive;
  font-size: 5rem;
  font-weight: 400;
  color: var(--c-teal);
  line-height: 0.7;
  background: #fff;
  flex-shrink: 0;
  user-select: none;
  padding-top: 0.3em;
}
/* "יחידת הרחבה" — still numbered in sequence, but the number reads as secondary */
.unit-card-number.is-expansion {
  opacity: 0.38;
}
/* More air between unit cards (bootstrap g-3 = 1rem) */
.units-archive-grid {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2rem;
  /* Every card in the grid is as tall as the tallest one, and the coloured
     block is exactly that wide — so it always reads as a square, never a
     tall thin strip. equalizeCardSquares() in base.html measures the tallest
     card and overrides this; the value here is the no-JS fallback. */
  --card-h: 116px;
}

/* Side-number layout — the numeral sits beside the text in one row,
   in a teal block; the title area stays white. */
.unit-card.unit-card-side {
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  /* a border AND a shadow on every card reads as visual noise once the
     teal block is there too — the soft shadow alone defines the card */
  border: none;
  box-shadow: 0 2px 10px rgba(40, 60, 70, .07);
  /* Fixed, not min-height: the block stretches to the card's height and is
     exactly that wide, so pinning the height is what guarantees a square.
     equalizeCardSquares() picks a height that fits the wordiest card. */
  height: var(--card-h, 116px);
}
.unit-card.unit-card-side:hover { box-shadow: 0 12px 26px rgba(40, 60, 70, .13); }
.unit-card-side .unit-card-number {
  /* width == the card's height, and the block stretches to that height */
  width: var(--card-h, 116px);
  min-width: 72px;
  min-height: 0;
  flex: 0 0 auto;
  align-self: stretch;
  font-size: 3.2rem;
  color: #4f9aa6;
  background: #c4e1e5;
  padding: 0 12px;
  padding-top: .25em;
}
.unit-card-side .unit-card-body {
  padding: 14px 16px;
  background: var(--c-white);
  align-items: flex-start;
  text-align: start;
  min-width: 0;
  gap: 4px;
}
/* slightly tighter type than the old stacked card: a two-line title has to fit
   inside the square without being clipped */
.unit-card-side .unit-card-title {
  font-size: 1.08rem;
  line-height: 1.28;
}
.unit-card-side .unit-card-subtitle { font-size: .82rem; }
/* Cross-listed cards carry no number, so the same square slot holds the
   picture of the program they point at. */
.unit-card-side .unit-card-img-sq {
  width: var(--card-h, 116px);
  align-self: stretch;
  flex: 0 0 auto;
  overflow: hidden;
}
.unit-card-side .unit-card-img-sq img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* the tinted guest cards keep their own colour behind the text */
.unit-card-side.aron-ref-card .unit-card-body,
.unit-card-side.tanach-ref-card .unit-card-body { background: transparent; }
.unit-card-body {
  padding: 14px 16px;
  background: var(--c-white);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
}
.unit-card-meta {
  font-size: .75rem;
  color: var(--c-muted) !important;
  margin-bottom: 4px;
}
.unit-card-title {
  font-family: 'Heebo', Arial, sans-serif !important;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--c-navy) !important;
  margin: 0;
  line-height: 1.35;
}

/* ── Sub-subject card with tags ─────────────────────── */
.sub-subject-card {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px;
}
.sub-subject-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.sub-subject-subtitle {
  display: block;
  width: 100%;
  margin-top: 2px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--c-teal);
}
.grade-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Grade view section title ───────────────────────── */
.grade-section-title {
  font-family: 'Antidot', Arial, sans-serif;
  color: var(--c-navy);
  border-right: 3px solid var(--c-teal);
  padding-right: 10px;
  margin-bottom: 12px;
}

/* ── Section label ──────────────────────────────────── */
.section-label {
  font-size: .8rem;
  color: var(--c-muted);
  font-weight: 700;
  text-align: right;
  margin-bottom: 14px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Cards / general ────────────────────────────────── */
.card {
  border: none !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-sm);
}
.card-header {
  border-radius: 14px 14px 0 0 !important;
  background: var(--c-gray);
  border-bottom: 1px solid var(--c-border) !important;
  color: var(--c-navy);
  font-weight: 700;
}
.btn-primary {
  background: var(--c-teal) !important;
  border-color: var(--c-teal) !important;
  border-radius: 10px !important;
  font-family: 'Heebo', Arial, sans-serif;
}
.btn-primary:hover {
  background: var(--c-navy) !important;
  border-color: var(--c-navy) !important;
}
.btn-outline-primary {
  color: var(--c-teal) !important;
  border-color: var(--c-teal) !important;
  border-radius: 10px !important;
}
.btn-outline-primary:hover {
  background: var(--c-teal) !important;
  color: var(--c-white) !important;
}
.btn-outline-secondary {
  color: var(--c-navy) !important;
  border-color: var(--c-border) !important;
  border-radius: 10px !important;
}
.badge.bg-primary, .badge.bg-info { background: var(--c-teal) !important; }
.badge.bg-success               { background: var(--c-olive) !important; }
.badge.bg-warning               { background: var(--c-orange) !important; color: #fff !important; }

/* ── Unit view ──────────────────────────────────────── */
.unit-header {
  background: linear-gradient(135deg, rgba(45,146,173,.08), rgba(21,72,98,.06));
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 24px;
  text-align: center;
  border: 1px solid var(--c-border);
}
.unit-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 8px;
}
.unit-meta { color: var(--c-muted); font-size: .9rem; }
.unit-meta .grade-tag { font-size: .82rem; }

.unit-tabs-wrap {
  margin-bottom: 0;
}
.unit-tabs {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: row;
  border-bottom: 2px solid var(--c-border);
  gap: 0;
}
.unit-tab {
  padding: 12px 28px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.unit-tab:hover { color: var(--c-teal); }
.unit-tab.active {
  color: var(--c-navy);
  border-bottom-color: var(--c-teal);
}

.unit-content-area { padding: 28px 0; }
.unit-panel { display: none; }
.unit-panel.active { display: block; }

.orientation-block {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-navy);
  border-right: 4px solid var(--c-teal);
  background: rgba(45,146,173,.05);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
}

.comp-text {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-navy);
  margin-bottom: 20px;
}
.comp-label {
  font-family: 'Antidot', Arial, sans-serif;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 8px;
  margin-top: 20px;
}
.comp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-teal);
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .9rem;
  margin-bottom: 12px;
  text-decoration: none;
}
.comp-link:hover { color: var(--c-navy); text-decoration: underline; }
.comp-audio, .comp-video { margin-bottom: 20px; max-width: 640px; }
.comp-attached-file { margin-top: -4px; }
.comp-image { margin: 0 0 20px; }
.comp-image img { width: 100%; height: auto; display: block; border-radius: 10px; }
.comp-image figcaption {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .85rem;
  color: #666;
  margin-top: 6px;
}

/* Bottom actions */
.unit-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--c-border);
  margin-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.unit-actions-start, .unit-actions-end {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-unit-nav {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .9rem;
  color: var(--c-teal);
  text-decoration: none;
  padding: 8px 18px;
  border: 1.5px solid var(--c-teal);
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.btn-unit-nav:hover { background: var(--c-teal); color: #fff; }
.btn-unit-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .88rem;
  color: var(--c-navy);
  text-decoration: none;
  padding: 8px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-white);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-unit-action:hover { border-color: var(--c-teal); color: var(--c-teal); }
.btn-unit-edit { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.btn-unit-edit:hover { background: var(--c-teal); border-color: var(--c-teal); color: #fff; }

/* Manage unit tabs */
.manage-tabs {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  border-bottom: 1px solid var(--c-border);
}
.manage-tab {
  padding: 12px 24px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.manage-tab:hover { color: var(--c-teal); }
.manage-tab.active { color: var(--c-navy); border-bottom-color: var(--c-teal); }
.manage-panel { display: none; }
.manage-panel.active { display: block; }

/* ── Breadcrumb ─────────────────────────────────────── */
.breadcrumb-item a { color: var(--c-teal); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--c-navy); text-decoration: underline; }
.breadcrumb-item.active { color: var(--c-muted); }

/* ── Search dropdown ────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0; left: 0;
  background: var(--c-white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  border: 1px solid var(--c-border);
}
.search-dropdown.show { display: block; }
.search-result-item {
  padding: 11px 16px;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  display: block;
  color: var(--c-navy);
  transition: background .12s;
}
.search-result-item:hover { background: var(--c-gray); color: var(--c-teal); }
.search-result-item:last-child { border-bottom: none; }
.search-result-meta { font-size: .78rem; color: var(--c-muted); margin-top: 2px; }

/* ── List group ─────────────────────────────────────── */
.list-group-item {
  border-color: var(--c-border) !important;
  border-radius: 10px !important;
  margin-bottom: 4px;
  color: var(--c-navy);
}
.list-group-item-action:hover { background: var(--c-gray); color: var(--c-teal); }

/* ── Forms ──────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--c-border) !important;
  border-radius: 10px !important;
  font-family: 'Heebo', Arial, sans-serif;
  color: var(--c-navy);
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-teal) !important;
  box-shadow: 0 0 0 3px rgba(45,146,173,.12) !important;
}

/* ── Alert ──────────────────────────────────────────── */
.alert { border-radius: 12px; border: none; }

/* ── Drag & Drop ─────────────────────────────────────── */
.drag-handle {
  cursor: grab;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 4px;
  user-select: none;
  color: var(--c-muted);
  transition: color .15s;
}
.drag-handle:hover { color: var(--c-teal); }
.sortable-ghost { opacity: .4; background: var(--c-gray) !important; }
.sortable-chosen { box-shadow: 0 4px 16px rgba(45,146,173,.18); }

/* ── Grade Picker (sub-subject edit) ─────────────────── */
.grade-pick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--c-border);
  background: var(--c-white);
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  color: var(--c-muted);
}
.grade-pick-btn.gt-yesodi.selected  { background: #e8f5fb; border-color: var(--c-teal);  color: var(--c-teal); }
.grade-pick-btn.gt-beinayim.selected{ background: #eaf0f7; border-color: var(--c-navy);  color: var(--c-navy); }
.grade-pick-btn.gt-elyon.selected   { background: #f2f5ee; border-color: var(--c-olive); color: var(--c-olive); }
.grade-pick-btn.gt-heritage.selected{ background: #fdf1e6; border-color: var(--c-orange); color: var(--c-orange); }
.grade-pick-btn:hover { border-color: var(--c-teal); color: var(--c-teal); }

/* ── Unit View Layout ────────────────────────────────── */
.unit-page-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--c-navy);
  margin-bottom: 1.25rem;
}

.unit-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin: 0 auto 1.5rem;
  max-width: 1100px;
}

.unit-page-title,
.unit-actions-bar,
.unit-nav-bar,
.unit-breadcrumb-bar {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.unit-breadcrumb-bar {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.unit-breadcrumb-bar .breadcrumb {
  margin: 0;
  padding: 0;
  background: transparent;
}
.unit-top-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.unit-top-actions .btn-action-pill {
  padding: .35rem 1rem;
  font-size: .82rem;
}

/* Teacher-intro button (left side of the breadcrumb row) */
.btn-teacher-intro {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  padding: .55rem 1.5rem;
  background: var(--c-teal);
  color: #fff;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.btn-teacher-intro:hover {
  background: var(--c-navy);
  color: #fff;
  transform: translateY(-1px);
}

/* Archive page (units grid) — align to banner width */
.units-archive-grid {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Unit banner — full-width banner with breadcrumbs + title overlay */
.unit-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 1100px;
  margin: 0 auto 1.5rem;
}
/* תלב״ס grade banner — spans the full content width (not capped at 1100px),
   so it lines up with the text/cards below it. */
.unit-banner.talbas-banner {
  max-width: none;
}
.unit-banner-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.unit-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(21,72,98,.78) 0%, rgba(21,72,98,.25) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem 2rem;
}
.unit-banner-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  margin: 0 0 4px;
  line-height: 1.15;
}
.unit-banner-subtitle {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
  margin: 0;
}
.unit-page-subtitle {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1.25rem;
  color: var(--c-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.unit-card-subtitle {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1.05rem;
  color: var(--c-muted);
  line-height: 1.35;
}

/* Content area — left (in RTL: right side visually) */
.unit-content-col {
  flex: 1;
  min-width: 0;
}

.unit-content-card {
  background: var(--c-white);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 2rem 2.25rem;
  min-height: 300px;
}

.unit-panel { display: none; }
.unit-panel.active { display: block; }

.unit-panel-heading {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-teal);
  margin-bottom: 1rem;
}

/* מרקר על הטקסט המרכזי — תצוגה בלבד */
.unit-panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

.unit-panel-heading-row .unit-panel-heading {
  margin-bottom: 0;
}

.marker-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.marker-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text);
  background: var(--c-white);
  border: 1px solid #d9d9d9;
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.marker-btn:hover {
  border-color: #f9c74f;
  background: #fffbea;
}

.marker-btn.active {
  background: #ffe975;
  border-color: #f0c419;
  color: #5c4a00;
}

.marker-btn.marker-clear {
  font-size: 0.8rem;
  padding: 5px 12px;
}

#marker-area.marker-mode {
  cursor: crosshair;
}

#marker-area.marker-mode ::selection {
  background: rgba(255, 233, 117, 0.9);
}

mark.live-mark {
  background: linear-gradient(180deg, rgba(255, 233, 117, 0.35) 0%, #ffe975 30%);
  border-radius: 3px;
  padding: 0 0.08em;
  color: inherit;
}

.orientation-block {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--c-text);
}

/* Clickable cover images below קריאת כיוון (e.g. יום האישה הבינלאומי) */
.unit-kavanah-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}
.unit-kavanah-images a {
  display: block;
  flex: 1 1 200px;
  max-width: 220px;
}
/* Higher specificity than the generic ".orientation-block img" icon clamp
   (which caps bare pasted images at 2em so they read as inline emoji). */
.orientation-block .unit-kavanah-images img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(21, 72, 98, .15);
  transition: transform .2s;
  display: block !important;
}
.unit-kavanah-images a:hover img {
  transform: scale(1.03);
}

/* Right column wrapper — tabs on top, files below */
.unit-right-col {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Tab sidebar — right (in RTL: left side visually) */
.unit-tab-sidebar {
  width: 100%;
}

.unit-tab-nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  background: var(--c-navy);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: rgba(255,255,255,.65);
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .92rem;
  font-weight: 400;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}

.unit-tab-item svg { flex-shrink: 0; opacity: .7; }

.unit-tab-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.unit-tab-item.active {
  background: var(--c-white);
  color: var(--c-navy);
  font-weight: 600;
}

.unit-tab-item.active svg { opacity: 1; }

/* Bottom action buttons */
.unit-actions-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .55rem 1.4rem;
  border-radius: 50px;
  border: 1.5px solid var(--c-border);
  background: var(--c-white);
  color: var(--c-navy);
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all .18s;
}

.btn-action-pill:hover {
  border-color: var(--c-teal);
  color: var(--c-teal);
  box-shadow: var(--shadow-md);
}

.btn-action-edit {
  border-color: var(--c-teal);
  color: var(--c-teal);
}

/* Prev / Next nav */
.unit-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .5rem;
  margin-bottom: 2rem;
}

.unit-nav-side { display: flex; align-items: center; }

.btn-unit-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--c-navy);
  font-family: 'Heebo', Arial, sans-serif;
  font-weight: 500;
  font-size: .95rem;
  transition: color .18s;
}

.btn-unit-nav-pill:hover { color: var(--c-teal); }

.btn-unit-nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-navy);
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background .18s;
}

.btn-unit-nav-pill:hover .btn-unit-nav-arrow { background: var(--c-teal); }

/* File upload rows in manage */
.file-upload-row { background: var(--c-gray); }

/* ── Grade Archive Page ───────────────────────────────── */
.grade-archive-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
}

.grade-archive-badge {
  display: inline-block;
  padding: .3rem 1.1rem;
  border-radius: 50px;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 600;
}
.grade-archive-badge.gt-yesodi  { background: #e8f5fb; color: var(--c-teal); }
.grade-archive-badge.gt-beinayim{ background: #eaf0f7; color: var(--c-navy); }
.grade-archive-badge.gt-elyon   { background: #f2f5ee; color: var(--c-olive); }
.grade-archive-badge.gt-heritage{ background: #fdf1e6; color: var(--c-orange); }

/* ── שבילי מורשת — designed program page ─────────────────── */
.moreshet-banner {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background-color: #eaf4fb;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* RTL: start = right, over the open sky */
  padding: 24px clamp(24px, 6vw, 70px);
  margin: 4px 0 28px;
}
/* Soft sky-coloured scrim, strongest on the right (where the title sits),
   fading out over the illustration on the left — keeps the title legible at any width. */
.moreshet-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left,
    rgba(234,244,251,.97) 0%, rgba(234,244,251,.72) 24%, rgba(234,244,251,0) 55%);
  pointer-events: none;
}
.moreshet-banner-titles {
  position: relative; z-index: 1;
  text-align: right; text-shadow: 0 1px 10px rgba(255,255,255,.85);
}
.moreshet-banner-title {
  font-size: 2.8rem; font-weight: 800; color: #003f5a; margin: 0; line-height: 1.1;
}
.moreshet-banner-kicker {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1.3rem; font-weight: 700; color: #2d92ae; margin: 6px 0 0;
}
.moreshet-intro {
  max-width: 880px; margin: 0 auto 40px; text-align: center;
  color: var(--c-text); line-height: 1.75;
}
.moreshet-intro p { margin: 0 0 12px; }
.moreshet-note {
  font-weight: 700; color: var(--c-teal); margin-top: 18px !important;
}
.moreshet-grade { max-width: 1100px; margin: 0 auto 40px; }
.moreshet-grade-head {
  border-bottom: 2px solid rgba(225,125,36,.25);
  padding-bottom: 10px; margin-bottom: 20px;
}
.moreshet-grade-title {
  font-size: 1.7rem; font-weight: 800; color: var(--c-orange); margin: 0;
}
.moreshet-grade-sub {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1.05rem; color: var(--c-navy); font-weight: 600; margin: 2px 0 0;
}
.moreshet-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.moreshet-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--c-white); border: 1.5px solid var(--c-border);
  border-radius: 14px; padding: 20px 18px 16px; text-decoration: none;
  box-shadow: 0 1px 6px rgba(21,72,98,.08);
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.moreshet-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: rgba(225,125,36,.45);
}
/* Cards with a topic image: square thumbnail on the RIGHT (RTL start),
   text + CTA fill the rest. Cards without an image keep the column layout. */
.moreshet-card.has-img { flex-direction: row; align-items: stretch; gap: 14px; padding: 14px; }
.moreshet-card.has-img .moreshet-card-img {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 12px;
  overflow: hidden; background: #f2f7f8; align-self: center;
}
.moreshet-card.has-img .moreshet-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moreshet-card-main {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
}
.moreshet-card.has-img .moreshet-card-cta { margin-top: 10px; }
.moreshet-card-title {
  font-size: 1.2rem; font-weight: 800; color: var(--c-navy); margin: 0 0 6px;
}
.moreshet-card-sub {
  font-size: .95rem; color: var(--c-muted); line-height: 1.5; margin: 0;
}
.moreshet-card-cta {
  display: inline-block; margin-top: 16px;
  color: var(--c-orange); font-weight: 700; font-size: .95rem;
}
@media (max-width: 640px) {
  .moreshet-banner { min-height: 150px; padding: 16px 24px; }
  .moreshet-banner-title { font-size: 1.9rem; }
  .moreshet-banner-kicker { font-size: 1.05rem; }
  /* one card per row on phones — horizontal image cards need the width */
  .moreshet-cards { grid-template-columns: 1fr; gap: 12px; }
}

.grade-archive-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0;
}

.grade-archive-sub {
  font-family: 'Heebo', Arial, sans-serif;
  color: var(--c-muted);
  font-size: .95rem;
  margin: 0;
}

.grade-subject-section {
  border-top: 2px solid var(--c-border);
  padding-top: 1.5rem;
}

.grade-subject-heading {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-teal);
  margin-bottom: 1.25rem;
}

.grade-sub-subject-heading {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-navy);
  margin: 0 0 .75rem;
}

/* Month headings on the grouped "סימן קריאה" page — larger, aligned with the
   card grid content (offset by the Bootstrap column gutter). */
.month-heading {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--c-navy);
  max-width: 1100px;
  margin: 0 auto 1.25rem;
}

/* ── Program page groups (יחידה ראשונה / שנייה …) ───────── */
.program-group { margin-bottom: 3.5rem; scroll-margin-top: 90px; }
.program-group:last-child { margin-bottom: 0; }
.program-group .month-heading { margin-bottom: 0.75rem; }
.program-anchor-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin: 1.5rem auto 3rem;
  max-width: 1100px;
}
.program-group .orientation-block { max-width: 1100px; margin: 0 auto 1.5rem; }
.program-group-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
  margin: 0 auto 1.75rem;
  max-width: 1100px;
}
/* Group intro with a small square icon beside the text (יום השפה העברית) —
   mirrors the old site's Elementor "image box": 116px icon, text alongside. */
.program-group-intro {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 18px;
}
.program-group-icon {
  width: 116px;
  height: 116px;
  object-fit: contain;
  flex: none;
  margin-top: 6px;
}
.program-group-text { min-width: 0; flex: 1; }
.program-group-text .month-heading { margin-top: 0; }
@media (max-width: 767px) {
  .program-group-intro { gap: 14px; }
  .program-group-icon { width: 76px; height: 76px; }
}

.program-group-img { display: block; }
.program-group-img img {
  height: 680px;
  max-width: 100%;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(21,72,98,.18);
  transition: transform .2s;
}
.program-group-img:nth-child(odd) img { transform: rotate(-1.5deg); }
.program-group-img:nth-child(even) img { transform: rotate(1.5deg); }
.program-group-img:hover img { transform: rotate(0) scale(1.03); }
@media (max-width: 767px) {
  .program-group-img img { height: auto; width: 100%; }
}

/* ── Spiral program page (תכנית ספיראלית, e.g. ימים נוראים) ──
   One row per grade: a big grade-letter illustration on the right,
   then a column per topic — icon + title and slim outlined unit
   bars. No frames or white boxes; sits on the page background. */
.spiral-grade {
  max-width: 1100px;
  margin: 0 auto 4rem;
  scroll-margin-top: 90px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: center;
}
/* holidays with no shared topic (one plain unit-list column per grade) —
   two grades share one row instead of each stretching a lone narrow column
   across the full width, leaving the other side empty. */
.spiral-grade-pair {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.spiral-grade-half {
  max-width: none;
  margin: 0;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
}
.spiral-grade-half .spiral-letter-img { max-width: 110px; }
.spiral-grade-half .spiral-topics-single {
  grid-template-columns: minmax(160px, 1fr);
}
@media (max-width: 767px) {
  .spiral-grade-pair { grid-template-columns: 1fr; gap: 1.25rem; }
}
/* topic columns — auto-fit so a holiday can have 3 or 4 topics per row */
.spiral-topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 1.25rem;
  align-self: start;
}
/* No shared topic (e.g. פתיחת שנה) — a single unnamed unit-list column:
   keep it a compact block next to the letter, vertically centered with
   it, instead of stretching across the full row like a multi-topic grid. */
.spiral-topics-single {
  grid-template-columns: minmax(220px, 340px);
  justify-content: start;
  align-self: center;
}
/* exactly 2 topics — keep both columns compact instead of the auto-fit grid
   stretching each one to fill the whole row. */
.spiral-topics-2 {
  grid-template-columns: repeat(2, minmax(160px, 220px));
  justify-content: start;
}
.spiral-letter {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* grade CLUSTER (e.g. "כיתה א-ב") — two letter illustrations side by side,
   each shrunk so the pair still fits the 200px column. */
.spiral-letter-multi {
  gap: .35rem;
}
.spiral-letter-multi .spiral-letter-img {
  max-width: 48%;
}
.spiral-letter-img {
  max-width: 100%;
  height: auto;
  /* the artwork ships on a baked white background — multiply melts it
     into the page background so no white box shows */
  mix-blend-mode: multiply;
}
.spiral-letter-fallback {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-navy);
  white-space: nowrap;
}
.spiral-topic {
  align-self: start;
}
.spiral-topic-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
  color: #222;
  margin: 0 0 .85rem;
}
.spiral-topic-title span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spiral-topic-icon {
  width: 56px;
  height: auto;
  mix-blend-mode: multiply;
}
.spiral-topic-units {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.spiral-unit-btn {
  display: block;
  background: rgba(45, 146, 173, .09);
  border-radius: 8px;
  padding: .55rem .9rem;
  text-align: center;
  color: var(--c-navy);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.spiral-unit-btn:hover {
  background: rgba(45, 146, 173, .2);
  color: var(--c-navy);
  transform: translateY(-2px);
}
/* cross-listed card from ארון הספרים — light turquoise so it reads as a guest unit */
.spiral-aron-btn {
  background: #c4e7ec;
  border: 1px solid #c4e7ec;
  color: #015a66;
  font-weight: 700;
}
.spiral-aron-btn:hover { background: #b4dfe6; color: #015a66; }
/* unit with its own cover image (e.g. סדר כיתתי per-grade plate) — thumbnail
   beside the label instead of a plain text pill */
.spiral-unit-btn-cover {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-align: right;
  padding: .4rem .6rem;
}
.spiral-unit-cover {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
@media (max-width: 991px) {
  .spiral-grade { grid-template-columns: 1fr; gap: 1.25rem; }
  .spiral-letter-img { max-width: 180px; }
}
@media (max-width: 640px) {
  /* one topic per row on mobile — auto-fit's minmax(185px,1fr) still
     squeezes 2 narrow columns onto a phone-width screen */
  .spiral-topics { grid-template-columns: 1fr; }
}

/* ── Spiral page card-row sections (חוברות להדפסה / הרחבות רב גילאיות) ──
   image beside the text (not above), centered under a centered heading */
.ext-card { flex-direction: row; align-items: center; }
.ext-card-cover {
  width: 128px;
  height: 128px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  padding: 8px;
}
.ext-card .unit-card-body {
  align-items: flex-start;
  text-align: right;
  justify-content: center;
}
.ext-card .unit-card-title { font-size: 1rem; }
.ext-card .unit-card-subtitle { font-size: .8rem; }
.ext-heading { text-align: center; font-size: 1.4rem; }
.ext-grid { justify-content: center; }
/* 4-in-a-row variant — narrower cards, so a smaller image and text */
.ext-grid-4 .ext-card-cover { width: 96px; height: 96px; }
.ext-grid-4 .unit-card-title { font-size: .92rem; }
@media (max-width: 575px) {
  .ext-card-cover { width: 84px; height: 84px; padding: 6px; }
  .ext-card .unit-card-body { padding: 10px 12px; }
  .ext-card .unit-card-title { font-size: .92rem; }
  .ext-card .unit-card-subtitle { font-size: .75rem; }
  .ext-heading { font-size: 1.25rem; }
}

/* ── Standalone content page (e.g. מתודות לקריאה) ─────────── */
.content-page-intro {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
}
.content-method-cards { margin-bottom: 2.5rem; }

/* Anchor cards — bigger title (Antidot) + larger icon */
.method-card-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.5rem !important;
  font-weight: 700;
  line-height: 1.25;
}
.method-card-icon .method-img { width: 132px; height: 132px; object-fit: contain; }
.method-card-icon { min-height: 140px; }

/* Detail area — tinted background holding white "boxes" */
.method-sections-area {
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(45,146,173,.07);
  border-radius: 16px;
  padding: 1.5rem;
}
.method-section { scroll-margin-top: 90px; }
.method-section-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.25rem;
}
.method-section:last-child .method-section-card { margin-bottom: 0; }

/* Heading row — icon on the right, title right-aligned next to it (RTL) */
.method-section-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: .75rem;
}
.method-section-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0;
}
.method-section-icon { flex: 0 0 auto; color: var(--c-teal); display: inline-flex; }
.method-section-icon .method-img { width: 52px; height: 52px; object-fit: contain; }

/* Anchor cards — same look as .unit-card but with an icon instead of a number */
.method-card {
  align-items: center;
  text-align: center;
  padding-top: 1.25rem;
}
.method-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--c-teal);
}
.method-card .unit-card-title { font-size: 1.15rem; }

/* Expanded sections — icon + heading row, and scroll offset for anchor jumps */
.method-section { scroll-margin-top: 90px; }
.method-section-head {
  max-width: 1100px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.method-section-icon {
  display: inline-flex;
  color: var(--c-teal);
  flex: 0 0 auto;
}
.method-section .comp-text {
  max-width: 1100px;
  margin: 0 auto;
}

/* Inline HTML embed (uploaded into the WYSIWYG text, e.g. a מצגת) — both in the
   public view (.comp-text) and inside the Quill editor (.ql-editor). */
.comp-text iframe.comp-embed-frame,
.ql-editor iframe.comp-embed-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  margin: 1rem 0;
  border-radius: 8px;
  background: #fff;
}

/* Grade page — section banner with breadcrumbs */
.grade-section-banner {
  position: relative;
  height: 110px;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.grade-section-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(21,72,98,.75) 0%, rgba(21,72,98,.45) 100%);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
}
.grade-section-crumbs {
  display: flex;
  align-items: center;
  gap: .55rem;
  direction: rtl;
}
.grade-section-crumbs a {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: opacity .15s;
}
.grade-section-crumbs a:hover { opacity: .85; text-decoration: underline; }
.grade-section-crumbs .crumb-sep {
  color: rgba(255,255,255,.65);
  font-size: 1.1rem;
  font-weight: 400;
}

/* ── Quill WYSIWYG ───────────────────────────────────── */
.ql-toolbar.ql-snow {
  border-radius: 10px 10px 0 0 !important;
  border-color: var(--c-border) !important;
  background: var(--c-gray);
  direction: rtl;
}
.ql-container.ql-snow {
  border-radius: 0 0 10px 10px !important;
  border-color: var(--c-border) !important;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: 1rem;
}
.ql-editor {
  min-height: 160px;
  direction: rtl;
  text-align: right;
  font-family: 'Heebo', Arial, sans-serif;
  color: var(--c-text);
  line-height: 1.8;
}
.ql-editor.ql-blank::before {
  right: 12px;
  left: unset;
  font-style: normal;
  color: var(--c-muted);
}

/* ── Quill color picker customization ────────────────── */
/* Brand colors get a slightly larger swatch + gold ring */
.ql-color-picker .ql-picker-options .ql-picker-item[data-value="#2D92AD"],
.ql-color-picker .ql-picker-options .ql-picker-item[data-value="#154862"],
.ql-color-picker .ql-picker-options .ql-picker-item[data-value="#5E7144"],
.ql-color-picker .ql-picker-options .ql-picker-item[data-value="#E17D24"] {
  width: 22px !important;
  height: 22px !important;
  border-radius: 4px !important;
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 1px;
}

/* Separator line between palette and hex input */
.hex-sep {
  border-top: 1px solid #ddd;
  margin: 6px 4px 4px;
}

/* Hex input row */
.hex-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 6px;
}
.hex-text {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: .78rem;
  font-family: monospace;
  width: 0;
  min-width: 0;
  direction: ltr;
}
.hex-swatch {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  padding: 1px;
  cursor: pointer;
  flex-shrink: 0;
}
.hex-apply {
  background: var(--c-teal);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: .85rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hex-apply:hover { background: var(--c-navy); }

/* ── Files sidebar (now stacked under tabs in right column) ─ */
/* Files sidebar — same design as the tab box above, but in תכלת (teal) */
.unit-files-sidebar {
  width: 100%;
  background: var(--c-teal);
  border-radius: 16px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-file-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,.85);
  font-size: .92rem;
  text-decoration: none;
  text-align: right;
  transition: all .18s;
}

.unit-file-item:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

.unit-file-item svg {
  width: 20px;
  height: 20px;
  opacity: .85;
  flex-shrink: 0;
}

/* "מתודות קריאה" (במדבר units) — sits inside the teal files box like the rest */

.unit-file-label {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Quill content: constrain images & icons ─────────── */
.ql-editor img,
.ql-editor .ql-icon,
.orientation-block img,
.comp-text img {
  max-width: 100%;
  max-height: 120px;
  width: auto;
  height: auto;
  vertical-align: middle;
  display: inline-block;
}

/* Emoji rendered as text stay at 1.2em max */
.ql-editor,
.orientation-block,
.comp-text {
  font-size: 1rem;
}

/* Prevent pasted content from bringing in huge inline styles */
.ql-editor span[style*="font-size: 40"],
.ql-editor span[style*="font-size: 3"],
.ql-editor span[style*="font-size: 4"],
.ql-editor span[style*="font-size: 5"],
.ql-editor span[style*="font-size: 6"],
.ql-editor span[style*="font-size: 7"],
.ql-editor span[style*="font-size: 8"],
.ql-editor span[style*="font-size: 9"] {
  font-size: 1.2em !important;
}

.orientation-block span[style*="font-size: 40"],
.orientation-block span[style*="font-size: 3"],
.orientation-block span[style*="font-size: 4"],
.orientation-block span[style*="font-size: 5"],
.comp-text span[style*="font-size: 40"],
.comp-text span[style*="font-size: 3"],
.comp-text span[style*="font-size: 4"],
.comp-text span[style*="font-size: 5"] {
  font-size: 1.2em !important;
}

/* ── Emoji size fix in editor + view ─────────────────── */
.ql-editor *,
.orientation-block *,
.comp-text * {
  font-size: inherit;
}

.ql-editor,
.orientation-block,
.comp-text {
  font-size: 1rem !important;
  line-height: 1.85;
}

/* Quill size classes — cap at reasonable values */
.ql-editor .ql-size-small  { font-size: .85rem !important; }
.ql-editor .ql-size-large  { font-size: 1.2rem  !important; }
.ql-editor .ql-size-huge   { font-size: 1.5rem  !important; }

/* Same caps in view */
.orientation-block .ql-size-small,
.comp-text .ql-size-small  { font-size: .85rem !important; }
.orientation-block .ql-size-large,
.comp-text .ql-size-large  { font-size: 1.2rem  !important; }
.orientation-block .ql-size-huge,
.comp-text .ql-size-huge   { font-size: 1.5rem  !important; }

/* ── Constrain pasted images inside editor & view ───── */
.ql-editor img {
  max-height: 2em !important;
  max-width: 2em !important;
  width: auto !important;
  height: auto !important;
  vertical-align: middle !important;
  display: inline !important;
}

.orientation-block img,
.comp-text img {
  max-height: 2em !important;
  max-width: 2em !important;
  width: auto !important;
  height: auto !important;
  vertical-align: middle !important;
  display: inline !important;
}

/* Images uploaded via the editor toolbar are inserted with width="33%" — they
   display at 33% width, overriding the 2em icon constraint above (the attribute
   selector wins on specificity, and Quill preserves the width attribute). */
.ql-editor img[width="33%"],
.orientation-block img[width="33%"],
.comp-text img[width="33%"] {
  width: 33% !important;
  max-width: 33% !important;
  max-height: none !important;
  height: auto !important;
  display: block !important;
  margin: .5rem 0 !important;
}

/* Imported inline icons / small graphics — capped to an icon size, never the
   33% illustration width and never the tiny 2em emoji clamp. More specific than
   the generic ".comp-text img" caps above, so it wins without touching them. */
.ql-editor img.content-icon,
.orientation-block img.content-icon,
.comp-text img.content-icon {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  max-width: 36px !important;
  max-height: 36px !important;
  margin: .25rem !important;
  vertical-align: middle !important;
}

/* ── Print styles ─────────────────────────────────────── */
@media print {
  /* Hide ALL chrome — navbar, mega-menu, breadcrumb, buttons */
  .navbar-meitarim,
  .mega-nav,
  .mega-dropdown,
  nav.breadcrumb,
  .breadcrumb,
  .unit-right-col,
  .unit-tab-sidebar,
  .unit-files-sidebar,
  .unit-actions-bar,
  .unit-nav-bar,
  .alert,
  header, footer {
    display: none !important;
  }

  /* Kill all spacing left by hidden navbar */
  html, body { margin: 0 !important; padding: 0 !important; }
  .container.py-4 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    max-width: 100% !important;
  }

  /* Reset layout — full width, no flex */
  .unit-layout {
    display: block !important;
  }

  .unit-content-col {
    width: 100% !important;
  }

  .unit-content-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  /* Show ALL panels */
  .unit-panel {
    display: block !important;
    page-break-inside: avoid;
    margin-bottom: 2rem;
  }

  /* Hide files panel */
  #panel-files {
    display: none !important;
  }

  /* Section heading */
  .unit-panel-heading {
    font-size: 1.1rem;
    border-bottom: 2px solid #154862;
    padding-bottom: .4rem;
    margin-bottom: 1rem;
    color: #154862 !important;
  }

  /* Title */
  .unit-page-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #000 !important;
  }

  body {
    font-size: 11pt;
    color: #000;
  }

  /* Avoid page break inside a paragraph */
  p, li {
    orphans: 3;
    widows: 3;
  }

  a { color: #000 !important; text-decoration: none !important; }
}

/* ════════════════════════════════════════════════════════
   MOBILE RESPONSIVE  (≤ 768px)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Navbar ──────────────────────────────────────────── */
  .navbar-meitarim .container {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .navbar-meitarim .logo img { height: 40px; }
  .search-bar { order: 3; flex-basis: 100%; max-width: 100% !important; }
  .btn-site { font-size: .8rem; padding: 5px 10px; }
  .nav-link-plain { font-size: .8rem; }

  /* ── Mega-menu ───────────────────────────────────────── */
  .mega-nav-inner {
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    /* centering + overflow scroll clips the first items — keep start-aligned */
    justify-content: flex-start;
  }
  .mega-nav-btn { font-size: .78rem; padding: 6px 10px; white-space: nowrap; }
  .mega-sub-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Grade bar ───────────────────────────────────────── */
  .grade-bar { padding: 12px; }
  .grade-bar-header { display: none; }
  .grade-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 4px;
  }
  .grade-segment { flex-wrap: nowrap; gap: 4px; }
  /* יסודי-בלבד: כל הכפתורים (א–ו + שבילי מורשת) נגלשים לשורה שנייה במרכז,
     במקום להיגלל אופקית ולהיחתך במסך צר */
  .grade-bar.yesodi-only .grade-row { flex-wrap: wrap; overflow-x: visible;
    justify-content: center; }
  .grade-bar.yesodi-only .yesodi-seg { flex-wrap: wrap; justify-content: center;
    row-gap: 8px; }
  /* אם חטיבה/תיכון יחזרו — השורה המלאה עדיין נגללת אופקית */
  .grade-divider { flex-shrink: 0; }
  .grade-btn { width: 44px; height: 44px; font-size: .85rem; flex-shrink: 0; }

  /* ── Subject grid ────────────────────────────────────── */
  .subjects-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* ── Sub-subjects grid ───────────────────────────────── */
  .sub-subjects-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

  /* ── Unit cards grid ─────────────────────────────────── */
  .row.g-3 > .col-sm-6.col-md-4.col-lg-3 { flex: 0 0 50%; max-width: 50%; }

  /* ── Unit view layout ────────────────────────────────── */
  .unit-layout {
    flex-direction: column;
    gap: 0;
  }

  /* Right column: full width on mobile, no longer a stacked column */
  .unit-right-col {
    width: 100%;
    order: 1;
    gap: 0;
  }

  /* Tabs: horizontal strip on top */
  .unit-tab-sidebar {
    width: 100%;
    order: 1;
  }
  .unit-tab-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    padding: 6px;
    gap: 4px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
  }
  .unit-tab-item {
    flex-direction: column;
    gap: 4px;
    padding: .5rem .75rem;
    font-size: .75rem;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
  }
  .unit-tab-item svg { width: 16px; height: 16px; }

  /* Content: full width */
  .unit-content-col { order: 2; width: 100%; }
  .unit-content-card { padding: 1rem; }

  /* Files: horizontal strip below content */
  .unit-files-sidebar {
    width: 100%;
    order: 3;
    gap: 8px;
    margin-top: 12px;
  }
  .unit-file-item {
    padding: 10px 14px;
    border-radius: 10px;
    gap: 8px;
  }
  .unit-file-item svg { width: 22px; height: 22px; }

  /* Actions bar */
  .unit-actions-bar {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .btn-action-pill { width: 100%; max-width: 260px; justify-content: center; }

  /* Prev/Next */
  .unit-nav-bar { flex-direction: row; gap: 8px; }
  .btn-unit-nav-pill { font-size: .85rem; gap: 6px; }
  .btn-unit-nav-arrow { width: 36px; height: 36px; font-size: .9rem; }

  /* ── Grade archive ───────────────────────────────────── */
  .grade-archive-title { font-size: 1.4rem; }

  /* ── Manage forms ────────────────────────────────────── */
  .manage-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .manage-tab { white-space: nowrap; font-size: .82rem; padding: 8px 12px; flex-shrink: 0; }
}

/* ── Tablet (769px – 992px) ──────────────────────────── */
@media (min-width: 769px) and (max-width: 992px) {
  .subjects-grid { grid-template-columns: repeat(3, 1fr); }
  .sub-subjects-grid { grid-template-columns: repeat(3, 1fr); }
  .mega-sub-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .unit-right-col { width: 170px; }
}

/* ── Phone: category cards & mega-nav dropdown one per row ─ */
/* Placed after the 768px block so it wins the cascade — otherwise the generic
   mobile rules (repeat(2,1fr)) leave cramped ~170px items on a phone.
   .mega-sub-grid needs !important to beat the !important rule in the 768 block. */
@media (max-width: 600px) {
  .sub-subjects-grid { grid-template-columns: 1fr; }
  .mega-sub-grid { grid-template-columns: 1fr !important; }
}

/* ── יום הולדת בית ספרי ───────────────────────────────── */
.bday-banner {
  border-radius: 18px;
  overflow: hidden;
  background: #e4f1fa;
  box-shadow: var(--shadow-md);
}
.bday-banner-img {
  width: 100%;
  height: auto;
  display: block;
}
.bday-intro {
  text-align: center;
  max-width: 820px;
  margin: 2.4rem auto 1rem;
}
.bday-intro-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 1.1rem;
}
.bday-intro-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #5a6b78;
  margin: 0;
}
/* למה ולמי? — full-bleed sage band with zig-zag dashed cards */
.bday-why {
  background: #edf1de;
  /* break out of the .container to span the full viewport width */
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: 3rem 0 3.5rem;
}
.bday-why-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--c-navy);
  text-align: center;
  margin-bottom: 2.5rem;
}
.bday-why-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 1.6rem 0;
}
.bday-why-row--right { justify-content: flex-start; }
.bday-why-row--left  { justify-content: flex-end; }
.bday-why-card {
  background: #fff;
  border: 2px dashed var(--c-navy);
  border-radius: 16px;
  padding: 1.7rem 2rem;
  max-width: 620px;
  font-size: 1.02rem;
  line-height: 1.95;
  color: #4f5f57;
  text-align: right;
}
.bday-gift {
  width: 150px;
  height: auto;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .bday-intro { margin-top: 1.6rem; }
  .bday-intro-title { font-size: 1.5rem; }
  .bday-intro-text { font-size: .98rem; line-height: 1.8; }
  .bday-why { padding: 2rem 0 2.2rem; }
  .bday-why-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
  .bday-why-row,
  .bday-why-row--right,
  .bday-why-row--left {
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    margin: 1.2rem 0;
  }
  .bday-why-card { font-size: .98rem; line-height: 1.8; padding: 1.3rem 1.4rem; }
  .bday-gift { width: 110px; order: -1; }
}

/* jump cards — three anchor links to the sections below */
.bday-jump { margin: 2.6rem 0 1rem; }
.bday-jump-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.bday-jump-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #fff;
  border: 1.5px solid rgba(45,146,173,.45);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: var(--c-navy);
  font-size: 1.15rem;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.bday-jump-card img { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.bday-jump-card:hover {
  border-color: var(--c-teal);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: var(--c-teal);
}
@media (max-width: 768px) {
  .bday-jump-grid { grid-template-columns: 1fr; gap: .9rem; }
  .bday-jump-card { font-size: 1.05rem; }
}

/* #prp — preparations (gingham band) */
.bday-prep {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  margin-top: 2.6rem;
  padding: 3rem 0 3.5rem;
  background: #eef4fb url("../img/birthday/משבצות.jpg") center top / cover;
  scroll-margin-top: 90px;
}
.bday-section-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--c-navy);
  text-align: center;
  margin-bottom: 2rem;
}
.bday-checklist {
  list-style: none;
  max-width: 880px;
  margin: 0 auto 2.6rem;
  padding: 0;
}
.bday-checklist li {
  position: relative;
  padding-right: 2.2rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #3a4a55;
}
.bday-checklist li::before {
  content: "✓";
  position: absolute;
  right: 0;
  top: .1em;
  color: var(--c-teal);
  font-weight: 800;
  font-size: 1.15rem;
}
.bday-checklist strong { color: var(--c-navy); }
.bday-prep-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  max-width: 980px;
  margin: 0 auto 2.4rem;
}
.bday-prep-col {
  text-align: center;
  background: rgba(255,255,255,.7);
  border-radius: 16px;
  padding: 1.8rem 1.4rem;
}
.bday-prep-col img { width: 92px; height: 92px; object-fit: contain; }
.bday-prep-col h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: .7rem 0 .5rem;
}
.bday-prep-col p { font-size: .98rem; line-height: 1.7; color: #3a4a55; margin: 0; }
.bday-kit {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  max-width: 760px;
  margin: 0 auto;
  background: rgba(255,255,255,.7);
  border-radius: 16px;
  padding: 1.4rem 1.8rem;
}
.bday-kit-img { width: 110px; height: 110px; object-fit: contain; flex-shrink: 0; }
.bday-kit-text h3 { font-size: 1.25rem; font-weight: 700; color: var(--c-navy); margin: 0 0 .5rem; }
.bday-kit-text p { font-size: .98rem; line-height: 1.75; color: #3a4a55; margin: 0; }
@media (max-width: 768px) {
  .bday-prep { padding: 2rem 0 2.4rem; margin-top: 1.6rem; }
  .bday-section-title { font-size: 1.5rem; }
  .bday-prep-cols { grid-template-columns: 1fr; gap: 1.4rem; }
  .bday-kit { flex-direction: column; text-align: center; }
}

/* #dl — files to print */
.bday-dl { margin: 3rem 0; scroll-margin-top: 90px; }
.bday-dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  max-width: 920px;
  margin: 0 auto;
}
.bday-dl-item {
  text-align: center;
  background: #fff;
  border: 1px solid rgba(21,72,98,.10);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 1.6rem 1.4rem;
}
.bday-dl-item h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 1rem;
}
.bday-dl-item a {
  display: inline-block;
  transition: transform .15s;
}
.bday-dl-item img {
  width: 100%;
  max-width: 210px;
  height: auto;
  display: block;
  border-radius: 10px;
}
.bday-dl-item a:hover { transform: scale(1.04); }

/* #idea — activity flow (zig-zag steps) */
.bday-flow { margin: 3rem 0 1rem; scroll-margin-top: 90px; }
.bday-flow-list { max-width: 980px; margin: 0 auto; }
.bday-flow-step {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 1.6rem 0;
}
.bday-flow-step:nth-child(even) { flex-direction: row-reverse; }
.bday-flow-img { flex-shrink: 0; width: 210px; text-align: center; }
.bday-flow-img img { width: 100%; height: auto; }
.bday-flow-text { flex: 1; }
.bday-flow-text h3 {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0 0 .6rem;
}
.bday-flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--c-teal);
  color: #fff;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.bday-flow-text p { font-size: 1.02rem; line-height: 1.9; color: #4f5f57; margin: 0; }
@media (max-width: 768px) {
  .bday-dl-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .bday-flow-step,
  .bday-flow-step:nth-child(even) { flex-direction: column; text-align: center; gap: .8rem; margin: 1.8rem 0; }
  .bday-flow-img { width: 150px; }
  .bday-flow-text h3 { justify-content: center; font-size: 1.2rem; }
  .bday-flow-text p { text-align: right; }
}

/* ── שבוע החיים המשותפים ──────────────────────────────── */
.sl-banner {
  border-radius: 18px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #9c4a6b;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.sl-banner-overlay { text-align: center; padding: 1.5rem 1.2rem; }
.sl-banner-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2.3rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  margin: 0 0 .6rem;
}
.sl-banner-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
  margin: 0;
  line-height: 1.5;
}
.sl-intro {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 2.4rem 0 1rem;
}
.sl-intro-video {
  flex: 0 0 42%;
  max-width: 42%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sl-intro-video iframe { width: 100%; height: 100%; display: block; }
.sl-intro-text { flex: 1; }
.sl-intro-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0 0 .8rem;
}
.sl-intro-text p { font-size: 1.02rem; line-height: 1.85; color: #4f5f57; margin: 0 0 .8rem; }
.sl-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin: 2.4rem 0 1rem;
}
.sl-card {
  background: #f4f1ea;
  border: 1px solid rgba(21,72,98,.08);
  border-radius: 14px;
  padding: 1.4rem 1.3rem 1.2rem;
  /* number leads on the right, text starts alongside it — same shape as the
     numbered tiles in ברכות השחר / עיון תפילה */
  text-align: start;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: .9rem;
  transition: box-shadow .15s, transform .15s;
}
.sl-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sl-card-number {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: center;
  font-family: 'Just Another Hand', 'Antidot', cursive;
  font-size: 2.8rem;
  line-height: .78;
  font-weight: 400;
  color: var(--c-teal);
  margin: 0;
  user-select: none;
}
.sl-card-title { font-size: 1.25rem; font-weight: 700; color: var(--c-navy); margin: 0 0 .5rem; }
.sl-card-subtitle { font-size: .98rem; color: #6a7882; line-height: 1.6; margin: 0 0 1.1rem; flex: 1; }
.sl-card-link {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(21,72,98,.2);
  border-radius: 8px;
  padding: .45rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-teal);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sl-card-link:hover { background: var(--c-teal); color: #fff; }
@media (max-width: 768px) {
  .sl-banner-title { font-size: 1.6rem; }
  .sl-banner-subtitle { font-size: 1rem; }
  .sl-intro { flex-direction: column; gap: 1.2rem; }
  .sl-intro-video { flex: none; max-width: 100%; width: 100%; }
  .sl-cards { grid-template-columns: 1fr; }
}

/* ── Subject banner ───────────────────────────────────── */
.subject-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.subject-banner-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}









.subject-banner-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
  margin: 0;
}
.subject-page-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-navy);
}

@media (max-width: 768px) {
  .subject-banner-img { height: 140px; }
  .subject-banner-title { font-size: 1.5rem; }
  .subject-banner-overlay { padding: 0 1.2rem; }
  .unit-banner-img { height: 160px; }
  .unit-banner-title { font-size: 1.4rem; }
  .unit-banner-subtitle { font-size: 1.1rem; }
  .unit-banner-overlay { padding: .8rem 1rem; }
  .unit-banner-breadcrumb .breadcrumb-item,
  .unit-banner-breadcrumb .breadcrumb-item a { font-size: .78rem; }
}
.subject-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(21,72,98,.72) 0%, rgba(21,72,98,.15) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.2rem 2rem;
}

/* ── Sub-subject card with image ─────────────────────── */
.sub-subject-card.has-image {
  flex-direction: row !important;
  align-items: stretch !important;
  padding: 0 !important;
  overflow: hidden;
  height: var(--card-h, 100px);
}

.sub-subject-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  justify-content: center;
}

.sub-subject-img-wrap {
  /* width == the card's height (every card matches the tallest in the grid),
     so the picture fills the full height and still reads as a square instead
     of a tall thin strip cropped at the sides. --card-h is the border-box
     height, and the picture only spans the content box, hence the 1px border
     top and bottom subtracted here. */
  width: calc(var(--card-h, 100px) - 2px);
  align-self: stretch;
  flex: 0 0 auto;
  order: -1; /* image on right in RTL (first in DOM = rightmost) */
}

.sub-subject-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card without image keeps original layout */
.sub-subject-card:not(.has-image) .sub-subject-body {
  padding: 0;
}


/* ── Delete confirmation modal ───────────────────────── */
.delete-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21,72,98,.45);
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.delete-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: var(--c-white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
}
.delete-modal-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.delete-modal-title {
  font-family: 'Antidot', Arial, sans-serif;
  font-size: 1.3rem;
  color: var(--c-navy);
  margin-bottom: .75rem;
}
.delete-modal-msg {
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .95rem;
  color: var(--c-text);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.delete-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ── Mega-menu sub-subject thumbnail ─────────────────── */
.mega-sub-img {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.mega-sub-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Mega-menu two-panel layout ──────────────────────── */
.mega-two-panel {
  display: flex;
  gap: 0;
  min-height: 220px;
}

.mega-panel-parents {
  width: 220px;
  flex-shrink: 0;
  border-left: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega-panel-children {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
}

.mega-parent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Heebo', Arial, sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--c-navy);
  transition: background .15s;
  gap: 8px;
}
.mega-parent-item:hover,
.mega-parent-item.active {
  background: var(--c-gray);
  color: var(--c-teal);
}
.mega-parent-item.active { background: var(--c-navy); color: #fff; }
.mega-parent-item.active .mega-child-arrow { color: #fff; }
.mega-parent-item .sub-name { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.mega-child-arrow {
  font-size: .65rem;
  color: var(--c-muted);
  flex-shrink: 0;
}

.mega-child-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--c-white);
  text-decoration: none;
  color: var(--c-navy);
  font-size: .88rem;
  font-weight: 500;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: background .15s, transform .12s;
}
.mega-child-item:hover {
  background: var(--c-gray);
  transform: translateX(-2px);
  color: var(--c-teal);
}
.mega-child-item .sub-name { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* ── Home welcome ───────────────────────────────────── */
.home-welcome {
  text-align: center;
  margin: 8px 0 28px;
}
.home-welcome-title {
  color: var(--c-navy);
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 6px;
}
.home-welcome-subtitle {
  color: var(--c-teal);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}
@media (max-width: 640px) {
  .home-welcome-title { font-size: 1.6rem; }
  .home-welcome-subtitle { font-size: 1.05rem; }
}

/* ── Footer ─────────────────────────────────────────── */
.footer-meitarim {
  flex-shrink: 0;
  background: var(--c-navy);
  color: var(--c-white);
  margin-top: 48px;
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-logo img {
  height: 64px;
  width: auto;
}
.footer-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--c-white);
  font-weight: 600;
  text-decoration: none;
  opacity: .9;
  transition: opacity .15s;
}
.footer-links a:hover { opacity: 1; color: var(--c-white); text-decoration: underline; }
.footer-copy {
  color: rgba(255,255,255,.75);
  font-size: .92rem;
}
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; text-align: center; gap: 14px; }
}

/* נעילה לפי תת-קטגוריה: מנעול על כרטיס שדורש התחברות (רק לגולש לא מחובר) */
:has(> .lock-badge) { position: relative; }
.lock-badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.grade-btn > .lock-badge { top: -8px; inset-inline-end: -8px; width: 22px; height: 22px; font-size: 11px; }
