/*
  gallery.css — Styles for gallery.html (and shared filmstrip / lightbox)
  ────────────────────────────────────────────────────────────────────────
  Loaded AFTER main.css on gallery.html and causes.html.

  Section map:
    Hero              .gallery-hero
    Gallery body      .gallery-body / .gallery-row-wrap
    Row grid          .gallery-row  (side-by-side image + info)
    Info panel        .gallery-info + colour themes (.theme-*)
    Polaroid thumbs   .gallery-polaroids / .gallery-polaroid
    Filmstrip         .film-strip-wrap / .film-strip   ← shared with causes.html
    Lightbox          .film-lightbox                   ← shared with causes.html
    Bottom CTA        .gallery-cta
    Responsive        @media blocks at bottom

  ⚠️  The filmstrip and lightbox blocks are used by both gallery.html
      and causes.html. Do not move them to a page-specific file.
*/

/* ═══════════════════════════════════════════════
   GALLERY PAGE — redesigned row layout
   NOTE: filmstrip + lightbox rules are also used
   by causes.html — keep those sections intact.
═══════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────── */
.gallery-hero {
  background: linear-gradient(135deg, #f97316 0%, #ec4899 55%, #8b5cf6 100%);
  color: white;
  padding: 50px 0 39px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* confetti dots layer */
.gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.18) 2px, transparent 2px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* floating shapes */
.gallery-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 70%, rgba(255,255,255,0.12) 0%, transparent 35%),
    radial-gradient(circle at 88% 30%, rgba(255,220,80,0.15)  0%, transparent 30%);
  pointer-events: none;
}

.gallery-hero-inner {
  position: relative;
  z-index: 1;
}

.gallery-hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 13px;
}

.gallery-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(21px, 4.2vw, 36px);
  font-weight: 900;
  color: white;
  margin-bottom: 10px;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.gallery-hero h1 span {
  color: #fde68a;
}

.gallery-hero-sub {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  max-width: 520px;
  margin: 0 auto;
}

/* floating emoji decorations */
.gallery-hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

.gallery-hero-deco span {
  position: absolute;
  font-size: var(--sz, 2rem);
  left: var(--x);
  top: var(--y);
  transform: rotate(var(--r, 0deg));
  opacity: 0.22;
  line-height: 1;
}

/* ── Gallery body ───────────────────────────── */
.gallery-body {
  padding: 56px 0 80px;
}

/* subtle alternating row background */
.gallery-row-wrap:nth-child(even) {
  background: #fffbeb;
}

.gallery-row-wrap {
  padding: 16px 0;
}

/* ── Row grid ───────────────────────────────── */
.gallery-row {
  display: grid;
  grid-template-columns: 312px 1fr;
  min-height: unset;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.35s, transform 0.35s;
}

.gallery-row:hover {
  box-shadow: 0 20px 64px rgba(0,0,0,0.17), 0 4px 12px rgba(0,0,0,0.07);
  transform: translateY(-3px);
}

.gallery-row.flip {
  grid-template-columns: 1fr 312px;
}

.gallery-row.flip .gallery-info  { order: 2; }
.gallery-row.flip .gallery-media { order: 1; }

/* ── Info panel ─────────────────────────────── */
.gallery-info {
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* polka dot overlay */
.gallery-info::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.15) 2px, transparent 2px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

/* large background event number */
.gallery-info::after {
  content: var(--event-num, '');
  position: absolute;
  bottom: -14px;
  right: 8px;
  font-family: var(--font-head);
  font-size: 65px;
  font-weight: 900;
  color: rgba(255,255,255,0.09);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.gallery-info > * { position: relative; z-index: 1; }

/* ── Polaroid thumbnails ────────────────────── */
.gallery-polaroids {
  display: none;
}

.gallery-polaroid {
  position: absolute;
  width: 42px;
  height: 50px;
  object-fit: cover;
  background: white;
  padding: 3px;
  padding-bottom: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2);
  border-radius: 3px;
  transition: transform 0.25s;
}

.gallery-polaroid:nth-child(1) { left: 0;    top: 5px;  transform: rotate(-7deg); z-index: 1; }
.gallery-polaroid:nth-child(2) { left: 32px; top: 1px;  transform: rotate(3deg);  z-index: 2; }
.gallery-polaroid:nth-child(3) { left: 64px; top: 7px;  transform: rotate(-2deg); z-index: 1; }

.gallery-polaroids:hover .gallery-polaroid:nth-child(1) { transform: rotate(-12deg) translate(-6px, -4px); }
.gallery-polaroids:hover .gallery-polaroid:nth-child(2) { transform: rotate(0deg) translateY(-6px); }
.gallery-polaroids:hover .gallery-polaroid:nth-child(3) { transform: rotate(5deg) translate(6px, -4px); }

/* ── Event metadata ─────────────────────────── */
.gallery-event-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.gallery-event-icon {
  font-size: 14px;
  line-height: 1;
}

