/* Montserrat Font - Self-hosted */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/montserrat-v31-latin-300.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/montserrat-v31-latin-regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/montserrat-v31-latin-500.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/montserrat-v31-latin-600.woff2') format('woff2');
  font-display: swap;
}

/* Playfair Display Font - Self-hosted */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/playfair-display-light-new.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/playfair-display-regular-new.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/playfair-display-bold-new.woff2') format('woff2');
  font-display: swap;
}

/* Minimal, clean theme */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --brand-primary: var(--brand-primary);
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary), black 14%);
  --brand-primary-strong: color-mix(in srgb, var(--brand-primary), black 22%);
  --brand-primary-soft: color-mix(in srgb, var(--brand-primary), transparent 90%);
  --brand-primary-soft-mid: color-mix(in srgb, var(--brand-primary), transparent 85%);
  --brand-primary-border-muted: color-mix(in srgb, var(--brand-primary), transparent 65%);
  --brand-primary-ring: color-mix(in srgb, var(--brand-primary), transparent 88%);
  --brand-primary-ring-strong: color-mix(in srgb, var(--brand-primary), transparent 75%);
  --brand-primary-shadow: color-mix(in srgb, var(--brand-primary), transparent 80%);
  --brand-primary-backdrop: color-mix(in srgb, var(--brand-primary), transparent 72%);
  --brand-primary-ghost-1: color-mix(in srgb, var(--brand-primary), transparent 89%);
  --brand-primary-ghost-2: color-mix(in srgb, var(--brand-primary), transparent 95%);
  --brand-primary-watermark: color-mix(in srgb, var(--brand-primary), transparent 94.5%);
  --accent: var(--brand-primary);
  --card: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

html, body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  position: relative;
}

/* Custom scrollbar - thumb grows and darkens on hover */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
  border-width: 0;
  background-clip: border-box;
}

::selection {
  background: color-mix(in srgb, var(--brand-primary), transparent 80%);
  color: var(--fg);
}

a { color: inherit; text-decoration: none; transition: opacity 0.2s ease, color 0.2s ease; }
a:hover { text-decoration: underline; opacity: 0.8; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}
/* When .container only wraps the fixed footer, it shouldn't add page height */
.container:has(> .footer:only-child) {
  padding: 0;
}

/* Top navigation */
.nav { 
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  z-index: 100; 
  background: var(--bg); 
  border-bottom: 1px solid transparent; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }

