/* ── Design tokens (ported from Website/index.html) ──
   Fonts: Cormorant Garamond (serif headings) + Inter (body, weight 300)
   Palette: bg #fff, text #333, muted #888, borders #e0e0e0 */

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

body {
  background: #ffffff;
  color: #333333;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Top nav (all pages) ── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem 2.5rem;
  background: #ffffff;
}
.site-nav .nav-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;      /* allow the logo to shrink below its intrinsic width in flex */
  max-width: 100%;
}
.site-nav .nav-logo img {
  width: 421px;      /* renders ~112px tall (logo is 531×141); matches prior size */
  max-width: 100%;   /* never exceed the nav width — scales down on narrow screens */
  height: auto;      /* keep aspect ratio when width is capped */
  display: block;
}
.site-nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
}
.site-nav .nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888888;
  transition: color 0.2s;
}
.site-nav .nav-links a:hover { color: #333333; }
.site-nav .nav-links a.active { color: #333333; }

/* ── Overview mosaic ── */
.mosaic {
  display: flex;
  gap: 1rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
/* Columns are filled left-to-right, top-to-bottom (round-robin in site.js)
   so tiles read in row order while keeping a masonry-style column layout. */
.mosaic-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mosaic-tile {
  position: relative;
  display: block;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 2px;
  background: #ececec;
  cursor: pointer;
}
/* Varied heights (set inline per tile in site.js) read like willakveta's mosaic. */
.mosaic-tile .tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease, opacity 0.3s ease;
}
.mosaic-tile:hover .tile-bg { transform: scale(1.04); opacity: 0.92; }
.mosaic-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Lighter scrim, confined to the top band behind the title/subtitle so the
     rest of the cover shows at full brightness. */
  background: linear-gradient(to bottom, rgba(0,0,0,0.34) 0%, rgba(0,0,0,0.18) 18%, rgba(0,0,0,0) 42%);
}
.mosaic-tile .tile-caption {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  padding: 2rem 2.2rem;
  color: #ffffff;
}
.mosaic-tile .tile-title {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 4rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.mosaic-tile .tile-subtitle {
  display: block;
  margin-top: 0.5rem;
  max-width: 26rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: rgba(255,255,255,0.92);
}

/* ── Category page ── */
.cat-header {
  text-align: center;
  padding: 3rem 2rem 1rem;
}
.cat-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: 0.08em;
  color: #333333;
}
.cat-header .cat-subtitle {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: #888888;
}

.masonry {
  display: flex;
  gap: 0.9rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}
/* Reserve viewport height while the grid is empty (before JS fetches + renders
   the manifest) so the footer starts below the fold and doesn't visibly jump
   down once the tiles appear. Stops applying the moment tiles are inserted. */
.masonry:empty { min-height: 100vh; }
/* Round-robin filled in site.js so photos read left-to-right, top-to-bottom. */
.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.masonry-item {
  margin-bottom: 0.9rem;
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  background: #efedea;   /* neutral placeholder shown while the photo loads */
}
.masonry-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;     /* fills the aspect-ratio box (matches native ratio, no crop) */
  opacity: 0;            /* fade in once loaded to avoid an abrupt pop-in */
  transition: opacity 0.5s ease, transform 0.4s ease;
}
.masonry-item img.loaded { opacity: 1; }
.masonry-item:hover img.loaded { opacity: 0.85; transform: scale(1.02); }

.cat-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #888888;
}
.cat-empty a {
  color: #333333;
  border-bottom: 1px solid #333333;
  padding-bottom: 2px;
  letter-spacing: 0.06em;
}

/* ── About page ── */
.about {
  display: grid;
  grid-template-columns: minmax(300px, 42%) 1fr;
  gap: 3.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4.5rem;
}
.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}
.about-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: #333333;
  margin-bottom: 1.6rem;
}
.about-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: #333333;
  margin: 2rem 0 0.9rem;
}
.about-content p {
  margin-bottom: 1.1rem;
  color: #444444;
  font-size: 0.98rem;
  line-height: 1.75;
}
.about-content p.about-tagline {
  font-style: italic;
  color: #666666;
}
.about-content ul {
  margin: 0 0 1.2rem 1.2rem;
  color: #444444;
  line-height: 1.8;
}
.about-content ul li { margin-bottom: 0.25rem; }

@media (max-width: 768px) {
  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem 3.5rem;
  }
  .about-photo img { max-width: 420px; margin: 0 auto; }
}

/* ── Lightbox (ported from Website/index.html) ── */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* Dynamic viewport height so the overlay tracks the mobile browser toolbar
     and the centered image + controls stay fully on-screen (vh fallback first). */
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  max-height: 90dvh;
  object-fit: contain;
  border-radius: 2px;
}
/* Shared control styling: circular tap target with a translucent backing so the
   button stays visible over bright photos, and offsets that respect the safe area. */
.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  opacity: 0.85;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover,
.lightbox-nav:hover { opacity: 1; }
.lightbox-close {
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  font-size: 2rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
}
.lightbox-prev { left: max(0.75rem, env(safe-area-inset-left)); }
.lightbox-next { right: max(0.75rem, env(safe-area-inset-right)); }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid #e0e0e0;
  color: #aaaaaa;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

/* ── Responsive ── */
/* Column counts are chosen in site.js (mosaic: 2→1; masonry: 3→2→1),
   matching these breakpoints. */
@media (max-width: 768px) {
  .mosaic-tile { aspect-ratio: 3 / 4 !important; }
  .site-nav { padding: 1.2rem 1.5rem; }
}
