/* ============================================================
   KOS WEDDING MEMORIES — STYLE.CSS
   Design System & Component Styles
   ============================================================

   TABLE OF CONTENTS:
   1.  CSS Custom Properties (Design Tokens)
   2.  Reset & Base Styles
   3.  Google Fonts Import
   4.  Layout & Scroll Behaviour
   5.  Hero / Header Section
   6.  Navigation Tabs
   7.  Grid Control Panel
   8.  Photo Grid — Default (4-column)
   9.  Photo Grid — 2-column variant
   10. Photo Grid — Masonry variant
   11. Photo Card & Hover Effects
   12. Lightbox Overlay
   13. Lightbox Controls (Nav, Slideshow, Download, Fullscreen)
   14. Toast Notifications
   15. Loading Spinner
   16. Responsive Breakpoints
   17. Particle / Sparkle Animation (Hero)
   ============================================================ */


/* ── Hide Netlify "Powered by" badge injected on deployed sites ── */
/* Selectors observed in DevTools: button#nl-badge.nl-badge inside section.nl-card / div.nl-wrap */
#nl-badge,
.nl-badge,
.nl-card,
.nl-wrap,
[id="nl-badge"],
[class~="nl-badge"],
[data-netlify-badge],
#netlify-badge,
.netlify-badge,
[class*="netlify-badge"],
[id*="netlify-badge"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   Edit these variables to reskin the entire app.
   ============================================================ */
:root {
  /* Color Palette */
  --color-bg:           #111010;       /* main page background      */
  --color-surface:      #1c1b1b;       /* card / panel background   */
  --color-surface-2:    #252424;       /* elevated surface          */
  --color-border:       #2e2d2d;       /* subtle borders            */
  --color-gold:         #c9a84c;       /* primary accent — gold     */
  --color-gold-light:   #e8c97a;       /* lighter gold for hover    */
  --color-gold-dark:    #8c6f28;       /* darker gold for gradients */
  --color-silver:       #b8b0a0;       /* secondary accent — silver */
  --color-cream:        #f0e8d8;       /* primary text colour       */
  --color-muted:        #7a7060;       /* muted / secondary text    */
  --color-white:        #ffffff;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light), var(--color-gold));
  --gradient-hero: linear-gradient(180deg, #0a0908 0%, #1a1510 40%, #111010 100%);

  /* Typography */
  --font-display:  'Cormorant Garamond', Georgia, serif;   /* headings       */
  --font-body:     'Inter', system-ui, sans-serif;          /* body text      */

  /* Font sizes (fluid) */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-hero:  clamp(2.5rem, 8vw, 5.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.7);
  --shadow-gold: 0 0 20px rgba(201, 168, 76, 0.3);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   280ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Grid — default column count. See app.js for the JS-side constant.
     CHANGE THE GRID DEFAULT HERE: update the number in repeat(N, ...) below */
  --grid-cols: 4;  /* ← DEFAULT GRID COLUMNS — change this value to 2, 3, or 4 */
}


/* ============================================================
   2. RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  /* Subtle grain texture via SVG data URI */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}


/* ============================================================
   3. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-gold-dark); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }


/* ============================================================
   4. HERO / HEADER SECTION
   ============================================================ */
#hero {
  position: relative;
  width: 100%;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: var(--gradient-hero);
  overflow: hidden;
}

/* Radial gold glow in the centre of the hero */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%,
    rgba(201, 168, 76, 0.08) 0%,
    transparent 70%);
  pointer-events: none;
}

/* Decorative top border shimmer */
#hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-gold);
  opacity: 0.6;
}

/* ── Hero particle canvas (JS draws here) ── */
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;        /* sits below all hero text */
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.5;
}

/* All direct hero text children sit above the canvas */
#hero > *:not(#particle-canvas) {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-6);
  opacity: 1;  /* always visible — animation is purely a slide-in enhancement */
  animation: heroReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.05;
  color: var(--color-cream);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
  opacity: 1;
  animation: heroReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both;
}

.hero-title .ampersand {
  color: var(--color-gold);
  font-style: italic;
}

/* ── Animated gold divider ── */
.hero-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) auto;
  width: min(400px, 80%);
  opacity: 1;
  animation: heroReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}

.hero-divider-line {
  flex: 1;
  height: 1px;
  background: var(--gradient-gold);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep animation on the divider line */
.hero-divider-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmerSweep 3s ease-in-out 1.5s infinite;
}

.hero-divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--color-gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
}

.hero-dates {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 300;
  font-style: italic;
  color: var(--color-silver);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  opacity: 1;
  animation: heroReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.45s both;
}