/* Submenu container - second horizontal bar */
.submenu-container {
  position: fixed;
  top: 71px; /* Right below main nav - increased gap for better spacing */
  left: 0;
  right: 0;
  z-index: 95;
  background: rgba(250, 250, 250, 0.95); /* Semi-transparent */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(224, 224, 224, 0.6);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.submenu-container.show {
  max-height: 48px;
  opacity: 1;
}

.submenu {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

.submenu.active {
  display: block;
}

.submenu-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  /* Start position will be set by JS to align with parent */
  padding-left: 0;
  transition: padding-left 0.2s ease;
}

/* Desktop: Add fade gradients for submenu overflow */
@media (min-width: 769px) {
  .submenu {
    position: relative;
  }
  
  .submenu::before,
  .submenu::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .submenu::before {
    left: 0;
    background: linear-gradient(to right, rgba(250, 250, 250, 0.95), transparent);
  }
  
  .submenu::after {
    right: 0;
    background: linear-gradient(to left, rgba(250, 250, 250, 0.95), transparent);
  }
  
  .submenu.scrollable-left::before,
  .submenu.scrollable-right::after {
    opacity: 1;
  }
}

.submenu-inner::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.submenu-inner a {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 12px 8px 12px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.submenu-inner a:hover {
  color: var(--brand-primary);
  text-decoration: none;
}

.submenu-inner a.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 500;
}

/* Parent menu item indicator */
.has-submenu {
  position: relative;
}

.has-submenu::after {
  content: '▾';
  font-size: 9px;
  margin-left: 8px;
  opacity: 0.35;
  position: relative;
  top: -1px;
}

.brand { display: flex; align-items: center; }
.brand a { text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { height: 42px; width: auto; display: block; transition: opacity 0.2s ease; }
/* Brand text styling - Playfair Display two-line layout */
.brand span { 
  font-family: 'Playfair Display', Georgia, serif;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  transition: opacity 0.2s ease;
}

.brand-main {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.brand-sub {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}
.brand a:hover img,
.brand a:hover span { opacity: 0.7; }
.links { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
  flex: 1;               /* let menu take remaining space next to logo */
  justify-content: flex-end;
  min-width: 0;          /* allow inner content to overflow/scroll instead of shrinking logo */
  overflow: hidden;      /* hide any horizontal overflow; inner strip will handle scrolling */
}
.links a { 
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--fg); 
  text-decoration: none; 
  transition: color 0.2s ease;
}
.links a:hover { opacity: 1; }
.links a.active { color: var(--brand-primary); }
.more { display: none; color: var(--fg); }
.menu-items { 
  display: inline-flex;
  align-items: baseline; /* gallery titles line up with Services / Contact; date sits below title */
  gap: 20px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Top-level gallery: optional "Until YYYY/MM/DD" under title (available_until); same pulse as footer "Currently Updating" */
.nav-gallery-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  align-self: baseline;
  justify-content: flex-start;
  gap: 5px;
  flex-shrink: 0;
  position: relative;
}
.nav-gallery-block > a {
  line-height: 1.25;
}
.nav-gallery-until {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
  line-height: 1.2;
  white-space: nowrap;
  max-width: min(200px, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: footer-updating-blink 1.2s ease-in-out infinite;
}

/* Ensure desktop/main menu can scroll horizontally on narrower viewports
   even when it visually reaches the logo */
@media (max-width: 1024px) {
  .links {
    overflow-x: hidden;
  }
  .menu-items {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .menu-items::-webkit-scrollbar {
    display: none;
  }
}

/* Large desktop: float the "Until …" date below the gallery name so it no longer
   pushes the vertically-centered menu names upward. Scoped to >1024px because
   narrower widths use a horizontally-scrolling menu that must keep overflow clipping. */
@media (min-width: 1025px) {
  .nav-gallery-until {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 3px;
  }
  /* Let the floated date spill below the nav row while still clipping horizontal
     overflow. overflow:clip permits overflow-y:visible (overflow:hidden would not). */
  .links {
    overflow-x: clip;
    overflow-y: visible;
  }
}

.dropdown { position: relative; }
.dropdown-toggle { padding: 8px 10px; border-radius: 8px; color: var(--fg); display: inline-flex; align-items: center; gap: 6px; }
.dropdown-menu { position: absolute; right: 0; top: 110%; min-width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); display: none; padding: 6px; }
.dropdown-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); }
.dropdown-menu a:hover { background: #f1f5f9; }
.dropdown.open .dropdown-menu { display: block; }
/* Icons: keep vertically centered in the nav row next to text-baseline-aligned links */
.menu-items > .favorites-link,
.menu-items > a.ig {
  align-self: center;
}
.favorites-link { opacity: 0.7; display: inline-flex; align-items: center; justify-content: center; position: relative; margin-right: 18px; }
.favorites-link:hover { opacity: 1; }
.favorites-link svg { width: 18px; height: 18px; display: block; }
.favorites-counter { position: absolute; top: -6px; right: -8px; background: var(--brand-primary); color: #fff; font-size: 10px; font-weight: 600; min-width: 16px; height: 16px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.favorites-link { opacity: 0.7; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.favorites-link:hover { opacity: 1; }
.favorites-link svg { width: 18px; height: 18px; display: block; }
.favorites-counter { position: absolute; top: -3px; right: -5px; background: var(--brand-primary); color: #fff; font-size: 8px; font-weight: 700; min-width: 12px; height: 12px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0 2px; line-height: 1; letter-spacing: -0.03em; box-sizing: border-box; }
.ig { opacity: 0.7; display: inline-flex; align-items: center; justify-content: center; }
.ig:hover { opacity: 1; }
.ig svg { width: 18px; height: 18px; display: block; }

/* Overlay defaults (hidden by default on all screens) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 245, 0.78);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.52s,
    backdrop-filter 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s,
    backdrop-filter 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
body.overlay-open { overflow: hidden; }
.overlay-inner {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  opacity: 0;
  transform: translateY(16px) scale(0.992);
  transition:
    opacity 0.56s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}
.overlay.open .overlay-inner {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.overlay-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; }
.overlay-header .brand img { height: 28px; }
.overlay-header .brand-main { font-size: 16px; }
.overlay-header .brand-sub { font-size: 10px; }
.overlay-close { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: background 0.2s ease; }
.overlay-close:hover { background: #f1f5f9; }
.overlay-menu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.overlay-menu a { 
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px; 
  color: var(--fg); 
  text-decoration: none; 
  transition: color 0.2s ease, transform 0.2s ease;
}
.overlay-menu a:hover { transform: translateX(4px); }
.overlay-menu a.active { color: var(--brand-primary); }
.overlay-social { display: flex; gap: 20px; margin-top: 24px; }
.overlay-social .ig svg { width: 28px; height: 28px; }

.layout { display: block; min-height: 100vh; }
.content { max-width: 1200px; margin: 0 auto; padding: 90px 20px 40px; min-height: calc(100svh - 180px); box-sizing: border-box; }
/* Admin sub-pages: extra bottom padding so trailing content clears the fixed footer. */
body:has(.admin-back-link) main.content { padding-bottom: 80px; }
.content.content-home { max-width: 1600px; }
/* Homepage parallax hero only: trim the top clearance so the grid sits closer
   to the header (other hero modes and gallery pages keep the default padding). */
.content.content-home:has(> .parallax-scroll) { padding-top: 92px; }
/* Adjust content padding when submenu is visible */
body.submenu-visible .content { padding-top: 128px; }

/* About/Contact layout */
.about {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 36px;
  align-items: start;
}
.about .portrait {
  overflow: hidden;
  border-radius: 20px;
}
.about .portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.8s ease-out, filter 0.8s ease-out;
  /* Strong desaturation — almost B&W until hover */
  filter: grayscale(0.92) contrast(1.08);
}
.about .portrait:hover img {
  transform: scale(1.03);
  filter: grayscale(0) contrast(1);
}
.about h1 { font-size: 34px; line-height: 1.2; margin: 6px 0 14px; }
.about p { margin: 14px 0; color: var(--muted); }
.about .cta a { color: #d26b6b; text-decoration: none; }
.about .cta a:hover { text-decoration: underline; }

.section-label { margin-top: 22px; margin-bottom: 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* Hero image adjustments - moved down on both desktop and mobile */
.hero { 
  margin: 34px auto 30px;
  width: min(1600px, 95vw);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 220px);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.26) 100%),
    #0b0b0b;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 35%, rgba(0, 0, 0, 0.32) 100%);
  z-index: 2;
}
.hero img { 
  width: 100%;
  height: 100%;
  display: block; 
  object-fit: cover;
}

/* Slideshow styles */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  z-index: 1;
}
.hero-slide--portrait {
  object-position: 50% 28%;
}
.hero-slide--landscape {
  object-position: 50% 50%;
}
.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

/* Homepage optional horizontal strip — large tiles, no frame (admin: horizontal strip) */
.hero-strip {
  margin: 24px auto 28px;
  width: 100%;
  max-width: none;
  position: relative;
  z-index: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
.hero-strip__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* proximity = gentle snap; mandatory felt abrupt / "hard" */
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scroll-padding-inline: 8px;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  padding: 8px 0 16px;
  gap: 16px;
  box-sizing: border-box;
  /* Open on the first image and center only when the images fit: "safe center"
     centers when there's room, else aligns to the start (first image) so the
     strip opens there and stays fully scrollable / arrow-navigable. */
  justify-content: safe center;
}
/* Strip is auto-focused for instant keyboard control; no visible focus ring. */
.hero-strip__track:focus,
.hero-strip__track:focus-visible {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-strip__track {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }
}
.hero-strip--gutter-compact .hero-strip__track {
  gap: 10px;
  padding: 6px 0 12px;
}
.hero-strip--gutter-cozy .hero-strip__track {
  gap: 16px;
  padding: 8px 0 16px;
}
.hero-strip--gutter-comfortable .hero-strip__track {
  gap: 24px;
  padding: 10px 0 20px;
}
.hero-strip__track:has(> .hero-strip__cell:only-child) {
  justify-content: center;
}
.hero-strip__cell {
  flex: 0 0 auto;
  height: clamp(360px, 78vh, 820px);
  width: auto;
  max-width: 92vw;
  aspect-ratio: 2 / 3;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  background: transparent;
  box-shadow: none;
  border: none;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  scroll-margin-inline: 0;
}
.hero-strip__cell--portrait {
  aspect-ratio: 2 / 3;
}
.hero-strip__cell--landscape {
  aspect-ratio: 3 / 2;
}
.hero-strip__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.hero-strip__cell--portrait .hero-strip__img {
  object-position: 50% 28%;
}
.hero-strip__cell--landscape .hero-strip__img {
  object-position: 50% 45%;
}
@media (max-width: 768px) {
  .hero-strip {
    margin: 16px auto 24px;
    width: 100%;
  }
  .hero-strip__cell {
    height: clamp(280px, 68vh, 620px);
    max-width: 92vw;
  }
}

.grid {
  column-count: 1;
  column-gap: 16px;
  max-width: 100%;
}
.grid.two-column-mobile {
  column-count: 2;
}
@media (min-width: 640px) { 
  .grid { column-count: 2; } 
  .grid.two-column-mobile { column-count: 2; }
}
@media (min-width: 940px) { 
  .grid { column-count: 3; } 
  .grid.two-column-mobile { column-count: 3; }
}

/* Desktop column overrides: optional 4-9 column layouts */
.grid.desktop-cols-4 { column-count: 1; }
.grid.desktop-cols-5 { column-count: 1; }
.grid.desktop-cols-6 { column-count: 1; }
.grid.desktop-cols-7 { column-count: 1; }
.grid.desktop-cols-8 { column-count: 1; }
.grid.desktop-cols-9 { column-count: 1; }

@media (min-width: 640px) {
  .grid.desktop-cols-4 { column-count: 2; }
  .grid.desktop-cols-5 { column-count: 2; }
  .grid.desktop-cols-6 { column-count: 2; }
  .grid.desktop-cols-7 { column-count: 2; }
  .grid.desktop-cols-8 { column-count: 2; }
  .grid.desktop-cols-9 { column-count: 2; }
}

@media (min-width: 940px) {
  .grid.desktop-cols-4 { column-count: 4; }
  .grid.desktop-cols-5 { column-count: 5; }
  .grid.desktop-cols-6 { column-count: 6; }
  .grid.desktop-cols-7 { column-count: 7; }
  .grid.desktop-cols-8 { column-count: 8; }
  .grid.desktop-cols-9 { column-count: 9; }
}

/* Keep mobile two-column layout when desktop is set to 4-9 */
@media (max-width: 939px) {
  .grid.two-column-mobile.desktop-cols-3,
  .grid.two-column-mobile.desktop-cols-4,
  .grid.two-column-mobile.desktop-cols-5,
  .grid.two-column-mobile.desktop-cols-6,
  .grid.two-column-mobile.desktop-cols-7,
  .grid.two-column-mobile.desktop-cols-8,
  .grid.two-column-mobile.desktop-cols-9 {
    column-count: 2;
  }
}

/* Scatter layout (desktop only) */
.grid.scatter-layout {
  position: relative;
  column-count: unset;
  column-gap: 0;
}
.grid.scatter-layout .tile {
  position: absolute;
  margin-bottom: 0;
}

@media (max-width: 939px) {
  .grid.scatter-layout {
    position: relative;
    column-count: 1;
    column-gap: 16px;
  }
  .grid.scatter-layout .tile {
    position: relative;
    margin-bottom: 20px;
    transform: none !important;
  }
}

/* Scatter layout custom background (desktop only) - full width */
@media (min-width: 940px) {
  body:has(.grid.scatter-layout.scatter-bg) {
    background: #f5f1e8;
  }
  .grid.scatter-layout {
    padding: 40px 20px;
  }
}

/* Gutter sizing (desktop-focused; mobile still stacks columns) */
.grid.gutter-compact { column-gap: 10px; }
.grid.gutter-cozy { column-gap: 16px; }
.grid.gutter-comfortable { column-gap: 24px; }
.grid.gutter-compact .tile { margin-bottom: 12px; }
.grid.gutter-cozy .tile { margin-bottom: 20px; }
.grid.gutter-comfortable .tile { margin-bottom: 26px; }

/* Corner radius variants */
.grid.radius-square .tile,
.grid.radius-square .tile img { border-radius: 0; }
.grid.radius-soft .tile,
.grid.radius-soft .tile img { border-radius: 6px; }
.grid.radius-round .tile,
.grid.radius-round .tile img { border-radius: 12px; }
.grid.radius-pill .tile,
.grid.radius-pill .tile img { border-radius: 999px; }

/* Hover styles (desktop) */
.tile img { 
  width: 100%; 
  height: auto; 
  display: block; 
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  backface-visibility: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  pointer-events: auto;
}
.grid.hover-lift .tile:hover img {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.26);
  border: 1px solid #aaaaaa;
}
.grid.hover-shadow .tile img {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.grid.hover-shadow .tile:hover img {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transform: none;
}
.grid.hover-none .tile img,
.grid.hover-none .tile:hover img {
  box-shadow: none;
  transform: none;
}

/* Scatter layout hover effect - straighten and lift */
.grid.scatter-layout .tile {
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), filter 0.35s ease;
}

