/* =========================================================
   Ghadan Naltaki — Vintage Sitewide CSS (v24)
   Purpose: archival/poetic vibe, warm parchment, brass accents
   Notes:
   - Matches existing classes across the site (no HTML changes).
   - Remove per-page <style> tags to avoid overrides.
   ========================================================= */

/* 1) Baseline + Tokens */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
:root{
  /* Palette */
  --bg:        #f7f1e3;  /* parchment */
  --surface:   #fbf7ef;  /* lighter parchment */
  --ink:       #2e2925;  /* body text */
  --ink-2:     #5c5148;  /* secondary */
  --muted:     #6f635b;  /* meta */
  --border:    #e5dccd;  /* deckle edge */
  --brass:     #b5832f;  /* accent brass */
  --brass-deep:#a47126;  /* deeper brass */
  --teal-dull: #5e7d8a;  /* optional secondary */

  /* Layout + Effects */
  --radius: 14px;
  --maxw:   980px;
  --shadow-soft: 0 1px 0 rgba(255,255,255,.85) inset, 0 10px 22px rgba(90,75,56,.12);
  --focus:  2px dashed var(--brass);
  --focus-offset: 2px;

  /* Typography */
  --font-serif: "Amiri", "Noto Naskh Arabic", serif;
  --font-sans:  "Noto Naskh Arabic", "Amiri", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
body {
  margin: 0;
  direction: rtl;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(181,132,58,.08), transparent 60%),
    linear-gradient(180deg, #fcf9f3 0%, #f7f1e3 100%);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.9;
  font-size: clamp(17px, 1.4vw, 19px);
}

/* 2) Containers */
.container { width: min(92vw, var(--maxw)); margin-inline: auto; }

/* 3) Header + Nav */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.nav-wrap { display: flex; justify-content: space-between; align-items: center; }
.brand{
  display: flex; align-items: center; gap: .6rem;
  padding-block: .9rem; text-decoration: none; color: var(--ink);
  font-weight: 800; letter-spacing: .2px;
}
.brand .logo{
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; color:#fff; font-weight:800; font-size:18px;
  background: linear-gradient(180deg, #c89a46 0%, #a57325 70%);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 16px rgba(98,75,28,.18);
}

nav.primary{ display: flex; align-items: center; gap: .8rem; }
nav.primary a{
  text-decoration: none; color: var(--ink); opacity: .92;
  padding: .6rem .8rem; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-sans);
}
nav.primary a:is(:hover,:focus-visible){
  opacity: 1; background: var(--surface); border-color: var(--border);
}
nav.primary a[aria-current="page"],
nav.primary a[href="index.html"]{ /* active indication */
  background: #f3ebdc; border-color: #e8dfcf; box-shadow: 0 1px 0 #fff inset;
}

.nav-toggle{
  display: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); border-radius: 10px; padding: .5rem .7rem; font-family: var(--font-sans);
}
@media (max-width: 820px){
  nav.primary{
    position: fixed; inset: 62px 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: .6rem .9rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
    transform: translateY(-140%); transition: transform .25s ease;
  }
  body.nav-open nav.primary{ transform: translateY(0); }
  .nav-toggle{ display: inline-flex; align-items: center; gap: .5rem; }
}