.hero-subtitle {
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-12);
  opacity: 1;
  animation: heroReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

.hero-scroll-cue {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 1;
  animation: heroReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.7s both;
}

.hero-scroll-cue span {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1px solid var(--color-gold);
  border-bottom: 1px solid var(--color-gold);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}


/* ============================================================
   5. MAIN APP CONTAINER
   ============================================================ */
#app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-16);
}


/* ============================================================
   6. NAVIGATION TABS
   ============================================================ */
#nav-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 16, 16, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 var(--space-8);
}

.tab-btn {
  position: relative;
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-base);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--color-cream);
}

.tab-btn.active {
  color: var(--color-gold);
}

/* Animated underline indicator */
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  transition: transform var(--transition-base);
}

.tab-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  padding: 2px 6px;
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-muted);
  transition: background var(--transition-base), color var(--transition-base);
}

.tab-btn.active .tab-count {
  background: rgba(201, 168, 76, 0.15);
  color: var(--color-gold);
}


/* ── More Info button (pinned to far-right of the sticky nav bar) ── */
.info-btn {
  position: absolute;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
  z-index: 10;
}
.info-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.info-btn:hover {
  color: var(--color-gold);
  background: rgba(201, 168, 76, 0.08);
  border-color: rgba(201, 168, 76, 0.35);
}

/* ── Hero variant: pinned to top-right corner of the hero ── */
.hero-info-btn {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 10;
}

/* On mobile keep it accessible in the top-right */
@media (max-width: 480px) {
  .hero-info-btn {
    top: var(--space-4);
    right: var(--space-4);
  }
}


/* ============================================================
   INFO MODAL — password-protected panel
   ============================================================ */
#info-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#info-modal.open {
  opacity: 1;
  pointer-events: all;
}

/* Dark blurred backdrop */
.info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 7, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Floating glass card */
.info-modal-box {
  position: relative;
  width: min(420px, 92vw);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8) var(--space-8);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(201, 168, 76, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#info-modal.open .info-modal-box {
  transform: translateY(0) scale(1);
}

/* Close X */
.info-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
}
.info-modal-close svg { width: 18px; height: 18px; }
.info-modal-close:hover { color: var(--color-cream); background: rgba(255,255,255,0.07); }

/* Icon at top of modal */
.info-modal-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-gold);
  margin-bottom: var(--space-2);
}
.info-modal-icon svg { width: 26px; height: 26px; }

/* Title & subtitle */
.info-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-cream);
  text-align: center;
  margin: 0;
}
.info-modal-subtitle {
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
  margin: 0;
}

/* Password input row */
.info-password-field {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-2);
}
#info-password-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
#info-password-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}
#info-password-input::placeholder { color: var(--color-muted); }

.info-submit-btn {
  padding: var(--space-3) var(--space-5);
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-md);
  color: #1a1500;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.info-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.info-submit-btn:active { transform: translateY(0); }

/* Error message */
.info-password-error {
  font-size: var(--text-xs);
  color: #e07070;
  text-align: center;
  min-height: 1.2em;
  margin: 0;
}

/* ── Info content panel (after unlock) ── */
#info-content-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.info-content-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.info-section {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.info-section-heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 var(--space-3) 0;
}

.info-section-line {
  font-size: var(--text-sm);
  color: var(--color-cream);
  margin: var(--space-1) 0;
  line-height: 1.6;
  word-break: break-all;
}

/* Wrong-password shake feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX( 6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX( 4px); }
}
#info-password-input.shake {
  animation: shake 0.35s ease;
  border-color: #e07070;
}


/* ============================================================
   7. GRID CONTROL PANEL
   ============================================================ */
#controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  flex-wrap: wrap;
}

.controls-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  flex-shrink: 0;
}

.grid-toggles {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
}

.grid-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  background: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-base), background var(--transition-base);
  white-space: nowrap;
}

.grid-toggle-btn:hover {
  color: var(--color-cream);
  background: var(--color-surface-2);
}

.grid-toggle-btn.active {
  background: rgba(201, 168, 76, 0.12);
  color: var(--color-gold);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.25);
}

/* SVG icons inside toggle buttons */
.grid-toggle-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.photo-count-display {
  font-size: var(--text-xs);
  color: var(--color-muted);
  flex-shrink: 0;
}

.photo-count-display span {
  color: var(--color-gold);
  font-weight: 600;
}