.grid.scatter-layout .tile:hover {
  transform: rotate(0deg) scale(1.05) !important;
  z-index: 100 !important;
}

/* Desktop: blur non-hovered tiles while one scatter tile is hovered (JS adds .scatter-peers-blur on #grid) */
@media (min-width: 940px) {
  .grid.scatter-layout.scatter-peers-blur .tile:not(:hover) {
    filter: blur(2.5px);
  }
}

/* Scatter + Polaroid-style frame (desktop only; matches scatter JS breakpoint 940px) */
@media (min-width: 940px) {
  .grid.scatter-layout.scatter-polaroid .tile {
    box-sizing: border-box;
    /* Matte paper + very light “foxing” (reference: warm spots, not heavy) */
    background-color: #f6f4ef;
    background-image:
      radial-gradient(ellipse 28% 22% at 14% 16%, rgba(188, 145, 95, 0.07), transparent 62%),
      radial-gradient(ellipse 22% 18% at 78% 82%, rgba(165, 125, 88, 0.05), transparent 58%),
      radial-gradient(ellipse 120% 80% at 18% 22%, rgba(255, 255, 255, 0.75), transparent 55%),
      radial-gradient(ellipse 100% 70% at 85% 72%, rgba(0, 0, 0, 0.035), transparent 45%),
      linear-gradient(168deg, #faf9f6 0%, #f2f0ea 45%, #e9e6de 100%);
    /* Slight top/side padding; larger bottom for the “lip” below the print */
    padding: 10px 10px 28px 10px;
    border-radius: 3px 2px 4px 3px;
    /* Light from top-left: soft cast shadow to bottom-right + faint top/left edge highlight */
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.1),
      0 4px 12px rgba(0, 0, 0, 0.06),
      0 1px 0 rgba(255, 255, 255, 0.75) inset,
      1px 1px 0 rgba(255, 255, 255, 0.35) inset,
      0 -1px 1px rgba(0, 0, 0, 0.035) inset;
  }
  /* Specks, faint grain, hairline scratches — paper only, under the photo */
  .grid.scatter-layout.scatter-polaroid .tile::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.34;
    mix-blend-mode: multiply;
    background-image:
      /* Fine matte grain (whole surface, very light) */
      repeating-linear-gradient(
        0deg,
        rgba(40, 35, 30, 0.018) 0px,
        transparent 1px,
        transparent 4px,
        rgba(40, 35, 30, 0.012) 4px,
        transparent 5px
      ),
      repeating-linear-gradient(
        90deg,
        rgba(40, 35, 30, 0.015) 0px,
        transparent 1px,
        transparent 4px,
        rgba(40, 35, 30, 0.01) 4px,
        transparent 5px
      ),
      /* Slightly stronger cross-hatch on bottom lip only */
      repeating-linear-gradient(
        45deg,
        transparent 0px,
        transparent 4px,
        rgba(35, 30, 26, 0.04) 4px,
        rgba(35, 30, 26, 0.04) 5px,
        transparent 5px,
        transparent 9px
      ),
      repeating-linear-gradient(
        -45deg,
        transparent 0px,
        transparent 4px,
        rgba(35, 30, 26, 0.035) 4px,
        rgba(35, 30, 26, 0.035) 5px,
        transparent 5px,
        transparent 9px
      ),
      /* Tiny pepper specks */
      radial-gradient(ellipse 1.2px 1.2px at 18% 24%, rgba(30, 26, 22, 0.09), transparent 100%),
      radial-gradient(ellipse 1px 1px at 62% 71%, rgba(30, 26, 22, 0.075), transparent 100%),
      radial-gradient(ellipse 1px 1px at 84% 19%, rgba(30, 26, 22, 0.065), transparent 100%),
      radial-gradient(ellipse 1.1px 1.1px at 41% 56%, rgba(30, 26, 22, 0.08), transparent 100%),
      radial-gradient(ellipse 1px 1px at 73% 38%, rgba(30, 26, 22, 0.06), transparent 100%),
      /* Hairline scratches */
      linear-gradient(118deg, transparent 44%, rgba(30, 26, 22, 0.04) 44.4%, transparent 45.2%),
      linear-gradient(72deg, transparent 58%, rgba(30, 26, 22, 0.032) 58.35%, transparent 59.2%),
      linear-gradient(156deg, transparent 22%, rgba(30, 26, 22, 0.028) 22.5%, transparent 23.5%),
      linear-gradient(201deg, transparent 66%, rgba(30, 26, 22, 0.035) 66.4%, transparent 67.5%),
      linear-gradient(45deg, transparent 82%, rgba(30, 26, 22, 0.03) 82.25%, transparent 83.2%);
    background-size:
      100% 100%,
      100% 100%,
      100% 32px,
      100% 32px,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%;
    background-position:
      0 0,
      0 0,
      bottom,
      bottom,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
    background-repeat: no-repeat, no-repeat, repeat-x, repeat-x, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  }
  /*
   * Recessed print: shadow strongest along top + left inner edge of window (reference),
   * no outer lift — stays “in” the mat.
   */
  .grid.scatter-layout.scatter-polaroid .tile img {
    position: relative;
    z-index: 2;
    border: none;
    border-radius: 2px;
    transform: none;
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.34),
      inset 0 5px 14px rgba(0, 0, 0, 0.18),
      inset 4px 0 12px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(0, 0, 0, 0.08),
      inset 1px 0 0 rgba(0, 0, 0, 0.06),
      inset 0 -1px 5px rgba(255, 255, 255, 0.07);
  }
  .grid.scatter-layout.scatter-polaroid.hover-lift .tile:hover img {
    transform: translateY(-1px);
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.34),
      inset 0 5px 14px rgba(0, 0, 0, 0.18),
      inset 4px 0 12px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(0, 0, 0, 0.08),
      inset 1px 0 0 rgba(0, 0, 0, 0.06),
      inset 0 -1px 5px rgba(255, 255, 255, 0.07);
  }
  .grid.scatter-layout.scatter-polaroid.hover-shadow .tile img {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.34),
      inset 0 5px 14px rgba(0, 0, 0, 0.18),
      inset 4px 0 12px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(0, 0, 0, 0.08),
      inset 1px 0 0 rgba(0, 0, 0, 0.06),
      inset 0 -1px 5px rgba(255, 255, 255, 0.07);
  }
  .grid.scatter-layout.scatter-polaroid.hover-shadow .tile:hover img {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.34),
      inset 0 5px 14px rgba(0, 0, 0, 0.18),
      inset 4px 0 12px rgba(0, 0, 0, 0.12),
      inset 0 1px 0 rgba(0, 0, 0, 0.08),
      inset 1px 0 0 rgba(0, 0, 0, 0.06),
      inset 0 -1px 5px rgba(255, 255, 255, 0.07);
  }
  /* Override gallery corner-radius presets for the polaroid outer frame */
  .grid.scatter-layout.scatter-polaroid.radius-square .tile,
  .grid.scatter-layout.scatter-polaroid.radius-soft .tile,
  .grid.scatter-layout.scatter-polaroid.radius-round .tile,
  .grid.scatter-layout.scatter-polaroid.radius-pill .tile {
    border-radius: 3px 2px 4px 3px;
  }
  .grid.scatter-layout.scatter-polaroid.radius-square .tile img,
  .grid.scatter-layout.scatter-polaroid.radius-soft .tile img,
  .grid.scatter-layout.scatter-polaroid.radius-round .tile img,
  .grid.scatter-layout.scatter-polaroid.radius-pill .tile img {
    border-radius: 2px;
  }
}

