/* ============================================================
   RYAN DONNELL PHOTOGRAPHY — Global Styles v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400&family=DM+Sans:wght@300;400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nav-height: 60px;
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans: 'DM Sans', 'Helvetica Neue', sans-serif;
  --brand: #1BA8D5;
  --grid-pad: 50px;
  --grid-gap: 3px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #080808;
  --bg-nav: rgba(8,8,8,0.92);
  --bg-dropdown: rgba(30,30,30,0.96);
  --text: #f0f0ee;
  --text-muted: #777;
  --text-nav: #aaa;
  --border: rgba(255,255,255,0.07);
  --toggle-bg: rgba(255,255,255,0.1);
  --overlay-bg: rgba(0,0,0,0.96);
  --thumb-bg: #1a1a1a;
  --lb-bg: rgba(0,0,0,0.97);
}

/* Light theme */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-nav: rgba(255,255,255,0.92);
  --bg-dropdown: rgba(255,255,255,0.94);
  --text: #1a1a18;
  --text-muted: #888;
  --text-nav: #555;
  --border: rgba(0,0,0,0.09);
  --toggle-bg: rgba(0,0,0,0.07);
  --overlay-bg: rgba(242,241,238,0.97);
  --thumb-bg: #e0dfd9;
  --lb-bg: rgba(20,20,18,0.97);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

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

/* ======== NAV ======== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 50px;
  z-index: 600;
  border-bottom: none;
  transition: background 0.3s;
}

.nav-logo img {
  height: 45px;
  width: auto;
  display: block;
  margin-top: 10px;
}

.nav-desktop {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.nav-item {
  position: relative;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 15px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-nav);
  transition: color 0.2s;
  user-select: none;
}
.nav-item:hover { color: var(--brand); }

.nav-direct {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 15px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  color: var(--text-nav);
  transition: color 0.2s;
}
.nav-direct:hover { color: var(--brand); }

/* Smooth drawer dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(var(--nav-height) - 1px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.96);
  border: none;
  min-width: 220px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.28s ease;
}
.nav-item:hover .nav-dropdown {
  max-height: 360px;
  opacity: 1;
}
.nav-dropdown a {
  display: block;
  padding: 11px 24px;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-nav);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  text-align: center;
}
.nav-dropdown a:hover {
  color: var(--brand);
  background: transparent;
}

/* Theme toggle */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--toggle-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  color: var(--text-nav);
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { color: var(--text); }

/* Hamburger — mobile only */
.hamburger {
  display: none;
  width: 36px; height: 36px;
  background: rgba(128,128,128,0.18);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu-close {
  position: absolute;
  top: 18px; right: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.mobile-menu a {
  display: block;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-nav);
  padding: 10px 0;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--text); }
.mobile-section-label {
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 4px;
  text-align: center;
}
.mobile-divider {
  width: 36px; height: 1px;
  background: var(--border);
  margin: 16px auto;
}

/* ======== PAGE WRAPPER ======== */
.page-content {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ======== HERO ======== */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}
.hero #hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.7s;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.22);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s;
}
.hero-overlay:hover { background: rgba(0,0,0,0.3); }
.hero-enter {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
  transition: color 0.25s, letter-spacing 0.3s;
}
.hero-overlay:hover .hero-enter {
  color: #fff;
  letter-spacing: 0.36em;
}

.hero-dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
}
.hero-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.hero-dot.active { background: rgba(255,255,255,0.82); }

/* ======== MASONRY (jigsaw, natural aspect ratios) ======== */
.photo-grid {
  position: relative;
  padding: 0 var(--grid-pad);
  /* height set by JS */
}

.grid-item {
  position: absolute;
  overflow: hidden;
  cursor: pointer;
  background: var(--thumb-bg);
  transition: background 0.3s;
}
.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s;
  opacity: 0;
}
.grid-item img.loaded { opacity: 1; }
.grid-item:hover img { transform: scale(1.04); }

/* ======== INLINE IMAGE VIEWER ======== */
.image-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: #ffffff;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 500;
  padding-top: calc(var(--nav-height) + 8px);
  padding-bottom: 40px;
  touch-action: pan-x;
  overscroll-behavior: none;
}
.image-viewer.open {
  display: flex;
  cursor: none;
}

