/* ══════════════════════════════════════════
   Corporate Stories — Gallery Styles
   gallery.css
══════════════════════════════════════════ */

:root {
  --black:     #0a0a0a;
  --white:     #f5f4f0;
  --light-bg:  #f0efeb;
  --dark-bg:   #111110;
  --dark-card: #1a1918;
  --dark-border: #2a2926;
  --mid-gray:  #c8c6c0;
  --dim:       #888;
  --border:    #e0dfd9;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark-bg);
  color: var(--white);
  overflow-x: hidden;
  cursor: none;
}

/* ── GRAIN OVERLAY ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9998; opacity: 0.35;
}

/* ── CUSTOM CURSOR ── */
.cursor {
  width: 10px; height: 10px;
  background: var(--white);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease, width 0.25s ease, height 0.25s ease, background 0.25s ease;
  transform: translate(-50%, -50%);
}
.cursor.expanded {
  width: 48px; height: 48px;
  background: transparent;
  border: 1.5px solid var(--white);
}
.cursor.lightbox-open { background: var(--white); border-color: var(--white); }

/* ── NAVBAR ── */
.navbar {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--dark-border);
  background: var(--dark-bg);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 0.75rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--white) !important;
}
.nav-link {
  font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #555 !important;
  padding: 0 1.1rem !important; transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--white) !important; }

/* ── GALLERY HERO ── */
.gallery-hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--dark-border);
  overflow: hidden;
}
.gallery-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2rem;
}
.hero-eyebrow {
  font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #555;
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.hero-eyebrow::before {
  content: ''; display: inline-block;
  width: 28px; height: 1px; background: #333;
}
.gallery-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 900; line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--white);
}
.gallery-hero h1 em {
  font-style: italic;
  color: #444;
}
.hero-meta { text-align: right; }
.hero-count {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem; font-weight: 900;
  color: #222; line-height: 1;
}
.hero-count-label {
  font-size: 0.65rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: #444;
  margin-top: 0.3rem;
}

/* ── FILTER BAR ── */
.filter-bar {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--dark-border);
  position: sticky; top: 61px; z-index: 90;
  background: var(--dark-bg);
}
.filter-tabs {
  display: flex; gap: 0; flex-wrap: wrap;
}
.filter-btn {
  background: none; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: #444;
  padding: 0.5rem 1.4rem 0.5rem 0;
  cursor: none;
  position: relative;
  transition: color 0.25s;
}
.filter-btn::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width 0.35s cubic-bezier(.77,0,.18,1);
}
.filter-btn:hover { color: var(--white); }
.filter-btn.active { color: var(--white); }
.filter-btn.active::after { width: calc(100% - 1.4rem); }

.filter-count {
  font-size: 0.55rem; vertical-align: super;
  margin-left: 2px; color: #333;
}

/* ── MASONRY GRID ── */
.gallery-section {
  padding: 3rem 0 5rem;
  background: var(--dark-bg);
}

.masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
}
@media (max-width: 991px) { .masonry-grid { column-count: 2; } }
@media (max-width: 575px)  { .masonry-grid { column-count: 1; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.masonry-item.visible  { opacity: 1; transform: translateY(0); }
.masonry-item.hidden   { display: none; }

/* ── GALLERY CARD ── */
.gallery-card {
  position: relative; overflow: hidden;
  background: var(--dark-card);
  cursor: none;
}
.gallery-card-img {
  width: 100%; display: block;
  transition: transform 0.6s cubic-bezier(.25,.46,.45,.94);
  object-fit: cover;
}
.img-ph {
  width: 100%;
  background: linear-gradient(135deg, #1e1d1b 0%, #161514 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.4rem;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #333;
}
.img-ph svg { width: 28px; height: 28px; opacity: 0.25; }

.gallery-card:hover .gallery-card-img,
.gallery-card:hover .img-ph {
  transform: scale(1.04);
}

/* Card Overlay */
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem;
}
.gallery-card:hover .card-overlay { opacity: 1; }

.overlay-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  color: #fff; line-height: 1.2;
  transform: translateY(8px);
  transition: transform 0.35s ease;
}
.gallery-card:hover .overlay-title { transform: translateY(0); }

.overlay-sub {
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  margin-top: 0.3rem;
  transform: translateY(8px);
  transition: transform 0.4s ease;
}
.gallery-card:hover .overlay-sub { transform: translateY(0); }

.overlay-zoom {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.overlay-zoom svg { width: 14px; height: 14px; color: #fff; }
.gallery-card:hover .overlay-zoom { opacity: 1; }

/* Card Category Tag */
.card-tag {
  position: absolute; top: 1rem; left: 1rem;
  font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(10,10,10,0.75);
  color: #555;
  padding: 0.3rem 0.7rem;
  backdrop-filter: blur(4px);
}

/* Card Meta Below Image */
.card-meta-below { padding-top: 0.7rem; }
.card-meta-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem; font-weight: 700;
  color: var(--white);
}
.card-meta-loc { font-size: 0.7rem; color: #444; margin-top: 0.1rem; }
.card-meta-cat {
  font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: #333;
  float: right; padding-top: 0.15rem;
}

/* ── EMPTY STATE ── */
.empty-state {
  display: none;
  text-align: center;
  padding: 5rem 0;
  color: #444;
}
.empty-state.show { display: block; }
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 0.5rem;
  color: #555;
}

/* ── CTA STRIP ── */
.cta-strip {
  background: var(--black);
  padding: 5rem 0;
}
.cta-strip-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900; color: var(--white); line-height: 1.1;
}
.btn-cta-strip {
  background: transparent; color: var(--white);
  border: 1px solid #444;
  font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  display: inline-flex; align-items: center; gap: 0.6rem;
  cursor: none; text-decoration: none;
  transition: all 0.25s;
}
.btn-cta-strip:hover { background: var(--white); color: var(--black); border-color: var(--white); }

/* ── FOOTER ── */
.site-footer {
  background: var(--black);
  border-top: 1px solid #1a1a1a;
  padding: 2rem 0;
}
.footer-brand {
  font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #555;
}
.footer-copy { font-size: 0.65rem; color: #444; }
.footer-links a {
  font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #555;
  text-decoration: none; margin-left: 1.5rem;
  transition: color 0.2s; cursor: none;
}
.footer-links a:hover { color: #aaa; }

/* ── LIGHTBOX ── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,8,0.97);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }

.lightbox-inner {
  position: relative;
  width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.lightbox-img-wrap {
  flex: 1 1 0;
  min-width: 0;
  transform: scale(0.93);
  transition: transform 0.45s cubic-bezier(.25,.46,.45,.94);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.lightbox-overlay.open .lightbox-img-wrap { transform: scale(1); }

.lightbox-img-wrap img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
}

.lightbox-img-wrap .lb-ph {
  display: block;
  width: 100%;
}

.lb-ph {
  width: 100%;
  /* height: 55vh;
  background: #1a1a1a; */
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem;
  color: #444;
}
.lb-ph svg { width: 40px; height: 40px; }

/* Placeholder inner (rendered by JS) */
.lb-ph-inner {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; color: #444;
  width: 100%; height: 100%;
}
.lb-ph-inner svg { width: 40px; height: 40px; }
.lb-ph-inner span {
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; text-align: center;
  padding: 0 1rem;
}

/* ── THUMBNAIL STRIP ── */
.lb-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.lb-thumbs::-webkit-scrollbar { display: none; }

.lb-thumb {
  flex: 0 0 52px; height: 36px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  cursor: none;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s;
  position: relative;
}
.lb-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.lb-thumb-ph {
  display: block;
  width: 100%; height: 100%;
  background: #252525;
}
.lb-thumb:hover { border-color: #555; }
.lb-thumb:hover img { opacity: 0.8; }
.lb-thumb.active { border-color: var(--white); }
.lb-thumb.active img { opacity: 1; }
.lb-thumb.active .lb-thumb-ph { background: #444; }

.lightbox-info {
  flex: 0 0 260px;
  width: 260px;
  color: var(--white);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.45s ease 0.15s, transform 0.45s ease 0.15s;
  align-self: center;
}
.lightbox-overlay.open .lightbox-info { opacity: 1; transform: translateX(0); }

.lb-cat {
  font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #666;
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.lb-cat::before {
  content: ''; display: inline-block;
  width: 20px; height: 1px; background: #444;
}
.lb-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 900; line-height: 1.1;
  margin-bottom: 0.5rem;
}
.lb-location { font-size: 0.78rem; color: #888; margin-bottom: 1.4rem; }
.lb-desc {
  font-size: 0.8rem; color: #666; line-height: 1.75;
  border-top: 1px solid #222; padding-top: 1.2rem;
}

/* Photo caption — changes per photo */
.lb-caption {
  font-size: 0.72rem; color: #555;
  font-style: italic;
  margin-top: 1rem;
  min-height: 1.2em;
}

.lb-counter {
  font-size: 0.62rem; letter-spacing: 0.14em;
  color: #555; margin-top: 1.2rem;
}
.lb-counter span { color: #888; }
.lb-counter-label {
  display: block;
  font-size: 0.58rem; letter-spacing: 0.12em;
  color: #333; margin-top: 0.2rem;
  text-transform: uppercase;
}

/* Lightbox Buttons */
.lb-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid #333;
  color: #666; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: none; transition: all 0.2s; z-index: 1001;
}
.lb-nav:hover { border-color: #fff; color: #fff; }
.lb-nav.prev { left: 1.5rem; }
.lb-nav.next { right: 1.5rem; }
.lb-nav svg { width: 16px; height: 16px; }

.lb-close {
  position: fixed; top: 1.5rem; right: 1.5rem;
  background: none; border: 1px solid #333;
  color: #666; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: none; transition: all 0.2s; z-index: 1001;
}
.lb-close:hover { border-color: #fff; color: #fff; }
.lb-close svg { width: 16px; height: 16px; }

/* ── PAGE ENTER ANIMATION ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeUp 0.7s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ══════════════════════════════════════════
   MOBILE & TOUCH FIXES
══════════════════════════════════════════ */

/* ── Hide custom cursor on touch devices ── */
@media (hover: none) and (pointer: coarse) {
  .cursor { display: none; }
  body { cursor: auto; }
  .filter-btn, .gallery-card, .btn-cta-strip,
  .footer-links a, .lb-nav, .lb-close { cursor: pointer; }
}

/* ── Always show card overlay info on touch (no hover) ── */
@media (hover: none) {
  .card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 45%);
  }
  .overlay-title, .overlay-sub {
    transform: translateY(0);
    opacity: 1;
  }
  .overlay-zoom { display: none; }
  .card-tag { display: none; }
}

/* ── Tablet (max 768px) ── */
@media (max-width: 768px) {

  /* Hero */
  .gallery-hero { padding: 3rem 0 2.5rem; }
  .gallery-hero-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .hero-meta { text-align: left; }
  .hero-count { font-size: 2.2rem; }

  /* Filter bar — scrollable horizontal strip */
  .filter-bar {
    padding: 1.2rem 0 1.4rem;
    top: 56px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tabs {
    flex-wrap: nowrap;
    width: max-content;
    padding-bottom: 4px;
  }
  .filter-btn {
    font-size: 0.68rem;
    padding: 0.4rem 1.2rem 0.4rem 0;
    white-space: nowrap;
  }

  /* Gallery section */
  .gallery-section { padding: 2rem 0 3.5rem; }

  /* Card meta */
  .card-meta-title { font-size: 0.85rem; }
  .card-meta-loc   { font-size: 0.68rem; }

  /* Lightbox — stack vertically on tablet */
  .lightbox-inner {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 4rem 1rem 2rem;
    overflow-y: auto;
    max-height: 100vh;
  }
  .lightbox-img-wrap {
    max-width: 90vw;
  }
  .lightbox-img-wrap img {
    max-width: 90vw;
    max-height: 45vh;
    width: auto;
    height: auto;
  }
  .lb-ph { width: 90vw; height: 260px; }
  .lightbox-info {
    flex: none;
    width: 90vw;
    transform: translateY(10px);
    transition: opacity 0.45s ease 0.15s, transform 0.45s ease 0.15s;
  }
  .lightbox-overlay.open .lightbox-info {
    opacity: 1;
    transform: translateY(0);
  }
  .lb-title { font-size: 1.4rem; }
  .lb-desc  { font-size: 0.78rem; }

  /* Lightbox nav buttons — bottom of screen */
  .lb-nav {
    top: auto;
    bottom: 1.5rem;
    transform: none;
    border-color: #444;
    width: 40px; height: 40px;
  }
  .lb-nav.prev { left: 1.5rem; }
  .lb-nav.next { right: 1.5rem; }
  .lb-close { top: 1rem; right: 1rem; }

  /* CTA strip */
  .cta-strip { padding: 3.5rem 0; }
  .cta-strip-title { font-size: 1.8rem; }
  .btn-cta-strip { width: 100%; justify-content: center; margin-top: 0.5rem; }

  /* Footer */
  .footer-links { margin-top: 0.5rem; }
  .footer-links a { margin-left: 0; margin-right: 1.2rem; }
}

/* ── Small mobile (max 480px) ── */
@media (max-width: 480px) {

  .gallery-hero { padding: 2.5rem 0 2rem; }
  .gallery-hero h1 { font-size: 2.4rem; }

  /* Single column already set at 575px — just tighten spacing */
  .masonry-item { margin-bottom: 1rem; }
  .gallery-section { padding: 1.5rem 0 3rem; }

  /* Make image placeholders shorter on small screens */
  .img-ph[style*="height:420px"] { height: 260px !important; }
  .img-ph[style*="height:460px"] { height: 280px !important; }
  .img-ph[style*="height:390px"] { height: 240px !important; }
  .img-ph[style*="height:350px"] { height: 220px !important; }
  .img-ph[style*="height:320px"] { height: 200px !important; }
  .img-ph[style*="height:300px"] { height: 190px !important; }
  .img-ph[style*="height:280px"] { height: 180px !important; }
  .img-ph[style*="height:270px"] { height: 175px !important; }

  /* Lightbox */
  .lightbox-img-wrap { max-height: 45vh; }
  .lb-ph { height: 200px; }
  .lb-title { font-size: 1.2rem; }
  .lb-desc  { display: none; } /* too much text on tiny screens */

  /* Swipe hint on lightbox */
  .lb-nav { display: flex; } /* keep arrows visible for non-swipe users */
}