/*
Theme Name: Ogbonna
Theme URI: https://bradogbonna.com
Author: Brad Ogbonna
Description: Minimal image-forward portfolio theme. Full-bleed slideshow home, project pages built from attached media, silent index grid.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ogbonna
*/
/* ============================================================
   BRAD OGBONNA — PHOTOGRAPHY
   Minimal / image-forward. No accent color. No decoration.
   ============================================================ */

:root {
  --bg:    #FFFFFF;
  --ink:   #111111;
  --mute:  #999999;
  --hair:  #E5E5E5;

  /* Neutral grotesque. Same family everywhere — the images are the
     only "display" element on this site. */
  --font: "Helvetica Neue", Helvetica, Arial, -apple-system, sans-serif;

  --nav-h: 60px;
  --pad: 22px;
  --sidebar-w: 210px;

  /* Home slideshow insets. Nothing is full-bleed — images sit large
     but inside a margin. Raise --slide-x to shrink landscape frames. */
  --slide-x: 6vw;
  --slide-top: calc(var(--nav-h) + 12px);
  --slide-bottom: 52px;

  /* Index contact sheet spacing. Row gap is larger than column gap
     because thumbnails keep their true height — the extra vertical
     room stops ragged rows from reading as clutter. */
  --sheet-gap-x: 20px;
  --sheet-gap-y: 34px;
  --sheet-min: 170px;   /* smaller = more images per row */
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 50;
  background: var(--bg);
}

/* On the full-bleed home, the nav sits over the image. */
.nav.over {
  background: transparent;
  color: #fff;
  mix-blend-mode: difference;
}

.nav a { display: inline-block; }

.wordmark {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-right a { opacity: 0.55; transition: opacity 0.15s ease; }
.nav-right a:hover,
.nav-right a[aria-current="page"] { opacity: 1; }

/* Work dropdown — projects listed without titles, Aksland-style */
.work { position: relative; }

.work-list {
  position: absolute;
  top: 18px;
  left: 0;
  display: none;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
  white-space: nowrap;
}

.work:hover .work-list,
.work:focus-within .work-list { display: flex; }

.work-list a { opacity: 0.55; }
.work-list a:hover { opacity: 1; }

/* ---------- Home: full-bleed slideshow ---------- */

.stage {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.slide.on { opacity: 1; }

/* Both orientations are contained — nothing is cropped, and nothing
   runs to the edge. Landscape is limited by the side inset, portrait
   by the available height. */
.slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--slide-top) var(--slide-x) var(--slide-bottom);
}

.slide > * {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Portrait gets a tighter side inset — it's height-limited anyway, so
   the extra width would only push it smaller. */
.slide--tall {
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* click zones: left half back, right half forward */
.zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 20;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.zone.prev { left: 0;  cursor: w-resize; }
.zone.next { right: 0; cursor: e-resize; }

.counter {
  position: fixed;
  bottom: var(--pad);
  right: var(--pad);
  z-index: 30;
  color: #fff;
  mix-blend-mode: difference;
  font-variant-numeric: tabular-nums;
}

/* ---------- Work overview ---------- */

.work-grid {
  padding: calc(var(--nav-h) + 8px) var(--pad) 90px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 34px 14px;
  align-items: start;
}

.work-item .box { display: block; overflow: hidden; }

.work-item .box img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.work-item:hover .box img { opacity: 0.78; }

.work-caption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 7px;
}

.work-title { color: var(--ink); }

.work-tag { color: var(--mute); }

/* ---------- Index: contact sheet ---------- */

.index-sheet {
  padding: calc(var(--nav-h) + 20px) var(--pad) 90px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--sheet-min), 1fr));
  gap: var(--sheet-gap-y) var(--sheet-gap-x);
  align-items: start;
}

/* Thumbnails are buttons so the viewer is keyboard-reachable, but they
   should look like nothing at all. */
.sheet-thumb {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.sheet-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.15s ease;
}

.sheet-thumb:hover img { opacity: 0.7; }