/* Center column — image lives here */
.iv-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  overflow: hidden;
  padding: 8px 50px 0;
}
.iv-center img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.18s ease;
}

/* Controls row — below the image */
.iv-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  height: 56px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

/* Grid return icon */
.iv-grid-btn {
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
  opacity: 0.75;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}
.iv-grid-btn:hover { opacity: 1; }
.iv-grid-btn svg rect { fill: var(--brand); }

/* Prev / Next buttons */
.iv-prev, .iv-next {
  background: none;
  border: none;
  color: var(--brand);
  opacity: 0.75;
  transition: opacity 0.2s;
  cursor: none;
  display: flex;
  align-items: center;
  padding: 4px;
}
.iv-prev:hover, .iv-next:hover { opacity: 1; }
.iv-prev svg, .iv-next svg { width: 28px; height: 28px; }

/* Lightbox kept as alias for mobile fallback — hidden on desktop */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.open {
  display: flex;
}
.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  padding: 20px 60px;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}
.lb-img-wrap iframe {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  border: none;
  background: transparent;
}
.lb-close {
  position: fixed;
  top: 18px; right: 20px;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  z-index: 510;
  padding: 8px;
  opacity: 0.75;
}
.lb-close:hover { opacity: 1; }
.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  z-index: 510;
  padding: 16px;
  opacity: 0.6;
  display: none;
}
.lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-counter {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 10px;
}

/* ======== CONTACT ======== */
.contact-wrap {
  max-width: 480px;
  margin: 80px auto;
  padding: 0 32px;
}
.contact-wrap h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 36px;
}
.contact-wrap p {
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}
.contact-wrap a { color: #4aa8c0; transition: opacity 0.2s; }
.contact-wrap a:hover { opacity: 0.7; }

/* ======== FOOTER ======== */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: none;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 610;
  transition: background 0.3s, border-color 0.3s;
}

/* Give page content bottom padding so footer doesn't cover content */
.page-content {
  padding-top: calc(var(--nav-height) + 8px);
  padding-bottom: 32px;
}

/* ======== ANIMATIONS ======== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease forwards; }

/* ======== MOBILE ======== */
@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
  .lb-img-wrap { padding: 16px 10px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}

/* ============================================================
   MOBILE — Full redesign for screens <= 768px
   ============================================================ */

