:root {
  --cream: #f5efe4;
  --olive: #5f6651;
  --clay: #b77753;
  --water: #7c9094;
  --ink: #34372f;
  --cream-foreground: #34372f;
  --olive-foreground: #ffffff;
  --clay-foreground: #ffffff;
  --water-foreground: #16272b;
  --surface: #fffcf6;
  --line: color-mix(in srgb, var(--ink) 20%, transparent);
  --space-1: clamp(.5rem, .42rem + .35vw, .75rem);
  --space-2: clamp(1rem, .8rem + .8vw, 1.5rem);
  --space-3: clamp(1.5rem, 1.1rem + 1.6vw, 2.75rem);
  --space-4: clamp(3rem, 2rem + 4vw, 6.5rem);
  --content: min(100% - 2rem, 75rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.55;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

button, .button {
  min-height: 44px;
  min-width: 44px;
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: var(--space-1);
  left: var(--space-1);
  padding: .6rem 1rem;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  color: #fff;
  background: var(--ink);
  overflow: hidden;
}

.hero > * { grid-area: 1 / 1; }

.hero__media {
  position: relative;
  height: 100%;
}

.hero__media::after {
  position: absolute;
  inset: 0;
  content: '';
  background:
    linear-gradient(90deg, rgb(0 0 0 / .62), rgb(0 0 0 / .22) 48%, rgb(0 0 0 / .1)),
    linear-gradient(0deg, rgb(0 0 0 / .38), transparent 55%);
}

.hero__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}

.hero__slide[data-active='true'] {
  opacity: 1;
  pointer-events: auto;
}

.hero__slide picture,
.hero__slide img,
.hero__slide video {
  width: 100%;
  height: 100%;
}

.hero__slide img,
.hero__slide video {
  object-fit: cover;
}

.hero__slide:nth-child(1) img { object-position: 45% 52%; }
.hero__slide:nth-child(2) img { object-position: 50% 50%; }
.hero__slide:nth-child(3) img { object-position: 38% 52%; }

.hero__slide--video {
  background:
    linear-gradient(rgb(0 0 0 / .2), rgb(0 0 0 / .2)),
    url('../images/hero-rio-1600.jpg') center / cover;
}

.hero__slide--video video {
  object-fit: contain;
  background: rgb(0 0 0 / .18);
}

.hero__content {
  position: relative;
  z-index: 1;
  align-self: end;
  width: var(--content);
  margin: 0 auto;
  padding: var(--space-4) 0 calc(var(--space-4) + 2.5rem);
  text-shadow: 0 2px 16px rgb(0 0 0 / .28);
}

.hero__controls {
  position: relative;
  z-index: 2;
  display: grid;
  align-self: stretch;
  pointer-events: none;
}

.hero__dots button {
  pointer-events: auto;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero__dots {
  align-self: end;
  justify-self: center;
  display: flex;
  gap: .55rem;
  padding-bottom: var(--space-2);
}

.hero__dots button {
  position: relative;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: transparent;
}

.hero__dots button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: .72rem;
  height: .72rem;
  border: 1px solid rgb(255 255 255 / .65);
  border-radius: 999px;
  content: '';
  background: rgb(0 0 0 / .24);
  transform: translate(-50%, -50%);
}

.hero__dots button[aria-current='true']::before {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.25);
}

.brand, h1, h2, h3 { line-height: 1.04; }

.brand { margin: 0; font-size: clamp(2.5rem, 7vw, 6.5rem); letter-spacing: .08em; }

h1 { max-width: 14ch; margin: var(--space-2) 0; font-size: clamp(2rem, 5vw, 4.5rem); }
h2 { max-width: 18ch; margin: 0 0 var(--space-2); font-size: clamp(2rem, 3.8vw, 3.75rem); }
h3 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 2rem); text-transform: capitalize; }

.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--olive);
  font-family: Arial, sans-serif;
  font-size: .78em;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #fff; }

.button, .calendar-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clay);
  border-radius: 0;
  padding: .6rem 1rem;
  background: var(--clay);
  color: var(--clay-foreground);
  cursor: pointer;
  text-decoration: none;
}

.button--secondary, .calendar-controls button { background: transparent; color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .45; }

