/* Cabo All Inclusive — luxury Cabo editorial */
:root {
  --ink: #10161a;
  --ink-soft: #2a3338;
  --mute: #6a7378;
  --line: #ddd8cf;
  --paper: #faf8f4;
  --wash: #f1eee7;
  --sand: #b9a78a;
  --deep: #0c1216;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: Manrope, system-ui, sans-serif;
  --header-h: 4.25rem;
  --pad-x: clamp(1.25rem, 4vw, 3.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding: 0.75rem var(--pad-x);
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: transparent;
  color: #faf8f4;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-solid {
  background: rgba(250, 248, 244, 0.96);
  color: var(--ink);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1.35rem);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(250, 248, 244, 0.4);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(250, 248, 244, 0.75);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font: inherit;
}

.lang-toggle button.is-active {
  background: #faf8f4;
  color: var(--deep);
}

.site-header.is-solid .lang-toggle {
  border-color: var(--line);
}

.site-header.is-solid .lang-toggle button {
  color: var(--mute);
}

.site-header.is-solid .lang-toggle button.is-active {
  background: var(--ink);
  color: #fff;
}

.nav-link {
  opacity: 0.88;
}

.nav-link:hover {
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: 500 0.82rem/1.2 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  background: #faf8f4;
  color: var(--deep);
  border-color: #faf8f4;
}

.btn.primary:hover {
  background: #fff;
}

.btn.ghost {
  border-color: rgba(250, 248, 244, 0.45);
  color: #faf8f4;
}

.btn.ink {
  border-color: var(--ink);
  color: var(--ink);
}

.btn.ink.primary {
  background: var(--ink);
  color: #faf8f4;
  border-color: var(--ink);
}

.site-header.is-solid .btn.ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.site-header.is-solid .btn.primary {
  background: var(--ink);
  color: #faf8f4;
  border-color: var(--ink);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(5.5rem + env(safe-area-inset-top)) var(--pad-x) clamp(2.5rem, 6vh, 4rem);
  color: #faf8f4;
  background:
    linear-gradient(180deg, rgba(12, 18, 22, 0.18) 0%, rgba(12, 18, 22, 0.42) 40%, rgba(12, 18, 22, 0.92) 100%),
    url("https://palmilla.caboluxurystays.com/media/concierge/casa-mariposa-view.jpg") center 48% / cover no-repeat;
  animation: hero-rise 1.15s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  max-width: 12ch;
  text-wrap: balance;
}

.hero-lede {
  margin: 0;
  max-width: 36ch;
  color: rgba(250, 248, 244, 0.82);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

/* —— Intro —— */
.intro {
  padding: clamp(3rem, 7vh, 4.5rem) var(--pad-x);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem 3rem;
  align-items: end;
  max-width: 1100px;
}

.kicker {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.intro h2,
.chapter-head h2,
.villas h2,
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 0.65rem;
}

.intro h2 {
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  max-width: 16ch;
}

.lede {
  margin: 0;
  color: var(--mute);
  max-width: 42ch;
  text-wrap: pretty;
}

.intro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.intro-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.intro-stats div span {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

/* —— Chapter nav —— */
.chapter-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  padding: 0.65rem var(--pad-x);
  background: rgba(250, 248, 244, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.chapter-nav-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.1rem 0;
}

.chapter-nav-scroll::-webkit-scrollbar {
  display: none;
}

.chapter-chip {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  min-height: 2.5rem;
  font: 500 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}

.chapter-chip:hover,
.chapter-chip.is-active {
  background: var(--ink);
  color: #faf8f4;
  border-color: var(--ink);
}

/* —— Chapters —— */
.chapter {
  padding: clamp(2.75rem, 6vh, 4rem) var(--pad-x) 1.5rem;
  scroll-margin-top: calc(var(--header-h) + 3.5rem);
}

.chapter:nth-child(even) {
  background: var(--wash);
}

.chapter-head {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

.chapter-head h2 {
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  max-width: 18ch;
}

.chapter-meta {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--mute);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 1.15rem;
}

.item {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  width: 100%;
  animation: item-in 0.7s ease both;
}

.item-media {
  aspect-ratio: 4 / 3;
  background: var(--wash) center / cover no-repeat;
  transition: transform 0.7s ease;
}

.item:hover .item-media {
  transform: scale(1.025);
}

.item-copy {
  padding: 0.95rem 0 0;
}

.item-copy h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  text-wrap: balance;
}

.item-copy p {
  margin: 0;
  color: var(--mute);
  font-size: 0.92rem;
  line-height: 1.45;
  text-wrap: pretty;
}

/* —— Drawer —— */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  padding: 0;
  background: rgba(12, 18, 22, 0.48);
  cursor: pointer;
}

.drawer {
  position: fixed;
  inset: auto 0 0;
  z-index: 41;
  max-height: min(88dvh, 740px);
  overflow: auto;
  background: var(--paper);
  box-shadow: 0 -16px 48px rgba(12, 18, 22, 0.18);
  outline: none;
  animation: drawer-up 0.35s ease both;
}

.drawer-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: rgba(250, 248, 244, 0.94);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.drawer-media {
  height: min(32dvh, 240px);
  background: var(--wash) center / cover no-repeat;
}

.drawer-body {
  padding: 1.25rem 1.35rem 1.75rem;
}

.drawer-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  margin: 0 0 0.65rem;
  text-wrap: balance;
}

.drawer-body p {
  margin: 0;
  color: var(--mute);
  line-height: 1.55;
  text-wrap: pretty;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

body.is-locked {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* —— Villas + CTA —— */
.villas {
  padding: clamp(3rem, 7vh, 4.5rem) var(--pad-x);
  background: var(--deep);
  color: #faf8f4;
}

.villas .kicker {
  color: rgba(250, 248, 244, 0.55);
}

.villas h2 {
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  max-width: 14ch;
}

.villas .lede {
  color: rgba(250, 248, 244, 0.72);
  margin-bottom: 1.35rem;
}

.cta-band {
  padding: clamp(2.75rem, 6vh, 4rem) var(--pad-x);
  background: var(--wash);
}

.cta-band h2 {
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  max-width: 16ch;
}

.cta-band .lede {
  margin-bottom: 1.25rem;
}

.site-footer {
  padding: 1.5rem var(--pad-x) calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--mute);
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawer-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .drawer {
    inset: 0 0 0 auto;
    width: min(440px, 100%);
    max-height: none;
    height: 100dvh;
    box-shadow: -16px 0 48px rgba(12, 18, 22, 0.18);
  }
}

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header .nav-secondary {
    display: none;
  }
  .hero {
    min-height: min(90dvh, 760px);
    padding: calc(4.5rem + env(safe-area-inset-top)) 1.1rem 2rem;
  }
  .item-grid {
    grid-template-columns: 1fr;
  }
  .chapter-nav {
    top: calc(var(--header-h) - 0.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .item,
  .item-media,
  .drawer {
    animation: none !important;
    transition: none !important;
  }
}
