html,
body,
#root {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
}

/* Match the map shell so iOS safe-area (URL bar / home indicator) regions
   show the dark theme instead of white when the page hasn't fully painted. */
html,
body {
  background-color: #0a0f1a;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button,
a,
.hole-chip,
.gallery-flyover-chip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
  color: #f0ede6;
  /* Glass fills — the Vite config fix (cssMinify: false) preserves
     backdrop-filter prefixes in production, so we can return to elegant,
     translucent glass values. */
  --glass-fill: rgba(18, 24, 38, 0.82);
  --glass-fill-solid: rgba(18, 24, 38, 0.96);
  --glass-chip-fill: rgba(18, 24, 38, 0.70);
  /* Shared overlay spacing — tuned per breakpoint below */
  --ui-inset: clamp(12px, 2.2vw, 22px);
  --carousel-zone: 76px;
  --bottom-ui-lift: calc(var(--carousel-zone) + var(--ui-inset));
  --search-stack: 58px;
  /* Country-club display serif — applied only to the map's titles / hole
     numbers / eyebrow labels (not numeric chrome, search inputs, or the
     hole carousel). Numeric pills + small UI keep the cleaner sans below. */
  --map-display-font: 'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
}

.map-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-canvas {
  width: 100%;
  height: 100%;
}

/* Hide Google's cooperative-gesture banner ("use ⌘ + scroll to zoom", etc.). */
.map-wrap .gm-style-pbc {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide Google's native map controls (fullscreen / zoom / compass / etc.).
   On mobile the Map3DElement was rendering a tiny "expand" button in the
   bottom-right corner — strip every variant we can target via light DOM. */
.map-wrap .gm-fullscreen-control,
.map-wrap .gm-svpc,
.map-wrap .gm-bundled-control,
.map-wrap .gm-control-active,
.map-wrap [aria-label*="fullscreen" i],
.map-wrap [aria-label*="full screen" i],
.map-wrap [aria-label*="expand" i],
.map-wrap [title*="fullscreen" i],
.map-wrap [title*="expand" i] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Map3DElement exposes its UI through shadow-DOM parts. CSS can pierce
   shadow DOM only via ::part(), so hide every known native control part. */
gmp-map-3d::part(fullscreen-control),
gmp-map-3d::part(zoom-control),
gmp-map-3d::part(compass-control),
gmp-map-3d::part(controls),
gmp-map-3d::part(map-control),
gmp-map-3d::part(button) {
  display: none !important;
}

.map-yardage-marker {
  pointer-events: none;
}

.map-yardage-label {
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  box-shadow: none;
  color: #f0ede6;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.map-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 10, 19, 0.8);
  color: #f5f7fa;
  font-size: 1rem;
  padding: 20px;
  z-index: 10;
}

/* Glass UI Elements */
.ui-overlay {
  position: absolute;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through to map where there's no card */
}

.top-left {
  top: max(var(--ui-inset), env(safe-area-inset-top));
  left: max(var(--ui-inset), env(safe-area-inset-left));
  right: auto;
  max-width: min(360px, calc(100vw - var(--ui-inset) * 2 - 220px));
}

.top-right {
  top: max(var(--ui-inset), env(safe-area-inset-top));
  right: max(var(--ui-inset), env(safe-area-inset-right));
  left: auto;
  width: min(420px, calc(100vw - var(--ui-inset) * 2));
  max-width: calc(100vw - var(--ui-inset) * 2);
}

/* Course Search */
.course-search {
  pointer-events: auto;
  position: relative;
}

.course-search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.course-search-icon {
  font-size: 1.05rem;
  opacity: 0.85;
}

.course-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.95rem;
  min-width: 0;
}

.course-search-input::placeholder {
  color: rgba(226, 232, 240, 0.6);
}

.course-search-submit {
  flex-shrink: 0;
  border: 1px solid rgba(197, 160, 89, 0.6);
  background: rgba(197, 160, 89, 0.18);
  color: #c5a059;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.course-search-submit:hover:not(:disabled) {
  background: rgba(197, 160, 89, 0.3);
}

.course-search-submit:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.course-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--glass-fill-solid);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.course-search-empty,
.course-search-error {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #b5af9f;
}

.course-search-error {
  color: #fca5a5;
}

.course-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 120ms ease;
}

.course-search-item:hover:not(:disabled) {
  background: rgba(197, 160, 89, 0.12);
}

.course-search-item:disabled {
  cursor: progress;
  opacity: 0.75;
}

.course-search-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.course-search-item-address {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #a8a29a;
}

.course-search-item-loading {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #c5a059;
}

.glass-card {
  pointer-events: auto; /* Re-enable clicks on the cards themselves */
  background: var(--glass-fill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card {
    background: var(--glass-fill-solid);
  }
}

.header-card h1 {
  margin: 0;
  font-family: var(--map-display-font);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.header-card .subtitle {
  margin: 4px 0 12px;
  font-family: var(--map-display-font);
  font-style: italic;
  font-weight: 500;
  color: #b5af9f;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.meta-strip {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: #e2e8f0;
}

.meta-strip span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Map gesture hint — bottom-right, read-only */
.map-gesture-hint {
  position: absolute;
  bottom: calc(var(--bottom-ui-lift) + env(safe-area-inset-bottom, 0px));
  right: max(var(--ui-inset), env(safe-area-inset-right));
  left: auto;
  transform: none;
  max-width: min(320px, calc(100vw - var(--ui-inset) * 2));
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.72rem;
  color: #b5af9f;
  line-height: 1.4;
  text-align: right;
}

.map-gesture-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.68rem;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

/* Hole Info Card (bottom-left) */
.bottom-left {
  bottom: calc(var(--bottom-ui-lift) + env(safe-area-inset-bottom, 0px));
  left: max(var(--ui-inset), env(safe-area-inset-left));
  max-width: min(280px, calc(100vw - var(--ui-inset) * 2));
}

.hole-info {
  padding: 12px 16px;
  min-width: 200px;
}

.hole-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hole-info-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hole-info-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.65rem;
  font-weight: 500;
  color: #a8a29a;
  line-height: 1;
}

.hole-info-number {
  font-family: var(--map-display-font);
  font-size: 2.1rem;
  font-weight: 600;
  color: #c5a059;
  line-height: 1;
  letter-spacing: 0.01em;
}

.hole-info-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 14px;
}

