/* ============================================================
   AL-SAAT WELFARE FOUNDATION -- PUBLIC SITE STYLES
   Palette carried over from the approved Phase 3 design:
   slate indigo, stone, madder red. No JS frameworks, no build step.
   ============================================================ */

:root {
  --slate:      #3d4f7c;   /* slate indigo -- the mountains */
  --slate-dark: #2b3a5e;
  --stone:      #f3f1ec;   /* the landscape */
  --stone-dark: #e4e0d5;
  --ink:        #22262e;
  --ink-soft:   #5b6270;
  --madder:     #a13d3a;   /* Balochi embroidery */
  --line:       #e2ded2;
  --success:    #2e6b4f;
  --success-bg: #e8f3ee;
  --error-bg:   #fbeae8;
  --error:      #a13d3a;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  max-width: 100vw;
  overflow-x: hidden;
}

.lang-ur body, .lang-ur { font-family: "Noto Nastaliq Urdu", "Newsreader", serif; }
html[dir="rtl"] body { font-family: "Noto Nastaliq Urdu", serif; line-height: 2.2; }

h1, h2, h3 { font-family: "Archivo", -apple-system, sans-serif; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: "Noto Nastaliq Urdu", serif; font-weight: 600; letter-spacing: 0; }

a { color: var(--slate); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; gap: 20px; flex-wrap: wrap; }
.site-brand { text-decoration: none; display: flex; flex-direction: column; }
.site-brand-en { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.site-brand-ur { font-family: "Noto Nastaliq Urdu", serif; font-size: 1rem; color: var(--ink-soft); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { text-decoration: none; color: var(--ink); font-family: "Archivo", sans-serif; font-size: .92rem; font-weight: 600; }
.site-nav a:hover { color: var(--slate); }
.lang-switch { border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px !important; }

/* ---- Hero ---- */
.hero { padding: 56px 24px 32px; text-align: center; }
.hero h1 { font-size: 2.1rem; margin: 0 0 10px; }
.hero-tagline { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }

/* ---- Post feed / grid ---- */
.post-feed { padding: 20px 24px 64px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.post-card { text-decoration: none; color: inherit; display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--stone); transition: transform .15s ease, box-shadow .15s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.post-card img { width: 100%; height: 190px; object-fit: cover; }
.post-card-noimg { width: 100%; height: 190px; background: var(--stone-dark); }
.post-card-body { padding: 14px 16px 18px; }
.post-card-body time { font-family: "IBM Plex Mono", monospace; font-size: .78rem; color: var(--madder); letter-spacing: .02em; }
.post-card-body h2 { font-size: 1.1rem; margin: 6px 0 0; line-height: 1.35; }

.empty-note { text-align: center; color: var(--ink-soft); padding: 48px 0; }

/* ---- Post detail ---- */
.post-detail { padding: 32px 24px 72px; max-width: 780px; }
.back-link { display: inline-block; text-decoration: none; font-family: "Archivo", sans-serif; font-size: .85rem; font-weight: 600; margin-bottom: 20px; color: var(--ink-soft); }
.post-detail-date { display: block; font-family: "IBM Plex Mono", monospace; color: var(--madder); font-size: .85rem; margin-bottom: 6px; }
.post-detail h1 { font-size: 1.9rem; margin: 0 0 20px; }
.post-detail-desc p { margin: 0 0 16px; color: var(--ink); }
.post-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 32px; }
.post-photo-grid figure { margin: 0; }
.post-photo-grid img { border-radius: 6px; width: 100%; height: 220px; object-fit: cover; }
.post-photo-grid figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }

/* ---- Static pages (About / Contact) ---- */
.static-page { padding: 40px 24px 72px; max-width: 760px; }
.static-page h1 { font-size: 1.9rem; margin: 0 0 24px; }
.static-page-content p { margin: 0 0 16px; }
.contact-details { margin: 24px 0; padding: 18px 20px; background: var(--stone); border-radius: 8px; font-family: "Archivo", sans-serif; font-size: .92rem; }
.contact-details div { margin-bottom: 6px; }
.contact-details div:last-child { margin-bottom: 0; }
.contact-form-heading { font-size: 1.3rem; margin: 36px 0 16px; }

/* ---- Contact form ---- */
.contact-form { font-family: "Archivo", sans-serif; }
.contact-form label { display: block; font-weight: 600; font-size: .85rem; margin: 14px 0 5px; }
.contact-form label:first-of-type { margin-top: 0; }
.contact-form input[type=text], .contact-form input[type=email], .contact-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px;
  font-family: "Newsreader", serif; font-size: 1rem; background: #fff; color: var(--ink);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn-primary {
  margin-top: 16px; background: var(--slate); color: #fff; border: none; border-radius: 6px;
  padding: 11px 26px; font-family: "Archivo", sans-serif; font-weight: 700; font-size: .95rem; cursor: pointer;
}
.contact-form .btn-primary:hover { background: var(--slate-dark); }
/* Hidden from real visitors without pushing content off-screen with a
   negative offset -- an earlier version of this site had a bug where
   exactly that technique broke page width on RTL (Urdu) pages. */
.honeypot-field { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.alert { padding: 12px 16px; border-radius: 6px; font-family: "Archivo", sans-serif; font-size: .9rem; margin: 16px 0; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #cfd3dc; margin-top: 40px; }
.site-footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 40px 24px; font-family: "Archivo", sans-serif; font-size: .9rem; }
.site-footer-inner strong { color: #fff; font-size: 1.05rem; }
.site-footer-inner p { margin: 6px 0 0; color: #a7acb8; }
.footer-contact div { margin-bottom: 6px; }
.footer-contact a { color: #cfd3dc; }
.site-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 24px; font-family: "Archivo", sans-serif; font-size: .8rem; color: #8a90a0; text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .site-header-inner { padding: 14px 16px; }
  .site-nav { gap: 14px; }
  .post-feed, .post-detail, .static-page { padding-left: 16px; padding-right: 16px; }
  .site-footer-inner { padding: 32px 16px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .post-card { transition: none; }
}
