/* Calgary Persian Library — dedicated About page
   Folder-safe: all images, CSS, and JS are local inside /about/assets/.
*/

:root {
  --ink: #171411;
  --muted: #6e6258;
  --paper: #fffdf8;
  --cream: #f6efe3;
  --cream-2: #efe3cf;
  --green: #19723a;
  --green-dark: #0f4d29;
  --red: #c52934;
  --gold: #c59a43;
  --line: rgba(23,20,17,.12);
  --shadow: 0 18px 50px rgba(23,20,17,.11);
  --shadow-big: 0 30px 85px rgba(23,20,17,.17);
  --radius: 28px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  background:
    radial-gradient(circle at 6% 3%, rgba(25,114,58,.13), transparent 29rem),
    radial-gradient(circle at 94% 12%, rgba(197,41,52,.10), transparent 22rem),
    linear-gradient(180deg, #fffdf8 0%, #f7f0e6 52%, #fffaf2 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(25,114,58,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,114,58,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 78%);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 14px;
  background: var(--ink);
  color: #fff;
  padding: .65rem .9rem;
  border-radius: 999px;
  z-index: 1000;
}
.skip-link:focus { left: 14px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(255,253,248,.82);
  border-bottom: 1px solid rgba(23,20,17,.08);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  min-width: 0;
}
.brand img { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; }
.brand strong { display: block; letter-spacing: -.025em; font-size: 1.02rem; white-space: nowrap; }
.brand span { display: block; color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  font-size: .91rem;
  font-weight: 850;
  padding: .56rem .78rem;
  border-radius: 999px;
  color: #312a23;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.nav-links a:hover { transform: translateY(-1px); background: rgba(25,114,58,.10); }
.nav-links .nav-primary { background: var(--green); color: white; box-shadow: 0 10px 25px rgba(25,114,58,.22); }
.nav-links .nav-primary:hover { background: var(--green-dark); }

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  border-radius: 50%;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

.hero {
  padding: clamp(2.7rem, 6vw, 6.8rem) 0 clamp(2.6rem, 5vw, 4rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, .96fr);
  gap: clamp(2rem, 5vw, 4.6rem);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .46rem .78rem;
  border-radius: 999px;
  border: 1px solid rgba(25,114,58,.16);
  background: rgba(25,114,58,.09);
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.eyebrow::before {
  content: "";
  width: .56rem;
  height: .56rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(197,41,52,.12);
}
h1 {
  margin: 1.15rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(3.05rem, 8vw, 6.4rem);
  line-height: .94;
  letter-spacing: -.075em;
  max-width: 10.5ch;
}
h1 em { color: var(--green); font-style: normal; }
.lead {
  margin: 0;
  color: #403a32;
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  max-width: 61ch;
}
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.65rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .84rem 1.12rem;
  border-radius: 999px;
  border: 1px solid rgba(23,20,17,.11);
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(23,20,17,.08);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(23,20,17,.13); }
.button.primary { background: var(--green); color: white; border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.instagram { border: 0; color: white; background: linear-gradient(135deg, #feda75 0%, #f58529 25%, #dd2a7b 58%, #515bd4 100%); }
.button.dark { background: var(--ink); color: white; border-color: var(--ink); }

.hero-visual { position: relative; isolation: isolate; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 7% -5% -6% 9%;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(25,114,58,.25), rgba(197,41,52,.17));
  transform: rotate(4deg);
  z-index: -1;
}
.hero-photo {
  overflow: hidden;
  border-radius: 36px;
  background: #fff;
  border: 1px solid rgba(23,20,17,.08);
  box-shadow: var(--shadow-big);
  transform: rotate(-1.3deg);
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.logo-card {
  position: absolute;
  left: -20px;
  bottom: -28px;
  width: min(220px, 42vw);
  padding: .9rem;
  border-radius: 24px;
  background: rgba(255,253,248,.92);
  border: 1px solid rgba(23,20,17,.08);
  box-shadow: 0 18px 48px rgba(23,20,17,.18);
  backdrop-filter: blur(10px);
}

.stats-row {
  margin-top: clamp(2rem, 5vw, 3.3rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.info-strip,
.stat {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.73);
  box-shadow: 0 14px 35px rgba(23,20,17,.07);
  border-radius: 22px;
  padding: 1rem;
}
.info-strip { grid-column: span 1; }
.info-strip strong { color: var(--green-dark); display: block; margin-bottom: .25rem; }
.info-strip span { color: var(--muted); font-weight: 700; font-size: .92rem; }
.stat strong {
  display: block;
  color: var(--green);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}
.stat span { display: block; color: var(--muted); font-weight: 750; font-size: .86rem; margin-top: .42rem; }

section { padding: clamp(3.3rem, 7vw, 5.9rem) 0; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(260px, .55fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.1rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.section-head p { margin: 0; color: var(--muted); font-weight: 700; }

.cta-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.cta-card {
  padding: clamp(1.4rem, 3vw, 2.1rem);
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.80);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.cta-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -80px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25,114,58,.16), transparent 72%);
  pointer-events: none;
}
.tag {
  display: inline-flex;
  padding: .36rem .66rem;
  border-radius: 999px;
  background: rgba(25,114,58,.10);
  color: var(--green-dark);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .7rem;
}
.cta-card h3 { margin: 0 0 .5rem; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -.035em; }
.cta-card p { margin: 0 0 1.05rem; color: #433d35; }

.story-layout { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(320px, .97fr); gap: 1.1rem; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,248,.84);
  box-shadow: var(--shadow);
  padding: clamp(1.35rem, 3vw, 2.35rem);
}
.panel p { margin: 0 0 1rem; color: #403a32; }
.panel p:last-child { margin-bottom: 0; }
.panel strong { color: var(--green-dark); }
.dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4.8rem;
  line-height: .75;
  padding: .12rem .42rem .05rem 0;
  color: var(--green);
}
.quote {
  margin: 1.4rem 0;
  padding: 1.35rem 1.2rem;
  border-radius: 24px;
  border: 1px solid rgba(25,114,58,.14);
  background: linear-gradient(135deg, rgba(25,114,58,.10), rgba(197,41,52,.06));
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  font-style: italic;
  text-align: center;
}
.timeline { position: relative; display: grid; gap: .9rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 1.02rem;
  top: .8rem;
  bottom: .8rem;
  width: 2px;
  background: linear-gradient(var(--green), var(--red));
  opacity: .34;
}
.timeline-item {
  position: relative;
  padding: 1rem 1rem 1rem 3rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}
.timeline-item::before {
  content: attr(data-year);
  position: absolute;
  left: 0;
  top: 1rem;
  width: 2.05rem;
  height: 2.05rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: .64rem;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(25,114,58,.11);
}
.timeline-item:nth-child(even)::before {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(197,41,52,.10);
}
.timeline-item h3 { margin: 0 0 .35rem; font-size: 1.04rem; }
.timeline-item p { margin: 0; color: #403a32; font-size: .96rem; }
.timeline-item a { color: var(--green-dark); font-weight: 850; }

.media-grid {
  display: grid;
  grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
  gap: 1rem;
  align-items: start;
}
.media-card,
.gallery-card {
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 0;
}
.media-card img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.media-card figcaption,
.gallery-card figcaption {
  padding: .95rem 1rem 1.05rem;
  color: var(--muted);
  background: #fffdf8;
  font-size: .94rem;
  line-height: 1.55;
}
.media-card figcaption strong,
.gallery-card figcaption strong { color: var(--ink); }
.media-card figcaption a,
.gallery-card figcaption a { color: var(--green-dark); font-weight: 850; }

.program-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .72rem;
  margin-top: 1.15rem;
}
.program-list span {
  display: block;
  text-align: center;
  padding: .82rem .78rem;
  border-radius: 18px;
  border: 1px solid rgba(25,114,58,.13);
  background: rgba(255,255,255,.68);
  font-weight: 850;
  color: #332c25;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.gallery-card { grid-column: span 6; }
.gallery-card.wide { grid-column: span 12; }
.gallery-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  cursor: zoom-in;
  transition: transform .3s ease;
}
.gallery-card.contain img {
  object-fit: contain;
  background: #f6efe3;
  padding: 10px;
}
.gallery-card.tall img { height: 460px; }
.gallery-card:hover img { transform: scale(1.025); }

.visit-card {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(300px, .78fr);
  gap: 1.1rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(25,114,58,.11), rgba(197,41,52,.07)), rgba(255,253,248,.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.visit-card h2 {
  margin: 0 0 .8rem;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1;
  letter-spacing: -.055em;
}
.visit-card p { margin: 0 0 1rem; color: #403a32; }
.contact-box {
  padding: 1.25rem;
  background: #fff;
  border-radius: 28px;
  border: 1px solid rgba(23,20,17,.09);
  box-shadow: 0 18px 46px rgba(23,20,17,.12);
}
.contact-brand { display: flex; gap: .85rem; align-items: center; margin-bottom: 1rem; }
.contact-brand img { width: 66px; height: 66px; object-fit: contain; flex: 0 0 auto; }
.contact-brand strong { display: block; font-size: 1.1rem; }
.contact-brand span { color: var(--muted); font-weight: 700; font-size: .93rem; }
.contact-note {
  border-radius: 18px;
  background: #f5f0e6;
  border: 1px solid rgba(23,20,17,.08);
  padding: .85rem .9rem;
}
.contact-note p { margin: .3rem 0 0; color: var(--muted); font-size: .94rem; }

footer {
  padding: 2.1rem 0 2.8rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: .85rem; }
.footer-links a { text-underline-offset: 3px; }

dialog {
  width: min(1080px, calc(100% - 24px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: #111;
  color: white;
  box-shadow: 0 38px 120px rgba(0,0,0,.58);
}
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.modal-image {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #111;
}
.modal-caption { margin: 0; padding: .95rem 1rem 1.1rem; color: #eadfcf; }
.modal-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #111;
  font-size: 1.45rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .hero-grid,
  .story-layout,
  .media-grid,
  .visit-card,
  .section-head {
    grid-template-columns: 1fr;
  }
  .stats-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cta-grid { grid-template-columns: 1fr; }
  .program-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 780px) {
  .nav { min-height: 68px; }
  .menu-toggle { display: inline-block; }
  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: .8rem;
    background: rgba(255,253,248,.97);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { text-align: center; }
  .brand strong { font-size: .95rem; }
  .brand span { font-size: .7rem; }
  .brand img { width: 50px; height: 50px; }
}

@media (max-width: 700px) {
  h1 { font-size: clamp(2.65rem, 15vw, 4.2rem); }
  .logo-card { position: relative; left: auto; bottom: auto; margin: -1.8rem 1rem 0; }
  .stats-row { grid-template-columns: 1fr; }
  .program-list { grid-template-columns: 1fr; }
  .gallery-card,
  .gallery-card.wide { grid-column: span 12; }
  .gallery-card img,
  .gallery-card.tall img { height: auto; max-height: none; }
  .actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}


/* Final gallery fixes: compact thumbnails, no distortion, important faces/top areas visible. */
.gallery-card.focus-top img { object-position: center top; }
.gallery-card.portrait-card img { height: 420px; object-position: center top; }
.gallery-card.outreach-card img { height: 330px; object-position: center top; }

@media (max-width: 700px) {
  .gallery-card.portrait-card img,
  .gallery-card.outreach-card img { height: auto; object-fit: contain; }
}


/* Visit/access map and history document blocks */
.map-frame {
  overflow: hidden;
  min-height: 420px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #f6efe3;
  box-shadow: var(--shadow);
}
.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
}

.history-blocks { display: grid; gap: 1.2rem; }
.history-block {
  display: grid;
  grid-template-columns: minmax(280px, .74fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}
.history-block.reverse { grid-template-columns: minmax(0, 1fr) minmax(280px, .74fr); }
.history-block.reverse figure { order: 2; }
.history-block.reverse .history-copy { order: 1; }
.history-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,248,.84);
  box-shadow: var(--shadow);
  padding: clamp(1.3rem, 3vw, 2.2rem);
}
.history-copy h3 { margin: 0 0 .55rem; font-size: clamp(1.5rem, 2.4vw, 2.2rem); letter-spacing: -.04em; line-height: 1.1; }
.history-copy p { margin: 0 0 1rem; color: #403a32; }
.history-copy p:last-child { margin: 0; }
.programs-panel { margin-top: 1.2rem; }

@media (max-width: 1020px) {
  .history-block,
  .history-block.reverse { grid-template-columns: 1fr; }
  .history-block.reverse figure,
  .history-block.reverse .history-copy { order: initial; }
  .map-frame,
  .map-frame iframe { min-height: 340px; }
}
