/* ============================================================
   آتلیه کودک نینو — صفحه گالری (gallery-page.css)
   RTL، فارسی، با اصول better-ui و design-taste
   ============================================================ */

/* ===== هدر (فیکس) ===== */
.site-header {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 100;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.97);
  transition: background .3s ease, padding .3s ease;
}
.site-header.scrolled { background: rgba(255,255,255,.97); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  direction: rtl;
}
.nav-right a, .nav-left a { color: var(--black); }
.site-header .auth-btn {
  color: var(--black);
  border-color: rgba(0,0,0,.35);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.7));
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
}
.site-header .auth-btn:hover {
  background: linear-gradient(180deg, var(--black), #222);
  color: var(--white);
  border-color: transparent;
}
.hamburger span { background: var(--black); }

/* ===== هیرو گالری ===== */
.gallery-hero {
  position: relative;
  min-height: 34vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--beige-light) 0%, var(--white) 100%);
  padding: 120px 24px 50px;
  text-align: center;
  overflow: hidden;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../photos/hero-v2-desktop.webp') center/cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
}

.gallery-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 400;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 10px;
  text-wrap: balance;
}

.gallery-hero p {
  font-family: var(--font-body);
  font-size: 16px;
  color: rgba(0,0,0,.6);
  max-width: 480px;
  margin: 0 auto;
}

/* ===== فیلتر دسته‌بندی ===== */
.gallery-filter {
  padding: 8px 24px 34px;
  background: var(--white);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.filter-tab {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: rgba(0,0,0,.6);
  background: var(--beige-light);
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition: all .2s ease;
}

.filter-tab:hover {
  color: var(--black);
  background: rgba(0,0,0,.08);
}

.filter-tab.active {
  background: var(--black);
  color: var(--white);
}

.filter-tab:active {
  transform: scale(0.96);
}

/* ===== گرید گالری ===== */
.gallery-section {
  padding: 0 24px 80px;
  background: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* آیتم گالری */
.gallery-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3/4;
  background: var(--beige-light);
  box-shadow:
    0 1px 3px rgba(0,0,0,.06),
    0 4px 14px rgba(0,0,0,.05);
  transition: transform .25s cubic-bezier(.2,.8,.2,1),
              box-shadow .25s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 10px rgba(0,0,0,.1),
    0 14px 28px rgba(0,0,0,.08);
}

.gallery-item:active {
  transform: scale(0.98);
  transition-duration: 40ms;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* هاله (hover overlay) */
.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 45%);
  opacity: 0;
  transition: opacity .3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay .gallery-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.4px;
}

/* انیمیشن فیلتر */
.gallery-item {
  opacity: 0;
  transform: translateY(16px) scale(.98);
  animation: galleryIn .5s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes galleryIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== لایتباکس ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: min(900px, 90vw);
  max-height: 85vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  outline: 1px solid rgba(255,255,255,.08);
}

.lightbox-content figcaption {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--white);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.lightbox-close:hover {
  background: rgba(255,255,255,.25);
}

.lightbox-close:active {
  transform: scale(0.94);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .2s ease;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,.25);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.94);
}

.lightbox-prev { right: 24px; }
.lightbox-next { left: 24px; }

/* ===== حالت خالی ===== */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 24px;
  color: rgba(0,0,0,.45);
}

.gallery-empty h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 8px;
}

/* ===== فوتر ===== */
.site-footer { background: var(--black); color: var(--white); direction: rtl; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  max-width: 1180px;
  margin: 0 auto;
  padding: 50px 40px;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.footer-col { text-align: center; }
.footer-col h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 16px;
}
.footer-col .socials { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.footer-col .socials a {
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,.8);
  transition: color .2s ease;
}
.footer-col .socials a:hover { color: var(--white); }
.footer-col .tagline {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(255,255,255,.9);
  line-height: 2;
  margin: 0;
}
.footer-col .tagline em {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}
.footer-col .blog-link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,.8);
  transition: color .2s ease;
}
.footer-col .blog-link:hover { color: var(--white); }
.footer-bottom {
  text-align: center;
  padding: 22px 40px 28px;
}
.footer-bottom .back-top {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(255,255,255,.7);
  margin-bottom: 14px;
  transition: color .2s ease;
}
.footer-bottom .back-top:hover { color: var(--white); }
.footer-bottom .copyright {
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(255,255,255,.5);
}

/* ===== تبلت ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ===== موبایل ===== */
@media (max-width: 768px) {
  .site-header { padding: 0 14px; height: 64px; }
  .nav-right, .nav-left { display: none; }
  .auth-btn {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    font-size: 11px;
    padding: 7px 13px;
    z-index: 250;
    width: auto;
    min-width: 78px;
  }
  .hamburger {
    display: flex;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
  }
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .logo-img { width: 52px; height: 52px; }
  
  .gallery-hero { min-height: 30vh; padding: 100px 16px 36px; }
  .gallery-hero h1 { font-size: 30px; }
  .gallery-hero p { font-size: 14px; }
  .gallery-filter { padding: 4px 16px 26px; }
  .filter-tabs { gap: 8px; }
  .filter-tab { font-size: 13px; padding: 8px 16px; }
  .gallery-section { padding: 0 16px 60px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-item { border-radius: 10px; }
  .lightbox-prev { right: 12px; }
  .lightbox-next { left: 12px; }
  .lightbox-close { top: 12px; left: 12px; }
  
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px; }
  .footer-col .tagline { font-size: 13px; }
}

/* ===== حرکت کاهش‌یافته ===== */
@media (prefers-reduced-motion: reduce) {
  .gallery-item {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .gallery-item:hover { transform: none; }
  .gallery-item:hover img { transform: none; }
  .lightbox { transition: none; }
}