/* =========================================================
   garrett michaud — photographs
   Same look as the main page: white, Helvetica, one big
   see-through name. The only color on the page is the green
   of the name; everything else is the photos themselves.
   ========================================================= */

:root {
  --green: rgba(0, 150, 45, 0.62);   /* the see-through green of the name (the main page uses blue) */
  --green-solid: #00802b;            /* for small text + links, so it stays readable */
  --ink: #111;
  --sans: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;

  --edge: 8.4vw;                     /* left/right margin: lines up with the name on the main page */
  --gap: clamp(0.6rem, 1.4vw, 1.25rem);   /* space between photos */
}
@media (max-width: 760px) { :root { --edge: 5vw; } }

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

html { background: #fff; color-scheme: light; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--green-solid); color: #fff; }

/* =========================================================
   THE NAME (also the link back to the main page)
   ========================================================= */
.masthead { padding: clamp(1rem, 3vw, 2.5rem) var(--edge) 0; }

.name {
  margin: 0;
  font-weight: 400;
  font-size: 15.7vw;                 /* same size as on the main page */
  line-height: 1;
  letter-spacing: -0.113em;          /* the squeezed-together look */
  white-space: nowrap;
  color: var(--green);
}
.name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}
.name a:hover,
.name a:focus-visible { color: rgba(0, 150, 45, 0.95); }
.name a:focus-visible { outline: 2px solid var(--green-solid); outline-offset: 6px; }

/* =========================================================
   PHOTO GRID  (columns = masonry layout: handles tall + wide photos)
   ========================================================= */
.gallery {
  padding: clamp(1.5rem, 3.5vw, 3rem) var(--edge) var(--edge);
  columns: 2;
  column-gap: var(--gap);
}
@media (min-width: 760px)  { .gallery { columns: 3; } }
@media (min-width: 1700px) { .gallery { columns: 4; } }

.frame {
  margin: 0 0 var(--gap);
  break-inside: avoid;
  background: #f2f2f2;               /* a pale placeholder for the split second a photo loads */
}
.frame button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: zoom-in;
}
.frame img { display: block; width: 100%; height: auto; }
.frame button:focus-visible { outline: 2px solid var(--green-solid); outline-offset: 3px; }

/* photos fade up as they scroll into view (only when JavaScript is on) */
.js .frame {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .frame.in { opacity: 1; transform: none; }

/* =========================================================
   FOOTER: just two quiet links
   ========================================================= */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--edge) 2.5rem;
}
.foot a {
  display: inline-block;
  padding: 10px 6px;               /* tap area 44px+ for thumbs... */
  margin: -10px -6px;              /* ...without moving the text */
  color: var(--green-solid);
  text-decoration: none;
}
.foot a:hover,
.foot a:focus-visible { text-decoration: underline; text-underline-offset: 0.25em; outline: none; }

/* =========================================================
   FULL-SCREEN VIEWER (opens when you click a photo)
   ========================================================= */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--ink);
  place-items: center;
}
.viewer[open] { display: grid; }
.viewer::backdrop { background: #fff; }

.viewer-img {
  max-width: 92vw;
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s;
}
.viewer-img.ready { opacity: 1; }

.viewer button {
  position: absolute;
  padding: 1rem;
  border: 0;
  background: none;
  color: var(--green-solid);
  font: inherit;
  cursor: pointer;
}
.viewer button:hover,
.viewer button:focus-visible { color: var(--ink); }
.viewer .viewer-close { top: 0.5rem; right: 0.5rem; }
.viewer .viewer-prev,
.viewer .viewer-next {
  top: 50%;
  transform: translateY(-50%);
  padding: 1.5rem 1rem;
  font-size: 2.2rem;
  line-height: 1;
}
.viewer .viewer-prev { left: 0.25rem; }
.viewer .viewer-next { right: 0.25rem; }

/* "3 / 30" is not shown, but screen readers still announce it */
.viewer-count {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
body.locked { overflow: hidden; }    /* stops the page scrolling behind the viewer */

/* Respect people who ask their device for less motion */
@media (prefers-reduced-motion: reduce) {
  .js .frame { opacity: 1; transform: none; transition: none; }
  .name a { transition: none; }
}