.hole-info-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hole-info-metric-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  color: #a8a29a;
}

.hole-info-metric-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hole-info-metric-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

/* Hole Carousel — on desktop, padding passes touches to map; chips stay clickable. */
.hole-carousel {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 14px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  scrollbar-width: none; /* Firefox */
  pointer-events: none;
}

/* Smoked-glass band behind the hole chips — matches overlay cards.
   Height = --carousel-zone only; safe-area is on .hole-carousel padding.
   Solid glass-fill base so it stays readable if blur fails over WebGL. */
/* Smoked-glass background behind the hole chips. Solid behind the chips, 
   then softly fading out at the top edge to blend into the map, without adding extra height. */
.hole-carousel-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--carousel-zone) + env(safe-area-inset-bottom, 0px));
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to top, black 0%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 70%, transparent 100%);
  z-index: 15;
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hole-carousel-bg {
    background: linear-gradient(
      to top,
      var(--glass-fill-solid) 0%,
      var(--glass-fill-solid) 70%,
      transparent 100%
    );
    mask-image: none;
    -webkit-mask-image: none;
  }
}

.hole-carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.hole-chip {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  background: transparent;
  color: #a8a29a;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  pointer-events: auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hole-chip {
    background: transparent;
  }
}

.hole-chip:hover {
  color: #f0ede6;
}

.hole-chip.active {
  background: transparent;
  color: #c5a059;
  border-color: #c5a059;
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
 * Gallery shell shared bits
 * ------------------------------------------------------------------------- */
.gallery-shell {
  /* Same as .app-shell; just a hook for future per-mode overrides. */
}

/* Top-right: hole photo + caption */
.gallery-photo-overlay {
  width: min(380px, calc(100vw - var(--ui-inset) * 2));
  max-width: calc(100vw - var(--ui-inset) * 2);
}

/* Bottom-left: floating flyover + hole / tee card */
.gallery-tee-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: min(400px, calc(100vw - var(--ui-inset) * 2));
}

.gallery-flyover-float {
  display: flex;
  justify-content: stretch;
  pointer-events: none;
}

.gallery-flyover-chip {
  pointer-events: auto;
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(197, 160, 89, 0.15);
  background: var(--glass-fill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  color: #c5a059;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gallery-flyover-chip {
    background: var(--glass-fill-solid);
  }
}

.gallery-flyover-chip:hover {
  border-color: rgba(197, 160, 89, 0.3);
  background: rgba(197, 160, 89, 0.05);
  color: #d4af37;
}

.gallery-flyover-chip-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
}

.gallery-flyover-chip-play svg {
  margin-left: 2px;
}

/* ----------------------------------------------------------------------------
 * Gallery hero card (top-left)
 * ------------------------------------------------------------------------- */
.gallery-hero-card {
  max-width: 340px;
  padding: 14px 18px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gallery-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Course / club logo — sits next to the title to give each course its own
   identity without crowding the marquee text. Sized for legibility but
   restrained enough to read as a brand mark, not a hero image. */
.gallery-hero-logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.gallery-hero-eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  font-family: var(--map-display-font);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.74rem;
  font-weight: 400;
  color: #c5a059;
  text-decoration: none;
  transition: color 150ms ease, opacity 150ms ease;
}

.gallery-hero-eyebrow:hover {
  color: #d4af37;
  opacity: 0.92;
}

.gallery-hero-title {
  margin: 0 0 8px;
  font-family: var(--map-display-font);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.08;
  color: #f8fafc;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-hero-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: #b5af9f;
}

.gallery-hero-credits span:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  color: #475569;
}

.gallery-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  font-size: 0.72rem;
  color: #a8a29a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.gallery-hero-meta span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.gallery-hero-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  color: #a8a29a;
}

/* ----------------------------------------------------------------------------
 * Hole photo (top-right) — image + caption
 * ------------------------------------------------------------------------- */
.gallery-photo-frame {
  pointer-events: auto;
  padding: 8px;
  border-radius: 8px;
  background: var(--glass-fill);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.gallery-photo-card-inner {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.gallery-photo-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, rgba(197, 160, 89, 0.12), rgba(18, 24, 38, 0.75));
  overflow: hidden;
}

/* The image-wrap is a real <button> so the entire photo is one big tap target.
   Resets keep the visual identical to the old div-based card. */
.gallery-photo-trigger {
  display: block;
  margin: 0;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: transform 160ms ease;
}

.gallery-photo-trigger:hover .gallery-photo-image {
  transform: scale(1.02);
}

.gallery-photo-trigger:focus-visible {
  outline: 2px solid #c5a059;
  outline-offset: 3px;
}

.gallery-photo-image {
  transition: transform 220ms ease;
}

