@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Marcellus&display=swap");

/* ============================================================
   Mecca Madinah Connect — Phase 1 brand layer
   Additive only: loads AFTER each page's original stylesheet.
   Elevates typography + header/footer; never touches layouts,
   interactive components (tabs, filters, planners) keep theirs.
   Zero JavaScript required. Mobile-first. Light + dark ready.
   ============================================================ */

/* ---------- Brand tokens ---------- */
:root {
  color-scheme: light dark;
  --brand-green: #0b3d2e;
  --brand-green-deep: #062e25;
  --brand-green-soft: #e9f3ee;
  --brand-gold: #c9a227;
  --brand-gold-soft: #f4e8c8;
  --brand-alert: #b84c3e;
  --brand-paper: #fbf9f3;
  --brand-ink: #14211c;
  --brand-muted: #56625d;
  --brand-header-bg: #ffffff;
  --brand-header-ink: #14211c;
  --brand-serif: "Marcellus", "Newsreader", Georgia, "Times New Roman", serif;
  --brand-sans: "Manrope", Avenir, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-green: #14503d;
    --brand-green-deep: #062e25;
    --brand-green-soft: #16281f;
    --brand-gold: #d9ad3a;
    --brand-gold-soft: #2c2413;
    --brand-alert: #ec8272;
    --brand-paper: #101713;
    --brand-ink: #eef4f0;
    --brand-muted: #b6c3ba;
    --brand-header-bg: #101713;
    --brand-header-ink: #eef4f0;
  }
}

/* ---------- Base typography (additive: fonts + color harmony) ---------- */
body {
  font-family: var(--brand-sans);
}

/* ---------- Base media ---------- */
/* Intrinsic dimensions: content <img> tags carry width/height attributes
   (added Nov 7, 2026) so the browser reserves the correct aspect ratio
   before the file loads (less layout shift). Those attributes also map to
   presentational height hints, which would pin the height and stretch any
   image whose width is constrained by CSS (aspect-ratio crops, width:100%
   styles) — height:auto here (author origin) beats the hint, so the aspect
   ratio governs instead. Class rules with an explicit height (hero frames,
   logo) still win on specificity. */
img { height: auto; }
h1, h2 {
  font-family: var(--brand-serif);
  font-weight: 400;
  letter-spacing: 0.005em;
}

/* ---------- Shared container (pages each define .wrap differently) ---------- */
.mmc-container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}
.mmc-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.mmc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.mmc-announce {
  background: var(--brand-green-deep);
  color: #f2e9c9;
  font-size: 0.78rem;
  padding: 0.5rem 1rem;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1rem;
}
.mmc-announce-text {
  flex: 1 1 auto;
  text-align: center;
}
.mmc-announce .mmc-langswitch {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.mmc-announce .mmc-langswitch a {
  border: 1px solid var(--brand-gold);
  color: #f2e9c9;
  padding: 0.24rem 0.6rem;
  font-size: 0.74rem;
}
.mmc-announce .mmc-langswitch a[aria-current="true"] {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: #231a04;
}
.mmc-announce .mmc-langswitch a:hover {
  background: rgba(201, 162, 39, 0.25);
  color: #f2e9c9;
}
.mmc-announce strong {
  color: var(--brand-gold);
  font-weight: 800;
}
.mmc-bar {
  background: var(--brand-header-bg);
  border-bottom: 1px solid var(--line, #d5d0c1);
  box-shadow: 0 2px 10px rgba(6, 46, 37, 0.08);
}
.mmc-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.mmc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--brand-header-ink);
  flex: 0 0 auto;
  margin-right: auto;
}
.mmc-brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}
.mmc-brand span {
  font-family: var(--brand-serif);
  font-size: 1.26rem;
  line-height: 1.1;
  white-space: nowrap;
}
.mmc-nav {
  flex: 1 1 100%;
  min-width: 0;
  order: 2;
}
.mmc-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0.15rem 0;
}
.mmc-nav ul::-webkit-scrollbar { display: none; }
.mmc-nav a {
  display: block;
  white-space: nowrap;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-header-ink);
}
.mmc-nav a:hover,
.mmc-nav a:focus-visible {
  background: var(--brand-green-soft);
  color: var(--brand-header-ink);
  outline: none;
}
.mmc-nav a:focus-visible {
  box-shadow: 0 0 0 2px var(--brand-gold);
}
.mmc-nav a[aria-current="page"] {
  background: var(--brand-green-soft);
}
.mmc-nav a[href$="/emergency/"] {
  color: var(--brand-alert);
}
@media (min-width: 900px) {
  .mmc-bar-inner { flex-wrap: wrap; gap: 0.35rem 0.4rem; }
  .mmc-nav { flex: 1 1 0; min-width: 0; order: 0; }
  .mmc-nav ul { flex-wrap: wrap; }
  .mmc-bar-inner .mmc-nav a { padding: 0.5rem 0.37rem; font-size: 0.8rem; }
  .mmc-langswitch { flex: 0 0 auto; order: 0; }
  .mmc-bar-inner .mmc-langswitch a { padding: 0.3rem 0.5rem; font-size: 0.72rem; }
}

