:root {
  --paper: #f7fbfb;
  --paper-deep: #e5ede3;
  --paper-shadow: rgba(52, 45, 35, 0.08);

  --gold: #c8983e;
  --gold-deep: #9b7023;

  --teal: #066e78;
  --teal-deep: #06496c;
  --navy: #0c3551;

  --ink: #20303a;
  --ink-soft: #47616b;

  --radius-lg: 24px;
  --radius-md: 16px;
  --container: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

body {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(0, 0, 0, 0.02), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.02));
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(92vw, var(--container));
  margin-inline: auto;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 243, 239, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--paper-shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 0;
}

.brand-emblem {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 36px;
}

.brand-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-wordmark {
  display: flex;
  align-items: center;
  flex: 0 1 150px;
  width: 150px;
  height: 36px;
}

.brand-wordmark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--teal-deep);
  border-color: var(--teal-deep);
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 0 2rem;
}

.brand-panel {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px var(--paper-shadow);
  text-align: center;
  overflow: hidden;
}

.brand-logo {
  width: min(82vw, 520px);
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(93, 76, 41, 0.12));
  margin-bottom: 1.25rem;
}

.hero-compact {
  padding: 2rem 0 0.5rem;
}

.hero-compact .brand-logo {
  width: min(60vw, 300px);
  margin-bottom: 1rem;
}

.home-hero {
  width: calc(100% + 3rem);
  margin: -1.5rem -1.5rem 1.25rem;
}

.home-hero img {
  width: 100%;
  height: auto;
}

.cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  background: var(--teal-deep);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  background: var(--teal);
  transform: translateY(-2px);
}

/* ---------- About ---------- */
.about {
  padding: 2rem 0 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.about h2 {
  color: var(--teal-deep);
  font-size: 1.75rem;
  margin-top: 0;
}

.about p {
  color: var(--ink-soft);
  line-height: 1.7;
  text-align: justify;
}

.about-copy strong {
  color: var(--teal-deep);
  font-weight: 700;
}

.about-mark img {
  width: min(100%, 300px);
  height: auto;
  margin-inline: auto;
}

.page-hero {
  padding: 2.5rem 0 1rem;
  text-align: center;
}

.page-hero img {
  width: min(72vw, 420px);
  height: auto;
  margin: 0 auto;
}

.page-shell {
  padding: 1.5rem 0 4rem;
}

.story-block {
  max-width: 960px;
  margin: 0 auto;
}

.story-block h1,
.story-block h2 {
  color: var(--teal-deep);
  margin-bottom: 1rem;
}

.story-block p {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  line-height: 1.8;
  text-align: justify;
}

.story-block strong {
  color: var(--navy);
}

.about-feature {
  margin: 2.5rem 0;
}

.about-feature img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 40px var(--paper-shadow);
}

.about-feature figcaption {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.program-overview {
  grid-template-areas:
    "farsi-action ideas-action"
    "farsi-card vision-card";
}

.program-overview .cta-button {
  justify-self: start;
}

.program-action-farsi { grid-area: farsi-action; }
.program-action-ideas { grid-area: ideas-action; }
.program-card-farsi { grid-area: farsi-card; }
.program-card-vision { grid-area: vision-card; }

.program-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 53, 81, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 24px var(--paper-shadow);
}

.program-card h3 {
  margin-top: 0;
  color: var(--teal-deep);
}

.program-card ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.page-hero .contact-hero-image {
  width: 100%;
  height: 390px;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  box-shadow: 0 18px 40px var(--paper-shadow);
}

.contact-page h1 {
  margin-bottom: 1.25rem;
}

.flyer-placeholder {
  width: 100%;
  height: 390px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 2px dashed rgba(12, 53, 81, 0.25);
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink-soft);
  font-weight: 600;
}

.farsi-flyer-image {
  width: min(100%, 480px);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 18px 40px var(--paper-shadow);
}

.teacher-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 53, 81, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 24px var(--paper-shadow);
  margin-bottom: 1.5rem;
}

.teacher-card h3 {
  margin-top: 0;
  color: var(--teal-deep);
}

.teacher-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.teacher-contact-list li {
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
}

