/* ============================================================
   ADEA GALLERY — Premium Light Mode CSS  v3
   css/gallery.css  |  link after custom.css
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --gold-primary:    #dd9933;
  --gold-light:      #926624;
  --gold-dark:       #dd9933;
  --gold-shimmer:    #d6a761;
  --gold-pale:       rgba(184,136,42,0.08);

  --surface-page:    #F7F5F0;
  --surface-white:   #FFFFFF;
  --surface-card:    #EEEAE3;
  --border-subtle:   #DDD8CE;
  --border-mid:      #C4BDB0;
  --text-muted:      #8A8070;
  --text-body:       #5C5448;
  --text-heading:    #1A1612;

  --overlay-photo:   rgba(18,13,6,0.80);
  --overlay-bottom:  rgba(18,13,6,0.92);

  --gap:             clamp(10px, 1.4vw, 18px);
  --r-sm:            6px;
  --r-md:            12px;

  --ease-out:  cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in:   cubic-bezier(0.4, 0, 1, 1);
  --ease-both: cubic-bezier(0.4, 0, 0.2, 1);

  --fast:  0.20s var(--ease-both);
  --mid:   0.38s var(--ease-both);
  --slow:  0.65s var(--ease-out);

  --font-display: inherit;
  --font-ui:      'Onest','DM Sans',sans-serif;
}

/* ============================================================
   2. SCOPED RESET — box-sizing only, never nuke margins/padding
   ============================================================ */
.adea-gallery-page *,
.adea-gallery-page *::before,
.adea-gallery-page *::after { box-sizing: border-box; }

/* ============================================================
   3. STATS BAND
   ============================================================ */
.gallery-stats-band {
  background: var(--surface-white);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}

.gallery-stats-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(184,136,42,0.05) 0%, transparent 55%);
  pointer-events: none;
}

.gallery-stats-inner {
  display: grid;
  grid-template-columns: repeat(4,1fr);
}

.gallery-stat-item {
  padding: clamp(22px,3.5vw,44px) clamp(16px,2.5vw,36px);
  text-align: center;
  position: relative;
  border-right: 1px solid var(--border-subtle);
}

.gallery-stat-item:last-child { border-right: none; }

.gallery-stat-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 50%; height: 2px;
  background: linear-gradient(90deg,transparent,var(--gold-primary),transparent);
  transition: transform var(--mid);
}

.gallery-stat-item:hover::after { transform: translateX(-50%) scaleX(1); }

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.9rem,3.8vw,3.2rem);
  font-weight: 600;
  line-height: 1;
  color: var(--gold-primary);
  letter-spacing: -0.02em;
  display: block;
  margin: 0 0 7px 0;
  padding: 0;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: clamp(0.65rem,1.1vw,0.75rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin: 0; padding: 0;
}

/* ============================================================
   4. GALLERY SECTION WRAPPER
   ============================================================ */
.adea-gallery-section {
  background: var(--surface-page);
  padding-top:    clamp(48px,6vw,80px);
  padding-bottom: clamp(64px,8vw,120px);
  padding-left: 0; padding-right: 0;
  border-top: 3px solid var(--gold-primary);
}

/* ============================================================
   5. SECTION HEADINGS
   ============================================================ */
.gallery-section-head {
  text-align: center;
  margin: 0 0 clamp(32px,5vw,56px) 0;
  padding: 0;
}

.gallery-overline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin: 0 0 12px 0;
  padding: 0;
}

.gallery-overline::before,
.gallery-overline::after {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: var(--gold-dark);
  flex-shrink: 0;
}

.gallery-section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem,4.5vw,3.6rem);
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0; padding: 0;
}

.gallery-section-title em {
  font-style: italic;
  color: var(--gold-primary);
}

/* ============================================================
   6. FEATURED MOMENTS — cinematic 3-panel grid
   ============================================================ */
.gallery-featured-section {
  margin: 0 0 clamp(48px,6vw,80px) 0;
}

.gallery-featured-section .gallery-section-head {
  margin-bottom: clamp(24px,3.5vw,44px);
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  width: 100%;
  /* fix equal row heights */
  height: clamp(340px, 46vw, 620px);
}

.featured-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--surface-card);
  margin: 0; padding: 0;
  /* gold frame on hover */
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition: outline-color var(--fast), box-shadow var(--mid);
}

