/* ================================================================
   styles.css — McClayne & Kyle Wedding Photo Site
   ================================================================
   TABLE OF CONTENTS
   1.  CSS Custom Properties (design tokens)
   2.  Reset & Base
   3.  Typography
   4.  Utility Classes
   5.  Buttons
   6.  Screens (Login, Expired, Closed)
   7.  Navigation
   8.  Sections & Layout
   9.  Hero
   10. Gallery Grid        (Step 4)
   11. Photo Card          (Step 4)
   12. Scoreboard          (Step 5)
   13. Guestbook           (Step 5)
   14. Modals              (Steps 4 & 3)
   15. Comments            (Step 4)
   16. Admin Panel         (Step 6)
   17. States (Loading / Empty / Error)
   18. Rope Divider & Decorative
   19. Responsive / Mobile
================================================================ */


/* ----------------------------------------------------------------
   1. CSS Custom Properties (design tokens)
   All colors, spacing, and font references go through these
   variables. Change a variable here → changes everywhere.
   Colors mirror CONFIG.colors in firebase-config.js.
---------------------------------------------------------------- */
:root {
  /* Brand colors */
  --color-terracotta: #C26B5B;   /* primary accent */
  --color-terracotta-dark: #A8574A;
  --color-terracotta-light: #D4887A;
  --color-cream: #F5F0E6;        /* main background */
  --color-cream-dark: #EDE6D6;   /* slightly deeper cream for cards */
  --color-olive: #5A6B4D;        /* secondary accent */
  --color-olive-light: #7A8E6A;
  --color-leather: #8B6347;      /* tertiary accent */
  --color-leather-light: #A8815F;

  /* Text */
  --color-text-dark: #2C2416;    /* headings, primary text */
  --color-text-mid: #6B5744;     /* body text */
  --color-text-light: #A89880;   /* captions, timestamps, placeholders */

  /* Utility */
  --color-white: #FFFFFF;
  --color-error: #C0392B;
  --color-success: #5A6B4D;      /* reuse olive */
  --color-border: rgba(139, 99, 71, 0.2);  /* leather at low opacity */

  /* Shadows — layered + color-tinted (not flat shadow-md) */
  --shadow-card:
    0 1px 2px rgba(44, 36, 22, 0.06),
    0 4px 12px rgba(44, 36, 22, 0.08),
    0 8px 24px rgba(44, 36, 22, 0.04);
  --shadow-elevated:
    0 2px 4px rgba(44, 36, 22, 0.08),
    0 8px 24px rgba(44, 36, 22, 0.12),
    0 16px 48px rgba(44, 36, 22, 0.06);
  --shadow-modal:
    0 4px 8px rgba(44, 36, 22, 0.10),
    0 16px 48px rgba(44, 36, 22, 0.20),
    0 32px 80px rgba(44, 36, 22, 0.10);

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

  /* Spacing tokens — use these rather than arbitrary px values */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 60px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions — only transform and opacity, never transition-all */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ----------------------------------------------------------------
   2. Reset & Base
---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-cream);
  color: var(--color-text-mid);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden; /* required for slide-in section animations */
  /* Subtle grain texture via SVG noise filter for depth */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
}

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

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

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
}

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

ul, ol {
  list-style: none;
}


/* ----------------------------------------------------------------
   3. Typography
---------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.2;
  /* Tight tracking on display headings */
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p {
  line-height: 1.7;
  color: var(--color-text-mid);
}

.timestamp {
  font-size: 0.78rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}


/* ----------------------------------------------------------------
   4. Utility Classes
---------------------------------------------------------------- */
.hidden { display: none !important; }

/* Ensure the native [hidden] attribute always wins over class-level display values.
   Without this, .loading-state/.empty-state { display:flex } overrides [hidden]. */
[hidden] { display: none !important; }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--color-text-dark);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
  font-size: 0.95rem;
}

.error-text {
  color: var(--color-error);
  font-size: 0.88rem;
  margin-top: var(--space-sm);
}

.consent-notice {
  font-size: 0.80rem;
  color: var(--color-text-light);
  text-align: center;
  margin-top: var(--space-lg);
  line-height: 1.5;
  max-width: 320px;
}

