/* ============================================================
   Recanta Primavera — Polish layer
   Applied on top of site.css. Purely additive + overrides.
   ============================================================ */

/* ---- Scroll progress bar ---- */
.rp-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    var(--accent-deep) 100%);
  z-index: 900;
  transition: width 0.08s linear;
  pointer-events: none;
  will-change: width;
}

/* ---- Page-load fade-in handled by reveal observers below ---- */

/* ---- Entrance animations (IntersectionObserver-driven) ---- */
[data-rp-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s cubic-bezier(.2, .7, .2, 1),
    transform 0.9s cubic-bezier(.2, .7, .2, 1);
  will-change: opacity, transform;
}
[data-rp-reveal].rp-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-rp-reveal="fade"] {
  transform: none;
}
[data-rp-reveal="slow"] {
  transition-duration: 1.3s;
}
@media (prefers-reduced-motion: reduce) {
  [data-rp-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Stagger children when parent has data-rp-stagger */
[data-rp-stagger] > * { transition-delay: 0s; }
[data-rp-stagger].rp-visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-rp-stagger].rp-visible > *:nth-child(2) { transition-delay: 0.15s; }
[data-rp-stagger].rp-visible > *:nth-child(3) { transition-delay: 0.25s; }
[data-rp-stagger].rp-visible > *:nth-child(4) { transition-delay: 0.35s; }
[data-rp-stagger].rp-visible > *:nth-child(5) { transition-delay: 0.45s; }
[data-rp-stagger].rp-visible > *:nth-child(6) { transition-delay: 0.55s; }

/* ---- Hero: ken-burns, parallax, subtle vignette ---- */
.hero .hero-photo-inner {
  animation: rp-kenburns 22s ease-out infinite alternate;
  transform-origin: center 45%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
@keyframes rp-kenburns {
  0%   { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.10) translate3d(-1.5%, -1%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero .hero-photo-inner { animation: none; }
}

/* Extra vignette depth on hero for legibility */
.hero::after {
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(12,11,9,0.35) 100%),
    linear-gradient(180deg, rgba(12,11,9,0.28) 0%, transparent 30%, transparent 60%, rgba(12,11,9,0.45) 100%);
}

/* Hero stamp — subtle float */
.hero .stamp {
  animation: rp-stamp-float 12s ease-in-out infinite;
}
@keyframes rp-stamp-float {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50%      { transform: translate(-50%, -52%) rotate(0.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero .stamp { animation: none; }
}

/* ---- Hero title: static, no animation ---- */

/* ---- Gallery tiles: refined hover ---- */
.gallery-grid .g {
  overflow: hidden;
  position: relative;
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1);
  background-size: cover;
  background-position: center;
  will-change: transform;
}
.gallery-grid .g::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s cubic-bezier(.2, .7, .2, 1),
              filter 0.7s ease;
  will-change: transform;
  pointer-events: none;
}
/* Hover state — gentle zoom + faint warm wash */
@media (hover: hover) {
  .gallery-grid .g { cursor: zoom-in; }
  .gallery-grid .g::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
      rgba(0,0,0,0) 50%,
      rgba(20,15,10,0.35) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
  }
  .gallery-grid .g:hover::before { opacity: 1; }
  .gallery-grid .g:hover {
    transform: translateY(-3px);
  }
  .gallery-grid .g:hover::after {
    transform: scale(1.045);
  }
  /* Zoom icon */
  .gallery-grid .g .zoom-hint {
    position: absolute;
    bottom: 14px; right: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,245,230, 0.95);
    color: var(--ink);
    display: grid; place-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 2;
    pointer-events: none;
  }
  .gallery-grid .g:hover .zoom-hint {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Filter tabs: underline micro-animation ---- */
.filter-btn {
  position: relative;
  transition: color 0.25s ease;
}
.filter-btn::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(.2, .7, .2, 1);
}
.filter-btn.active::after,
.filter-btn:hover::after {
  transform: scaleX(1);
}
.filter-btn.active { border-bottom-color: transparent !important; }

/* ---- Buttons: refined hover ---- */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s cubic-bezier(.2, .7, .2, 1),
    box-shadow 0.3s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); transition-duration: 0.1s; }

.btn-primary {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 6px 16px rgba(0,0,0,0.12);
}
.btn-primary:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 10px 24px rgba(0,0,0,0.18);
}

/* Ghost button: animated underline sweep */
.btn-ghost {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s cubic-bezier(.2, .7, .2, 1),
              color 0.3s ease;
}
.btn-ghost:hover {
  background-size: 100% 1px;
  color: var(--accent-ink);
}

/* ---- Book-CTA in header: glow on scroll ---- */
.site-header .book-cta {
  transition: background 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.site-header .book-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* ---- Header: subtle elevation after scroll ---- */
.site-header {
  transition: background 0.35s ease, box-shadow 0.35s ease,
              backdrop-filter 0.35s ease;
}
.site-header.scrolled {
  /* Fully opaque fallback for iOS versions where backdrop-filter
     causes transparent-header rendering bugs */
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(31,29,26,0.08);
}
@supports (-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px)) {
  .site-header.scrolled {
    background: rgba(250, 246, 239, 0.92);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    backdrop-filter: saturate(140%) blur(12px);
  }
}

