/* Prayer Times → Google Calendar. Mobile-first, logical properties only (RTL-ready). */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #f0ede4;
  --text: #1c2624;
  --muted: #55625f;
  --border: #d9d4c7;
  --accent: #0e6b5e;
  --accent-hover: #0b574c;
  --accent-soft: #e2f0ec;
  --on-accent: #ffffff;
  --gold: #a87a1d;
  --warn-bg: #fff4d6;
  --warn-text: #6b4a00;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --focus: #1a73e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111716;
    --surface: #1a2220;
    --surface-2: #222c2a;
    --text: #e8eeec;
    --muted: #a3b2ae;
    --border: #34413e;
    --accent: #4fc2ad;
    --accent-hover: #6fd3c0;
    --accent-soft: #1d3a35;
    --on-accent: #08211d;
    --gold: #e0b45a;
    --warn-bg: #3a2f12;
    --warn-text: #f3d68e;
    --danger: #f28b82;
    --danger-soft: #3b1f1d;
    --focus: #8ab4f8;
    --shadow: none;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.wrap {
  inline-size: 100%;
  max-inline-size: 46rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -3rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus {
  inset-block-start: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 1.25rem 0.5rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-inline-size: 0;
}
.brand-mark {
  inline-size: 2rem;
  block-size: 2rem;
  flex: none;
  fill: var(--gold);
}
.brand h1,
.brand-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lang-picker select {
  min-inline-size: 7rem;
}

/* ---------- Hero ---------- */

.wrap-wide {
  max-inline-size: 72rem;
}

/* Header + hero sit on a dark, ornamented background in both colour schemes.
   The tokens are re-scoped here so buttons, select, focus ring etc. adapt. */
.hero-shell {
  --hero-ink: #151d23;
  --text: #eef3f1;
  --muted: #b6c4c0;
  --border: rgb(255 255 255 / 0.2);
  --surface: rgb(255 255 255 / 0.06);
  --surface-2: rgb(255 255 255 / 0.1);
  --accent: #5cc9b4;
  --accent-hover: #80d8c7;
  --accent-soft: rgb(92 201 180 / 0.16);
  --on-accent: #08211d;
  --gold: #e3b860;
  --focus: #8ab4f8;
  color-scheme: dark;
  color: var(--text);
  /* Phones: small image tucked into the top-right corner, darkened under the text. */
  background:
    linear-gradient(90deg, rgb(21 29 35 / 0.9) 0 40%, rgb(21 29 35 / 0.35)),
    url('../assets/hero-bg-sm.webp') right -7rem top 1rem / auto 24rem no-repeat,
    var(--hero-ink);
}
.hero-shell select { background-color: var(--hero-ink); }
.hero-shell select option { background: var(--hero-ink); color: var(--text); }

.hero {
  position: relative;
  display: grid;
  align-items: center;
  /* Fill the first screen below the header (~4.5rem). */
  min-block-size: calc(100svh - 4.5rem);
  padding-block: 1.5rem 4.5rem;
}

@media (min-width: 56rem) {
  .hero-shell {
    background: url('../assets/hero-bg.webp') right center / cover no-repeat, var(--hero-ink);
  }
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-title > span {
  display: block;
}
.hero-accent {
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 1.5rem;
  max-inline-size: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-actions {
  margin-block-end: 1.5rem;
}
.hero-actions .btn {
  flex: 1 1 auto;
}

.hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero-points .icon {
  color: var(--accent);
  flex: none;
}

/* Hero and step images. */
.media {
  display: block;
  inline-size: 100%;
  /* Let aspect-ratio win over the <img> height attribute. */
  block-size: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.media-portrait {
  aspect-ratio: 4 / 5;
}
.hero-media .media {
  max-inline-size: 26rem;
  margin-inline: auto;
  /* Thin light ring + deep shadow so the dark image separates from the dark hero. */
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12), 0 24px 60px rgb(0 0 0 / 0.45);
}

.scroll-cue {
  position: absolute;
  inset-block-end: 1rem;
  inset-inline-start: 50%;
  translate: -50% 0;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  transition: background-color 0.2s;
}
.scroll-cue:hover {
  background: var(--accent-soft);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  .scroll-cue .icon {
    animation: cue 2s ease-in-out infinite;
  }
  @keyframes cue {
    50% {
      transform: translateY(3px);
    }
  }
}

/* ---------- How it works ---------- */

.how {
  padding-block: 3.5rem 2.5rem;
  scroll-margin-block-start: 0.5rem;
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
}
.section-lead {
  margin: 0 auto 2rem;
  max-inline-size: 34rem;
  color: var(--muted);
  text-align: center;
}

.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.how-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.75rem 1.25rem;
}
.how-step .media {
  margin-block-end: 1rem;
  border-radius: calc(var(--radius) - 4px);
}
.how-step h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0.25rem 0.4rem;
  font-size: 1.1rem;
}
.how-step p {
  margin: 0 0.25rem;
  color: var(--muted);
}

.how-cta {
  margin: 2rem 0 0;
  text-align: center;
}

/* ---------- Cards / steps ---------- */

main {
  padding-block: 0.75rem 1rem;
  scroll-margin-block-start: 0.5rem;
}
main:focus {
  outline: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1rem 1.25rem;
  margin-block-end: 1rem;
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  flex: none;
}

.card p {
  margin-block: 0 0.75rem;
}

.note {
  background: var(--surface-2);
  border-inline-start: 4px solid var(--gold);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.93rem;
}

.help {
  color: var(--muted);
  font-size: 0.9rem;
  margin-block: 0.3rem 0;
}

.warning {
  background: var(--warn-bg);
  color: var(--warn-text);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.93rem;
  margin-block: 0.5rem 0;
}

.status:empty {
  display: none;
}
.status {
  margin-block: 0.75rem 0;
  font-size: 0.95rem;
}
.status.error {
  color: var(--danger);
}
.status.ok {
  color: var(--accent);
}

.attribution {
  font-size: 0.8rem;
  color: var(--muted);
  margin-block-start: 0.75rem;
}

/* ---------- Buttons ---------- */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-large {
  min-block-size: 3.1rem;
  padding-inline: 1.5rem;
  font-size: 1.05rem;
}

.icon {
  inline-size: 1.2rem;
  block-size: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.g-icon {
  inline-size: 1.1rem;
  block-size: 1.1rem;
}
@media (prefers-color-scheme: dark) {
  .g-icon path {
    fill: var(--on-accent);
  }
}

/* ---------- Forms ---------- */

label,
legend {
  font-weight: 600;
}

input,
select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-block-size: 2.75rem;
  padding: 0.45rem 0.65rem;
  inline-size: 100%;
}
input:hover,
select:hover {
  border-color: var(--muted);
}
input[type="checkbox"],
input[type="radio"] {
  inline-size: 1.2rem;
  block-size: 1.2rem;
  min-block-size: 0;
  accent-color: var(--accent);
  margin: 0;
  flex: none;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}
legend {
  padding: 0;
  margin-block-end: 0.35rem;
}

.field {
  margin-block-end: 1rem;
  display: grid;
  gap: 0.3rem;
}
.field > label:not(.check) {
  display: block;
}
.indent {
  margin-block-start: 0.5rem;
  padding-inline-start: 1.9rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
  min-block-size: 2.5rem;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  gap: 0 1rem;
}

.adjust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.6rem;
  margin-block-start: 0.4rem;
}
.adjust-grid label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}
.adjust-grid input {
  text-align: center;
}

