/* v3: unified vertical rhythm (spacing) system, balanced hero heading,
   grid centering when there are few collections/photos, expanded footer, #about tweaks. */
:root {
  --bg: #edeceb;
  --paper: rgba(250, 250, 249, 0.92);
  --paper-solid: #f8f8f7;
  --ink: #252422;
  --muted: #63625f;
  --line: rgba(57, 55, 51, 0.18);
  --brand: #423f39;
  --brand-2: #57524a;
  --accent: #878175;
  --green: #354f35;
  --shadow: 0 22px 60px rgba(38, 36, 32, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;

  /* Vertical rhythm scale - used between sections, headings, and blocks. */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 88px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(135, 129, 117, .23), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(53, 79, 53, .16), transparent 26%),
    linear-gradient(135deg, #e2e0dc 0%, #f0efee 42%, #dbd9d5 100%);
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(rgba(54, 51, 47, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 51, 47, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mix-blend-mode: multiply;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* So that jumping to the #about section doesn't leave its heading hidden behind the sticky header. */
#about { scroll-margin-top: var(--site-header-height, 116px); }

.btn, .style-pill {
  border: 1px solid rgba(66, 63, 57, .20);
  background: rgba(248, 248, 247, .70);
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover, .style-pill:hover {
  transform: translateY(-1px);
  background: #f8f8f7;
  border-color: rgba(66, 63, 57, .34);
}
.btn--primary {
  background: var(--brand);
  color: #f6f5f3;
  border-color: var(--brand);
}
.btn--primary:hover { background: #4e4942; }
.btn--ghost { background: rgba(255,255,255,.34); }

.hero {
  /* Upper bound capped so the hero doesn't grow too tall on tall screens
     and leave an uneven empty gap before the next block. */
  min-height: clamp(560px, calc(100vh - var(--site-header-height, 156px)), 820px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: 42px;
  padding: var(--space-6) 0;
}
.hero__copy {
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 700;
}
.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1 {
  /* Gentler vw-growth and max-width so the heading doesn't narrow down to one word
     per line on wide screens (the hero text column is only ~half the site width). */
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.06;
  letter-spacing: -.03em;
  max-width: 640px;
  margin-bottom: var(--space-3);
}
.lead {
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.5;
  color: #3b3936;
  max-width: 720px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-3); }
.hero__panel {
  background: var(--paper);
  border: 1px solid rgba(66, 63, 57, .16);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
  transform: rotate(1.1deg);
}
.photo-stack {
  min-height: 520px;
  position: relative;
  display: grid;
  place-items: center;
}
.vintage-card {
  --card-frame: 18px; /* white frame around the photo window (top/sides) */
  width: min(440px, 92%);
  background: #f8f8f7;
  border-radius: 8px;
  padding: var(--card-frame) var(--card-frame) 62px;
  box-shadow: 0 18px 45px rgba(23, 21, 19, .22);
  border: 1px solid rgba(66, 63, 57, .18);
}
.vintage-card::before {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background:
    linear-gradient(rgba(48, 46, 42, .15), rgba(48, 46, 42, .15)),
    radial-gradient(circle at 42% 35%, rgba(255,255,255,.58), transparent 9%),
    linear-gradient(155deg, #494743, #b8b6b2 44%, #2b3029 100%);
  filter: sepia(.45) contrast(.94) saturate(.8);
}
/* Random gallery photo. Sits exactly on top of the ::before photo window
   (the inset matches the frame size + 4/3 ratio), object-position:top left aligns
   the top-left corner, and object-fit:cover scales up diagonally until it
   fills the window - one edge lines up, the other gets cropped, no empty space is left.
   Until the photo loads (or if it fails) the decorative ::before stays visible. */
.vintage-card__photo {
  position: absolute;
  top: var(--card-frame);
  left: var(--card-frame);
  /* Width is set explicitly (rather than via left+right bounds), because with both a left
     and a right bound PLUS aspect-ratio, some browsers ignore the right bound on the
     <img> element and let it overflow past the frame. aspect-ratio then
     computes the height from this width. */
  width: calc(100% - 2 * var(--card-frame));
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  object-position: top left;
  filter: sepia(.25) contrast(.96);
}
.vintage-card--back {
  position: absolute;
  transform: translate(-38px, 16px) rotate(-6deg);
  opacity: .68;
}
.vintage-card--front { position: relative; transform: rotate(3deg); }
.hero-note {
  position: absolute;
  right: 10px;
  bottom: 22px;
  width: min(300px, 70%);
  background: #e7e5e2;
  border: 1px solid rgba(66, 63, 57, .16);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(23, 21, 19, .16);
  transform: rotate(-2.3deg);
}
.hero-note strong { display: block; margin-bottom: 6px; }

.section { padding: var(--space-6) 0; }
.section__head {
  max-width: 760px;
  margin-bottom: var(--space-4);
}
.section h2 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: 14px;
}
.section__head p { color: var(--muted); font-size: 18px; line-height: 1.6; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-card, .gallery-card, .content-card {
  background: var(--paper);
  border: 1px solid rgba(66, 63, 57, .14);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 44px rgba(38, 36, 32, .10);
}
.feature-card {
  padding: 24px;
  min-height: 210px;
}
.feature-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dddbd7;
  color: var(--brand);
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 23px; margin-bottom: 10px; }
.feature-card p { color: var(--muted); line-height: 1.55; }

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.searchbox {
  flex: 1;
  min-width: 220px;
  border: 1px solid rgba(66, 63, 57, .18);
  background: rgba(248, 248, 247, .76);
  border-radius: 999px;
  padding: 13px 16px;
  outline: none;
}
.gallery-grid {
  display: grid;
  /* auto-fit: the column count adapts to the width on its own (3 → 2 → 1),
     so separate fixed media-query breakpoints aren't needed. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 18px;
  justify-content: center;
}
/* When there's only one or two collections, they aren't left-aligned with empty space on the
   right - instead they get a more proportional, capped width and are centered. */
.gallery-grid:has(> :only-child) {
  grid-template-columns: minmax(min(100%, 340px), 480px);
}
.gallery-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 420px));
}
.gallery-card { overflow: hidden; }
.gallery-card__cover {
  height: 210px;
  background:
    linear-gradient(rgba(37, 36, 34, .08), rgba(37, 36, 34, .22)),
    radial-gradient(circle at 40% 28%, rgba(255,255,255,.6), transparent 12%),
    linear-gradient(135deg, #6a6761, #c0beba 48%, #3e4b3d 100%);
  position: relative;
}
.gallery-card__cover img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.18) contrast(.96); }
.gallery-card__badge {
  position: absolute;
  left: 14px;
  top: 14px;
  background: rgba(248, 248, 247, .88);
  border: 1px solid rgba(66, 63, 57, .16);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--brand);
}
.gallery-card__body { padding: 20px; }
.gallery-card h3 { font-size: 25px; line-height: 1.16; margin-bottom: 8px; }
.gallery-card p { color: var(--muted); line-height: 1.55; min-height: 48px; }
.gallery-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; color: var(--muted); font-size: 14px; }
.gallery-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.viewer-page { padding: 34px 0 80px; }
.viewer-header {
  background: var(--paper);
  border: 1px solid rgba(66, 63, 57, .14);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 28px 0 22px;
}
.viewer-header__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.viewer-title { font-size: clamp(32px, 4vw, 58px); line-height: 1.02; letter-spacing: -.04em; margin-bottom: 8px; }
.viewer-description { max-width: 780px; color: var(--muted); line-height: 1.6; font-size: 18px; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  justify-content: center;
}
.photo-grid:has(> :only-child) {
  grid-template-columns: minmax(min(100%, 300px), 480px);
}
.photo-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 420px));
}
.photo-card {
  background: var(--paper-solid);
  border: 1px solid rgba(66, 63, 57, .14);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 12px 34px rgba(38, 36, 32, .10);
}
/* .photo-frame is a fixed 4:3-ratio box, the SAME color as the card (no
   black border). The <img> inside it is NOT forced to stretch across the whole box
   (no object-fit:contain with unsightly "extra" space) - its width/height is
   capped only by the image's natural ratio (max-width/max-height + auto),
   so the <img> element's box EXACTLY matches the visible photo, and the border-radius
   on it rounds the corners of the photo itself, not the corners of an empty outer box. */
