/* San Borja Rentals — direct-booking site
   Works from file:// and as a static deploy. */

:root {
  --bg: #f4eee4;
  --bg-deep: #ebe3d4;
  --surface: #fffaf3;
  --surface-2: #f8f1e6;
  --ink: #1c1410;
  --ink-soft: #5a4d44;
  --ink-faint: #8a7b70;
  --line: #e4d5c4;
  --line-strong: #d3c0aa;
  --terracotta: #b54a2c;
  --terracotta-dark: #8c331c;
  --terracotta-soft: #f3e0d6;
  --olive: #5c6b4a;
  --olive-soft: #e6eadc;
  --gold: #c4a15a;
  --shadow: 0 18px 40px rgba(28, 20, 16, 0.08);
  --shadow-sm: 0 8px 20px rgba(28, 20, 16, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
  --header-h: 76px;
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}

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

html { scroll-behavior: smooth; }

html.lang-es [data-lang="en"],
html.lang-en [data-lang="es"] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--terracotta-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--ink);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.skip {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
  border-radius: 8px;
}
.skip:focus, .skip:focus-visible {
  top: 12px;
  transform: none;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 550;
}
.nav a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 7px 11px;
  cursor: pointer;
}
html.lang-es .lang-toggle button[data-set-lang="es"],
html.lang-en .lang-toggle button[data-set-lang="en"] {
  background: var(--ink);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--terracotta) 40%, white); outline-offset: 2px; }

.btn-primary {
  background: var(--terracotta);
  color: #fff;
}
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-whatsapp { background: #128c47; color: #fff; }
.btn-whatsapp:hover { background: #0e7a3c; color: #fff; }

.menu-btn {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  content: "";
}
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }

/* Hero */
.hero {
  position: relative;
  min-height: clamp(560px, 86vh, 820px);
  display: grid;
  place-items: end start;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 12, 8, 0.18) 0%, rgba(20, 12, 8, 0.25) 40%, rgba(20, 12, 8, 0.78) 100%);
}
.hero-content {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto 72px;
  max-width: 760px;
  margin-left: max(20px, calc((100% - var(--max)) / 2));
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 16px;
  color: #f3e0d6;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  margin-bottom: 16px;
  font-weight: 600;
}
.hero .lede {
  font-size: 1.15rem;
  max-width: 46ch;
  color: rgba(255,255,255,0.9);
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
}
.hero-meta strong { color: #fff; font-weight: 700; }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-deep); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
}
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.section-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--terracotta);
  margin-bottom: 8px;
}
.muted { color: var(--ink-soft); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.listing-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #d9cbb8;
  overflow: hidden;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.45rem; margin: 0; }
.card-specs, .spec-row {
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.price {
  font-weight: 750;
  color: var(--ink);
}
.price.is-ask {
  color: var(--terracotta-dark);
  font-weight: 700;
}
.rating { font-size: 0.92rem; color: var(--ink-soft); }
.rating strong { color: var(--ink); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}
.about-copy h2 { font-size: clamp(2rem, 4vw, 3rem); }
.feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 16px;
}
.feature-list li {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid var(--line);
}
.feature-list strong { display: block; font-family: var(--font-serif); font-size: 1.15rem; margin-bottom: 4px; }

/* Booking */
.booking-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--terracotta) 30%, white);
  border-color: var(--terracotta);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.form-note, .config-note, .contact-pending {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.contact-pending {
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}
.hidden { display: none !important; }
.form-error {
  color: #8c1c1c;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Listing page */
.listing-hero { padding: 28px 0 0; }
.crumb {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { color: var(--terracotta-dark); }
.listing-title-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.listing-title-row h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); margin: 0 0 8px; }
.listing-sub { color: var(--ink-soft); }

.gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  margin-bottom: 48px;
}
.gallery-main,
.gallery-side button,
.gallery-more button {
  border: 0;
  padding: 0;
  background: #d9cbb8;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}
.gallery-main { aspect-ratio: 4 / 3; }
.gallery-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gallery-side button { aspect-ratio: 1 / 1; }
.gallery-main img,
.gallery-side img,
.gallery-more img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-more {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.gallery-more button { aspect-ratio: 4 / 3; border-radius: 14px; }

.listing-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 42px;
  align-items: start;
  padding-bottom: 80px;
}
.prose h2 { font-size: 1.7rem; margin-top: 2rem; }
.prose h3 { font-size: 1.2rem; margin: 1.2em 0 0.4em; font-family: var(--font-sans); font-weight: 750; letter-spacing: 0; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.amenity-group { margin: 18px 0; }
.amenity-group h3 { margin-bottom: 8px; }
.amenity-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}
.amenity-group li {
  position: relative;
  padding-left: 18px;
}
.amenity-group li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--olive);
  position: absolute;
  left: 0;
  top: 0.55em;
}
.rules { padding-left: 1.15em; }
.rules li { margin: 0.35em 0; }

.side-card {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.side-card .price { font-size: 1.25rem; display: block; margin-bottom: 6px; }
.side-card .meta-list {
  list-style: none;
  padding: 14px 0;
  margin: 10px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.side-card .meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.95rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.side-card .meta-list span { color: var(--ink-soft); }
.side-card .meta-list strong { text-align: right; flex: 1 1 12rem; font-weight: 650; font-size: 0.9rem; }
.airbnb-link { display: block; margin-top: 14px; font-size: 0.92rem; text-align: center; }
.cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 16px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.cats strong { color: var(--ink); font-weight: 700; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 6, 0.92);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 64px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 8px;
}
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
}
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px 20px;
    gap: 12px;
  }
  .nav.open { display: flex; }
  .card-grid,
  .about-grid,
  .gallery,
  .listing-layout,
  .form-grid,
  .amenity-group ul { grid-template-columns: 1fr; }
  .gallery-side { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .header-actions .btn { display: none; }
  .listing-title-row { flex-direction: column; align-items: flex-start; }
  .hero-content { margin-bottom: 48px; }
  .section { padding: 64px 0; }
}

@media (max-width: 560px) {
  .wrap, .header-inner, .hero-content, .footer-inner { width: calc(100% - 32px); }
  .cats { grid-template-columns: 1fr; }
  .lightbox { padding: 56px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .listing-card { transition: none; }
}
