/* =========================================================
   PeterBjoerk.com — site styles
   Fonts: League Gothic (headings/nav), Nunito (body text).
   ========================================================= */

:root {
  --black: #000;
  --white: #fff;
  --grey: #6b6b6b;
  --gutter: 3vw;          /* page side margin */
  --gap: 2.2vw;           /* space between photos */
  --max: 1500px;          /* max content width */
  --heading: "League Gothic", "Oswald", Impact, sans-serif;
  --body: "Nunito", "Omnes", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: .01em;
}
h1, h2 { font-size: clamp(34px, 3.6vw, 52px); }
h3 { font-size: clamp(24px, 2.4vw, 34px); }
h4 { font-size: clamp(20px, 1.8vw, 26px); }

.center { text-align: center; }
/* Main page headings (h1) that should look like smaller headings */
h1.as-h3 { font-size: clamp(24px, 2.4vw, 34px); }
h1.as-h4 { font-size: clamp(20px, 1.8vw, 26px); }
/* Read by Google and screen readers, but not shown on screen */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--gutter);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
}
.logo img { height: 76px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-family: var(--heading);
  text-transform: uppercase;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: .04em;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

.social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--black); color: var(--white);
}
.social svg { width: 18px; height: 18px; }
.site-nav .social { margin-left: 18px; }

.menu-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
}
.menu-toggle span { display: block; width: 26px; height: 2px; background: var(--black); margin: 6px 0; }

@media (max-width: 767px) {
  .logo img { height: 56px; }
  .menu-toggle { display: block; position: relative; z-index: 30; }
  .site-nav {
    position: fixed; inset: 0; z-index: 20;
    background: var(--white);
    flex-direction: column; justify-content: center; gap: 22px;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .site-nav a { font-size: 34px; }
  .site-nav .social { margin: 10px 0 0; }
  body.menu-open .site-nav { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Main content ---------- */
main {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter) 60px;
}
.narrow { max-width: 700px; margin-left: auto; margin-right: auto; }
.text-block { margin: 60px auto; }
.text-block p { margin: 0 0 1em; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 40px 0 60px; }

/* ---------- Homepage masonry gallery ---------- */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry-col { flex: 1; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.masonry img { width: 100%; cursor: zoom-in; }
/* Before JS arranges the columns (or if JS is off) show a simple 3-column layout */
.masonry:not(.ready) { display: block; columns: 3; column-gap: var(--gap); }
.masonry:not(.ready) img { margin-bottom: var(--gap); break-inside: avoid; }
@media (max-width: 767px) { .masonry:not(.ready) { columns: 1; } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: var(--white);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer;
  font-size: 34px; line-height: 1; padding: 16px; color: var(--black);
}
.lightbox .lb-close { top: 10px; right: 14px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 767px) {
  /* Phones: arrows below the photo instead of on top of it (swiping also works) */
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 18px; transform: none; font-size: 40px; }
  .lightbox .lb-prev { left: 22%; }
  .lightbox .lb-next { right: 22%; }
  .lightbox img { max-height: 78vh; }
}

/* ---------- Projects index ---------- */
.project-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px var(--gap);
}
.project-grid a { text-decoration: none; display: block; }
.project-grid img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: opacity .2s; }
.project-grid a:hover img { opacity: .85; }
.project-grid .project-title { font-size: 18px; margin-top: 14px; }
@media (max-width: 767px) { .project-grid { grid-template-columns: 1fr; } }

/* ---------- Slideshow (Sacred Geometry, Auto-Biographies) ---------- */
.slideshow { position: relative; margin: 30px auto; }
.slides { position: relative; height: 72vh; }
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity .5s;
}
.slides img.active { opacity: 1; }
.slideshow .prev, .slideshow .next {
  position: absolute; top: 36vh; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 30px; padding: 10px; z-index: 2;
}
.slideshow .prev { left: -10px; }
.slideshow .next { right: -10px; }
.thumbs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.thumbs img { width: 70px; height: 56px; object-fit: cover; cursor: pointer; opacity: .55; }
.thumbs img.active, .thumbs img:hover { opacity: 1; }
@media (max-width: 767px) {
  /* Phones: the slide area fits each photo's shape (set in site.js); arrows sit below the photo */
  .slideshow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin: 20px 0; }
  .slides { order: 1; width: 100%; height: 60vh; transition: height .3s; }
  .slideshow .prev, .slideshow .next { order: 2; position: static; transform: none; font-size: 34px; padding: 6px 14px; }
  .thumbs { order: 3; width: 100%; }
  .thumbs img { width: 48px; height: 40px; }
}

/* ---------- Photo story (On The Waterfront) ---------- */
.story figure { margin: 0 0 70px; }
.story figure.bleed { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
.story figcaption { font-size: 13px; margin-top: 8px; color: var(--black); }
.story figure.bleed figcaption { padding-left: var(--gutter); }
.story .pair { display: flex; gap: var(--gap); margin-bottom: 70px; }
.story .pair figure { flex: 1; margin: 0; }
.story .pair img { width: 100%; }
.story .text-block { max-width: 660px; text-align: center; }
@media (max-width: 767px) { .story .pair { flex-direction: column; } }

/* ---------- Two-column photo grid (5 Kilometres) ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-2 img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; cursor: zoom-in; }
@media (max-width: 767px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Video page ---------- */
.video-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center;
  margin: 40px 0 80px;
}
.video-row.reverse .video-text { order: 2; }
.video-embed { position: relative; aspect-ratio: 16 / 9; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 767px) {
  .video-row { grid-template-columns: 1fr; gap: 20px; }
  .video-row.reverse .video-text { order: 0; }
}

/* ---------- About page ---------- */
.about-portrait { width: 300px; margin: 20px auto 50px; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; }
@media (max-width: 767px) { .about-cols { grid-template-columns: 1fr; } }

/* ---------- Contact (email button) ---------- */
.contact-email { text-align: center; margin: 50px auto 0; max-width: 560px; }
.button, .copy-email {
  display: inline-block; font: inherit; cursor: pointer; text-decoration: none;
  background: var(--white); color: var(--black); border: 2px solid var(--black);
}
.button { font-family: var(--heading); text-transform: uppercase; letter-spacing: .05em; font-size: 22px; padding: 14px 44px; }
.button:hover, .copy-email:hover { background: var(--black); color: var(--white); }
.email-address { margin: 28px 0 8px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.copy-email { font-size: 12px; padding: 8px 14px; border-width: 1px; }
.email-note { color: var(--grey); }

/* ---------- Phone readability ---------- */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .button { display: block; }
  .copy-email { padding: 10px 16px; }
  /* Bigger tap areas for stacked links */
  .about-cols a { display: inline-block; padding: 6px 0; }
}
