/* Learning Schedule — dark Holateam / sandtonshul.co.za look */

.learning-schedule {
  --ls-surface: #191820;
  --ls-surface-2: #22222c;
  --ls-line: rgba(120, 200, 230, 0.35);
  --ls-ink: #ffffff;
  --ls-ink-soft: rgba(255, 255, 255, 0.72);
  --ls-ink-muted: rgba(255, 255, 255, 0.5);
  --ls-accent: #7ec8e3;
  --ls-accent-strong: #4eb6d9;
  --ls-accent-deep: #292bf5;
  --ls-afternoon: #e4b84a;
  --ls-evening: #c084fc;
  --ls-shabbos: #1c2433;

  box-sizing: border-box;
  color: var(--ls-ink);
  font-family: Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0 0 2rem;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.learning-schedule *,
.learning-schedule *::before,
.learning-schedule *::after {
  box-sizing: border-box;
}

.learning-schedule .sch-header {
  color: var(--ls-ink);
  padding: 2.2rem 1.5rem 1.8rem;
  text-align: left;
  border-bottom: 1px solid var(--ls-line);
}

.learning-schedule .sch-header-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.learning-schedule .sch-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-accent);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.learning-schedule .sch-title {
  font-family: inherit, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  margin: 0 0 0.65rem;
  line-height: 1.15;
  color: #ffffff;
}

.learning-schedule .sch-sub {
  max-width: 62ch;
  color: var(--ls-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.learning-schedule .sch-updated {
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: var(--ls-ink-muted);
}

.learning-schedule .sch-download-wrap {
  margin: 1rem 0 0;
  padding: 0;
  line-height: 0;
}

.learning-schedule .sch-download-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ls-accent);
  border-radius: 8px;
  background: transparent;
  color: var(--ls-accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  /* Override Holateam / theme button styles */
  min-height: 0;
  height: auto;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.learning-schedule .sch-download-pdf:hover,
.learning-schedule .sch-download-pdf:focus {
  background: var(--ls-accent);
  color: #0e0e14;
  outline: none;
  box-shadow: none;
}

.learning-schedule .sch-filters-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 14, 20, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ls-line);
}

.learning-schedule .sch-filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.6rem;
  align-items: flex-start;
}

.learning-schedule .sch-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.learning-schedule .sch-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ls-ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.learning-schedule .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.learning-schedule .chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--ls-surface-2);
  color: var(--ls-ink);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.3;
}

.learning-schedule .chip:hover {
  border-color: var(--ls-accent);
  color: var(--ls-accent);
}

.learning-schedule .chip.active {
  background: var(--ls-accent-deep);
  border-color: var(--ls-accent-deep);
  color: #fff;
}

.learning-schedule .chip.active.rabbi {
  background: var(--ls-accent-strong);
  border-color: var(--ls-accent-strong);
  color: #0e0e14;
}

.learning-schedule .sch-search {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--ls-surface-2);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 220px;
  color: var(--ls-ink);
}

.learning-schedule .sch-search::placeholder {
  color: var(--ls-ink-muted);
}

.learning-schedule .sch-search:focus {
  outline: 2px solid var(--ls-accent);
  outline-offset: 1px;
}

.learning-schedule .sch-reset {
  align-self: center;
  margin-top: auto;
  background: none;
  border: none;
  color: var(--ls-accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.4rem 0;
  font-family: inherit;
}

.learning-schedule .sch-count {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 0.85rem;
  font-size: 0.82rem;
  color: var(--ls-ink-muted);
}

.learning-schedule .day-tabs {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem 0;
  gap: 0.4rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.learning-schedule .day-tabs::-webkit-scrollbar {
  display: none;
}

.learning-schedule .day-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--ls-surface-2);
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ls-ink-soft);
  cursor: pointer;
  font-family: inherit;
}

.learning-schedule .day-tab.active {
  background: var(--ls-accent-deep);
  border-color: var(--ls-accent-deep);
  color: #fff;
}