.featured-item:hover {
  outline-color: var(--gold-primary);
  box-shadow: 0 16px 48px rgba(184,136,42,0.18);
}

.featured-item--hero  { grid-row: 1 / 3; }
.featured-item--sm    { /* default */ }

.featured-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  margin: 0; padding: 0;
  transition: transform var(--slow);
  will-change: transform;
}

.featured-item:hover img { transform: scale(1.055); }

/* gradient vignette — always on, deeper at bottom */
.featured-item__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    175deg,
    transparent 20%,
    rgba(18,13,6,0.18) 55%,
    rgba(18,13,6,0.88) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: clamp(14px,2.2vw,26px);
  transition: background var(--mid);
}

.featured-item:hover .featured-item__overlay {
  background: linear-gradient(
    175deg,
    transparent 10%,
    rgba(18,13,6,0.28) 50%,
    rgba(18,13,6,0.95) 100%
  );
}

/* meta block — slides up on hover */
.featured-item__meta {
  transform: translateY(6px);
  transition: transform var(--mid);
  margin: 0; padding: 0;
}

.featured-item:hover .featured-item__meta { transform: translateY(0); }

.featured-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: var(--gold-primary);
  padding: 4px 10px;
  margin: 0 0 7px 0;
  border-radius: 3px;
  line-height: 1.5;
}

.featured-caption {
  font-family: var(--font-display);
  font-size: clamp(0.95rem,1.8vw,1.35rem);
  font-weight: 500;
  color: #F7F5F0;
  line-height: 1.25;
  margin: 0; padding: 0;
}

/* expand icon */
.featured-item__view-icon {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  background: rgba(184,136,42,0.22);
  border: 1px solid rgba(184,136,42,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-shimmer);
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.75) rotate(-8deg);
  transition: opacity var(--fast), transform var(--mid);
  backdrop-filter: blur(6px);
}

.featured-item:hover .featured-item__view-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ============================================================
   7. FILTER BAR
   ============================================================ */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(14px,2vw,22px) 0 0 0;
  margin-bottom: clamp(22px,3vw,36px);
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
}

.gallery-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.filter-tab {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 7px 17px;
  margin: 0;
  cursor: pointer;
  transition: all var(--fast);
  white-space: nowrap;
  outline: none;
  line-height: 1.4;
}

.filter-tab:hover {
  color: var(--gold-dark);
  border-color: var(--gold-primary);
  background: var(--gold-pale);
}

.filter-tab.active {
  color: #fff;
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(184,136,42,0.30);
}

.gallery-year-select {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-body);
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 7px 34px 7px 14px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238A8070' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  transition: border-color var(--fast);
  line-height: 1.4;
}

.gallery-year-select:hover,
.gallery-year-select:focus { border-color: var(--gold-primary); }

/* ============================================================
   8. MASONRY GRID — upgraded visual system
   ============================================================ */
.gallery-masonry {
  columns: 4;
  column-gap: var(--gap);
  padding-bottom: clamp(8px,1vw,14px);
}

@media (max-width: 1199px) { .gallery-masonry { columns: 3; } }
@media (max-width: 767px)  { .gallery-masonry { columns: 2; } }
@media (max-width: 479px)  { .gallery-masonry { columns: 1; } }

/* ── Base card ─────────────────────────────────────────────── */
.gallery-card {
  break-inside: avoid;
  margin: 0 0 var(--gap) 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--surface-card);
  display: block;
  /* subtle warm shadow on light bg */
  box-shadow:
    0 1px 3px rgba(100,75,20,0.07),
    0 4px 12px rgba(100,75,20,0.06);
  transition:
    transform   var(--mid),
    box-shadow  var(--mid),
    outline-color var(--fast);
  /* gold frame */
  outline: 2px solid transparent;
  outline-offset: -2px;
}

/* ── Lift & gold frame on hover ────────────────────────────── */
.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 6px 20px rgba(184,136,42,0.14),
    0 16px 40px rgba(100,75,20,0.10);
  outline-color: var(--gold-primary);
  z-index: 2;
}

/* ── Every 5th card: taller visual weight ──────────────────── */
.gallery-card:nth-child(5n+1) {
  border-radius: var(--r-md) var(--r-md) var(--r-md) var(--r-md);
}

