/* Mandegar8 Gallery Master CSS */
/* Matches Mandegar8 visual identity */

:root {
  --bg: #0c0f0c;
  --bg-elevated: #13160f;
  --olive-deep: #262b1d;
  --olive: #4b5a3e;
  --sage: #8a9a72;
  --ink: #ece6d6;
  --ink-dim: #a8a290;
  --ink-faint: #6f6b5d;
  --gold: #b8924a;
  --gold-soft: rgba(184, 146, 74, 0.32);
  --line: rgba(184, 146, 74, 0.18);
  --maxw: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 400;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0px, rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 3px);
  opacity: 0.5;
}

h1, h2, h3, .kufi {
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.5px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
}

/* Header */
header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

header.scrolled {
  background: rgba(12, 15, 12, 0.92);
  backdrop-filter: blur(10px);
  border-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  max-width: 200px;
  height: auto;
  display: block;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-fa {
  font-family: 'Noto Kufi Arabic';
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.brand-en {
  font-size: 0.62rem;
  letter-spacing: 3px;
  color: var(--ink-faint);
}

nav.main-nav ul {
  display: flex;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  font-size: 0.92rem;
  color: var(--ink-dim);
  position: relative;
  padding: 6px 2px;
  transition: color 0.25s ease;
}

nav.main-nav a:hover {
  color: #8b0000;
  text-shadow: 0 0 10px rgba(139, 0, 0, 0.5), 0 0 20px rgba(139, 0, 0, 0.3);
}

nav.main-nav a.active {
  color: var(--gold);
}

nav.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

nav.main-nav a:hover::after,
nav.main-nav a.active::after {
  transform: scaleX(1);
}

/* Dropdown Menu */
nav.main-nav > ul > li {
  position: relative;
}

nav.main-nav .dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

nav.main-nav .dropdown-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--ink-dim);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

nav.main-nav .dropdown-toggle.active::after {
  border-top-color: var(--gold);
  transform: rotate(180deg);
}

nav.main-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  min-width: 220px;
  padding: 12px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 150;
  display: block;
}

nav.main-nav .dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

nav.main-nav .dropdown-menu li {
  display: block;
  width: 100%;
  list-style: none;
}

nav.main-nav .dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--ink-dim);
  font-size: 0.88rem;
  white-space: nowrap;
}

nav.main-nav .dropdown-menu a:hover {
  background: var(--gold-soft);
  color: var(--ink);
  text-shadow: none;
  animation: none;
}

nav.main-nav .dropdown-menu a::after {
  display: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--ink);
  margin: 4px auto;
}

@media (max-width: 880px) {
  nav.main-nav {
    position: fixed;
    top: 84px;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(10, 12, 9, 0.98);
    backdrop-filter: blur(10px);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    padding-top: 40px;
  }

  nav.main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  nav.main-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  nav.main-nav a {
    font-size: 1.15rem;
  }

  .menu-toggle {
    display: block;
  }
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background: #0a0c09;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.4s ease;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.slide.active .slide-bg {
  animation: kenburns 7s ease-in-out forwards;
}

@keyframes kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.07);
  }
}

.slide-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(12, 15, 12, 0.45), rgba(8, 10, 7, 0.88) 72%),
    linear-gradient(to top, rgba(8, 10, 7, 0.95), rgba(8, 10, 7, 0.3) 55%);
}

/* هر اسلاید یک تصویر دارد. تصویر را داخل پوشه‌ی images کنار همین فایل با همین نام قرار دهید.
   تا زمانی که عکس واقعی اضافه نشده، رنگ زیتونی پشت‌زمینه به‌صورت خودکار نمایش داده می‌شود. */
