/* ==========================================================================
   Giving Place: design system
   --------------------------------------------------------------------------
   Colour   Brand green #056951 (sampled from the existing logo), a warm paper
            ground in place of pure white, and green-black ink. One warm
            accent, "lamp", is kept for the only live element on the site: the
            next prayer.
   Type     Newsreader, a variable serif, for anything said with feeling.
            Figtree, a geometric sans, for anything you act on, echoing the
            logo's caps. Amiri Quran for Arabic (Uthmani script).
   Motion   One easing curve. Things move only when the movement says
            something: a line means a connection, a dot means a place, a
            weight change means arriving. Reduced-motion users get the end
            state.
   ========================================================================== */

:root {
  --paper: #F5F2EB;
  --paper-2: #ECE7DC;
  --card: #FBF9F4;
  --ink: #15201C;
  --ink-2: #46524D;
  --ink-3: #77817C;
  --line: rgba(21, 32, 28, .12);
  --line-2: rgba(21, 32, 28, .22);

  --green: #056951;
  --green-2: #045A45;
  --green-3: #033F31;
  --green-4: #022C22;
  --mint: #CFE3D8;
  --mint-2: #E4EFE8;
  --lamp: #E3B25A;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Amiri Quran", "Noto Naskh Arabic", "Geeza Pro", serif;

  /* Corners: tight and consistent. Large for cards and panels, medium for controls, small for chips. */
  --r-lg: 10px;
  --r-md: 6px;
  --r-sm: 4px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --max: 1280px;
  --pad: clamp(20px, 4.2vw, 56px);
  --gap: clamp(16px, 2.4vw, 32px);
  --r: 16px;
  --header: 76px;
  --section: clamp(88px, 12vw, 168px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--green); color: var(--paper); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { width: 100%; max-width: calc(var(--max) + var(--pad) * 2); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.display, .title, .serif {
  font-family: var(--serif); font-optical-sizing: auto;
  font-weight: 380; letter-spacing: -0.022em; text-wrap: balance;
}
.display { font-size: clamp(2.75rem, 1.3rem + 5vw, 5.9rem); line-height: .98; margin: 0; }
.title { font-size: clamp(2.2rem, 1.45rem + 2.7vw, 4rem); line-height: 1.02; margin: 0; }
.title-sm { font-size: clamp(1.7rem, 1.3rem + 1.3vw, 2.4rem); }
.display em, .title em { font-style: italic; font-weight: inherit; color: var(--green); }
.on-dark .display em, .on-dark .title em { color: var(--mint); }

.lead { font-size: clamp(1.1rem, 1rem + .35vw, 1.28rem); line-height: 1.55; color: var(--ink-2); max-width: 36em; margin: 0; text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 1.6rem;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.on-dark .eyebrow { color: rgba(245, 242, 235, .62); }
.on-dark .eyebrow::before { background: var(--mint); }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; line-height: 1.5; }
p { margin: 0 0 1em; }

/* ---------- Buttons ---------- */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  height: var(--h); padding: 0 1.6em; border-radius: var(--r-md);
  font: 600 1rem/1 var(--sans); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.btn svg { width: 1.05em; height: 1.05em; transition: transform .45s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green); color: var(--paper); }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-light { background: var(--paper); color: var(--green-3); }
.btn-light:hover { background: #fff; }
.btn-sm { --h: 42px; padding: 0 1.2em; font-size: .9375rem; }
.btn-block { width: 100%; }
.on-dark .btn-ghost { border-color: rgba(245, 242, 235, .3); color: var(--paper); }
.on-dark .btn-ghost:hover { background: var(--paper); color: var(--green-3); }

.link {
  display: inline-flex; align-items: center; gap: .45em; font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease); padding-bottom: 2px;
}
.link:hover { background-size: 100% 1px; }
.link svg { width: 1em; height: 1em; transition: transform .45s var(--ease); }
.link:hover svg { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .5s var(--ease);
}
.site-header.is-scrolled { background: rgba(245, 242, 235, .94); box-shadow: 0 1px 0 var(--line); }
@supports (backdrop-filter: blur(1px)) { .site-header.is-scrolled { background: rgba(245, 242, 235, .86); backdrop-filter: saturate(1.4) blur(14px); } }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; color: var(--green); text-decoration: none; height: 34px; }
.logo svg { height: 100%; width: auto; }
.logo-fallback { font: 800 1.15rem/1 var(--sans); letter-spacing: .02em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 36px); }
.nav a:not(.btn) {
  position: relative; font: 500 .975rem/1 var(--sans); text-decoration: none; color: var(--ink-2);
  padding: 8px 0; transition: color .3s var(--ease);
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; border-radius: 50%;
  background: var(--green); transform: translate(-50%, 4px) scale(0); transition: transform .4s var(--ease);
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after, .nav a:not(.btn):hover::after { transform: translate(-50%, 4px) scale(1); }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border-radius: var(--r-md);
    border: 1px solid var(--line-2); background: transparent; font: 600 .9375rem/1 var(--sans); cursor: pointer;
  }
  .menu-toggle i { position: relative; width: 14px; height: 8px; }
  .menu-toggle i::before, .menu-toggle i::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), top .4s var(--ease); }
  .menu-toggle i::before { top: 0; } .menu-toggle i::after { top: 6.5px; }
  .menu-open .menu-toggle i::before { top: 3.25px; transform: rotate(45deg); }
  .menu-open .menu-toggle i::after { top: 3.25px; transform: rotate(-45deg); }
}
.mobile-menu {
  position: fixed; inset: 0; z-index: 40; background: var(--paper); padding: calc(var(--header) + 32px) var(--pad) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .7s var(--ease), visibility 0s .7s;
}
.menu-open .mobile-menu { clip-path: inset(0); visibility: visible; transition: clip-path .7s var(--ease); }
.menu-open .site-header { background: var(--paper); box-shadow: none; }
.mobile-menu nav { display: grid; gap: 6px; }
.mobile-menu nav a {
  font: 380 clamp(2.4rem, 10vw, 3.4rem)/1.1 var(--serif); letter-spacing: -.02em; text-decoration: none;
  opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.menu-open .mobile-menu nav a { opacity: 1; transform: none; transition-delay: calc(.12s + var(--i) * .05s); }
.mobile-menu nav a[aria-current="page"] { font-style: italic; color: var(--green); }

/* ---------- Live prayer chip ---------- */
.prayer {
  display: inline-flex; align-items: center; gap: 10px; font: 500 .875rem/1.2 var(--sans);
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.prayer b { color: var(--ink); font-weight: 650; }
.lamp { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--lamp); }
.lamp::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; background: var(--lamp); opacity: .35;
  animation: lamp 2.8s var(--ease-io) infinite;
}
@keyframes lamp { 0%, 100% { transform: scale(.4); opacity: .45; } 50% { transform: scale(1); opacity: 0; } }
.on-dark .prayer { color: rgba(245, 242, 235, .7); }
.on-dark .prayer b { color: var(--paper); }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Headings settle into their weight as they arrive: the "dynamic" type. */
.js .title[data-reveal], .js .display[data-reveal] { font-weight: 250; letter-spacing: 0; transition-property: opacity, transform, font-weight, letter-spacing; transition-duration: 1.1s, 1.1s, 1.6s, 1.6s; }
.js .title[data-reveal].is-in, .js .display[data-reveal].is-in { font-weight: 380; letter-spacing: -0.022em; }

