.cottage-gallery-section {
  position: relative;
  height: calc(var(--gallery-scenes, 6) * 100svh);
  min-height: calc(var(--gallery-scenes, 6) * 680px);
}

.cottage-booking-bar { position: fixed; z-index: 80; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px clamp(22px,4vw,72px) calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 25px rgba(24,39,37,.08); }
.cottage-booking-bar[hidden],.menu-open .cottage-booking-bar { display: none; }
.cottage-booking-bar span { display: block; font-size: .65rem; color: var(--ink2); }
.cottage-booking-bar strong { display: block; font: 400 1.8rem/1.1 var(--serif); }
.has-cottage-booking { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.has-cottage-booking .cottage-gallery-controls { bottom: calc(100px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) {
  .cottage-booking-bar { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .cottage-booking-bar strong { font-size: 1.5rem; }
  .cottage-booking-bar .button { padding: 14px 16px; font-size: .65rem; white-space: nowrap; }
}

.cottage-gallery-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
}

.cottage-gallery-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.cottage-gallery-track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
}

.cottage-gallery-scene {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #e2e9df;
  color: #18312a;
}

.cottage-gallery-image {
  position: absolute;
  inset: 11% 46% 9% 4%;
  overflow: hidden;
}

.cottage-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.055);
  transition: transform 1.15s cubic-bezier(.2,.7,.2,1);
}

