/* Qur'an en français — shares the CoranAlarm palette and typography. */

:root {
  --night: #050D0A;
  --deep: #0B4433;
  --emerald: #1AA666;
  --gold: #D9B561;
  --ivory: #F2EEE2;
  --muted: #8AA396;
  --hairline: rgba(217, 181, 97, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--ivory);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
::selection { background: var(--deep); color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

a { color: inherit; }

/* ---------- Nav ---------- */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  position: relative; z-index: 10;
}
.brand { text-decoration: none; }
.brand span { font-family: "Amiri", serif; font-size: 1.25rem; letter-spacing: .02em; }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: color .25s;
}
.nav-links a:hover { color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding-bottom: 90px;
  background:
    radial-gradient(58% 42% at 50% 108%, rgba(217,181,97,.34) 0%, rgba(217,181,97,.10) 45%, transparent 72%),
    radial-gradient(120% 85% at 50% 115%, #14523D 0%, var(--deep) 38%, var(--night) 78%);
}
.hero nav { position: absolute; top: 0; left: 0; right: 0; }
.calligraphy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; user-select: none;
  font-family: "Amiri", serif;
  font-size: clamp(4.2rem, 13vw, 11rem);
  color: rgba(217, 181, 97, 0.07);
  white-space: nowrap;
}
.eyebrow {
  font-size: .74rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
  color: var(--emerald); margin-bottom: 26px;
}
h1 {
  font-family: "Amiri", serif; font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 1.15; max-width: 16ch; margin: 0 auto 26px;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--gold); }
.lede {
  max-width: 54ch; margin: 0 auto 44px; color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem); font-weight: 300;
}
.cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.store-btn, .ghost-btn {
  display: inline-flex; align-items: center; gap: 13px;
  text-decoration: none; padding: 15px 30px; border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
}
.store-btn { background: var(--ivory); color: var(--night); box-shadow: 0 10px 40px rgba(217,181,97,.18); }
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 50px rgba(217,181,97,.30); }
.ghost-btn { border: 1px solid var(--hairline); color: var(--gold); }
.ghost-btn:hover { background: var(--gold); color: var(--night); }

.rise { opacity: 0; transform: translateY(18px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.rise.d1 { animation-delay: .15s; } .rise.d2 { animation-delay: .3s; }
.rise.d3 { animation-delay: .45s; } .rise.d4 { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Layout ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 80px 24px; }
.page-head { margin-bottom: 56px; }
.page-head h1 { margin-left: 0; text-align: left; max-width: none; }
.page-head .lede { margin-left: 0; text-align: left; }
.section-eyebrow {
  font-size: .72rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
  color: var(--emerald); margin-bottom: 14px;
}
h2 {
  font-family: "Amiri", serif; font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.2; margin-bottom: 18px;
}
.section-lede { color: var(--muted); max-width: 58ch; font-weight: 300; }

.ayah-divider {
  display: flex; align-items: center; gap: 18px;
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
}
.ayah-divider::before, .ayah-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.ayah-divider span { font-family: "Amiri", serif; color: var(--gold); font-size: 1.5rem; line-height: 1; }

/* ---------- Surah list ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pill {
  text-decoration: none; border: 1px solid var(--hairline); color: var(--ivory);
  padding: 10px 20px; border-radius: 999px; font-size: .92rem;
  transition: background .25s, border-color .25s;
}
.pill:hover { background: rgba(217,181,97,.1); border-color: var(--gold); }

.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.surah-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--night); padding: 20px 22px; text-decoration: none;
  transition: background .25s;
}
.surah-card:hover { background: #081711; }
.surah-card .n {
  font-family: "Amiri", serif; color: var(--gold); font-size: 1.1rem;
  min-width: 2.2rem; text-align: center;
}
.surah-card .names { flex: 1; display: flex; flex-direction: column; }
.surah-card strong { font-weight: 600; font-size: 1rem; }
.surah-card small { color: var(--muted); font-size: .82rem; font-weight: 300; }
.surah-card .ar { font-family: "Amiri", serif; color: var(--ivory); font-size: 1.3rem; opacity: .85; }

/* ---------- Surah page ---------- */
.surah { max-width: 900px; margin: 0 auto; padding: 40px 24px 90px; }
.surah-head { text-align: center; margin-bottom: 46px; }
.surah-arabic {
  font-family: "Amiri", serif; font-size: clamp(2.6rem, 8vw, 4.4rem);
  margin: 0 auto 18px; max-width: none;
}
.surah-title { font-family: "Amiri", serif; font-size: 1.6rem; color: var(--gold); margin-bottom: 14px; }
.surah-lede { color: var(--muted); font-weight: 300; max-width: 56ch; margin: 0 auto; }

.surah-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 0 0 42px;
}
.action {
  background: none; border: 1px solid var(--hairline); color: var(--gold);
  font: 600 .88rem/1 "Manrope", sans-serif;
  padding: 14px 26px; border-radius: 999px; cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.action:hover { background: rgba(217,181,97,.12); transform: translateY(-1px); }
.action.primary { background: var(--ivory); color: var(--night); border-color: var(--ivory); }
.action.primary:hover { background: var(--gold); border-color: var(--gold); }

.verses { margin-top: 48px; }
.ayah {
  display: flex; gap: 22px; padding: 34px 0;
  border-bottom: 1px solid rgba(217,181,97,.12);
}
.ayah:target { background: rgba(217,181,97,.05); }
.ayah-num a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hairline); color: var(--gold);
  font-family: "Amiri", serif; font-size: .95rem; text-decoration: none;
  flex-shrink: 0; transition: background .25s;
}
.ayah-num a:hover { background: rgba(217,181,97,.12); }
/* Capped so the right-aligned Arabic and the left-aligned French stay in one
   readable column instead of drifting to opposite margins. */
