/* City pages (namaz.cc/<city>/): static HTML generated by scripts/city-pages.mjs. Follows the phone's light/dark. */
:root {
  --bg: #0b1416; --surface: #12201f; --surface-2: #1a2c2b; --text: #eef3f1; --muted: #9db0ab; --line: #2a3d3b;
  --accent: #e9c46a; --ink: #1b1600; --next: #e9c46a; --red: #e07a5f;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f1e3; --surface: #fffdf8; --surface-2: #efe7d6; --text: #13201f; --muted: #5c6b67; --line: #ddd3c0;
          --accent: #0f3d3e; --ink: #fff; --next: #9a3412; --red: #b4462f; color-scheme: light; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
h1 { margin: 4px 0 2px; font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 1.25rem; }
.muted { color: var(--muted); }

/* top bar */
.bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; flex: 1; }
.brand .ic { width: 30px; height: 30px; border-radius: 22%; }
.lang { font-weight: 700; font-size: 0.9rem; text-decoration: none; border: 1.5px solid currentColor; border-radius: 99px; padding: 3px 10px; }

/* hero: illustrated (default) and photo (top cities) */
.hero { position: relative; }
.hero .in { padding: 4px 16px 18px; max-width: 1040px; margin: 0 auto; }
.hero .date { margin: 2px 0 0; }
.hero.illu { background: linear-gradient(160deg, #f6b65a 0%, #df7f4d 55%, #c7473f 100%); color: #fff8ee; }
.hero.illu .in { padding-bottom: 6px; }
.hero.illu .date { color: rgb(255 248 238 / 0.92); }
.skyline { display: block; width: 100%; height: 86px; margin-top: 10px; }
.skyline .far { fill: #0b1416; opacity: 0.18; }
.skyline .near { fill: var(--bg); }
.hero.photo { color: #fff; min-height: 340px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.hero.photo .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero.photo::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / 0.25) 0%, rgb(0 0 0 / 0.1) 35%, rgb(8 14 16 / 0.9) 100%); }
.hero.photo { isolation: isolate; }
.hero.photo .date { color: rgb(255 255 255 / 0.88); }
.hero.photo .lang { color: #fff; }
.credit { position: absolute; right: 10px; bottom: 6px; font-size: 10.5px; color: rgb(255 255 255 / 0.8); text-decoration: none; }

/* live "time left" card (class differs from the boxes' "now" state on purpose) */
.nowcard[hidden] { display: none; }
.nowcard { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgb(255 255 255 / 0.93); color: #13201f; border-radius: 16px; padding: 12px 14px; max-width: 520px; }
.nowcard .k { font-size: 0.8rem; color: #5c6b67; font-weight: 700; }
.nowcard .v { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.nowcard .at { text-align: end; color: #5c6b67; font-size: 0.85rem; }
.nowcard .at b { display: block; font-size: 1.3rem; color: #13201f; font-variant-numeric: tabular-nums; }

main { max-width: 1040px; margin: 0 auto; }
.s { padding: 20px 16px; border-bottom: 1px solid var(--line); }

/* six times */
.six { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.six .c { border: 2px solid var(--line); border-radius: 14px; text-align: center; padding: 10px 2px; font-size: 0.85rem; }
.six .c b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.six .c em { display: block; font-style: normal; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; min-height: 1.1em; }
.six .c.done { border-style: dashed; color: var(--muted); }
.six .c.now { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.six .c.next { border: 4px solid var(--next); }

.cta { display: block; text-align: center; text-decoration: none; border-radius: 16px; padding: 14px; font-weight: 800; font-size: 1.1rem; background: var(--accent); color: var(--ink); }
.cta small { display: block; font-weight: 500; font-size: 0.8rem; opacity: 0.85; }

/* facts & qibla */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.fact.wide { grid-column: 1 / -1; }
.fact .k { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.fact .v { font-size: 1.2rem; font-weight: 800; }
.fact .v.small { font-size: 0.98rem; }
.fact .dir { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.qibla { display: flex; gap: 14px; align-items: center; }
.qibla svg { width: 68px; height: 68px; flex: none; }
.qibla .ring { fill: none; stroke: var(--muted); stroke-width: 3; opacity: 0.5; }
.qibla text { font-size: 12px; fill: var(--muted); }
.qibla .needle { fill: var(--red); }
.qibla .tail, .qibla .pin { fill: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 0.92rem; }

.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 6px 0 0; color: var(--muted); }

/* month table */
.tablewrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.month { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.86rem; }
.month th, .month td { padding: 7px 2px; text-align: center; border-bottom: 1px solid var(--line); }
.month thead th { font-size: 0.72rem; color: var(--muted); background: var(--surface); }
.month td:first-child { text-align: start; padding-inline-start: 8px; font-weight: 700; white-space: nowrap; }
.month tr[data-fri] td:first-child { color: var(--next); }
.month tr.today { background: var(--surface-2); font-weight: 800; }
.note { margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); }
.nextmonth { margin-top: 14px; }
.nextmonth summary { font-weight: 700; cursor: pointer; padding: 6px 0; }

.foot { max-width: 1040px; margin: 0 auto; padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); font-size: 0.9rem; color: var(--muted); }

/* index page */
.index main .chips a { font-size: 1rem; }

/* computers: two columns (times, info) | (timetable) */
@media (min-width: 900px) {
  .hero .in { padding: 10px 28px 24px; }
  .hero.photo { min-height: 420px; }
  .bar { max-width: 1040px; margin: 0 auto; padding: 14px 28px; }
  .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 28px; padding: 0 12px; }
  .cols .s { border-bottom: 0; }
}
@media print {
  .hero, .cta, .chips, .faq, .foot, .bar, .nowcard { display: none !important; }
  .nextmonth { display: none; }
}

/* ---------- Ramadan pages (body.ramadan) and the link strip on city pages ---------- */
:root { --hi: rgb(233 196 106 / 0.12); --kadir: rgb(151 128 200 / 0.22); --eid: rgb(233 196 106 / 0.22); }
@media (prefers-color-scheme: light) { :root { --hi: #fbf3dc; --kadir: #e8e1f3; --eid: #fff1c7; } }
.hero.night { background: linear-gradient(170deg, #15233f 0%, #2b3f6b 70%, #6b4a6e 100%); color: #f4efe3; overflow: hidden; }
.hero.night .lang { color: #f4efe3; }
.hero.night .moon { position: absolute; right: 18px; top: 58px; width: 46px; height: 46px; fill: #e9c46a; }
.hero.night .kicker { margin: 8px 0 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #e9c46a; max-width: 80%; }
.hero.night h1 { max-width: 85%; }
.hero.night .lead { margin: 4px 0 8px; opacity: 0.9; }
.rprog { height: 7px; border-radius: 9px; background: rgb(255 255 255 / 0.18); max-width: 460px; }
.rprog i { display: block; height: 100%; width: 0; border-radius: 9px; background: #e9c46a; }
.rprogl { margin: 4px 0 0; font-size: 0.8rem; opacity: 0.85; }
.rcard { margin-top: 12px; background: rgb(255 255 255 / 0.1); border-radius: 18px; padding: 12px 14px; }
.rcard .big { font-size: 1.15rem; line-height: 1.3; }
.rcard .big b { font-size: 1.55rem; }
.rcard .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 2px; }
.rcard .pair > div { background: rgb(255 255 255 / 0.12); border-radius: 12px; padding: 6px 12px; }
.rcard .pair > div.on { background: #e9c46a; color: #1b1600; }
.rcard .pair small { display: block; font-size: 0.75rem; font-weight: 700; }
.rcard .pair b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.rcard .sub { margin: 6px 0 0; font-size: 0.88rem; opacity: 0.9; }
.rprog[hidden], .rprogl[hidden], .rcard [hidden], .rcard .pair[hidden] { display: none; }
.hero.night .skyline .far { fill: #000; opacity: 0.22; }
.sk-wide { display: none; }

.rcols { display: flex; flex-direction: column; }
.rcols aside { display: contents; }
.rcols aside > .s:first-child { order: 1; }
.rcols .rtable { order: 2; }
.rcols aside > .s { order: 3; }
.month.ram th { vertical-align: bottom; }
.month.ram th small { display: block; font-weight: 500; font-size: 0.62rem; }
.month.ram td:nth-child(2) { text-align: start; white-space: nowrap; }
.month.ram td:first-child { text-align: center; padding-inline-start: 2px; }
.month.ram td em { display: block; font-style: normal; font-size: 0.66rem; font-weight: 800; color: var(--next); }
.month.ram .hi { background: var(--hi); font-weight: 800; }
.month.ram tr.kadir { background: var(--kadir); }
.month.ram tr.eid { background: var(--eid); font-weight: 700; }
.month.ram tr.today { background: var(--accent); color: var(--ink); }
.month.ram tr.today .hi { background: transparent; }
.month.ram tr.today em, .month.ram tr.today td:first-child { color: inherit; }
.month.ram tr[data-fri] td:nth-child(2) { color: var(--next); }
.month.ram tr[data-fri] td:first-child { color: inherit; }
.month.ram tr.today[data-fri] td:nth-child(2) { color: inherit; }
@media (max-width: 599px) {
  /* phones: the Ramadan columns only (day, date, imsak, iftar, isha) */
  .month.ram th:nth-child(4), .month.ram td:nth-child(4), .month.ram th:nth-child(5), .month.ram td:nth-child(5), .month.ram th:nth-child(6), .month.ram td:nth-child(6) { display: none; }
  .month.ram { font-size: 0.92rem; }
}
.print { width: 100%; border: 2px solid var(--accent); background: transparent; color: var(--accent); border-radius: 14px; padding: 10px; font: inherit; font-weight: 800; cursor: pointer; }
.printhead { display: none; }

/* link strip on city pages and city lists */
.rstrip { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 16px; padding: 10px 14px; background: linear-gradient(170deg, #15233f, #2b3f6b); color: #f4efe3; font-weight: 800; }
.rstrip .moon { width: 30px; height: 30px; flex: none; fill: #e9c46a; }
.rstrip small { display: block; font-weight: 500; font-size: 0.82rem; opacity: 0.85; }

@media (min-width: 900px) {
  .hero.night .moon { right: auto; left: 52%; top: 64px; width: 56px; height: 56px; }
  .rgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; }
  .rgrid h1 { font-size: 2.5rem; }
  .rcard { margin-top: 0; padding: 16px 18px; }
  .rcard .big b { font-size: 2rem; }
  .rcard .pair b { font-size: 1.9rem; }
  .sk-phone { display: none; }
  .sk-wide { display: block; height: 104px; }
  .rcols { display: grid; grid-template-columns: 360px 1fr; gap: 0 28px; padding: 0 12px; align-items: start; }
  .rcols aside { display: flex; flex-direction: column; }
  .rcols .s { border-bottom: 0; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body.ramadan { background: #fff; color: #000; font-size: 11px; }
  body.ramadan .rcols aside, body.ramadan .rstrip { display: none !important; }
  body.ramadan .printhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 3px double #0f3d3e; border-bottom: 0; padding: 8px 12px; }
  body.ramadan .printhead h2 { margin: 0; font-size: 1.5rem; color: #0f3d3e; }
  body.ramadan .printhead p { margin: 2px 0 0; color: #333; }
  body.ramadan .printhead svg { width: 22mm; height: 22mm; }
  body.ramadan main, body.ramadan .rtable { max-width: none; padding: 0; margin: 0; }
  body.ramadan .rtable h2 { display: none; }
  body.ramadan .tablewrap { border: 3px double #0f3d3e; border-radius: 0; }
  body.ramadan .month.ram { font-size: 10.5px; }
  body.ramadan .month.ram th, body.ramadan .month.ram td { padding: 3px 2px; color: #000; }
  body.ramadan .month.ram th:nth-child(n), body.ramadan .month.ram td:nth-child(n) { display: table-cell; }
  body.ramadan .month.ram .hi { background: #f3e7c3 !important; }
  body.ramadan .month.ram tr.today { background: none; }
  body.ramadan .month.ram tr.kadir { background: #ece6f5 !important; }
  body.ramadan .month.ram tr.eid { background: #fff1c7 !important; }
  body.ramadan .note { display: flex; justify-content: space-between; color: #333; }
  body.ramadan * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.fact .muted { font-size: 0.85rem; }

/* breadcrumbs (also as BreadcrumbList structured data) */
.crumbs { padding: 12px 16px 0; font-size: 0.85rem; color: var(--muted); }
.crumbs a { color: inherit; }
.crumbs span[aria-current] { color: var(--text); font-weight: 600; }
/* shown by city.js when the page is older than its timetable */
.stale { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; border: 2px solid #c0392b; font-weight: 700; }
