/* Gallery Walk Template - calm exhibit panels for careful looking */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: var(--font-body); font-size: 16px; color: #202425; background: #e9e6dd; }
h1, h2, h3 { font-family: var(--font-heading); }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--primary-color); }

.book {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(80,76,65,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(80,76,65,.05) 1px, transparent 1px),
    linear-gradient(180deg, #f3f0e7, #e5e0d3);
  background-size: 88px 88px, 88px 88px, auto;
}

.page {
  position: absolute;
  inset: clamp(10px, 2vw, 24px) clamp(12px, 4vw, 78px);
  display: flex;
  overflow: hidden;
  background: #fbfaf5;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(37,35,30,.18);
}
.page[hidden] { display: none; pointer-events: none; }
.page--slide-in-next { z-index: 2; animation: galleryInRight .38s ease both; }
.page--slide-out-prev { z-index: 1; animation: galleryOutLeft .32s ease both; }
.page--slide-in-prev { z-index: 2; animation: galleryInLeft .38s ease both; }
.page--slide-out-next { z-index: 1; animation: galleryOutRight .32s ease both; }
.page--fade-in { z-index: 2; animation: fadeIn .22s ease both; }
.page--fade-out { z-index: 1; animation: fadeOut .22s ease both; }
@keyframes galleryInRight { from { opacity: .5; transform: translateX(8%); } to { opacity: 1; transform: translateX(0); } }
@keyframes galleryOutLeft { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-8%); } }
@keyframes galleryInLeft { from { opacity: .5; transform: translateX(-8%); } to { opacity: 1; transform: translateX(0); } }
@keyframes galleryOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(8%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.page--cover { flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 2vh, 22px); padding: clamp(18px, 4vw, 40px); text-align: center; background: #fbfaf5; }
.cover-image-wrap { flex: 1 1 0; min-height: 0; width: min(78vw, 720px); display: grid; place-items: center; padding: clamp(12px, 2vw, 22px); background: #fff; border: 1px solid rgba(37,35,30,.18); box-shadow: 0 12px 28px rgba(37,35,30,.12); }
.cover-image-wrap img { max-height: 100%; object-fit: contain; }
.cover-text { flex-shrink: 0; max-width: min(88vw, 760px); }
.cover-title { color: var(--primary-color); font-size: clamp(2rem, 5.8vw, 4rem); line-height: 1.05; }
.cover-subtitle { margin-top: 7px; color: #4c5150; font-size: clamp(1rem, 2.4vw, 1.35rem); font-weight: 600; }
.cover-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.btn-icon, .nav-edge-btn { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: rgba(32,36,37,.76); text-decoration: none; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.btn-icon:active, .nav-edge-btn:active { transform: scale(.92); background: var(--primary-color); }

.page--content { flex-direction: row; align-items: stretch; gap: clamp(14px, 2.2vw, 28px); padding: clamp(18px, 3vw, 38px); }
.page--content::after { content: ""; position: absolute; left: clamp(16px, 3vw, 34px); right: clamp(16px, 3vw, 34px); bottom: clamp(12px, 2vw, 24px); height: 2px; background: linear-gradient(90deg, transparent, rgba(40,40,35,.18), transparent); pointer-events: none; }
.page-figure, .page-images-pair, .page-body, .page-right { position: relative; min-width: 0; min-height: 0; }
.page-figure { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border: 1px solid rgba(37,35,30,.16); box-shadow: 0 10px 26px rgba(37,35,30,.13); }
.page-figure::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.7); pointer-events: none; z-index: 1; }
.page-figure img { width: 100%; height: 100%; object-fit: cover; }
.page--layout-2mixed .page-figure img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.page-figure figcaption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 5px 9px; background: rgba(255,255,255,.92); color: #2e3332; border-left: 4px solid var(--accent-color); font-size: .68rem; line-height: 1.25; box-shadow: 0 2px 8px rgba(0,0,0,.1); z-index: 2; }
.page-body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(18px, 3vw, 38px); background: color-mix(in srgb, var(--background-color) 36%, white); border-left: 8px solid var(--accent-color); box-shadow: inset 0 0 0 1px rgba(37,35,30,.12); }
.page-text { color: #202425; font-size: var(--page-text-size); line-height: var(--page-text-line-height); font-weight: 600; }
.extras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.extra { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; background: #fff; color: #202425; border: 1px solid rgba(37,35,30,.16); font-size: .88rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.extra:active { transform: scale(.96); background: color-mix(in srgb, var(--background-color) 48%, white); }
.extra-icon { color: var(--accent-color); }
.page--layout-a .page-figure, .page--layout-b .page-figure, .page--layout-2a .page-images-pair, .page--layout-2portrait .page-images-pair, .page--layout-2mixed .page-images-pair { flex: 1 1 62%; }
.page--layout-a .page-body, .page--layout-b .page-body, .page--layout-2a .page-body, .page--layout-2portrait .page-body, .page--layout-2mixed .page-body { flex: 1 1 38%; }
.page--layout-b { flex-direction: row; }
.page--layout-2a .page-images-pair, .page--layout-2mixed .page-images-pair { display: flex; flex-direction: column; gap: clamp(12px, 2vw, 20px); }
.page--layout-2portrait .page-images-pair { display: flex; flex-direction: row; gap: clamp(12px, 2vw, 20px); }
.page--layout-pl .page-figure--portrait { flex: 0 0 36%; }
.page--layout-pl .page-right { flex: 1 1 64%; display: flex; flex-direction: column; gap: clamp(12px, 2vw, 20px); }
.page--layout-pl .page-figure--landscape { flex: 1 1 52%; }
.page--layout-pl .page-body { flex: 1 1 48%; }
.extra[data-audio] { position: relative; z-index: 30; pointer-events: auto; }
.btn-read { position: absolute; right: 20px; bottom: 20px; z-index: 30; pointer-events: auto; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-color); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn-read:active { transform: scale(.92); }
.btn-read.playing { background: var(--accent-color); animation: quietPulse 1.1s ease-in-out infinite; }
@keyframes quietPulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent-color) 28%, transparent); } }
.nav-edge { position: absolute; inset: 0; z-index: 25; pointer-events: none; }
.nav-edge-btn { position: absolute; pointer-events: auto; }
.nav-edge-prev { left: max(12px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.nav-edge-next { right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.nav-edge-prev:active, .nav-edge-next:active { transform: translateY(-50%) scale(.92); }
.nav-edge-home { left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); width: 48px; height: 48px; }
.nav-edge-prev[hidden], .nav-edge-next[hidden] { display: flex; visibility: hidden; }
.tap-zone { display: none; position: absolute; top: 0; bottom: 0; width: 22%; min-width: 64px; z-index: 12; }
.tap-zone--left { left: 0; } .tap-zone--right { right: 0; }
.tap-zone.ripple::after { content: ""; position: absolute; inset: 0; background: rgba(32,36,37,.08); animation: tapRipple .35s ease-out both; }
@keyframes tapRipple { from { opacity: 1; } to { opacity: 0; } }
.swipe-hint { display: none; position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; pointer-events: none; text-align: center; }
.swipe-hint-hand { display: inline-block; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.94); color: #202425; font-weight: 800; animation: hintSway 1.2s ease-in-out infinite; }
.swipe-hint-label { display: block; margin-top: 5px; color: #202425; font-size: .8rem; font-weight: 700; }
@keyframes hintSway { 50% { transform: translateX(-14px); } }
.page--credits { padding: clamp(20px, 4vw, 46px); overflow-y: auto; align-items: flex-start; justify-content: flex-start; }
.credits-content { width: min(860px, 100%); margin: 0 auto; padding: clamp(20px, 3vw, 34px); background: #fff; border-left: 8px solid var(--accent-color); box-shadow: 0 12px 28px rgba(37,35,30,.12); }
.credits-title { color: var(--primary-color); font-size: clamp(1.5rem, 4vw, 2.25rem); margin-bottom: 14px; }
.credits-content h3 { margin: 16px 0 8px; color: #4c5150; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.credits-sources, .credits-images { list-style: none; }
.credits-sources li, .credits-images li { padding: 4px 0; color: #303634; font-size: .9rem; line-height: 1.45; }

@media (orientation: portrait), (max-width: 700px) {
  .page { inset: 6px; border-radius: 8px; }
  .page--content, .page--layout-b, .page--layout-pl { flex-direction: column; gap: 10px; padding: 12px; }
  .page--layout-a .page-figure, .page--layout-b .page-figure, .page--layout-2a .page-images-pair, .page--layout-2portrait .page-images-pair, .page--layout-2mixed .page-images-pair { flex: 1 1 var(--portrait-image-share); width: 100%; }
  .page--layout-a .page-body, .page--layout-b .page-body, .page--layout-2a .page-body, .page--layout-2portrait .page-body, .page--layout-2mixed .page-body { flex: 0 1 var(--portrait-text-share); width: 100%; padding: 14px 16px; border-left-width: 5px; }
  .page--layout-2a .page-images-pair, .page--layout-2portrait .page-images-pair, .page--layout-2mixed .page-images-pair { flex-direction: row; gap: 8px; }
  .page--layout-pl .page-figure--portrait { flex: 0 0 30%; width: 100%; }
  .page--layout-pl .page-right { flex: 1 1 70%; width: 100%; gap: 8px; }
  .page--layout-pl .page-figure--landscape, .page--layout-pl .page-body { flex: 1 1 0; }
  .extras { gap: 6px; margin-top: 10px; }
  .extra { min-height: 38px; padding: 7px 10px; font-size: .82rem; }
}
@media (max-width: 479px) {
  .tap-zone, .swipe-hint { display: block; }
  .cover-actions { top: 8px; right: 8px; }
  .btn-icon { width: 44px; height: 44px; }
  .btn-read { width: 48px; height: 48px; right: 12px; bottom: 12px; }
  .page-text { line-height: var(--page-text-line-height); }
  .page-figure figcaption { font-size: .62rem; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .page--content, .page--layout-b { flex-direction: row; }
  .page--layout-a .page-figure, .page--layout-b .page-figure, .page--layout-2a .page-images-pair, .page--layout-2portrait .page-images-pair, .page--layout-2mixed .page-images-pair { flex: 1 1 58%; height: 100%; }
  .page--layout-a .page-body, .page--layout-b .page-body, .page--layout-2a .page-body, .page--layout-2portrait .page-body, .page--layout-2mixed .page-body { flex: 1 1 42%; height: 100%; padding: 10px 14px; }
  .page--layout-2a .page-images-pair, .page--layout-2mixed .page-images-pair { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .book { position: static; display: block; padding: 0; background: none; }
  .page, .page[hidden] { position: static; display: flex !important; inset: auto; height: auto; min-height: 0; page-break-after: always; padding: 24px; border-radius: 0; box-shadow: none; transform: none !important; animation: none !important; }
  .page--content { flex-direction: column; }
  .page-figure, .page-body, .page-images-pair { break-inside: avoid; width: 100%; height: auto; }
  .nav-edge, .tap-zone, .swipe-hint, .btn-read, .cover-actions { display: none !important; }
}