.gallery-photo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-photo-caption {
  margin: 14px 2px 6px;
  padding: 0 6px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #a8a29a;
  max-height: min(24vh, 168px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.gallery-photo-caption strong {
  color: #f1f5f9;
  font-weight: 600;
}

.gallery-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #f8fafc;
  font-family: var(--map-display-font);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
}

.gallery-photo-placeholder small {
  font-family: var(--map-display-font);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #a8a29a;
}

/* ----------------------------------------------------------------------------
 * Hole-photo lightbox — tap the thumbnail to expand the image full-screen.
 * Portal-rendered to <body> so it sits above the map UI on every breakpoint.
 * ------------------------------------------------------------------------- */
.gallery-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  background: rgba(2, 6, 15, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: gallery-photo-lightbox-in 200ms ease forwards;
}

.gallery-photo-lightbox-closing {
  animation: gallery-photo-lightbox-out 180ms ease forwards;
}

@keyframes gallery-photo-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gallery-photo-lightbox-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.gallery-photo-lightbox-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: background 150ms ease, transform 150ms ease;
}

.gallery-photo-lightbox-close:hover,
.gallery-photo-lightbox-close:focus-visible {
  background: rgba(30, 41, 59, 0.92);
  transform: scale(1.05);
  outline: none;
}

.gallery-photo-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: 920px;
  max-height: 100%;
  cursor: default;
  animation: gallery-photo-lightbox-zoom 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-photo-lightbox-closing .gallery-photo-lightbox-inner {
  animation: gallery-photo-lightbox-zoom-out 180ms ease forwards;
}

@keyframes gallery-photo-lightbox-zoom {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes gallery-photo-lightbox-zoom-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

.gallery-photo-lightbox-image-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.gallery-photo-lightbox-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72dvh;
  object-fit: contain;
}

.gallery-photo-lightbox-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, rgba(197, 160, 89, 0.12), rgba(15, 23, 42, 0.75));
  color: #f8fafc;
  font-family: var(--map-display-font);
  font-weight: 600;
  font-size: 2rem;
}

.gallery-photo-lightbox-placeholder small {
  font-family: var(--map-display-font);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #a8a29a;
}

.gallery-photo-lightbox-meta {
  padding: 0 6px;
}

.gallery-photo-lightbox-title {
  margin: 0 0 8px;
  font-family: var(--map-display-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.005em;
}

.gallery-photo-lightbox-description {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #b5af9f;
  max-height: 22dvh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.gallery-photo-lightbox-description strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
 * Tee box card (bottom-left)
 * ------------------------------------------------------------------------- */
.gallery-tee-card {
  padding: 14px 16px 16px;
  min-width: 260px;
  max-height: min(58vh, 520px);
  overflow-y: auto;
}

.gallery-tee-hole-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gallery-tee-hole-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.gallery-tee-hole-eyebrow {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f8fafc;
  line-height: 1.15;
}

.gallery-tee-hole-name {
  font-family: var(--map-display-font);
  font-style: italic;
  font-size: 0.82rem;
  font-weight: 500;
  color: #a8a29a;
  letter-spacing: 0.01em;
  margin-top: 1px;
}

.gallery-tee-hole-metrics {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
}

.gallery-tee-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gallery-tee-metric-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a8a29a;
}

.gallery-tee-metric-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #c5a059;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.gallery-tee-metric-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

.gallery-tee-designer-notes {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.16);
  font-size: 0.72rem;
  line-height: 1.4;
  color: #dfbc68;
}

.gallery-tee-divider {
  height: 1px;
  margin: 2px 0 8px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 20%,
    rgba(255, 255, 255, 0.12) 80%,
    transparent
  );
}

.gallery-tee-subheader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.gallery-tee-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.64rem;
  font-weight: 500;
  color: #a8a29a;
}

.gallery-tee-estimate {
  font-size: 0.66rem;
  color: #b5af9f;
}

.gallery-tee-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gallery-tee-row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.gallery-tee-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.gallery-tee-label {
  font-size: 0.76rem;
  font-weight: 500;
  color: #f0ede6;
  letter-spacing: 0.02em;
}

/* Desktop shows the full tee name; mobile swaps to a compact form. */
.gallery-tee-label-full { display: inline; }
.gallery-tee-label-short { display: none; }

.gallery-tee-yards {
  font-size: 0.76rem;
  font-weight: 500;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.gallery-tee-rs {
  font-size: 0.66rem;
  color: #a8a29a;
  font-variant-numeric: tabular-nums;
}

.gallery-tee-empty {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #b5af9f;
}

/* ----------------------------------------------------------------------------
 * Download edits button (Gallery mode only)
 * ------------------------------------------------------------------------- */
.gallery-download {
  position: fixed;
  bottom: calc(var(--bottom-ui-lift) + 12px);
  right: var(--ui-inset);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: auto;
}

.gallery-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 89, 0.6);
  background: rgba(197, 160, 89, 0.92);
  color: #1a1600;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 14px rgba(197, 160, 89, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.gallery-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 0 0 18px rgba(197, 160, 89, 0.5);
}

.gallery-download-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26, 22, 0, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
}

.gallery-download-error {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.85);
  color: #fee2e2;
  font-size: 0.75rem;
}

/* ----------------------------------------------------------------------------
 * Gallery index (grid of course cards)
 * ------------------------------------------------------------------------- */
.gallery-index {
  min-height: 100vh;
  padding: 56px 32px 60px;
  background:
    radial-gradient(ellipse at top, rgba(197, 160, 89, 0.08), transparent 60%),
    linear-gradient(180deg, #050b18 0%, #02060f 100%);
  color: #f2f6fa;
  box-sizing: border-box;
}

.gallery-index-header {
  max-width: 960px;
  margin: 0 auto 36px;
  text-align: center;
}

.gallery-index-eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c5a059;
}

.gallery-index-title {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gallery-index-subtitle {
  margin: 10px auto 0;
  max-width: 560px;
  color: #b5af9f;
  font-size: 0.95rem;
  line-height: 1.5;
}

.gallery-index-back-link {
  display: inline-block;
  margin-top: 18px;
  color: #c5a059;
  text-decoration: none;
  font-weight: 600;
}

.gallery-index-back-link:hover {
  text-decoration: underline;
}

.gallery-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  max-width: 1120px;
  margin: 0 auto;
}