/* ---------- Footer ---------- */
.mmc-footer {
  background: #062e25;
  color: #cfded4;
  border-top: 3px solid var(--brand-gold);
  padding: 3rem 0 1.75rem;
  font-size: 0.9rem;
}
.mmc-footer a {
  color: #eef6f0;
  text-decoration: none;
}
.mmc-footer a:hover,
.mmc-footer a:focus-visible {
  color: var(--brand-gold);
  outline: none;
}
.mmc-footer-grid {
  display: grid;
  gap: 2rem 2.5rem;
  grid-template-columns: 1fr;
}
.mmc-footer-brand p {
  margin: 0.9rem 0 0;
  max-width: 34ch;
  color: #b9cbc0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.mmc-brand--footer { color: #ffffff; }
.mmc-footer h3 {
  font-family: var(--brand-serif);
  font-weight: 400;
  font-size: 1rem;
  color: #ffffff;
  margin: 0 0 0.9rem;
  letter-spacing: 0.02em;
}
.mmc-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.mmc-footer ul a {
  font-size: 0.88rem;
  color: #d8e6dd;
}
.mmc-newsletter p {
  margin: 0 0 1rem;
  color: #b9cbc0;
  font-size: 0.86rem;
  line-height: 1.55;
}
.mmc-news-form {
  display: flex;
  gap: 0.5rem;
  max-width: 340px;
}
.mmc-news-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 0.86rem;
}
.mmc-news-form input::placeholder { color: #8fa39a; }
.mmc-news-form button {
  flex: 0 0 auto;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--brand-gold);
  background: var(--brand-gold);
  color: #062e25;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: not-allowed;
  opacity: 0.55;
}
.mmc-news-form input:disabled { opacity: 0.55; cursor: not-allowed; }
.mmc-footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #a9bcb1;
}
.mmc-footer-bottom p { margin: 0; }
@media (min-width: 700px) {
  .mmc-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1020px) {
  .mmc-footer-grid { grid-template-columns: 1.25fr 1fr 1fr 0.9fr 1.25fr; }
}

/* ---------- Floating contact button ---------- */
.mmc-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1f9d66;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  z-index: 1000;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mmc-fab:hover,
.mmc-fab:focus-visible {
  transform: translateY(-2px);
  background: #27b576;
  outline: none;
}
.mmc-fab:focus-visible { box-shadow: 0 0 0 3px var(--brand-gold); }
.mmc-fab svg {
  width: 28px;
  height: 28px;
}
@media (prefers-reduced-motion: reduce) {
  .mmc-fab { transition: none; }
  .mmc-fab:hover { transform: none; }
}