/* ---------- Map ---------- */
.gpmap { width: 100%; height: 100%; overflow: visible; }
.gpmap-road { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.gpmap-road.is-major { stroke-width: calc(var(--upp, 1) * 1.1px); opacity: .22; }
.gpmap-road.is-minor { stroke-width: calc(var(--upp, 1) * .7px); opacity: .13; }
.gpmap-river { fill: none; stroke: var(--mint); stroke-width: calc(var(--upp, 1) * var(--river, 7) * 1px); stroke-linecap: round; stroke-linejoin: round; }
.gpmap-river-label { font: italic 400 calc(var(--upp, 1) * 14px) var(--serif); fill: var(--ink-3); letter-spacing: .02em; }
.gpmap-place { cursor: default; outline: none; }
.gpmap-place[role="link"] { cursor: pointer; }
.gpmap-hit { fill: transparent; }
.gpmap-pin { fill: var(--green); stroke: var(--paper); stroke-width: 2.5; transition: transform .45s var(--ease); }
.gpmap-halo { fill: var(--green); opacity: 0; transform: scale(.4); transition: opacity .5s var(--ease), transform .7s var(--ease); }
.gpmap-place.is-soon .gpmap-pin { fill: var(--paper); stroke: var(--green); stroke-width: 2; stroke-dasharray: 3 2.6; }
.gpmap-label { font: 600 13px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; transition: opacity .4s var(--ease); }
.gpmap-place.is-active .gpmap-halo, .gpmap-place:hover .gpmap-halo, .gpmap-place:focus-visible .gpmap-halo { opacity: .16; transform: scale(1); }
.gpmap-place.is-active .gpmap-pin, .gpmap-place:hover .gpmap-pin { transform: scale(1.3); }
.gpmap-place.is-dim { opacity: .25; }
.gpmap-place { transition: opacity .4s var(--ease); }

.on-dark .gpmap-road { stroke: var(--paper); }
.on-dark .gpmap-road.is-major { opacity: .2; }
.on-dark .gpmap-road.is-minor { opacity: .1; }
.on-dark .gpmap-river { stroke: rgba(207, 227, 216, .16); }
.on-dark .gpmap-river-label { fill: rgba(245, 242, 235, .4); }
.on-dark .gpmap-pin { fill: var(--mint); stroke: var(--green-3); }
.on-dark .gpmap-halo { fill: var(--lamp); }
/* Gold (live) markers breathe, very slightly. */
@keyframes halo-breathe { 0%, 100% { opacity: .3; transform: scale(1); } 50% { opacity: .14; transform: scale(1.28); } }
.on-dark .gpmap-place.is-active .gpmap-halo, .hero-map .gpmap-place.is-active .gpmap-halo { animation: halo-breathe 3.2s var(--ease-io) infinite; }
.on-dark .gpmap-place.is-active .gpmap-pin { fill: var(--lamp); }
.on-dark .gpmap-place.is-active .gpmap-halo { opacity: .3; }
.on-dark .gpmap-place.is-soon .gpmap-pin { fill: var(--green-3); stroke: var(--mint); }
.on-dark .gpmap-label { fill: var(--paper); stroke: var(--green-3); }

/* ---------- Status tag ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-md);
  font: 600 .75rem/1 var(--sans); letter-spacing: .02em; white-space: nowrap;
  background: var(--mint-2); color: var(--green-2);
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.is-soon { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.tag.is-soon::before { background: transparent; box-shadow: inset 0 0 0 1.2px currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font: 500 .78rem/1 var(--sans); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Photo placeholder ---------- */
.photo-ph {
  aspect-ratio: 4 / 5; display: grid; place-items: end start; padding: 22px; border-radius: var(--r-lg);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(5, 105, 81, .06) 11px 12px),
    linear-gradient(180deg, var(--mint-2), var(--paper-2));
  color: var(--ink-3); font: 500 .8rem/1.3 var(--sans);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field > span { font: 600 .875rem/1.2 var(--sans); color: var(--ink); }
.field small { color: var(--ink-3); font-size: .8125rem; }
.input, .select, .textarea {
  width: 100%; height: 54px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--card); font: 500 1rem/1 var(--sans); transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.textarea { height: auto; min-height: 120px; padding: 14px 18px; line-height: 1.5; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2315201C' stroke-width='1.6'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; padding-right: 44px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(5, 105, 81, .12); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-md); background: var(--paper-2); position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; z-index: 1; display: grid; place-items: center; height: 44px; padding: 0 20px; border-radius: var(--r-sm); font: 600 .9375rem/1 var(--sans); color: var(--ink-2); cursor: pointer; transition: color .35s var(--ease); white-space: nowrap; }
.seg input:checked + label { color: var(--ink); }
.seg input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 2px; }
.seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: var(--r-sm); background: var(--card); box-shadow: 0 1px 2px rgba(21, 32, 28, .08), 0 4px 14px rgba(21, 32, 28, .06); transition: transform .5s var(--ease), width .5s var(--ease); }

