/* Site additions on top of Beautiful Hugo. Linked from layouts/partials/head_custom.html. */

:root {
  --muted: #6b6b6b;
  --card-bg: #fff;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  --photo-radius: 6px;
  --column: 680px;
  --wide: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --muted: #a3a3a3;
    --card-bg: #1b1b1b;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }
}

/* ---------- Captions for markdown images (layouts/_default/_markup/render-image.html) ---------- */
.img-caption {
  text-align: center;
  margin: .5rem 0 1.25rem;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--muted);
}
.img-caption a { text-decoration: underline; }

/* ---------- Trip page: hero ---------- */
.trip-hero {
  position: relative;
  margin-top: 50px;                     /* clear the fixed navbar */
  height: min(82vh, 62vw);
  min-height: 320px;
  background: #111;
  overflow: hidden;
}
.trip-hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.trip-hero__text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 120px 16px 28px;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  color: #fff;
  text-align: center;
}
.trip-hero__text h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 60px);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.trip-hero__subtitle {
  margin: 8px auto 0;
  max-width: var(--column);
  font-size: clamp(17px, 2.2vw, 22px);
  font-style: italic;
}
.trip-hero__meta {
  margin: 10px 0 0;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .85;
}
/* No photos yet: fall back to a plain title block like the rest of the site. */
.trip-hero--plain { height: auto; min-height: 0; background: none; margin-top: 80px; }
.trip-hero--plain .trip-hero__text { position: static; padding: 20px 16px; background: none; color: inherit; }
.trip-hero--plain .trip-hero__text h1 { text-shadow: none; }

/* ---------- Trip page: body ---------- */
.trip {
  flex: 1 0 auto;            /* keeps the footer at the bottom, like .container[role=main] */
  overflow-x: clip;          /* full-bleed photos may not cause sideways scrolling */
  padding: 48px 16px 64px;
}
.trip__body {
  max-width: var(--column);
  margin: 0 auto;
  font-size: 19px;
  line-height: 1.7;
}

/* Photos break out of the text column. */
.photo { margin: 2.2em 0; }
.photo a { display: block; cursor: zoom-in; }
.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--photo-radius);
}
.photo figcaption {
  margin-top: .6em;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
.photo--wide,
.photo-row,
.photo-grid-wrap {
  width: min(var(--wide), 100vw - 32px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.photo--full {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.photo--full img { border-radius: 0; }
.photo--full figcaption { padding: 0 16px; }

/* Side-by-side row: every photo gets the same height. */
.photo-row {
  display: flex;
  gap: 8px;
  margin: 2.2em 0;
}
.photo-row .photo { flex: var(--ar) 1 0; margin: 0; }
@media (max-width: 540px) {
  .photo-row { flex-direction: column; }
}

/* Justified grid: rows of even height, photos keep their shape. */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-grid::after { content: ""; flex-grow: 1000000; }   /* don't stretch the last row */
.photo-grid .photo {
  margin: 0;
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * 260px);
}
.photo-grid .photo img { border-radius: 3px; aspect-ratio: var(--ar); }
.photo-grid figcaption { display: none; }   /* captions still show in the lightbox */
@media (max-width: 600px) {
  .photo-grid .photo { flex-basis: calc(var(--ar) * 110px); }   /* ~2 per row on phones */
}
.photo-grid-wrap { margin: 2.2em 0; }

.trip__more {
  max-width: var(--wide);
  margin: 56px auto 0;
}
.trip__more-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  color: var(--muted);
  margin: 0 0 20px;
}
.trip__empty { text-align: center; color: var(--muted); }

.trip__nav {
  max-width: var(--wide);
  margin: 56px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.trip__nav-all { margin: 0 auto; }
.trip__nav-prev, .trip__nav-next { flex: 1; }
.trip__nav-next { text-align: right; }

/* ---------- Photos index (layouts/photos/list.html) ---------- */
.albums-intro { margin: 0 0 24px; }
.albums-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.album-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  color: inherit;
}
.album-card:hover, .album-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
  text-decoration: none;
  color: inherit;
}
.album-card img { display: block; width: 100%; height: auto; aspect-ratio: 900 / 620; object-fit: cover; }
.album-meta { padding: 14px 16px 16px; }
.album-meta h2 { margin: 0 0 4px; font-size: 20px; }
.album-meta span {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.album-meta p { margin: 8px 0 0; font-size: 16px; color: var(--muted); }

/* ---------- Home feed: photo-post cover ---------- */
.post-preview-cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0 4px;
  border-radius: var(--photo-radius);
}