.section { width: var(--content); margin: 0 auto; padding: var(--space-4) 0; }
.section--surface {
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface);
  clip-path: inset(0 -100vmax);
}
.section > p:not(.eyebrow) { max-width: 68ch; }
.contact { display: grid; gap: var(--space-1); }
.contact h2 { margin-bottom: 0; }
.contact__layout { display: grid; gap: var(--space-3); }
.contact__details { display: grid; align-content: start; justify-items: start; gap: var(--space-2); }
.contact__details > * { margin: 0; }
.contact__email { max-width: 100%; }
.contact__social-link { display: inline-flex; align-items: center; gap: .55rem; justify-self: start; }
.contact__social-icon { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.contact__social-icon-dot { fill: currentColor; stroke: none; }
.contact__airbnb { display: grid; justify-items: start; gap: var(--space-1); }
.contact__airbnb p { margin: 0; }
.contact__map { display: grid; align-content: start; gap: var(--space-1); min-width: 0; }
.contact__map iframe { width: 100%; min-height: 22rem; border: 0; }
.contact__map .button { justify-self: start; }
.contact__link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}
.contact__icon {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 999px;
  background: var(--clay);
  color: var(--clay-foreground);
  flex: 0 0 auto;
}
.contact__icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.gallery {
  outline-offset: .25rem;
}
.gallery__preview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(7rem, .72fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  height: clamp(20rem, 54vw, 36rem);
}
.gallery__preview-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--water);
  cursor: pointer;
}
.gallery__preview-item--main { grid-row: 1 / 3; }
.gallery__preview-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery__preview-item:hover img { transform: scale(1.018); }
.gallery__view-all {
  position: absolute;
  right: var(--space-1);
  bottom: var(--space-1);
  padding: .55rem .8rem;
  background: rgb(31 34 29 / .82);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .82em;
}
.gallery-lightbox {
  width: min(calc(100% - 2rem), 75rem);
  max-width: none;
  max-height: calc(100svh - 2rem);
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
}
.gallery-lightbox::backdrop { background: rgb(20 22 18 / .84); backdrop-filter: blur(4px); }
.gallery-lightbox__panel { display: grid; gap: var(--space-1); padding: var(--space-2); background: var(--ink); }
.gallery-lightbox__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.gallery-lightbox__header h3 { margin: 0; }
.gallery-lightbox__header .eyebrow { color: #fff; }
.gallery-lightbox__status { display: flex; align-items: center; gap: var(--space-1); font-family: Arial, sans-serif; }
.gallery-lightbox__status button,
.gallery-lightbox__arrow {
  border: 1px solid rgb(255 255 255 / .55);
  background: rgb(20 22 18 / .5);
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
}
.gallery-lightbox__stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-1); min-height: 0; }
.gallery-lightbox__track { min-width: 0; touch-action: pan-y; }
.gallery-lightbox__slide { margin: 0; }
.gallery-lightbox__slide[data-active='false'] { display: none; }
.gallery-lightbox__slide img { width: 100%; height: min(68svh, 46rem); object-fit: contain; }
.gallery-lightbox__slide figcaption { padding-top: var(--space-1); font-size: .9em; }

.calendar-controls { display: flex; justify-content: space-between; gap: var(--space-1); margin-bottom: var(--space-2); }
.calendar-months { display: grid; gap: var(--space-3); }
.calendar-month { min-width: 0; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-top: var(--space-2); color: var(--olive); font-family: Arial, sans-serif; font-size: .75em; font-weight: 700; text-align: center; }
.calendar-days { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: Arial, sans-serif;
  font-size: .84em;
}
.calendar-day--available { background: #edf0e8; }
.calendar-day--booking { background: var(--clay); color: var(--clay-foreground); }
.calendar-day--blocked { background: var(--water); color: var(--water-foreground); }
.calendar-day--past, .calendar-day--outside { color: color-mix(in srgb, var(--ink) 45%, transparent); }
.calendar-day--outside { background: color-mix(in srgb, var(--cream) 70%, transparent); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); padding: 0; list-style: none; font-family: Arial, sans-serif; font-size: .85em; }
.calendar-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.calendar-legend__swatch {
  width: .9rem;
  height: .9rem;
  border: 1px solid var(--line);
}
.calendar-legend__swatch--available { background: #edf0e8; }
.calendar-legend__swatch--booking { background: var(--clay); }
.calendar-legend__swatch--blocked { background: var(--water); }
.availability__error { padding: var(--space-2); background: #f5ded2; }

footer { padding: var(--space-3) 1rem; background: var(--ink); color: #fff; text-align: center; }
footer p { margin: 0; }

@media (min-width: 768px) {
  .contact__layout { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; }
  .calendar-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .hero { min-height: min(42rem, 100svh); }
  .hero__media::after {
    background:
      linear-gradient(0deg, rgb(0 0 0 / .66), rgb(0 0 0 / .18) 58%, rgb(0 0 0 / .08)),
      linear-gradient(90deg, rgb(0 0 0 / .36), transparent 65%);
  }
  .hero__content { padding-bottom: calc(var(--space-4) + 2rem); }
  .gallery__preview { grid-template-columns: minmax(0, 1.55fr) minmax(5.5rem, .72fr); height: clamp(16rem, 84vw, 25rem); }
  .gallery-lightbox__panel { padding: var(--space-1); }
  .gallery-lightbox__stage { position: relative; display: block; }
  .gallery-lightbox__slide img { height: auto; max-height: calc(100svh - 10rem); }
  .gallery-lightbox__arrow { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
  .gallery-lightbox__arrow--previous { left: .35rem; }
  .gallery-lightbox__arrow--next { right: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
