:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #2b2a28;
  --muted: #6f6a63;
  --accent: #b5683b;
  --accent-rgb: 181,104,59;
  --border: #e7e2da;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 24px rgba(0,0,0,.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --surface: #252320;
    --text: #eeeae4;
    --muted: #a8a197;
    --accent: #e0925f;
    --accent-rgb: 224,146,95;
    --border: #3a3733;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2 { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-weight: 560; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-size: 1.7rem; margin: 0 0 1rem; }

a { transition: color .15s ease; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.hero {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding: 2rem 0;
  background: #3d3a36 center / cover no-repeat;
  color: #fff;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 60%);
}
.lang-switch {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,.35);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(4px);
}
.lang-switch button {
  font: 600 .8rem/1 system-ui, sans-serif;
  letter-spacing: .05em;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: .45rem .7rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: #2b2a28; }
.hero-text { position: relative; max-width: 960px; width: 100%; margin: 0 auto; padding: 0 1rem; }
.brand { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; margin: 0; opacity: .85; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin: .3rem 0; }
.tagline { font-size: 1.2rem; margin: 0; }
.city { margin: .3rem 0 0; opacity: .85; }

main { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
section { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fact:hover { transform: translateY(-2px); }
.fact .value { font-size: 1.6rem; font-family: "Fraunces", Georgia, serif; font-weight: 560; }
.fact .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

.about p { margin: 0 0 1rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
}
.gallery button:hover { box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 16px 32px rgba(0,0,0,.14); }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.gallery button:hover img { transform: scale(1.04); }

.unit { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.unit > p { margin: 0 0 1rem; }
.unit .facts { margin: 0 0 1.25rem; }
.unit .gallery { margin-top: 1.25rem; }
.unit-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.unit-head h2 { margin: 0; }
.unit-tagline { color: var(--muted); margin: .3rem 0 0; }

.links { display: flex; gap: .5rem; flex-wrap: wrap; }
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow); }

/* Availability and prices (see renderBooking in app.js) */
.booking-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.booking-controls label { font-weight: 600; }
.booking-controls select {
  font: inherit;
  margin-left: .4rem;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.booking-rules { color: var(--muted); font-size: .9rem; }
.booking-nav { margin-left: auto; display: flex; gap: .4rem; }
.booking-nav button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.booking-nav button:disabled { opacity: .35; cursor: default; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.cal-month h3 { margin: 0 0 .5rem; font-size: 1.05rem; text-align: center; }
.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); text-transform: uppercase; padding-bottom: .2rem; }
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  min-height: 3.4rem;
  padding: .2rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.cal-day:hover:not(:disabled) { border-color: var(--accent); }
.cal-day .n { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.cal-day .p { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.cal-day.taken { background: transparent; border-color: transparent; color: var(--muted); }
.cal-day.taken .n { text-decoration: line-through; font-weight: 400; opacity: .6; }
.cal-day:disabled { cursor: default; }
.cal-day.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-day.sel .p { color: #fff; }
.cal-day.sel-end, .cal-day.taken.sel-end { background: rgba(var(--accent-rgb), .18); border-color: var(--accent); color: var(--text); }
.cal-day.sel-end .n { text-decoration: none; font-weight: 600; opacity: 1; }
.booking-hint, .booking-note { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }
.booking-summary {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.booking-summary > p:first-child { margin: 0; }
.booking-summary dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.25rem; margin: 0; }
.booking-summary dt { color: var(--muted); }
.booking-summary dd { margin: 0; font-weight: 600; }
.booking-total { font-size: 1.15rem; margin: 1rem 0; }
.booking-total span { color: var(--muted); font-size: .95rem; }
.booking-warning { color: var(--accent); font-weight: 600; margin: 1rem 0; }
/* Locations on Airbnb (Itapema): the direct-booking offer, the studio picker and the price breakdown. */
.booking-offer {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), .08);
}
.booking-offer strong { display: block; font-size: 1.1rem; color: var(--accent); }
.booking-offer p { margin: .3rem 0 0; }
.booking-studios { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.booking-studios button {
  font: inherit;
  font-weight: 600;
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.booking-studios button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.booking-summary dl.booking-prices { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); grid-template-columns: 1fr auto; column-gap: 0; }
.booking-prices dd { text-align: right; font-weight: 400; padding-left: 1rem; }
.booking-prices .subtotal { padding-top: .3rem; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; }
.booking-prices .saving { color: var(--accent); font-weight: 600; }
.booking-total + .booking-note { margin-top: 0; }
button.button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
button.button:disabled { opacity: .6; cursor: default; }
/* The booking request form (requestForm in app.js). */
.booking-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem 1rem; margin: 1rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.booking-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.booking-form input {
  font: inherit;
  font-weight: 400;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.booking-form button { justify-self: start; grid-column: 1 / -1; }
.booking-form .booking-warning { grid-column: 1 / -1; margin: 0; }
#booking-website { position: absolute; left: -9999px; width: 1px; height: 1px; }
.booking-sent strong { display: block; font-size: 1.15rem; color: var(--accent); }
.booking-sent .links { margin-top: 1rem; }
.button.plain { background: transparent; color: var(--text); border: 1px solid var(--border); }

.info { margin: 0; padding-left: 1.2rem; }
.info li { margin: .35rem 0; }
.info li::marker { color: var(--accent); }

.amenities {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem 1.5rem;
}
.amenities li::before { content: "✓"; color: var(--accent); margin-right: .6rem; }

.contact a { color: var(--accent); }
.contact p { margin: .3rem 0; }

footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; }

.empty { color: var(--muted); font-style: italic; }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}
.lightbox::backdrop { background: rgba(0,0,0,.92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 85vh; object-fit: contain; }
.lightbox figcaption { color: #ddd; margin-top: .5rem; }
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 0;
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease;
}
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
