/* =============================================
   JON GORDON PHOTOGRAPHY — Static Site CSS
   v4 — All WP-accurate measurements + fixes
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Merriweather:wght@300;400&display=swap');

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Desktop: horizontal scroll like WP for gallery pages */
html {
  overflow-x: scroll;
  overflow-y: hidden;
}

/* About and contact pages scroll vertically, not horizontally */
html.page-scrollable {
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'Lato', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  background-color: #fff;
  color: #111;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; }

/* ---------- HEADER ---------- */
header {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  background: #fff;
  height: 147px;           /* matches WP total header height */
  width: 100vw;
  min-width: 100%;
  display: flex;
  align-items: center;
  border-top: 3px solid #000;  /* black line at very top of viewport */
}

.logo-area {
  flex: 0 0 291px;
  width: 291px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  /* Border is on a pseudo-element to match WP's hgroup dimensions:
     WP hgroup top=15 bottom=132, so border runs y=15→132, leaving 15px gaps at top and bottom */
}

/* This creates the header's vertical line at exactly the right height, matching WP's hgroup border */
.logo-area::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15px;
  bottom: 15px;   /* 147px header - 15px top - 15px bottom = 117px, matching hgroup height */
  width: 1px;
  background: #ebebeb;
}

.logo-area img { max-width: 190px; height: auto; }

nav.primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 28px;   /* so first nav item left edge ≈ x=319 */
}

nav.primary-nav ul, nav.secondary-nav ul {
  list-style: none;
  display: flex;
  gap: 16px;   /* WP uses margin-right:16px on each li, gap:16px is equivalent */
  align-items: center;
}

nav.primary-nav ul li a,
nav.secondary-nav ul li a {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: normal;
  color: #888;
  text-transform: uppercase;
  padding: 4px 6px 5px;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  display: block;
}

