/* Last Sea Resort · motion
 *
 * One place for everything that moves. The values are Animate UI's motion tokens
 * (https://animate-ui.com — springs, curves, scales, blur) written as plain CSS, so the
 * page needs no animation library:
 *   · springs for what moves (press, entrances, the nav indicator, the menu highlight)
 *   · ease-out for what enters and leaves, a softer ease-out for what unfolds or slides in
 *   · only transform-type properties, opacity and filter animate (the FAQ's height excepted)
 *   · hover effects only on devices that can hover; reduced motion keeps fades, drops travel
 */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);          /* enters or leaves */
  --ease-soft: cubic-bezier(0.215, 0.61, 0.355, 1);    /* unfolds, dims the page, a menu opens */
  --ease-leave: cubic-bezier(0, 0, 0.58, 1);           /* fades out to make way */
  --ease-color: cubic-bezier(0.25, 0.1, 0.25, 1);      /* a color changing */
  --ease-away: cubic-bezier(0.33, 0.17, 0.67, 0.5);    /* dismissed, speeding away */
  --ease-fill: cubic-bezier(0.4, 0, 0.2, 1);           /* a fill growing in */

  --t-color: 200ms var(--ease-color);
  --t-fade: 200ms var(--ease-out);
  --t-swap: 150ms var(--ease-out);
  --t-reveal: 300ms var(--ease-out);
  --t-menu: 220ms var(--ease-soft);
  --t-disclosure: 350ms var(--ease-soft);
  --t-overlay: 400ms var(--ease-soft);
  --t-sheet: 400ms var(--ease-soft);
  --t-dismiss: 200ms var(--ease-away);
  --t-fill: 300ms var(--ease-fill);

  /* Springs. Browsers without linear() get a close cubic-bezier instead. */
  --spring-press: 240ms cubic-bezier(0.3, 1.4, 0.5, 1);
  --spring-entrance: 450ms cubic-bezier(0.2, 1.2, 0.3, 1);
  --spring-dialog: 500ms cubic-bezier(0.16, 1, 0.3, 1);
  --spring-highlight: 250ms cubic-bezier(0.2, 1, 0.3, 1);
  --spring-selection: 380ms cubic-bezier(0.2, 1, 0.3, 1);

  --scale-press: 0.97;     /* a button pressed */
  --scale-choice: 0.985;   /* a whole card pressed */
  --zoom: 1.05;            /* an image inside its card, hovered */
  --lift: -2px;            /* a clickable card, hovered */
  --rise: 16px;            /* content coming in on scroll */
  --icon-from: 0.5;        /* an icon swapping for another */
  --fill-from: 0.7;        /* a selected fill growing in */
  --menu-from: scale(0.9);
  --dialog-from: perspective(500px) rotateX(-20deg) scale(0.8);
  --sheet-from: 0 -100%;
  --row-from: 8px 0;
  --value-shift: 6px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-press: 400ms linear(0, 0.0261, 0.0935, 0.188, 0.2977, 0.4132, 0.5271, 0.6343, 0.7313, 0.8159, 0.8872, 0.9452, 0.9906, 1.0244, 1.048, 1.063, 1.0709, 1.0732, 1.0713, 1.0663, 1.0594, 1.0514, 1.0429, 1.0346, 1.0267, 1.0196, 1.0134, 1.0082, 1.004, 1.0007, 0.9982, 0.9965, 1, 0.9948, 0.9946, 0.9948, 1, 1, 1, 1);
    --spring-entrance: 600ms linear(0, 0.0097, 0.036, 0.0756, 0.1251, 0.1819, 0.2435, 0.3079, 0.3734, 0.4385, 0.5021, 0.5634, 0.6215, 0.676, 0.7265, 0.7728, 0.8149, 0.8526, 0.8862, 0.9157, 0.9414, 0.9634, 0.9821, 0.9977, 1.0104, 1.0206, 1.0285, 1.0345, 1.0387, 1.0414, 1.0428, 1.0432, 1.0427, 1.0415, 1.0397, 1.0376, 1.0351, 1.0324, 1.0296, 1.0268, 1.024, 1.0212, 1.0186, 1.0161, 1.0138, 1.0116, 1.0096, 1.0078, 1.0062, 1.0048, 1.0035, 1.0024, 1.0015, 1.0007, 1, 0.9995, 0.9991, 0.9987, 0.9985, 1);
    --spring-dialog: 750ms linear(0, 0.0071, 0.0261, 0.0541, 0.0886, 0.1279, 0.1702, 0.2143, 0.2592, 0.3041, 0.3485, 0.3918, 0.4336, 0.4738, 0.5121, 0.5485, 0.5829, 0.6153, 0.6456, 0.674, 0.7004, 0.725, 0.7479, 0.769, 0.7886, 0.8066, 0.8233, 0.8386, 0.8527, 0.8656, 0.8775, 0.8884, 0.8983, 0.9074, 0.9158, 0.9234, 0.9303, 0.9367, 0.9424, 0.9477, 0.9525, 0.9569, 0.9609, 0.9645, 0.9678, 0.9708, 0.9735, 0.976, 0.9782, 0.9803, 0.9821, 0.9838, 0.9853, 0.9867, 0.9879, 0.9891, 0.9901, 0.9911, 0.9919, 0.9927, 0.9934, 0.994, 0.9946, 0.9951, 0.9955, 0.996, 0.9964, 0.9967, 0.997, 0.9973, 0.9976, 0.9978, 1, 1, 1);
    --spring-highlight: 300ms linear(0, 0.0233, 0.0813, 0.1598, 0.2483, 0.3396, 0.4288, 0.5126, 0.5894, 0.658, 0.7183, 0.7704, 0.8149, 0.8524, 0.8837, 0.9094, 0.9303, 0.9472, 0.9607, 0.9713, 0.9796, 0.986, 0.9908, 0.9944, 0.997, 0.9988, 1.0001, 1.001, 1.0015, 1);
    --spring-selection: 500ms linear(0, 0.0141, 0.0509, 0.1035, 0.1663, 0.2349, 0.306, 0.3769, 0.4459, 0.5115, 0.573, 0.6297, 0.6814, 0.728, 0.7696, 0.8064, 0.8387, 0.8668, 0.8911, 0.9119, 0.9296, 0.9445, 0.957, 0.9673, 0.9758, 0.9827, 0.9882, 0.9926, 0.9961, 0.9987, 1.0007, 1.0021, 1.0031, 1.0038, 1.0041, 1, 1, 1, 1.004, 1.0038, 1.0035, 1.0032, 1.0029, 1.0026, 1.0023, 1.002, 1.0017, 1.0015, 1, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --scale-press: 1; --scale-choice: 1; --zoom: 1; --lift: 0px; --rise: 0px;
    --icon-from: 1; --fill-from: 1; --menu-from: none; --dialog-from: none;
    --sheet-from: 0 0; --row-from: 0 0; --value-shift: 0px;
  }
  html { scroll-behavior: auto; }
}