.tile {
  break-inside: avoid;
  margin-bottom: 20px;
  cursor: pointer;
  position: relative;
  /* Subtle background while image loads */
  background: #f5f5f5;
  border-radius: 6px;
  /* Tiles no longer animate individually - grid handles it */
}

/* Optional per-image caption (shown only in desktop scatter polaroid mode) */
.tile-polaroid-caption {
  display: none;
}

@media (min-width: 940px) {
  .grid.scatter-layout.scatter-polaroid .tile .tile-polaroid-caption {
    display: block;
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    z-index: 3;
    color: #555047;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  }
}

/* Parallax scroll (desktop 4-column; narrow + two-column-mobile uses 2 columns in JS) */
.grid.parallax-scroll.desktop-cols-4 .tile {
  will-change: transform;
}

/* Homepage parallax hero only: no zoom-on-click (index does not ship #lightbox); keep default cursor */
.grid.home-parallax-no-lightbox .tile img {
  cursor: default;
  -webkit-user-drag: none;
  user-select: none;
}

/* Mobile favorite button (single-column mobile only) */
.tile-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tile-favorite-btn:active {
  transform: scale(0.9);
}

.tile-favorite-btn.favorited {
  color: #ff4757;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  font-size: 19px;
}

/* Show on mobile single-column only */
@media (max-width: 640px) {
  .tile-favorite-btn {
    display: flex;
  }
  
  /* Hide in two-column mobile mode (lightbox works there) */
  .grid.two-column-mobile .tile-favorite-btn {
    display: none;
  }
}

/* Show on mobile favorites page */
@media (max-width: 640px) {
  .tile-favorite-btn.favorites-page-btn {
    display: flex;
  }
}

/* Always hide on desktop (use lightbox instead) */
@media (min-width: 641px) {
  .tile-favorite-btn {
    display: none !important;
  }
}

/* Proof gallery: flag bar and bulk mode */
/* Optional proof-gallery PDFs (gallery-pdf.php) */
details.proof-documents {
  margin-bottom: 20px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
}
details.proof-documents > summary.proof-documents-summary {
  margin: 0;
  padding: 14px 16px;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: footer-updating-blink 1.2s ease-in-out infinite;
}
details.proof-documents > summary.proof-documents-summary::-webkit-details-marker {
  display: none;
}
details.proof-documents > summary.proof-documents-summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--brand-primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
details.proof-documents[open] > summary.proof-documents-summary::after {
  transform: rotate(180deg);
}
details.proof-documents > summary.proof-documents-summary:hover {
  color: #6b1515;
}
details.proof-documents > summary.proof-documents-summary:hover::after {
  border-top-color: #6b1515;
}
.proof-documents-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.proof-documents-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}
.proof-doc-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* Centered row on desktop; full-width column on narrow screens */
  flex: 0 1 220px;
  width: min(100%, 280px);
  max-width: 280px;
  min-width: 0;
}
@media (max-width: 480px) {
  .proof-doc-card {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
}
.proof-doc-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 180px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8e8e8;
  border: 1px solid var(--border);
}
.proof-doc-preview {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
img.proof-doc-preview {
  object-fit: contain;
  background: #f0f0f0;
}
.proof-doc-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
}
.proof-doc-download {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent, var(--fg));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.proof-doc-download:hover {
  opacity: 0.85;
}