.photo-frame {
  position: relative; /* needed so the absolutely-positioned <img> inside has a defined container */
  aspect-ratio: 4 / 3;
  background: var(--paper-solid);
  border-radius: 12px;
  overflow: hidden;
}
/* <img> is positioned ABSOLUTELY within the frame (inset:0), so its container has a
   DEFINED height (from .photo-frame's aspect-ratio). Only this way does max-height:100%
   work reliably in Safari (iPhone) too - previously, for a flex-child img with max-height:100%,
   Safari didn't apply that percentage against the aspect-ratio container, so a portrait photo
   would fill the whole width and overflow:hidden would crop the heads off. margin:auto centers it.
   width/height:auto + max-width/height:100% = the photo fits at its natural ratio,
   with nothing cropped (no object-fit:cover). */
.photo-frame img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  cursor: zoom-in;
}
/* Portrait-orientation photos are aligned to the left (not centered) - the orientation
   is determined by gallery_view.js from the actual loaded photo's ratio. With absolute
   positioning, left-aligned = right:auto + margin-left:0 (it stays vertically centered). */
.photo-frame[data-orientation="portrait"] img {
  right: auto;
  margin-left: 0;
}
.photo-caption { padding: 12px 4px 4px; }
.photo-caption strong { display: block; font-size: 18px; margin-bottom: 4px; }
.photo-caption span { color: var(--muted); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 17, 16, .88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.lightbox.is-open { display: flex; }
.lightbox__panel {
  /* The panel should use almost the entire screen - the right-hand comments
     rail gets only the width it needs (300px), everything else goes to the photo. */
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}
/* display:contents lets .lightbox__stage/.lightbox__comments become direct
   .lightbox__panel grid items on desktop, but below the mobile breakpoint
   .lightbox__scroll becomes a real single-column scrolling container. */
.lightbox__scroll { display: contents; }
.lightbox__stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  height: 100%;
}
.lightbox__zoom-wrap {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 14px;
  background: #121211;
  touch-action: none;
}
/* When zoomed in, zoomWrap becomes a fullscreen element (see gallery_view.js) - then it
   fills the whole screen itself, with no rounded corners, no comments rail or anything else. */
