/* the photo album: a space picker above the portrait photos */
.album { padding-block: clamp(2.5rem, 6vw, 4.5rem); background: var(--sand-edge); border-block: 1px solid var(--line); }
.album__inner { inline-size: min(100% - 2.5rem, 76rem); margin-inline: auto; display: grid; gap: 1.1rem; min-inline-size: 0; }
.album__inner > *, .album__panel, .album__rowwrap { min-inline-size: 0; max-inline-size: 100%; }
.album__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.album__title { font-size: clamp(1.75rem, 4.5vw, 2.75rem); }
.album__all { min-block-size: 2.75rem; padding-inline: 1.25rem; border-color: var(--green); color: var(--green); }
@media (hover: hover) and (pointer: fine) { .album__all:hover { background: var(--green) !important; color: #fbf4e8 !important; } }

.album__tabs { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding-block: 0.15rem; margin-inline: calc(var(--bleed, 0px) * -1); }
.album__tabs::-webkit-scrollbar { display: none; }
.album__tab { flex: none; min-block-size: 2.75rem; padding: 0.4rem 1.25rem; border: 1px solid var(--maroon); border-radius: 999px; background: transparent; color: var(--maroon); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }
.album__tab.is-active { background: var(--maroon); color: var(--sand); }
@media (hover: hover) and (pointer: fine) { .album__tab:not(.is-active):hover { background: rgb(92 10 6 / 0.08); } }

.album__panel { display: grid; gap: 0.9rem; animation: album-in 280ms ease both; }
.album__panel[hidden] { display: none; }
@keyframes album-in { from { opacity: 0; } to { opacity: 1; } }
.album__rowwrap { position: relative; }
/* every photo in the row shares one height; the width follows each photo's own ratio, so none is cropped */
.album__row { max-inline-size: 100%; --ph: min(62svh, 34rem); display: flex; gap: 0.75rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x pan-y; }
.album__row::-webkit-scrollbar { display: none; }
.album__item { flex: none; scroll-snap-align: start; }
.album__photo { display: block; padding: 0; border: 0; background: var(--sand-deep); cursor: zoom-in; block-size: var(--ph); aspect-ratio: 9 / 16; max-inline-size: 78vw; box-shadow: 0 1rem 2rem -1rem rgb(60 20 10 / 0.3); transition: transform 160ms var(--ease-out); }
.album__photo:active { transform: scale(0.985); }
.album__photo img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }
.album__caption { margin: 0; font-family: "Amiri", var(--display); font-size: 1.25rem; line-height: 1.6; color: var(--maroon); }
html[lang="en"] .album__caption { font-family: var(--display); font-weight: 600; font-size: 1.375rem; }
.album__arrow { display: none; }

/* laptops and up: three photos side by side at one height, the words close underneath */
@media (min-width: 62rem) {
  .album__row { max-inline-size: 100%; --ph: min(calc(100svh - 21rem), 34rem); justify-content: flex-start; overflow-x: auto; }
  .album__panel[data-panel] .album__row { scroll-snap-type: x proximity; }
  .album__arrow { position: absolute; z-index: 2; inset-block-start: calc(var(--ph) / 2 - 1.375rem); display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; padding: 0; border: 1px solid var(--maroon); border-radius: 999px; background: var(--sand); color: var(--maroon); cursor: pointer; }
  .album__arrow[hidden] { display: none; }
  .album__arrow--prev { inset-inline-start: -0.5rem; }
  .album__arrow--next { inset-inline-end: -0.5rem; }
}
@media (prefers-reduced-motion: reduce) { .album__panel { animation: none; } .album__tab { transition: none; } }

/* the full gallery */
.gal { inset: 0; inline-size: 100%; max-inline-size: 100%; block-size: 100dvh; max-block-size: 100dvh; margin: 0; padding: 0; border: 0; background: var(--sand); color: var(--ink); overflow: hidden; }
.gal[open] { display: flex; flex-direction: column; }
.gal:focus-visible { outline: none; }
.gal::backdrop { background: rgb(40 10 6 / 0.5); }
.gal__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left)); border-block-end: 1px solid var(--line); }
.gal__head h2 { font-size: 1.5rem; }
.gal__close, .gal__vclose, .gal__vnav { display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; padding: 0; border: 1px solid var(--maroon); border-radius: 999px; background: var(--sand); color: var(--maroon); cursor: pointer; }
.gal__body { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.gal__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; max-inline-size: 78rem; margin: 0 auto; padding: 0; list-style: none; }
@media (min-width: 40rem) { .gal__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .gal__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.gal__thumb { display: block; inline-size: 100%; padding: 0; border: 0; background: var(--sand-deep); cursor: pointer; aspect-ratio: 9 / 16; transition: transform 160ms var(--ease-out); }
.gal__thumb:active { transform: scale(0.98); }
.gal__thumb img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }
.gal__viewer { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 3.75rem 0.75rem 1rem; background: rgb(243 232 217 / 0.98); }
.gal__viewer[hidden] { display: none; }
.gal__vclose { position: absolute; inset-block-start: 0.75rem; inset-inline-end: 0.75rem; }
.gal__vfig { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 0.6rem; block-size: 100%; margin: 0; min-block-size: 0; }
.gal__vfig img { max-inline-size: 100%; max-block-size: 100%; min-block-size: 0; object-fit: contain; }
.gal__vfig figcaption { color: var(--maroon); text-align: center; font-size: 1rem; }
@media (max-width: 40rem) { .gal__vnav { inline-size: 2.5rem; block-size: 2.5rem; } .gal__viewer { gap: 0.25rem; padding-inline: 0.4rem; } }
