/**
 * assets/css/gallery.css — Gallery page /portfolio/ (round 55: filmstrip on top, big photo below).
 * Strip + counter bar + big photo always fit on one screen: the big photo's height is the screen height
 * minus the fixed header (~80px), the strip (~96px), the bar and some breathing room.
 */
.section-pad.gallery-intro { padding-bottom: 3.5rem; }
.gal { padding: 0 0 6rem; scroll-margin-top: 90px; }
.gallery-intro + .ornament + .gal { padding-top: 3.5rem; }   /* round 58: equal, compact space around the stars above the filmstrip */

/* ── filmstrip (top): swipe / drag / wheel ── */
.gal-strip {
    display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 6px 4px 12px;
    scrollbar-width: thin; scrollbar-color: rgba(201,168,76,0.5) transparent; scroll-behavior: smooth;
    cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.gal-strip.is-grabbing { cursor: grabbing; scroll-behavior: auto; }
.gal-strip::-webkit-scrollbar { height: 5px; }
.gal-strip::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.45); border-radius: 3px; }
.gal-strip__thumb {
    flex: 0 0 auto; height: 84px; padding: 0; border: 1px solid rgba(201,168,76,0.25); background: #141a26; cursor: inherit;
    opacity: 0.55; transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.gal-strip__thumb img { display: block; height: 100%; width: auto; pointer-events: none; -webkit-user-drag: none; }
.gal-strip__thumb:hover { opacity: 0.9; transform: translateY(-2px); }
.gal-strip__thumb.is-active { opacity: 1; border-color: var(--gold-light); box-shadow: 0 0 12px rgba(201,168,76,0.4); }

/* ── counter + slideshow (between strip and photo) ── */
.gal-stage__bar { display: flex; justify-content: center; align-items: center; gap: 2rem; margin: 0.9rem 0 1.1rem; }
.gal-stage__count { display: block; font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.22em; color: var(--gold-dim); }
.gal-stage__count b { color: var(--gold-light); font-weight: 400; }
.gal-stage__play { border: 0; background: none; color: var(--gold-light); font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; cursor: pointer; border-bottom: 1px solid rgba(228,201,123,0.4); padding: 0 0 2px; }

/* ── big photo (round 56): the frame takes the exact size of each photo, centred; the arrows never move ── */
.gal { --stage-h: clamp(260px, calc(100vh - 330px), 680px); }
@supports (height: 100svh) { .gal { --stage-h: clamp(260px, calc(100svh - 330px), 680px); } }
.gal-stage { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 1.5rem; max-width: 1040px; margin: 0 auto; }
.gal-stage__box {
    container-type: inline-size; min-height: calc(var(--stage-h) + 30px);
    display: flex; align-items: center; justify-content: center;
}
.gal-stage .gal-stage__frame {
    --w: 3; --h: 4;
    width: auto; max-width: none; flex: 0 0 auto;
    transition: opacity 0.55s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.55s ease;
}
.gal-stage .gal-stage__frame .gal-stage__img {
    display: block; cursor: pointer; user-select: none; -webkit-user-drag: none; object-fit: cover;
    aspect-ratio: var(--w) / var(--h);
    height: min(var(--stage-h), calc((100cqw - 30px) * var(--h) / var(--w)));
    width: auto; max-width: none;
}
.gal-stage .gal-stage__frame.is-out { opacity: 0; transform: scale(0.975); filter: blur(3px); transition-duration: 0.38s, 0.38s, 0.38s; }
.gal-stage__nav {
    width: 52px; height: 52px; border: 1px solid rgba(201,168,76,0.5); background: rgba(20,26,38,0.85); color: var(--gold-light);
    font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.gal-stage__nav:hover { border-color: #f3dc9a; color: #f6e3ae; box-shadow: 0 0 16px rgba(201,168,76,0.35); transform: scale(1.06); }

/* slideshow speed (round 68): a gold slide line, Slow ... Fast */
.gal-speed { display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.gal-speed__end { font-family: var(--font-sans); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dim); }
.gal-speed__range {
    --fill: 50%;
    -webkit-appearance: none; appearance: none; width: 130px; height: 22px; margin: 0; background: transparent; cursor: pointer;
}
.gal-speed__range::-webkit-slider-runnable-track {
    height: 1px; background: linear-gradient(to right, var(--gold-light) 0 var(--fill), rgba(201,168,76,0.3) var(--fill) 100%);
}
.gal-speed__range::-moz-range-track { height: 1px; background: rgba(201,168,76,0.3); }
.gal-speed__range::-moz-range-progress { height: 1px; background: var(--gold-light); }
.gal-speed__range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -6.5px; border-radius: 50%;
    background: #1a2230; border: 1px solid #f3dc9a; box-shadow: 0 0 10px rgba(228,201,123,0.55);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.gal-speed__range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #1a2230; border: 1px solid #f3dc9a; box-shadow: 0 0 10px rgba(228,201,123,0.55); }
.gal-speed__range:hover::-webkit-slider-thumb, .gal-speed__range:focus-visible::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 16px rgba(243,220,154,0.8); }
.gal-speed__range:focus { outline: none; }
/* counter under the big photo */
.gal-stage__count { text-align: center; margin: 0.9rem 0 0; }

@media (max-width: 968px) {
    .gal { --stage-h: clamp(240px, calc(100vh - 300px), 620px); }
    @supports (height: 100svh) { .gal { --stage-h: clamp(240px, calc(100svh - 300px), 620px); } }
    .gal-stage { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .gal-stage__nav { display: none; }                         /* phones: swipe or tap left/right half */
}
@media (max-width: 600px) {
    .gal-strip__thumb { height: 70px; }
    .gal-stage__bar { margin: 0.7rem 0 0.9rem; gap: 1.2rem; flex-wrap: wrap; }
}

/* intro (round 52) */
.gold-script { font-family: var(--font-script); font-style: normal; font-size: 1.45em; color: var(--gold-light); text-shadow: 0 0 10px rgba(201,168,76,0.3); line-height: 1; }
.gallery-quote { margin-top: 1.8rem; font-family: var(--font-serif); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.45rem); color: #fff; }
.gallery-quote::before, .gallery-quote::after { content: '\2726'; font-style: normal; font-size: 0.6rem; color: var(--gold-light); vertical-align: middle; margin: 0 0.9rem; }