@media (max-width: 768px) {

  /* Hide desktop nav entirely */
  nav { display: none; }

  /* ---- MOBILE MENU PAGE ---- */
  .mobile-home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    padding: 36px 28px 40px;
    overflow-x: hidden;
  }

  .mobile-home-logo {
    margin-bottom: 32px;
  }
  .mobile-home-logo img {
    height: 48px;
    width: auto;
    display: block;
  }
  /* In light mode logo shows naturally; in dark mode invert to white */
  [data-theme="dark"] .mobile-home-logo img {
    filter: brightness(0) invert(1);
  }

  /* Top row: logo + theme toggle */
  .mobile-home-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
  }
  .mobile-home-topbar img {
    height: 44px;
    width: auto;
  }
  [data-theme="dark"] .mobile-home-topbar img {
    filter: brightness(0) invert(1);
  }

  /* Menu links */
  .mobile-nav-list {
    list-style: none;
    flex: 1;
  }

  .mobile-nav-item {
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
  }
  .mobile-nav-link:hover { color: #4aa8c0; }
  .mobile-nav-link.active-link { color: #4aa8c0; }

  .mobile-nav-link.section-header {
    font-weight: 400;
    color: var(--text);
  }

  /* Chevron */
  .mobile-chevron {
    width: 16px; height: 16px;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
    opacity: 0.5;
  }
  .mobile-nav-item.open .mobile-chevron {
    transform: rotate(90deg);
  }

  /* Sub-menu (nested galleries) */
  .mobile-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1);
  }
  .mobile-nav-item.open .mobile-sub-menu {
    max-height: 400px;
  }
  .mobile-sub-menu a {
    display: block;
    padding: 10px 0 10px 16px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
  }
  .mobile-sub-menu a:last-child { border-bottom: none; }
  .mobile-sub-menu a:hover { color: var(--text); }

  /* Bottom of menu */
  .mobile-nav-bottom {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .mobile-nav-bottom a {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.2s;
  }
  .mobile-nav-bottom a:hover { color: var(--text); }

  /* ---- MOBILE GALLERY PAGE ---- */
  .mobile-gallery-page {
    display: block;
    background: var(--bg);
    min-height: 100vh;
    padding-bottom: 32px;
  }

  /* Fixed hamburger on gallery pages */
  .mobile-hamburger {
    position: fixed;
    top: 14px; left: 14px;
    z-index: 200;
    width: 38px; height: 38px;
    background: rgba(128,128,128,0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
  }
  .mobile-hamburger span {
    display: block;
    width: 17px; height: 1.5px;
    background: #fff;
    border-radius: 2px;
  }
  [data-theme="light"] .mobile-hamburger span {
    background: #333;
  }

  /* Full-width stacked images */
  .mobile-gallery-images {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .mobile-gallery-images img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.4s;
  }
  .mobile-gallery-images img.loaded { opacity: 1; }

  /* Hide desktop-only elements on mobile */
  .page-content { padding-top: 0; }
  .photo-grid { display: none; }
  footer { display: none; }
  .lightbox .lb-prev, .lightbox .lb-next { display: flex; }

  /* Mobile footer replacement */
  .mobile-footer {
    display: block;
    text-align: center;
    padding: 20px;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  /* Slide transition */
  .slide-out-left {
    animation: slideOutLeft 0.38s cubic-bezier(0.4,0,0.2,1) forwards;
  }
  @keyframes slideOutLeft {
    to { transform: translateX(-100%); opacity: 0; }
  }
  .slide-in-right {
    animation: slideInRight 0.38s cubic-bezier(0.4,0,0.2,1) forwards;
  }
  @keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
}

/* On desktop, hide mobile-only elements */
@media (min-width: 769px) {
  .mobile-home { display: none !important; }
  .mobile-gallery-page { display: none !important; }
  .mobile-hamburger { display: none !important; }
  .mobile-footer { display: none !important; }
}

/* ---- Mobile-specific overrides ---- */
@media (max-width: 768px) {
  /* Hide desktop hero completely on mobile */
  .page-content .hero { display: none; }
  /* Remove top padding so first gallery image hits the top */
  .mobile-gallery-page .mobile-gallery-images { padding-top: 0; }
  .mobile-gallery-page { padding-top: 0; }
  /* Remove page-content top padding on mobile */
  .page-content { padding-top: 0; }
}

/* Fix: hide desktop page-content entirely on mobile so it takes zero space */
@media (max-width: 768px) {
  .page-content {
    display: none !important;
  }
  nav {
    display: none !important;
  }
}

/* ── Viewer counter ── */
.iv-counter { display: none; }

/* ── Mobile: viewer stacks vertically ── */
@media (max-width: 768px) {
  .image-viewer.open {
    flex-direction: column;
    padding-top: 0;
  }
  .iv-prev, .iv-next {
    flex: none;
    width: 50%;
    height: 56px;
    order: 2;
  }
  .iv-center { order: 1; padding: calc(var(--nav-height) + 16px) 16px 16px; }
  .iv-center img { max-height: 70vh; }
  .iv-grid-btn { top: calc(var(--nav-height) + 16px); }
}

/* ── Custom cursor for image viewer ── */













/* Viewer close button — mobile only */
#iv-close-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 700;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
}
#iv-close-btn::before,
#iv-close-btn::after {
  content: '';
  position: absolute;
  width: 36px;
  height: 4px;
  background: #222;
  border-radius: 2px;
}
#iv-close-btn::before { transform: rotate(45deg); }
#iv-close-btn::after  { transform: rotate(-45deg); }
@media (max-width: 768px) {
  #iv-close-btn { display: flex; }
}

