/* ==========================================================================
   photo67.com — Elad, photography portfolio
   Fixed layout. Do not edit this file to change content; edit photos.json
   and the [data-editable] regions in index.html.
   Palette, type and layout rules come from the handoff Design Spec.
   ========================================================================== */

:root {
  --paper:      #FBFAF8;
  --paper-sunk: #F2EFE9;
  --hairline:   #E9E6E0;
  --ink-quiet:  #8A857D;
  --ink-body:   #3E3B36;
  --ink:        #2E2C29;
  --lightbox:   #141312;

  --muted:      #6F6A62;   /* standfirst / summary text */
  --footer-ink: #A29C93;
  --img-bg:     #EFECE6;   /* flat placeholder while an image loads */
  --rule:       #C9C4BB;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;

  --pad-x: clamp(14px, 3vw, 40px);
  --maxw:  1600px;
}

/* ---------- reset ---------- */
html { -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
img { -webkit-user-drag: none; }
::selection { background: #E7E4DE; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-quiet); }

/* ---------- shell ---------- */
.page {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 250, 248, 0.94);
  backdrop-filter: saturate(120%) blur(8px);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 22px) var(--pad-x) clamp(10px, 1.6vw, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.4vw, 14px);
}
.wordmark {
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 27px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
}
.nav { display: flex; gap: clamp(16px, 2.4vw, 30px); align-items: baseline; }
.nav a {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* active state is a 1px rule, never a colour */
.nav a .underline { display: block; height: 1px; background: var(--ink); margin-top: 5px; }

/* ---------- main ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 56px) var(--pad-x) clamp(48px, 6vw, 96px);
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: 0.01em;
  margin: 0 0 clamp(24px, 4vw, 44px);
}
.standfirst {
  margin: 0 0 clamp(22px, 4vw, 46px);
  max-width: 34em;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.75;
  color: var(--muted);
  text-wrap: pretty;
}
.prose {
  margin: 0;
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.8;
  color: var(--ink-body);
  max-width: 32em;
  text-wrap: pretty;
}
/* consecutive paragraphs get one line of air, nothing more */
.prose + .prose { margin-top: 1.1em; }
.label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* ---------- justified photo rows ----------
   Desktop: flex-grow = aspect, flex-basis = aspect x rowHeight, so rows fill
   the width at equal height with zero cropping. Mobile: one per row.        */
.feed {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: clamp(22px, 3.2vw, 34px);
}
.feed figure { margin: 0; min-width: 0; max-width: 100%; }
.feed img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: var(--img-bg);
}
.feed figcaption {
  margin-top: 9px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-quiet);
  line-height: 1.5;
}

/* ---------- albums index ---------- */
.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  column-gap: clamp(14px, 2vw, 26px);
  row-gap: clamp(30px, 4vw, 52px);
  align-items: start;
}
.albums a { display: block; }
.albums img { display: block; width: 100%; height: auto; background: var(--img-bg); }
.albums__meta { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.albums__title {
  font-family: var(--serif);
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.2;
}

/* ---------- album detail ---------- */
.backlink {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.album__title { margin: clamp(16px, 2vw, 22px) 0 10px; }
.album__summary { margin: 0 0 clamp(24px, 4vw, 46px); }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  column-gap: clamp(24px, 4vw, 64px);
  row-gap: clamp(24px, 3vw, 32px);
  align-items: start;
  max-width: 1100px;
}
.about img { display: block; width: 100%; height: auto; background: var(--img-bg); }
.about .title { margin: 0 0 clamp(16px, 2vw, 22px); }
.portrait-placeholder {
  aspect-ratio: 4 / 5;
  background: repeating-linear-gradient(135deg, #F2EFE9 0 8px, #EDE9E2 8px 16px);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.portrait-placeholder span {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 11px;
  color: var(--ink-quiet);
  letter-spacing: 0.02em;
}

/* ---------- contact ---------- */
.contact { max-width: 32em; }
.contact .title { margin: 0 0 clamp(16px, 2vw, 22px); }
.contact__text { margin: 0 0 clamp(20px, 3vw, 28px); }
.contact__email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 30px);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
}
.contact__place { margin: clamp(26px, 4vw, 40px) 0 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(18px, 2.4vw, 26px) var(--pad-x);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-ink);
}
.site-footer a { color: var(--footer-ink); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vw, 44px);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.lb-close {
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  color: rgba(251, 250, 248, 0.62);
  font-size: 19px;
}
.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 64px;
  color: rgba(251, 250, 248, 0.5);
  font-size: 20px;
}
.lb-prev { left: 6px; }
.lb-next { right: 6px; }
.lb-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  pointer-events: none;
}
.lb-meta {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(251, 250, 248, 0.6);
  line-height: 1.5;
  max-width: 60%;
}
.lb-counter {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(251, 250, 248, 0.42);
}

/* ---------- mobile: one photograph per row, lightbox edge to edge ---------- */
@media (max-width: 899px) {
  .feed figure { flex: 0 0 100% !important; }
  .about { grid-template-columns: 1fr; }
  .lightbox { padding: 0; }
  .lb-prev, .lb-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