@media (max-width: 700px) {
  .index-sheet {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px 12px;
  }
  .work-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- Fullscreen viewer ---------- */

body.viewer-open { overflow: hidden; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer[hidden] { display: none; }

.viewer-stage {
  position: absolute;
  inset: var(--nav-h) var(--pad) 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Contained, never cropped — same rule as everywhere else on the site. */
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewer-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 2;
  border: 0;
  background: none;
  padding: 0;
}
.viewer-zone.prev { left: 0;  cursor: w-resize; }
.viewer-zone.next { right: 0; cursor: e-resize; }

.viewer-close {
  position: absolute;
  top: 0;
  right: var(--pad);
  height: var(--nav-h);
  z-index: 4;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.viewer-meta {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 18px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: none;
}

.viewer-project { color: var(--ink); pointer-events: auto; }
.viewer-project:hover { color: var(--mute); }
.viewer-count { color: var(--mute); font-variant-numeric: tabular-nums; }

/* ---------- Project page: stacked full-width images ---------- */

.project {
  padding-top: var(--nav-h);
}

.project figure {
  margin: 0 0 4px;
}

.project figure.wide  { width: 100%; }

.project figure.wide img {
  width: 100%;
  height: auto;
}

/* Portrait sits centred, capped to the viewport so it reads as one
   image rather than something you have to scroll through. */
.project figure.tall {
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
  margin-bottom: 4px;
}

.project figure.tall img {
  width: auto;
  height: auto;
  max-width: min(100%, 720px);
  max-height: calc(100vh - var(--nav-h) - 40px);
}

.project .ph {
  width: 100%;
  display: block;
}

.ph-wide { aspect-ratio: 3 / 2; }
.ph-tall { aspect-ratio: 4 / 5; }

.project-foot {
  display: flex;
  justify-content: space-between;
  padding: 40px var(--pad) 80px;
  color: var(--mute);
}

.project-foot a:hover { color: var(--ink); }

/* ---------- Information ---------- */

.info {
  padding: calc(var(--nav-h) + 60px) var(--pad) 100px;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.info p {
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 46ch;
}

.info h2 {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
  margin: 0 0 12px;
}

.info ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  line-height: 1.9;
}

.info .col-b a { border-bottom: 1px solid var(--hair); }
.info .col-b a:hover { border-color: var(--ink); }

@media (max-width: 800px) {
  .info { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Mobile nav ---------- */

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 700px) {
  /* On a narrow screen the vw-based inset is too small to read as a
     margin, so switch to the page padding. */
  :root { --slide-x: var(--pad); }

  .nav-right { display: none; }
  .menu-btn { display: block; }

  .nav-right.open {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    color: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px var(--pad) 24px;
    mix-blend-mode: normal;
  }

  .work-list { position: static; display: flex; padding-top: 10px; padding-left: 12px; }

  .index-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

/* ============================================================
   MOTION
   ============================================================ */

.motion-grid {
  padding: calc(var(--nav-h) + 8px) var(--pad) 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px 14px;
}

.motion-item .box {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f2f2f2;
}

.motion-item .box img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.motion-item:hover .box img { opacity: 0.72; }

.motion-item .cap {
  display: block;
  margin-top: 6px;
  color: var(--mute);
}

.motion-item:hover .cap { color: var(--ink); }

.motion-single { padding-top: var(--nav-h); }

/* 16:9 shell — the oEmbed iframe is forced to fill it, since Vimeo and
   YouTube return fixed pixel dimensions that won't scale on their own. */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrap iframe,
.video-wrap object,
.video-wrap embed,
.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.video-wrap--still img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.motion-meta {
  padding: 22px var(--pad) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 40px;
  align-items: baseline;
}

.motion-meta h1 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

.motion-credits {
  color: var(--mute);
  line-height: 1.7;
  max-width: 46ch;
}

.motion-credits p { margin: 0 0 4px; }

/* ============================================================
   JOURNAL
   ============================================================ */

.journal {
  padding: calc(var(--nav-h) + 60px) var(--pad) 100px;
  max-width: 1000px;
  margin: 0 auto;
}

.entry { margin-bottom: 76px; }

.entry-image { display: block; }

.entry-image img {
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}

.entry-image:hover img { opacity: 0.82; }

.entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-top: 8px;
}

.entry-title { color: var(--ink); }
.entry-title:hover { color: var(--mute); }

.entry-meta time { color: var(--mute); }

.journal-empty { color: var(--mute); }

/* Pagination */

.pagination {
  display: flex;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  color: var(--mute);
}

.pagination .page-numbers.current { color: var(--ink); }
.pagination a:hover { color: var(--ink); }
.pagination .screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Single journal post */

.post-single {
  padding: calc(var(--nav-h) + 60px) var(--pad) 60px;
  max-width: 760px;
  margin: 0 auto;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 30px;
}

.post-head h1 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

.post-head time { color: var(--mute); }

.post-body {
  font-size: 13px;
  line-height: 1.7;
}

.post-body p { margin: 0 0 18px; max-width: 60ch; }

.post-body img,
.post-body figure { margin: 30px 0; }

.post-body figure img { width: 100%; height: auto; }

.post-body figcaption {
  margin-top: 6px;
  color: var(--mute);
  font-size: 12px;
}

.post-body a { border-bottom: 1px solid var(--hair); }
.post-body a:hover { border-color: var(--ink); }

.post-body h2,
.post-body h3 {
  font-size: 13px;
  font-weight: 400;
  margin: 30px 0 10px;
}

.post-single .project-foot { padding-left: 0; padding-right: 0; }

@media (max-width: 700px) {
  .motion-grid { grid-template-columns: 1fr; }
  .entry { margin-bottom: 52px; }
}

/* ---------- Multi-up rows on project pages ---------- */

/* A Gallery block with N columns becomes an N-up row. Images keep their
   true shape and align to the top, so a portrait next to a landscape
   reads as two photographs rather than one cropped pair. */
.project-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 4px;
  align-items: start;
  margin-bottom: 4px;
}

.project-row figure {
  margin: 0;
}

.project-row figure img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 700px) {
  /* Multi-up rows collapse to a single column on phones. */
  .project-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================================
   PROJECT PAGES — sidebar + click-through viewer
   ============================================================ */

.project-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* The sidebar stays put while you page through images, so the rest of
   the body of work is always one click away. */
.project-sidebar {
  position: fixed;
  top: var(--nav-h);
  bottom: 0;
  width: var(--sidebar-w);
  padding: 4px var(--pad) 24px;
  overflow-y: auto;
  border-right: 1px solid var(--hair);
}

.sidebar-heading {
  display: block;
  color: var(--mute);
  margin-bottom: 12px;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sidebar-list a {
  color: var(--mute);
  transition: color 0.15s ease;
}

.sidebar-list a:hover { color: var(--ink); }
.sidebar-list a.is-current { color: var(--ink); }

.project-viewer {
  grid-column: 2;
  position: relative;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

.pv-stage {
  position: absolute;
  inset: 0 0 46px 0;
}

.pv-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px var(--slide-x) 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pv-slide.on { opacity: 1; }

/* Contained, never cropped — landscape and portrait alike. */
.pv-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pv-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 5;
  border: 0;
  background: none;
  padding: 0;
}
.pv-zone.prev { left: 0;  cursor: w-resize; }
.pv-zone.next { right: 0; cursor: e-resize; }

.pv-bar {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pv-title { color: var(--ink); }
.pv-count { color: var(--mute); font-variant-numeric: tabular-nums; }
.pv-empty { padding: 40px var(--pad); color: var(--mute); }

@media (max-width: 860px) {
  /* Sidebar moves above the images and scrolls horizontally, so the
     project list is still there without eating the screen. */
  .project-shell { grid-template-columns: 1fr; }

  .project-sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
    padding: calc(var(--nav-h) + 12px) var(--pad) 12px;
    overflow: visible;
  }

  .sidebar-list {
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }

  .project-viewer {
    grid-column: 1;
    margin-top: 0;
    height: 68vh;
  }
}

/* ============================================================
   INFO DOCUMENT
   ============================================================ */

.info-doc {
  padding: calc(var(--nav-h) + 60px) var(--pad) 110px;
  max-width: 1080px;
}

.info-doc h2 {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
  margin: 46px 0 12px;
}

.info-doc > h2:first-child { margin-top: 0; }

.info-doc p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 10px;
  max-width: 52ch;
}

.info-doc a { border-bottom: 1px solid var(--hair); }
.info-doc a:hover { border-color: var(--ink); }

/* Long lists (clients, press) run in columns so they don't become a
   single endless ribbon. */
.info-doc ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  columns: 4;
  column-gap: 24px;
  font-size: 13px;
  line-height: 1.75;
}

.info-doc ul li { break-inside: avoid; }

@media (max-width: 900px) { .info-doc ul { columns: 3; } }
@media (max-width: 640px) { .info-doc ul { columns: 2; } }

/* Project date sits quietly beside the title in the viewer bar. */
.pv-date {
  color: var(--mute);
  margin-left: 10px;
  font-variant-numeric: tabular-nums;
}