/* ── Vimeo video entries in grid ── */
.grid-item.is-video,
.mobile-video-wrap.is-video {
  cursor: pointer;
}
/* grid-item is position:absolute from masonry JS inline styles — */
/* but we still need a stacking context for the child img/overlay  */
.grid-item.is-video {
  overflow: hidden;
}
.mobile-video-wrap.is-video {
  position: relative;
  aspect-ratio: 16 / 9;
}
.grid-item.is-video::after,
.mobile-video-wrap.is-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.18);
  pointer-events: none;
}
.grid-item.is-video::before,
.mobile-video-wrap.is-video::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}
/* Play triangle inside the circle */
.grid-item.is-video {
  overflow: hidden;
}
.grid-item.is-video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mobile-video-wrap.is-video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
/* Hide broken/missing video thumbnails cleanly */
.grid-item.is-video img[src=""],
.mobile-video-wrap.is-video img[src=""] {
  display: none;
}
.grid-item.is-video,
.mobile-video-wrap.is-video {
  background: var(--thumb-bg);
}
.grid-item.is-video .play-icon,
.mobile-video-wrap.is-video .play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-42%, -50%);
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 18px;
  border-color: transparent transparent transparent #222;
  z-index: 3;
  pointer-events: none;
}

/* ── Iframe in viewer ── */
#iv-video, #lb-video {
  display: none;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border: none;
  background: transparent;
}

/* mobile-video-wrap: treat same as img in mobile grid */
.mobile-video-wrap {
  display: block;
  width: 100%;
  position: relative;
}
.mobile-video-wrap img {
  width: 100%;
  display: block;
}

/* ── Video-only gallery: CSS grid layout ── */
.photo-grid.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 var(--grid-pad);
  position: relative;
  height: auto !important;
}
.photo-grid.video-grid .grid-item {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.photo-grid.video-grid .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
@media (max-width: 900px) {
  .photo-grid.video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Inner wrap for video grid items — handles overlay positioning */
.video-thumb-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.video-thumb-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.18);
  pointer-events: none;
}
.video-thumb-wrap::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}
.video-thumb-wrap .play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-42%, -50%);
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 18px;
  border-color: transparent transparent transparent #222;
  z-index: 3;
  pointer-events: none;
}

#iv-video[src]:not([src=""]) { pointer-events: auto; }


/* ── Image viewer cursor zones ── */
.image-viewer.open { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Crect x='2' y='2' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='20' y='2' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='2' y='20' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='20' y='20' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3C/svg%3E") 18 18, pointer; }
.image-viewer.open.zone-prev { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cline x1='28' y1='10' x2='16' y2='22' stroke='%231BA8D5' stroke-width='3.5' stroke-linecap='round'/%3E%3Cline x1='16' y1='22' x2='28' y2='34' stroke='%231BA8D5' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") 22 22, w-resize; }
.image-viewer.open.zone-next { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cline x1='16' y1='10' x2='28' y2='22' stroke='%231BA8D5' stroke-width='3.5' stroke-linecap='round'/%3E%3Cline x1='28' y1='22' x2='16' y2='34' stroke='%231BA8D5' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") 22 22, e-resize; }
.image-viewer.open.zone-grid { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Crect x='2' y='2' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='20' y='2' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='2' y='20' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3Crect x='20' y='20' width='14' height='14' rx='2' fill='%231BA8D5'/%3E%3C/svg%3E") 18 18, pointer; }

/* ── Pair items in grid ── */
.grid-item-pair {
  display: flex;
  gap: 3px;
}
.grid-item-pair img {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ======== IMAGE PROTECTION ======== */
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Licensing popup */
.license-popup {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 32px;
  max-width: 420px;
  width: calc(100% - 40px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  text-align: center;
}
.license-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.license-popup p {
  font-family: var(--font-serif);
  font-size: 0.92rem !important;
  line-height: 1.7;
  color: var(--text) !important;
  margin: 0 0 14px;
  font-weight: 300 !important;
}
.license-popup a {
  color: var(--brand);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.license-popup a:hover { opacity: 0.7; }
.license-popup-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.license-popup-close:hover { color: var(--text); }

/* ── Pair display in viewer ── */
#iv-pair-wrap {
  display: none;
  gap: 4px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
#iv-pair-wrap img {
  max-height: 88vh;
  max-width: 49%;
  object-fit: contain;
  width: auto;
  height: auto;
}