/* Placeholder used during scaffold — removed as each step builds real UI */
.step-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
}


/* ----------------------------------------------------------------
   5. Buttons
---------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  background-color: var(--color-terracotta);
  color: var(--color-white);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow:
    0 1px 2px rgba(194, 107, 91, 0.3),
    0 4px 12px rgba(194, 107, 91, 0.25);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--color-terracotta-dark);
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(194, 107, 91, 0.35),
    0 8px 20px rgba(194, 107, 91, 0.30);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(194, 107, 91, 0.3);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--color-terracotta-light);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background-color: transparent;
  color: var(--color-terracotta);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--color-terracotta);
  border-radius: var(--radius-sm);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.btn-secondary:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  transform: translateY(-1px);
}

.btn-secondary:active  { transform: translateY(0); }

.btn-secondary:focus-visible {
  outline: 3px solid var(--color-terracotta-light);
  outline-offset: 2px;
}

.btn-full { width: 100%; }

/* Disabled state — used when login button shows "Entering…" */
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Subtle text-style button (used for admin entry) */
.btn-text {
  color: var(--color-text-light);
  font-size: 0.85rem;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.btn-text:hover    { color: var(--color-text-mid); }
.btn-text:focus-visible { outline: 2px solid var(--color-terracotta); }

/* Admin ··· button in nav — intentionally faint so casual guests don't notice it */
.btn-admin-entry {
  font-size: 0.8rem;
  padding: 6px 8px;
  color: var(--color-text-light);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), opacity var(--transition-fast);
  opacity: 0.28;           /* very faint — blends into nav */
  letter-spacing: 0.12em; /* spread the dots for visual balance */
  line-height: 1;
  user-select: none;
}

.btn-admin-entry:hover { opacity: 0.65; color: var(--color-text-mid); }
.btn-admin-entry:focus-visible { outline: 2px solid var(--color-terracotta); opacity: 1; }


/* ----------------------------------------------------------------
   6. Screens (Login, Expired, Closed)
   Screens are full-viewport covers shown before the app loads.
---------------------------------------------------------------- */
.screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

/* The active screen is shown via flex */
.screen.active { display: flex; }

/* Login card */
.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) clamp(var(--space-lg), 6vw, var(--space-2xl));
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.login-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.login-couple {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--color-text-dark);
  text-align: center;
  letter-spacing: -0.03em;
}

.login-date {
  font-size: 0.9rem;
  color: var(--color-terracotta);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-prompt {
  font-size: 0.9rem;
  color: var(--color-text-light);
  text-align: center;
}

/* Login form */
#login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-dark);
  letter-spacing: 0.02em;
}

.field-group input,
input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.field-group input:focus,
input:focus,
textarea:focus {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(194, 107, 91, 0.15);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-light);
}

/* Generic message card (expired / closed screens) */
.message-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.message-icon { font-size: 2.5rem; }

.message-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-text-dark);
}

.message-card p {
  color: var(--color-text-mid);
  line-height: 1.7;
}


/* ----------------------------------------------------------------
   7. Navigation
---------------------------------------------------------------- */
#main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(245, 240, 230, 0.92);
  /* Frosted glass effect on supported browsers */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-lg);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-dark);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-mid);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover { color: var(--color-text-dark); background: var(--color-cream-dark); }

/* Active nav link — set by router in app.js */
.nav-link.active { color: var(--color-terracotta); font-weight: 600; }

.nav-link:focus-visible { outline: 2px solid var(--color-terracotta); outline-offset: 2px; }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-dark);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}


/* ----------------------------------------------------------------
   8. Sections & Layout
   Each content section is hidden/shown by the router in app.js.
---------------------------------------------------------------- */
.section {
  display: none;
  min-height: calc(100vh - var(--nav-height));
}