.learning-schedule .sch-board {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 2.5rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.learning-schedule .day-col {
  background: var(--ls-surface);
  border: 1px solid rgba(126, 200, 227, 0.22);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  min-width: 150px;
}

.learning-schedule .day-col.is-shabbos {
  background: var(--ls-shabbos);
  border-color: rgba(126, 200, 227, 0.4);
}

.learning-schedule .day-col-head {
  padding: 0.75rem 0.85rem;
  font-family: inherit, system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  border-bottom: 1px solid var(--ls-line);
  border-left: 3px solid var(--ls-accent);
}

.learning-schedule .day-col-body {
  padding: 0.7rem 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 120px;
}

.learning-schedule .shiur-card {
  background: var(--ls-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--ls-accent);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  transition: border-color 0.15s, transform 0.15s;
}

.learning-schedule .shiur-card.morning {
  border-left-color: var(--ls-accent);
}

.learning-schedule .shiur-card.afternoon {
  border-left-color: var(--ls-afternoon);
}

.learning-schedule .shiur-card.evening {
  border-left-color: var(--ls-evening);
}

.learning-schedule .shiur-card:hover {
  border-color: rgba(126, 200, 227, 0.45);
  transform: translateY(-1px);
}

.learning-schedule .shiur-time {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.78rem;
  display: block;
  margin-bottom: 0.2rem;
}

.learning-schedule .shiur-topic {
  font-weight: 600;
  color: var(--ls-ink);
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.learning-schedule .shiur-meta {
  color: var(--ls-accent);
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.learning-schedule .audience-tag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0e0e14;
  background: var(--ls-accent);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
}

.learning-schedule .day-empty {
  color: var(--ls-ink-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin: 0;
  padding: 1.25rem 0.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 88px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.learning-schedule .sch-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  color: var(--ls-ink-muted);
  font-size: 0.8rem;
}

.learning-schedule .sch-footer p {
  margin: 0;
}

@media (max-width: 1100px) {
  .learning-schedule .sch-board {
    grid-template-columns: repeat(7, minmax(160px, 1fr));
  }
}

@media (max-width: 980px) {
  .learning-schedule .sch-board {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 680px) {
  .learning-schedule .day-tabs {
    display: flex;
  }

  .learning-schedule .sch-board {
    grid-template-columns: 1fr;
    padding-top: 1rem;
    overflow-x: visible;
  }

  .learning-schedule .day-col {
    display: none;
    min-width: 0;
  }

  .learning-schedule .day-col.mobile-active {
    display: flex;
  }
}

/* Off-screen measure host for print pagination packing */
.sch-print-measure {
  position: absolute;
  left: -12000px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  color: #111;
  background: #fff;
}

.sch-print-measure .sch-board--print,
.learning-schedule .sch-board--print {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}

.sch-print-measure .day-col {
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: visible;
  min-width: 0;
}

.sch-print-measure .day-col-head {
  padding: 4px 5px;
  font-size: 8pt;
  font-weight: 700;
  border-bottom: 1px solid #ccc;
}

.sch-print-measure .day-col-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
}

.sch-print-measure .shiur-card {
  border: 1px solid #ddd;
  border-left: 2px solid #333;
  border-radius: 2px;
  padding: 3px 4px;
  font-size: 6.5pt;
  line-height: 1.25;
}

.sch-print-measure .shiur-time,
.sch-print-measure .shiur-topic {
  display: block;
  font-size: 6.5pt;
}

.sch-print-measure .shiur-meta {
  display: block;
  font-size: 6pt;
}

.sch-print-measure .audience-tag {
  display: inline-block;
  font-size: 5.5pt;
  margin-top: 1px;
}

.sch-print-pages {
  display: none;
}

/* ---------- Print / Save as PDF ----------
   Keep all 7 day columns side-by-side. If a day is too tall for one
   page, remaining events continue on the next page in the same
   column layout (built by JS into .sch-print-pages). */
@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

  body.ls-printing #wrapper-navbar,
  body.ls-printing #wrapper-footer,
  body.ls-printing .navbar,
  body.ls-printing .offcanvas,
  body.ls-printing .skip-link,
  body.ls-printing .sch-filters-wrap,
  body.ls-printing .day-tabs,
  body.ls-printing .sch-download-wrap,
  body.ls-printing .sch-download-pdf,
  body.ls-printing .sch-reset,
  body.ls-printing .sch-count,
  body.ls-printing .sch-sub,
  body.ls-printing #ls-scheduleBoard {
    display: none !important;
  }

  body.ls-printing .sch-print-pages {
    display: block !important;
  }

  body.ls-printing .learning-schedule {
    position: relative !important;
    width: 100% !important;
    background: #fff !important;
    color: #111 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.ls-printing .sch-header {
    background: none !important;
    border: none !important;
    padding: 0 0 6px !important;
    color: #111 !important;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  body.ls-printing .sch-eyebrow,
  body.ls-printing .sch-title,
  body.ls-printing .sch-updated,
  body.ls-printing .sch-footer,
  body.ls-printing .sch-print-continued,
  body.ls-printing .day-col-head,
  body.ls-printing .shiur-time,
  body.ls-printing .shiur-topic,
  body.ls-printing .shiur-meta,
  body.ls-printing .day-empty {
    color: #111 !important;
  }

  body.ls-printing .sch-eyebrow {
    font-size: 8pt !important;
    margin: 0 0 2px !important;
  }

  body.ls-printing .sch-title {
    font-size: 14pt !important;
    margin: 0 0 2px !important;
    line-height: 1.15 !important;
  }

  body.ls-printing .sch-updated {
    margin-top: 0 !important;
    font-size: 8pt !important;
  }

  body.ls-printing .sch-print-continued {
    margin: 0 0 6px !important;
    font-size: 10pt !important;
    font-weight: 600 !important;
  }

  body.ls-printing .sch-print-page {
    break-after: page;
    page-break-after: always;
  }

  body.ls-printing .sch-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.ls-printing .sch-board--print {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    overflow: visible !important;
    break-before: avoid-page;
    page-break-before: avoid;
  }

  body.ls-printing .day-col {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    margin: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  body.ls-printing .day-col-head {
    padding: 4px 5px !important;
    font-size: 8pt !important;
    border-bottom: 1px solid #ccc !important;
    border-left: 2px solid #333 !important;
  }

  body.ls-printing .day-col-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    padding: 4px !important;
    overflow: visible !important;
  }

  body.ls-printing .shiur-card {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-left: 2px solid #333 !important;
    border-radius: 2px !important;
    padding: 3px 4px !important;
    font-size: 6.5pt !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: visible !important;
  }

  body.ls-printing .shiur-card.morning {
    border-left-color: #7ec8e3 !important;
  }

  body.ls-printing .shiur-card.afternoon {
    border-left-color: #e4b84a !important;
  }

  body.ls-printing .shiur-card.evening {
    border-left-color: #c084fc !important;
  }

  body.ls-printing .shiur-time {
    font-size: 6.5pt !important;
    margin-bottom: 1px !important;
  }

  body.ls-printing .shiur-topic {
    font-size: 6.5pt !important;
  }

  body.ls-printing .shiur-meta {
    color: #333 !important;
    font-size: 6pt !important;
    margin-top: 1px !important;
  }

  body.ls-printing .audience-tag {
    color: #111 !important;
    background: #eee !important;
    border: 1px solid #ccc !important;
    font-size: 5.5pt !important;
    margin-top: 1px !important;
    padding: 0 3px !important;
  }

  body.ls-printing .day-empty {
    font-size: 6.5pt !important;
    min-height: 0 !important;
    padding: 4px 2px !important;
    text-align: left !important;
    display: block !important;
  }

  body.ls-printing .sch-footer {
    display: block !important;
    padding: 8px 0 0 !important;
    color: #444 !important;
    font-size: 8pt !important;
  }
}
