/* ==========================================================
   Photography site — shared styles
   Change the colors / fonts here to restyle the whole site.
   ========================================================== */

:root {
  color-scheme: dark;
  --bg: #121110;               /* page background: warm near-black */
  --surface: #1c1a18;          /* image placeholders while loading */
  --text: #ece8e1;             /* main text: warm off-white */
  --muted: #948e85;            /* labels, menu, captions */
  --line: #2b2926;             /* dividers */
  --field-line: #46423d;       /* form field underlines */
  --accent: #ece8e1;           /* button background */
  --on-accent: #121110;        /* button text */
  --error: #f2a097;
  --header-bg: rgba(18, 17, 16, 0.92);
  --lightbox-bg: rgba(8, 8, 7, 0.97);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(10px, 1.4vw, 20px);
  --max-width: 1600px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}

.nav a {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---------- Page layout ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px var(--gutter) 80px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 24px 0 12px;
}

.page-intro {
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 32px;
}

.site-footer {
  border-top: 1px solid var(--line);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Portfolio: category filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 8px 0 28px;
}

.filters[hidden] { display: none; }

.filters button {
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 6px 0;
  color: var(--muted);
  cursor: pointer;
}

.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---------- Portfolio: masonry grid ---------- */

.year-section + .year-section { margin-top: clamp(48px, 7vw, 96px); }

.year-section__title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.year-section__title small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: clamp(36px, 5vw, 72px) 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.1;
}
.year-section__title + .session-title { margin-top: 8px; }

.session-title small {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Editorial layout: rows on a 12-column grid, arranged by js/portfolio.js.
   data-shape lists each photo's shape in the row: L = landscape, P = portrait. */
.row {
  --drop: clamp(40px, 9vw, 160px);      /* how far staggered photos sit lower */
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(14px, 2.4vw, 40px);
  align-items: start;
  margin-bottom: clamp(28px, 5vw, 80px);
}

/* feature: full width; a portrait sits centred */
.row--feature > *                       { grid-column: 1 / -1; }
.row--feature[data-shape="P"] > *       { grid-column: 4 / 10; }

/* solo: one photo to one side, open space on the other */
.row--solo-right[data-shape="L"] > *    { grid-column: 5 / -1; }
.row--solo-right[data-shape="P"] > *    { grid-column: 8 / 12; }
.row--solo-left[data-shape="L"] > *     { grid-column: 1 / 9; }
.row--solo-left[data-shape="P"] > *     { grid-column: 2 / 6; }

/* stagger: two photos, the second dropped lower */
.row--stagger > :nth-child(2)                   { margin-top: var(--drop); }
.row--stagger[data-shape="LL"] > :nth-child(1)  { grid-column: 1 / 8; }
.row--stagger[data-shape="LL"] > :nth-child(2)  { grid-column: 8 / -1; }
.row--stagger[data-shape="LP"] > :nth-child(1)  { grid-column: 1 / 9; }
.row--stagger[data-shape="LP"] > :nth-child(2)  { grid-column: 9 / -1; }
.row--stagger[data-shape="PL"] > :nth-child(1)  { grid-column: 1 / 5; }
.row--stagger[data-shape="PL"] > :nth-child(2)  { grid-column: 6 / -1; }
.row--stagger[data-shape="PP"] > :nth-child(1)  { grid-column: 2 / 7; }
.row--stagger[data-shape="PP"] > :nth-child(2)  { grid-column: 8 / 12; }

/* trio: three in a row, widths set by each photo's proportions, middle dropped */
.row--trio {
  display: flex;
  gap: clamp(14px, 2.4vw, 40px);
  align-items: flex-start;
}
.row--trio > *                 { flex: 1 1 0; min-width: 0; }
.row--trio > :nth-child(2)     { margin-top: calc(var(--drop) * 0.5); }

/* Phones: one photo per line, alternating widths so the page still zig-zags */
@media (max-width: 700px) {
  .row,
  .row--trio {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
  }
  .row > *,
  .row--trio > * {
    grid-column: auto !important;
    margin-top: 0 !important;
    width: 100%;
    flex: none !important;
  }
  .row--stagger > :nth-child(2),
  .row--solo-right > *,
  .row--trio > :nth-child(2)          { width: 82%; align-self: flex-end; }
  .row--solo-left > *,
  .row--trio > :nth-child(3)          { width: 82%; }
  .row[data-shape="P"] > *,
  .row--stagger[data-shape="PP"] > *  { width: 72%; }
  .row--feature[data-shape="P"] > *   { align-self: center; }
}

.gallery__item {
  margin: 0;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.gallery__item button {
  all: unset;
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.gallery__item button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery__item img {
  width: 100%;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s ease;
}

.gallery__item img.is-loaded { opacity: 1; }
.gallery__item:hover img { transform: scale(1.015); }

.gallery__caption {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 0 0;
  background: var(--bg);
}

.gallery-empty {
  border: 1px dashed var(--line);
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}

.gallery-empty code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--lightbox-bg);
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.lightbox.is-open { display: flex; }

.lightbox__figure {
  margin: 0;
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  user-select: none;
}

.lightbox__caption {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 12px;
  text-align: center;
  min-height: 1.2em;
}

.lightbox__btn {
  position: absolute;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 16px;
  line-height: 0;
  transition: color 0.2s;
}

.lightbox__btn:hover { color: #fff; }
.lightbox__btn svg { width: 28px; height: 28px; }

.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev  { left: 8px;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 8px; top: 50%; transform: translateY(-50%); }

.lightbox__counter {
  position: absolute;
  top: 26px;
  left: 28px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 700px) {
  .lightbox__figure { max-width: 100vw; }
  .lightbox__prev, .lightbox__next { display: none; }
}

body.no-scroll { overflow: hidden; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  margin-top: 24px;
}

.about__portrait {
  position: sticky;
  top: 100px;
  margin: 0;
}

.about__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface);
}

.about__portrait .portrait-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px;
}

.about__text { max-width: 620px; }
.about__text .page-title { margin-top: 0; }

.about__text p { margin: 0 0 1.2em; }

.about__text h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin: 40px 0 12px;
}

.about__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about__list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.about__list span:last-child { color: var(--muted); text-align: right; }
.about__list span:first-child { white-space: nowrap; }

@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait { position: static; max-width: 480px; }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  margin-top: 24px;
}

.contact__details dl { margin: 0; }

.contact__details dt {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 24px;
}

.contact__details dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.contact__details dd a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact__details dd a:hover { border-bottom-color: var(--text); }

.form { display: grid; gap: 20px; }

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.form input,
.form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--field-line);
  border-radius: 0;
  padding: 10px 0;
  transition: border-color 0.2s;
}

.form textarea { min-height: 160px; resize: vertical; }

.form input:focus,
.form textarea:focus {
  outline: none;
  border-bottom-color: var(--text);
}

.form button {
  justify-self: start;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 14px 36px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.form button:hover { background: transparent; color: var(--accent); }
.form button:disabled { opacity: 0.5; cursor: wait; }

.form__status { font-size: 0.9rem; min-height: 1.4em; margin: 0; }
.form__status.is-error { color: var(--error); }

.hp { position: absolute; left: -9999px; }

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

@media (max-width: 480px) {
  .form__row { grid-template-columns: 1fr; }
  .site-header__inner { flex-direction: column; gap: 6px; padding-top: 16px; padding-bottom: 12px; }
}
