@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Open+Sans:wght@300;400;600;700;800&display=swap');

:root {
  --bg: #ffffff;
  --bg-secondary: #f7f7fb;
  --bg-card: #ffffff;
  --text: #2d2d44;
  --text-secondary: #6b7280;
  --border: #e2e4ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff4ff;
  --accent: #7c3aed;
  --accent-light: #f3edff;
  --holiday: #dc2626;
  --holiday-bg: #fef2f2;
  --cuti: #db2777;
  --cuti-bg: #fdf2f8;
  --weekend: #6b7280;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px;
  --font: 'Lato', 'Open Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Open Sans', 'Lato', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #334155;
  --primary: #60a5fa;
  --primary-dark: #93bbfd;
  --primary-light: #1e3a5f;
  --accent: #a78bfa;
  --accent-light: #2e2155;
  --holiday: #f87171;
  --holiday-bg: #3b1a1a;
  --cuti: #f472b6;
  --cuti-bg: #3b1a2e;
  --weekend: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-secondary);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== NAVBAR (Divi-style) ===== */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.nav-brand:hover { text-decoration: none; color: var(--primary-dark); }
.nav-brand .logo-img { height: 36px; width: auto; }
.nav-brand span { font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all .2s;
  position: relative;
}
.nav-links a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.nav-links a.active {
  background: var(--primary);
  color: #fff;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.hamburger:hover { background: var(--bg-secondary); }

/* THEME TOGGLE */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all .2s;
  margin-left: 8px;
}
.theme-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 56px 24px 48px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #9333ea 100%);
  color: #fff;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: #fff;
  font-weight: 800;
  position: relative;
}
.hero p {
  opacity: .92;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ===== YEAR NAV ===== */
.year-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.year-arrow {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.year-arrow:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}
.year-arrow:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.year-display {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
  min-width: 80px;
  text-align: center;
  user-select: none;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-item {
  text-align: center;
  padding: 20px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color, var(--primary));
}
.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  display: block;
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--stat-color, var(--primary));
  font-family: var(--font-heading);
  line-height: 1.2;
}
.stat-label {
  font-size: .75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}