.gallery-card.hidden  { display: none; }
.gallery-card.fade-out { opacity: 0; transform: scale(0.97); }

/* ── Image ─────────────────────────────────────────────────── */
.gallery-card img {
  width: 100%; height: auto;
  display: block;
  margin: 0; padding: 0;
  vertical-align: bottom;
  transition: transform var(--slow);
  will-change: transform;
}

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

/* lazy fade-in */
.gallery-card img.lazy {
  opacity: 0;
  background: var(--surface-card);
  min-height: 160px;
  transition: opacity var(--mid);
}
.gallery-card img.lazy.loaded { opacity: 1; }

/* ── Overlay: dark bottom gradient + full-cover on hover ───── */
.gallery-card__overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  /* resting state: subtle bottom vignette so cards have depth */
  background: linear-gradient(
    180deg,
    transparent 48%,
    rgba(18,13,6,0.55) 80%,
    rgba(18,13,6,0.88) 100%
  );
  transition: background var(--mid);
}

.gallery-card:hover .gallery-card__overlay {
  background: linear-gradient(
    180deg,
    rgba(18,13,6,0.15) 0%,
    rgba(18,13,6,0.55) 55%,
    rgba(18,13,6,0.93) 100%
  );
}

/* ── Caption block at the bottom of every card ─────────────── */
.gallery-card__caption {
  padding: clamp(10px,1.8vw,16px) clamp(10px,1.8vw,16px) clamp(12px,2vw,18px);
  transform: translateY(6px);
  opacity: 0;
  transition:
    transform var(--mid),
    opacity   var(--mid);
  margin: 0;
}

.gallery-card:hover .gallery-card__caption {
  transform: translateY(0);
  opacity: 1;
}

/* category pill inside caption */
.gallery-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-shimmer);
  background: rgba(184,136,42,0.22);
  border: 1px solid rgba(184,136,42,0.35);
  border-radius: 100px;
  padding: 3px 9px;
  margin: 0 0 6px 0;
  line-height: 1.5;
  backdrop-filter: blur(4px);
}

.gallery-card__pill i {
  font-size: 0.55rem;
  opacity: 0.85;
}

/* card title text */
.gallery-card__title {
  font-family: var(--font-display);
  font-size: clamp(0.82rem,1.4vw,1.05rem);
  font-weight: 500;
  color: #F0EDE8;
  line-height: 1.3;
  margin: 0; padding: 0;
  /* prevent overflow on narrow cards */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Top-right expand icon ─────────────────────────────────── */
.gallery-card__icon {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 1px solid rgba(184,136,42,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-shimmer);
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.7) rotate(-12deg);
  transition: opacity var(--fast), transform var(--mid);
  backdrop-filter: blur(6px);
  background: rgba(18,13,6,0.35);
  margin: 0; padding: 0;
  flex-shrink: 0;
}

.gallery-card:hover .gallery-card__icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ── Gold accent stripe — thin line at card bottom ─────────── */
.gallery-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-primary) 30%,
    var(--gold-light) 50%,
    var(--gold-primary) 70%,
    transparent 100%
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s var(--ease-out);
  z-index: 3;
}

.gallery-card:hover::before { transform: scaleX(1); }

/* ── Shimmer-border pseudo on hover (::after) ──────────────── */
.gallery-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--r-md);
  /* inner highlight ring */
  box-shadow: inset 0 0 0 1.5px rgba(184,136,42,0);
  transition: box-shadow var(--fast);
  pointer-events: none;
  z-index: 4;
}

.gallery-card:hover::after {
  box-shadow: inset 0 0 0 1.5px rgba(184,136,42,0.45);
}

/* ============================================================
   9. FEATURED — small screens override
      On tablet the small panels use their own aspect-ratio
   ============================================================ */
@media (max-width: 991px) {
  .featured-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
  .featured-item--hero { aspect-ratio: 16/9; }
  .featured-item--sm   { aspect-ratio: 16/7; }
}

/* ============================================================
   10. LOADING STATE
   ============================================================ */
.gallery-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  flex-direction: column;
  gap: 18px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

.gallery-spinner {
  width: 38px; height: 38px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   11. EMPTY STATE
   ============================================================ */
.gallery-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  display: none;
  margin: 0;
}