/* ============================================================
   8. PHOTO GRID — DEFAULT (4-column)
   ============================================================

   TO CHANGE THE DEFAULT COLUMN COUNT:
   ➡  Update --grid-cols in the :root section at the top of this file
   ➡  Also update DEFAULT_GRID_COLS in app.js (search for that constant)
   Currently set to 4 columns.
   ============================================================ */
#photo-grid {
  /* ── GRID COLUMNS ──────────────────────────────────────────
     This repeat() value controls how many columns appear.
     The CSS variable --grid-cols is set to 4 by default (see :root).
     The JavaScript also respects this via the grid toggle buttons.
     ────────────────────────────────────────────────────────── */
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr); /* ← COLUMN COUNT IS HERE */
  gap: 3px; /* tight gap between photos — change this for spacing */
  transition: grid-template-columns var(--transition-base);
}

/* When JS adds the class 'cols-2', override to 2 columns */
#photo-grid.cols-2 {
  --grid-cols: 2; /* ← 2-COLUMN OVERRIDE */
  gap: 6px;
}

/* When JS adds the class 'cols-4', use 4 columns (default) */
#photo-grid.cols-4 {
  --grid-cols: 4; /* ← 4-COLUMN OVERRIDE */
  gap: 3px;
}


/* ============================================================
   9. PHOTO GRID — MASONRY LAYOUT
   ============================================================
   Masonry uses CSS columns (not grid), so the HTML structure
   is the same — JS just adds/removes the 'masonry' class.
   ============================================================ */
#photo-grid.masonry {
  display: block;         /* disable CSS grid, switch to block flow */
  columns: 4 auto;        /* ← MASONRY COLUMN COUNT — change the 4 here */
  column-gap: 6px;
  gap: 0;
}

#photo-grid.masonry .photo-card {
  break-inside: avoid;   /* prevents photos splitting across columns */
  margin-bottom: 6px;
  display: inline-block; /* needed for columns layout */
  width: 100%;
}

#photo-grid.masonry .photo-card img {
  aspect-ratio: unset;   /* masonry: let natural image ratio show */
  object-fit: contain;
}


/* ============================================================
   10. PHOTO CARD & HOVER EFFECTS
   ============================================================ */
.photo-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
  /* Hover lift + glow effect */
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.photo-card:hover {
  transform: scale(1.01);
  z-index: 2;
  box-shadow: var(--shadow-gold);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;        /* uniform grid card ratio; masonry overrides this */
  object-fit: cover;
  object-position: center top; /* bias toward faces at the top of photos */
  display: block;
  transition: transform var(--transition-slow), filter var(--transition-slow);
  /* Images start slightly blurred while lazy-loading */
  filter: blur(0px);
}

/* Lazy-load blur-in: JS adds .lazy-loading before src, removes after onload */
.photo-card img.loading {
  filter: blur(8px);
  transform: scale(1.05);
}

/* Overlay that appears on hover */
.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.7) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}

.photo-card:hover .photo-card-overlay {
  opacity: 1;
}

.photo-card-overlay-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background var(--transition-fast), transform var(--transition-spring);
  margin-left: auto;
}

.photo-card:hover .photo-card-overlay-icon {
  transform: scale(1.1);
  background: rgba(201, 168, 76, 0.3);
}

.photo-card-overlay-icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-gold);
}

/* Photo index label (bottom-left of overlay) */
.photo-card-index {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}


/* ============================================================
   11. EMPTY STATE (shown when no photos are in the folder)
   ============================================================ */
#empty-state {
  display: none; /* JS shows this when no photos detected */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  gap: var(--space-6);
  padding: var(--space-16);
}

#empty-state.visible {
  display: flex;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
}

.empty-icon svg {
  width: 36px;
  height: 36px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-cream);
}

.empty-body {
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 480px;
  line-height: 1.8;
}

.empty-body code {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: var(--text-xs);
  color: var(--color-gold);
}


/* ============================================================
   12. LIGHTBOX OVERLAY
   ============================================================ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  touch-action: pan-y pinch-zoom;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Lightbox image ── */
#lightbox-img {
  max-width: 90vw;
  max-height: calc(100vh - 210px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: opacity var(--transition-base), transform var(--transition-base);
  user-select: none;
  -webkit-user-drag: none;
}

#lightbox-img.transitioning {
  opacity: 0;
  transform: scale(0.96);
}

/* ── Lightbox caption & counter ── */
#lightbox-caption {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-silver);
  text-align: center;
  letter-spacing: 0.03em;
}

#lightbox-counter {
  margin-top: var(--space-1);
  margin-bottom: 54px; /* clearance above absolute bottom toolbar */
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-muted);
}