/* ── Color feedback: named properties, never "all" ──────────────────────── */
a { transition: color var(--t-color), background-color var(--t-color), border-color var(--t-color), box-shadow var(--t-color); }
.faq-question { transition: color var(--t-color); }
.info-card, .promo-card, .activity-card, .banner-dot { transition: none; }

/* ── Press: 0.97 on a spring, and nothing scales on hover ───────────────── */
.hero-btn, .nav-book, .btn-outline, .room-filter, .f-btn, .btn-modal-book, .btn-modal-close, .booking-copy,
.gallery-more button, .real-reviews a, .room-back-btn, .lang-switcher, .hamburger, .banner-arrow, .modal-arrow,
.lb-close, .lb-prev, .lb-next, .room-thumb {
  transition: scale var(--spring-press), color var(--t-color), background-color var(--t-color),
    border-color var(--t-color), box-shadow var(--t-color), opacity var(--t-color);
}
:is(.hero-btn, .nav-book, .btn-outline, .room-filter, .f-btn, .btn-modal-book, .btn-modal-close, .booking-copy,
.gallery-more button, .real-reviews a, .room-back-btn, .lang-switcher, .hamburger, .banner-arrow, .modal-arrow,
.lb-close, .lb-prev, .lb-next, .room-thumb):active { scale: var(--scale-press); }