.gallery-index-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.gallery-index-card:hover {
  transform: translateY(-3px);
  border-color: rgba(197, 160, 89, 0.4);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(197, 160, 89, 0.18);
}

.gallery-index-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.18), rgba(15, 23, 42, 0.8));
  overflow: hidden;
}

.gallery-index-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-index-card-placeholder {
  position: absolute;
  inset: 0;
}

.gallery-index-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-index-card-body h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gallery-index-card-location {
  margin: 0;
  font-size: 0.78rem;
  color: #a8a29a;
}

.gallery-index-card-tagline {
  margin: 6px 0 4px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.gallery-index-card-meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: #e2e8f0;
}

.gallery-index-card-meta span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-index-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: #a8a29a;
  font-size: 0.9rem;
}

.gallery-index-empty code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ----------------------------------------------------------------------------
 * Gallery landing (sales page + live preview frame)
 * ------------------------------------------------------------------------- */
.gallery-landing {
  min-height: 100vh;
  background: #fdfdfc; /* Crisp warm white */
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  padding-bottom: 120px;
}

.gallery-landing-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
}

.gallery-landing-logo {
  margin: 0;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #111111;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.gallery-landing-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-landing-header {
  text-align: center;
  margin-bottom: 72px;
  max-width: 800px;
}

.gallery-landing-eyebrow {
  margin: 0 0 24px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #718096;
}

.gallery-landing-title {
  margin: 0;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: #111;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.gallery-landing-title em {
  font-style: italic;
  color: #144d2b;
}

.gallery-landing-subtitle {
  margin: 28px auto 0;
  color: #4a5568;
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 300;
  max-width: 500px;
}

.gallery-landing-preview-wrap {
  width: 100%;
  max-width: 1200px;
  border-radius: 4px; /* More sophisticated square-ish corners */
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
  margin-bottom: 80px;
}

.gallery-landing-frame-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.gallery-landing-frame-chrome-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gallery-landing-frame-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
}

.gallery-landing-frame-dot:first-child { background: #b5af9f; }
.gallery-landing-frame-dot:nth-child(2) { background: #b5af9f; }
.gallery-landing-frame-dot:nth-child(3) { background: #b5af9f; }

.gallery-landing-frame-label {
  margin: 0 0 0 4px;
  font-size: 0.8rem;
  color: #111;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.gallery-landing-frame-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 10px 16px;
  border-radius: 4px;
  background: #144d2b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(20, 77, 43, 0.35);
  transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.gallery-landing-frame-cta:hover {
  background: #0f3d22;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20, 77, 43, 0.45);
}

.gallery-landing-frame-cta-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.gallery-landing-frame-cta-text {
  line-height: 1;
}

.gallery-landing-frame-cta-short {
  display: none;
}

.gallery-landing-iframe {
  display: block;
  width: 100%;
  height: min(75vh, 750px);
  border: none;
  background: #000;
}

/* Mobile preview is only used on small screens; hide by default. */
.gallery-landing-preview-mobile {
  display: none;
}

.gallery-landing-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.gallery-landing-cta-headline {
  margin: 0;
  max-width: 420px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #111;
}

.gallery-landing-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 48px;
  background: transparent;
  color: #144d2b;
  border: 1px solid #144d2b;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 250ms ease;
}

.gallery-landing-cta-button:hover {
  background: #144d2b;
  color: #ffffff;
}

.gallery-landing-cta-button-secondary {
  color: #4a5568;
  border-color: rgba(0, 0, 0, 0.15);
}

.gallery-landing-cta-button-secondary:hover {
  background: transparent;
  color: #144d2b;
  border-color: #144d2b;
}

@media (max-width: 768px) {
  .gallery-landing {
    padding-bottom: 64px;
  }

  .gallery-landing-nav {
    padding: 24px 20px 16px;
  }

  .gallery-landing-logo {
    font-size: 0.95rem;
    letter-spacing: 0.12em;
  }

  .gallery-landing-hero {
    --landing-pad: 20px;
    padding: 0 0 40px;
    max-width: none;
  }

  .gallery-landing-header {
    margin-bottom: 28px;
    padding: 0 var(--landing-pad);
    max-width: none;
  }

  .gallery-landing-title {
    font-size: clamp(1.85rem, 7.5vw, 2.5rem);
    line-height: 1.12;
  }

  .gallery-landing-title br {
    display: none;
  }

  .gallery-landing-subtitle {
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.5;
    max-width: none;
  }

  /* Hide the live iframe entirely on mobile — it captures all touches
     and prevents page scrolling. Show the tap-to-explore card instead. */
  .gallery-landing-preview-desktop {
    display: none;
  }

  .gallery-landing-preview-mobile {
    display: block;
    position: relative;
    width: calc(100% - var(--landing-pad) * 2);
    max-width: 560px;
    margin: 0 var(--landing-pad) 32px;
    aspect-ratio: 4 / 5;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #0b1220;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
  }

  .gallery-landing-preview-mobile-image {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    transition: transform 600ms ease;
  }

  .gallery-landing-preview-mobile:active .gallery-landing-preview-mobile-image {
    transform: scale(1.03);
  }

  .gallery-landing-preview-mobile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.05) 40%,
      rgba(0, 0, 0, 0.55) 80%,
      rgba(0, 0, 0, 0.78) 100%
    );
  }

  .gallery-landing-preview-mobile-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
  }

  .gallery-landing-preview-mobile-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: gallery-pulse 2s ease-out infinite;
  }

  @keyframes gallery-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
  }

  .gallery-landing-preview-mobile-meta {
    margin-top: auto;
    margin-bottom: 16px;
    color: #fff;
  }

  .gallery-landing-preview-mobile-course {
    margin: 0;
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .gallery-landing-preview-mobile-location {
    margin: 4px 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
  }

  .gallery-landing-preview-mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 8px;
    background: #fff;
    color: #144d2b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    align-self: stretch;
  }

  .gallery-landing-cta-wrap {
    padding: 0 var(--landing-pad);
    gap: 14px;
  }

  .gallery-landing-cta-headline {
    font-size: 1.25rem;
    max-width: none;
  }

  .gallery-landing-cta-button {
    width: 100%;
    max-width: none;
    padding: 16px 24px;
  }
}