.segmented {
  display: flex;
  gap: 0.4rem;
}
.segmented label {
  flex: 1 1 0;
  min-inline-size: 0;
  position: relative;
  font-weight: 600;
}
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  cursor: pointer;
}
.segmented span {
  display: grid;
  place-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
}
.segmented input:checked + span {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.segmented input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.search-form {
  display: grid;
  gap: 0.3rem;
}
.input-row {
  display: flex;
  gap: 0.5rem;
}
.input-row input {
  flex: 1;
  min-inline-size: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-block: 1rem !important;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--border);
}

.results {
  margin-block-start: 0.75rem;
}
.results ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.results button {
  inline-size: 100%;
  text-align: start;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  min-block-size: 2.75rem;
  cursor: pointer;
}
.results button:hover {
  border-color: var(--accent);
}

.summary {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: 10px;
}
.summary div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
}
.summary dt {
  color: var(--muted);
  font-size: 0.9rem;
}
.summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- Preview table ---------- */

.table-scroll {
  margin-inline: -0.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.preview-table {
  border-collapse: collapse;
  inline-size: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.preview-table th,
.preview-table td {
  padding: 0.5rem 0.2rem;
  text-align: center;
  white-space: nowrap;
}
.preview-table thead th {
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--muted);
}
.preview-table tbody th {
  text-align: start;
  font-weight: 600;
}
.preview-table tbody tr + tr > * {
  border-block-start: 1px solid var(--border);
}
.preview-table tr.friday {
  background: var(--accent-soft);
}
.preview-table .jumuah {
  display: block;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}
.badge {
  display: inline-block;
  margin-inline-start: 0.35rem;
  font-size: 0.7rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  background: var(--gold);
  color: #fff;
  vertical-align: middle;
}

/* ---------- Progress / done ---------- */

.progress-box {
  margin-block-start: 1rem;
}
progress {
  inline-size: 100%;
  block-size: 0.85rem;
  appearance: none;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
}
progress::-webkit-progress-bar {
  background: var(--surface-2);
}
progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 99px;
}
progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 99px;
}
.progress-text {
  margin-block: 0.4rem 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.done {
  margin-block-start: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.done h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
}
.done:focus {
  outline: none;
}

#btn-continue {
  margin-block-start: 0.75rem;
}

.manage {
  margin-block-start: 1.25rem;
  border-block-start: 1px solid var(--border);
  padding-block-start: 0.75rem;
}
.manage summary {
  gap: 0.4rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  min-block-size: 2.5rem;
  display: flex;
  align-items: center;
}
.manage-item {
  margin-block-start: 0.75rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 0.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer p {
  margin-block: 0 0.4rem;
}

/* ---------- Privacy page ---------- */

.prose {
  max-inline-size: 40rem;
}
.prose p {
  margin-block: 0 1rem;
}

/* ---------- Larger screens ---------- */

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }
  .how-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 40rem) {
  .brand h1,
  .brand-name {
    font-size: 1.45rem;
  }
  .hero-actions .btn {
    flex: 0 0 auto;
  }
  .card {
    padding: 1.4rem 1.5rem 1.5rem;
  }
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .preview-table {
    font-size: 0.92rem;
  }
  .table-scroll {
    margin-inline: 0;
  }
  .preview-table th,
  .preview-table td {
    padding-inline: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

[hidden] {
  display: none !important;
}

