/* Allison Chu Photography — layout follows portfolio.joemcnally.com/index/all:
   a thin full-width header, a fixed vertical nav down the left, and a near-flush
   masonry photo grid. Black ground, white text, nothing decorative. */

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8a8a8a;
  --line: #1e1e1e;
  --header-h: 80px;
  --sidebar-w: 200px;
  --gutter: 20px;         /* page edge padding */
  --grid-x: 210px;        /* where the photo grid starts, measured off the reference */
  --grid-gap: 12px;       /* the reference grid is near-flush, but not zero */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* Visible to screen readers, not on screen — each gallery still needs an h1. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: var(--bg);
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 22px;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--fg);
  white-space: nowrap;
}
.header-meta a:hover { color: var(--muted); }

/* ---------- Left sidebar ---------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 4px var(--gutter) 32px;
  overflow-y: auto;
  background: var(--bg);
  z-index: 20;
}

.nav-group {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}
.nav-group:last-child { margin-bottom: 0; }

.nav-link {
  display: block;
  font-size: 0.875rem;        /* 14px, matching the reference nav */
  line-height: 27px;          /* the row rhythm of the reference nav */
  font-weight: 400;
  color: var(--fg);
  white-space: nowrap;
}
.nav-link.sub { padding-left: 10px; }   /* categories indent under Overview All */
.nav-link:hover { color: var(--muted); }
.nav-link.active { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

.nav-contact {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 4px;
}
.nav-contact a { display: block; line-height: 0; color: var(--fg); }
.nav-contact a:hover { color: var(--muted); }

.nav-icon {
  width: 16px; height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon .icon-dot { fill: currentColor; stroke: none; }

/* ---------- Main / photo grid ---------- */
main {
  margin-top: var(--header-h);
  margin-left: var(--grid-x);
  padding: 0 48px 60px 0;   /* right margin measured off the reference */
}

.photo-grid {
  /* Masonry: equal-width columns, a 12px gutter, each photo keeping its own aspect
     ratio. (The brief said zero gutter, but the reference site measures ~12px between
     columns and rows, so it is matched rather than flattened.) CSS columns rather than
     JS balancing means the DOM order IS the read order, so the lightbox's prev/next
     follows exactly what the eye follows down a column — and it survives a resize
     with no script. */
  column-count: 4;
  column-gap: var(--grid-gap);
  line-height: 0;             /* kills the inline-block gap under each image */
}
@media (max-width: 1200px) { .photo-grid { column-count: 3; } }
@media (max-width: 760px)  { .photo-grid { column-count: 2; } }

.tile {
  display: block;
  break-inside: avoid;
  cursor: zoom-in;
  position: relative;
  margin-bottom: var(--grid-gap);
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.25s ease;
}
.tile:hover img { opacity: 0.72; }

/* ---------- Hamburger + off-canvas nav (mobile only) ---------- */
.nav-burger {
  display: none;
  width: 26px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  flex: none;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
}

.nav-scrim { display: none; }

@media (max-width: 760px) {
  :root { --header-h: 40px; --gutter: 14px; --grid-x: 0px; --grid-gap: 8px; }

  .nav-burger { display: flex; }
  .brand { font-size: 0.78rem; letter-spacing: 0.1em; }

  /* A 40px bar has no room for the email and the copyright line: at 390px they
     overflow the screen and get clipped mid-address. The phone header keeps the
     hamburger and her name; both contacts live one tap away in the menu, and the
     copyright sits on the About page. */
  .header-meta { display: none; }

  /* Sidebar parks off-canvas and slides in when the hamburger is checked. */
  .sidebar {
    top: var(--header-h);
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    padding-top: 16px;
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }

  /* Tapping anywhere outside the open menu closes it. */
  .nav-toggle:checked ~ .nav-scrim {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.55);
  }

  main { margin-left: 0; padding-right: var(--gutter); padding-left: var(--gutter); }
}

/* ---------- Lightbox ---------- */
.lb-lock { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.96);
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  touch-action: pan-y;
  line-height: 0;
}
.lightbox[data-open="true"] { display: flex; }

.lb-stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img {
  max-width: 94vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
}

.lb-btn {
  position: absolute;
  background: rgba(20, 20, 20, 0.6);
  color: var(--fg);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: #555; }

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.9rem;
  font-weight: 700;
}
.lb-prev { left: clamp(8px, 3vw, 28px); }
.lb-next { right: clamp(8px, 3vw, 28px); }

.lb-close {
  top: clamp(10px, 3vw, 24px);
  right: clamp(10px, 3vw, 24px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
}

@media (max-width: 520px) {
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 1.5rem; }
}

/* ---------- About ---------- */
/* No headshot and no bio copy: Allison has given us neither, and an empty photo
   frame reads worse than a clean text column. */
.about {
  padding: 40px var(--gutter) 60px 0;
  max-width: 560px;
}

.about-name {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.01em;
  font-weight: 700;
}
.about-role {
  margin: 6px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}
.contact-block {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.contact-block h2 {
  margin: 0 0 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 400;
}
.contact-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.contact-list li { margin: 0 0 10px; }
.contact-list a {
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
  transition: border-color 0.15s;
}
.contact-list a:hover { border-bottom-color: var(--fg); }