.gallery-empty i {
  font-size: 2.2rem;
  color: var(--border-mid);
  margin: 0 0 14px 0;
  display: block;
}

.gallery-empty p {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  margin: 0; padding: 0;
}

/* ============================================================
   12. LOAD MORE
   ============================================================ */
.gallery-load-more-wrap {
  text-align: center;
  margin: clamp(32px,5vw,52px) 0 0 0;
  padding: 0;
}

.btn-gallery-load {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-primary);
  background: transparent;
  border: 1.5px solid var(--gold-primary);
  border-radius: 100px;
  padding: 12px 34px;
  margin: 0;
  cursor: pointer;
  transition: all var(--fast);
  outline: none;
  line-height: 1.4;
}

.btn-gallery-load:hover {
  color: #fff;
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 20px rgba(184,136,42,0.28);
  transform: translateY(-1px);
}

.btn-gallery-load:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-gallery-load .load-spinner {
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
  margin: 0; padding: 0;
}

.btn-gallery-load.loading .load-spinner { display: block; }
.btn-gallery-load.loading .load-text   { display: none; }

/* ============================================================
   13. LIGHTBOX (Magnific Popup)
   ============================================================ */
.mfp-bg {
  background: rgba(14,10,5,0.97) !important;
  opacity: 1 !important;
}

.mfp-container { padding: 20px !important; }

.mfp-image-holder .mfp-content {
  max-width: min(1200px, 95vw);
}

.mfp-figure figure {
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(184,136,42,0.22);
}

.mfp-figure::after { display: none !important; }

.mfp-bottom-bar {
    display: flex !important;
    justify-content: space-between !important;
  padding: 10px 10px 0 !important;
  font-family: var(--font-ui) !important;
}

.mfp-title {
  color: #C8C0B4 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.08em !important;
  font-family: var(--font-ui) !important;
}

.mfp-counter {
  color: var(--gold-primary) !important;
  position: relative;
  font-family: var(--font-ui) !important;
  font-size: 0.76rem !important;
}

.mfp-arrow { opacity: 0.85 !important; }
.mfp-arrow::before,
.mfp-arrow::after { border-color: var(--gold-primary) !important; }

.mfp-close {
  color: var(--gold-primary) !important;
  font-size: 1.6rem !important;
  opacity: 0.8 !important;
  transition: opacity var(--fast) !important;
}
.mfp-close:hover { opacity: 1 !important; }

/* ============================================================
   14. FOCUS / ACCESSIBILITY
   ============================================================ */
.gallery-card:focus-visible,
.filter-tab:focus-visible,
.btn-gallery-load:focus-visible,
.featured-item:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 3px;
}

/* ============================================================
   15. RESPONSIVE — TABLET ≤991px
   ============================================================ */
@media (max-width: 991px) {
  .gallery-stats-inner { grid-template-columns: repeat(2,1fr); }

  .gallery-stat-item:nth-child(2),
  .gallery-stat-item:nth-child(4) { border-right: none; }

  .gallery-stat-item:nth-child(1),
  .gallery-stat-item:nth-child(2) { border-bottom: 1px solid var(--border-subtle); }
}

/* ============================================================
   16. RESPONSIVE — MOBILE ≤575px
   ============================================================ */
@media (max-width: 575px) {
  .gallery-stats-inner { grid-template-columns: repeat(2,1fr); }

  .gallery-stat-item:nth-child(2),
  .gallery-stat-item:nth-child(4) { border-right: none; }

  .gallery-stat-item:nth-child(1),
  .gallery-stat-item:nth-child(2) { border-bottom: 1px solid var(--border-subtle); }

  .gallery-stat-item { padding: 18px 10px; }

  .gallery-filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 14px;
  }

  .gallery-filter-tabs { gap: 4px; width: 100%; }

  .filter-tab { font-size: 0.68rem; padding: 6px 13px; }

  .gallery-year-select { width: 100%; }

  .gallery-section-head { margin-bottom: clamp(22px,4vw,36px); }

  .gallery-masonry { columns: 1; }

  .mfp-arrow-left  { left:  0 !important; }
  .mfp-arrow-right { right: 0 !important; }
}

/* ============================================================
   17. PRINT
   ============================================================ */
@media print {
  .adea-gallery-section,
  .gallery-stats-band { display: none !important; }
}