/* ============================================================
   Jadwal Program Empat Kitab Dasar Ilmu Bahasa Arab
   Style mengikuti bahasa desain web donasi Lisanul Arab.
   ============================================================ */

@font-face {
  font-family: 'Neue Montreal';
  src: url('/fonts/NeueMontreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('/fonts/NeueMontreal-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('/fonts/NeueMontreal-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #ffffff;
  --foreground: #171717;
  --muted-foreground: #6b7280;
  --border: #e2e4ef;
  --border-2: #e4e4e7;
  --blue: #0066e3;
  --text-body: #4d4d4d;
  --heading-sub: #5f647c;
  --red: #dc2626;
  --shadow-card: 0px 4px 12px 0px rgba(10, 14, 39, 0.08);
  --font-display: 'Neue Montreal', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

/* ── Page / container ── */
.page {
  position: relative;
  padding: 0;
}

/* Collapse border dengan section sebelumnya (hindari border-bottom dobel) */
.block-panduan {
  margin-top: -1px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

@media (min-width: 1024px) {
  .container { padding: 0 48px; }
}

/* ── Gutter stripe — mobile only ── */
.gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  opacity: 0.06;
  pointer-events: none;
  background-image: repeating-linear-gradient(45deg, currentColor 0, currentColor 1px, transparent 1px, transparent 6px);
  color: var(--foreground);
}
.gutter-l { left: 0; }
.gutter-r { right: 0; }

@media (min-width: 1024px) {
  .gutter { display: none; }
}

/* ── Bordered wrapper ── */
.bordered {
  position: relative;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── Section cap ── */
.cap {
  display: flex;
}

.cap-ear {
  position: relative;
  width: 40px;
  height: 80px;
  flex-shrink: 0;
  border-top: 1px dashed var(--border);
}
.cap-ear-l { border-right: 1px dashed var(--border); }
.cap-ear-r { border-left: 1px dashed var(--border); }
.cap-mid { flex: 1; border-top: 1px solid var(--border); }

@media (min-width: 1280px) {
  .cap-ear { width: 80px; }
}

/* Section bukan-pertama: cap tanpa border-top (nyambung ke border-bottom section sebelumnya) */
.cap-ear--nocap-top,
.cap-mid--nocap-top {
  border-top: none;
}

/* ── Rail wrapper ── */
.rail-wrap {
  display: flex;
  flex-direction: column;
}

/* Section bukan-pertama: border-top pindah ke sini, di bawah cap */
.rail-wrap--bordered-top {
  border-top: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .rail-wrap { flex-direction: row; }
}

.content {
  flex: 1;
  min-width: 0;
}

/* ── Rail kiri/kanan — desktop only ── */
.rail {
  display: none;
  position: relative;
  width: 40px;
  flex-shrink: 0;
  pointer-events: none;
}
.rail-l { border-right: 1px solid var(--border); }
.rail-r { border-left: 1px solid var(--border); }

.rail-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: repeating-linear-gradient(45deg, currentColor 0, currentColor 1px, transparent 1px, transparent 6px);
  color: var(--foreground);
}

@media (min-width: 1024px) {
  .rail { display: block; }
}
@media (min-width: 1280px) {
  .rail { width: 80px; }
}

/* ── Heading ── */
.heading {
  padding: 40px 24px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .heading { padding: 40px 32px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--blue);
  margin-bottom: 24px;
}

.eyebrow-line {
  width: 32px;
  height: 1px;
  background: var(--blue);
}

.heading h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0;
}

@media (min-width: 1024px) {
  .heading h1 {
    font-size: 48px;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
}

/* ── Body area (filters + table) ── */
.body-area {
  padding: 32px 24px;
}

@media (min-width: 1024px) {
  .body-area { padding: 40px 32px; }
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .filters { flex-direction: row; gap: 16px; }
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.filter-field label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.filter-field select {
  appearance: none;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 10px 36px 10px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--foreground);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.filter-field select:focus { border-color: #9ca3af; }

/* ── Legend ── */
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* ── Table band (bar biru atas & bawah) — di luar area scroll, jadi tidak ikut ter-scroll ── */
.table-band {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--blue);
  flex-wrap: wrap;
}

.table-band-top { justify-content: space-between; }

.table-band-bottom {
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
}

.table-header-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #ffffff;
}

.table-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ffffff;
}

.table-header-sep {
  color: rgba(255, 255, 255, 0.4);
}

/* ── Table — full-bleed, nempel ke border kiri/kanan konten ── */
.table-wrap {
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
  border-radius: 0;
  margin: 0 -24px;
}

@media (min-width: 1024px) {
  .table-wrap { margin: 0 -32px; }
}

/* Area scroll — vertikal selalu aktif (≈10 baris desktop / ≈7 baris mobile termasuk
   tinggi header), horizontal aktif kalau tabel lebih lebar dari layar (mobile). */
.table-scroll {
  overflow: auto;
  max-height: 520px;
}

@media (max-width: 639px) {
  .table-scroll { max-height: 380px; }
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead tr {
  background: #f7f7f8;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-2);
}

/* Thead sticky — tetap terlihat saat konten di-scroll vertikal */
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f7f8;
}

tbody tr {
  border-bottom: 1px solid rgba(226, 228, 239, 0.6);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0, 0, 0, 0.02); }

td {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--foreground);
  vertical-align: middle;
  background: #fff;
}

