/* A Minute with a Stranger – minimalist stylesheet */

/* Self-hosted IBM Plex Sans (variable, latin subset) — no third-party font CDN */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSansVar-Roman.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSansVar-Italic.woff2") format("woff2");
  font-weight: 100 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #161618;        /* very dark gray, a touch above black */
  --fg: #ededed;        /* neutral near-white */
  --muted: #969696;     /* subdued gray for secondary text */
  --line: #262628;      /* subtle divider lines */
  --accent: #ffffff;    /* white accents/hover */
  --tile-bg: #1d1d1f;   /* placeholder area behind images */
  --maxw: 1180px;
  --gap: 1.1rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header / navigation ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.4rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand__mark {
  color: var(--muted);
  margin-right: 0.55rem;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand__mark { color: var(--fg); }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover, .site-nav a.is-active { color: var(--fg); text-decoration: none; }

/* gallery dropdown */
.nav-drop { position: relative; }
.nav-drop summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  user-select: none;
}
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.45rem;
  width: 0.32em;
  height: 0.32em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-0.18em);
  transition: transform 0.18s ease;
}
.nav-drop[open] summary::after {
  transform: rotate(-135deg) translateY(-0.05em);
}
.nav-drop summary:hover, .nav-drop summary.is-active, .nav-drop[open] summary { color: var(--fg); }
.nav-drop__menu {
  position: absolute;
  left: -1rem;
  top: calc(100% + 0.7rem);
  min-width: 10rem;
  background: var(--tile-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0;
  z-index: 50;
  animation: nav-drop-in 0.15s ease;
}
@keyframes nav-drop-in {
  from { opacity: 0; transform: translateY(-4px); }
}
.nav-drop__menu a {
  display: block;
  padding: 0.45rem 1rem;
}
.nav-drop__menu a:hover { text-decoration: none; }

/* ---------- Main area ---------- */
.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem 1.4rem 3rem;
}

/* ---------- Home page ---------- */
.intro { max-width: 640px; margin: 1rem auto 3rem; text-align: center; }
.intro h1 { font-size: 2rem; font-weight: 600; margin: 0 0 0.4rem; }
.tagline { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.6rem; }
.intro-text { font-size: 1.1rem; }

.series-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.6rem;
}
.series-card {
  display: block;
  color: inherit;
}
.series-card:hover { text-decoration: none; }
.series-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--tile-bg);
  filter: grayscale(8%);
  transition: filter .3s ease, transform .3s ease;
}
.series-card:hover .series-card__img { filter: none; transform: scale(1.01); }
.series-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0.1rem 0;
}
.series-card__title { font-weight: 600; }
.series-card__count { color: var(--muted); font-size: 0.85rem; }

/* ---------- Series header ---------- */
.series-head { max-width: 640px; margin: 0 auto 2.2rem; text-align: center; }
.series-head h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 0.5rem; }
.series-desc { color: var(--muted); }
.series-desc p { margin: 0.3rem 0; }

/* ---------- Gallery (masonry, mixes portrait/landscape) ----------
   No-JS fallback: CSS columns (column-major order).
   With JS, app.js rebuilds the gallery into flex columns filled
   round-robin so portraits read left-to-right in their real order. */
.gallery {
  column-count: 3;
  column-gap: var(--gap);
}
@media (max-width: 900px) { .gallery { column-count: 2; } }
@media (max-width: 560px) { .gallery { column-count: 1; } }

.gallery--js {
  column-count: auto;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}
.gallery__col { flex: 1 1 0; min-width: 0; }

.gallery-empty {
  text-align: center;
  color: var(--muted);
  margin: 3rem 0 4rem;
}

.tile {
  position: relative;
  margin: 0 0 var(--gap);
  break-inside: avoid;
  overflow: hidden;
  background: var(--tile-bg);
  cursor: zoom-in;
}
.tile__img {
  width: 100%;
  height: auto;
  transition: transform .4s ease, filter .4s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.tile:hover .tile__img { transform: scale(1.03); filter: brightness(0.85); }

.tile__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.4rem 0.9rem 0.7rem;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  color: #fff;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.tile:hover .tile__overlay { opacity: 1; }
.tile__title { font-size: 0.95rem; font-weight: 500; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.2rem;
  background: rgba(15,14,13,.94);
}
.lightbox[hidden] { display: none; }

.lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
}
.lightbox__imgwrap { position: relative; line-height: 0; }
.lightbox__img {
  max-width: 88vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
/* transparent shield over the image (hinders saving/dragging) */
.lightbox__shield {
  position: absolute;
  inset: 0;
  cursor: default;
}
.lightbox__meta {
  color: #eee;
  text-align: center;
  max-width: 640px;
  padding: 0.9rem 0.6rem 0;
}
.lightbox__title { font-size: 1.05rem; font-weight: 500; margin: 0 0 0.3rem; }
.lightbox__caption { color: #bdbab5; font-size: 0.98rem; }
.lightbox__caption p { margin: 0.2rem 0; }

.lightbox__close, .lightbox__nav {
  background: none;
  border: none;
  color: #cfccc6;
  cursor: pointer;
  transition: color .2s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { color: #fff; }
.lightbox__close {
  position: absolute;
  top: 0.6rem; right: 1rem;
  font-size: 2.4rem;
  line-height: 1;
}
.lightbox__nav { font-size: 3rem; line-height: 1; padding: 0 0.4rem; flex: 0 0 auto; }
@media (max-width: 560px) {
  .lightbox__nav { position: absolute; bottom: 0.8rem; font-size: 2.4rem; }
  .lightbox__prev { left: 1rem; }
  .lightbox__next { right: 1rem; }
}

/* ---------- Text pages ---------- */
.prose { max-width: 620px; margin: 0 auto; }
.lang-switch { float: right; display: flex; gap: 0.2rem; }
.lang-switch button {
  background: none;
  border: none;
  padding: 0.2rem 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--fg); }
.lang-switch button.is-active { color: var(--fg); text-decoration: underline; }
.prose h1 { font-size: 1.7rem; font-weight: 600; }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin: 2.2rem 0 0.6rem; }
.prose h3 { font-size: 1.02rem; font-weight: 600; margin: 1.6rem 0 0.4rem; }
.prose p { margin: 1rem 0; }

/* newest-portraits grid on standalone pages */
.latest {
  max-width: 620px;
  margin: 2.4rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.latest__head {
  grid-column: 1 / -1;
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (max-width: 480px) {
  .latest { grid-template-columns: repeat(2, 1fr); }
}
.latest__tile { display: block; background: var(--tile-bg); }
.latest__tile img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.6rem 1.4rem 2.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--muted); }
