/* ============================================================
   Pura Vida Tiny Homes — style.css
   Aesthetic: warm organic editorial. Sand, jungle green, terracotta.
   Fonts: Fraunces (display) + Karla (body)
   ============================================================ */

:root {
  --sand: #F5EEE3;
  --sand-deep: #EDE2D0;
  --jungle: #1E3D2F;
  --jungle-soft: #2E5744;
  --terracotta: #C4643B;
  --terracotta-soft: #D98A63;
  --ink: #22301F;
  --cream: #FBF7EF;
  --line: rgba(30, 61, 47, 0.18);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;

  --radius-arch: 999px 999px 24px 24px;
  --max-w: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
}

/* subtle grain texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

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

a { color: var(--jungle); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 238, 227, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--jungle);
  line-height: 1.1;
}

.logo span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  position: relative;
}

.nav-links a:not(.lang-switch)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--terracotta);
  transition: width 0.25s ease;
}

.nav-links a:not(.lang-switch):hover::after { width: 100%; }

.lang-switch {
  border: 1.5px solid var(--jungle);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition: background 0.2s, color 0.2s;
}

.lang-switch:hover { background: var(--jungle); color: var(--cream); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--jungle);
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 24px 88px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.08;
  color: var(--jungle);
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
}

.hero p {
  font-size: 1.1rem;
  max-width: 46ch;
  margin-bottom: 32px;
  color: var(--ink);
}

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--jungle);
  color: var(--cream);
  box-shadow: 0 8px 24px rgba(30, 61, 47, 0.28);
}

.btn-outline {
  border: 2px solid var(--jungle);
  color: var(--jungle);
}

/* ---------- Image placeholders (replace with real photos) ---------- */
.ph {
  background: var(--sand-deep);
  border: 2px dashed rgba(30, 61, 47, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--jungle-soft);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 12px;
}

.ph-hero {
  border-radius: var(--radius-arch);
  aspect-ratio: 4 / 5;
  max-height: 560px;
  width: 100%;
}

.ph-card { border-radius: 20px; aspect-ratio: 4 / 3; }

.ph-wide { border-radius: 24px; aspect-ratio: 16 / 7; }

/* ---------- Real photos ---------- */
.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-hero {
  border-radius: var(--radius-arch);
  aspect-ratio: 4 / 5;
  max-height: 560px;
  box-shadow: 0 24px 48px rgba(30, 61, 47, 0.22);
}

.photo-card { aspect-ratio: 4 / 3; }

.photo-wide { border-radius: 24px; aspect-ratio: 16 / 7; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }

.section-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--jungle);
  line-height: 1.15;
  margin-bottom: 20px;
}

/* Ways to stay */
.stay { padding: 0 0 72px; }

.stay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.stay-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stay-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--jungle);
}

.stay-card p { flex: 1; }

.stay-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--jungle);
  color: var(--cream);
}

.stay-card + .stay-card .stay-tag { background: var(--terracotta); }

/* Intro */
.intro { background: var(--cream); border-block: 1px solid var(--line); }

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.intro-grid p + p { margin-top: 16px; }

/* Homes */
.homes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.home-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(30, 61, 47, 0.14);
}

.home-card .ph-card { border-radius: 0; border-inline: none; border-top: none; }

.home-card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.home-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--jungle);
}

.home-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sand-deep);
  color: var(--jungle);
}

.home-tag.available { background: var(--jungle); color: var(--cream); }
.home-tag.soon { background: var(--terracotta); color: var(--cream); }

.home-card p { font-size: 0.95rem; flex: 1; }

.card-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--terracotta);
  font-size: 0.95rem;
}

.card-link:hover { text-decoration: underline; }

.section-sub {
  max-width: 52ch;
  color: var(--jungle-soft);
  margin-top: -8px;
}

/* ---------- Gallery ---------- */
.gallery { background: var(--cream); border-block: 1px solid var(--line); }

.gallery-group { margin-top: 36px; }

.gallery-group h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--jungle);
  margin-bottom: 14px;
}

.gallery-note {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--terracotta);
}

.gallery-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-strip::-webkit-scrollbar { height: 8px; }
.gallery-strip::-webkit-scrollbar-track { background: var(--sand-deep); border-radius: 999px; }
.gallery-strip::-webkit-scrollbar-thumb { background: var(--terracotta-soft); border-radius: 999px; }

.gallery-strip img {
  height: 240px;
  width: auto;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  scroll-snap-align: start;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-strip img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(30, 61, 47, 0.18);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 30, 24, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 2.2rem;
  cursor: pointer;
  padding: 16px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.lightbox button:hover { opacity: 1; }

.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

.lightbox .lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cream);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

@media (max-width: 860px) {
  .gallery-strip img { height: 190px; }
}

/* For sale band */
.forsale {
  background: var(--jungle);
  color: var(--cream);
}

.forsale .section-title { color: var(--cream); }
.forsale .section-kicker { color: var(--terracotta-soft); }
.forsale p { max-width: 60ch; margin-bottom: 28px; color: rgba(251, 247, 239, 0.88); }

.forsale .btn-primary {
  background: var(--terracotta);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Contact */
.contact { text-align: center; }
.contact p { max-width: 52ch; margin: 0 auto 28px; }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--jungle-soft);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 36px; }
  .ph-hero, .photo-hero { aspect-ratio: 4 / 3; }
  .intro-grid { grid-template-columns: 1fr; gap: 32px; }
  .stay-grid { grid-template-columns: 1fr; }
  .homes-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--cream);
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--line);
    gap: 18px;
  }

  .nav-links.open { display: flex; }
}