.ayah-body { flex: 1; max-width: 46rem; }
/* Right-aligned, as Arabic is read. */
.arabic {
  font-family: "Amiri", serif; font-size: 2.45rem; line-height: 2.05;
  margin-bottom: 22px; color: var(--ivory); text-align: right;
}
.french { color: var(--muted); font-weight: 300; font-size: 1.02rem; margin-bottom: 16px; }
.play {
  background: none; border: 1px solid var(--hairline); color: var(--gold);
  font: 600 .78rem/1 "Manrope", sans-serif; letter-spacing: .1em;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background .25s, color .25s;
}
.play:hover, .play[aria-pressed="true"] { background: var(--gold); color: var(--night); }

.surah-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 56px; }
.surah-nav a { color: var(--gold); text-decoration: none; font-weight: 500; }
.surah-nav a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 44px 24px 56px; text-align: center; color: var(--muted); font-size: .85rem;
}
footer .bismillah { font-family: "Amiri", serif; color: rgba(217,181,97,.5); font-size: 1.3rem; margin-bottom: 18px; }
footer a { color: var(--gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .links { display: flex; gap: 26px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .wrap { padding: 60px 20px; }
  .arabic { font-size: 1.9rem; line-height: 1.95; }
  .ayah { gap: 14px; }
}

/* ---------- Print / PDF ----------
   The screen design is nearly black; on paper that is unreadable and drains
   ink, so printing re-themes the page to ink-on-white and drops every
   interactive control. */
@media print {
  @page { margin: 18mm 16mm; }

  body { background: #fff; color: #111; }
  nav, footer, .surah-actions, .play, .surah-nav, #player { display: none !important; }

  .surah { max-width: none; padding: 0; }

  .surah-head { margin-bottom: 22px; }
  .surah-arabic { color: #111; font-size: 30pt; }
  .surah-title { color: #7a5c14; font-size: 15pt; }
  .surah-lede, .eyebrow { color: #555; }
  .eyebrow { font-size: 8pt; }

  .ayah-divider::before, .ayah-divider::after { background: #ccc; }
  .ayah-divider span { color: #7a5c14; }

  /* Keep a verse and its translation on the same sheet. */
  .ayah {
    break-inside: avoid; page-break-inside: avoid;
    border-bottom: 1px solid #e3e3e3; padding: 14pt 0;
  }
  .ayah-num a { color: #7a5c14; border-color: #d8c89a; width: 26px; height: 26px; font-size: 9pt; }
  .arabic { color: #111; font-size: 19pt; line-height: 1.95; }
  .french { color: #333; font-size: 10.5pt; }

  a { text-decoration: none; }

  .print-credit {
    display: block; margin-top: 16pt; padding-top: 8pt;
    border-top: 1px solid #ddd; color: #777; font-size: 8.5pt; text-align: center;
  }
}

/* Credit line is for paper only. */
.print-credit { display: none; }