.gallery-download-wrap {
  margin: 0 0 20px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--brand-primary-border-muted);
  background: linear-gradient(180deg, #fff 0%, #faf8f6 100%);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.gallery-download-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 4px 14px var(--brand-primary-ring-strong), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}
.gallery-download-btn:active {
  transform: translateY(0);
}
.gallery-download-icon {
  flex-shrink: 0;
  color: var(--brand-primary);
  opacity: 0.95;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.proof-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.proof-bulk-toggle {
  padding: 8px 16px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.proof-bulk-toggle:hover {
  opacity: 0.9;
}
.proof-bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.proof-bulk-label {
  font-size: 14px;
  color: var(--muted);
}
.proof-stats {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}
.proof-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proof-stat strong {
  font-weight: 600;
  color: var(--fg);
}
.proof-stat-total::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); opacity: 0.6; }
.proof-stat-green::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; }
.proof-stat-yellow::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ca8a04; }
.proof-stat-red::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #dc2626; }
.proof-stat-unmarked::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.proof-stat-total strong { color: var(--fg); }
.proof-stat-green strong { color: #16a34a; }
.proof-stat-yellow strong { color: #ca8a04; }
.proof-stat-red strong { color: #dc2626; }
.proof-stat-unmarked strong { color: var(--muted); }
@media (max-width: 640px) {
  .proof-toolbar { flex-wrap: wrap; gap: 8px; }
  .proof-stats { gap: 8px; font-size: 12px; flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .proof-bulk-toggle, .proof-remove-all-btn { font-size: 12px; padding: 6px 12px; border-radius: 6px; line-height: 1.4; }
  .proof-bulk-toggle { order: -2; }
  .proof-remove-all-btn { order: -1; margin-left: auto; }
}
.proof-remove-all-btn {
  margin-left: auto;
  padding: 8px 16px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.proof-remove-all-btn:hover {
  opacity: 0.9;
}
.proof-gallery-comment {
  margin: 16px auto 0;
  max-width: 600px;
  padding: 0;
}
.proof-gallery-comment-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg, #fff);
  margin-bottom: 8px;
}
.proof-gallery-comment-textarea {
  width: 100%;
  min-height: 56px;
  max-height: 200px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.12));
  color: var(--fg, #fff);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}
.proof-gallery-comment-textarea::placeholder {
  color: var(--muted, rgba(255,255,255,0.35));
}
.proof-gallery-comment-textarea:focus {
  outline: none;
  border-bottom-color: var(--brand-primary, #3b82f6);
}
.proof-gallery-comment-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.proof-gallery-comment-counter {
  font-size: 11px;
  color: var(--muted, rgba(255,255,255,0.35));
  transition: opacity 0.2s ease, color 0.2s ease;
}
.proof-gallery-comment-counter.warn {
  color: #ca8a04;
  opacity: 1;
}
.proof-gallery-comment-counter.critical {
  color: #dc2626;
  opacity: 1;
}
.proof-gallery-comment-status {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted, rgba(255,255,255,0.4));
  transition: color 0.2s ease;
  margin-left: 6px;
}
.proof-gallery-comment-status.saved {
  color: #16a34a;
}
@media (max-width: 640px) {
  .proof-gallery-comment {
    margin: 12px auto 0;
  }
  .proof-gallery-comment-textarea {
    font-size: 16px;
    min-height: 48px;
  }
}
.proof-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  z-index: 12;
  cursor: pointer;
  accent-color: var(--brand-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.proof-bulk-mode .proof-select-checkbox {
  opacity: 1;
}
body.proof-bulk-mode .proof-remove-all-btn {
  display: none;
}
body.proof-bulk-mode .proof-toolbar {
  position: fixed;
  bottom: 52px; /* Above fixed footer (footer ~48px) */
  left: 0;
  right: 0;
  z-index: 50;
  border-radius: 12px 12px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}
body.proof-bulk-mode {
  padding-bottom: 120px; /* Bulk bar + footer height */
}
/* In bulk mode: hide pills only on unmarked images; show on flagged so user can see/change them */
body.proof-bulk-mode .proof-flag-bar {
  opacity: 0;
  pointer-events: none;
}
body.proof-bulk-mode .tile[data-proof-flag="green"] .proof-flag-bar,
body.proof-bulk-mode .tile[data-proof-flag="yellow"] .proof-flag-bar,
body.proof-bulk-mode .tile[data-proof-flag="red"] .proof-flag-bar {
  opacity: 1;
  pointer-events: auto;
}
/* Flagged tiles: dark overlay to show they're worked on */
.tile[data-proof-flag="green"]::after,
.tile[data-proof-flag="yellow"]::after,
.tile[data-proof-flag="red"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
}
/* Shared pill design for per-image and bulk flag bars */
.proof-flag-bar,
.proof-flag-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 5px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.proof-flag-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  transition: opacity 0.2s ease;
  max-width: calc(100% - 12px);
}
@media (max-width: 640px) {
  .proof-flag-bar .proof-flag-btn {
    min-width: 36px;
    height: 26px;
    font-size: 10px;
    padding: 0 7px;
    gap: 3px;
  }
  .proof-flag-bar .proof-flag-btn .proof-flag-icon {
    width: 6px;
    height: 6px;
  }
  .proof-flag-bar {
    gap: 3px;
    padding: 3px 4px;
  }
}
.proof-flag-pill {
  display: inline-flex;
  background: #222;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.proof-flag-btn {
  height: 28px;
  min-width: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  position: relative;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.proof-flag-btn .proof-flag-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.proof-flag-btn.proof-flag-red .proof-flag-icon { background: rgba(248, 113, 113, 0.7); }
.proof-flag-btn.proof-flag-yellow .proof-flag-icon { background: rgba(250, 204, 21, 0.7); }
.proof-flag-btn.proof-flag-green .proof-flag-icon { background: rgba(74, 222, 128, 0.7); }
.proof-flag-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.03);
}
.proof-flag-btn.proof-flag-red { color: rgba(248, 113, 113, 0.6); }
.proof-flag-btn.proof-flag-yellow { color: rgba(250, 204, 21, 0.6); }
.proof-flag-btn.proof-flag-green { color: rgba(74, 222, 128, 0.6); }
/* When one is selected, dim the others */
.proof-flag-bar:has(.active) .proof-flag-btn:not(.active),
.proof-flag-pill:has(.active) .proof-flag-btn:not(.active) {
  opacity: 0.3;
}
.proof-flag-bar:has(.active) .proof-flag-btn:not(.active).proof-flag-red,
.proof-flag-pill:has(.active) .proof-flag-btn:not(.active).proof-flag-red { color: rgba(248, 113, 113, 0.2); }
.proof-flag-bar:has(.active) .proof-flag-btn:not(.active).proof-flag-yellow,
.proof-flag-pill:has(.active) .proof-flag-btn:not(.active).proof-flag-yellow { color: rgba(250, 204, 21, 0.2); }
.proof-flag-bar:has(.active) .proof-flag-btn:not(.active).proof-flag-green,
.proof-flag-pill:has(.active) .proof-flag-btn:not(.active).proof-flag-green { color: rgba(74, 222, 128, 0.2); }
.proof-flag-btn.proof-flag-red:hover { color: rgba(252, 165, 165, 0.7); }
.proof-flag-btn.proof-flag-yellow:hover { color: rgba(253, 224, 71, 0.7); }
.proof-flag-btn.proof-flag-green:hover { color: rgba(134, 239, 172, 0.7); }
.proof-flag-btn.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.proof-flag-btn.active .proof-flag-icon {
  box-shadow: 0 0 4px currentColor;
}
.proof-flag-btn.proof-flag-red.active {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
}
.proof-flag-btn.proof-flag-red.active .proof-flag-icon { background: #fff; }
.proof-flag-btn.proof-flag-yellow.active {
  background: rgba(161, 98, 7, 0.85);
  color: #fef08a;
}
.proof-flag-btn.proof-flag-yellow.active .proof-flag-icon { background: #fef08a; }
.proof-flag-btn.proof-flag-green.active {
  background: rgba(22, 163, 74, 0.85);
  color: #fff;
}
.proof-flag-btn.proof-flag-green.active .proof-flag-icon { background: #fff; }

/* Grid-level fade-in animation - smooth single pass */
.grid {
  opacity: 0;
  animation: fadeInGrid 0.8s ease forwards;
  animation-delay: 0.1s;
}

@keyframes fadeInGrid {
  from { 
    opacity: 0;
  }
  to { 
    opacity: 1;
  }
}

/* Scatter layout - hide until all images positioned */
.grid.scatter-layout {
  visibility: hidden;
  opacity: 0;
  animation: none; /* Override default grid animation */
}

.grid.scatter-layout.scatter-ready {
  visibility: visible;
  opacity: 0;
  animation: fadeInGrid 0.6s ease forwards;
  animation-delay: 0s;
}

/* Masonry layout - hide until JS positions tiles, then fade in.
   When JS does not run, the grid keeps the default CSS column layout as a fallback. */
.grid.masonry-pending {
  visibility: hidden;
  opacity: 0;
  animation: none;
}

.grid.masonry-ready {
  /* Disable CSS column layout so absolute-positioned tiles control sizing */
  column-count: unset !important;
  visibility: visible;
  opacity: 0;
  animation: fadeInGrid 0.6s ease forwards;
  animation-delay: 0s;
}

.grid.masonry-ready .tile {
  position: absolute;
  margin-bottom: 0;
  break-inside: auto;
}

/* Loading indicator for scatter layouts */
.grid-loader {
  position: absolute;
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--muted);
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.grid.scatter-ready .grid-loader {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

.grid-loader p {
  font-size: 14px;
  margin: 0;
}

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

/* Remove box-shadow on mobile two-column galleries to fix rendering artifacts */
@media (max-width: 940px) {
  .grid.two-column-mobile .tile img {
    box-shadow: none;
  }
  .grid.two-column-mobile .tile:hover img {
    box-shadow: none;
  }
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.gallery-card h3 { margin: 0 0 6px 0; font-size: 16px; }
.gallery-card .meta { color: var(--muted); font-size: 13px; }

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox-backdrop.open { display: flex; opacity: 1; }
.lightbox-content img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: lightboxZoom 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}
@keyframes lightboxZoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-controls { position: fixed; inset: 0; display: none; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 1001; pointer-events: none; }
.lightbox-backdrop.open + .lightbox-controls { display: flex; }
.lightbox-btn { background: rgba(255,255,255,0.4); border: none; border-radius: 999px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto; opacity: 0.6; transition: opacity 0.2s, background 0.2s; }
.lightbox-btn:hover { background: rgba(255,255,255,0.7); opacity: 1; }

.lightbox-close { position: fixed; top: 20px; right: 20px; z-index: 1002; background: rgba(255,255,255,0.4); border: none; border-radius: 999px; width: 36px; height: 36px; display: none; align-items: center; justify-content: center; cursor: pointer; opacity: 0.6; transition: opacity 0.2s, background 0.2s; }
.lightbox-backdrop.open ~ .lightbox-close { display: flex; }
.lightbox-close:hover { background: rgba(255,255,255,0.7); opacity: 1; }
.lightbox-favorite { position: fixed; top: 20px; right: 66px; z-index: 1002; background: rgba(255,255,255,0.4); border: none; border-radius: 999px; width: 36px; height: 36px; display: none; align-items: center; justify-content: center; cursor: pointer; opacity: 0.6; transition: all 0.2s; pointer-events: auto; }
.lightbox-backdrop.open ~ .lightbox-favorite { display: flex; }
.lightbox-favorite:hover { background: rgba(255,255,255,0.7); opacity: 1; transform: scale(1.05); }
.lightbox-favorite.favorited svg path { fill: var(--brand-primary); stroke: var(--brand-primary); }
.lightbox-favorite.favorited { opacity: 1; }

/* Modal */
/* Proof gallery: remove-all-flags confirmation (visitor) */
.proof-clear-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.proof-clear-modal-overlay.is-open {
  display: flex;
}
.proof-clear-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 8, 8, 0.5);
  backdrop-filter: blur(2px);
}
.proof-clear-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: linear-gradient(180deg, #fffefb 0%, #faf8f5 100%);
  border: 2px solid var(--brand-primary);
  border-radius: 14px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow:
    0 4px 24px color-mix(in srgb, var(--brand-primary), transparent 82%),
    0 24px 48px rgba(40, 10, 10, 0.12);
}
.proof-clear-modal-title {
  margin: 0 0 0.65rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: #5c1818;
  letter-spacing: -0.02em;
}
.proof-clear-modal-text {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}
.proof-clear-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.proof-clear-modal-cancel.btn {
  border-color: #c4c4c4;
  background: #fff;
}
.proof-clear-modal-confirm.btn {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  font-weight: 600;
}
.proof-clear-modal-confirm.btn:hover {
  background: #6f1818;
  border-color: #6f1818;
}

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 1100; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; color: var(--fg); border: 1px solid var(--border); border-radius: 12px; width: min(560px, 92vw); box-shadow: var(--shadow); }
.modal .body { padding: 22px; color: var(--muted); }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }

/* Adult Modal - styled like contact page */
.modal-adult { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0; width: min(700px, 92vw); overflow: hidden; }
.modal-adult .modal-image { overflow: hidden; position: relative; }
.modal-adult .modal-image img { width: 100%; height: 100%; object-fit: cover; display: block; filter: blur(12px); transform: scale(1.05); }
.modal-adult .modal-body { padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; }
.modal-adult .modal-body h2 { margin: 0 0 12px; font-size: 22px; font-weight: 600; line-height: 1.2; }
.modal-adult .modal-body p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.modal-adult .modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-adult .btn { width: 100%; text-align: center; }

/* Text-only adult modal (no image) */
.modal-adult-text-only { display: block; width: min(480px, 92vw); }
.modal-adult-text-only .modal-body { padding: 40px 48px; }

.btn { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--fg); cursor: pointer; font-size: 13px; transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.btn.primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.btn.primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); opacity: 1; transform: translateY(-1px); }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }

@media (max-width: 640px) {
  .modal-adult { grid-template-columns: 1fr; max-height: 90vh; }
  .modal-adult .modal-image { max-height: 200px; }
  .modal-adult-text-only .modal-body { padding: 32px 24px; }
}

.notice {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 10px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.form {
  max-width: 520px;
}
.form label { display: block; margin: 12px 0 6px; color: var(--muted); }
.form input, .form textarea, .form button {
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.form button { cursor: pointer; }

.footer { 
  color: var(--muted); 
  padding: 14px 20px; 
  font-size: 13px; 
  position: fixed; 
  bottom: 0; 
  left: 0; 
  right: 0; 
  background: var(--bg); 
  z-index: 100;
  transition: transform 0.3s ease;
}
@media (max-width: 768px) {
  .footer.footer--admin {
    display: none;
  }
}
.footer .admin-link { opacity: 0; transition: opacity 0.3s ease; font-size: 11px; margin-left: 4px; text-decoration: none; }
.footer:hover .admin-link { opacity: 0.4; }
.footer .admin-link:hover { opacity: 1 !important; text-decoration: none; }
.footer-updating-sep { color: var(--muted); }
.footer-updating,
.proof-pdf-on-server {
  color: var(--brand-primary);
  font-weight: 500;
  animation: footer-updating-blink 1.2s ease-in-out infinite;
}
.footer-no-license {
  color: var(--brand-primary);
  font-weight: 500;
}
@keyframes footer-updating-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; padding: 16px 16px; }
  /* Bottom padding clears the fixed .footer (which wraps to ~2 lines on mobile)
     plus the iOS home-indicator safe area, so trailing content (e.g. the
     contact form's Send Message button) isn't hidden behind it. */
  .content { padding: 140px 16px calc(env(safe-area-inset-bottom, 0px) + 100px); }
  /* Homepage parallax hero only: tighter top clearance on mobile too. */
  .content.content-home:has(> .parallax-scroll) { padding-top: 92px; }
  .grid { column-gap: 12px; }
}

/* Hero image adjustments for mobile */
@media (max-width: 768px) {
  .hero {
    margin: 20px auto 40px;
    width: min(100%, 95vw);
    max-height: calc(100vh - 280px);
    aspect-ratio: 4 / 5;
  }
  .hero.hero--landscape {
    aspect-ratio: 16 / 10;
  }
  .hero-slide--portrait {
    object-position: 50% 26%;
  }
  .hero-slide--landscape {
    object-position: 50% 50%;
  }
}