/* Fade + slight upward drift when a section becomes active */
.section.active {
  display: block;
  animation: sectionFadeIn 0.22s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Swipe slide-in overrides — replace the fade with a directional slide */
.section.active.slide-from-right {
  animation: slideFromRight 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.section.active.slide-from-left {
  animation: slideFromLeft  0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideFromRight {
  from { transform: translateX(100%); opacity: 0.6; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideFromLeft {
  from { transform: translateX(-100%); opacity: 0.6; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ----------------------------------------------------------------
   Thanks overlay — full-screen celebration after upload
---------------------------------------------------------------- */
#thanks-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  pointer-events: none;
}
#thanks-overlay.visible {
  animation: thanksReveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
#thanks-overlay.exit {
  animation: thanksExit 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes thanksReveal {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes thanksExit {
  from { opacity: 1; transform: translateX(0)    scale(1); }
  to   { opacity: 0; transform: translateX(-80px) scale(0.95); }
}

.thanks-content {
  text-align: center;
  padding: var(--space-xl);
}
.thanks-icon {
  font-size: 4.5rem;
  display: block;
  animation: thanksHeartbeat 0.7s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes thanksHeartbeat {
  from { transform: scale(1); }
  to   { transform: scale(1.2); }
}
.thanks-text {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  color: var(--color-terracotta);
  margin: var(--space-md) 0 var(--space-sm);
  line-height: 1.1;
}
.thanks-sub {
  font-size: 1rem;
  color: var(--color-text-light);
  letter-spacing: 0.01em;
}

@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* App shell fades in after login */
#app-shell.fading-in {
  animation: sectionFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}


/* ----------------------------------------------------------------
   9. Hero
---------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  /* Multi-layer radial gradients for depth */
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(194, 107, 91, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(90, 107, 77, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(245, 240, 230, 1) 40%, transparent 100%);
}

.hero-couple {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--color-text-dark);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
  /* Italic style for the ampersand via CSS trick */
  font-style: normal;
}

.hero-date {
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-terracotta);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.hero-tagline {
  max-width: 520px;
  font-size: 1.05rem;
  color: var(--color-text-mid);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}


/* ----------------------------------------------------------------
   10. Upload Section
---------------------------------------------------------------- */

/* "Sharing as [Name] · Edit" badge */
.upload-name-badge {
  font-size: 0.9rem;
  color: var(--color-text-mid);
  margin-bottom: var(--space-md);
  min-height: 1.5em; /* prevents layout shift while JS fills it */
}

.upload-name-badge strong { color: var(--color-text-dark); }

/* Accent text button for "Set your display name" prompt */
.btn-text--accent {
  color: var(--color-terracotta);
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-text--accent:hover { text-decoration: underline; }

/* Consent line under the name badge */
.upload-consent {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* ---- Upload Drop Zone ---- */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  background: var(--color-white);
  transition:
    border-color var(--transition-base),
    background-color var(--transition-base),
    transform var(--transition-base);
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--color-terracotta);
  background: rgba(194, 107, 91, 0.03);
  outline: none;
}

/* Visual feedback while a file is being dragged over the zone */
.upload-zone.dragover {
  border-color: var(--color-terracotta);
  background: rgba(194, 107, 91, 0.06);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(194, 107, 91, 0.12);
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: none; /* let clicks fall through to the zone div */
}

/* Allow the label/button to receive clicks even with pointer-events:none on parent */
.upload-zone-content label,
.upload-zone-content input { pointer-events: all; }

/* Side-by-side button row: Choose Photos + Take a Photo */
.upload-zone-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: all;
}

/* Camera button is slightly smaller than the primary */
.upload-camera-btn {
  font-size: 0.9rem;
  padding: 10px 18px;
}

.upload-zone-icon { font-size: 2.5rem; margin-bottom: var(--space-sm); }

.upload-zone-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-text-dark);
  font-weight: 600;
}

.upload-zone-or {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin: calc(-1 * var(--space-xs)) 0;
}

.upload-zone-hint {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

/* ---- Preview Grid ---- */
.upload-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

/* Single preview tile */
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream-dark);
  box-shadow: var(--shadow-card);
}

/* Remove button — top-right of each preview tile.
   44×44px touch target (WCAG minimum) with the visual circle centred inside. */
.preview-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 0 var(--radius-md) 0 50%; /* matches card corner, circle bottom-left */
  background: rgba(44, 36, 22, 0.68);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast), transform var(--transition-spring);
  -webkit-tap-highlight-color: transparent;
}
.preview-remove:hover  { background: rgba(192, 57, 43, 0.88); transform: scale(1.06); }
.preview-remove:active { transform: scale(0.94); }
.preview-remove:focus-visible { outline: 2px solid #fff; }

/* Pop-out animation — brief scale-up then shrink to nothing */
@keyframes popRemove {
  0%   { transform: scale(1);    opacity: 1; }
  25%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0);    opacity: 0; }
}

