/* ============================================================
   Fotograf Peter Westrup — Shared Stylesheet v2
   Palette: --bg #f0f0f0  --ink #181818  --mid #888  --green #5c7c38
   Fonts: Playfair Display (nav, captions, headings) + Montserrat (body)
   ============================================================ */

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

:root {
  --bg:     #f0f0f0;
  --ink:    #181818;
  --mid:    #444444;
  --green:  #5c7c38;   /* active nav colour — edit this to adjust */
  --font-display: 'Cormorant Garamond', serif;
  --border: rgba(24,24,24,0.08);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  letter-spacing: 0.02em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ─────────────────────────────────────────────── */
/* Matches archive.peterwestrup.se exactly: 28px top, 32px sides */
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 0;
}

.site-logo { display: block; flex-shrink: 0; }
.site-logo img {
  height: 120px;       /* same as archive page */
  width: auto;
  display: block;
  opacity: 0.85;       /* same as archive page */
  transition: opacity 0.2s;
}
.site-logo:hover img { opacity: 1; }

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-top: 6px;    /* matches archive .header-right padding-top */
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

nav a:hover           { color: var(--ink); }
nav a[aria-current]   { color: var(--green); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
}

@media (max-width: 740px) {
  header { padding: 18px 20px 0; flex-wrap: wrap; }
  .site-logo img { height: 72px; }
  .nav-toggle { display: flex; }
  nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 16px 0 8px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
  }
  nav.is-open { display: flex; }
  nav a { padding: 10px 0; font-size: 1rem; }
}

/* ── MAIN ────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 32px 32px 100px;  /* side padding matches header */
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 740px) { main { padding: 24px 20px 64px; } }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  padding: 24px 36px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--mid);
  text-align: center;
}
footer a { color: var(--mid); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--ink); }

/* ── PAGE TITLE ──────────────────────────────────────────── */
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 36px;
  letter-spacing: 0.01em;
}

/* ============================================================
   MASONRY GRID (commissions cover, landscapes, observations)
   ============================================================ */
.masonry {
  columns: 3 260px;
  column-gap: 56px;
  margin-top: 44px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 72px;   /* generous vertical space between items */
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s;
  background: #d8d8d8;
}
.masonry-item:hover img { opacity: 0.82; }

/* Caption below each grid item — Playfair Display */
.masonry-caption {
  margin-top: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.masonry-caption .caption-client {
  display: inline;
  font-size: inherit;
  color: inherit;
  font-style: normal;
}

/* ============================================================
   COMMISSION DETAIL VIEW
   (the grid of images within one commission)
   ============================================================ */
.detail-view { display: none; }
.detail-view.is-visible { display: block; }

.detail-header {
  display: flex;
  align-items: baseline;
  gap: 28px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  color: var(--mid);
  padding: 0;
  transition: color 0.15s;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-back:hover { color: var(--ink); }
.btn-back::before { content: '←'; font-style: normal; }

.detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.detail-client-name {
  display: none;
}

/* Detail image grid: same height, natural width (no crop) */
.detail-grid {
  display: flex;
  flex-wrap: wrap;
  column-gap: 56px;
  row-gap: 72px;
  margin-top: 28px;
}

.detail-item {
  flex: 0 0 auto;
  cursor: pointer;
}

.detail-item img {
  display: block;
  height: 360px;
  width: auto;
  transition: opacity 0.25s;
  background: #d8d8d8;
}
.detail-item:hover img { opacity: 0.82; }

/* ============================================================
   LIGHTBOX — light background
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open { display: flex; }

.lb-img {
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.35s;
}
.lb-img.loaded { opacity: 1; }

.lb-caption-text {
  margin-top: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--mid);
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

/* Nav buttons */
.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(24,24,24,0.3);
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  padding: 20px 28px;
  transition: color 0.15s;
  line-height: 1;
  z-index: 1001;
}
.lb-btn:hover { color: var(--ink); }
.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-close {
  position: fixed;
  top: 22px;
  right: 28px;
  background: none;
  border: none;
  color: rgba(24,24,24,0.3);
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 300;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.15s;
  z-index: 1001;
}
.lb-close:hover { color: var(--ink); }

.lb-counter {
  position: fixed;
  bottom: 22px;
  right: 28px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  color: var(--mid);
  letter-spacing: 0.1em;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 72px;
  align-items: start;
  max-width: 900px;
  margin-top: 44px;
  margin-left: 80px;
}

.about-body {
  max-width: 480px;
}

.about-photo img {
  display: block;
  width: 280px;
  height: auto;
}

@media (max-width: 700px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .about-photo { order: -1; }
  .about-photo img { width: 100%; max-width: 320px; }
}
.about-body h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}
.about-body p {
  font-size: 0.88rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  color: var(--ink);
}
.about-body p:last-child { margin-bottom: 0; }
.about-contact-link {
  display: inline-block;
  margin-top: 36px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(24,24,24,0.3);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.about-contact-link:hover { border-color: var(--ink); }