/* ---- Link underline polish ---- */
.prose a,
a.inline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: color 0.3s ease, background-size 0.4s cubic-bezier(.2,.7,.2,1);
  color: inherit;
  text-decoration: none;
}
.prose a:hover,
a.inline:hover {
  color: var(--accent-ink);
}

/* ---- Typography refinement ---- */
.display,
.hero-title,
h1, h2, h3 {
  text-wrap: balance;
  font-feature-settings: "kern" 1, "liga" 1, "dlig" 1;
}
/* Hero title: editorial two-line treatment — primary line bold uppercase,
   second line italic, smaller, lowercase-styled for rhythm. */
.hero-title {
  text-shadow: 0 2px 40px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
}
.hero-title .sm {
  display: block;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.62em;
  margin-top: 0.15em;
  opacity: 0.95;
}

/* ---- Editorial hero refinement ---- */
.hero-title--editorial {
  text-transform: none !important;
  font-weight: 400;
  letter-spacing: 0.005em !important;
  font-size: clamp(44px, 6.4vw, 88px) !important;
  line-height: 1.04 !important;
  text-wrap: nowrap !important;
  white-space: nowrap;
  font-feature-settings: "kern" 1, "liga" 1, "dlig" 1, "swsh" 1;
}
.hero-title--editorial .sm {
  font-size: 0.92em;
  font-style: italic;
  letter-spacing: 0.005em;
  margin-top: 0.04em;
  opacity: 1;
  color: rgba(255,255,255,0.96);
  white-space: nowrap;
}
@media (max-width: 680px) {
  .hero-title--editorial {
    font-size: clamp(34px, 8.5vw, 50px) !important;
    line-height: 1.08 !important;
    white-space: normal;
    text-wrap: balance !important;
  }
  .hero-title--editorial .sm { white-space: normal; }
}

/* Ornament above hero title */
.hero .hero-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}
.hero .hero-flourish .line {
  display: block;
  width: 56px;
  height: 1px;
  background: rgba(255,255,255,0.55);
}
.hero .hero-flourish .sym {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
  font-style: italic;
  transform: translateY(-1px);
}
@media (max-width: 680px) {
  .hero .hero-flourish { margin-bottom: 16px; gap: 10px; }
  .hero .hero-flourish .line { width: 40px; }
}

/* Sub line: refined dot/slash separators */
.hero-sub {
  white-space: nowrap;
}
.hero-sub .dot,
.hero-sub .slash {
  display: inline-block;
  margin: 0 0.55em;
  opacity: 0.55;
  font-weight: 400;
  transform: translateY(-0.5px);
}
.hero-sub .slash {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.15em;
  margin: 0 0.35em;
  letter-spacing: 0;
  opacity: 0.7;
}
@media (max-width: 720px) {
  .hero-sub {
    white-space: normal;
    text-wrap: balance;
  }
  .hero-sub .dot, .hero-sub .slash { margin: 0 0.4em; }
}
.prose p,
.lede {
  text-wrap: pretty;
  font-feature-settings: "kern" 1, "liga" 1;
  hanging-punctuation: first;
}

/* Optional drop cap for prose sections */
.prose.drop-cap > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4em;
  line-height: 0.95;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--accent-ink);
  font-weight: 500;
}

/* ---- Section dividers that breathe ---- */
.ornament {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1s ease, transform 1s ease;
}
.ornament.rp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Sticky mobile CTA bar ---- */
.rp-sticky-cta {
  position: fixed;
  left: 16px; right: 16px;
  bottom: 16px;
  z-index: 800;
  display: none;
  transform: translateY(140%);
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1);
}
.rp-sticky-cta.visible {
  transform: translateY(0);
}
.rp-sticky-cta a {
  display: block;
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.3px;
  text-transform: uppercase;
  padding: 18px 22px;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.rp-sticky-cta a:active {
  transform: scale(0.98);
}
@media (max-width: 720px) {
  .rp-sticky-cta { display: block; }
  /* push footer above sticky */
  .site-footer { padding-bottom: 100px; }
}
/* Hide sticky CTA on the bookings page itself */
body[data-screen-label="Bookings"] .rp-sticky-cta { display: none; }

/* ---- Focus visible ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible {
  outline-offset: 4px;
}

/* ---- Lightbox grab cursor when zoomed ---- */
.rp-lb-slide.zoomed img { cursor: grab; }
.rp-lb-slide.zoomed img:active { cursor: grabbing; }

/* ---- Image lazy fade-in on load ---- */
img {
  transition: opacity 0.6s ease;
}

/* Smooth anchor scroll */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---- Selection ---- */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ---- Collage images: subtle parallax on scroll ---- */
.collage [data-img],
.collage img {
  will-change: transform;
  transition: transform 0.6s ease-out;
}

/* ---- FAQ accordion polish (if present) ---- */
details {
  transition: border-color 0.3s ease;
}
details[open] summary {
  color: var(--accent-ink);
}
details summary {
  transition: color 0.3s ease;
  cursor: pointer;
}

/* ---- Visible while Tweaks is open: pulse hint ---- */
.tweaks.open {
  animation: rp-tweaks-in 0.35s ease-out;
}
@keyframes rp-tweaks-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