.slide:nth-child(1) .slide-bg {
  background-image: url('../../../assets/images/hero/gallery/slide-1.jpg'), linear-gradient(160deg, #1a2014, #0a0c09 60%);
}
.slide:nth-child(2) .slide-bg {
  background-image: url('../../../assets/images/hero/gallery/slide-2.jpg'), linear-gradient(160deg, #241f14, #0a0c09 60%);
}
.slide:nth-child(3) .slide-bg {
  background-image: url('../../../assets/images/hero/gallery/slide-3.jpg'), linear-gradient(160deg, #1c2118, #0a0c09 60%);
}
.slide:nth-child(4) .slide-bg {
  background-image: url('../../../assets/images/hero/gallery/slide-4.jpg'), linear-gradient(160deg, #1a1a17, #0a0c09 60%);
}
.slide:nth-child(5) .slide-bg {
  background-image: url('../../../assets/images/hero/gallery/slide-5.jpg'), linear-gradient(160deg, #202418, #0a0c09 60%);
}

.slide-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 760px;
  padding: 56px 48px;
  margin: 0 24px;
}

.slide-content .eyebrow {
  justify-content: center;
  margin-bottom: 22px;
}

.slide-content .eyebrow::before {
  display: none;
}

.slide-title {
  font-size: clamp(2.1rem, 5.2vw, 4rem);
  line-height: 1.35;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.slide-sub {
  margin-top: 20px;
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 520px;
  margin-inline: auto;
}

.hero-marks {
  position: absolute;
  bottom: 38px;
  right: 0;
  left: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero-marks button {
  width: 44px;
  height: 2px;
  background: rgba(236, 230, 214, 0.28);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, width 0.3s ease;
}

.hero-marks button.active {
  background: var(--gold);
  width: 64px;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  background: rgba(12, 15, 12, 0.4);
  border: 1px solid rgba(184, 146, 74, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hero-nav:hover {
  background: rgba(12, 15, 12, 0.7);
  border-color: var(--gold);
}

.hero-nav svg {
  width: 20px;
  height: 20px;
  color: var(--ink-dim);
  transition: color 0.3s ease;
}

.hero-nav:hover svg {
  color: var(--gold);
}

.hero-nav.prev {
  right: 24px;
}

.hero-nav.next {
  left: 24px;
}

@media (max-width: 700px) {
  .hero-nav {
    display: none;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 38px;
  left: 48px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 0.7rem;
  letter-spacing: 2px;
}

.scroll-cue .line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: cue 2.4s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% {
    transform: scaleY(0.6);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 700px) {
  .scroll-cue {
    display: none;
  }
}

/* Introduction */
.intro {
  padding: 60px 0;
}

.intro-content {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 40px;
}

.intro h2 {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 20px;
}

.intro p {
  color: var(--ink-dim);
  line-height: 2;
  font-size: 1rem;
}

/* Filters */
.filters {
  padding: 40px 0;
}

.section-title {
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 24px;
  text-align: center;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: var(--olive-deep);
  border-color: var(--gold);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

/* Gallery Grid */
.gallery-section {
  padding: 40px 0 80px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.gallery-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--olive-deep);
}

.gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card-image img {
  transform: scale(1.05);
}

.gallery-card-content {
  padding: 16px;
}

.gallery-card-category {
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.gallery-card-title {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 600;
}

.gallery-card-description {
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(184, 146, 74, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.lightbox-close {
  top: -60px;
  left: 0;
}

.lightbox-prev {
  top: 50%;
  right: -70px;
  transform: translateY(-50%);
}

.lightbox-next {
  top: 50%;
  left: -70px;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--gold);
  color: var(--bg);
}

.lightbox-image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-info {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lightbox-title {
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.lightbox-category {
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.lightbox-description {
  font-size: 1rem;
  color: var(--ink-dim);
  line-height: 1.8;
  margin-bottom: 16px;
}

.lightbox-meta {
  display: flex;
  gap: 24px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* Footer */
footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand {
  flex-shrink: 0;
}

.footer-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.footer-text {
  flex: 1;
  display: flex;
  align-items: center;
}

.footer-text p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-close {
    top: -50px;
    width: 40px;
    height: 40px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox-prev {
    right: -50px;
  }

  .lightbox-next {
    left: -50px;
  }

  .lightbox-title {
    font-size: 1.2rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-inner {
    height: 70px;
  }

  nav.main-nav ul {
    gap: 16px;
  }

  nav.main-nav a {
    font-size: 0.8rem;
  }

  .hero {
    min-height: 300px;
    margin-top: 70px;
  }

  .hero-content {
    padding: 40px 16px;
  }

  .intro-content {
    padding: 24px;
  }

  .filter-buttons {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

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