/* Andrewjozef photography portfolio
   Contemporary, minimal, white. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #5a5a5a;
  --line: #ececec;
  --line-strong: #d8d8d8;
  --overlay: rgba(10, 10, 10, 0.92);
  --header-h: 4.25rem;
  --pad: clamp(1.1rem, 3.5vw, 2.75rem);
  --gallery-h: clamp(17.5rem, calc(100vh - var(--header-h) - 8.5rem), 40rem);
  --gap: 0.7rem;
  --font-display: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  --focus: 0 0 0 2px #fff, 0 0 0 4px #111;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

img {
  max-width: none;
  height: auto;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header (clean, white, no hero) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--pad);
  gap: 1.25rem;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  z-index: 2;
}

.brand picture {
  display: flex;
  align-items: center;
  height: 38px;
}

.brand-logo {
  height: 38px;
  width: auto;
  max-height: 79px;
  max-width: 256px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-fallback {
  display: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
}

.brand.is-fallback .brand-logo {
  display: none;
}

.brand.is-fallback .brand-fallback {
  display: inline-block;
}

/* ---------- Nav ---------- */

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  border-radius: 4px;
}

.menu-toggle:focus-visible,
.site-nav a:focus-visible,
.site-nav button:focus-visible,
.gallery-nav:focus-visible,
.slide-open:focus-visible,
.lightbox button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 1.2rem;
  height: 1.5px;
  background: var(--text);
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }

body.nav-open .menu-toggle-bars {
  background: transparent;
}

body.nav-open .menu-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.nav-open .menu-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list > li {
  position: relative;
}

.nav-list a,
.nav-list .submenu-toggle {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.45rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list .submenu-toggle:hover {
  opacity: 0.55;
}

.chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s var(--ease);
}

.has-sub.is-open > .submenu-toggle .chevron,
body.nav-open .has-sub.is-open > .submenu-toggle .chevron {
  transform: translateY(1px) rotate(225deg);
}

.submenu {
  position: absolute;
  top: calc(100% + 0.85rem);
  right: 0;
  min-width: 17.5rem;
  max-height: min(70vh, 38rem);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.45rem 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 220;
}

.submenu a {
  display: block;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 400;
  font-size: 0.9rem;
  padding: 0.48rem 1.1rem;
  white-space: normal;
  line-height: 1.35;
}

.submenu a:hover {
  opacity: 1;
  background: #f6f6f6;
}

/* Desktop: open when clicked/toggled, and (when hover exists) on hover or focus */
@media (min-width: 861px) {
  .has-sub.is-open > .submenu,
  html.shot-projects .has-sub > .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .has-sub.is-open > .submenu-toggle .chevron,
  html.shot-projects .has-sub > .submenu-toggle .chevron {
    transform: translateY(1px) rotate(225deg);
  }
}

@media (hover: hover) and (min-width: 861px) {
  .has-sub:hover > .submenu,
  .has-sub:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .has-sub:hover > .submenu-toggle .chevron,
  .has-sub:focus-within > .submenu-toggle .chevron {
    transform: translateY(1px) rotate(225deg);
  }
}

/* ---------- Main / galleries ---------- */

.site-main {
  padding: 0 0 3rem;
}

.gallery-section {
  padding-top: 1.75rem;
  padding-bottom: 1.25rem;
}

.gallery-section:first-of-type {
  padding-top: 1.5rem;
}

.projects-wrap {
  scroll-margin-top: var(--header-h);
}