.preview-item.removing {
  animation: popRemove 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none; /* prevent double-tap during animation */
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay shows upload status on top of the thumbnail */
.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity var(--transition-base);
}

/* Uploading state: semi-dark + spinner */
.preview-item.uploading .preview-overlay {
  background: rgba(44, 36, 22, 0.5);
  opacity: 1;
}

.preview-item.uploading .preview-overlay::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Success state: green tint + checkmark */
.preview-item.success .preview-overlay {
  background: rgba(90, 107, 77, 0.55);
  opacity: 1;
}
.preview-item.success .preview-overlay::after { content: '✓'; color: white; font-size: 1.6rem; font-weight: 700; }

/* Error state: red tint + X */
.preview-item.error .preview-overlay {
  background: rgba(192, 57, 43, 0.55);
  opacity: 1;
}
.preview-item.error .preview-overlay::after { content: '✕'; color: white; font-size: 1.4rem; font-weight: 700; }

/* ---- Upload Actions ---- */
.upload-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

/* ---- Status Line ---- */
.upload-status {
  margin-top: var(--space-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-mid);
  text-align: center;
}

.upload-status.is-error { color: var(--color-error); }
.upload-status.is-success { color: var(--color-olive); }

/* ---- Upload Progress Bar ---- */
#upload-progress-wrap {
  margin-top: var(--space-md);
}

.upload-progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-cream-dark);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-terracotta), var(--color-leather));
  border-radius: 3px;
  /* Animate width smoothly as XHR progress events fire */
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-progress-label {
  font-size: 0.78rem;
  color: var(--color-text-light);
  text-align: center;
  margin-top: var(--space-xs);
}

/* ---- Composition Tips ---- */
.tips-section {
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
}

.tips-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-mid);
  padding: var(--space-sm) 0;
  width: 100%;
  text-align: left;
  transition: color var(--transition-fast);
}

.tips-toggle:hover { color: var(--color-text-dark); }
.tips-toggle:focus-visible { outline: 2px solid var(--color-terracotta); border-radius: var(--radius-sm); }

.tips-arrow {
  margin-left: auto;
  display: inline-block;
  transition: transform var(--transition-base);
}

/* Rotate arrow when open */
.tips-toggle[aria-expanded="true"] .tips-arrow { transform: rotate(180deg); }

.tips-content {
  padding: var(--space-md) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  list-style: none;
  animation: sectionFadeIn 0.2s ease both;
}

.tips-content li {
  font-size: 0.88rem;
  color: var(--color-text-mid);
  line-height: 1.6;
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-terracotta-light);
}

.tips-content li strong { color: var(--color-text-dark); }


/* ----------------------------------------------------------------
   11. Gallery Grid  (Step 4 — styles stubbed, fleshed out later)
---------------------------------------------------------------- */
.gallery-grid {
  columns: 2;
  column-gap: var(--space-md);
  /* Built out in Step 4 */
}

@media (min-width: 640px)  { .gallery-grid { columns: 3; } }
@media (min-width: 960px)  { .gallery-grid { columns: 4; } }


/* ----------------------------------------------------------------
   11. Photo Card  (Step 4)
---------------------------------------------------------------- */
.photo-card {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-cream-dark);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}

.photo-card:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 2px;
}

.photo-card img {
  width: 100%;
  display: block;
  /* Gradient overlay on images */
}

.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44, 36, 22, 0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.photo-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base);
}

.photo-card:hover .photo-card-footer {
  opacity: 1;
  transform: translateY(0);
}

/* Heart / like button */
.like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-white);
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 10px;
  min-height: 44px;   /* accessible touch target */
  backdrop-filter: blur(4px);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-spring);
}

.like-btn:hover  { background: rgba(255,255,255,0.25); transform: scale(1.05); }
.like-btn:active { transform: scale(0.95); }
.like-btn:focus-visible { outline: 2px solid var(--color-white); }

