/* ✿ Photos: albums, chapters, grid, viewer ✿
   Look only (Maison tokens from maison.css). Structure comes from /js/photos.js. */

.photos-page { max-width: 1320px; margin: 0 auto; padding: 150px var(--gutter) 130px; min-height: 70vh; }
.photos-loading { text-align: center; padding: 8rem 0; font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--taupe); }

.photos-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; font-size: 11px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--taupe); margin-bottom: 26px; }
.photos-crumbs a { border-bottom: 1px solid var(--line); }
.photos-crumbs a:hover { color: var(--ink); }
.photos-crumbs .sep { margin: 0 12px; opacity: .6; }

.photos-header { text-align: center; margin-bottom: 64px; }
.photos-eyebrow { display: inline-block; font-size: 11px; font-weight: 400; letter-spacing: .24em; text-transform: uppercase; color: var(--taupe); }
.photos-title { font-family: var(--serif); font-weight: 300; font-size: clamp(56px, 9vw, 128px); line-height: .95; text-transform: uppercase; margin: 12px 0 18px; }
.photos-meta { color: var(--ink-soft); max-width: 36rem; margin: 0 auto; }
.photos-meta a { border-bottom: 1px solid currentColor; }

.photos-era { margin-bottom: 70px; }
.photos-era-title { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 30px; }

.album-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.chapter-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.album-card, .chapter-card { display: block; }
.photo-cover { overflow: hidden; background: var(--paper-2); aspect-ratio: 4 / 5 !important; }
.photo-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.album-card:hover img, .chapter-card:hover img { transform: scale(1.04); }
.album-card-body h3, .chapter-card-body h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin-top: 16px; }
.album-card-meta, .album-card-count, .chapter-card-count { font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--taupe); margin-top: 4px; }

.chapter-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -24px 0 34px; }
.chapter-tabs a { font-size: 11px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); transition: border-color .3s; }
.chapter-tabs a:hover { border-color: var(--ink); }
.chapter-tabs a.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.photos-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 18px; }
.photos-hint { font-size: 14px; color: var(--ink-soft); }
.photos-download-all { font-size: 11px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; border: 1px solid var(--ink); padding: 11px 22px; transition: background .3s, color .3s; }
.photos-download-all:hover { background: var(--ink); color: var(--paper); }

.section-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: -6px 0 22px; }
.section-links a { font-family: var(--serif); font-style: italic; font-size: 20px; border-bottom: 1px solid var(--line); }
.section-links a:hover { border-color: var(--ink); }
.photos-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; margin: 64px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.photos-section-title:first-child { margin-top: 0; }
.photos-section-title span { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--taupe); }

/* Justified rows that keep capture order: each tile grows in proportion to its aspect ratio (--r). */
.photo-grid { --row: 280px; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid::after { content: ''; flex-grow: 999999; }
.photo-tile { display: block; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--row)); aspect-ratio: var(--r); overflow: hidden; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .4s; }
.photo-tile:hover img { transform: scale(1.03); }
@media (max-width: 640px) { .photo-grid { --row: 150px; gap: 4px; } }

.chapter-next { display: block; text-align: center; margin: 90px auto 0; font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 5vw, 64px); line-height: 1; }
.chapter-next:hover { font-style: italic; }

/* Viewer */
html.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(22, 18, 15, .97); color: #efe9e1; display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: auto 1fr; }
.lightbox[hidden] { display: none; }
.lb-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 16px 22px; }
.lb-count { margin-right: auto; font-size: 11px; letter-spacing: .22em; color: #a89a8b; }
.lb-download { font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; border: 1px solid rgba(239, 233, 225, .6); padding: 9px 18px; transition: background .3s, color .3s; }
.lb-download:hover { background: #efe9e1; color: var(--espresso); }
.lb-close, .lb-prev, .lb-next { color: #efe9e1; font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; opacity: .8; transition: opacity .3s; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-stage { grid-column: 2; display: flex; align-items: center; justify-content: center; min-height: 0; padding-bottom: 22px; touch-action: pan-y; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
@media (max-width: 640px) {
  .photos-page { padding-top: 120px; }
  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb-bar { padding: 12px 14px; gap: 12px; }
  .lb-prev, .lb-next { position: absolute; bottom: 14px; font-size: 46px; }
  .lb-prev { left: 22px; } .lb-next { right: 22px; }
}

/* Comfortable tap targets for the viewer controls */
.lb-close, .lb-prev, .lb-next { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
