:root {
  --ink: #102c3f;
  --ink-soft: #4c626b;
  --paper: #fbf7ef;
  --paper-deep: #f1e8d8;
  --white: #ffffff;
  --line: rgba(16, 44, 63, 0.14);
  --terracotta: #d7684f;
  --terracotta-dark: #a94936;
  --gold: #e9b957;
  --olive: #66745a;
  --shadow: 0 18px 45px rgba(16, 44, 63, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: 100px; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.topline {
  padding: 0.6rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  text-align: center;
}

.topline strong { color: var(--gold); }

.container { width: min(1140px, calc(100% - 2.5rem)); margin: 0 auto; }

.legal-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 247, 239, 0.94);
  backdrop-filter: blur(18px);
}

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink); text-decoration: none; }

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50% 50% 45% 45%;
  background: var(--terracotta);
  color: var(--white);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  transform: rotate(-6deg);
}

.brand-logo { display: block; width: 72px; height: 72px; flex: 0 0 auto; object-fit: contain; }

.brand-copy { display: grid; gap: 0.02rem; line-height: 1.05; }
.brand-name { font-size: 0.93rem; font-weight: 900; letter-spacing: 0.11em; }
.brand-note { color: var(--ink-soft); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }

.home-link {
  color: var(--terracotta-dark);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.home-link:hover { color: var(--ink); }

.legal-hero { padding: clamp(3.8rem, 8vw, 6.5rem) 0 3.6rem; background: var(--paper-deep); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.15rem;
  color: var(--terracotta-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before { width: 24px; height: 3px; border-radius: 999px; background: var(--terracotta); content: ""; }

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; }

h1 { max-width: 780px; margin: 0 0 1rem; font-size: clamp(3rem, 7vw, 5.9rem); }

.hero-lead { max-width: 760px; margin: 0; color: var(--ink-soft); font-size: clamp(1.05rem, 1.8vw, 1.22rem); }

.last-updated { margin: 1.25rem 0 0; color: #6f7d82; font-size: 0.82rem; font-weight: 750; }

.notice {
  margin-top: 1.7rem;
  padding: 1.1rem 1.2rem;
  border-left: 4px solid var(--terracotta);
  border-radius: 0 12px 12px 0;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.notice strong { color: var(--ink); }

.legal-body { padding: clamp(3.7rem, 8vw, 6rem) 0; }

.legal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(2.3rem, 6vw, 6.5rem); align-items: start; }

.toc { position: sticky; top: 1.4rem; padding: 1.05rem; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }

.toc strong { display: block; margin-bottom: 0.65rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }

.toc a { display: block; padding: 0.38rem 0; color: var(--ink-soft); font-size: 0.83rem; font-weight: 750; text-decoration: none; }
.toc a:hover { color: var(--terracotta-dark); }

.legal-content { min-width: 0; }

.legal-content h2 { margin: 2.7rem 0 0.75rem; font-size: clamp(1.75rem, 3.4vw, 2.65rem); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { margin: 1.7rem 0 0.45rem; font-size: 1.55rem; }
.legal-content p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 1rem; }
.legal-content strong { color: var(--ink); }
.legal-content a { color: var(--terracotta-dark); font-weight: 800; }

.legal-content ul, .legal-content ol { margin: 0 0 1.1rem; padding-left: 1.35rem; color: var(--ink-soft); }
.legal-content li { margin: 0.45rem 0; padding-left: 0.15rem; }

.policy-card { margin: 1.15rem 0 1.5rem; padding: 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.policy-card h3 { margin-top: 0; }
.policy-card p:last-child, .policy-card ul:last-child { margin-bottom: 0; }

.policy-card.important { border-color: rgba(215, 104, 79, 0.4); background: #fff4ed; }
.policy-card.green { border-color: rgba(102, 116, 90, 0.32); background: #f3f4ea; }

.definition-list { display: grid; grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr); margin: 1rem 0 1.4rem; border-top: 1px solid var(--line); }
.definition-list dt, .definition-list dd { margin: 0; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--ink); font-size: 0.88rem; font-weight: 900; }
.definition-list dd { color: var(--ink-soft); font-size: 0.92rem; }

.source-box { margin-top: 2.2rem; padding: 1.15rem 1.2rem; border-radius: 15px; background: var(--ink); color: var(--paper); }
.source-box h3 { margin: 0 0 0.45rem; color: var(--white); }
.source-box p { color: rgba(251, 247, 239, 0.72); }
.source-box a { color: var(--gold); }

.legal-footer { padding: 2.5rem 0; background: var(--ink); color: rgba(251, 247, 239, 0.68); }
.legal-footer-grid { display: flex; align-items: start; justify-content: space-between; gap: 2rem; }
.legal-footer .brand { color: var(--white); }
.legal-footer p { max-width: 550px; margin: 0.7rem 0 0; font-size: 0.82rem; }
.footer-back { color: var(--gold); font-size: 0.82rem; font-weight: 850; text-decoration: none; }
.legal-footer-links { display: flex; flex-wrap: wrap; gap: 0.55rem 0.75rem; margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid rgba(251, 247, 239, 0.14); }
.legal-footer-links a { color: var(--gold); font-size: 0.8rem; font-weight: 850; text-decoration: none; }
.legal-footer-links a:hover { color: var(--white); }
.legal-footer-separator { color: rgba(251, 247, 239, 0.32); font-size: 0.75rem; }

.contact-layout, .donation-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.72fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: start; }
.contact-card, .donation-card { padding: clamp(1.35rem, 3vw, 2.2rem); border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.contact-card h2, .donation-card h2 { margin: 0 0 0.8rem; font-size: clamp(2rem, 4vw, 3.2rem); }
.contact-card > p, .donation-card > p { color: var(--ink-soft); }
.contact-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.5rem; }
.contact-form-grid .field.full { grid-column: 1 / -1; }
.contact-form-grid label, .custom-amount-field label { display: block; margin-bottom: 0.4rem; color: var(--ink); font-size: 0.85rem; font-weight: 850; }
.contact-form-grid input, .contact-form-grid textarea, .custom-amount-field input { width: 100%; padding: 0.82rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; color: var(--ink); font: inherit; }
.contact-form-grid textarea { min-height: 175px; resize: vertical; }
.contact-form-grid input:focus-visible, .contact-form-grid textarea:focus-visible, .custom-amount-field input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.contact-form-grid small, .custom-amount-field small { display: block; margin-top: 0.35rem; color: #6f7d82; font-size: 0.76rem; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }
.contact-submit { border: 0; border-radius: 999px; padding: 0.88rem 1.2rem; background: var(--ink); color: var(--white); font-weight: 900; cursor: pointer; transition: background 180ms ease, transform 180ms ease; }
.contact-submit:hover { background: var(--terracotta-dark); transform: translateY(-2px); }
.contact-email-link { display: inline-flex; align-items: center; justify-content: center; padding: 0.82rem 1.05rem; border: 1px solid var(--line); border-radius: 999px; color: var(--terracotta-dark); font-size: 0.88rem; font-weight: 850; text-decoration: none; }
.contact-email-link:hover { border-color: var(--terracotta); background: var(--paper-deep); }
.contact-status { margin: 0.9rem 0 0; color: var(--olive); font-size: 0.84rem; font-weight: 800; }
.contact-aside { display: grid; gap: 1rem; }
.contact-aside .policy-card { margin: 0; }
.contact-details { display: grid; gap: 0.9rem; margin: 1.1rem 0 0; }
.contact-detail { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.contact-detail strong { display: block; margin-bottom: 0.15rem; color: var(--ink); }
.contact-detail a { color: var(--terracotta-dark); font-weight: 850; }
.flash-donate { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: 100%; padding: 0.95rem 1.1rem; border-radius: 999px; background: #c54138; color: var(--white); font-size: 0.95rem; font-weight: 900; text-decoration: none; box-shadow: 0 10px 25px rgba(197, 65, 56, 0.28); animation: donation-pulse 1.8s ease-in-out infinite; }
.flash-donate:hover { background: #a9322b; }
@keyframes donation-pulse { 0%, 100% { box-shadow: 0 10px 25px rgba(197, 65, 56, 0.22); transform: translateY(0); } 50% { box-shadow: 0 10px 32px rgba(197, 65, 56, 0.52); transform: translateY(-2px); } }

.amount-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin: 1.4rem 0 1rem; }
.amount-button { min-height: 92px; padding: 0.9rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease; }
.amount-button:hover { border-color: var(--terracotta); transform: translateY(-2px); }
.amount-button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.amount-button strong { display: block; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; line-height: 1; }
.amount-button span { display: block; margin-top: 0.45rem; color: var(--ink-soft); font-size: 0.77rem; line-height: 1.3; }
.amount-button[aria-pressed="true"] span { color: rgba(251, 247, 239, 0.72); }
.custom-amount-field { margin-top: 0.8rem; }
.paypal-form { margin-top: 1.35rem; }
.paypal-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: 100%; padding: 0.95rem 1.1rem; border: 0; border-radius: 999px; background: #0070ba; color: var(--white); font-size: 0.98rem; font-weight: 900; cursor: pointer; transition: background 180ms ease, transform 180ms ease; }
.paypal-button:hover { background: #005ea6; transform: translateY(-2px); }
.paypal-direct { display: block; margin-top: 0.9rem; color: var(--terracotta-dark); font-size: 0.84rem; font-weight: 850; text-align: center; }
.selected-gift { margin: 1rem 0 0; padding: 0.85rem 0.95rem; border-radius: 12px; background: var(--paper-deep); color: var(--ink-soft); font-size: 0.88rem; }
.selected-gift strong { color: var(--ink); }
.payment-note { margin-top: 1rem; color: #6f7d82; font-size: 0.78rem; }
.donation-aside { display: grid; gap: 1rem; }
.donation-aside .policy-card { margin: 0; }
.donation-aside h2 { margin-top: 0; font-size: 2rem; }
.donation-aside ul, .donation-aside ol { margin-bottom: 0; }

.news-layout, .prayer-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.72fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: start; }
.live-panel { padding: clamp(1.35rem, 3vw, 2.2rem); border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.live-panel h2 { margin: 0 0 0.8rem; font-size: clamp(2rem, 4vw, 3.2rem); }
.live-panel > p { color: var(--ink-soft); }
.live-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.live-status { margin: 0; color: #6f7d82; font-size: 0.8rem; }
.live-refresh { border: 1px solid var(--line); border-radius: 999px; padding: 0.62rem 0.85rem; background: var(--paper); color: var(--ink); font-size: 0.8rem; font-weight: 850; cursor: pointer; }
.live-refresh:hover { border-color: var(--terracotta); background: var(--paper-deep); }
.news-list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.news-item { padding: 1.05rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.news-item h3 { margin: 0.35rem 0 0.35rem; font-size: 1.35rem; }
.news-item h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover { color: var(--terracotta-dark); }
.news-item-meta { margin: 0; color: #6f7d82; font-size: 0.76rem; font-weight: 800; }
.news-item-summary { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.news-aside { display: grid; gap: 1rem; }
.news-aside .policy-card { margin: 0; }
.news-aside .source-link { margin-top: 0.65rem; }
.news-empty { margin: 1rem 0 0; padding: 1rem; border-radius: 12px; background: var(--paper-deep); color: var(--ink-soft); font-size: 0.9rem; }

.prayer-controls { padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.prayer-controls-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: end; }
.prayer-controls label { display: block; margin-bottom: 0.35rem; color: var(--ink); font-size: 0.8rem; font-weight: 850; }
.prayer-controls input { width: 100%; padding: 0.7rem 0.75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.prayer-controls input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.prayer-update { min-height: 42px; border: 0; border-radius: 9px; padding: 0.7rem 0.9rem; background: var(--ink); color: var(--white); font-size: 0.82rem; font-weight: 900; cursor: pointer; }
.prayer-update:hover { background: var(--terracotta-dark); }
.prayer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin-top: 1.1rem; }
.prayer-card { padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.prayer-card.is-next { border-color: var(--gold); background: #fff7dc; }
.prayer-card p { margin: 0; }
.prayer-name { color: var(--ink-soft); font-size: 0.82rem; font-weight: 850; }
.prayer-time { margin-top: 0.35rem !important; color: var(--ink); font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.prayer-next { margin-top: 1rem; padding: 0.95rem 1rem; border-radius: 12px; background: var(--ink); color: var(--paper); }
.prayer-next strong { color: var(--gold); }
.prayer-note { margin-top: 1rem; color: #6f7d82; font-size: 0.78rem; }
.prayer-aside { display: grid; gap: 1rem; }
.prayer-aside .policy-card { margin: 0; }
.auto-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.55rem; border-radius: 999px; background: var(--olive); color: var(--white); font-size: 0.7rem; font-weight: 900; }
.auto-badge::before { width: 7px; height: 7px; border-radius: 50%; background: #c8df77; content: ""; }

.zakat-intro { max-width: 850px; }
.zakat-intro h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.zakat-quote { margin: 1.4rem 0 1.8rem; padding: 1.25rem 1.35rem; border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--white); color: var(--ink); font-family: Georgia, serif; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.35; }
.zakat-quote cite { display: block; margin-top: 0.6rem; color: var(--ink-soft); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 0.78rem; font-style: normal; font-weight: 800; }
.zakat-highlight { margin: 1.25rem 0 1.6rem; padding: 1.2rem; border: 1px solid rgba(102, 116, 90, 0.32); border-radius: 15px; background: #f3f4ea; }
.zakat-highlight h3 { margin-top: 0; }
.zakat-highlight p:last-child { margin-bottom: 0; }
.zakat-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin: 1.1rem 0 1.5rem; }
.zakat-check { margin: 0; padding: 0.9rem; border-top: 3px solid var(--terracotta); background: var(--white); color: var(--ink-soft); font-size: 0.88rem; }
.zakat-check strong { display: block; margin-bottom: 0.2rem; color: var(--ink); }

.historic-content { min-width: 0; }
.historic-content h2 { margin: 2.7rem 0 0.85rem; font-size: clamp(1.75rem, 3.4vw, 2.65rem); }
.historic-content h2:first-child { margin-top: 0; }
.historic-content h3 { margin: 1.7rem 0 0.45rem; font-size: 1.55rem; }
.historic-content p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 1rem; }
.historic-content strong { color: var(--ink); }
.historic-content a { color: var(--terracotta-dark); font-weight: 800; }
.historic-content .timeline-link { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.75rem 1rem; border-radius: 999px; background: var(--ink); color: var(--white); text-decoration: none; }
.historic-content .timeline-link:hover { background: var(--terracotta-dark); }
.historic-intro { margin-bottom: 2rem; padding: 1.15rem 1.2rem; border-left: 4px solid var(--gold); border-radius: 0 15px 15px 0; background: var(--white); }
.historic-intro p:last-child { margin-bottom: 0; }
.historic-video { position: relative; overflow: hidden; aspect-ratio: 16 / 9; margin: 1.4rem 0 2rem; border-radius: 18px; background: var(--ink); box-shadow: var(--shadow); }
.historic-video iframe { width: 100%; height: 100%; border: 0; }
.historic-figure { margin: 1.7rem 0 2.3rem; }
.historic-figure a { display: block; }
.historic-figure img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: 16px; background: var(--paper-deep); box-shadow: var(--shadow-small); }
.historic-figure figcaption { margin-top: 0.8rem; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.55; }
.historic-figure figcaption strong { display: block; margin-bottom: 0.15rem; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; line-height: 1.15; }
.historic-section { padding-top: 0.35rem; }
.historic-source-note { margin-top: 2rem; padding: 1.15rem 1.2rem; border-radius: 15px; background: var(--ink); color: var(--paper); }
.historic-source-note h3 { margin-top: 0; color: var(--white); }
.historic-source-note p { color: rgba(251, 247, 239, 0.72); }
.historic-source-note a { color: var(--gold); }

@media (max-width: 780px) {
  .contact-layout, .donation-layout, .news-layout, .prayer-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .container { width: min(100% - 1.5rem, 1140px); }
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc a { display: inline-block; margin-right: 0.85rem; }
  .legal-footer-grid { flex-direction: column; }
}

@media (max-width: 540px) {
  .legal-nav { min-height: 68px; }
  .brand-logo { width: 60px; height: 60px; }
  .brand-name { font-size: 0.78rem; }
  .brand-note { font-size: 0.58rem; }
  .home-link { font-size: 0.78rem; }
  .definition-list { grid-template-columns: 1fr; }
  .definition-list dt { padding-bottom: 0.15rem; border-bottom: 0; }
  .definition-list dd { padding-top: 0.15rem; }
  .contact-form-grid { grid-template-columns: 1fr; }
  .contact-form-grid .field.full { grid-column: auto; }
  .amount-grid { gap: 0.55rem; }
  .amount-button { min-height: 84px; padding: 0.75rem; }
  .amount-button strong { font-size: 1.75rem; }
  .prayer-controls-grid, .zakat-checklist { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .flash-donate { animation: none; } }