.cottage-gallery-open { position:absolute; inset:0; width:100%; height:100%; padding:0; overflow:hidden; border:0; background:transparent; color:inherit; text-align:left; cursor:pointer; }
.cottage-gallery-open img,.cottage-gallery-open video { display:block; width:100%; height:100%; object-fit:cover; }
.cottage-gallery-open > span { position:absolute; left:var(--gallery-cursor-x,50%); top:var(--gallery-cursor-y,50%); width:clamp(132px,17vw,220px); aspect-ratio:1; display:grid; place-items:center; padding:12px; border:1px solid rgba(246,248,242,.38); border-radius:50%; background:transparent; color:#f6f8f2; font:700 .66rem/1 var(--sans); letter-spacing:.07em; text-transform:uppercase; opacity:0; transform:translate(-50%,-50%) scale(.92); pointer-events:none; transition:opacity .25s ease,transform .35s cubic-bezier(.2,.7,.2,1); }
.cottage-gallery-open:hover > span,.cottage-gallery-open:focus-visible > span { opacity:1; transform:translate(-50%,-50%) scale(1); }
.cottage-gallery-open:focus-visible { outline:2px solid #f6f8f2; outline-offset:-6px; }
@media (hover:hover) and (pointer:fine) { .cottage-gallery-open { cursor:none; } }
.gallery-scene-video .cottage-gallery-image { transform:scale(.78); opacity:.7; transition:transform 1.25s cubic-bezier(.2,.7,.2,1),opacity 1.1s ease; }
.gallery-scene-video .cottage-gallery-open video { clip-path:inset(11%); transform:scale(1.12); transition:clip-path 1.1s cubic-bezier(.2,.7,.2,1),transform 1.25s cubic-bezier(.2,.7,.2,1); }
.gallery-scene-video.is-active .cottage-gallery-image { transform:scale(1); opacity:1; }
.gallery-scene-video.is-active .cottage-gallery-open video { clip-path:inset(0); transform:scale(1); }

.cottage-gallery-scene.is-active .cottage-gallery-image img { transform: scale(1); }

.cottage-gallery-copy {
  position: absolute;
  z-index: 1;
  left: 59%;
  right: 6%;
  top: 29%;
  transform: translateY(35px);
  opacity: .5;
  transition: transform .85s cubic-bezier(.2,.7,.2,1), opacity .85s ease;
}

.cottage-gallery-scene.is-active .cottage-gallery-copy {
  transform: translateY(0);
  opacity: 1;
}

.cottage-gallery-copy h2 {
  font: 400 clamp(5rem, 8vw, 10rem)/.85 var(--serif);
  letter-spacing: -.04em;
  overflow-wrap: normal;
}

.cottage-gallery-copy p {
  margin-top: 35px;
  font-size: 1rem;
}

.gallery-scene-2,
.gallery-scene-5 { background: #18312a; color: #f6f8f2; }

.gallery-scene-2 .cottage-gallery-image,
.gallery-scene-5 .cottage-gallery-image { inset: 10% 5% 9% 41%; }

.gallery-scene-2 .cottage-gallery-copy,
.gallery-scene-5 .cottage-gallery-copy { left: 6%; right: 62%; top: 33%; }

.gallery-scene-3,
.gallery-scene-6 { background: #b8c8bb; }

.gallery-scene-3 .cottage-gallery-image,
.gallery-scene-6 .cottage-gallery-image { inset: 17% 8% 6% 36%; }

.gallery-scene-3 .cottage-gallery-copy,
.gallery-scene-6 .cottage-gallery-copy { left: 5%; right: 68%; top: 30%; }
.gallery-scene-3 .cottage-gallery-copy h2,
.gallery-scene-6 .cottage-gallery-copy h2 { font-size: clamp(3.8rem, 6vw, 7rem); }

.gallery-scene-4 { background: #c5cbbd; }
.gallery-scene-4 .cottage-gallery-image { inset: 10% 51% 10% 6%; }
.gallery-scene-4 .cottage-gallery-copy { left: 53%; right: 7%; top: 30%; }

.cottage-gallery-controls {
  position: absolute;
  z-index: 5;
  left: clamp(22px, 3vw, 56px);
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 55px;
  padding: 10px 18px;
  background: #142d27;
  color: #fff;
}

.cottage-gallery-count { font-size: .8rem; white-space: nowrap; }
.cottage-gallery-total { font-size: .72rem; white-space: nowrap; }
.cottage-gallery-count strong { font-weight: 700; }
.cottage-gallery-controls > div { display: flex; gap: 9px; }

.cottage-gallery-controls button {
  border: 1px solid rgba(255,255,255,.5);
  background: transparent;
  color: white;
  padding: 7px 12px;
  font-size: .72rem;
  cursor: pointer;
}

.cottage-gallery-controls button:hover { background: white; color: #142d27; }
.cottage-gallery-controls button:disabled { opacity: .4; cursor: default; }
.cottage-gallery-controls button:disabled:hover { background: transparent; color: white; }

.cottage-gallery-viewer { position:fixed; inset:0; width:100vw; max-width:none; height:100svh; max-height:none; margin:0; padding:0; overflow:hidden; border:0; background:#142d27; color:#f6f8f2; }
.cottage-gallery-viewer::backdrop { background:#142d27; }
.gallery-viewer-stage { position:absolute; inset:0; display:grid; place-items:center; animation:gallery-open .75s cubic-bezier(.2,.7,.2,1) both; }
.gallery-viewer-stage img,.gallery-viewer-stage video { width:100%; height:100%; object-fit:contain; background:#142d27; }
.gallery-viewer-close,.gallery-viewer-arrow { position:absolute; z-index:2; display:grid; place-items:center; border:0; border-radius:0; background:#f6f8f2; color:#142d27; cursor:pointer; backdrop-filter:none; -webkit-backdrop-filter:none; transition:background .2s,color .2s; }
.gallery-viewer-close { top:24px; right:clamp(20px,4vw,64px); width:56px; height:56px; padding:0; }
.gallery-viewer-close span { font:400 2rem/1 var(--sans); }
.gallery-viewer-close:hover,.gallery-viewer-arrow:hover:not(:disabled) { background:#17352c; color:#fff; }
.gallery-viewer-arrow { top:50%; width:54px; height:62px; transform:translateY(-50%); font-size:1.45rem; }
.gallery-viewer-arrow:disabled { opacity:.4; cursor:default; }
.gallery-viewer-prev { left:clamp(14px,3vw,48px); }
.gallery-viewer-next { right:clamp(14px,3vw,48px); }
.gallery-viewer-caption { position:absolute; z-index:2; left:clamp(20px,4vw,64px); bottom:clamp(22px,4vh,48px); display:flex; flex-direction:column; gap:5px; text-shadow:0 1px 12px rgba(0,0,0,.65); }
.gallery-viewer-caption span { font:400 clamp(1.7rem,3vw,3rem)/1 var(--serif); }
.gallery-viewer-caption small { font-size:.65rem; letter-spacing:.13em; text-transform:uppercase; }
@keyframes gallery-open { from { opacity:.5; transform:scale(.94); clip-path:inset(5% 5% 5% 5%); } to { opacity:1; transform:scale(1); clip-path:inset(0); } }

@media (max-width: 760px) {
  .cottage-gallery-section { height: auto; min-height: 0; }
  .cottage-gallery-sticky { position: relative; height: min(760px, 88svh); min-height: 600px; }
  .cottage-gallery-viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cottage-gallery-viewport::-webkit-scrollbar { display: none; }
  .cottage-gallery-track { transform: none !important; }
  .cottage-gallery-scene { scroll-snap-align: start; }
  .cottage-gallery-image,
  .gallery-scene-2 .cottage-gallery-image,
  .gallery-scene-3 .cottage-gallery-image,
  .gallery-scene-4 .cottage-gallery-image,
  .gallery-scene-5 .cottage-gallery-image,
  .gallery-scene-6 .cottage-gallery-image { inset: 0 0 48% 0; }
  .cottage-gallery-copy,
  .gallery-scene-2 .cottage-gallery-copy,
  .gallery-scene-3 .cottage-gallery-copy,
  .gallery-scene-4 .cottage-gallery-copy,
  .gallery-scene-5 .cottage-gallery-copy,
  .gallery-scene-6 .cottage-gallery-copy { left: 24px; right: 24px; top: 56%; }
  .cottage-gallery-copy h2 { font-size: clamp(4.4rem, 14vw, 7rem); }
  .cottage-gallery-copy p { margin-top: 18px; }
  .cottage-gallery-controls { left: 18px; right: 18px; bottom: 16px; justify-content: space-between; }
  .cottage-gallery-total { display:none; }
  .cottage-gallery-controls > div { width:100%; justify-content:space-between; }
  .cottage-gallery-open > span { left:auto; top:auto; right:12px; bottom:12px; width:auto; aspect-ratio:auto; display:block; border:0; border-radius:0; background:rgba(18,42,35,.88); opacity:1; transform:none; padding:10px 12px; font-size:.55rem; }
  .gallery-viewer-close { top:14px; right:14px; width:50px; height:50px; }
  .gallery-viewer-arrow { top:auto; bottom:24px; width:48px; height:50px; transform:none; }
  .gallery-viewer-prev { left:18px; }
  .gallery-viewer-next { right:18px; }
  .gallery-viewer-caption { left:50%; bottom:35px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 140px); text-align:center; }
  .gallery-viewer-caption span { font-size:1.5rem; }
  .gallery-viewer-caption small { font-size:.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cottage-gallery-section { height: auto; min-height: 0; }
  .cottage-gallery-sticky { position: relative; height: min(900px, 100svh); }
  .cottage-gallery-viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cottage-gallery-viewport::-webkit-scrollbar { display: none; }
  .cottage-gallery-track { transform: none !important; will-change: auto; }
  .cottage-gallery-scene { scroll-snap-align: start; }
  .cottage-gallery-copy { opacity: 1; transform: none; }
  .cottage-gallery-image img { transform: none; }
  .gallery-scene-video .cottage-gallery-open video { transform:none; clip-path:none; }
  .gallery-scene-video .cottage-gallery-image,.gallery-scene-video.is-active .cottage-gallery-image { transform:none; opacity:1; }
  .gallery-viewer-stage { animation:none; }
}

/* Bare line icons use the sampled brightness of the photo or video below them. */
.cottage-gallery-viewer{isolation:isolate}
.cottage-gallery-viewer .gallery-viewer-close,
.cottage-gallery-viewer .gallery-viewer-arrow,
.cottage-gallery-viewer .gallery-viewer-close:hover,
.cottage-gallery-viewer .gallery-viewer-arrow:hover:not(:disabled){background:transparent!important;border:0;box-shadow:none;color:var(--gallery-icon-color,#fff);mix-blend-mode:normal;backdrop-filter:none;-webkit-backdrop-filter:none;transition:opacity .2s}
.gallery-viewer-close svg,.gallery-viewer-arrow svg{display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:square;pointer-events:none}
.gallery-viewer-close svg{width:26px;height:26px}
.gallery-viewer-arrow svg{width:36px;height:36px}
.gallery-viewer-close:focus-visible,.gallery-viewer-arrow:focus-visible{outline:2px solid currentColor;outline-offset:2px}

.cottage-gallery-controls .cottage-gallery-skip { display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.5); background:transparent; color:white; padding:7px 12px; font-size:.72rem; line-height:inherit; white-space:nowrap; }
.cottage-gallery-controls .cottage-gallery-skip:hover { background:white; color:#142d27; }
@media(max-width:760px) { .cottage-gallery-controls > div { flex-wrap:wrap; } }

.gallery-view-more { margin-top:28px; background:#111; color:#fff; border-color:#111; cursor:pointer; }
.gallery-view-more:hover { background:#292929; border-color:#292929; color:#fff; }
@media(max-width:760px) { .gallery-view-more { margin-top:18px; } }

.cottage-gallery-dots { display:none; }
@media(max-width:760px) {
  .cottage-gallery-dots { position:absolute; z-index:6; left:50%; bottom:78px; transform:translateX(-50%); display:flex; justify-content:center; gap:0; }
  .cottage-gallery-dots button { display:grid; place-items:center; width:36px; height:44px; padding:0; border:0; background:transparent; color:var(--ink); cursor:pointer; }
  .cottage-gallery-dots button span { display:block; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.3; transition:opacity .2s,transform .2s; }
  .cottage-gallery-dots button.is-active span { opacity:1; transform:scale(1.25); }
  .has-cottage-booking .cottage-gallery-dots { bottom:calc(162px + env(safe-area-inset-bottom)); }
  .cottage-gallery-controls button[data-horizontal-prev], .cottage-gallery-controls button[data-horizontal-next] { display:none; }
  .cottage-gallery-controls > div { justify-content:center; }
  .gallery-view-more { min-height:44px; }
}

/* Mobile exposes the full library; desktop keeps its four-scene preview. */
@media(min-width:761px) { .gallery-mobile-extra { display:none; } }
@media(max-width:760px) {
  .gallery-view-more { display:none; }
  .cottage-gallery-dots { gap:0; bottom:82px; }
  .cottage-gallery-dots button { width:20px; height:36px; }
  .cottage-gallery-dots button[hidden] { display:none; }
  .cottage-gallery-dots button.is-edge span { transform:scale(.6); opacity:.22; }
  .has-cottage-booking .cottage-gallery-dots { bottom:calc(166px + env(safe-area-inset-bottom)); }
  .cottage-gallery-scene .cottage-gallery-image { inset:0 0 48% 0; }
  .cottage-gallery-scene .cottage-gallery-copy { left:24px; right:24px; top:56%; }
}

@media(max-width:760px) {
  .cottage-gallery-open > span { display:none; }
  .cottage-gallery-dots,
  .has-cottage-booking .cottage-gallery-dots { top:calc(52% - 44px); bottom:auto; }
  .cottage-gallery-dots button { color:#fff; }
  .cottage-gallery-dots button span { opacity:.65; box-shadow:0 1px 4px rgba(0,0,0,.65); }
  .cottage-gallery-dots button.is-active span { opacity:1; }
  .cottage-gallery-dots button.is-edge span { opacity:.45; }
}

@media(max-width:760px) {
  .cottage-gallery-controls { display:none; }
}
