/* AutoAdhan — /namaz-time/ and /ramadan-2027/ pages. Builds on /css/style.css tokens and components. */
.pg { padding-bottom: 0 !important; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.main-nav a[aria-current] { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* day / night button */
.theme-btn .ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .ic-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .ic-moon { display: none; }
}

/* ---------- hero ---------- */
.pg-hero { position: relative; overflow: hidden; color: #d6ece0; padding: 26px 0 34px; text-align: center; background: radial-gradient(120% 140% at 85% 0%, #1d7a4e 0%, var(--band) 45%, var(--band-2) 100%); }
.pg-hero::before {
  content: ''; position: absolute; inset: 0; background: #fff; opacity: .06; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3C/svg%3E") repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3C/svg%3E") repeat;
}
.pg-hero::after { content: ''; position: absolute; width: 380px; height: 380px; right: -120px; top: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 189, 106, .3), transparent 65%); pointer-events: none; }
.pg-hero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.pg-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 14px; color: #a8cbb8; }
.pg-crumbs a { color: #cfe6d9; }
.pg-crumbs a:hover { color: #fff; }
.pg-crumbs span { opacity: .7; }
.pg-hero h1 { margin: 12px 0 2px; color: #fff; font-weight: 800; font-size: clamp(30px, 5.4vw, 52px); }
.pg-en { margin: 0; color: #bfdccd; font-size: 16px; }
.pg-date { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; }
.pg-date span { padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); color: #f1dfa8; font-weight: 500; font-size: 15px; }
.pg-filter { width: min(520px, 100%); margin-top: 20px; }
.pg-filter input { width: 100%; height: 50px; border: 0; border-radius: 14px; padding: 0 18px; font-size: 16px; background: var(--surface); color: var(--text); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .5); }
.pg-filter input:focus { outline: 2px solid var(--gold); }

/* ---------- today ---------- */
.pg-today { margin-top: -18px; position: relative; z-index: 2; }
.pg-next { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 18px; margin-bottom: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 16px; }
.pg-next-label { color: var(--muted); font-size: 14px; }
.pg-next strong { font-family: var(--font-display); font-size: 22px; color: var(--primary); }
.pg-next-left { padding: 3px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-next-left:empty { display: none; }
.pg-times { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pg-t { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s; }
.pg-t-name { font-size: 15px; color: var(--muted); font-weight: 600; }
.pg-t-time { font-family: var(--font-display); font-size: clamp(24px, 3vw, 30px); font-weight: 800; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.pg-t small { font-size: 13px; color: var(--muted); }
.pg-t-sunrise { background: var(--surface-2); }
.pg-t-sunrise .pg-t-time { color: var(--muted); }
.pg-t.is-next { background: linear-gradient(160deg, var(--primary), var(--primary-strong)); border-color: transparent; transform: translateY(-3px); box-shadow: 0 16px 30px -14px var(--primary); }
.pg-t.is-next .pg-t-name, .pg-t.is-next small { color: rgba(255, 255, 255, .8); }
.pg-t.is-next .pg-t-time { color: #fff; }
.pg-t.is-past { opacity: .6; }
.pg-extra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.pg-extra div { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 16px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.pg-extra span { font-size: 14px; color: var(--muted); }
.pg-extra strong { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.pg-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.pg-note a { color: var(--primary); text-decoration: underline; }

/* ---------- link cards ---------- */
.pg-ramadan-cta { margin-top: 26px; }
.pg-ramadan-cta a { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s; }
.pg-ramadan-cta a:hover { border-color: var(--primary); transform: translateY(-2px); }
.pg-ramadan-cta a > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.pg-ramadan-cta strong { font-family: var(--font-display); font-size: 18px; color: var(--primary); }
.pg-ramadan-cta small { color: var(--muted); font-size: 14px; }
.pg-moon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: linear-gradient(135deg, var(--band), var(--band-2)); color: #f1dfa8; font-size: 24px; }

/* ---------- tables ---------- */
.pg-month { margin-top: 34px; }
.pg-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pg-sec-head h2, .pg-faq h2, .pg-near h2, .pg-qibla h2, .pg-div h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; color: var(--text); }
.pg-table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.pg-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-table th, .pg-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.pg-table thead th { position: sticky; top: 0; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 14px; }
.pg-table tbody th { text-align: left; font-weight: 600; color: var(--text); }
.pg-table tbody th small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.pg-table tbody tr:last-child th, .pg-table tbody tr:last-child td { border-bottom: 0; }
.pg-table tbody tr:nth-child(even) { background: var(--surface-2); }
.pg-table tr.is-fri { background: var(--primary-soft) !important; }
.pg-table tr.is-today { background: var(--gold-soft) !important; box-shadow: inset 4px 0 0 var(--gold); font-weight: 700; }
.pg-table a { color: var(--primary); font-weight: 600; }
.pg-table a:hover { text-decoration: underline; }
.pg-table .pg-sehri { color: var(--primary); font-weight: 700; }
.pg-table .pg-iftar { color: var(--gold); font-weight: 700; }
.pg-table tr.pg-group th { background: var(--bg-mint) !important; color: var(--primary); text-align: left; font-size: 14px; padding: 8px 12px; }
.pg-more { font-size: 14px; }

/* index lists */
.pg-index-list { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.pg-div h2 { margin-bottom: 10px; }
.pg-div h2 small { font-size: 14px; color: var(--muted); font-weight: 500; }
.pg-table-index tbody th { min-width: 110px; }

/* ---------- qibla ---------- */
.pg-qibla { margin-top: 34px; display: flex; align-items: center; gap: 22px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pg-qibla p { margin: 6px 0 12px; color: var(--muted); }
.pg-qibla strong { color: var(--text); }
.pg-compass { position: relative; flex: none; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--surface) 55%, var(--primary-soft) 56%); border: 2px solid var(--line); }
.pg-needle { position: absolute; left: 50%; top: 50%; width: 4px; height: 46px; margin-left: -2px; border-radius: 4px; background: linear-gradient(var(--gold), var(--primary)); transform-origin: 50% 0; transform: rotate(calc(var(--q) + 180deg)); }
.pg-needle::after { content: '🕋'; position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%) rotate(calc(-1 * (var(--q) + 180deg))); font-size: 20px; }
.pg-n { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 13px; color: var(--primary); }

/* ---------- app box ---------- */
.pg-app { position: relative; overflow: hidden; margin-top: 34px; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px; background: linear-gradient(135deg, var(--band), var(--band-2)); color: #cfe6d9; box-shadow: var(--shadow); }
.pg-app img { border-radius: 16px; flex: none; box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .5); }
.pg-app > div { flex: 1; }
.pg-app h2 { color: #fff; font-size: 21px; font-weight: 800; }
.pg-app p { margin: 4px 0 0; font-size: 15px; }
.pg-app .btn-light { color: #0b0b0b; flex: none; }

/* ---------- faq + directory ---------- */
.pg-faq { margin-top: 34px; display: grid; gap: 10px; }
.pg-faq h2 { margin-bottom: 4px; }
.pg-faq details { overflow: hidden; }
.pg-faq summary { padding: 15px 18px; cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after { content: '+'; color: var(--primary); font-size: 22px; line-height: 1; }
.pg-faq details[open] summary::after { content: '–'; }
.pg-faq p { margin: 0; padding: 0 18px 16px; color: var(--muted); line-height: 1.75; }
.pg-near { margin-top: 34px; }
.pg-near h2 { margin-bottom: 12px; }
.dir-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dir-links a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--text); transition: border-color .2s, color .2s; }
.dir-links a:hover { border-color: var(--primary); color: var(--primary); }
.dir-links a[aria-current] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pg-dir { margin: 26px auto 56px; }
.pg-dir summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--primary); padding: 10px 0; }
.dir { display: grid; gap: 18px; margin-top: 8px; }
.dir-group h3 { font-size: 16px; color: var(--muted); margin-bottom: 8px; font-family: var(--font-bn); font-weight: 600; }
.pg-empty { text-align: center; padding: 60px 0; }
.pg-empty h1 { color: var(--primary); margin-bottom: 8px; }

/* ---------- Ramadan ---------- */
.pg-hero-ramadan { background: radial-gradient(120% 140% at 50% -10%, #2a6b4c 0%, #123f2b 45%, #0a2a1c 100%); padding-bottom: 40px; }
.pg-crescent { margin-top: 10px; font-size: 44px; line-height: 1; color: #f1dfa8; text-shadow: 0 0 30px rgba(241, 223, 168, .6); }
.pg-hero-ramadan h1 { margin-top: 4px; }
.pg-ramadan-first { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(640px, 100%); margin-top: 20px; }
.pg-ramadan-first div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.pg-ramadan-first span { font-size: 13px; color: #bfdccd; }
.pg-ramadan-first strong { font-family: var(--font-display); font-size: 19px; color: #fff; }
.pg-ramadan .pg-index-list + .wrap .pg-app, .pg-cal { margin-top: 30px; }
.pg-table-ramadan td, .pg-table-ramadan th { padding: 9px 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .site-header .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0 0; row-gap: 6px; }
  .site-header .main-nav { display: flex; order: 3; width: 100%; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .site-header .main-nav::-webkit-scrollbar { display: none; }
  .site-header .main-nav a { flex: none; font-size: 14px; padding: 6px 12px; }
}
@media (max-width: 900px) {
  .pg-times { grid-template-columns: repeat(3, 1fr); }
  .pg-index-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pg-hero { padding: 20px 0 30px; }
  .pg-today { margin-top: -14px; }
  .pg-times { gap: 8px; }
  .pg-t { padding: 12px 4px; border-radius: 14px; }
  .pg-t-time { font-size: 24px; }
  .pg-extra { gap: 8px; }
  .pg-extra div { padding: 10px 4px; text-align: center; }
  .pg-extra span { font-size: 12.5px; }
  .pg-extra strong { font-size: 17px; }
  .pg-table { font-size: 14px; }
  .pg-table th, .pg-table td { padding: 9px 8px; }
  .pg-qibla { flex-direction: column; text-align: center; }
  .pg-app { flex-direction: column; text-align: center; padding: 22px 18px; }
  .pg-app .btn { width: 100%; }
  .pg-ramadan-first strong { font-size: 16px; }
  .pg-ramadan-cta a { padding: 14px; }
  .pg-ramadan-cta strong { font-size: 16px; }
}

/* ---------- print: just the timetable ---------- */
@media print {
  .site-header, .site-footer, .pg-app, .pg-faq, .pg-dir, .pg-near, .pg-ramadan-cta, .pg-qibla, .pg-next, .pg-filter, [data-print], .skip { display: none !important; }
  .pg-hero { background: none !important; color: #000; padding: 0; }
  .pg-hero::before, .pg-hero::after { display: none; }
  .pg-hero h1, .pg-ramadan-first strong, .pg-crescent { color: #000 !important; text-shadow: none; }
  .pg-crumbs, .pg-en, .pg-date span, .pg-ramadan-first span { color: #333 !important; }
  .pg-ramadan-first div, .pg-date span { border-color: #ccc; background: none; }
  .pg-table-wrap { box-shadow: none; border-color: #999; }
  .pg-table thead th { background: #eee !important; color: #000 !important; }
  .pg-table th, .pg-table td { border-bottom-color: #ccc; padding: 5px 8px; }
  body { background: #fff !important; }
}

/* keep the date / district column visible while the table scrolls sideways */
.pg-table tbody th, .pg-table thead th:first-child { position: sticky; left: 0; z-index: 1; }
.pg-table tbody th { background: var(--surface); }
.pg-table tbody tr:nth-child(even) th { background: var(--surface-2); }
.pg-table tr.is-fri th { background: var(--primary-soft); }
.pg-table tr.is-today th { background: var(--gold-soft); }
.pg-table thead th:first-child { z-index: 2; }

/* phones: the Ramadan table keeps day, date, sehri and iftar on screen */
@media (max-width: 520px) { .pg-table-ramadan .col-opt { display: none; } .pg-table-ramadan td, .pg-table-ramadan th { padding: 9px 6px; } }

/* ---------- calculation method button + picker ---------- */
.pg-method { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 10px 14px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pg-method:hover { border-style: solid; border-color: var(--primary); }
.pg-method svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; }
.pg-method span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pg-method small { font-size: 12.5px; color: var(--muted); }
.pg-method strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-method em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--primary); padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); }
.pg-method.is-custom { border-style: solid; border-color: var(--gold); background: var(--gold-soft); }
.pg-method.is-custom svg { stroke: var(--gold); }
.pg-today .pg-method { box-shadow: var(--shadow-sm); }
.pg-index-tools { margin-top: 18px; }
.pg-index-tools .pg-method { max-width: 560px; margin: 0 auto; }
.pg-cal .pg-method { max-width: 560px; }

.pg-dlg { width: min(480px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.pg-dlg::backdrop { background: rgba(8, 26, 18, .55); backdrop-filter: blur(3px); }
.pg-dlg-inner { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.pg-dlg h2 { font-size: 22px; color: var(--primary); }
.pg-dlg-hint { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.pg-dlg-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.pg-field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.pg-field > span, .pg-field legend { font-weight: 600; font-size: 15px; margin-bottom: 4px; padding: 0; }
.pg-field select { height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
.pg-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.pg-radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pg-radio input { margin-top: 4px; accent-color: var(--primary); }
.pg-radio span { display: flex; flex-direction: column; line-height: 1.4; }
.pg-radio small { font-size: 13px; color: var(--muted); }
.pg-field summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.pg-field summary small { color: var(--muted); font-weight: 400; }
.pg-offsets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pg-offsets label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pg-offsets input { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-align: center; font: inherit; font-size: 16px; }
.pg-dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.pg-dlg-actions .btn { flex: 1; }
@media print { .pg-method { display: none !important; } }

/* ---------- phones: never wider than the screen ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.pg { overflow-x: hidden; }
.pg-index-list > *, .pg-div, .pg-month, .pg-today, .pg-table-wrap { min-width: 0; max-width: 100%; }
@media (max-width: 900px) {
  .pg-index-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .pg-table thead th { white-space: normal; line-height: 1.3; font-size: 13px; padding: 8px 6px; }
  .pg-table th, .pg-table td { padding: 9px 6px; font-size: 14px; }
  .pg-table-index tbody th { min-width: 0; }
  .pg-table-index .pg-more, .pg-table-index th:last-child:empty { display: none; }
  .pg-table-index td:has(> .pg-more), .pg-table-index thead th:nth-child(4):empty { display: none; }
  .pg-ramadan-first { gap: 6px; }
  .pg-ramadan-first div { padding: 10px 4px; }
  .pg-ramadan-first span { font-size: 12px; text-align: center; }
  .pg-ramadan-first strong { font-size: 15px; text-align: center; }
  .pg-method strong { white-space: normal; }
}
