/* Islamic Hijri Calendar – website styles.
   App colours: teal (#009688), teal.shade800 (#00695C), teal.shade900 (#004D40),
   accent #79D7BE, today green, event underline green[200]. */
:root {
  --teal: #009688;
  --teal-300: #4db6ac;
  --teal-700: #00796b;
  --teal-800: #00695c;
  --teal-900: #004d40;
  --teal-100: #b2dfdb;
  --accent: #79d7be;
  --red: #f44336;
  --ev-line: #a5d6a7;
  --radius: 16px;
  --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f3f8f7;
  --surface: #ffffff;
  --card: #eff3f2;
  --text: #111;
  --muted: #5f6b69;
  --border: #dde7e5;
  --cell-border: rgba(158, 158, 158, 0.35);
  --app-bg: #fafafa;
  --bar: linear-gradient(180deg, var(--teal-800) 0%, var(--teal-100) 60%, #fff 100%);
  --bar-text: #000;
  --bar-sub: rgba(0, 0, 0, 0.87);
  --today: rgba(76, 175, 80, 0.8);
  --sel: rgba(0, 150, 136, 0.2);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121212;
  --bg-alt: #181c1b;
  --surface: #1d1d1d;
  --card: rgba(66, 66, 66, 0.5);
  --text: #f1f1f1;
  --muted: #a9b3b1;
  --border: #2c3331;
  --cell-border: rgba(158, 158, 158, 0.25);
  --app-bg: #121212;
  --bar: linear-gradient(180deg, var(--teal-800) 0%, var(--teal-900) 60%, rgba(33, 33, 33, 0.8) 100%);
  --bar-text: #fff;
  --bar-sub: rgba(255, 255, 255, 0.75);
  --today: rgba(76, 175, 80, 0.55);
  --sel: rgba(0, 150, 136, 0.25);
}
html[lang='ur'] { --font: 'Noto Nastaliq Urdu', 'Roboto', system-ui, sans-serif; }
html[lang='ar'] { --font: 'Noto Kufi Arabic', 'Roboto', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
html[lang='ur'] body { line-height: 2.1; }
img { max-width: 100%; height: auto; }
a { color: var(--teal-700); }
:root[data-theme='dark'] a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
html[lang='ur'] :is(h1, h2, h3) { line-height: 1.9; }
.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: 0.5rem 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text) !important; text-decoration: none; }
.brand img { border-radius: 10px; }
.links { display: flex; gap: 1.25rem; margin-inline-start: auto; }
.links a { color: var(--text); text-decoration: none; font-weight: 500; }
.links a:hover { color: var(--teal); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
/* 3-line menu button: only shown on small screens (see 960px media query). */
.icon-btn.menu-btn { display: none; }
/* Mobile store icons (Play + App Store). Shown only on small screens; hidden on desktop. */
.nav-store-icons { display: none; align-items: center; gap: 0.35rem; }
.store-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--text); }
.store-icon svg { display: block; }
/* Desktop: taller navbar with larger text and logo. */
@media (min-width: 961px) {
  .nav { min-height: 80px; }
  .brand { gap: 0.75rem; font-size: 1.3rem; }
  .brand img { width: 48px; height: 48px; }
  .links { gap: 1.75rem; }
  .links a { font-size: 1.1rem; }
  .lang-menu summary { font-size: 1rem; }
  /* Download button removed on desktop. */
  .nav-actions [data-download] { display: none; }
}
.menu-btn .i-close, .nav-open .menu-btn .i-open { display: none; }
.nav-open .menu-btn .i-close { display: block; }
.lang-switch { display: flex; gap: 0.25rem; }
.lang-switch a { padding: 0.15rem 0.5rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.lang-switch a[aria-current] { background: var(--sel); color: var(--teal-700); font-weight: 700; }
:root[data-theme='dark'] .lang-switch a[aria-current] { color: var(--accent); }
/* Header language dropdown */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; height: 40px; padding: 0 0.7rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; color: var(--text); font-size: 0.9rem; font-weight: 600; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--teal); }
.lang-menu .caret { transition: transform 0.15s; }
.lang-menu[open] .caret { transform: rotate(180deg); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 50; min-width: 150px; display: grid; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }
.lang-list a { padding: 0.45rem 0.75rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.lang-list a:hover { background: var(--sel); }
.lang-list a[aria-current] { background: var(--sel); color: var(--teal-700); font-weight: 700; }
:root[data-theme='dark'] .lang-list a[aria-current] { color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.7rem 1.3rem; border-radius: 12px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 0; }
.btn-sm { padding: 0.45rem 1rem; }
.btn-primary { background: linear-gradient(135deg, var(--teal-300), var(--teal-700)); color: #fff !important; box-shadow: 0 4px 14px rgba(0, 150, 136, 0.35); }
.btn-ghost { background: transparent; color: var(--teal-700); border: 1px solid var(--accent); }
:root[data-theme='dark'] .btn-ghost { color: var(--accent); }
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 2.5rem 0 1rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.footer-langs { margin-top: 1rem; }
.copy { color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }

/* ---------- store badges ---------- */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1rem 0; }
.play-badge img { display: block; height: 58px; width: auto; }
/* Same height as the Google Play badge's visible area (58px image incl. padding) */
.apple-badge { display: inline-flex; align-items: center; gap: 0.45rem; height: 40px; padding: 0 0.85rem 0 0.65rem; border-radius: 8px; background: #000; color: #fff !important; text-decoration: none; border: 1px solid #a6a6a6; font-family: -apple-system, 'Segoe UI', 'Roboto', sans-serif; direction: ltr; }
.apple-badge[lang='ar'] { direction: rtl; padding: 0 0.65rem 0 0.85rem; }
.apple-badge:hover { background: #1a1a1a; }
.apple-badge svg { flex: none; width: 26px; height: 26px; }
.ab-text { display: grid; line-height: 1.05; text-align: start; }
.ab-small { font-size: 0.66rem; letter-spacing: 0.02em; }
.ab-big { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; }
.apple-badge.soon { opacity: 0.6; cursor: default; }
.apple-badge.soon .ab-big { font-size: 0.85rem; font-weight: 500; }
.center .badges, .cta-inner .badges, .sheet-inner.center .badges { justify-content: center; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 500px at 85% 0%, color-mix(in srgb, var(--teal) 22%, transparent), transparent 70%), var(--bg); padding: 3rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.kicker { color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0; }
html:not([lang='en']) .kicker { text-transform: none; letter-spacing: 0; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); margin: 0.5rem 0 1rem; font-weight: 900; }
.lead { font-size: 1.15rem; color: var(--muted); }
.today-card { display: grid; gap: 0.2rem; padding: 1.1rem 1.3rem; border-radius: var(--radius); background: var(--card); border-inline-start: 5px solid var(--teal); margin: 1.5rem 0 0.5rem; max-width: 460px; }
.today-card strong { font-size: 1.6rem; }
.today-events { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.today-events ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.today-events li { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.today-events li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.today-events a { color: inherit; text-decoration: none; }
.today-events a:hover { color: var(--teal); text-decoration: underline; }
.today-link { justify-self: start; margin-top: 0.5rem; padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--sel); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.today-link:hover { background: var(--teal); color: #fff !important; }
.today-events .none { margin: 0; color: var(--muted); font-style: italic; }
html[lang='ur'] .today-events .none, html[lang='ar'] .today-events .none { font-style: normal; }
html[lang='hi'] { --font: 'Noto Sans Devanagari', 'Roboto', system-ui, sans-serif; }
html[lang='hi'] body { line-height: 1.75; }

/* ---------- hero art ---------- */
.hero-art { display: flex; flex-direction: column; align-items: center; }
.hero-pic { position: relative; display: grid; place-items: center; width: 100%; min-height: 400px; }
.hero-art .badges { justify-content: center; margin: 1.25rem 0 0; }
.hero-art .glow { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 183, 77, 0.35), rgba(0, 150, 136, 0.25) 45%, transparent 70%); filter: blur(10px); }
.hero-pic > img { position: relative; width: min(360px, 80%); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.35)); animation: float 6s ease-in-out infinite; border-radius: 48px; }
.float-card { position: absolute; display: grid; gap: 0.1rem; padding: 0.7rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); }
.float-card strong { font-size: 1.05rem; }
.fc-1 { top: 12%; inset-inline-start: 0; border-inline-start: 4px solid var(--teal); }
.fc-2 { bottom: 10%; inset-inline-end: 0; border-inline-start: 4px solid #ffb74d; }
.fc-2:empty { display: none; }
@keyframes float { 50% { transform: translateY(-12px); } }
.shots { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.phone.shot { width: 280px; padding: 10px; border-radius: 38px; background: #0b0b0b; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); margin: 0; }
.phone.shot img { border-radius: 30px; display: block; }

/* ---------- web calendar (app colours, web layout) ---------- */
.cal-section { background: var(--bg-alt); }
/* Home starts with the calendar: tight spacing so the whole box fits on screen. */
.section.cal-section { padding-top: 1rem; padding-bottom: 1.5rem; }
@media (max-width: 600px) { .section.cal-section { padding-top: 0.75rem; } }
/* Calendar keeps its full width; buttons sit in the margin to its right. */
.cal-layout { display: flex; align-items: flex-start; gap: 1.5rem; }
.cal-layout > .webcal { flex: 1 1 100%; min-width: 0; }
.cal-stores { display: none; }
/* Wide screens: use the full window so the calendar keeps 1160px and the buttons
   go in the right margin. Needs 1160 + gap + buttons + side padding. */
@media (min-width: 1300px) {
  .cal-section > .wrap { width: calc(100% - 2rem); max-width: none; }
  /* Center the group; calendar takes up to 1160px but shrinks if the row is tight. */
  .cal-layout { justify-content: center; align-items: stretch; max-width: 1500px; margin-inline: auto; }
  .cal-layout > .webcal { flex: 1 1 auto; max-width: 1160px; min-width: 0; }
  /* Ad on top, buttons at the bottom of the calendar's right side. */
  .cal-stores { display: flex; flex-direction: column; justify-content: space-between; gap: 0.9rem; flex: none; width: 300px; }
  .cal-stores .badges { flex-direction: column; align-items: center; gap: 0.9rem; margin: 0; }
}
/* Matching store buttons (same size and style). */
.store-box { display: flex; align-items: center; gap: 0.5rem; height: 58px; padding: 0 0.9rem; border-radius: 10px; background: #000; color: #fff !important; text-decoration: none; border: 1px solid #a6a6a6; font-family: -apple-system, 'Segoe UI', 'Roboto', sans-serif; direction: ltr; }
.store-box:hover { background: #1a1a1a; }
.store-box svg { flex: none; }
.store-box .ab-text { display: grid; line-height: 1.05; text-align: start; }
.store-box .ab-small { font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; }
.store-box .ab-big { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }
.badges-box { gap: 0.75rem; }
/* Both buttons the same width, centered in the column. */
.badges-box .store-box { flex: 0 0 auto; width: 200px; justify-content: flex-start; }
/* Ad placeholder in the calendar side column (replace with real ad code later). */
.ad-slot { display: none; }
@media (min-width: 1300px) {
  .ad-slot { display: flex; flex-direction: column; align-items: stretch; gap: 0.4rem; width: 300px; }
  .ad-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }
  .ad-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 300px; padding: 2rem 1.25rem 1.5rem; border-radius: 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); text-decoration: none; text-align: center; }
  /* Dark mode: match the site's dark surface and use the light-text logo. */
  :root[data-theme='dark'] .ad-card { background: var(--surface); border-color: var(--border); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
  :root[data-theme='dark'] .ad-title { color: #fff; }
  :root[data-theme='dark'] .ad-text { color: var(--muted); }
  :root[data-theme='dark'] .ad-logo.logo-light { display: none; }
  .ad-logo.logo-dark { display: none; }
  :root[data-theme='dark'] .ad-logo.logo-dark { display: block; }
  .ad-sponsored { position: absolute; top: 10px; inset-inline-end: 12px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #94a3b8; }
  .ad-logo { display: block; width: 190px; height: auto; margin: 0.25rem 0 0.4rem; }
  .ad-title { font-size: 1.2rem; font-weight: 800; color: #0f2350; line-height: 1.25; }
  .ad-text { font-size: 0.9rem; color: #55617a; line-height: 1.4; }
  .ad-cta { margin-top: 0.5rem; padding: 0.6rem 1.4rem; border-radius: 999px; background: linear-gradient(135deg, #3f7cc0, #1b3a73); color: #fff; font-weight: 700; font-size: 0.95rem; }
  .ad-card:hover .ad-cta { filter: brightness(1.08); }
}

.cal-intro { max-width: 760px; margin: -0.5rem 0 1.5rem; }
.webcal { display: grid; grid-template-columns: minmax(0, 1fr) 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12); font-family: 'Roboto', var(--font); }
html[lang='ur'] .webcal, html[lang='ar'] .webcal { font-family: var(--font); }
.cal-main { padding: 20px 22px 18px; min-width: 0; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-titles { margin-inline-start: 8px; }
.month-title { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.cal-range { margin: 2px 0 0; color: var(--teal); font-weight: 500; font-size: 0.95rem; }
:root[data-theme='dark'] .cal-range { color: var(--accent); }
.chev { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background 0.15s; }
.chev:hover { background: var(--teal-700); }
[dir='rtl'] .chev svg { transform: scaleX(-1); }
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-tools .btn[disabled] { opacity: 0.45; cursor: default; }
.cal-country { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--muted); }
.cal-country[hidden] { display: none; }
.cal-country select { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; padding: 0.5rem 0.4rem; max-width: 220px; cursor: pointer; }
.cal-country select:focus { outline: none; }
.cal-country:focus-within { outline: 3px solid var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cal-grid { display: grid; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow { text-align: center; color: var(--muted); font-size: 13px; height: 34px; line-height: 34px; font-weight: 500; }
.dow.sun { color: var(--red); }
.cell { position: relative; margin: 2px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--cell-border); border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; padding: 0; line-height: 1.15; transition: background 0.12s, border-color 0.12s; }
button.cell:hover { background: var(--sel); border-color: var(--teal-300); }
.cell .h { color: var(--teal); }
:root[data-theme='dark'] .cell .h { color: var(--accent); }
.cell.sun .g { color: var(--red); }
.cell.out { border-color: transparent; cursor: default; }
.cell.out .g { color: var(--muted); opacity: 0.55; }
.cell .ev { display: block; width: 26px; max-width: 60%; height: 3px; border-radius: 2px; background: var(--ev-line); }
/* web cells */
.cal-grid.web .cell { height: 82px; align-items: stretch; justify-content: flex-start; padding: 7px 8px; gap: 5px; text-align: start; }
.cal-grid.web .cell.out { justify-content: flex-start; }
.cell-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.cal-grid.web .g { font-size: 1.2rem; font-weight: 600; }
.cal-grid.web .h { font-size: 0.8rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(0, 150, 136, 0.1); }
.cal-grid.web .ev { display: none; }
.ev-chip { display: block; font-size: 0.72rem; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: rgba(165, 214, 167, 0.28); color: #2e7d32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme='dark'] .ev-chip { background: rgba(165, 214, 167, 0.14); color: var(--ev-line); }
.ev-more { font-size: 0.7rem; color: var(--muted); padding-inline-start: 4px; }
.cell.sel { border: 2px solid var(--teal); background: var(--sel); }
.cell.today { background: rgba(76, 175, 80, 0.16); border: 2px solid #4caf50; }
.cal-grid.web .cell.today .g { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin: -4px 0 0 -4px; border-radius: 50%; background: #4caf50; color: #fff; font-weight: 700; }
[dir='rtl'] .cal-grid.web .cell.today .g { margin: -4px -4px 0 0; }
/* compact cells (year pages) */
.cal-grid.compact .cell { height: 44px; margin: 1px; cursor: default; border-radius: 6px; }
.cal-grid.compact .cell .h { font-size: 11px; }
.cal-grid.compact .cell .g { font-size: 14px; }
.cal-grid.compact .cell .ev { width: 18px; margin-top: 3px; height: 2px; }
.cal-grid.compact .dow { font-size: 11px; height: 26px; line-height: 26px; }
.cell-wrap { display: block; min-width: 0; }
.offset-note { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; }

.cal-side { display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--bg-alt); border-inline-start: 1px solid var(--border); min-width: 0; }
.day-panel { padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(160deg, var(--teal-800), var(--teal-900)); box-shadow: 0 8px 20px rgba(0, 77, 64, 0.35); }
.day-panel p { margin: 0; }
.day-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
html:not([lang='en']) .day-label { text-transform: none; letter-spacing: 0; }
.day-hijri { font-size: 1.55rem; font-weight: 700; line-height: 1.25; margin-top: 4px !important; }
.day-greg { opacity: 0.9; }
.day-basis { font-size: 0.8rem; opacity: 0.7; margin-top: 2px !important; }
.day-panel .ev-list { margin-top: 12px; }
.day-panel .ev-card { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); box-shadow: none; }
.day-panel .ev-card h3, .day-panel .ev-card h3 a { color: #fff; }
.day-panel .ev-card p { color: rgba(255, 255, 255, 0.75); }
.day-panel .learn { background: rgba(255, 255, 255, 0.16); color: #fff; }
.day-panel .muted { color: rgba(255, 255, 255, 0.7); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 0.78rem; }
.ev-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ev-list.scroll { max-height: 430px; overflow-y: auto; padding-inline-end: 4px; scrollbar-width: thin; }
.ev-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--teal); min-width: 0; }
.ev-text { flex: 1; min-width: 0; }
.ev-card h3 { margin: 0 0 2px; font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-card h3 a { color: var(--text); text-decoration: none; }
.ev-card h3 a:hover { text-decoration: underline; }
.ev-card p { margin: 0; font-size: 0.8rem; color: var(--muted); }
.ev-greg::before { content: ' · '; }
.learn { flex: none; padding: 5px 10px; border-radius: 8px; border: 0; background: rgba(121, 215, 190, 0.18); color: var(--teal-700); font: inherit; font-size: 0.78rem; font-weight: 500; cursor: pointer; text-decoration: none; }
:root[data-theme='dark'] .learn { color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 1rem; margin: 0; }
/* Desktop: the side panel takes the calendar's height (height 0 + min-height 100%
   keeps it from stretching the row); the month's event list scrolls inside it. */
@media (min-width: 1081px) {
  .webcal > .cal-side { height: 0; min-height: 100%; overflow-y: auto; }
  .cal-side .day-panel { flex: none; }
  .cal-side .month-panel { flex: 1 1 auto; min-height: 160px; display: flex; flex-direction: column; }
  .cal-side .ev-list.scroll { flex: 1 1 0; min-height: 0; max-height: none; }
}

/* ---------- sections ---------- */
.section { padding: 3.5rem 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.25rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.upcoming { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.upcoming a { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: 0.8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.up-name { font-weight: 700; }
.up-date { grid-column: 1; color: var(--muted); font-size: 0.9rem; }
.up-days { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--teal-700); font-weight: 700; font-size: 0.9rem; }
:root[data-theme='dark'] .up-days { color: var(--accent); }
.text-link { font-weight: 700; }
.year-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill { padding: 0.35rem 0.9rem; border-radius: 999px; border: 1px solid var(--accent); text-decoration: none; font-weight: 500; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature { padding: 1.4rem; border-radius: var(--radius); background: var(--card); }
.feature h3 { margin: 0.6rem 0 0.4rem; }
.feature p { margin: 0; color: var(--muted); }
.f-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--teal-300), var(--teal-700)); color: #fff; font-size: 1.4rem; }
.faq details { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.faq p { color: var(--muted); margin: 0.6rem 0 0; }
.cta-band { background: linear-gradient(135deg, var(--teal-800), var(--teal-900)); color: #fff; padding: 2.5rem 0; }
.cta-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta-inner > div { flex: 1; min-width: 240px; }
.cta-inner h2 { margin: 0 0 0.3rem; }
.cta-inner p { margin: 0; opacity: 0.85; }
.cta-inner img { border-radius: 20px; }

/* ---------- content pages ---------- */
.page { padding: 1.5rem 0 3rem; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.5rem 0; }
.page h1 small { font-size: 0.55em; font-weight: 500; }
.page h2 { margin-top: 2.2rem; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.9rem; color: var(--muted); }
.crumbs li:not(:last-child)::after { content: '›'; margin-inline-start: 0.4rem; }
[dir='rtl'] .crumbs li:not(:last-child)::after { content: '‹'; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { padding: 0.6rem 0.8rem; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td:last-child { white-space: normal; }
table.data thead th { background: var(--bg-alt); position: sticky; top: 0; }
table.data tr.sun td:first-child { color: var(--red); }
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.mini-month { padding: 1rem; border-radius: var(--radius); background: var(--card); }
.mini-month h2 { margin: 0; font-size: 1.15rem; }
.mini-month h2 a { text-decoration: none; }
.mini-month > p { margin: 0 0 0.4rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-weight: 700; }
.month-layout { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 2rem; align-items: start; margin-top: 1rem; }
.month-app .app { border-radius: 24px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); border: 1px solid var(--border); }
.month-layout h2 { margin-top: 0; }
.cta-inline .badges { margin: 1.25rem 0; }
.ev-groups { columns: 2 340px; column-gap: 2rem; }
.ev-group { break-inside: avoid; margin-bottom: 1.5rem; }
.ev-index { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.ev-index a { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 10px; text-decoration: none; color: var(--text); background: var(--card); }
.ev-day { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 700; }
.next-date { display: grid; gap: 0.2rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--card); border-inline-start: 5px solid var(--teal); margin: 1.2rem 0; }
.next-date strong { font-size: 1.35rem; }
.event-img { display: block; width: 100%; border-radius: var(--radius); margin: 1rem 0; aspect-ratio: 16 / 9; object-fit: cover; background: var(--card); }
.detail p { font-size: 1.05rem; }
.cta-box { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; padding: 1.2rem 1.4rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--teal-800), var(--teal-900)); color: #fff; margin: 1.5rem 0; }
.cta-box h2 { margin: 0; font-size: 1.2rem; }
.cta-box p { margin: 0.2rem 0 0; opacity: 0.85; }
.cta-box .badges { margin: 0; }

/* ---------- dialogs ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: 22px; width: min(520px, 100% - 1.5rem); max-height: 88vh; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
.sheet-inner { position: relative; padding: 1.5rem; display: grid; gap: 0.8rem; }
.sheet-inner h2 { margin: 0; padding-inline-end: 2rem; font-size: 1.3rem; }
.sheet-inner.center { justify-items: center; text-align: center; }
.sheet-inner.center h2 { padding: 0; }
.close-x { position: absolute; top: 0.75rem; inset-inline-end: 0.75rem; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--card); color: var(--text); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.ev-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; }
.ev-detail p { margin: 0; color: var(--muted); }
.sheet-cta .badges { margin: 0; }
.field { display: grid; gap: 0.35rem; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font-weight: 700; font-size: 0.95rem; }
.field select, .search-input { font: inherit; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; }
.field[hidden] { display: none; }
.seg { display: flex; gap: 0.4rem; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 0.55rem; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.seg input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; max-height: 50vh; overflow: auto; }
.search-results button { display: grid; width: 100%; text-align: start; gap: 0.1rem; padding: 0.6rem 0.8rem; border-radius: 10px; border: 0; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .webcal { grid-template-columns: 1fr; }
  .cal-side { border-inline-start: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .ev-list.scroll { max-height: 360px; }
}
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .hero-pic { min-height: 320px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .year-grid { grid-template-columns: repeat(2, 1fr); }
  /* Main links go into the 3-line menu (opened by .menu-btn). */
  .nav { position: relative; }
  .icon-btn.menu-btn { display: inline-grid; }
  .links { display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0; flex-direction: column; gap: 0.25rem; padding: 0.5rem; border-radius: 0 0 14px 14px; background: var(--surface); border: 1px solid var(--border); border-top: 0; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3); }
  .nav-open .links { display: flex; }
  .links a { padding: 0.75rem 1rem; border-radius: 10px; font-size: 1rem; }
  .links a:hover { background: var(--sel); color: var(--text); }
  .nav-actions { margin-inline-start: auto; }
  /* Mobile: replace the Download button with Play + App Store icons. */
  .nav-actions [data-download] { display: none; }
  .nav-store-icons { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .cal-side { grid-template-columns: 1fr; }
  .cal-main { padding: 14px 8px; }
  .cal-toolbar { padding: 0 6px; }
  .month-title { font-size: 1.3rem; }
  /* Small screens: compact cells like the app (Hijri above, Gregorian below, green underline) */
  .cal-grid.web .cell { height: 62px; padding: 4px 2px; align-items: center; justify-content: center; gap: 2px; margin: 1px; border-radius: 8px; }
  .cal-grid.web .cell-top { flex-direction: column-reverse; align-items: center; gap: 1px; }
  .cal-grid.web .g { font-size: 1.05rem; }
  .cal-grid.web .h { padding: 0; background: none; font-size: 0.75rem; }
  .cal-grid.web .ev-chip, .cal-grid.web .ev-more { display: none; }
  .cal-grid.web .ev { display: block; margin-top: 2px; }
  .cal-grid.web .cell.today .g { margin: 0; min-width: 26px; height: 26px; }
  .dow { font-size: 12px; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 1.25rem); }
  .brand span { display: none; }
  .nav-actions .lang-switch { display: none; }
  .lang-menu summary { padding: 0 0.55rem; }
  .hero { padding-top: 1.5rem; }
  .features, .year-grid { grid-template-columns: 1fr; }
  .float-card { display: none; }
  .webcal { border-radius: 16px; margin-inline: -0.25rem; }
  /* Phones: skip the decorative app picture so the calendar comes up sooner. */
  .hero-pic { display: none; }
  .hero-art .badges { margin-top: 0; }
  .hero { padding-bottom: 1.5rem; }
  .hero h1 { font-size: 1.9rem; }
  .lead { font-size: 1rem; }
  .feature { padding: 1rem; }
}
/* "Trusted by 50K+ users · 4.6 star rating" */
.trust { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.trust-item { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 999px; font-size: 1rem; font-weight: 700; color: var(--text); background: rgba(0, 150, 136, 0.14); border: 1px solid rgba(0, 150, 136, 0.45); }
.trust-item:last-child { background: rgba(251, 188, 4, 0.14); border-color: rgba(251, 188, 4, 0.5); }
.trust-item svg { width: 20px; height: 20px; color: var(--teal); }
:root[data-theme='dark'] .trust-item svg { color: var(--accent); }
.trust .stars { color: #fbbc04; font-size: 1.25rem; line-height: 1; }
.cta-band .trust-item { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); }
.cta-band .trust-item svg { color: #fff; }
/* Back-to-top button */
.to-top { position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--teal-700); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .hero-pic > img { animation: none; } }