/* Mobile menu - Hamburger → full-screen overlay (≤768px, overlay mode) */
@media (max-width: 768px) {
  html:not([data-mobile-menu="scroll"]) .nav { border-bottom: 1px solid var(--border); }
  html:not([data-mobile-menu="scroll"]) .nav-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 12px 20px;
  }
  html:not([data-mobile-menu="scroll"]) .brand { padding: 0; }
  html:not([data-mobile-menu="scroll"]) .links { display: none !important; }
  html:not([data-mobile-menu="scroll"]) .submenu-container { display: none !important; }
  html:not([data-mobile-menu="scroll"]) .more {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    color: var(--fg);
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, opacity 0.2s ease;
  }
  html:not([data-mobile-menu="scroll"]) .more:hover { background: rgba(0,0,0,0.04); opacity: 0.85; }
  html:not([data-mobile-menu="scroll"]) .more svg { flex-shrink: 0; }
  html:not([data-mobile-menu="scroll"]) body.submenu-visible .content { padding-top: 90px; }

  /* Overlay menu (mobile only): structured sections, main vs sub */
  html:not([data-mobile-menu="scroll"]) .overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(246, 242, 238, 0.86) 100%);
  }
  .overlay-menu {
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 20px 34px;
    justify-content: flex-start;
  }
  html:not([data-mobile-menu="scroll"]) .overlay-header,
  html:not([data-mobile-menu="scroll"]) .overlay-menu-section,
  html:not([data-mobile-menu="scroll"]) .overlay-social {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.56s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  }
  html:not([data-mobile-menu="scroll"]) .overlay.open .overlay-header {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.08s;
  }
  html:not([data-mobile-menu="scroll"]) .overlay.open .overlay-menu-section {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.16s;
  }
  html:not([data-mobile-menu="scroll"]) .overlay.open .overlay-menu-section-actions {
    transition-delay: 0.24s;
  }
  html:not([data-mobile-menu="scroll"]) .overlay.open .overlay-social {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
  }
  .overlay-menu-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 32px;
    background: transparent; /* no grey card behind submenu groups */
  }
  .overlay-menu-section-actions { padding-bottom: 24px; }
  .overlay-menu-section-actions .overlay-menu-main { margin-bottom: 10px; }
  .overlay-menu-section-actions .overlay-menu-main:last-child { margin-bottom: 0; }
  .overlay-menu-label {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted, #94a3b8);
    margin-bottom: 14px;
    padding-left: 2px;
  }
  .overlay-menu-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 20px;
    background: transparent; /* ensure child groups also have no background */
  }
  .overlay-menu-group:last-child { margin-bottom: 0; }
  .overlay-menu-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }
  .overlay-menu-head .nav-gallery-until {
    font-size: 12px;
    letter-spacing: 0.02em;
    padding-left: 2px;
    line-height: 1.35;
    color: rgba(61, 61, 61, 0.78);
    max-width: 100%;
    white-space: normal;
  }
  .overlay-menu-main {
    font-size: 18px;
    font-weight: 600;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 2px;
  }
  .overlay-menu-children {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
    margin-left: 16px;
    padding-left: 14px;
    border-left: 2px solid rgba(0,0,0,0.08);
    gap: 6px;
    background: transparent; /* keep vertical line but no grey background */
  }
  .overlay-menu a {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--fg);
    text-decoration: none;
    transition: color 0.24s ease, transform 0.28s ease;
  }
  .overlay-menu a:hover { transform: translateX(6px); }
  .overlay-menu a.active { color: var(--brand-primary); }
  .overlay-item-child {
    font-size: 11px;
    font-weight: 400;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 0;
    color: #3d3d3d; /* more greyish for submenu items */
  }
  .overlay-item-child:hover,
  .overlay-item-child.active { color: var(--brand-primary); }
  .overlay-social { margin-top: 8px; }
  .overlay-close {
    width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.06); color: var(--fg);
    transition: background 0.24s ease, transform 0.28s ease;
  }
  .overlay-close:hover { background: rgba(0,0,0,0.1); transform: rotate(90deg); }
  .overlay-close svg { width: 20px; height: 20px; }
}

/* Mobile menu - Scroll strip (original, ≤768px only, all orientations): stacked — brand above, full-width strip below */
@media (max-width: 768px) {
  html[data-mobile-menu="scroll"] .nav { border-bottom: 1px solid var(--border); }
  html[data-mobile-menu="scroll"] .nav-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 12px 0 0;
  }
  html[data-mobile-menu="scroll"] .brand { padding: 0 20px 12px; flex-shrink: 0; }
  html[data-mobile-menu="scroll"] .more { display: none !important; }
  html[data-mobile-menu="scroll"] .links {
    display: flex !important;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    align-items: center;
    padding-bottom: 12px;
    padding-left: 20px;
    position: relative;
  }
  html[data-mobile-menu="scroll"] .menu-items {
    display: inline-flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 20px;
    padding-right: 48px;
    align-items: baseline;
  }
  html[data-mobile-menu="scroll"] .links::before,
  html[data-mobile-menu="scroll"] .links::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 1;
  }
  html[data-mobile-menu="scroll"] .links::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), rgba(255,255,255,0));
  }
  html[data-mobile-menu="scroll"] .links::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), rgba(255,255,255,0));
  }
  html[data-mobile-menu="scroll"] .menu-items::-webkit-scrollbar { display: none; }
  /* Drop the favorites link's extra right margin so heart->IG spacing matches the
     strip's consistent 20px gap (otherwise the IG icon sits too far right). */
  html[data-mobile-menu="scroll"] .menu-items > .favorites-link { margin-right: 0; }
  html[data-mobile-menu="scroll"] .overlay { display: none !important; }

  /* Submenu visible in scroll mode: in-flow below main strip */
  html[data-mobile-menu="scroll"] .submenu-container {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    border-bottom: 1px solid rgba(224, 224, 224, 0.6);
  }
  html[data-mobile-menu="scroll"] .submenu-container.show {
    max-height: 52px;
    opacity: 1;
  }
  html[data-mobile-menu="scroll"] .submenu {
    max-width: 100%;
    padding: 0 20px;
  }
  html[data-mobile-menu="scroll"] .submenu-inner {
    padding: 10px 0;
    padding-left: 0;
  }
  html[data-mobile-menu="scroll"] body.submenu-visible .content {
    padding-top: 200px;
  }
}

/* Header and footer auto-hide on gallery pages (all screen sizes) */
.nav.header-hidden {
  transform: translateY(-100%);
}

.submenu-container.header-hidden {
  transform: translateY(-100%);
}

.footer.footer-hidden {
  transform: translateY(100%);
}


@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
}

/* Gallery Intro Page - Split Screen with Parallax */

/* Main container: 50/50 split, full height */
.gallery-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  height: auto;
  min-height: auto;
  max-height: calc(100svh - 180px);
  align-items: stretch;
  padding: 20px 0;
}

/* Left side - Image container */
.intro-image {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-radius: 20px;
  max-height: calc(100svh - 180px);
  display: flex;
  align-items: center;
}

/* The actual image */
.intro-image img {
  width: 100%;
  height: 100%;
  max-height: calc(100svh - 180px);
  object-fit: cover;
  display: block;
  border-radius: 20px;
  transition: transform 0.8s ease-out, filter 0.8s ease-out;
  filter: grayscale(0.2) contrast(1.1);
}

/* Hover effect on the whole intro section */
.gallery-intro:hover .intro-image img {
  transform: scale(1.03);
  filter: grayscale(0) contrast(1);
}

/* Right side - Content container */
.intro-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  border-radius: 20px;
  animation: slideInRight 0.8s ease-out;
  max-height: calc(100svh - 180px);
  overflow-y: auto;
}

/* Slide-in animation definition */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Text wrapper */
.intro-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--fg);
}

/* Main title */
.intro-text h1 {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  color: #0a0a0a;
  position: relative;
  padding-bottom: 16px;
}

/* Animated red underline under title */
.intro-text h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--brand-primary);
  animation: expandWidth 0.6s ease-out 0.4s both;
}

@keyframes expandWidth {
  from { width: 0; }
  to { width: 60px; }
}

/* Subheadings */
.intro-text h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 32px 0 16px;
  font-weight: 600;
}