.section-head {
  padding: 0 var(--pad) 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-head h2 {
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.gallery {
  position: relative;
}

.gallery-track {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  padding: 0 var(--pad);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
  outline: none;
}

.gallery-track::-webkit-scrollbar {
  height: 6px;
}

.gallery-track::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 99px;
}

.slide {
  flex: 0 0 auto;
  height: var(--gallery-h);
  width: auto;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

.slide-open {
  display: block;
  height: 100%;
  width: auto;
  padding: 0;
  background: #f4f4f4;
  cursor: zoom-in;
}

.slide-open picture,
.slide-open img {
  height: 100%;
  width: auto;
  display: block;
}

.slide-open img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  aspect-ratio: var(--img-w) / var(--img-h);
  background: #f4f4f4;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), background 0.2s ease;
}

.gallery-nav svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-nav.prev { left: calc(var(--pad) * 0.35); }
.gallery-nav.next { right: calc(var(--pad) * 0.35); }

.gallery:hover .gallery-nav,
.gallery:focus-within .gallery-nav,
.gallery-nav:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.gallery-nav:hover {
  background: #fff;
}

.gallery-nav[hidden],
.gallery-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

@media (hover: none) {
  .gallery-nav {
    display: none;
  }
}

@media (min-width: 861px) and (hover: none) {
  .gallery-nav {
    display: flex;
    opacity: 0.9;
    pointer-events: auto;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 3.5rem var(--pad) 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 6.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-caption {
  color: #e8e8e8;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  color: #fff;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.lightbox-close { top: 0.85rem; right: 0.85rem; }
.lightbox-prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.6rem; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- Mobile menu ---------- */

@media (max-width: 860px) {
  :root {
    --header-h: 3.75rem;
    /* Keep typical 3:2 frames fully in view on a narrow screen */
    --gallery-h: clamp(13.5rem, calc((100vw - var(--pad) * 2) * 0.68), 22rem);
  }

  .brand picture {
    height: 36px;
  }

  .brand-logo {
    height: 36px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.35s var(--ease), visibility 0.35s;
  }

  body.nav-open .site-nav {
    max-height: min(80vh, calc(100dvh - var(--header-h)));
    overflow: auto;
    visibility: visible;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem 0 1rem;
  }

  .nav-list > li {
    border-top: 1px solid var(--line);
  }

  .nav-list a,
  .nav-list .submenu-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 0.95rem var(--pad);
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 1.05rem;
    font-family: var(--font-display);
  }

  .submenu {
    position: static;
    min-width: 0;
    max-height: 0;
    overflow: hidden;
    border: 0;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: max-height 0.3s var(--ease);
  }

  .has-sub.is-open > .submenu {
    max-height: 70vh;
    overflow: auto;
    padding: 0 0 0.5rem;
  }

  .submenu a {
    padding: 0.65rem var(--pad) 0.65rem calc(var(--pad) + 0.85rem);
    font-size: 0.95rem;
    color: #333;
  }

  .gallery-nav {
    display: none;
  }

  .lightbox {
    padding: 4rem 1rem 1.5rem;
  }

  .lightbox-prev { left: 0.15rem; }
  .lightbox-next { right: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- About & Contact ---------- */

.nav-list a[aria-current="page"] {
  opacity: 0.55;
}

.about-page {
  padding: 2.75rem var(--pad) 5rem;
  max-width: 72rem;
  margin: 0 auto;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.about-page h1 {
  font-size: clamp(1.65rem, 2.5vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 1.6rem;
}

.about-copy p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #222;
  margin: 0 0 1.2rem;
  max-width: 40rem;
}

.about-copy p:last-of-type {
  margin-bottom: 0;
}

.about-location {
  margin: 1.85rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.contact-block {
  margin-top: 2.4rem;
  padding-top: 1.85rem;
  border-top: 1px solid var(--line);
}

.contact-block h2 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.7rem;
}

.contact-intro {
  margin: 0 0 1.15rem;
  max-width: 36rem;
  line-height: 1.6;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 1rem;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
}

.contact-list .label {
  color: var(--muted);
  min-width: 5.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-list a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.contact-list a:hover {
  border-bottom-color: currentColor;
}

.about-photo {
  margin: 0.15rem 0 0;
}

.about-photo picture,
.about-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.about-photo img {
  background: #f4f4f4;
}

@media (max-width: 860px) {
  .about-page {
    padding-top: 2rem;
    padding-bottom: 3.5rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
}
