/* Gallery index and album pages only. */
.gal-index {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1.1rem;
}
.gal-card {
  display: grid;
  grid-template-columns: 7.6rem minmax(0, 1fr);
  min-height: 7.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.gal-card:hover { border-color: var(--orange); }
.gal-card-photo {
  display: block;
  background: #f3d7b0;
  min-height: 7.2rem;
  height: 100%;
}
.gal-card-photo img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
.gal-card-fallback {
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--ink);
  font-family: Georgia, "Liberation Serif", serif;
  font-size: 2rem;
  font-weight: 700;
}
.gal-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.7rem 0.85rem 0.75rem;
  min-width: 0;
}
.gal-card-title {
  font-family: Georgia, "Liberation Serif", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
}
.gal-card-date {
  color: var(--muted);
  font-size: 0.86rem;
}
@media (min-width: 720px) {
  .gal-index { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
}
@media (min-width: 1000px) {
  .gal-index { grid-template-columns: repeat(3, 1fr); gap: 0.95rem; }
  .gal-card { grid-template-columns: 1fr; min-height: 0; }
  .gal-card-photo { aspect-ratio: 4 / 3; height: auto; min-height: 0; }
  .gal-card-body { padding: 0.8rem 0.9rem 0.95rem; }
}

.album-story { max-width: 52rem; }
.album-head { margin-bottom: 0.3rem; }
.album-date { margin: 0 0 0.7rem; color: var(--muted); }
.album-text { margin-bottom: 0.3rem; }
.album-photos { margin: 0.9rem 0 1.1rem; }
button.album-shot {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #efe4d2;
  color: inherit;
  line-height: 0;
  cursor: zoom-in;
  box-shadow: var(--shadow);
}
button.album-shot:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button.album-hero { margin-bottom: 0.6rem; }
button.album-hero.is-only img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: cover;
  object-position: center;
  display: block;
}
button.album-hero:not(.is-only) {
  aspect-ratio: 16 / 10;
}
button.album-hero:not(.is-only) img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
.album-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.album-mosaic button.album-shot { aspect-ratio: 1 / 1; border-radius: 14px; }
.album-mosaic button.album-shot img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
@media (min-width: 800px) {
  .album-mosaic { grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
  button.album-hero:not(.is-only) { aspect-ratio: 16 / 9; }
}
.album-nav { margin-top: 1.1rem; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem;
  background: rgba(28, 18, 11, 0.92);
}
.lb[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-figure {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lb-figure img {
  max-width: min(1100px, 100%);
  max-height: min(78vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #1c120b;
}
.lb-figure figcaption {
  color: #f6efe2;
  margin-top: 0.55rem;
  text-align: center;
  font-size: 0.95rem;
  max-width: 36rem;
}
button.lb-close,
button.lb-prev,
button.lb-next {
  position: relative;
  z-index: 1;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 226, 0.45);
  background: rgba(255, 250, 243, 0.14);
  color: #fffaf3;
  font-size: 1.7rem;
  line-height: 1;
}
button.lb-close { grid-column: 3; grid-row: 1; justify-self: end; }
button.lb-prev { grid-column: 1; grid-row: 2; }
button.lb-next { grid-column: 3; grid-row: 2; }
.lb.is-single .lb-prev,
.lb.is-single .lb-next { visibility: hidden; }
@media (max-width: 640px) {
  .lb { padding: 0.45rem; }
  button.lb-prev, button.lb-next { position: absolute; bottom: 0.7rem; }
  button.lb-prev { left: 0.7rem; }
  button.lb-next { right: 0.7rem; }
  .lb-figure { padding-bottom: 3.2rem; }
}

/* gallery-mobile-compact */
@media (max-width: 640px) {
  .gal-index { gap: 0.45rem; margin-top: 0.65rem; }
  .gal-card {
    grid-template-columns: 5.1rem minmax(0, 1fr);
    min-height: 0;
    border-radius: 12px;
  }
  .gal-card-photo { min-height: 4.3rem; }
  .gal-card-body { padding: 0.4rem 0.6rem 0.45rem; gap: 0.12rem; }
  .gal-card-title, .gal-card-date {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .gal-card-title { font-size: 0.98rem; }
  .album-head { margin-bottom: 0.15rem; }
  .album-date { margin-bottom: 0.4rem; }
  .album-photos { margin: 0.55rem 0 0.75rem; }
  button.album-hero:not(.is-only) { aspect-ratio: 16 / 9; }
  button.album-hero.is-only img { max-height: 52vh; }
  .album-mosaic { gap: 0.4rem; }
  .album-nav { margin-top: 0.7rem; }
}
