/* ═══════════════════════════════════════════════════
   GALLERY PAGE
   Ported verbatim from the static gallery page. No path rewrites needed —
   the hero background is an <img>, not a CSS url().
   ═══════════════════════════════════════════════════ */
    /* ── Hero ── */
    .gal-hero {
      position: relative;
      min-height: min(70vh, 700px);
      display: flex;
      align-items: flex-end;
      overflow: hidden;
      background: #0A0A0A;
    }

    .gal-hero__bg {
      position: absolute;
      inset: 0;
    }

    .gal-hero__bg img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 40%;
      opacity: 0.3;
    }

    .gal-hero__overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(
        to top,
        rgba(10, 10, 10, 1) 0%,
        rgba(10, 10, 10, 0.7) 30%,
        rgba(10, 10, 10, 0.3) 60%,
        rgba(10, 10, 10, 0.15) 100%
      );
    }

    .gal-hero__glow {
      position: absolute;
      bottom: -20%;
      left: -10%;
      width: 700px;
      height: 700px;
      border-radius: 9999px;
      filter: blur(160px);
      background: radial-gradient(ellipse at center, rgba(206, 68, 5, 0.12) 0%, transparent 70%);
      pointer-events: none;
    }

    .gal-hero__content {
      position: relative;
      z-index: 2;
      width: 100%;
      max-width: var(--max-width);
      margin: 0 auto;
      padding: 0 clamp(1.5rem, 4vw, 2rem) 5rem;
    }

    .gal-hero__eyebrow {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-bottom: 2rem;
    }

    .gal-hero__eyebrow-line {
      width: 48px;
      height: 2px;
      background: var(--color-primary);
    }

    .gal-hero__eyebrow-text {
      font-size: 0.8125rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.24em;
      color: var(--color-primary);
    }

    .gal-hero__title {
      font-size: clamp(2.8rem, 7vw, 5.5rem);
      font-weight: 900;
      line-height: 0.95;
      letter-spacing: -0.05em;
      color: #fff;
      margin: 0 0 1.5rem;
    }

    .gal-hero__title-accent {
      display: block;
      color: var(--color-primary);
    }

    .gal-hero__body {
      max-width: 640px;
      font-size: clamp(1rem, 1.6vw, 1.125rem);
      line-height: 1.7;
      color: rgba(255, 255, 255, 0.6);
      margin: 0;
    }

    /* ── Layout: Sidebar + Grid ── */
    .gal-layout {
      background: var(--color-cream);
      padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2rem) clamp(5rem, 10vw, 8rem);
    }

    .gal-layout__inner {
      max-width: var(--max-width);
      margin: 0 auto;
      display: grid;
      grid-template-columns: 240px 1fr;
      gap: clamp(2rem, 4vw, 3.5rem);
    }

    /* ── Sidebar ── */
    .gal-sidebar {
      align-self: stretch;
    }

    .gal-sidebar__sticky {
      position: sticky;
      top: 6.5rem;
    }

    .gal-sidebar__label {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: rgba(0, 0, 0, 0.4);
      margin: 0 0 1.25rem;
      padding-left: 0.75rem;
    }

    .gal-filter-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 0.125rem;
    }

    .gal-filter-item {
      width: 100%;
      display: grid;
      grid-template-columns: 3px 1fr auto;
      align-items: center;
      gap: 0.75rem;
      padding: 0.625rem 0.75rem;
      background: transparent;
      border: 0;
      font-family: var(--font-sans);
      font-size: 0.875rem;
      font-weight: 500;
      color: #555;
      cursor: pointer;
      text-align: left;
      border-radius: 0 6px 6px 0;
      transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
    }

    .gal-filter-item__indicator {
      width: 3px;
      height: 1.25rem;
      border-radius: 2px;
      background: transparent;
      transition: background 0.25s var(--ease-out);
    }

    .gal-filter-item__name {
      white-space: nowrap;
    }

    .gal-filter-item__count {
      font-size: 0.75rem;
      font-weight: 600;
      color: rgba(0, 0, 0, 0.32);
      font-variant-numeric: tabular-nums;
      transition: color 0.25s var(--ease-out);
    }

    .gal-filter-item:hover {
      color: var(--color-primary);
      background: rgba(0, 0, 0, 0.03);
    }

    .gal-filter-item.is-active {
      color: var(--color-primary);
      font-weight: 700;
      background: rgba(206, 68, 5, 0.06);
    }

    .gal-filter-item.is-active .gal-filter-item__indicator {
      background: var(--color-primary);
    }

    .gal-filter-item.is-active .gal-filter-item__count {
      color: var(--color-primary);
    }

    /* ── Gallery Grid ── */
    .gal-grid {
      columns: 3;
      column-gap: 1rem;
    }

    @media (max-width: 1200px) { .gal-grid { columns: 2; } }
    @media (max-width: 480px) { .gal-grid { columns: 1; } }

    .gal-item {
      break-inside: avoid;
      margin-bottom: 1rem;
      border-radius: 0.75rem;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      transition: transform 0.4s var(--ease-out), opacity 0.4s ease;
    }

    .gal-item:hover {
      transform: translateY(-4px);
    }

    .gal-item:hover .gal-item__overlay {
      opacity: 1;
    }

    .gal-item.is-hidden {
      display: none;
    }

    .gal-item img {
      width: 100%;
      height: auto;
      display: block;
    }

    .gal-item__overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
      opacity: 0;
      transition: opacity 0.3s ease;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 1.25rem;
    }

    .gal-item__title {
      font-size: 0.8125rem;
      font-weight: 700;
      color: #fff;
      margin: 0 0 0.25rem;
    }

    .gal-item__cat {
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--color-primary);
    }

    .gal-item__zoom {
      position: absolute;
      top: 1rem;
      right: 1rem;
      width: 2.25rem;
      height: 2.25rem;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }

    /* ── Lightbox ── */
    .gal-lightbox {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: rgba(0, 0, 0, 0.95);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.4s ease, visibility 0.4s ease;
      backdrop-filter: blur(20px);
    }

    .gal-lightbox.is-open {
      opacity: 1;
      visibility: visible;
    }

    .gal-lightbox__close {
      position: absolute;
      top: 1.5rem;
      right: 1.5rem;
      width: 3rem;
      height: 3rem;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      transition: background 0.3s ease;
      z-index: 10;
    }

    .gal-lightbox__close:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .gal-lightbox__img-wrap {
      max-width: 90vw;
      max-height: 85vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .gal-lightbox__img-wrap img {
      max-width: 100%;
      max-height: 85vh;
      object-fit: contain;
      border-radius: 0.5rem;
      transition: transform 0.4s var(--ease-out), opacity 0.3s ease;
    }

    .gal-lightbox__caption {
      position: absolute;
      bottom: 2rem;
      left: 50%;
      transform: translateX(-50%);
      text-align: center;
      z-index: 10;
    }

    .gal-lightbox__caption-title {
      font-size: 1rem;
      font-weight: 700;
      color: #fff;
      margin: 0 0 0.25rem;
    }

    .gal-lightbox__caption-cat {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--color-primary);
    }

    .gal-lightbox__nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 3rem;
      height: 3rem;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      transition: background 0.3s ease;
      z-index: 10;
    }

    .gal-lightbox__nav:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .gal-lightbox__nav--prev { left: 1.5rem; }
    .gal-lightbox__nav--next { right: 1.5rem; }

    .gal-lightbox__counter {
      position: absolute;
      top: 1.75rem;
      left: 1.5rem;
      font-size: 0.8125rem;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.5);
      z-index: 10;
    }

    /* ── Animations for gallery items ── */
    @keyframes gal-fadeIn {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .gal-item {
      animation: gal-fadeIn 0.6s var(--ease-out) both;
    }

    .gal-item:nth-child(1) { animation-delay: 0.02s; }
    .gal-item:nth-child(2) { animation-delay: 0.06s; }
    .gal-item:nth-child(3) { animation-delay: 0.10s; }
    .gal-item:nth-child(4) { animation-delay: 0.14s; }
    .gal-item:nth-child(5) { animation-delay: 0.18s; }
    .gal-item:nth-child(6) { animation-delay: 0.22s; }
    .gal-item:nth-child(7) { animation-delay: 0.26s; }
    .gal-item:nth-child(8) { animation-delay: 0.30s; }

    /* ── Mobile: sidebar collapses to horizontal scroll ── */
    @media (max-width: 900px) {
      .gal-layout__inner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
      }
      .gal-sidebar__sticky { position: static; }
      .gal-sidebar__label { display: none; }
      .gal-filter-list {
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 0 0.5rem;
        margin: 0 calc(-1 * clamp(1.5rem, 4vw, 2rem));
        padding-left: clamp(1.5rem, 4vw, 2rem);
        padding-right: clamp(1.5rem, 4vw, 2rem);
      }
      .gal-filter-list::-webkit-scrollbar { display: none; }
      .gal-filter-item {
        flex-shrink: 0;
        width: auto;
        grid-template-columns: auto auto;
        gap: 0.5rem;
        padding: 0.5rem 0.9375rem;
        border-radius: 100px;
        border: 1.5px solid rgba(0, 0, 0, 0.12);
        font-size: 0.8125rem;
      }
      .gal-filter-item__indicator { display: none; }
      .gal-filter-item:hover {
        background: transparent;
        border-color: var(--color-primary);
      }
      .gal-filter-item.is-active {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: #fff;
      }
      .gal-filter-item.is-active .gal-filter-item__count {
        color: rgba(255, 255, 255, 0.75);
      }
    }