.teacher-contact-list a {
  color: var(--teal-deep);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-grid img,
.gallery-grid video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 24px var(--paper-shadow);
}

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.address-block {
  margin-bottom: 1.5rem;
}

.address-block h2,
.contact-card h3 {
  color: var(--teal-deep);
  margin-bottom: 0.75rem;
}

.address-block p,
.contact-card li {
  color: var(--ink-soft);
  line-height: 1.8;
}

.map-wrap {
  margin: 1.5rem 0;
}

.map-wrap img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 14px 28px var(--paper-shadow);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.contact-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 53, 81, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 24px var(--paper-shadow);
}

.contact-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-card li {
  margin-bottom: 0.75rem;
}

.contact-card a {
  color: var(--teal-deep);
}

@media (max-width: 760px) {
  .about {
    grid-template-columns: 1fr;
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .program-overview {
    grid-template-areas:
      "farsi-action"
      "farsi-card"
      "ideas-action"
      "vision-card";
  }
}

/* ---------- Values (فرهنگ / زبان / هنر) ---------- */
.values {
  padding: 1rem 0 3.5rem;
}

.focus-divider {
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
}

.focus-divider img {
  width: min(82vw, 600px);
  height: auto;
}

.values h2 {
  text-align: center;
  color: var(--teal-deep);
  margin-bottom: 2rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  /* Right-to-left, like the footer tagline: فرهنگ • زبان • هنر */
  direction: rtl;
}

.value-card {
  display: block;
  direction: ltr;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  text-align: center;
  border-top: 4px solid var(--accent, var(--gold));
  box-shadow: 0 10px 24px var(--paper-shadow);
  text-decoration: none;
}

/* Same colors as .footer-tagline */
.value-card:nth-child(1) { --accent: var(--teal); }
.value-card:nth-child(2) { --accent: var(--gold-deep); }
.value-card:nth-child(3) { --accent: var(--navy); }

.value-card h3 {
  margin: 0 0 0.5rem;
  color: var(--accent, var(--teal-deep));
  direction: rtl;
  font-size: 1.3rem;
}

.value-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 40px var(--paper-shadow);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: var(--carousel-ratio, 2 / 1);
}

.carousel-slide,
.carousel-slide a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide a {
  width: 100%;
  height: 100%;
}

.carousel-slide picture {
  display: contents;
}

/* Images keep their own shape, so the rounded corners hug each photo. */
.carousel .carousel-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 12px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--teal-deep);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--paper-shadow);
}

.carousel-btn:hover,
.carousel-btn:focus-visible {
  background: #fff;
  color: var(--teal);
}

.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }

.carousel-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}

.carousel-dot {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 1px solid var(--teal-deep);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.carousel-dot[aria-current="true"] {
  background: var(--teal-deep);
}

/* ---------- Events ---------- */
.events-section {
  margin-top: 2.5rem;
}

.event-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(12, 53, 81, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 24px var(--paper-shadow);
}

.event-card[hidden] {
  display: none;
}

.event-card .carousel {
  --carousel-ratio: 4 / 3;
  box-shadow: none;
}

.event-details h3 {
  margin-top: 0;
  color: var(--teal-deep);
}

.event-meta {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.event-details .story-link {
  color: var(--teal-deep);
  font-weight: 600;
}

.events-empty {
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(12, 53, 81, 0.2);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

[data-pager] + .events-empty {
  margin-top: 1.5rem;
}

.story-block .events-empty p {
  text-align: center;
  margin: 0;
}

.events-empty a {
  color: var(--teal-deep);
}

.pager-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.pager-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--teal-deep);
  border-radius: 999px;
  background: transparent;
  color: var(--teal-deep);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pager-btn:hover:not(:disabled),
.pager-btn:focus-visible {
  background: var(--teal-deep);
  color: var(--paper);
}

.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager-count {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .event-card {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-tagline {
  direction: rtl;
  color: var(--gold-deep);
  font-weight: 600;
  margin: 0.25rem 0 0.75rem;
}

.footer-tagline span:nth-child(1) { color: var(--teal); }
.footer-tagline span:nth-child(3) { color: var(--navy); }

@media (max-width: 640px) {
  .site-header .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .hero {
    padding: 1.5rem 0;
  }
}