/* Kolom Kelas & Pemateri */
tbody td:nth-child(2),
tbody td:nth-child(3) {
  letter-spacing: 0.3px;
}

/* Kolom Tanggal sticky — tidak ikut ter-scroll ke kanan di mobile */
th:first-child,
.td-tanggal {
  position: sticky;
  left: 0;
  border-right: 1px solid var(--border-2);
}

th:first-child {
  z-index: 3; /* di atas thead biasa (2) & td sticky (1) karena sticky top + left sekaligus */
}

.td-tanggal {
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
  color: var(--foreground);
}

tbody tr:hover .td-tanggal { background: #fafafa; }

tr.bentrok .td-tanggal {
  color: var(--red);
  font-weight: 600;
}

td.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--foreground);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-foreground);
  padding: 32px 16px;
  margin: 0;
}

/* ── Mobile: horizontal scroll butuh lebar tabel tetap ── */
@media (max-width: 639px) {
  table { min-width: 560px; }
}

/* ── Panduan Peserta — kelompok aturan ── */
.guide {
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 24px;
  margin: 0 -24px;
}

@media (min-width: 1024px) {
  .guide {
    padding: 32px;
    margin: 0 -32px;
  }
}

.guide h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--foreground);
  margin: 0 0 16px 0;
}

/* ── Mini section cap — pemisah antar kelompok aturan, persis pola antar card fasilitas ── */
/* Full-bleed — sisi kiri/kanan mini-cap menyentuh rail (stripe), sama seperti .guide */
.mini-cap {
  display: flex;
  position: relative;
  height: 30px;
  margin: 0 -24px;
}

@media (min-width: 1024px) {
  .mini-cap { margin: 0 -32px; }
}

.mini-cap-ear {
  position: relative;
  width: 40px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mini-cap-ear-l { border-right: 1px dashed var(--border); }
.mini-cap-ear-r { border-left: 1px dashed var(--border); }
.mini-cap-mid {
  flex: 1;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  /* 2 garis yang menjorok keluar dari ear, melewati rail (stripe) di kiri/kanan —
     sejajar dengan border atas & bawah ear, bukan border box mid */
  .mini-cap-ear-l::before,
  .mini-cap-ear-l::after,
  .mini-cap-ear-r::before,
  .mini-cap-ear-r::after {
    content: "";
    position: absolute;
    width: 40px;
    border-top: 1px solid var(--border);
  }
  .mini-cap-ear-l::before { top: -1px; right: 100%; }
  .mini-cap-ear-l::after { bottom: -1px; right: 100%; }
  .mini-cap-ear-r::before { top: -1px; left: 100%; }
  .mini-cap-ear-r::after { bottom: -1px; left: 100%; }
}

@media (min-width: 1280px) {
  .mini-cap-ear { width: 80px; }
  .mini-cap-ear-l::before,
  .mini-cap-ear-l::after,
  .mini-cap-ear-r::before,
  .mini-cap-ear-r::after {
    width: 80px;
  }
}

.guide ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide li {
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.3px;
  color: var(--text-body);
  padding-left: 4px;
}

.guide-closing p {
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.3px;
  color: var(--text-body);
  margin: 0 0 12px 0;
}

.guide-closing p:last-child { margin-bottom: 0; }