/* ── Clickable cards: lighter press, a small lift and an image zoom on hover ─ */
.room-card, .contact-card, .gallery-item {
  transition: translate var(--spring-highlight), scale var(--spring-press), box-shadow var(--t-color);
}
.room-img-box img, .gallery-item img { transition: scale 300ms var(--ease-out); }
:is(.room-card, .contact-card, .gallery-item):active { scale: var(--scale-choice); }
.room-card:has(.btn-outline:active) { scale: 1; }
.gallery-item:focus-visible img { scale: var(--zoom); }
@media (hover: hover) and (pointer: fine) {
  .room-card:hover, .contact-card:hover { translate: 0 var(--lift); box-shadow: var(--shadow-md); }
  .gallery-item:hover { box-shadow: var(--shadow-md); }
  .room-card:hover .room-img-box img, .gallery-item:hover img { scale: var(--zoom); }
  .room-filter[aria-pressed="false"]:hover { background: #f1f6f1; border-color: #c6d8cc; color: var(--primary); }
}

/* ── Content coming in on scroll: fade, a short rise, out of a light blur ── */
.reveal { opacity: 0; translate: 0 var(--rise); filter: blur(var(--reveal-blur, 4px)); }
.reveal:not(.is-visible) { transition: none; }
.reveal.is-visible {
  opacity: 1; translate: 0 0; filter: blur(0px);
  transition: opacity var(--t-reveal) var(--reveal-delay, 0ms),
    translate var(--spring-entrance) var(--reveal-delay, 0ms),
    filter var(--t-reveal) var(--reveal-delay, 0ms);
}
.section-header.reveal { --reveal-blur: 2px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
/* One underline gliding between the nav links instead of one appearing per link. */
.nav-indicator { display: none; }
@media (min-width: 901px) {
  .nav-menu { position: relative; }
  .nav-menu.has-indicator a.is-active::after { display: none; }
  .nav-indicator {
    display: block; position: absolute; top: 0; left: 0; width: 100px; height: 2px; border-radius: 2px;
    background: var(--accent); pointer-events: none; opacity: 0; transform-origin: 0 50%;
    transform: translate(var(--x, 0px), var(--y, 0px)) scaleX(var(--w, 1));
    transition: transform var(--spring-selection), opacity var(--t-color);
  }
  .nav-indicator.is-shown { opacity: 1; }
}
/* The mobile menu is a sheet held against the header: it slides out from under its edge and fades.
   The <nav> around it is a window below the header, so the part still above that edge never shows. */
@media (max-width: 900px) {
  header nav { position: fixed; top: 68px; left: 0; right: 0; height: calc(100vh - 68px); height: calc(100dvh - 68px); overflow: hidden; pointer-events: none; }
  .nav-menu {
    position: absolute; top: 0;
    translate: var(--sheet-from); opacity: 0; visibility: hidden; pointer-events: none;
    transition: translate var(--t-dismiss), opacity var(--t-dismiss), visibility 0s linear 200ms;
  }
  .nav-menu.active {
    translate: 0 0; opacity: 1; visibility: visible; pointer-events: auto;
    transition: translate var(--t-sheet), opacity var(--t-sheet), visibility 0s;
  }
}
/* Menu and close icons swap in place through a light blur. */
.hamburger i { transition: opacity var(--t-swap), scale var(--t-swap), filter var(--t-swap); }
.hamburger .fa-times, .hamburger[aria-expanded="true"] .fa-bars { opacity: 0; scale: var(--icon-from); filter: blur(2px); }
.hamburger[aria-expanded="true"] .fa-times { opacity: 1; scale: 1; filter: blur(0px); }

/* ── Language menu: grows from its button, rows follow one another ──────── */
.lang-menu {
  transform-origin: calc(100% - 32px) 0; opacity: 0; transform: var(--menu-from); visibility: hidden;
  transition: opacity var(--t-menu), transform var(--t-menu), visibility 0s linear 220ms;
}
.lang-select.is-open .lang-menu {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity var(--t-menu), transform var(--t-menu), visibility 0s;
}
.lang-option {
  opacity: 0; translate: var(--row-from); filter: blur(4px);
  transition: opacity 0s linear 220ms, translate 0s linear 220ms, filter 0s linear 220ms, color var(--t-color);
}
.lang-select.is-open .lang-option {
  opacity: 1; translate: 0 0; filter: blur(0px);
  transition: opacity 300ms var(--ease-soft) calc(var(--i) * 33ms), translate 300ms var(--ease-soft) calc(var(--i) * 33ms),
    filter 300ms var(--ease-soft) calc(var(--i) * 33ms), color var(--t-color);
}
.lang-option .fa-check { transition: opacity var(--t-swap); }
.lang-hl {
  opacity: 0; translate: 0 calc(var(--hl, 0) * 40px);
  transition: translate var(--spring-highlight), opacity var(--t-color);
}
.lang-menu.has-hl .lang-hl { opacity: 1; }
.lang-caret { transition: rotate var(--t-menu); }
.lang-select.is-open .lang-caret { rotate: 180deg; }
:is(#langLabel, #langFlag).is-swapping { animation: value-in 400ms var(--ease-soft); }
@keyframes value-in { from { opacity: 0; translate: 0 var(--value-shift); filter: blur(4px); } }

/* ── Hero slides ────────────────────────────────────────────────────────── */
/* The active dot widens by uncovering a pill (clip-path) rather than resizing a box. */
.banner-dot::before, .banner-dot.active::before { left: 3px; width: 18px; border-radius: 4px; }
.banner-dot::before { clip-path: inset(0 5px round 4px); transition: clip-path var(--spring-selection), background-color var(--t-color); }
.banner-dot.active::before { clip-path: inset(0 0 round 4px); }

/* ── Room filters: the selected fill grows in from its center ───────────── */
.room-filter { position: relative; isolation: isolate; }
.room-filter::before {
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--primary);
  opacity: 0; scale: var(--fill-from); transition: opacity var(--t-fill), scale var(--t-fill);
}
.room-filter[aria-pressed="true"]::before { opacity: 1; scale: 1; }

/* ── FAQ: the panel unfolds to its real height while its text clears ────── */
.faq-answer {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows var(--t-disclosure), visibility 0s linear 350ms;
}
.faq-answer-inner {
  min-height: 0; overflow: hidden; opacity: 0; filter: blur(2px);
  transition: opacity var(--t-disclosure), filter var(--t-disclosure);
}
.faq-item.open .faq-answer { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--t-disclosure), visibility 0s; }
.faq-item.open .faq-answer-inner { opacity: 1; filter: blur(0px); }
.faq-question i { transition: rotate var(--t-disclosure); }
.faq-item.open .faq-question i { rotate: 180deg; }

/* ── Gallery ────────────────────────────────────────────────────────────── */
#galleryMore i { transition: rotate var(--t-disclosure); }
#galleryMore[aria-expanded="true"] i { rotate: 180deg; }
/* Photo viewer: the backdrop's color comes in from nothing, the photo tips upright;
   closed, both leave at once and quicker. Browsers without @starting-style open it at once. */
.gallery-lightbox { background-color: transparent; transition: background-color 200ms var(--ease-soft); }
.gallery-lightbox { transition: background-color 200ms var(--ease-soft), display 200ms allow-discrete, overlay 200ms allow-discrete; }
.gallery-lightbox[open] { background-color: rgba(12, 26, 23, .94); transition: background-color var(--t-overlay); }
.gallery-lightbox[open] { transition: background-color var(--t-overlay), display 400ms allow-discrete, overlay 400ms allow-discrete; }
.gallery-lightbox img {
  opacity: 0; transform: var(--dialog-from); filter: blur(4px);
  transition: transform var(--t-dismiss), filter var(--t-dismiss), opacity var(--t-dismiss);
}
.gallery-lightbox[open] img {
  opacity: 1; transform: none; filter: none;
  transition: transform var(--spring-dialog), filter var(--spring-dialog), opacity var(--t-overlay);
}
.gallery-lightbox :is(.lb-close, .lb-prev, .lb-next, .lb-count) { opacity: 0; }
.gallery-lightbox[open] :is(.lb-close, .lb-prev, .lb-next, .lb-count) { opacity: 1; }
.lb-count { transition: opacity var(--t-color); }
@starting-style {
  .gallery-lightbox[open] { background-color: transparent; }
  .gallery-lightbox[open] img { opacity: 0; transform: var(--dialog-from); filter: blur(4px); }
  .gallery-lightbox[open] :is(.lb-close, .lb-prev, .lb-next, .lb-count) { opacity: 0; }
}

/* ── Page changes (room detail ↔ landing, language): a short cross-fade ─── */
html[data-vt]::view-transition-old(root) { animation-duration: 150ms; animation-timing-function: var(--ease-leave); }
html[data-vt]::view-transition-new(root) { animation-duration: 300ms; animation-timing-function: var(--ease-out); }
html[data-vt="lang"]::view-transition-old(root), html[data-vt="lang"]::view-transition-new(root) { animation-duration: 200ms; }
html.no-vt .room-page.active { animation: page-in 300ms var(--ease-out); }
@keyframes page-in { from { opacity: 0; } }

/* ── Reduced motion: things still appear and change, nothing travels ────── */
@media (prefers-reduced-motion: reduce) {
  .banner-slide, .banner-slide.active { transform: none; transition: opacity 1.3s ease; }
  .faq-answer { transition: visibility 0s linear 350ms; }
  .faq-item.open .faq-answer { transition: visibility 0s; }
  .faq-question i, #galleryMore i, .lang-caret { transition: none; }
  .banner-dot::before { transition: background-color var(--t-color); }
  .nav-indicator, .lang-hl { transition: opacity var(--t-color); }
}
