/* ═══════════════════════════════════════════════════════════════
   Nasij — Gallery Section Theme
   Applied to "معرض التصاميم" section
   Warm cream + Deep green + Adaptive fashion aesthetic
   ═══════════════════════════════════════════════════════════════ */

:root {
  --gallery-bg:        #E8DDD0;  /* Warm cream */
  --gallery-card-bg:   #F5EFE8;  /* Light cream cards */
  --gallery-green:     #2B5F3F;  /* Deep green */
  --gallery-green-alt: #4A7F5D;  /* Softer green */
  --gallery-accent:    #D4A574;  /* Gold accent */
  --gallery-brown:     #8B7355;  /* Warm brown */
  --gallery-border:    #D9CEBC;  /* Subtle border */
}

/* ── Gallery/معرض التصاميم section ──────────────────────────── */
#gallery,
.gallery-section {
  background: var(--gallery-bg) !important;
  border-top: 1px solid var(--gallery-border) !important;
  padding: 90px 40px !important;
}

/* ── Gallery header ──────────────────────────────────────────── */
.gallery-header,
#gallery > div > div:first-child {
  text-align: center;
  margin-bottom: 60px;
}

.gallery-eyebrow,
#gallery p:first-of-type {
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
  font-size: 12px !important;
  letter-spacing: 0.4em !important;
  color: var(--gallery-accent) !important;
  margin-bottom: 16px !important;
  font-weight: 500 !important;
  text-transform: none !important;
}

.gallery-title,
#gallery h2 {
  font-family: 'Rakkas', 'Tajawal', serif !important;
  font-size: 56px !important;
  font-weight: 700 !important;
  color: var(--gallery-green) !important;
  letter-spacing: -0.025em !important;
  margin: 0 0 24px !important;
  line-height: 1.1 !important;
  text-wrap: balance !important;
}

.gallery-title span,
#gallery h2 span {
  color: var(--gallery-accent) !important;
  font-style: italic !important;
  font-family: 'Limelight', serif !important;
  margin: 0 12px !important;
  font-weight: 400 !important;
}

.gallery-subtitle,
#gallery p:nth-of-type(2),
#gallery > div > div:first-child > p:last-child {
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
  font-size: 15px !important;
  color: var(--gallery-brown) !important;
  line-height: 1.7 !important;
  max-width: 500px !important;
  margin: 0 auto !important;
  font-weight: 400 !important;
}

/* ── Filter buttons ──────────────────────────────────────────── */
.gallery-filters,
.filter-buttons,
#gallery > div > div:nth-child(2) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 50px;
}

.filter-btn,
.gallery-filters button {
  background: var(--gallery-card-bg) !important;
  color: var(--gallery-brown) !important;
  border: 1.5px solid var(--gallery-border) !important;
  border-radius: 28px !important;
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 10px 24px !important;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  text-transform: none !important;
}

.filter-btn:hover,
.gallery-filters button:hover {
  background: var(--gallery-green) !important;
  color: var(--gallery-card-bg) !important;
  border-color: var(--gallery-green) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(43, 95, 63, 0.15) !important;
}

.filter-btn.active,
.gallery-filters button.active {
  background: var(--gallery-green) !important;
  color: var(--gallery-card-bg) !important;
  border-color: var(--gallery-green) !important;
  font-weight: 600 !important;
}

/* ── Gallery grid ────────────────────────────────────────────── */
.gallery-grid,
.gallery-container,
#gallery > div > div:nth-child(3) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 50px;
}

@media (max-width: 1024px) {
  .gallery-grid,
  .gallery-container,
  #gallery > div > div:nth-child(3) {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .gallery-grid,
  .gallery-container,
  #gallery > div > div:nth-child(3) {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ── Gallery cards ───────────────────────────────────────────── */
.gallery-item,
article.gallery-item,
#gallery article,
.gallery-card {
  background: var(--gallery-card-bg) !important;
  border: 1px solid var(--gallery-border) !important;
  border-radius: 32px !important;
  overflow: hidden !important;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 6px 20px rgba(43, 95, 63, 0.08) !important;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover,
article.gallery-item:hover,
#gallery article:hover,
.gallery-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 14px 36px rgba(43, 95, 63, 0.15) !important;
  border-color: var(--gallery-accent) !important;
}

/* ── Gallery image ───────────────────────────────────────────── */
.gallery-image,
.gallery-item img,
.gallery-thumb,
#gallery img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  overflow: hidden;
  background: var(--gallery-bg) !important;
  display: block;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  border-radius: 24px !important;
  margin: 16px !important;
}

