/* ==============================================
   OTTO GOLDSTONE — Photography Portfolio
   Global Stylesheet
   ============================================== */

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

:root {
  --bg: #0d0d0d;
  --white: #ffffff;
  --nav-h: 80px;
  --gap: 8px;
  --track-wide: 0.18em;
  --track-wider: 0.28em;
  --ease: 300ms ease;
  --ease-slow: 600ms ease;
}

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

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  cursor: pointer;
}

/* ==============================================
   NAVIGATION
   ============================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  padding: 0 48px;
  display: flex;
  align-items: center;
  transition: background var(--ease), backdrop-filter var(--ease);
}

/* Pages without a hero: nav always has dark bg */
.site-nav.always-dark,
.site-nav.scrolled {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-logo {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: auto;
  transition: opacity 150ms ease;
}

.nav-logo:hover {
  opacity: 0.6;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-items > li > a,
.nav-dropdown-toggle {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--white);
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: opacity 150ms ease;
  cursor: pointer;
}

.nav-items > li > a:hover,
.nav-dropdown-toggle:hover {
  opacity: 0.55;
}

/* --- Dropdown --- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
  min-width: 196px;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
}

/* Invisible bridge that fills the gap between the button and the menu,
   keeping .nav-dropdown:hover active while the mouse travels down */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -12px;
  right: -12px;
  height: 20px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 11px 24px;
  font-size: 0.62rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  transition: background 150ms ease;
}

.nav-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.07);
  opacity: 1;
}

/* ==============================================
   HERO — Full-viewport crossfade
   ============================================== */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease;
  will-change: opacity;
  cursor: pointer;
}

/* --- Hero dot navigation --- */
.hero-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: background var(--ease);
}

.hero-dot.active {
  background: rgba(255, 255, 255, 0.92);
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==============================================
   GALLERY SECTION
   ============================================== */

.gallery-section {
  background: var(--bg);
}

.page-header {
  padding: 56px 48px 32px;
  text-align: center;
}

.page-header h1 {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.4;
}

.gallery {
  position: relative;
  padding: var(--gap);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  display: block; /* override <figure> default */
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform var(--ease);
}

/* Vignette overlay on hover */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity var(--ease);
  pointer-events: none;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.04);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

/* ==============================================
   LIGHTBOX
   ============================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Flex column: stacks the photo above the Info button */
.lightbox-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 0 20px;   /* top clears the fixed close button */
  max-height: 100vh;
  box-sizing: border-box;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: calc(100vh - 130px);  /* 130px = top pad + gap + button + bottom pad */
  object-fit: contain;
  display: block;
  user-select: none;
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 30px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--white);
  background: none;
  border: none;
  opacity: 0.6;
  transition: opacity 150ms ease;
  letter-spacing: 0;
  font-family: inherit;
  z-index: 501;
  padding: 4px;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 0.62rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.45;
  transition: opacity 150ms ease;
  padding: 24px 20px;
  font-family: inherit;
  z-index: 501;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

/* ==============================================
   NON-HERO PAGE WRAPPER
   ============================================== */

.page-wrapper {
  min-height: 100vh;
  background: var(--bg);
  padding-top: var(--nav-h);
}

/* ==============================================
   ABOUT PAGE
   ============================================== */

.about-content {
  max-width: 660px;
  margin: 0 auto;
  padding: 88px 48px 120px;
  text-align: center;
}

.about-portrait {
  width: 220px;
  height: 220px;
  object-fit: cover;
  object-position: center 20%;
  margin: 0 auto 56px;
  display: block;
}

.about-content h1 {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.38;
  margin-bottom: 44px;
}

.about-content p {
  font-size: 0.82rem;
  line-height: 2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-bottom: 1.6em;
}

/* ==============================================
   CONTACT BANNER
   ============================================== */

.contact-banner {
  width: 100%;
  height: 400px;
  overflow: hidden;
  line-height: 0;  /* collapse any inline gap below the img */
}

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

/* ==============================================
   CONTACT PAGE
   ============================================== */

.contact-content {
  max-width: 520px;
  margin: 0 auto;
  padding: 88px 48px 120px;
}

.contact-content h1 {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.38;
  margin-bottom: 64px;
  text-align: center;
}

.form-field {
  margin-bottom: 36px;
}

.form-field label {
  display: block;
  font-size: 0.58rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 9px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 8px 0 10px;
  outline: none;
  transition: border-color 150ms ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.form-field textarea {
  resize: none;
  min-height: 116px;
  line-height: 1.8;
}

.submit-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--white);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 14px 38px;
  margin-top: 16px;
  transition: background 150ms ease, border-color 150ms ease;
}

.submit-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.55);
}

.form-success {
  display: none;
  font-size: 0.65rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 24px;
}