@media (max-width: 480px) {
  .gallery-landing-hero {
    --landing-pad: 16px;
  }

  .gallery-landing-header {
    margin-bottom: 22px;
  }

  .gallery-landing-title {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
  }

  .gallery-landing-subtitle {
    font-size: 0.95rem;
  }

  .gallery-landing-preview-mobile {
    aspect-ratio: 3 / 4;
    border-radius: 12px;
  }

  .gallery-landing-preview-mobile-overlay {
    padding: 16px;
  }

  .gallery-landing-preview-mobile-course {
    font-size: 1.3rem;
  }

  .gallery-landing-preview-mobile-location {
    font-size: 0.72rem;
  }
}

/* ==========================================================================
 * Map app (golfer + grounds view course) — responsive overlays
 *
 * Layout strategy:
 *   - Map fills the screen behind everything; overlays float above it.
 *   - There are four overlay zones: top-left, top-right, bottom-left, bottom
 *     (hole carousel).
 *   - On small screens we prioritize the map by hiding low-priority chrome
 *     (eyebrows, credits, photo captions) and converting full cards into
 *     slim pills so the user still sees what hole they're on without the
 *     UI swallowing the photoreal imagery.
 *   - Cards never overlap horizontally: the hero pill on top-left always
 *     leaves room for the photo on top-right, and the tee card on
 *     bottom-left always sits above the fixed hole carousel.
 * ========================================================================== */

/* Map gesture hint — desktop pointer devices only.
   Mobile & touch get a cleaner map with no chrome. */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  .map-gesture-hint { display: none; }
}

/* Touch devices: hole carousel must capture horizontal swipes (incl. wide tablets). */
@media (hover: none) and (pointer: coarse) {
  .hole-carousel {
    pointer-events: auto;
    touch-action: pan-x;
    scroll-snap-type: x mandatory;
  }

  .hole-carousel .hole-chip {
    touch-action: pan-x;
    scroll-snap-align: center;
    transform: none;
  }
}

/* ----- Tablet landscape & small laptop (1024-1279) ------------------------ */
@media (min-width: 1024px) and (max-width: 1279px) {
  .app-shell {
    --ui-inset: 16px;
    --carousel-zone: 68px;
  }
  .glass-card {
    padding: 12px 16px;
  }
  .gallery-hero-card {
    max-width: min(320px, 34vw);
    padding: 12px 14px 14px;
    gap: 10px;
  }
  /* Title was wrapping awkwardly to two lines at this size — bring it down
     so course names like "Sahalee Country Club" fit on a single line. */
  .gallery-hero-title { font-size: 1.35rem; margin-bottom: 4px; }
  .gallery-hero-logo { width: 38px; height: 38px; }
  .gallery-hero-eyebrow { font-size: 0.65rem; margin-bottom: 4px; }
  .gallery-hero-credits { margin-bottom: 8px; font-size: 0.7rem; gap: 8px; }
  .gallery-hero-meta { font-size: 0.64rem; gap: 8px; }
  
  .gallery-photo-overlay { width: min(320px, 32vw); }
  .gallery-photo-caption { font-size: 0.74rem; margin: 10px 2px 4px; line-height: 1.5; }
  
  .gallery-tee-stack { max-width: min(320px, 30vw); }
  .gallery-shell .gallery-tee-card {
    max-height: min(44dvh, 360px);
    padding: 12px 14px 14px;
  }
  .gallery-tee-hole-header { gap: 8px; margin-bottom: 6px; }
  .gallery-tee-hole-eyebrow { font-size: 0.95rem; }
  .gallery-tee-hole-name { font-size: 0.76rem; }
  .gallery-tee-hole-metrics { padding: 4px 10px; gap: 10px; }
  .gallery-tee-metric-val { font-size: 0.95rem; }
  .gallery-tee-row { padding: 8px 6px; gap: 10px; }
  .gallery-tee-label { font-size: 0.7rem; }
  .gallery-tee-yards { font-size: 0.7rem; }
  .gallery-flyover-chip { padding: 8px 14px; font-size: 0.7rem; }
  
  .hole-chip { padding: 8px 14px; font-size: 0.85rem; }
}

