/* ============================================================
   Salaat Calendar – design tokens
   ============================================================ */
:root {
  /* Palette: deep evergreen with warm parchment cream */
  --ink: #0f1f1a;
  --ink-2: #2a3b34;
  --muted: #6c7a73;
  --line: #dcd6c8;
  --line-2: #e8e3d6;
  --bg: #f6f1e3;
  --bg-2: #fbf7ec;
  --card: #ffffff;
  --accent: #1a4d3a;
  --accent-2: #2c6e54;
  --accent-soft: #e6efe9;
  --gold: #b58a3b;

  /* Type */
  --font-sans: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Zodiak", "Iowan Old Style", "Apple Garamond", Georgia, serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 31, 26, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 31, 26, 0.08);
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
ul, ol { padding-left: 1.2em; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--ink); color: var(--bg); padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(246, 241, 227, 0.9);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; letter-spacing: -0.01em;
}
.brand:hover { color: var(--accent); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; color: var(--accent); }
.brand-name { font-family: var(--font-display); font-size: 19px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  color: var(--ink-2);
  font-size: 14px; font-weight: 500;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(ellipse 600px 400px at 80% 20%, rgba(26, 77, 58, 0.06), transparent),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 16px;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.display em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero-meta {
  font-size: 13px; color: var(--muted); margin: 16px 0 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-secondary {
  background: var(--card); color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Today card */
.today-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.today-header {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.today-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.today-date {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: -0.01em;
}
.today-hijri {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 400;
  margin-top: 2px;
}
.today-hijri:empty { display: none; }
.prayer-list {
  list-style: none; padding: 0; margin: 0;
}
.prayer-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}
.prayer-list li:last-child { border-bottom: none; }
.p-name {
  font-size: 14px; color: var(--ink-2); font-weight: 500;
}
.p-name.highlight { color: var(--accent); font-weight: 600; }
.p-time {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 18px; letter-spacing: -0.01em;
}
.p-time.highlight { color: var(--accent); }
.today-footer {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
}
.next-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 600; }
.next-prayer { font-weight: 600; color: var(--ink); }

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 880px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features-grid { grid-template-columns: 1fr; } }
.feature h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 20px; margin: 8px 0 6px; letter-spacing: -0.01em;
}
.feature p {
  margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55;
}
.feature-num {
  font-family: var(--font-display); font-style: italic;
  font-size: 13px; color: var(--gold);
  letter-spacing: 0.08em;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: inline-block;
}

/* ============================================================
   Section head
   ============================================================ */