/* ♥ heart icon — CSS-styled, not emoji */
.heart-icon {
  font-size: 1.05em;
  line-height: 1;
  display: inline-block;
  /* Faint muted red when not yet liked */
  color: rgba(139, 58, 58, 0.35);
  transition: color var(--transition-fast);
}

/* Liked state — darker, less-saturated red (not emoji-bright) */
.heart-icon--liked {
  color: #8B3A3A;
}

/* Uploader name shown in photo card footer on hover */
.photo-uploader {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;          /* keeps it from pushing the like button off screen */
  letter-spacing: 0.01em;
}


/* ----------------------------------------------------------------
   12. Scoreboard  (Step 5)
---------------------------------------------------------------- */
.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.scoreboard-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base);
}

.scoreboard-item:hover { transform: translateX(3px); }

.scoreboard-rank {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-terracotta);
  min-width: 36px;
  text-align: center;
}

.scoreboard-thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .scoreboard-thumb { width: 120px; height: 120px; }
}

.scoreboard-meta {
  flex: 1;
  min-width: 0;
}

.scoreboard-author {
  font-size: 0.88rem;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scoreboard-likes {
  font-weight: 600;
  color: var(--color-terracotta);
  font-size: 0.95rem;
}


/* ----------------------------------------------------------------
   13. Guestbook / Messages  (Step 5)
---------------------------------------------------------------- */
.guestbook-form {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.guestbook-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.guestbook-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--color-terracotta);
  /* Gentle fade-in on appear */
  animation: fadeSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Subtle hover lift on guestbook cards */
.guestbook-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Author + heart on the same row */
.guestbook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.guestbook-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-dark);
}

.guestbook-message {
  color: var(--color-text-mid);
  line-height: 1.7;
}

/* Guestbook like button — same feel as comment hearts */
.guestbook-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-light);
  font-size: 0.85rem;
  line-height: 1;
  min-height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.guestbook-like-btn:hover {
  color: var(--color-terracotta);
  transform: scale(1.12);
}
.guestbook-like-btn:active {
  transform: scale(0.92);
}
.guestbook-like-btn.liked {
  color: var(--color-terracotta);
}

.guestbook-heart {
  font-size: 0.95rem;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.guestbook-like-btn.liked .guestbook-heart {
  transform: scale(1.15);
}

.guestbook-like-count {
  font-variant-numeric: tabular-nums;
  min-width: 10px;
}

/* Guestbook textarea */
.guestbook-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  display: block;
  margin-bottom: var(--space-sm);
}

.guestbook-textarea:focus {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(194, 107, 91, 0.15);
}

/* Footer row: char count + submit button */
.guestbook-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Character counter */
.char-count {
  font-size: 0.78rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

/* Turns amber when approaching the limit (80%) */
.char-count--near { color: var(--color-leather); font-weight: 600; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ----------------------------------------------------------------
   14. Modals  (Steps 3, 4)
---------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

/* When a modal is shown, remove [hidden] via JS (don't use display:none) */
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 22, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-content--narrow { max-width: 380px; padding: var(--space-xl); text-align: center; }
.modal-content--narrow h3 { margin-bottom: var(--space-sm); }
.modal-content--narrow p  { margin-bottom: var(--space-lg); font-size: 0.9rem; color: var(--color-text-light); }
.modal-content--narrow form { display: flex; flex-direction: column; gap: var(--space-md); }

/* Two-field name row: First name (flex-grow) + Last initial (fixed narrow) */
.name-form-row {
  display: flex;
  gap: var(--space-sm);
}
.name-form-row #name-first {
  flex: 1 1 auto;
  min-width: 0;
}
.name-form-row #name-last {
  flex: 0 0 88px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-style: italic;
}
.name-form-row #name-last::placeholder {
  font-style: italic;
  text-transform: none;
  letter-spacing: normal;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-cream);
  color: var(--color-text-mid);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover { background: var(--color-cream-dark); color: var(--color-text-dark); }
.modal-close:focus-visible { outline: 2px solid var(--color-terracotta); }

