/* 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;
  --accent: #0a0a0a;
  --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;
  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: rgba(139, 30, 30, 0.2);
  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;
}

/* 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: #8b1e1e;
  text-decoration: none;
}

.submenu-inner a.active {
  color: #8b1e1e;
  border-bottom-color: #8b1e1e;
  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: #8b1e1e; }
.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;
}
.nav-gallery-block > a {
  line-height: 1.25;
}
.nav-gallery-until {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #8b1e1e;
  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;
  }
}

.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: #8b1e1e; 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: #8b1e1e; 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(255,255,255,0.9); display: none; z-index: 1000; opacity: 0; transition: opacity 0.3s ease; }
.overlay.open { display: block; opacity: 1; }
body.overlay-open { overflow: hidden; }
.overlay-inner { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.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: #8b1e1e; }
.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(100vh - 130px); }
/* 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: 40px 0 20px; /* Added top margin to move image down */
  padding: 0; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  min-height: 300px; 
  width: 100%; 
  overflow: visible; 
  position: relative; 
}
.hero img { 
  max-width: 95%; 
  max-height: calc(100vh - 180px); 
  width: auto; 
  height: auto; 
  display: block; 
  border-radius: 12px; 
  box-shadow: var(--shadow); 
  border: 1px solid var(--border); 
  object-fit: contain; 
}

/* Slideshow styles */
.hero-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}

.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 or 5 column layouts */
.grid.desktop-cols-4 { column-count: 1; }
.grid.desktop-cols-5 { column-count: 1; }

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

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

/* Keep mobile two-column layout when desktop is set to 4/5 */
@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 {
    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);
  }
}

/* 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: #8b1e1e;
  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 #8b1e1e;
  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 rgba(139, 30, 30, 0.35);
  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: #8b1e1e;
  color: #8b1e1e;
  box-shadow: 0 4px 14px rgba(139, 30, 30, 0.12), 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: #8b1e1e;
  opacity: 0.95;
}

.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: 10px; }
  .proof-stats { gap: 8px; font-size: 12px; flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
.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-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  z-index: 12;
  cursor: pointer;
  accent-color: #8b1e1e;
  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: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.proof-flag-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  transition: opacity 0.2s ease;
}
.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 {
  width: 22px;
  height: 22px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: transparent;
  color: rgba(255, 255, 255, 0.25);
  position: relative;
}
.proof-flag-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}
.proof-flag-btn.proof-flag-red { color: rgba(248, 113, 113, 0.45); }
.proof-flag-btn.proof-flag-yellow { color: rgba(250, 204, 21, 0.45); }
.proof-flag-btn.proof-flag-green { color: rgba(74, 222, 128, 0.45); }
/* When one is selected, dim the others a lot */
.proof-flag-bar:has(.active) .proof-flag-btn:not(.active),
.proof-flag-pill:has(.active) .proof-flag-btn:not(.active) {
  opacity: 0.35;
}
.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); }
/* Active state: subtle ring, filled, small center dot - not much larger */
.proof-flag-btn.active {
  width: 24px;
  height: 24px;
  font-size: 6px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
  border-width: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.proof-flag-btn.active::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}
.proof-flag-btn.proof-flag-red.active {
  background: radial-gradient(circle at 35% 35%, rgba(248, 113, 113, 0.95), rgba(220, 38, 38, 0.95));
  color: #fff;
}
.proof-flag-btn.proof-flag-yellow.active {
  background: radial-gradient(circle at 35% 35%, rgba(253, 224, 71, 0.95), rgba(202, 138, 4, 0.95));
  color: #fff;
}
.proof-flag-btn.proof-flag-green.active {
  background: radial-gradient(circle at 35% 35%, rgba(74, 222, 128, 0.95), rgba(22, 163, 74, 0.95));
  color: #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;
}

/* 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: #8b1e1e;
  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: #8b1e1e; stroke: #8b1e1e; }
.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 #8b1e1e;
  border-radius: 14px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow:
    0 4px 24px rgba(139, 30, 30, 0.18),
    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: #8b1e1e;
  color: #fff;
  border-color: #8b1e1e;
  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(8px); 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; }
.btn.primary { background: #8b1e1e; color: #fff; border-color: #8b1e1e; }
.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;
}
.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: #8b1e1e;
  font-weight: 500;
  animation: footer-updating-blink 1.2s ease-in-out infinite;
}
.footer-no-license {
  color: #8b1e1e;
  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; }
  .content { padding: 140px 16px 20px; }
  .grid { column-gap: 12px; }
}

/* Hero image adjustments for mobile */
@media (max-width: 768px) {
  .hero {
    min-height: 200px;
    margin: 30px 0 60px; /* Added top margin to move image down on mobile too */
  }
  .hero img {
    max-height: calc(100vh - 300px);
    max-width: 100%;
  }
}

/* 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 */
  .overlay-menu {
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px;
    justify-content: flex-start;
  }
  .overlay-menu-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 28px;
    background: transparent; /* no grey card behind submenu groups */
  }
  .overlay-menu-section-actions { padding-bottom: 20px; }
  .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: 12px;
    padding-left: 2px;
  }
  .overlay-menu-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 18px;
    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;
    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: 6px;
    margin-left: 16px;
    padding-left: 14px;
    border-left: 2px solid rgba(0,0,0,0.08);
    gap: 4px;
    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.2s ease, transform 0.2s ease;
  }
  .overlay-menu a:hover { transform: translateX(4px); }
  .overlay-menu a.active { color: #8b1e1e; }
  .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: #8b1e1e; }
  .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);
  }
  .overlay-close:hover { background: rgba(0,0,0,0.1); }
  .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: 20px;
    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; }
  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: 100vh;
  align-items: stretch;
  padding: 20px 0;
}

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

/* The actual image */
.intro-image img {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  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: 100vh;
  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: #8b1e1e;
  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: #8b1e1e;
}

/* 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: #8b1e1e;
  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: #8b1e1e;
  transform: translateX(4px);
  opacity: 1;
}

/* 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: #8b1e1e;
}

/* 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%;
  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: #8b1e1e;
  box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.1);
}

.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: #8b1e1e;
  transition: left 0.3s ease;
  z-index: -1;
}

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

.btn-contact:hover {
  border-color: #8b1e1e;
  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;
  }
}