.stat-item.libur { --stat-color: #dc2626; }
.stat-item.cuti { --stat-color: #ec4899; }
.stat-item.weekend { --stat-color: #6b7280; }
.stat-item.longweekend { --stat-color: #8b5cf6; }
.stat-item.hijri { --stat-color: #059669; }
.stat-item.jawa { --stat-color: #d97706; }
.stat-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--stat-color, var(--primary));
  font-family: var(--font-heading);
  line-height: 1.3;
}

/* ===== CALENDAR GRID ===== */
.calendar-year {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.calendar-month {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.calendar-month:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.month-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: opacity .2s;
  font-family: var(--font-heading);
  font-size: .95rem;
}
.month-header:hover { opacity: .9; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px;
  gap: 2px;
}
.day-header {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.day-cell {
  text-align: center;
  padding: 5px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}
.day-cell:hover { background: var(--bg-secondary); }
.day-cell.empty { cursor: default; }
.day-cell.empty:hover { background: transparent; }
/* ===== DAY CELL COLORS ===== */
.day-cell .day-num { font-weight: 600; }
.day-cell .day-hijri { font-size: .6rem; color: var(--text-secondary); line-height: 1.1; }
.day-cell .day-pasaran { font-size: .55rem; color: var(--accent); line-height: 1.1; }

/* Day headers: Sunday=red, Friday=green */
.month-grid .day-header:nth-child(1) { color: #dc2626; }
.month-grid .day-header:nth-child(6) { color: #16a34a; }

/* Sunday dates: red text */
.day-cell.sun .day-num { color: #dc2626; font-weight: 700; }

/* Saturday dates: default (slightly muted) */
.day-cell.sat .day-num { color: #475569; font-weight: 700; }

/* Holiday: red background, white text */
.day-cell.holiday {
  background: #dc2626;
  color: #fff;
  border: none;
}
.day-cell.holiday .day-num { color: #fff; font-weight: 700; }
.day-cell.holiday .day-pasaran { color: rgba(255,255,255,.8); }

/* Cuti bersama: pink background, white text */
.day-cell.cuti {
  background: #FF748B;
  color: #fff;
  border: none;
}
.day-cell.cuti .day-num { color: #fff; font-weight: 700; }
.day-cell.cuti .day-pasaran { color: rgba(255,255,255,.8); }

.day-cell.today {
  border: 2px solid var(--primary) !important;
  background: var(--primary) !important;
  color: #fff;
}
.day-cell.today .day-num { color: #fff; font-weight: 700; }
.day-cell.today .day-pasaran { color: rgba(255,255,255,.8); }
.day-cell.today.holiday { background: #dc2626 !important; }
.day-cell.today.cuti { background: #FF748B !important; }

[data-theme="dark"] .day-cell.holiday {
  background: #b91c1c;
  color: #fff;
}
[data-theme="dark"] .day-cell.holiday .day-num { color: #fff; }
[data-theme="dark"] .day-cell.cuti {
  background: #e11d72;
  color: #fff;
}
[data-theme="dark"] .day-cell.cuti .day-num { color: #fff; }
[data-theme="dark"] .day-cell.sat .day-num { color: #94a3b8; }

/* ===== MONTH HOLIDAY LIST ===== */
.month-holidays {
  padding: 8px 10px;
  border-top: 2px solid var(--border);
  background: var(--bg-secondary);
}
.month-holiday-item {
  font-size: .7rem;
  padding: 4px 6px;
  color: var(--text-secondary);
  line-height: 1.4;
  border-radius: 4px;
  margin-bottom: 2px;
}
.month-holiday-item:last-child { margin-bottom: 0; }
.month-holiday-item.libur {
  color: #dc2626;
  font-weight: 700;
  background: #fee2e2;
}
.month-holiday-item.cuti {
  color: #db2777;
  font-weight: 700;
  background: #fce7f3;
}
[data-theme="dark"] .month-holiday-item.libur { background: #3b1a1a; color: #f87171; }
[data-theme="dark"] .month-holiday-item.cuti { background: #3b1a2e; color: #f472b6; }

/* ===== LEGEND ===== */
.legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: .85rem;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.1);
}
.legend-dot.libur { background: #dc2626; border-color: #dc2626; }
.legend-dot.cuti { background: #FF748B; border-color: #FF748B; }
.legend-dot.weekend { background: #f1f5f9; border-color: #cbd5e1; }

/* ===== MONTHLY DETAIL ===== */
.month-detail-header {
  text-align: center;
  margin-bottom: 28px;
}
.month-detail-header h2 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.month-detail-header .hijri-info {
  color: var(--text-secondary);
  font-size: .95rem;
}

.month-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-bottom: 36px;
}

.detail-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.detail-day-header {
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 10px 0;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.detail-day {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
}
.detail-day:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
}
.detail-day .num { font-size: 1.15rem; font-weight: 600; }
.detail-day .hijri { font-size: .75rem; color: var(--text-secondary); }
.detail-day .pasaran { font-size: .7rem; color: var(--accent); }

/* Detail grid: Sunday header red, Friday header green */
.detail-grid .detail-day-header:nth-child(1) { color: #dc2626; }
.detail-grid .detail-day-header:nth-child(6) { color: #16a34a; }

/* Detail grid: Sunday dates red, Friday dates green */
.detail-day.sun .num { color: #dc2626; font-weight: 700; }
.detail-day.fri .num { color: #16a34a; font-weight: 600; }

.detail-day.holiday { background: #dc2626; color: #fff; }
.detail-day.holiday .num { color: #fff; font-weight: 700; }
.detail-day.holiday .hijri, .detail-day.holiday .pasaran { color: rgba(255,255,255,.8); }
.detail-day.cuti { background: #FF748B; color: #fff; }
.detail-day.cuti .num { color: #fff; font-weight: 600; }
.detail-day.cuti .hijri, .detail-day.cuti .pasaran { color: rgba(255,255,255,.8); }
.detail-day.weekend .num { color: #475569; }
.detail-day.today {
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #fff;
}
.detail-day.today .num { color: #fff; }
.detail-day.today .hijri,
.detail-day.today .pasaran { color: rgba(255,255,255,.8); }
.detail-day.empty { cursor: default; opacity: 0; }

/* ===== SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  font-family: var(--font-heading);
}
.sidebar-card ul { list-style: none; }
.sidebar-card li {
  padding: 8px 0;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-card .date { font-weight: 700; color: var(--primary); }
.sidebar-card .name { color: var(--text); }
.sidebar-card .type {
  font-size: .7rem;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}
.type.libur { background: var(--holiday-bg); color: var(--holiday); }
.type.cuti { background: var(--cuti-bg); color: var(--cuti); }

/* ===== NAV MONTHS ===== */
.nav-months {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}
.nav-months a, .nav-months span {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
}
.nav-months a:hover {
  text-decoration: none;
}

/* ===== DATEPICKER NAV ===== */
.datepicker-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.datepicker-nav input {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s;
  font-family: var(--font);
  min-width: 180px;
  text-align: center;
}
.datepicker-nav input:focus {
  outline: none;
  border-color: var(--primary);
}
.datepicker-nav .dp-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .9rem;
}

/* ===== HOLIDAY TABLE ===== */
.table-container {
  overflow-x: auto;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
th {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-heading);
}
tr:hover { background: var(--bg-secondary); }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-libur { background: var(--holiday-bg); color: var(--holiday); }
.badge-cuti { background: var(--cuti-bg); color: var(--cuti); }

/* ===== LONG WEEKEND ===== */
.long-weekend-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.long-weekend-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.lw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.lw-duration {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
}
.lw-range {
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 600;
}
.lw-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lw-day {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  background: var(--bg-secondary);
}
.lw-day.libur { background: var(--holiday-bg); color: var(--holiday); }
.lw-day.cuti { background: var(--cuti-bg); color: var(--cuti); }
.lw-day.minggu { background: var(--weekend); color: #fff; }

/* ===== CALCULATOR ===== */
.calc-container {
  max-width: 640px;
  margin: 0 auto 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.calc-container h2 {
  margin-bottom: 20px;
  font-size: 1.3rem;
  font-family: var(--font-heading);
}
.calc-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.calc-tab {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s;
}
.calc-tab:hover { border-color: var(--accent); color: var(--accent); }
.calc-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.calc-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 700; color: var(--text-secondary); }
.form-group input, .form-group select {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
  font-family: var(--font);
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.calc-btn {
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  font-family: var(--font-heading);
}
.calc-btn:hover { opacity: .9; }
.calc-btn:active { transform: scale(.98); }
.calc-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  text-align: center;
  font-size: 1.1rem;
  display: none;
  border: 1px solid var(--border);
}
.calc-result.show { display: block; }
.calc-result .result-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  font-family: var(--font-heading);
}

/* ===== WETON ===== */
.weton-result {
  text-align: center;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.weton-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  font-family: var(--font-heading);
}
.weton-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.weton-item {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.weton-item .label { font-size: .75rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.weton-item .value { font-size: 1rem; font-weight: 700; margin-top: 2px; }

/* ===== BLOG ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card .thumb {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}
.blog-card .content { padding: 20px; }
.blog-card .date { font-size: .8rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.blog-card h3 { font-size: 1.1rem; margin-bottom: 10px; font-family: var(--font-heading); }
.blog-card p { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; }

.blog-article {
  max-width: 740px;
  margin: 0 auto 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}
.blog-article h1 { font-size: 1.6rem; margin-bottom: 10px; }
.blog-article .meta { color: var(--text-secondary); font-size: .85rem; margin-bottom: 28px; font-weight: 600; }
.blog-article p { margin-bottom: 18px; }
.blog-article h2 { font-size: 1.25rem; margin: 28px 0 14px; }
.blog-article ul { margin-bottom: 18px; padding-left: 28px; }
.blog-article li { margin-bottom: 8px; }

/* ===== SUPPORTING PAGES ===== */
.page-content {
  max-width: 740px;
  margin: 0 auto 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}
.page-content h1 { font-size: 1.6rem; margin-bottom: 20px; }
.page-content h2 { font-size: 1.25rem; margin: 24px 0 12px; }
.page-content p { margin-bottom: 14px; }
.page-content ul { margin-bottom: 14px; padding-left: 28px; }
.page-content li { margin-bottom: 8px; }

/* ===== FOOTER ===== */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 48px 24px 24px;
  margin-top: 48px;
}
.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-links a { color: #94a3b8; font-weight: 600; font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer p {
  text-align: center;
  font-size: .85rem;
  color: #64748b;
}
.footer .footer-divider {
  border: none;
  border-top: 1px solid #334155;
  margin: 16px auto;
  max-width: 600px;
}

[data-theme="dark"] .footer {
  background: #0b1120;
}

/* ===== DOWNLOAD BTN ===== */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  font-family: var(--font-heading);
}
.download-btn:hover { opacity: .9; color: #fff; text-decoration: none; }
.download-btn:active { transform: scale(.98); }
.download-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .calendar-year { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .month-detail-grid { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .hero { padding: 40px 20px 36px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .95rem; }
  .stats-bar { gap: 10px; }
  .stat-item { min-width: 90px; padding: 12px 16px; }
  .stat-number { font-size: 1.4rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .detail-day .num { font-size: .95rem; }
  .detail-day .hijri { font-size: .65rem; }
  .datepicker-nav { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .calendar-year { grid-template-columns: 1fr; }
  .day-cell { min-height: 44px; padding: 5px; }
  .day-cell .day-hijri { font-size: .55rem; }
  .nav-months { flex-direction: column; gap: 10px; }
  .year-nav { gap: 12px; }
  .year-arrow { width: 38px; height: 38px; font-size: 1rem; }
  .year-display { font-size: 1.3rem; min-width: 60px; }
  .hero h1 { font-size: 1.3rem; }
  .calc-container { padding: 20px; }
  .blog-article { padding: 24px; }
  .page-content { padding: 24px; }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  z-index: 999;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: .85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--primary);
  font-weight: 600;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
}

/* ===== TAG LIST ===== */
.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.tag {
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}
[data-theme="dark"] .tag {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-text.w60 { width: 60%; }
.skeleton-text.w80 { width: 80%; }