nav.primary-nav ul li a:hover,
nav.secondary-nav ul li a:hover { color: #333; }

nav.primary-nav ul li a.active,
nav.secondary-nav ul li a.active { background: #ffe8ed; color: #111; }

nav.secondary-nav { flex: 0 0 auto; padding-right: 15px; }


/* ---------- HAMBURGER — hidden on desktop ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  position: absolute;   /* relative to fixed header — stays in header */
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
}

.hamburger span {
  display: block;
  width: 28px; height: 3px;
  background: #111;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); background: #fff; }
.hamburger.active span:nth-child(2) { opacity: 0; background: #fff; }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background: #fff; }

/* ---------- MOBILE NAV ---------- */
.mobile-nav-dim {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  z-index: 9998;
}
.mobile-nav-dim.open { display: block; }

.mobile-nav-panel {
  position: fixed;
  top: 0; right: -320px;
  width: 320px; height: 100%;
  background: #111;
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 70px 0 50px;
  overflow-y: auto;
}
.mobile-nav-panel.open { right: 0; }

/* × Close button inside mobile nav panel */
.mobile-nav-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}
.mobile-nav-close:hover { color: #fff; }

.mobile-nav-panel a {
  display: block;
  padding: 20px 45px 22px 30px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 16px;
  font-weight: 400;
  border-bottom: 1px solid #1d1d1d;
  transition: color 0.15s;
}
.mobile-nav-panel a:last-child { border-bottom: none; }
.mobile-nav-panel a.active { color: #fff; background: none; }
.mobile-nav-panel a:active, .mobile-nav-panel a:hover { color: #fff; }

/* ---------- PAGE CONTENT ---------- */
.page-content { margin-top: 147px; }

/* ---------- HOME GALLERY ---------- */
.home-gallery-wrap {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-left: 34px;    /* sidebar handles the 291px offset; this is the 34px gap to first image */
  padding-bottom: 50px;  /* breathing room below for caption labels */
  white-space: nowrap;
}

.home-thumb {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  margin-right: 38px;
}

.home-thumb-preview {
  position: relative;
  height: calc(100vh - 220px);
  overflow: hidden;
}

.home-thumb-preview img { height: calc(100vh - 220px); width: auto; display: block; }

.home-thumb-hover-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.28);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.home-thumb-hover-label span {
  font-family: 'Lato', sans-serif;
  font-weight: 700; font-size: 18px;
  letter-spacing: 0.18em; text-transform: uppercase; color: #fff;
}

.home-thumb:hover .home-thumb-hover-label { opacity: 1; }

.home-thumb-info {
  display: block;
  padding: 10px 2px 6px;
  font-family: 'Lato', sans-serif;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: #111;
  white-space: nowrap;
}

/* ---------- GALLERY PAGES ---------- */
/* Use a flex row layout matching WP's structural approach:
   sidebar div (with border-right) + gallery content div side by side.
   Both scroll off-screen to the left as the user scrolls right.
   The sidebar border-right IS the vertical line — no absolute positioning needed. */

.gallery-page {
  display: flex;
  flex-direction: row;
  align-items: stretch;          /* sidebar and gallery same height */
  min-height: calc(100vh - 197px); /* fill from header bottom to footer top */
}

/* Sidebar: matches WP's .sidebar-portfolio-single geometry exactly.
   WP: left=15, right=291, width=276, border-right at x=291. */
.gallery-sidebar {
  flex: 0 0 276px;
  width: 276px;
  margin-left: 15px;
  border-right: 1px solid #ebebeb;  /* this IS the vertical line */
  flex-shrink: 0;
  position: relative;               /* so title can be positioned within */
}

.gallery-page-title {
  position: absolute;
  top: 0;
  left: 5px;                        /* sidebar left=15px, +5px offset = x=20 viewport (matches WP) */
  width: 235px;                     /* WP title container width, right edge at x=255 */
  font-family: 'Lato', sans-serif;
  font-weight: 700; font-size: 23px;
  letter-spacing: 1.38px;
  text-transform: uppercase; color: #111;
  text-align: right;
  background: #fff;
  padding-bottom: 25px;
}

.gallery-wrap {
  display: flex; flex-direction: row;
  align-items: flex-start;
  padding-left: 34px;   /* 34px gap from sidebar border to first image, matching WP */
  white-space: nowrap;
  flex-shrink: 0;
}

.gallery-figure {
  display: inline-flex; flex-direction: column;
  margin: 0; flex-shrink: 0;
  cursor: pointer;
}

.gallery-figure + .gallery-figure { margin-left: 38px; }

.gallery-figure img { height: calc(100vh - 197px); width: auto; display: block; }

/* ---------- ABOUT ---------- */
/* WP about page: no sidebar, content starts at x=325 flush to header bottom */
.about-content {
  padding: 0 60px 100px 325px;   /* left=325 matches WP measurement */
  max-width: 1200px;
}

/* H1: Lato 300 36px, no letter-spacing, no text-transform — matches WP exactly.
   WP h1 bottom ≈ y=190, first paragraph top = y=222 → 32px gap below heading. */
.about-title {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 36px;
  letter-spacing: normal;
  text-transform: none;
  color: #111;
  margin: 0 0 32px 0;
  padding: 0;
  line-height: 1.2;
}

/* Body paragraphs: Merriweather 400 16px line-height 30px — matches WP exactly */
.about-body {
  font-family: 'Merriweather', georgia, serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 30px;
  color: #222;
  margin: 0 0 16px 0;
  max-width: 810px;
}

/* ---------- CONTACT ---------- */
/* WP contact: full-bleed hero image from x=15 to right edge, height=calc(100vh-197px) */
.contact-hero {
  position: absolute;
  left: 15px;
  top: 0;                         /* relative to page-content (margin-top:147px) */
  right: 0;
  height: calc(100vh - 197px);    /* fills header-bottom to footer-top */
  background-image: url('/images/uploads/2013/03/2012_04_28_JonGordon_FVazquez_IMMIGRANT_CAPTURES_09_169_BACKGROUND-931x1280.jpg');
  background-size: cover;
  background-position: center center;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-top: 160px;             /* pushes content to vertical center of hero */
  gap: 0;
}

.page-content:has(.contact-hero) {
  position: relative;
  min-height: calc(100vh - 197px);
}

/* Left column: title + location paragraph — WP measured left≈456 from viewport = 441px from hero left=15 */
.contact-hero-left {
  padding-left: 441px;
  width: 870px;
  flex-shrink: 0;
}

.contact-title {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 36px;
  color: #fff;
  letter-spacing: normal;
  text-transform: none;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.contact-location {
  font-family: 'Merriweather', georgia, serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 30px;
  color: #fff;
  margin: 0;
  max-width: 387px;
}

/* Right column: Tel/Email labels + value — WP measured left≈883 from viewport = 868px from hero left=15 */
.contact-hero-right {
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* TEL / EMAIL labels: h6, 13px, bold, uppercase, white */
.contact-label {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 5px 0;
  letter-spacing: normal;
}

/* Email link: 14px, white, no decoration */
.contact-value {
  font-family: 'Merriweather', georgia, serif;
  font-weight: 400;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-top: 4px;
}

/* ---------- FOOTER VARIANTS ---------- */
/* Static pages (about, contact): no arrow buttons, just copyright right-aligned */
footer.footer-static {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 50px;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 15px;
  background: transparent;
  z-index: 100;
}

/* On static pages, copyright has no "/" pseudo-element prefix */
.footer-copyright-only {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #6e6e6e;
  letter-spacing: normal;
}
.footer-copyright-only::before { content: none; }

/* ---------- FOOTER ---------- */
footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 50px;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 15px;
  background: transparent;   /* WP footer is transparent — white page shows through */
  z-index: 100; gap: 0;      /* gap handled by divider "/" in copyright ::before */
}

.footer-nav-hint {
  font-family: 'Lato', sans-serif; font-size: 12px;
  font-weight: 400;  /* WP measured 400, body default is 300 so must be explicit */
  color: #6e6e6e;
  letter-spacing: normal;
  display: flex; align-items: center; gap: 8px;
}

.arrow-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid #eaeaea;
  border-radius: 0;           /* square, not circle */
  cursor: pointer; font-size: 11px; color: #111;
  background: none;
  transition: border-color 0.15s, color 0.15s;
}
.arrow-btn:hover { border-color: #111; color: #111; }

.footer-copyright {
  font-family: 'Lato', sans-serif; font-size: 12px;
  font-weight: 400;  /* WP measured 400 */
  color: #6e6e6e;
  letter-spacing: normal;
}

/* WP shows a "/" divider between "for navigation" and "© JON GORDON" */
.footer-copyright::before {
  content: '/';
  margin: 0 15px;   /* equal spacing on both sides of the slash */
  color: #6e6e6e;
}

/* ---------- LIGHTBOX ---------- */
.lightbox-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,1);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox-overlay.open { display: flex; }

/* Stage: holds image + click zones */
.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

#lightboxImg {
  max-width: 94vw;
  max-height: calc(100vh - 50px);  /* leave room for bottom bar */
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

/* Invisible cursor-zone overlays on top of image area */
.lb-zones {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;  /* default off; JS enables when lightbox open */
}
.lb-zone {
  flex: 1;
  height: 100%;
  pointer-events: all;
}
.lb-zone-prev  { flex: 0 0 30%; cursor: w-resize; }
.lb-zone-center { flex: 0 0 40%; cursor: zoom-in; }
.lb-zone-next  { flex: 0 0 30%; cursor: e-resize; }
.lb-zone-center.zoomed { cursor: zoom-out; }

/* Bottom controls bar */
.lightbox-bottom-bar {
  position: relative;
  width: 100%;
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0,0,0,0);
}

.lb-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}
.lb-close:hover { color: #fff; }

.lb-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-icon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.15s;
}
.lb-icon-btn:hover { color: #fff; }

.lb-nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 26px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  font-weight: 300;
}
.lb-nav-btn:hover { color: #fff; }

/* ============================================
   MOBILE RESPONSIVE (max-width: 900px)
   ============================================ */
@media (max-width: 900px) {
  html { overflow-x: hidden; overflow-y: auto; }
  html.page-no-scroll { overflow-y: hidden; }

  /* FIX 1: Header height — live WP site is 142px on mobile (nearly desktop height).
     Increasing from 80px → 135px so logo has proper top/bottom breathing room. */
  header {
    height: 135px;
    min-width: unset;
    width: 100%;
    border-top-width: 3px;
  }

  .logo-area {
    flex: 1; width: auto;
    border-right: none;
    justify-content: center;
  }
  /* Hide the desktop vertical line — no sidebar on mobile */
  .logo-area::after { display: none; }
  .logo-area img { max-width: 180px; }

  nav.primary-nav, nav.secondary-nav { display: none; }

  .hamburger { display: flex; }

  /* Empty sidebar (homepage) — completely hidden on mobile */
  .gallery-sidebar:empty { display: none; }

  /* FIX 3: Gallery page sidebar — CRITICAL: must reset flex so flex-basis:276px doesn't
     become 276px HEIGHT in a column flex layout (was creating the huge gap above images).
     flex:none removes all flex sizing; width:100% makes it full-width. */
  .gallery-sidebar {
    flex: none;
    width: 100%;
    margin-left: 0;
    border-right: none;
    border-bottom: none;
    position: static;
  }
  .gallery-page {
    flex-direction: column;
    min-height: unset;
  }

  .page-content { margin-top: 135px; }

  /* Home gallery — vertical stack */
  .home-gallery-wrap {
    flex-direction: column;
    padding-left: 0;
    white-space: normal;
    padding-bottom: 0;
  }
  .home-thumb {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0;   /* spacing handled by info border-bottom + margin below */
    display: block;
  }
  .home-thumb-preview { height: auto; }
  /* 10px each side matches live WP's .site-with-sidebar { margin: 0 10px } wrapper */
  .home-thumb-preview img { width: calc(100% - 20px); height: auto; margin: 0 10px; }

  /* FIX 2: Homepage labels — left/right padding matches WP's 10px section margin.
     margin-bottom adds gap between label border and next image (matching live site spacing). */
  .home-thumb-info {
    padding: 15px 10px;        /* 10px left/right matches WP label indentation */
    font-size: 21px;
    font-weight: 700;
    border-bottom: 2px solid #111;
    border-top: none;
    width: 100%;
    letter-spacing: 0.42px;    /* matches WP measured value */
    margin-bottom: 20px;       /* gap between label and next image */
  }

  /* Gallery page title — static on mobile, full-width banner with top+bottom borders */
  .gallery-page-title {
    position: static;
    display: block;
    width: auto;
    text-align: left;
    font-size: 21px;
    letter-spacing: 1.26px;
    padding: 10px 10px;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    background: #fff;
  }

  /* FIX 3 (cont): Gallery images — simple block stack, no flex complications */
  .gallery-wrap {
    display: block;            /* switch from flex to block — simpler, no flex-basis issues */
    padding-left: 0;
    white-space: normal;
    padding-bottom: 0;
  }
  .gallery-figure {
    width: 100%;
    display: block;
    margin-left: 0 !important;
    margin-bottom: 12px;
    cursor: pointer;
  }
  .gallery-figure img {
    width: calc(100% - 20px); /* 10px each side, matches WP live site */
    height: auto;
    margin: 0 10px;
  }

  /* FIX 5/6: Footer — match live WP site: no border, transparent bg, #ccc credits.
     Gallery/about pages: footer scrolls with content (position:static). */
  footer {
    position: static;
    justify-content: flex-end;
    padding: 10px 15px;
    height: 50px;
    background: transparent;
    border-top: none;           /* live site has NO border on mobile footer */
  }
  .footer-nav-hint { display: none; }
  /* Credits color matches live WP: rgb(204,204,204) = #ccc, 11px */
  .footer-copyright {
    font-size: 11px;
    color: #ccc;
  }
  /* Remove "/" divider on mobile — nav-tip is hidden so no divider needed */
  .footer-copyright::before { display: none; }

  /* FIX 5: footer.footer-static (about/contact) — no border, transparent, copyright only */
  footer.footer-static {
    position: static;
    border-top: none;
    background: transparent;
    justify-content: flex-end;
    padding: 10px 15px;
    height: 50px;
  }
  .footer-copyright-only {
    font-size: 11px;
    color: #ccc;
  }

  /* About — remove large left padding on mobile */
  .about-content {
    padding: 40px 24px 60px;
  }

  /* Contact hero — mobile: relative flow, single column, background image covers */
  .contact-hero {
    position: relative;
    left: 0;
    height: auto;
    min-height: calc(100vh - 135px);
    padding: 40px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }
  .contact-hero-left {
    padding-left: 0;
    width: 100%;
  }
  .contact-hero-right {
    padding-left: 0;
  }

  /* Lightbox — mobile adjustments */
  #lightboxImg {
    max-width: 100vw;
    max-height: calc(100vh - 135px);
  }
  .lb-zone-prev, .lb-zone-next { flex: 0 0 20%; }
  .lb-zone-center { flex: 0 0 60%; }
  .lightbox-bottom-bar { padding: 0 16px; justify-content: center; position: relative; }
  .lb-close { position: absolute; left: 50%; transform: translateX(-50%); }
  .lb-bar-right { margin-left: auto; }
}

@media (max-width: 480px) {
  header { height: 110px; }
  .page-content { margin-top: 110px; }
  .contact-hero { min-height: calc(100vh - 110px); }
  .logo-area img { max-width: 155px; }
  .mobile-nav-panel { width: 280px; right: -280px; }
  .mobile-nav-panel.open { right: 0; }
}