.gallery-event-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 3px 12px;
}

.gallery-event-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 900;
  color: white;
  line-height: 1.2;
  margin: 0 0 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.gallery-event-date {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0;
}

.gallery-event-desc {
  display: none;
}

.gallery-chips {
  display: none;
}

.gallery-chip {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Color themes ───────────────────────────── */
.gallery-info.theme-orange {
  background: linear-gradient(145deg, #c2410c 0%, #ea580c 60%, #f97316 100%);
}
.gallery-info.theme-blue {
  background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 60%, #3b82f6 100%);
}
.gallery-info.theme-fuchsia {
  background: linear-gradient(145deg, #831843 0%, #db2777 50%, #c026d3 100%);
}
.gallery-info.theme-emerald {
  background: linear-gradient(145deg, #064e3b 0%, #059669 60%, #10b981 100%);
}
.gallery-info.theme-rose {
  background: linear-gradient(145deg, #9f1239 0%, #e11d48 60%, #f43f5e 100%);
}

/* ── Media / filmstrip panel ────────────────── */
.gallery-media {
  position: relative;
  overflow: hidden;
  background: #111827;
}


.gallery-media-hint {
  position: absolute;
  bottom: 12px;
  right: 16px;
  z-index: 10;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
  pointer-events: none;
}

.gallery-media .film-strip-wrap {
  height: 100%;
  border-radius: 0;
  padding: 10px 0;
}

.gallery-media .film-strip-wrap::before {
  inset: 10px 0;
}

.gallery-media .film-strip img {
  height: 161px;
}

/* ══════════════════════════════════════════════
   FILMSTRIP — shared with causes.html
══════════════════════════════════════════════ */

.film-strip-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--text-dark);
  border-radius: var(--radius-md);
  padding: 10px 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      var(--text-dark) 28px,
      var(--text-dark) 34px
    );
  background-size: 34px 12px;
  background-position: top, bottom;
  background-repeat: repeat-x;
}

.film-strip-wrap::before {
  content: '';
  position: absolute;
  inset: 12px 0;
  background: #111827;
  z-index: 0;
}

.film-strip-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, #111827 60px, transparent 160px),
    linear-gradient(to left,  #111827 60px, transparent 160px);
  z-index: 2;
  pointer-events: none;
}

.film-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  padding: 0 60px;
  width: max-content;
}

.film-strip.running {
  animation: filmScroll linear infinite;
}


@keyframes filmScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.film-strip img {
  height: 161px;
  width: auto;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
  cursor: pointer;
}


.film-placeholder {
  height: 161px;
  min-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 0 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Lightbox overlay ───────────────────────── */
.film-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}

.film-lightbox.open { display: flex; }

.film-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.film-lightbox-close {
  position: absolute;
  top: max(24px, env(safe-area-inset-top, 24px));
  right: max(24px, env(safe-area-inset-right, 24px));
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  padding: 0;
  backdrop-filter: blur(4px);
}

.film-lightbox-close:hover { color: white; background: rgba(255,255,255,0.2); }

/* ── Bottom CTA ─────────────────────────────── */
.gallery-cta {
  text-align: center;
  padding: 52px 24px;
  background: linear-gradient(135deg, #f0f4fa 0%, #fdf8f0 100%);
  border-radius: 20px;
  border: 2px solid rgba(0,49,105,0.08);
  margin-top: 8px;
}

.gallery-cta h3 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-navy, #003169);
  margin-bottom: 10px;
}

.gallery-cta p {
  font-size: 15px;
  color: var(--text-mid, #64748b);
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 960px) {
  .gallery-row,
  .gallery-row.flip {
    grid-template-columns: 1fr;
    min-height: unset;
    transform: none !important;
  }

  .gallery-row.flip .gallery-info  { order: 0; }
  .gallery-row.flip .gallery-media { order: 1; }

  .gallery-info { padding: 28px 24px; }
  .gallery-info::after { font-size: 90px; }

  .gallery-media,
  .gallery-media .film-strip-wrap { min-height: unset; }
  .gallery-media .film-strip img { height: 117px; }
}

@media (max-width: 600px) {
  .gallery-hero  { padding: 52px 0 36px; }
  .gallery-hero-sub { font-size: 14px; }
  .gallery-hero-deco { display: none; }

  .gallery-body { padding: 32px 0 56px; }
  .gallery-row-wrap { padding: 20px 0; }

  .gallery-polaroids { height: 100px; }
  .gallery-polaroid  { width: 68px; height: 82px; }
  .gallery-polaroid:nth-child(2) { left: 52px; }
  .gallery-polaroid:nth-child(3) { left: 104px; }

  .gallery-event-title { font-size: 18px; }
  .gallery-event-desc  { font-size: 13px; }
  .gallery-info { padding: 24px 18px; }
  .gallery-info::after { display: none; }

  .film-strip img { height: 161px; }
  .film-placeholder { height: 161px; min-width: 260px; }
}