/* ---------- Language switcher ---------- */
.mmc-langswitch {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.mmc-langswitch a {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--brand-gold);
  color: var(--brand-green-deep);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.mmc-langswitch a[aria-current="true"] {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
}
.mmc-langswitch a:hover { background: var(--brand-green-soft); }
.mmc-langswitch a[aria-current="true"]:hover { background: var(--brand-green); }
@media (prefers-color-scheme: dark) {
  .mmc-langswitch a { color: var(--brand-gold); }
  .mmc-langswitch a[aria-current="true"] { color: #ffffff; }
}

/* ---------- Prayer-times widget (Aladhan API, method 4 Umm al-Qura) ---------- */
.mmc-prayer {
  background: var(--brand-header-bg);
  border: 1px solid var(--brand-gold-soft);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(11, 61, 46, 0.08);
}
.mmc-prayer-head {
  background: var(--brand-green-deep);
  color: #f4f0e4;
  padding: 1.1rem 1.4rem;
  border-bottom: 3px solid var(--brand-gold);
}
.mmc-prayer-head h2 {
  font-family: var(--brand-serif);
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
  color: #ffffff;
}
.mmc-prayer-city { display: flex; gap: 0.5rem; }
.mmc-prayer-city button {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #f4f0e4;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: var(--brand-sans);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.mmc-prayer-city button[aria-pressed="true"] {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: #062e25;
}
.mmc-prayer-body { padding: 1.2rem 1.4rem 1rem; }
.mmc-prayer-date { font-size: 0.85rem; color: var(--brand-muted); margin: 0 0 0.9rem; }
.mmc-prayer-times {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem;
}
@media (max-width: 34rem) { .mmc-prayer-times { grid-template-columns: repeat(2, 1fr); } }
.mmc-prayer-times li {
  background: var(--brand-paper);
  border: 1px solid var(--brand-gold-soft);
  border-radius: 10px;
  padding: 0.6rem 0.4rem;
  text-align: center;
}
.mmc-prayer-times .p-name {
  display: block; font-size: 0.8rem; font-weight: 700; color: var(--brand-muted);
}
.mmc-prayer-times .p-time {
  display: block; font-size: 1.2rem; font-weight: 800; color: var(--brand-green);
  margin-top: 0.15rem; font-variant-numeric: tabular-nums;
}
.mmc-prayer-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  margin: 0 0 0.2rem; padding: 0; list-style: none;
}
.mmc-prayer-strip li { font-size: 0.92rem; white-space: nowrap; }
.mmc-prayer-strip .p-name { font-weight: 700; color: var(--brand-muted); margin-inline-end: 0.35rem; }
.mmc-prayer-strip .p-time { font-weight: 800; color: var(--brand-green); font-variant-numeric: tabular-nums; }
.mmc-prayer-src, .mmc-prayer-note { font-size: 0.78rem; color: var(--brand-muted); margin: 0; line-height: 1.55; }
.mmc-prayer-src strong { color: var(--brand-ink); }
.mmc-prayer-note { margin-top: 0.35rem; }
.mmc-prayer-foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: baseline;
  justify-content: space-between; font-size: 0.8rem; color: var(--brand-muted);
  margin: 0; padding: 0 1.4rem 1.1rem;
}
.mmc-prayer-link { font-weight: 800; color: var(--brand-green); text-decoration: none; white-space: nowrap; }
.mmc-prayer-link:hover { text-decoration: underline; }
.mmc-prayer-state { text-align: center; padding: 1.4rem 1rem; color: var(--brand-muted); }
.mmc-prayer-error {
  background: #fdf0ee; border: 1px solid #eec5bf; color: #8f2f22;
  border-radius: 10px; padding: 1rem 1.2rem; font-size: 0.92rem; line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  .mmc-prayer-error { background: #2a1512; border-color: #5a2c24; color: #f0b3a6; }
}

.mmc-cta-btn {
  display: inline-flex; align-items: center; white-space: nowrap;
  background: linear-gradient(180deg, #d9b545, #c9a227); color: #231a04;
  font-weight: 800; font-size: 0.8rem; text-decoration: none;
  padding: 0.52rem 1rem; border-radius: 999px;
  box-shadow: 0 3px 12px rgba(201,162,39,.35);
  flex: 0 0 auto; transition: transform .15s ease;
}
.mmc-cta-btn:hover { transform: translateY(-1px); color: #231a04; }
.mmc-cta-btn .short { display: none; }
@media (max-width: 520px) {
  .mmc-brand span { font-size: 1.02rem; }
  .mmc-brand img { width: 32px; height: 32px; }
  .mmc-cta-btn .full { display: none; }
  .mmc-cta-btn .short { display: inline; }
  .mmc-cta-btn { font-size: 0.76rem; padding: 0.45rem 0.8rem; }
}
@media (min-width: 900px) {
  .mmc-cta-btn { order: 1; }
  .mmc-bar-inner .mmc-langswitch { order: 2; }
}

/* Announce bar: tagline truly centered, language pills pinned to the end */
@media (min-width: 641px) {
  .mmc-announce { position: relative; }
  .mmc-announce .mmc-langswitch {
    position: absolute;
    inset-inline-end: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Skip link (added 2026-10-30) */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: #0b3d2e;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
}
.skip-link:focus,
.skip-link:active {
  top: 0;
}