/* ----- Tablet portrait (768-1023) ----------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell {
    --ui-inset: 14px;
    --carousel-zone: 64px;
  }

  .glass-card {
    padding: 10px 14px;
  }

  .gallery-hero-card {
    max-width: min(280px, 38vw);
    padding: 10px 12px 12px;
    gap: 8px;
  }

  .gallery-hero-title { font-size: 1.25rem; margin-bottom: 4px; }
  .gallery-hero-logo { width: 32px; height: 32px; }
  .gallery-hero-eyebrow { font-size: 0.6rem; margin-bottom: 2px; }
  .gallery-hero-credits { margin-bottom: 6px; font-size: 0.68rem; gap: 6px; }
  .gallery-hero-meta { font-size: 0.6rem; gap: 6px; }

  .gallery-photo-overlay { width: min(300px, 38vw); }
  .gallery-photo-caption { font-size: 0.72rem; margin: 8px 2px 2px; line-height: 1.4; }

  .gallery-photo-image-wrap { aspect-ratio: 16 / 10; }

  .gallery-tee-stack { max-width: min(300px, 40vw); }

  .gallery-tee-card { 
    max-height: min(46dvh, 400px); 
    padding: 10px 12px 12px;
  }
  .gallery-tee-hole-header { gap: 6px; margin-bottom: 4px; }
  .gallery-tee-hole-eyebrow { font-size: 0.9rem; }
  .gallery-tee-hole-name { font-size: 0.72rem; }
  .gallery-tee-hole-metrics { padding: 4px 8px; gap: 8px; }
  .gallery-tee-metric-val { font-size: 0.9rem; }
  .gallery-tee-row { padding: 6px 4px; gap: 8px; }
  .gallery-tee-label { font-size: 0.68rem; }
  .gallery-tee-yards { font-size: 0.68rem; }
  .gallery-flyover-chip { padding: 6px 12px; font-size: 0.68rem; }

  .hole-chip { padding: 6px 12px; font-size: 0.8rem; }

  .top-left {
    max-width: min(300px, calc(100vw - var(--ui-inset) * 2 - 320px));
  }

  .hole-info { min-width: 180px; padding: 10px 12px; }
}

/* ==========================================================================
 * Phones (≤ 767px)
 *
 * Strategy:
 *   - Hero becomes a SLIM single-line pill (top-left), fit-content with
 *     ellipsis. No credits, no meta strip cluttering the top.
 *   - Hole photo becomes a small thumb (top-right) — recognizable but
 *     never larger than ~36% of the viewport.
 *   - Tee card spans full-width at the bottom for legibility.
 *   - Golfer mode stacks search above a slim header pill.
 *   - Carousel: smaller chips, tighter padding.
 * ========================================================================== */