/* ============================================================
   13. LIGHTBOX CONTROLS
   ============================================================ */

/* ── Top bar (close + title) ── */
#lightbox-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

#lightbox-album-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* ── Bottom toolbar ── */
#lightbox-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
}

/* Shared style for all icon-buttons in lightbox */
.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--color-cream);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
              transform var(--transition-spring), border-color var(--transition-fast);
}

.lb-btn:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(201, 168, 76, 0.4);
  color: var(--color-gold-light);
  transform: scale(1.08);
}

.lb-btn:active {
  transform: scale(0.95);
}

.lb-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Download button — slightly highlighted */
#lb-download-btn {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--color-gold);
}

#lb-download-btn:hover {
  background: rgba(201, 168, 76, 0.25);
}

/* Slideshow active state */
#lb-play-btn.playing {
  background: rgba(201, 168, 76, 0.2);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* ── Left/Right arrow nav buttons ── */
.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-spring),
              border-color var(--transition-fast);
}

.lb-nav-btn:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.lb-nav-btn svg {
  width: 22px;
  height: 22px;
}

#lb-prev { left: var(--space-4); }
#lb-next { right: var(--space-4); }

/* ── Slideshow progress bar ── */
#slideshow-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gradient-gold);
  transition: width linear; /* duration set by JS */
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.8);
}


/* ============================================================
   14. TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--color-cream);
  backdrop-filter: blur(20px);
  animation: toastIn 0.3s var(--transition-spring) forwards;
  pointer-events: all;
}

.toast.toast-success { border-color: rgba(201, 168, 76, 0.4); }
.toast.toast-error   { border-color: rgba(220, 80, 80, 0.4); }

.toast-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-gold); }
.toast.toast-error .toast-icon { color: #dc5050; }


/* ============================================================
   15. LOADING SPINNER
   ============================================================ */
#loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 30vh;
}

#loading-spinner.visible {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}


/* ============================================================
   16. FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-16);
}

.footer-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 300px;
  margin: 0 auto var(--space-6);
}

.footer-divider-line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.footer-diamond {
  width: 5px;
  height: 5px;
  background: var(--color-gold-dark);
  transform: rotate(45deg);
}

footer p {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-muted);
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  opacity: 0.55;
  margin-top: var(--space-3);
}


/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Large tablets and below (≤ 1024px) ── */
@media (max-width: 1024px) {
  /* ── 3-column grid on large tablet, unless a specific class overrides it ── */
  #photo-grid:not(.cols-2):not(.cols-4):not(.masonry) {
    --grid-cols: 3; /* ← TABLET default: 3 columns */
  }

  #photo-grid.cols-4 {
    --grid-cols: 3; /* even explicit 4-col shows as 3 on tablet */
  }

  #photo-grid.masonry {
    columns: 3 auto; /* ← TABLET masonry: 3 columns */
  }
}

/* ── Tablets (≤ 768px) ── */
@media (max-width: 768px) {
  #photo-grid:not(.cols-2):not(.masonry) {
    --grid-cols: 2; /* ← SMALL TABLET default: 2 columns */
  }

  #photo-grid.cols-4 {
    --grid-cols: 2;
  }

  #photo-grid.masonry {
    columns: 2 auto; /* ← TABLET MASONRY: 2 columns */
  }

  .tab-btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
  }

  #controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  #photo-grid:not(.cols-2):not(.masonry) {
    --grid-cols: 1; /* ← MOBILE default: 1 column */
  }

  #photo-grid.cols-2 {
    --grid-cols: 2; /* honour the explicit 2-col on mobile */
  }

  #photo-grid.cols-4 {
    --grid-cols: 2; /* cap 4-col at 2 on mobile */
  }

  #photo-grid.masonry {
    columns: 2 auto; /* ← MOBILE MASONRY: 2 columns */
  }

  .lb-nav-btn {
    width: 40px;
    height: 40px;
  }

  #lb-prev { left: var(--space-2); }
  #lb-next { right: var(--space-2); }

  #lightbox-img {
    max-width: 98vw;
    max-height: 70vh;
  }
}


/* ============================================================
   18. KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* heroReveal: always starts visible so text shows even if animation is delayed */
@keyframes heroReveal {
  from { transform: translateY(-12px); }
  to   { transform: translateY(0); }
}

@keyframes shimmerSweep {
  0%   { left: -100%; }
  100% { left: 200%; }
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
  50%       { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* Card entrance animation (staggered via JS inline delay) */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-card {
  animation: cardFadeIn 0.4s ease forwards;
  opacity: 0; /* start invisible; animation reveals it */
}
