/* Faithful reconstruction of the original andreadionisio.la look:
   white room, centered wordmark, uppercase letterspaced nav (active in
   salmon), stacked galleries, quiet gray footer. Type is the system
   grotesque the Squarespace template used in effect. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #fff;
  color: #444;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-align: center;
}

a { color: inherit; }

/* ---- header ---- */
.site-header { padding: 56px 20px 8px; }
.logo img {
  width: min(440px, 82vw);
  height: auto;
  display: inline-block;
}
.site-header nav {
  margin-top: 26px;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 14px 44px;
}
.site-header nav a {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: #8a8a8a;
  transition: color 0.15s ease;
}
.site-header nav a:hover { color: #444; }
.site-header nav a.active { color: #f08575; }

/* ---- galleries: justified rows (the original Squarespace behavior) ----
   Each row's items share one height: flex-grow ∝ aspect ratio makes widths
   distribute so width/ar is equal across the row, at any viewport size. */
.gallery {
  max-width: 1500px;
  margin: 44px auto 0;
  padding: 0 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.g-row {
  display: flex; gap: 12px; align-items: stretch;
}
.g-item {
  flex: var(--g) 1 0%;
  min-width: 0;
  aspect-ratio: var(--ar);
  margin: 0;
}
.g-spacer { flex: var(--g) 1 0%; }
.g-item { overflow: hidden; }
.g-link { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.g-item picture, .g-item img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

/* ---- hover: the print comes forward, the room recedes ----
   Neighbors ease back; the print under the cursor breathes in. */
.g-item { transition: opacity 0.45s ease; }
.g-item img { transition: transform 0.7s cubic-bezier(0.62, 0.05, 0.18, 1); }
.gallery:has(.g-link:hover) .g-item:not(:has(.g-link:hover)) { opacity: 0.55; }
.g-link:hover img { transform: scale(1.02); }

/* ---- lightbox: the white room ---- */
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; cursor: zoom-out; }
.lb-veil {
  position: absolute; inset: 0; background: #fff;
  opacity: 0; transition: opacity 0.42s ease;
}
.lb.is-on .lb-veil { opacity: 0.985; }
.lb-img {
  position: absolute; z-index: 2;
  object-fit: contain;
  will-change: transform, opacity;
}
.lb-close, .lb-nav {
  position: absolute; z-index: 3;
  background: none; border: 0; cursor: pointer;
  color: #b9b9b9; font-family: inherit;
  opacity: 0; transition: opacity 0.42s ease 0.25s, color 0.2s ease;
  padding: 12px 18px; line-height: 1;
}
.lb.is-on .lb-close, .lb.is-on .lb-nav { opacity: 1; }
.lb-close { top: 14px; right: 16px; font-size: 30px; font-weight: 300; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 44px; font-weight: 200; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-close:hover, .lb-nav:hover { color: #444; }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 1px solid #f08575; outline-offset: 2px; color: #444; }
.lb-cap {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 16px;
  text-align: center; font-size: 11px; letter-spacing: 0.22em; color: #9a9a9a;
  opacity: 0; transition: opacity 0.42s ease 0.25s;
  pointer-events: none;
}
.lb.is-on .lb-cap { opacity: 1; }

@media (max-width: 640px) {
  .lb-nav { display: none; } /* tap-through on mobile; swipe comes later if wanted */
}

@media (prefers-reduced-motion: reduce) {
  .g-item, .g-item img, .lb-veil, .lb-close, .lb-nav, .lb-cap { transition-duration: 0.15s; }
  .g-link:hover img { transform: none; }
  .lb-img { transition: opacity 0.15s ease; }
  .lb:not(.is-on) .lb-img { opacity: 0; }
}

@media (max-width: 640px) {
  .g-row { display: block; }
  .g-item { margin-bottom: 12px; aspect-ratio: auto; }
  .g-item img { height: auto; }
  .g-spacer { display: none; }
}

/* ---- text pages ---- */
.prose {
  max-width: 640px;
  margin: 72px auto 0;
  padding: 0 24px;
}
.prose h1, .prose h2 {
  font-size: 15px;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: #3d3d3d;
  margin: 48px 0 22px;
}
.prose h1 { margin-top: 0; }
.prose p { margin-bottom: 18px; color: #555; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose .portrait { margin: 0 0 30px; }
.prose .portrait img { width: min(280px, 70vw); height: auto; display: inline-block; }

/* ---- footer ---- */
.site-footer {
  margin: 90px 0 46px;
  font-size: 12px;
  color: #9a9a9a;
}
.site-footer .social { margin-bottom: 10px; letter-spacing: 0.06em; }
.site-footer .social a { text-decoration: none; }
.site-footer .social a:hover { color: #444; }

@media (max-width: 640px) {
  .site-header { padding-top: 40px; }
  .site-header nav { gap: 12px 22px; }
  .gallery { gap: 18px; margin-top: 30px; }
}