@media (max-width: 767px) {
  .app-shell {
    --ui-inset: 12px;
    /* Total bottom chrome height (carousel row + safe-area) for tee-stack lift */
    --carousel-zone: 42px;
    --search-stack: 56px;
  }

  /* Slightly taller blur band on mobile — chips stay put, bg fades a bit above them */
  .hole-carousel-bg {
    height: calc(var(--carousel-zone) + env(safe-area-inset-bottom, 0px) + 10px);
    mask-image: linear-gradient(to top, black 0%, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, black 75%, transparent 100%);
  }

  /* Native momentum scroll — no JS scroll hijacking (smoother on iOS). */
  .hole-carousel {
    pointer-events: auto;
    touch-action: pan-x;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    padding-top: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  }

  .hole-carousel .hole-chip {
    touch-action: pan-x;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
      box-shadow 0.15s ease;
  }

  .hole-chip:hover,
  .hole-chip.active {
    transform: none;
  }

  /* Universal: tighter cards */
  .glass-card {
    padding: 10px 13px 11px;
    border-radius: 13px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
  }

  .hole-chip {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

  .map-yardage-label {
    min-width: 40px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 400;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  /* ---------- Golfer mode ---------- */
  /* Search bar = full-width row on top. */
  .app-shell:not(.gallery-shell) .ui-overlay.top-right {
    top: max(var(--ui-inset), env(safe-area-inset-top));
    left: max(var(--ui-inset), env(safe-area-inset-left));
    right: max(var(--ui-inset), env(safe-area-inset-right));
    width: auto;
    max-width: none;
  }

  /* Course header pill = below the search bar, compact. */
  .app-shell:not(.gallery-shell) .ui-overlay.top-left {
    top: calc(max(var(--ui-inset), env(safe-area-inset-top)) + var(--search-stack));
    left: max(var(--ui-inset), env(safe-area-inset-left));
    right: max(var(--ui-inset), env(safe-area-inset-right));
    max-width: none;
  }

  .app-shell:not(.gallery-shell) .header-card {
    padding: 8px 14px 9px;
  }

  .app-shell:not(.gallery-shell) .header-card h1 {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell:not(.gallery-shell) .header-card .subtitle {
    display: none;
  }

  .app-shell:not(.gallery-shell) .meta-strip {
    margin-top: 4px;
    gap: 5px;
    font-size: 0.64rem;
  }

  .app-shell:not(.gallery-shell) .meta-strip span {
    padding: 2px 7px;
  }

  .course-search-input-row {
    padding: 9px 12px;
    gap: 8px;
  }

  .course-search-input {
    font-size: 16px; /* prevent iOS zoom-on-focus */
  }

  .course-search-submit {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .course-search-dropdown {
    max-height: min(50dvh, 360px);
  }

  /* Hole info card (bottom-left, golfer only) */
  .app-shell:not(.gallery-shell) .bottom-left {
    max-width: min(260px, calc(100vw - var(--ui-inset) * 2));
  }

  .hole-info {
    padding: 9px 12px 10px;
    min-width: 0;
  }

  .hole-info-top { gap: 10px; }
  .hole-info-eyebrow { font-size: 0.66rem; letter-spacing: 0.18em; }
  .hole-info-number { font-size: 1.6rem; }
  
  .hole-info-metrics {
    padding: 6px 10px;
    gap: 10px;
  }
  .hole-info-metric-lbl { font-size: 0.5rem; }
  .hole-info-metric-val { font-size: 1.05rem; }
  .hole-info-metric-divider { height: 18px; }

  /* ---------- Gallery mode ---------- */
  /* Hero = slim inline pill, fit-content, ellipsis if name is long. */
  .gallery-shell .ui-overlay.top-left {
    top: max(var(--ui-inset), env(safe-area-inset-top));
    left: max(var(--ui-inset), env(safe-area-inset-left));
    right: auto;
    max-width: calc(100vw - var(--ui-inset) * 2 - clamp(160px, 40vw, 220px) - 10px);
  }

  .gallery-hero-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 9px 14px 9px 11px;
    border-radius: 10px;
  }

  .gallery-hero-logo {
    width: 30px;
    height: 30px;
  }

  .gallery-hero-credits {
    display: none;
  }

  .gallery-hero-eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    margin-bottom: 3px;
  }

  .gallery-hero-title {
    font-size: 1.05rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gallery-hero-meta {
    margin-top: 3px;
    gap: 8px;
    font-size: 0.62rem;
    flex-wrap: nowrap;
  }

  .gallery-hero-meta span {
    padding: 0;
  }

  .gallery-hero-meta span:not(:last-child)::after {
    margin-left: 8px;
  }

  /* Photo = top-right thumbnail, a touch larger so it reads as a feature card */
  .gallery-shell .gallery-photo-overlay {
    width: clamp(160px, 40vw, 220px);
  }

  .gallery-photo-frame {
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }

  .gallery-photo-card-inner {
    border-radius: 6px;
  }

  .gallery-photo-image-wrap {
    aspect-ratio: 16 / 9;
  }

  .gallery-photo-caption {
    display: none;
  }

  .gallery-photo-lightbox {
    padding:
      max(56px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .gallery-photo-lightbox-inner {
    gap: 10px;
  }

  .gallery-photo-lightbox-image {
    max-height: 60dvh;
  }

  .gallery-photo-lightbox-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .gallery-photo-lightbox-description {
    font-size: 0.82rem;
    max-height: 26dvh;
  }

  .gallery-photo-placeholder {
    font-size: 1rem;
  }

  /* Tee card & Flyover combined into a compact bottom sheet.
     Sits just above the hole carousel with a small breathing gap.
     Note: backdrop-filter over the WebGL map is unreliable on production
     builds, so we keep the base fill opaque enough to read without blur. */
  .gallery-shell .ui-overlay.bottom-left.gallery-tee-stack {
    display: flex;
    flex-direction: column;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(var(--carousel-zone) + env(safe-area-inset-bottom, 0px) + 8px);
    max-width: none;
    gap: 0;
    background: var(--glass-fill);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px 16px 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
  }

  .gallery-flyover-float {
    order: 2; /* move below tee card */
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .gallery-tee-card {
    min-width: 0;
    max-height: min(22dvh, 180px);
    padding: 12px 14px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  .gallery-tee-hole-header {
    margin-bottom: 6px;
    gap: 6px;
    align-items: center;
  }

  .gallery-tee-hole-title {
    flex: 1;
  }

  .gallery-tee-hole-eyebrow { 
    font-size: 0.9rem; 
    letter-spacing: 0.02em;
  }
  .gallery-tee-hole-name { display: none; }
  
  .gallery-tee-hole-metrics {
    padding: 0;
    gap: 6px;
    background: transparent;
    border: none;
  }
  
  .gallery-tee-metric {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
  }
  
  .gallery-tee-metric-lbl { 
    font-size: 0.48rem; 
    letter-spacing: 0.08em;
  }
  .gallery-tee-metric-val { 
    font-size: 0.78rem; 
  }
  .gallery-tee-metric-divider { display: none; }

  .gallery-tee-designer-notes {
    display: none;
  }

  .gallery-tee-divider {
    margin: 3px 0 4px;
  }

  .gallery-tee-subheader {
    margin-bottom: 3px;
  }

  .gallery-tee-eyebrow {
    font-size: 0.52rem;
  }

  .gallery-tee-estimate {
    display: none;
  }

  /* Mobile tee yardages: a single horizontal row that reads like a mini
     scorecard. Each tee gets an equal slice of width so the layout stays
     balanced no matter how many tees the course has (no awkward 3-on-top /
     2-on-bottom split when there are 5 tees). */
  .gallery-tee-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 2px;
  }

  .gallery-tee-row {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-bottom: 2px solid var(--tee-color, transparent);
    box-shadow: none;
  }
  .gallery-tee-row:last-child {
    border-right: none;
  }

  /* Standalone swatch is no longer needed on mobile — color is conveyed by
     the chip background tint. */
  .gallery-tee-swatch {
    display: none;
  }

  .gallery-tee-yards {
    order: 1;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .gallery-tee-yards-unit {
    display: none;
  }

  .gallery-tee-label {
    order: 2;
    font-size: 0.48rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #a8a29a;
    text-transform: uppercase;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gallery-tee-label-full { display: none; }
  .gallery-tee-label-short { display: inline; }

  .gallery-tee-rs {
    display: none;
  }

  .gallery-flyover-chip {
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c5a059;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .gallery-flyover-chip-play {
    width: 18px;
    height: 18px;
  }

  /* Download admin button — centered above carousel */
  .gallery-download {
    bottom: calc(var(--bottom-ui-lift) + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
  }

  .gallery-download-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
  }
}

/* ----- Small phones (≤ 479) ----------------------------------------------- */
@media (max-width: 479px) {
  .app-shell {
    --ui-inset: 10px;
    --carousel-zone: 40px;
    --search-stack: 52px;
  }

  .hole-carousel {
    gap: 7px;
    padding: 6px max(12px, env(safe-area-inset-right))
             max(6px, env(safe-area-inset-bottom))
             max(12px, env(safe-area-inset-left));
  }

  .hole-chip {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .gallery-shell .gallery-tee-card {
    max-height: min(22dvh, 180px);
    padding: 7px 10px 8px;
  }

  /* Photo shrinks; hero gets the rest */
  .gallery-shell .gallery-photo-overlay {
    width: clamp(150px, 38vw, 200px);
  }

  .gallery-shell .ui-overlay.top-left {
    max-width: calc(100vw - var(--ui-inset) * 2 - clamp(150px, 38vw, 200px) - 8px);
  }

  .gallery-hero-title { font-size: 1rem; }

  /* Keep the "18 holes · Par 72" chips visible on small phones (iPhone XR/SE)
     — earlier we hid them entirely, which dropped useful course context. */
  .gallery-hero-meta {
    margin-top: 4px;
    gap: 10px;
    font-size: 0.56rem;
    flex-wrap: nowrap;
  }
  .gallery-hero-meta span {
    padding: 0;
  }

  /* Gallery index page */
  .gallery-index {
    padding: 36px 16px 48px;
  }
  .gallery-index-title { font-size: 1.7rem; }
  .gallery-index-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ----- Ultra-narrow phones (≤ 360, e.g. iPhone SE) ------------------------ */
@media (max-width: 360px) {
  .gallery-shell .gallery-photo-overlay {
    width: 40vw;
  }
  .gallery-shell .ui-overlay.top-left {
    max-width: calc(100vw - var(--ui-inset) * 2 - 40vw - 8px);
  }
  .gallery-hero-title { font-size: 0.95rem; }
}

/* ----- Short desktop / small-laptop windows (≥ 768w, ≤ 760h) --------------
 * Catches small laptop screens (1280×720, 1366×768), browser dev-tools
 * sessions, multitasked windows, etc. Without this, the left column
 * (hero + flyover + tee card) clutters the available vertical space because
 * each card is sized for a generous desktop viewport. We trim padding,
 * shrink the hero, drop optional copy, and collapse the tee yardages to
 * the same horizontal mini-scorecard the phone layout uses.
 * --------------------------------------------------------------------------*/
@media (min-width: 768px) and (max-height: 700px) {
  .gallery-hero-card {
    gap: 10px;
    padding: 12px 16px 14px;
  }
  .gallery-hero-logo { width: 40px; height: 40px; }
  .gallery-hero-title { font-size: 1.25rem; margin-bottom: 4px; }
  .gallery-hero-eyebrow { font-size: 0.62rem; letter-spacing: 0.24em; margin-bottom: 4px; }
  .gallery-hero-credits { margin-bottom: 8px; font-size: 0.7rem; gap: 8px; }
  .gallery-hero-meta { font-size: 0.62rem; gap: 10px; }
  .gallery-hero-meta span { padding: 0; }

  .gallery-shell .gallery-tee-card {
    max-height: min(38dvh, 280px);
    padding: 9px 12px 11px;
  }
  .gallery-tee-hole-eyebrow { font-size: 0.95rem; }
  .gallery-tee-hole-name { font-size: 0.74rem; }
  .gallery-tee-designer-notes { display: none; }
  .gallery-tee-estimate { font-size: 0.62rem; }

  /* Collapse the stacked tee rows into a compact horizontal mini-scorecard,
     reusing the same visual language as the phone layout. */
  .gallery-tee-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 1px 0;
  }
  .gallery-tee-row {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 3px 4px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 -2px 0 var(--tee-color, transparent);
  }
  .gallery-tee-row:last-child {
    border-right: none;
  }
  .gallery-tee-swatch { display: none; }
  .gallery-tee-yards {
    order: 1;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .gallery-tee-yards-unit { display: none; }
  .gallery-tee-label {
    order: 2;
    font-size: 0.5rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #a8a29a;
    text-transform: uppercase;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gallery-tee-label-full { display: none; }
  .gallery-tee-label-short { display: inline; }
  .gallery-tee-rs { display: none; }

  /* Smaller flyover chip so the gap between hero and tee card breathes. */
  .gallery-flyover-chip { padding: 6px 14px 6px 10px; font-size: 0.74rem; }
  .gallery-flyover-chip-play { width: 22px; height: 22px; }
}

/* Even shorter (≤ 620h): drop the credits line entirely and tighten more. */
@media (min-width: 768px) and (max-height: 620px) {
  .gallery-hero-credits { display: none; }
  .gallery-hero-title { font-size: 1.1rem; }
  .gallery-shell .gallery-tee-card { max-height: min(32dvh, 220px); }
}

/* ----- Landscape phones / short viewports --------------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
  .app-shell {
    --carousel-zone: 52px;
    --search-stack: 48px;
  }

  .hole-carousel {
    padding-top: 7px;
    padding-bottom: max(7px, env(safe-area-inset-bottom));
  }

  .hole-chip {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* Strip non-essential info — vertical space is precious */
  .header-card .subtitle,
  .gallery-hero-credits,
  .gallery-hero-meta {
    display: none;
  }

  .gallery-shell .gallery-tee-card {
    max-height: min(36dvh, 260px);
  }

  .gallery-shell .gallery-photo-overlay {
    width: clamp(110px, 22vw, 160px);
  }

  .gallery-shell .ui-overlay.top-left {
    max-width: calc(100vw - var(--ui-inset) * 2 - clamp(110px, 22vw, 160px) - 8px);
  }
}

/* ----- Large desktops (≥ 1440) -------------------------------------------- */
@media (min-width: 1440px) {
  .app-shell {
    --ui-inset: 28px;
    --carousel-zone: 84px;
  }

  .gallery-hero-card { max-width: 360px; }
  .gallery-photo-overlay { width: min(400px, 26vw); }
  .gallery-tee-stack { max-width: min(400px, 26vw); }

  .top-left {
    max-width: min(400px, calc(100vw - var(--ui-inset) * 2 - 520px));
  }
}

/* ----- Ultra-wide (≥ 1920) — cap card sizes ------------------------------- */
@media (min-width: 1920px) {
  .gallery-hero-card { max-width: 400px; }
  .gallery-photo-overlay { width: 440px; }
  .gallery-tee-stack { max-width: 440px; }
}

