/* Memorial — محمد جوریان */
:root {
  --bg-deep: #0c0a09;
  --bg-card: rgba(28, 24, 20, 0.82);
  --bg-elevated: #1c1814;
  --text: #f5f0e8;
  --text-soft: #c4b8a8;
  --text-muted: #8a7d6e;
  --gold: #c9a962;
  --gold-dim: rgba(201, 169, 98, 0.18);
  --gold-glow: rgba(201, 169, 98, 0.35);
  --border: rgba(201, 169, 98, 0.2);
  --font: "Vazir", "Vazirmatn", Tahoma, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 720px;
  --radius: 12px;
  --radius-lg: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Background */
.memorial-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 50% -5%, rgba(201, 169, 98, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(120, 90, 60, 0.08), transparent 50%),
    linear-gradient(180deg, #12100e 0%, var(--bg-deep) 40%, #080706 100%);
  pointer-events: none;
}

.memorial-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23c9a962' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

/* Layout */
.memorial-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

/* Hero */
.memorial-hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
  margin-bottom: 2rem;
}

.portrait-frame {
  position: relative;
  display: inline-block;
  margin-bottom: 1.75rem;
  padding: 4px;
  background: linear-gradient(145deg, var(--gold), rgba(201, 169, 98, 0.25), var(--gold));
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 60px var(--gold-glow);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.portrait-frame img {
  width: min(280px, 78vw);
  aspect-ratio: 394 / 595;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 4px);
}

.memorial-name {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.memorial-lineage {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.dates-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
}

.date-card {
  flex: 1 1 140px;
  max-width: 200px;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.date-card .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.date-card .value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.date-card--passing .value {
  color: var(--gold);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0 0;
  color: var(--gold);
  opacity: 0.6;
  font-size: 0.65rem;
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Sections */
.memorial-section {
  margin-bottom: 2.75rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.section-title::before,
.section-title::after {
  content: "◆";
  font-size: 0.45rem;
  opacity: 0.7;
}

.bio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  backdrop-filter: blur(10px);
  text-align: justify;
}

.bio-card p {
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.bio-card p:last-child {
  margin-bottom: 0;
}

/* Poem */
.poem-block {
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-card), rgba(201, 169, 98, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
}

.poem-block::before {
  content: "«";
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
}

.poem-verses {
  font-size: 1.08rem;
  line-height: 2.1;
  color: var(--text);
  font-weight: 400;
}

.poem-author {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--gold);
}

/* Swiper shared */
.gallery-wrap,
.video-wrap {
  position: relative;
  padding: 0 0.25rem;
}

.swiper {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.photo-swiper .swiper-slide {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.4s var(--ease);
}

.photo-swiper .swiper-slide:hover img {
  transform: scale(1.03);
}

/* ویدیوها — گرید شماره‌دار */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

.video-card {
  position: relative;
  padding: 1.25rem 1rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s var(--ease);
}

.video-card.is-playing {
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}

.video-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.85rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bg-deep);
  background: linear-gradient(145deg, var(--gold), #a88b4a);
  border-radius: 50%;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0908;
  border: 1px solid rgba(201, 169, 98, 0.15);
}

.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: middle;
  background: #0a0908;
}

@media (min-width: 560px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.swiper-button-prev,
.swiper-button-next {
  color: var(--gold) !important;
  width: 40px !important;
  height: 40px !important;
  background: rgba(12, 10, 9, 0.75);
  border-radius: 50%;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.swiper-button-prev::after,
.swiper-button-next::after {
  font-size: 1rem !important;
  font-weight: 700;
}

.swiper-pagination-bullet {
  background: var(--text-muted) !important;
  opacity: 0.6 !important;
}

.swiper-pagination-bullet-active {
  background: var(--gold) !important;
  opacity: 1 !important;
}

/* Thanks */
.thanks-block {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-top: 2px solid var(--gold-dim);
}

.thanks-block p {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.9;
}

.thanks-sign {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.memorial-footer {
  text-align: center;
  padding: 2rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.memorial-footer a {
  color: var(--gold);
  transition: opacity 0.2s;
}

.memorial-footer a:hover {
  opacity: 0.85;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 6, 5, 0.92);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal.is-open {
  display: flex;
}

.modal img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(28, 24, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--gold-dim);
  color: var(--gold);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .memorial-page {
    padding: 1.25rem 1rem 2.5rem;
  }

  .dates-row {
    flex-direction: column;
    align-items: center;
  }

  .date-card {
    max-width: 100%;
    width: 100%;
  }

  .swiper-button-prev,
  .swiper-button-next {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .photo-swiper .swiper-slide:hover img {
    transform: none;
  }
}