.form-success.visible {
  display: block;
}

/* ==============================================
   LIGHTBOX — INFO / EXIF PANEL
   ============================================== */

/* Row holding the Info and Fullscreen buttons */
.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Shared base styles for all three control buttons */
.lightbox-info-btn,
.lightbox-fs-btn,
.lightbox-share-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, background 150ms ease, border-color 150ms ease;
}

/* "Info" text button */
.lightbox-info-btn {
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  padding: 7px 22px;
  white-space: nowrap;
}

/* Fullscreen + Share icon buttons — match Info button height */
.lightbox-fs-btn,
.lightbox-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
}

/* Share button: relative so tooltip can anchor to it */
.lightbox-share-btn {
  position: relative;
}

/* "Link copied" tooltip — slides up above the button */
.lightbox-share-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  color: #0d0d0d;
  font-family: inherit;
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 510;
}

.lightbox-share-btn.copied .lightbox-share-tooltip {
  opacity: 1;
}

/* All three visible while lightbox is open */
.lightbox.active .lightbox-info-btn,
.lightbox.active .lightbox-fs-btn,
.lightbox.active .lightbox-share-btn {
  opacity: 0.48;
  pointer-events: auto;
}

.lightbox.active .lightbox-info-btn:hover,
.lightbox.active .lightbox-fs-btn:hover,
.lightbox.active .lightbox-share-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Hide all three while the EXIF panel is showing (panel has its own close) */
.lightbox.exif-open .lightbox-info-btn,
.lightbox.exif-open .lightbox-fs-btn,
.lightbox.exif-open .lightbox-share-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* EXIF slide-up panel — lives at the bottom edge, never moves the photo */
.lightbox-exif {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(6, 6, 6, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px 52px 26px;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  z-index: 502;
  /* No pointer-events manipulation — translateY(100%) keeps it off-screen when hidden */
}

.lightbox.exif-open .lightbox-exif {
  transform: translateY(0);
}

/* × close button inside the panel */
.exif-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.38;
  padding: 6px 8px;
  transition: opacity 150ms ease;
  font-family: inherit;
  cursor: pointer;
  z-index: 503;
}

.exif-close:hover { opacity: 1; }

/* Two-column grid: label | value */
.exif-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  max-width: 560px;
  align-items: center;
}

.exif-label {
  font-size: 0.54rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.35;
  white-space: nowrap;
}

.exif-value {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  opacity: 0.82;
}

/* Thin rule between camera data and file details */
.exif-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 3px 0;
}

.exif-loading {
  font-size: 0.58rem;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  opacity: 0.35;
}

/* ==============================================
   HORIZONTAL SCROLL GALLERY — Noir et Blanc
   ============================================== */

/* Section fills the viewport below the nav, no overflow */
.gallery-section--horizontal {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

/* Tighter header for horizontal layout */
.gallery-section--horizontal .page-header {
  padding: 22px 48px 14px;
  flex-shrink: 0;
}

/* Horizontal strip: fills remaining height, scrolls sideways */
.gallery--horizontal {
  flex: 1;
  min-height: 0;          /* let flex child shrink to allow overflow */
  position: static;       /* override masonry's position: relative */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--gap);
  padding: 0 var(--gap) var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  /* Start hidden; JS reveals once built */
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Subtle dark scrollbar to match the aesthetic */
.gallery--horizontal::-webkit-scrollbar        { height: 2px; }
.gallery--horizontal::-webkit-scrollbar-track  { background: transparent; }
.gallery--horizontal::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.18); border-radius: 1px; }
.gallery--horizontal::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.38); }
.gallery--horizontal { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }

/* Each item: full height, width determined by the image's natural aspect ratio */
.gallery--horizontal .gallery-item {
  position: static !important;  /* override absolute from masonry */
  left:   auto !important;
  top:    auto !important;
  width:  auto !important;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  display: block;
}

.gallery--horizontal .gallery-item img {
  height: 100%;
  width:  auto;
  max-width: none;   /* override global img { max-width: 100% } */
  display: block;
  object-fit: cover;
  transition: transform var(--ease);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 900px) {
  .site-nav { padding: 0 28px; }

  .nav-items { gap: 24px; }
}

@media (max-width: 600px) {

  .site-nav { padding: 0 20px; }

  .nav-items { gap: 18px; }

  .nav-items > li > a,
  .nav-dropdown-toggle {
    font-size: 0.58rem;
  }

  .nav-logo { font-size: 0.65rem; }

  .about-content,
  .contact-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .page-header { padding: 44px 24px 28px; }

  .lightbox-prev,
  .lightbox-next {
    padding: 16px 10px;
  }

  .lightbox-exif {
    padding: 16px 20px 20px;
  }
}