.lightbox__zoom-wrap:fullscreen,
.lightbox__zoom-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}
.lightbox__zoom-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox__zoom-wrap.is-zoomed img { cursor: grab; }
.lightbox__zoom-wrap.is-dragging img { cursor: grabbing; }

/* Face-box layer - its size/position is set by JS to exactly match the visible
   photo's rectangle (see gallery_view.js positionFaceLayer()), and when zoomed/
   panned it gets the SAME CSS transform as the <img>, so it stays in sync. */
.lightbox__face-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}
.face-box {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: border-color .1s ease, border-style .1s ease, background-color .1s ease;
}
.face-box:hover { border-color: #2ecc40; border-style: solid; background: rgba(46, 204, 64, .12); }
.face-box.is-marked { border-color: #2ecc40; border-style: solid; background: rgba(46, 204, 64, .18); }
.lightbox__caption {
  color: #f6f5f3;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 14px 16px;
}
.lightbox__close {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  background: rgba(0,0,0,.4);
  cursor: pointer;
  font-size: 24px;
  z-index: 3;
}

.lightbox__comments {
  background: var(--paper-solid);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.comments__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(66, 63, 57, .14);
}
.comments__head h3 { font-size: 18px; margin: 0; }
.comments__count { color: var(--muted); font-size: 13px; }
.comments__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-card {
  background: #fff;
  border: 1px solid rgba(66, 63, 57, .12);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(38, 36, 32, .08);
}
.comment-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.comment-card__name { font-weight: 700; color: var(--ink); }
.comment-card p { margin: 0; line-height: 1.5; font-size: 14px; white-space: pre-wrap; }
.comments__form {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(66, 63, 57, .14);
}
.comments__form input, .comments__form textarea {
  border: 1px solid rgba(66, 63, 57, .2);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  resize: vertical;
}
.comments__form button { justify-self: start; }
.comments__status { font-size: 13px; color: var(--muted); min-height: 16px; }
.comments__status.is-error { color: #a33326; }
.comments__status.is-ok { color: var(--green); }

.state {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(248, 248, 247, .78);
  border: 1px solid rgba(66, 63, 57, .14);
  color: var(--muted);
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-5) 0 var(--space-6);
  color: var(--muted);
}
.site-footer__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-4);
}
.site-footer__col h4 {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink);
}
.site-footer__brand strong {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: var(--space-1);
}
.site-footer__brand p { margin: 0; line-height: 1.55; max-width: 32ch; }
.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.site-footer__col a { text-decoration: none; }
.site-footer__col a:hover { text-decoration: underline; }
.site-footer__bottom {
  /* Three equal columns: left part left-aligned, center part centered, right part
     right-aligned. Below --footer-bottom-stack (a third of this row's own design
     width, 1180px / 3 ≈ 393px) there isn't room for three side-by-side columns, so
     it switches to a single left-aligned stack instead (see media query below). */
  width: min(1180px, calc(100% - 32px));
  margin: var(--space-4) auto 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.site-footer__bottom-left {
  justify-self: start;
  text-align: left;
}
.site-footer__bottom-center {
  justify-self: center;
  text-align: center;
}
.site-footer__bottom-right {
  justify-self: end;
  text-align: right;
}
.site-footer__sitemap { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.site-footer__sitemap a { text-decoration: none; }
.site-footer__sitemap a:hover { text-decoration: underline; }

.site-footer__partner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  opacity: .88;
  transition: opacity .16s ease, transform .16s ease;
}
.site-footer__partner img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}
.site-footer__partner:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.site-footer__partner:hover span {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 42px; }
  .photo-stack { min-height: 410px; }
  /* .gallery-grid / .photo-grid aren't redefined here - they're already responsive via auto-fit above. */
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .viewer-header__top { display: grid; }

  /* For narrow screens - the comments rail moves below the photo, but the photo
     (.lightbox__stage) stays sticky at the top of the scrolling .lightbox__scroll,
     so that scrolling the comments never makes the photo disappear from view. */
  .lightbox { padding: 10px; }
  .lightbox__panel { display: block; width: 100%; height: 94vh; max-height: 94vh; }
  .lightbox__scroll {
    display: block;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
  }
  .lightbox__stage {
    position: sticky;
    top: 0;
    z-index: 2;
    display: block;
    height: auto;
    background: rgba(18, 18, 17, .98);
    padding-bottom: 10px;
  }
  .lightbox__zoom-wrap { height: 46vh; }
  .lightbox__caption { margin-top: 10px; border-radius: 0 0 14px 14px; }
  .lightbox__comments {
    height: auto;
    max-height: none;
    border-radius: 0 0 18px 18px;
    box-shadow: none;
  }
  .comments__list { overflow-y: visible; max-height: none; }
}
@media (max-width: 640px) {
  .btn, .style-pill { padding: 9px 11px; font-size: 14px; }
  .hero { min-height: auto; }
  .hero h1 { font-size: 36px; max-width: 100%; }
  .lead { font-size: 18px; }
  .feature-grid { grid-template-columns: 1fr; }
  .gallery-toolbar { display: grid; }
  .viewer-header { padding: 20px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: var(--space-3); }
  .lightbox__zoom-wrap { height: 40vh; }
}
@media (max-width: 393px) {
  /* 1180px (.site-footer__bottom's own design width) / 3 ≈ 393px: below this, each of
     the three columns would be narrower than it was ever designed for, so stack them
     instead, all left-aligned. */
  .site-footer__bottom {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .site-footer__bottom-left,
  .site-footer__bottom-center,
  .site-footer__bottom-right {
    justify-self: start;
    text-align: left;
  }
  .site-footer__sitemap { justify-content: flex-start; }
}