/* Paragraphs */
.intro-text p {
  font-size: 17px;
  line-height: 1.8;
  color: #4a4a4a;
  margin: 32px 0 48px;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bold text styling */
.intro-text strong, .intro-text b {
  font-weight: 600;
  color: var(--fg);
}

/* Italic text (red accent) */
.intro-text em, .intro-text i {
  font-style: italic;
  color: var(--brand-primary);
}

/* Button container */
.intro-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 16px;
}

/* Enter Gallery button */
.btn-intro {
  align-self: flex-start;
  background: #0a0a0a;
  color: #fff;
  border: 2px solid #0a0a0a;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Red background that slides in on hover */
.btn-intro::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--brand-primary);
  transition: left 0.3s ease;
  z-index: -1;
}

/* Hover: slide red background in, nudge button right */
.btn-intro:hover::before {
  left: 0;
}

.btn-intro:hover {
  border-color: var(--brand-primary);
  transform: translateX(4px);
  opacity: 1;
  text-decoration: none; /* Override global a:hover underline */
}

/* Keep the arrow animation */
.btn-intro::after {
  content: '→';
  font-size: 14px;
  margin-left: 8px;
  transition: transform 0.25s ease;
}

.btn-intro:hover::after {
  transform: translateX(4px);
}

/* ===== MOBILE ADJUSTMENTS ===== */
@media (max-width: 900px) {
  /* Stack vertically on mobile */
  .gallery-intro {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    max-height: none; /* Remove height constraint on mobile */
    padding: 0;
  }
  
  /* Image takes reasonable height on mobile */
  .intro-image {
    min-height: 50vh;
    max-height: 60vh; /* Cap image height to leave room for content */
    border-radius: 20px;
  }
  
  .intro-image img {
    border-radius: 20px;
  }
  
  /* Smaller text on mobile */
  .intro-text h1 {
    font-size: 32px;
    margin: 0 0 24px;
  }
  
  .intro-text h2 {
    font-size: 20px;
  }
  
  .intro-text {
    font-size: 15px;
  }
  
  .intro-text p {
    font-size: 15px;
    margin: 24px 0 32px;
  }
  
  /* Less padding on mobile - REMOVE height constraint for proper scrolling */
  .intro-content {
    padding: 40px 24px;
    max-height: none; /* Allow content to take natural height */
    overflow-y: visible; /* Allow natural scrolling */
  }
  
  /* Button with same inset as text on mobile */
  .intro-action {
    align-items: flex-start;
    margin-bottom: 20px; /* Add bottom margin for breathing room */
  }
}

/* Tablet size adjustment */
@media (max-width: 1200px) and (min-width: 901px) {
  .gallery-intro {
    padding: 16px 0;
  }
  
  .intro-content {
    padding: 50px 40px;
  }
  
  .intro-text h1 {
    font-size: 40px;
  }
}

/* Contact Page Styles */
.contact-subtitle {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: -6px 0 22px 0;
}

/* Collapsible text with Read more */
.collapsible-text {
  margin-bottom: 32px;
}

.text-preview {
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.4s ease;
  position: relative;
}

.text-preview.expanded {
  max-height: none;
}

.text-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.text-preview.expanded::after {
  opacity: 0;
}

.read-more-link {
  display: inline-block;
  color: var(--fg);
  text-decoration: underline;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.read-more-link:hover {
  color: var(--brand-primary);
}

/* Contact Form */
.contact-form {
  max-width: 100%;
  margin-top: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Checkbox styling */
.checkbox-group {
  margin: 22px 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label span {
  flex: 1;
}

/* Submit button - styled like intro button */
.btn-contact {
  background: #0a0a0a;
  color: #fff;
  border: 2px solid #0a0a0a;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-radius: 0;
}

.btn-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--brand-primary);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-contact:hover::before {
  left: 0;
}

.btn-contact:hover {
  border-color: var(--brand-primary);
  transform: translateX(4px);
}

.btn-contact::after {
  content: '→';
  font-size: 14px;
  margin-left: 8px;
  transition: transform 0.25s ease;
}

.btn-contact:hover::after {
  transform: translateX(4px);
}

/* Form messages */
.form-message {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.form-message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #81c784;
}

.form-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #e57373;
}

/* Mobile adjustments for contact form */
@media (max-width: 900px) {
  .contact-subtitle {
    font-size: 11px;
  }
  
  .text-preview {
    max-height: 100px;
  }
  
  .btn-contact {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .overlay-inner,
  .overlay-header,
  .overlay-menu-section,
  .overlay-social,
  .overlay-menu a,
  .overlay-close {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
}

/* Admin "Back to Admin" nav link (sub-page nav bars). */
.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}
.admin-back-link::before {
  content: "←";
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.admin-back-link:hover {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary), transparent 60%);
  background: color-mix(in srgb, var(--brand-primary), transparent 95%);
  box-shadow: 0 1px 4px var(--brand-primary-soft);
}
.admin-back-link:hover::before {
  transform: translateX(-3px);
}
.admin-back-link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Admin sub-pages: nav + “Back to Admin” must not clip on narrow screens */
@media (max-width: 768px) {
  .nav-inner:has(.admin-back-link) {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav-inner:has(.admin-back-link) .brand {
    flex: 1 1 100%;
    min-width: 0;
  }
  .nav-inner:has(.admin-back-link) .brand a {
    min-width: 0;
  }
  .nav-inner:has(.admin-back-link) .brand span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .nav-inner:has(.admin-back-link) .admin-back-link {
    margin-left: auto;
    max-width: 100%;
  }
}

/* Admin/editor pages linked from dashboard: predictable widths, fewer horizontal overflows */
@media (max-width: 768px) {
  body:has(.admin-back-link) main.content {
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: max(40px, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  }
  body:has(.admin-back-link) input[type="text"],
  body:has(.admin-back-link) input[type="email"],
  body:has(.admin-back-link) input[type="password"],
  body:has(.admin-back-link) input[type="url"],
  body:has(.admin-back-link) input[type="number"],
  body:has(.admin-back-link) textarea,
  body:has(.admin-back-link) select {
    box-sizing: border-box;
    max-width: 100%;
  }
  body:has(.admin-back-link) main.content [style*="1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  body:has(.admin-back-link) main.content [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  body:has(.admin-back-link) main.content [style*="grid-template-columns: 200px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  body:has(.admin-back-link) .toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  /* Save / action rows: avoid clipping (body uses overflow-x: hidden) */
  body:has(.admin-back-link) .toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    min-width: 0;
    max-width: 100%;
  }
  body:has(.admin-back-link) .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
  }
  body:has(.admin-back-link) .toolbar-actions .btn,
  body:has(.admin-back-link) .toolbar-actions > .btn,
  body:has(.admin-back-link) .toolbar-actions > a {
    min-width: 0;
  }
  body:has(.admin-back-link) .editor-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }
  body:has(.admin-back-link) .editor-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

/* Child gallery thumbnail cards */
.child-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding: 20px 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.child-gallery-card {
  display: block;
  text-decoration: none;
  color: var(--fg);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
}

.child-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.child-gallery-thumb {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.child-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.child-gallery-card:hover .child-gallery-thumb img {
  transform: scale(1.04);
}

.child-gallery-thumb.child-gallery-empty {
  background: var(--border, #e5e7eb);
}

.child-gallery-label {
  display: block;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.01em;
}

.child-gallery-card.nsfw-blur .child-gallery-thumb img {
  filter: blur(12px);
  transform: scale(1.1);
}

.child-gallery-card.nsfw-blur:hover .child-gallery-thumb img {
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .child-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 12px 12px 30px;
  }
  .child-gallery-label {
    padding: 10px 12px;
    font-size: 13px;
  }
}