/* 4) Hero */
.hero { padding: 44px 0 22px; }
.hero--image{
  position: relative; min-height: 62vh;
  border-radius: 18px; overflow: hidden; background: #2b241b;
  box-shadow: 0 12px 26px rgba(50,38,22,.12);
}
.hero--image::before{
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(115,84,35,.18), rgba(40,30,18,.45));
}
.hero--image img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  filter: sepia(.22) saturate(.95) contrast(1.04) brightness(.98);
  mix-blend-mode: multiply; transform: scale(1.02);
}
.hero__content{ position:absolute; inset-inline:0; bottom:0; padding:2rem; color:#fff; text-shadow:0 1px 0 rgba(0,0,0,.35); }
.hero__title{
  margin:0 0 .5rem; font-size:clamp(26px,5vw,46px);
  font-weight: 800; font-family: var(--font-serif);
  text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 18px 28px rgba(48,36,20,.18);
}
.hero__kicker{ opacity:.95; margin:0 0 1rem; color:#f1e6d2; }
.hero__cta{ display:flex; gap:.75rem; flex-wrap:wrap; }

/* 5) Cards & Layout */
.main-grid{ display:grid; gap:18px; grid-template-columns: 1fr; margin-block: 1rem; }
@media (min-width:960px){ .main-grid{ grid-template-columns: 2.4fr 1fr; } }

.card{
  background: var(--surface);
  border: 1px solid #e7decf; border-radius: var(--radius);
  padding: clamp(12px, 2vw, 20px);
  box-shadow: var(--shadow-soft);
}

/* 6) Typography (Prose) */
h1,h2,h3{ line-height:1.25; margin:0 0 .8rem; }
.prose h1,.prose h2,.prose h3{ font-family: var(--font-serif); }
.prose h1{ font-size:1.6rem; }
.prose h2{ font-size:1.35rem; }
.prose h3{ font-size:1.15rem; }
.prose h2::after{
  content:""; display:block; margin:.6rem auto 0; height:10px; width:120px;
  background: radial-gradient(closest-side, var(--brass) 98%, transparent) left/10px 10px repeat-x;
  opacity:.55;
}
.prose p{ margin: 0 0 1rem; }
.prose a{ color:#6d5a1e; text-decoration-thickness:.06em; text-underline-offset:.2em; }
.prose a:is(:hover,:focus-visible){ color: var(--brass); }
.prose img, .legacy-content img{ max-width:100%; height:auto; border-radius:10px; }
.prose blockquote{
  border: 1px dashed #d8cbb7; padding: 1rem 1rem 1rem 1.25rem; margin: .8rem 0;
  color: var(--ink); background: #fff5e8; border-radius: 10px; position: relative;
}
.prose blockquote::before{
  content:"❝"; position:absolute; font-size:2rem; line-height:1;
  color:#d0b07a; top:-.6rem; inset-inline-start:.6rem; opacity:.9;
}
.prose blockquote::after{
  content:"❞"; position:absolute; font-size:1.6rem; line-height:1;
  color:#d0b07a; bottom:-.7rem; inset-inline-end:.6rem; opacity:.55;
}
.meta{ color: var(--muted); font-size: .95rem; }

/* 7) Poem layout (shared across poem pages) */
.poem{
  white-space: pre-wrap;
  font-family: var(--font-serif);
  font-size: 1.12em;
  line-height: 2.1;
  text-align: center;
  letter-spacing: 0; /* do not track Arabic */
  margin-block: .5rem 1.25rem;
}

/* 8) Buttons */
.btn{
  display: inline-flex; align-items: center; gap:.5rem;
  padding: .65rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--brass-deep);
  color: #fff; text-decoration: none; font-weight: 700;
  background: linear-gradient(180deg, #cfa256 0%, #af7e2c 80%);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 10px 20px rgba(114,83,18,.22);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.btn--primary{
  background: linear-gradient(180deg, #b9893b 0%, #8c631f 80%);
  border-color: #8c631f;
}
.btn:is(:hover,:focus-visible){ filter: saturate(1.05) brightness(1.04); }
.btn:active{ transform: translateY(1px); }

/* 9) Gallery (photos page) */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.gallery a, .gallery img{ display: block; width: 100%; }
.gallery a{
  background:#fff; border:1px solid #e8e0d6; padding:8px 8px 18px; border-radius:8px;
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gallery img{ border-radius:4px; filter: sepia(.08) contrast(1.02); }
.gallery a:nth-child(odd){ transform: rotate(-.6deg); }
.gallery a:nth-child(even){ transform: rotate(.45deg); }
.gallery a:is(:hover,:focus-visible){
  transform: scale(1.02) rotate(0deg);
  box-shadow: 0 16px 26px rgba(0,0,0,.12);
}

/* 10) Legacy content safety net (old HTML tables, etc.) */
.legacy-content { container-type: inline-size; }
.legacy-content table{
  width: 100% !important; border-collapse: collapse; overflow: auto; display: block;
}
.legacy-content td, .legacy-content th{ border:1px solid var(--border); padding:.5rem; }
.legacy-content center{ text-align:center; }
.legacy-content font{ color: inherit !important; font-family: inherit !important; }

/* 11) Utilities */
.muted{ color: var(--muted); }
.hr{
  height:2px; background: linear-gradient(90deg, transparent, #d9cdb9 35%, #d9cdb9 65%, transparent);
  margin:14px 0; position:relative;
}
.hr::after{
  content:"❖"; position:absolute; inset-inline:0; top:-.7rem; margin-inline:auto;
  font-size:.95rem; color:#c19a5e; background: var(--surface); padding:0 .55rem;
}

/* 12) Footer */
footer.site-footer{
  margin-top: 40px; padding: 28px 0 44px;
  border-top: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-sans);
}

/* 13) Focus states (accessibility) */
:focus-visible{
  outline: var(--focus);
  outline-offset: var(--focus-offset);
}

/* 14) Print (poems and sources look clean on paper) */
@media print{
  .site-header, .nav-toggle, .hero, .hero--image, nav.primary{ display:none !important; }
  body{ background:#fff; color:#000; font-family: var(--font-serif); }
  .card{ box-shadow:none; border: none; }
  .prose a{ color:#000; text-decoration: underline; }
}


/* --- Poem page shell (Option A) --- */
.poem-page{padding:clamp(16px,2vw,24px)}
.poem-header{max-width:720px;margin:0 auto 1rem auto;text-align:center}
.poem-title{margin:0 0 .25rem;font-size:clamp(22px,3vw,28px);font-weight:800}
.poem-meta{margin:.25rem 0 1rem;color:var(--muted);font-size:.95em}

/* You already have .poem; keep it. Add these refinements: */
pre.poem{
  max-width:720px;margin:0 auto;
  background:#fff8ed;border:1px solid #eadfcf;border-radius:12px;
  padding:clamp(12px,2vw,18px) clamp(14px,2.2vw,22px);
  box-shadow:var(--shadow-soft);
  /* from your base: rtl, centered, generous line-height */
  white-space:pre-wrap; text-align:center; line-height:2.1;
  font-family:var(--font-serif); font-size:1.12em; letter-spacing:0;
}

/* stanza marker (if you keep a line with • • • ) */
.poem-sep{display:block;opacity:.6;letter-spacing:.4em}

/* Footnotes */
.footnotes{max-width:720px;margin:1.2rem auto 0;padding:0 6px;color:var(--ink-2)}
.footnotes h4{margin:.25rem 0 .5rem;font-size:1rem;color:var(--muted);text-align:center}
.footnotes ol{margin:0;padding:0;list-style:none}
.footnotes li{margin:.35rem 0;padding:.35rem .5rem;border:1px dashed #d8cbb7;border-radius:8px;background:#fff5e8}
.footnotes a{color:var(--brass)}