.modal-image-wrap {
  background: var(--color-text-dark);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

.modal-meta {
  padding: var(--space-md) var(--space-lg) 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
}


/* ----------------------------------------------------------------
   15. Comments  (Step 4)
---------------------------------------------------------------- */
.modal-comments {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.comment-item {
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  animation: fadeSlideIn 0.25s ease both;
}

/* Row: author name on the left, heart button on the right */
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-text-dark);
}

.comment-text {
  font-size: 0.9rem;
  color: var(--color-text-mid);
  word-break: break-word;
}

/* Comment like button — mirrors .like-btn but smaller */
.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-text-light);
  font-size: 0.78rem;
  line-height: 1;
  min-height: 32px;
  min-width: 32px;
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.comment-like-btn:hover {
  color: var(--color-terracotta);
  transform: scale(1.12);
}
.comment-like-btn:active {
  transform: scale(0.92);
}
.comment-like-btn.liked {
  color: var(--color-terracotta);
}

.comment-heart {
  font-size: 0.85rem;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.comment-like-btn.liked .comment-heart {
  transform: scale(1.15);
}

.comment-like-count {
  font-variant-numeric: tabular-nums;
  min-width: 10px;
  text-align: left;
}

.comment-form {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.comment-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--color-cream);
}

.comment-form input:focus {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(194, 107, 91, 0.15);
  outline: none;
}

/* Shown when the 3-comment session limit is reached */
.comment-limit-msg {
  font-size: 0.82rem;
  color: var(--color-text-light);
  text-align: center;
  padding: var(--space-md) 0 var(--space-sm);
  font-style: italic;
  line-height: 1.5;
}


/* ----------------------------------------------------------------
   16. Admin Panel  (Step 6)
---------------------------------------------------------------- */
.admin-auth {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.admin-controls-grid {
  display: grid;
  gap: var(--space-lg);
}

.admin-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.admin-card h3 {
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
}

.admin-auth-prompt {
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

/* Header row: title + sign-out button */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.admin-signed-in-label {
  font-weight: 600;
  color: var(--color-text-dark);
  font-size: 0.9rem;
}

/* Site settings toggle */
.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.admin-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-mid);
}

.admin-toggle-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-olive);
  color: #fff;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.admin-toggle-btn:hover { opacity: 0.85; transform: scale(1.03); }
.admin-toggle-btn--closed { background: var(--color-terracotta); }

/* Save / status feedback */
.admin-status-msg {
  font-size: 0.82rem;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.admin-status-msg--success { color: var(--color-olive); background: rgba(90,107,77,0.08); }
.admin-status-msg--error   { color: var(--color-error); background: rgba(192,57,43,0.08); }

/* Photo/message rows in admin lists */
.admin-photo-row,
.admin-message-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.admin-photo-row:last-child,
.admin-message-row:last-child { border-bottom: none; }

.admin-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--color-cream-dark);
}

.admin-row-meta {
  flex: 1;
  min-width: 0;
}

.admin-row-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-dark);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row-sub {
  font-size: 0.75rem;
  color: var(--color-text-light);
  display: block;
}

.admin-row-text {
  font-size: 0.82rem;
  color: var(--color-text-mid);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action button group — Hide + Delete sit side by side */
.admin-row-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Hide / Show action buttons */
.admin-action-btn {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  min-height: 36px;   /* safer tap target on mobile */
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.admin-action-btn:hover  { opacity: 0.8; transform: scale(1.04); }
.admin-action-btn:active { transform: scale(0.97); }
.admin-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-action-btn--hide {
  background: rgba(192, 57, 43, 0.1);
  color: var(--color-error);
}

.admin-action-btn--show {
  background: rgba(90, 107, 77, 0.1);
  color: var(--color-olive);
}

.admin-action-btn--delete {
  background: rgba(192, 57, 43, 0.06);
  color: var(--color-error);
  border: 1px solid rgba(192, 57, 43, 0.2);
}
.admin-action-btn--delete:hover {
  background: rgba(192, 57, 43, 0.15);
  opacity: 1;
}

/* Admin email shown next to panel title */
.admin-signed-in-email {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-weight: 400;
  margin-top: 2px;
}

/* Archive collapsible subsection */
.admin-archive-section {
  margin-top: var(--space-md);
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-md);
}

.admin-archive-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-light);
  padding: var(--space-xs) 0;
  width: 100%;
  text-align: left;
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
}