.gallery-item:hover .gallery-image,
article.gallery-item:hover img,
.gallery-card:hover img,
#gallery article:hover img {
  transform: scale(1.04) !important;
}

.gallery-image-wrapper,
.gallery-thumb-wrapper {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--gallery-bg) !important;
  overflow: hidden;
  border-radius: 24px !important;
  margin: 16px !important;
}

.gallery-image-wrapper img,
.gallery-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.gallery-item:hover .gallery-image-wrapper img,
.gallery-item:hover img {
  transform: scale(1.04) !important;
}

/* ── Gallery image tag ───────────────────────────────────────── */
.gallery-tag,
.gallery-item span.tag,
#gallery span[class*="tag"] {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(245, 239, 232, 0.92) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: var(--gallery-green) !important;
  font-size: 10px !important;
  letter-spacing: 0.2em !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  font-family: 'Tajawal', sans-serif !important;
  font-weight: 500 !important;
  text-transform: none !important;
}

/* ── Gallery content ────────────────────────────────────────── */
.gallery-content,
.gallery-item footer,
article.gallery-item > div:last-child {
  padding: 24px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.gallery-title-item,
.gallery-item h3,
article h3 {
  font-family: 'Rakkas', 'Tajawal', serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--gallery-green) !important;
  margin: 0 !important;
  letter-spacing: -0.015em !important;
}

/* ── Gallery arrow icon ──────────────────────────────────────– */
.gallery-arrow,
.gallery-item span[class*="arrow"],
#gallery article span:last-child,
section[id="gallery"] article span:last-child {
  color: var(--gallery-accent) !important;
  font-size: 22px !important;
  font-family: 'Limelight', serif !important;
  font-weight: 400 !important;
  transition: transform 0.3s ease !important;
}

.gallery-item:hover .gallery-arrow,
article:hover span:last-child {
  transform: translateX(-4px) !important;
}

/* ── Load more button ───────────────────────────────────────── */
.gallery-load-more,
.gallery-footer,
#gallery > div > div:last-child {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

.load-more-btn,
.gallery-load-more button,
#gallery button:last-child {
  background: var(--gallery-card-bg) !important;
  color: var(--gallery-accent) !important;
  border: 2px solid var(--gallery-accent) !important;
  border-radius: 32px !important;
  font-family: 'Tajawal', 'Cairo', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 16px 36px !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.load-more-btn:hover,
.gallery-load-more button:hover,
#gallery button:last-child:hover {
  background: var(--gallery-accent) !important;
  color: var(--gallery-card-bg) !important;
  transform: scale(1.04) !important;
  box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25) !important;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item,
article.gallery-item,
#gallery article {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(n+4) { animation-delay: 0.2s; }

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  article.gallery-item,
  #gallery article {
    animation: none;
  }

  .gallery-item:hover,
  article.gallery-item:hover,
  #gallery article:hover {
    transform: none !important;
  }

  .gallery-image,
  .gallery-item img {
    transition: none !important;
  }
}

/* ── Responsive ──────────────────────────────────────────────– */
@media (max-width: 768px) {
  #gallery,
  .gallery-section {
    padding: 60px 20px !important;
  }

  .gallery-header {
    margin-bottom: 40px;
  }

  .gallery-title,
  #gallery h2 {
    font-size: 36px !important;
  }

  .gallery-filters {
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .gallery-title,
  #gallery h2 {
    font-size: 28px !important;
  }

  .gallery-item,
  article.gallery-item,
  #gallery article {
    border-radius: 24px !important;
  }

  .gallery-content,
  article > div:last-child {
    padding: 16px 14px !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .gallery-title-item,
  article h3 {
    font-size: 18px !important;
  }
}