.section-head {
  margin-bottom: 36px;
  max-width: 60ch;
}
.preview .section-head { max-width: none; }
.preview .section-lede { max-width: 80ch; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.section-lede {
  font-size: 17px; color: var(--ink-2); margin: 0;
}

/* ============================================================
   Downloads
   ============================================================ */
.downloads { padding: 80px 0; }

.controls {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 36px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.control { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.control-mode { flex: 1 1 320px; }
.control label {
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
.control select {
  font: inherit;
  font-size: 15px; font-weight: 500;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.control select:hover, .control select:focus {
  border-color: var(--accent); outline: none;
}
.control-hint {
  font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.5;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 880px) { .download-grid { grid-template-columns: 1fr; } }

.download-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.download-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.download-primary {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 60%);
}
.download-card header h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 22px; margin: 6px 0; letter-spacing: -0.01em;
}
.download-card header p {
  margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5;
}
.dl-tag {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600;
  background: var(--accent); color: #fff;
  padding: 3px 8px; border-radius: 999px;
}
.dl-meta {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 14px 0;
}
.dl-meta li {
  display: flex; flex-direction: column; gap: 2px;
}
.dl-meta span {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.dl-meta strong {
  font-family: var(--font-display); font-size: 15px; color: var(--ink); font-weight: 500;
}
.card-fineprint {
  margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.card-fineprint a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.card-fineprint a:hover { color: var(--ink); }

/* ============================================================
   Quarter picker (dropdown + button)
   ============================================================ */
.quarter-picker {
  margin-bottom: 14px;
}
.quarter-picker .q-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.quarter-picker .q-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.quarter-picker .q-select {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  height: 46px;
  padding: 0 36px 0 14px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.quarter-picker .q-select:hover, .quarter-picker .q-select:focus { border-color: var(--accent); outline: none; }
.quarter-picker .q-btn {
  font-size: 13px;
  padding: 0 18px;
  text-align: center;
  white-space: nowrap;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .quarter-picker .q-row { grid-template-columns: 1fr; }
  .quarter-picker .q-btn { padding: 0 12px; }
}

/* ============================================================
   Info icon with hover tooltip
   ============================================================ */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
  vertical-align: 1px;
  transition: background 0.15s ease;
}
.info-icon:hover, .info-icon:focus { background: var(--accent); outline: none; }
.info-icon .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  z-index: 10;
  text-align: left;
  white-space: normal;
}
.info-icon .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.info-icon:hover .tooltip,
.info-icon:focus .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
@media (max-width: 480px) {
  .info-icon .tooltip { width: 220px; }
}

/* ============================================================
   Import
   ============================================================ */
.import {
  padding: 80px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.import-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--card);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 24px;
  width: fit-content;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-weight: 500; font-size: 14px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active {
  background: var(--accent); color: #fff;
}
.tab-panels {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel ol, .tab-panel ul { margin: 0 0 16px; padding-left: 1.4em; }
.tab-panel li { padding: 5px 0; line-height: 1.55; }
.hint {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--ink-2);
}
.hint-callout {
  margin-top: 0; margin-bottom: 18px;
  background: #fff5e1;
  border-left-color: #c4923f;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
}
.other-list { list-style: none; padding: 0; }
.other-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.other-list li:last-child { border-bottom: none; }

/* ============================================================
   Preview
   ============================================================ */
.preview { padding: 80px 0; }
.month-picker {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.month-picker label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.month-picker select {
  font: inherit; font-size: 15px; font-weight: 500;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}
.month-picker select:hover, .month-picker select:focus {
  border-color: var(--accent); outline: none;
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  overflow-x: auto;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.schedule-table th, .schedule-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  font-size: 14.5px;
}
.schedule-table thead th {
  background: var(--bg-2);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
}
.schedule-table tbody tr.is-today {
  background: var(--accent-soft);
}
.schedule-table tbody tr.is-today td:first-child {
  font-weight: 600; color: var(--accent);
}
.schedule-table tbody tr:last-child td { border-bottom: none; }
.schedule-table td.maghrib-col { font-weight: 600; color: var(--accent); }

/* ============================================================
   About
   ============================================================ */
.about { padding: 80px 0; background: var(--bg-2); border-top: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about p { line-height: 1.7; color: var(--ink-2); margin: 0 0 16px; }
.about .muted { color: var(--muted); font-size: 14.5px; }
.about-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  height: fit-content;
}
.about-side h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 18px; margin: 0 0 16px; letter-spacing: -0.01em;
}
.about-side dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px;
  margin: 0; font-size: 14.5px;
}
.about-side dt { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; align-self: center; }
.about-side dd { margin: 0; color: var(--ink-2); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 14px;
}
.footer-row p { margin: 0; }
.footer-row .muted { color: var(--muted); }

/* CSV warning */
.csv-warning {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(184, 134, 11, 0.08);
  border-left: 3px solid #b8860b;
  border-radius: 4px;
  color: var(--ink);
}
.csv-warning strong { font-weight: 600; }

/* ===== Adhan toggle ===== */
.adhan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-left: 16px;
  background: transparent;
  border: 1px solid var(--line, rgba(0,0,0,0.12));
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.adhan-toggle:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
}
.adhan-toggle:focus-visible {
  outline: 2px solid #1a4d3a;
  outline-offset: 2px;
}
.adhan-toggle .adhan-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.adhan-toggle .adhan-icon-on { display: none; }
.adhan-toggle .adhan-icon-off { display: block; }
.adhan-toggle[aria-pressed="true"] {
  background: #1a4d3a;
  border-color: #1a4d3a;
  color: #fff;
}
.adhan-toggle[aria-pressed="true"] .adhan-icon-on { display: block; }
.adhan-toggle[aria-pressed="true"] .adhan-icon-off { display: none; }
.adhan-toggle.is-playing {
  animation: adhan-pulse 1.6s ease-in-out infinite;
}
@keyframes adhan-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 77, 58, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(26, 77, 58, 0); }
}

/* Adhan banner */
.adhan-banner[hidden] { display: none !important; }
.adhan-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px 10px 18px;
  background: #1a4d3a;
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  animation: adhan-banner-in 0.3s ease-out;
}
@keyframes adhan-banner-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.adhan-banner-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}
.adhan-banner-close:hover { opacity: 1; }

@media (max-width: 640px) {
  .adhan-toggle {
    margin-left: 0;
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Make adhan banner not collide with nav: shift it slightly down on desktop */
@media (min-width: 721px) {
  .adhan-banner { top: 84px; }
}