.admin-archive-toggle:hover { color: var(--color-text-dark); }
.admin-archive-toggle:focus-visible {
  outline: 2px solid var(--color-terracotta);
  border-radius: var(--radius-sm);
}

.admin-archive-arrow {
  font-size: 0.65rem;
  display: inline-block;
  transition: transform var(--transition-base);
  line-height: 1;
}

.admin-archive-count {
  background: rgba(139, 99, 71, 0.12);
  color: var(--color-leather);
  font-size: 0.70rem;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 2px;
  font-weight: 700;
}

.admin-archive-list {
  margin-top: var(--space-sm);
}

/* ---- Guest List ---- */
/* Shown in the admin panel: one row per guest with photo/message/heart counts */
.guest-list-header,
.guest-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.guest-list-row:last-child { border-bottom: none; }

.guest-list-header {
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.guest-list-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Header label for the name column */
.guest-list-header .guest-list-name {
  color: var(--color-text-light);
  font-weight: 700;
}

.guest-list-stat {
  min-width: 32px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-mid);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.guest-list-total {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-align: right;
  margin-top: var(--space-sm);
  font-style: italic;
}


/* ----------------------------------------------------------------
   17. States: Loading, Empty, Error
   Every data-driven section must handle these three states.
   Never show a blank screen — always communicate status.
---------------------------------------------------------------- */
.loading-state,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.error-state { color: var(--color-error); }

/* CSS-only spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-terracotta);
  border-radius: 50%;
  /* Animate transform only — never transition-all */
  animation: spin 0.8s linear infinite;
}

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


/* ----------------------------------------------------------------
   18. Rope Divider & Decorative Elements
   Very light western touches — used sparingly.
---------------------------------------------------------------- */
.rope-divider {
  width: 80px;
  height: 2px;
  margin: var(--space-lg) auto;
  /* Woven rope look via repeating gradient */
  background: repeating-linear-gradient(
    90deg,
    var(--color-leather-light)    0px,
    var(--color-leather-light)    4px,
    var(--color-cream-dark)       4px,
    var(--color-cream-dark)       8px
  );
  border-radius: 2px;
  opacity: 0.6;
}


/* ----------------------------------------------------------------
   19. Responsive / Mobile-First Breakpoints
---------------------------------------------------------------- */
@media (max-width: 640px) {

  /* Nav: collapse links behind hamburger toggle */
  .nav-toggle { display: flex; }
  #btn-admin-entry { margin-left: 0; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-xs);
    box-shadow: 0 8px 24px rgba(44, 36, 22, 0.08);
  }

  /* app.js toggles this class to open the mobile menu */
  .nav-links.open { display: flex; }

  .nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
  }

  /* Hero adjustments */
  .hero { padding: var(--space-xl) var(--space-md); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary { width: 100%; text-align: center; }

  /* Single-column gallery on mobile */
  .gallery-grid { columns: 1; }

  /* Modal full-screen on mobile */
  .modal-content {
    max-height: 95vh;
    border-radius: var(--radius-md);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .gallery-grid { columns: 2; }
}


/* ----------------------------------------------------------------
   20. Touch Device Overrides  (hover: none = phones & tablets)
   Fixes:
   1. Gallery footer (likes + uploader) always visible — hover doesn't
      exist on touch, so we can't hide it behind a hover state.
   2. Subtle "tap to view" indicator on each card.
   3. (Touch targets already handled above via min-height values.)
---------------------------------------------------------------- */
@media (hover: none) {

  /* Always show the card footer and dim the overlay slightly */
  .photo-card-footer {
    opacity: 1;
    transform: translateY(0);
    /* Strengthen the gradient so text stays legible without hover */
    background: linear-gradient(to top, rgba(44, 36, 22, 0.72) 0%, transparent 100%);
  }

  .photo-card-overlay {
    opacity: 0.15;   /* very subtle permanent vignette */
  }

  /* Small "tap to expand" badge in the top-right of every gallery card */
  .photo-card::before {
    content: '⤢';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
    pointer-events: none;   /* don't block card clicks */
  }
}
