/* ============================================================
   Jamshid Foundation — static site
   Self-contained: no external fonts, CSS, or JS.
   System font stacks only, so the folder runs anywhere offline.
   ============================================================ */

:root {
  --bg: #faf8f3;          /* warm cream */
  --ink: #211e1a;         /* warm near-black */
  --muted: #6f675b;       /* muted brown-gray */
  --accent: #1f3a5f;      /* deep persian / lapis blue */
  --accent-2: #a9834f;    /* muted gold */
  --line: #e6dfd1;        /* soft rule */
  --card: #ffffff;
  --img-shadow: 0 4px 10px rgba(33,30,26,0.18), 0 22px 60px rgba(33,30,26,0.34);
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fa: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --maxw: 1000px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Subtle patterned background layer (ornate-floral), behind all content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../images/ornate-floral.avif") center / 680px auto repeat;
  opacity: 0.15;
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: saturate(180%) blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.20);
}
.brand .name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.3px;
  display: block;
  line-height: 1.1;
}
.brand .tag {
  display: block;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-top: 3px;
}
nav.main-nav {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 8px 0 12px;
}
nav.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  padding: 6px 13px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
nav.main-nav a:hover { color: var(--accent); background: rgba(31,58,95,0.08); }
nav.main-nav a.active { color: #fff; background: var(--accent); }

/* ---------- Layout ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 42px 24px 76px;
}
.page-head { margin-bottom: 34px; }
.page-title {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.12;
  margin: 0 0 12px;
  color: var(--ink);
}
.page-sub {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
  max-width: 64ch;
}
.title-rule {
  width: 56px;
  height: 3px;
  background: var(--accent-2);
  border: 0;
  margin: 18px 0 0;
  border-radius: 2px;
}

/* ---------- Prose ---------- */
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1.15em; }
.prose strong { color: var(--ink); }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }

/* Persian / RTL */
.fa {
  font-family: var(--fa);
  direction: rtl;
  text-align: right;
  line-height: 2.15;
  font-size: 18.5px;
  margin: 0 0 1.2em;
}

/* ---------- Figures / images ---------- */
figure.figure {
  margin: 34px 0;
  text-align: center;
}
figure.figure a { display: inline-block; }
figure.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: var(--img-shadow);
}
figure.figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* Product (book / dvd) block */
.product {
  text-align: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.product:first-of-type { padding-top: 6px; }
.product:last-of-type { border-bottom: 0; }
.product h3 {
  font-family: var(--serif);
  font-size: 23px;
  margin: 0 0 18px;
  color: var(--accent);
}
.product img {
  max-width: 100%;
  width: 620px;
  height: auto;
  border-radius: 6px;
  box-shadow: var(--img-shadow);
  transition: transform .2s ease;
}
.product img:hover { transform: scale(1.012); }

/* ---------- Grids (posters / statue) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  margin: 30px 0;
}
.grid a.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--img-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}
.grid a.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(33,30,26,0.20), 0 28px 70px rgba(33,30,26,0.40);
}
.grid a.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.grid a.card .cap {
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Video ---------- */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(33,30,26,0.18);
  margin: 6px 0 36px;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Memorial hero ---------- */
.memorial-hero { text-align: center; padding: 24px 0 8px; }
.memorial-hero .epitaph {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent-2);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-size: 14px;
  margin: 0 0 22px;
}
.portrait {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--img-shadow);
  border: 4px solid #fff;
  margin: 0 auto 22px;
  display: block;
}
.memorial-name {
  font-family: var(--serif);
  font-size: 42px;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}
.memorial-role {
  color: var(--accent);
  font-size: 17px;
  margin: 8px 0 0;
  letter-spacing: 0.4px;
}
.memorial-bio {
  max-width: 66ch;
  margin: 30px auto 0;
  text-align: center;
  font-size: 17.5px;
}
.memorial-bio p { margin: 0 0 1.1em; }
.placeholder-note {
  background: rgba(169,131,79,0.08);
  border: 1px dashed var(--accent-2);
  border-radius: 8px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 14.5px;
  margin: 24px auto 0;
  max-width: 60ch;
  text-align: center;
}

/* ---------- Contact / credit block ---------- */
.info-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 30px 0;
}
.info-block h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0 0 10px;
  color: var(--accent);
}
.info-block p { margin: 0 0 0.7em; }
.info-block a { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #f3efe6;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 24px 46px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}
.footer-inner .f-name {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 19px;
  margin-bottom: 4px;
}
.footer-inner .f-tag { color: var(--accent-2); letter-spacing: 0.4px; }
.footer-inner a { color: var(--accent); }

/* ---------- Lightbox (js/lightbox.js) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 15, 0.93);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
  cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }
.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 16px 16px;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.5);
  background: #fff;
}
.lightbox-cap {
  color: rgba(250, 248, 243, 0.85);
  font-size: 14.5px;
  font-style: italic;
  text-align: center;
  max-width: 80vw;
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 248, 243, 0.12);
  color: #faf8f3;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.lightbox-close:hover { background: rgba(250, 248, 243, 0.28); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .page-title, .memorial-name { font-size: 31px; }
  .brand .name { font-size: 19px; }
  .product img { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .grid a.card img { height: 140px; }
}