.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts input { position: absolute; opacity: 0; pointer-events: none; }
.amounts label {
  display: grid; place-items: center; height: 60px; border-radius: var(--r-md); cursor: pointer;
  font: 400 1.45rem/1 var(--serif); font-variant-numeric: lining-nums; letter-spacing: -.01em;
  box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease), font-weight .5s var(--ease);
}
.amounts label:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.amounts input:checked + label { background: var(--green); color: var(--paper); box-shadow: none; font-weight: 520; }
.amounts input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 2px; }

.toggle { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle .sw { flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--r-sm); background: var(--line-2); transition: background-color .35s var(--ease); margin-top: 1px; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .45s var(--ease); }
.toggle input:checked + .sw { background: var(--green); }
.toggle input:checked + .sw::after { transform: translateX(18px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-4); color: rgba(245, 242, 235, .72); padding-top: clamp(72px, 10vw, 128px); }
.footer-cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: clamp(56px, 8vw, 96px); border-bottom: 1px solid rgba(245, 242, 235, .12); }
.footer-cta .title { color: var(--paper); max-width: 12ch; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-block: 56px; }
.footer-grid h4 { margin: 0 0 16px; font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(245, 242, 235, .45); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { text-decoration: none; color: rgba(245, 242, 235, .86); transition: color .3s var(--ease); }
.footer-grid a:hover { color: #fff; }
.footer-brand .logo { color: var(--paper); height: 38px; margin-bottom: 20px; }
.footer-brand p { max-width: 30ch; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 28px 40px; border-top: 1px solid rgba(245, 242, 235, .12); font-size: .8125rem; color: rgba(245, 242, 235, .5); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-top: calc(var(--header) + clamp(48px, 8vw, 112px)); padding-bottom: clamp(40px, 6vw, 80px); }
.crumbs { display: flex; gap: 10px; align-items: center; font: 500 .875rem/1 var(--sans); color: var(--ink-3); margin-bottom: 28px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }

/* ---------- Night: the page eases into green for its quiet moments ---------- */
body { transition: background-color 1.4s var(--ease); }
.site-header .logo, .site-header .nav a, .menu-toggle { transition: color 1.2s var(--ease); }
.is-night body { background: var(--green-4); }
.is-night .site-header.is-scrolled { background: rgba(2, 44, 34, .86); box-shadow: 0 1px 0 rgba(245, 242, 235, .08); }
.is-night .site-header .logo { color: var(--paper); }
.is-night .site-header .nav a:not(.btn), .is-night .menu-toggle { color: rgba(245, 242, 235, .8); border-color: rgba(245, 242, 235, .3); }
.is-night .site-header .nav a[aria-current="page"] { color: var(--paper); }
.is-night .site-header .nav a::after { background: var(--mint); }
.is-night .site-header .btn-primary { background: var(--paper); color: var(--green-3); }
.night-dim { transition: opacity 1.2s var(--ease); }
.is-night .night-dim { opacity: .12; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 140%);
  display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-radius: var(--r-md);
  background: var(--ink); color: var(--paper); font: 500 .9375rem/1.4 var(--sans); box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
  transition: transform .6s var(--ease); max-width: calc(100vw - 32px);
}
.toast.is-on { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}
