/* Quinta Estrella del Sur
   Palette taken from the house: lime-wash cream, stucco ochre, roof-tile terracotta,
   garden green, dark wood. Night indigo and string-light gold for the evening only. */

:root {
  --cream: #f5eee0;
  --cream-deep: #ece2cd;
  --paper: #faf6ee;
  --ochre: #c9963f;
  --ochre-ink: #7d5716;
  --terracotta: #a9472a;
  --terracotta-dark: #8c3920;
  --green: #3e5a36;
  --wood: #3a2a1d;
  --wood-soft: #66513f;
  --line: #d9cbb0;
  --night: #1b2040;
  --night-deep: #141831;
  --gold: #f0c46f;
  --night-text: #efe6d4;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.1rem, 5vw, 2rem);
  --space: clamp(4rem, 10vw, 7.5rem);
  --header: 3.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 0.5rem);
}

body {
  margin: 0;
  background-color: var(--cream);
  /* faint stucco grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--wood);
  font-family: var(--sans);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
@media (min-width: 900px) { body { font-size: 1.25rem; } } /* 20px */

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

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

:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  font-optical-sizing: auto;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  color: var(--wood);
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 9vw, 4.6rem); }
h2 { font-size: clamp(2.1rem, 6.5vw, 3.4rem); }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }

.star { width: 0.9em; height: 0.9em; fill: var(--ochre); flex: none; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--wood); color: var(--paper); padding: 0.6rem 1rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-in {
  display: flex; align-items: center; gap: 0.9rem;
  min-height: var(--header);
  max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter);
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--serif); font-weight: 560; font-size: 1.12rem;
  color: var(--wood); text-decoration: none; margin-right: auto; white-space: nowrap;
}
.brand .star { width: 1.05em; height: 1.05em; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.nav a {
  color: var(--wood); text-decoration: none; font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.nav a:hover { color: var(--terracotta); text-decoration: underline; }
.lang {
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--wood-soft); text-decoration: none; padding: 0.4rem 0.2rem;
}
.lang:hover { color: var(--terracotta); }
.menu-btn {
  display: none;
  font: inherit; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--wood); padding: 0.35rem 0.9rem; cursor: pointer;
}

@media (max-width: 899px) {
  .menu-btn { display: block; }
  .top .top-wa { display: none; }
  .brand span { font-size: 1rem; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.2rem;
    display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: 0.75rem 0; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
}
@media (max-width: 380px) { .brand span { font-size: 0.92rem; } .top-in { gap: 0.6rem; } }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--sans); font-weight: 600; font-size: 1.05rem; line-height: 1.2;
  text-decoration: none; border-radius: 999px;
  padding: 0.85rem 1.5rem; min-height: 3rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-wa { background: var(--terracotta); color: #fff; }
.btn-wa:hover { background: var(--terracotta-dark); color: #fff; }
.btn-quiet { border: 1.5px solid var(--wood-soft); color: var(--wood); background: transparent; }
.btn-quiet:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.btn-small { font-size: 0.92rem; padding: 0.45rem 1rem; min-height: 2.4rem; }
.btn-big { font-size: 1.12rem; padding: 1rem 1.7rem; }
.wa-icon { width: 1.25em; height: 1.25em; flex: none; }
.btns { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.btns-center { justify-content: center; }

.float-wa {
  position: fixed; z-index: 40;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: none; align-items: center; gap: 0.5rem;
  background: var(--terracotta); color: #fff; text-decoration: none; font-weight: 600;
  padding: 0.8rem 1.2rem 0.8rem 1rem; border-radius: 999px;
  box-shadow: 0 6px 18px rgb(58 42 29 / 0.28);
}
.float-wa:hover { background: var(--terracotta-dark); color: #fff; }
.float-wa { transition: opacity 0.3s ease, transform 0.3s ease; }
.js .float-wa.away { opacity: 0; transform: translateY(1rem); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .float-wa { transition: none; } }
.float-wa .wa-icon { width: 1.5em; height: 1.5em; }
@media (max-width: 899px) { .float-wa { display: inline-flex; } }

/* ------------------------------------------------------------- hero */
.hero { position: relative; }
.hero-photo { margin: 0; max-width: 1600px; margin-inline: auto; }
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 47% 40%; /* keep the windmill in frame */
  max-height: calc(100svh - var(--header) - 9rem);
  min-height: 22rem;
}
@media (min-width: 700px) {
  .hero-photo img { aspect-ratio: 4 / 3; max-height: calc(100svh - var(--header) - 13rem); }
}
.hero-text {
  position: relative;
  max-width: 40rem; margin: -3.2rem auto 0;
  background: var(--paper);
  padding: 1.6rem var(--gutter) 2.2rem;
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--line);
}
@media (max-width: 699px) { .hero-text { margin: -2.4rem 1rem 0; } }
.hero-text > .star { width: 1.6rem; height: 1.6rem; margin: 0 auto 0.6rem; display: block; }
.kicker, .label {
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ochre-ink); font-weight: 600; margin: 0 0 0.9rem;
}
.hero h1 { margin-bottom: 0.4em; }
.hero-lede { font-size: 1.12em; color: var(--wood-soft); max-width: 32rem; margin: 0 auto 1.5rem; }

/* ------------------------------------------------------------- facts */
.facts { padding: 2.6rem var(--gutter) 1rem; }
.facts ul {
  list-style: none; margin: 0 auto; padding: 0; max-width: 56rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.8rem;
}
.facts li {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.3;
}
.facts .star { width: 0.7em; height: 0.7em; }
@media (max-width: 599px) {
  .facts ul { flex-direction: column; align-items: flex-start; max-width: 22rem; gap: 0.6rem; }
}

/* ------------------------------------------------------------- sections */
.sec { padding-top: var(--space); }
.sec-plain { padding-bottom: 1rem; }

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.4rem var(--gutter) 1rem;
  box-sizing: content-box;
}
.lead + .prose { padding-top: 2.6rem; }
.label { display: flex; align-items: center; gap: 0.55rem; }
.label .star { width: 0.9rem; height: 0.9rem; }

.designer {
  font-family: var(--serif); font-size: 1.22em; line-height: 1.45;
  color: var(--wood);
  padding-left: 1rem; border-left: 3px solid var(--ochre);
  margin-bottom: 1.4em;
}
.designer strong { font-weight: 600; }

.small-head {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ochre-ink);
  margin: 1.2rem 0 0.8rem;
}

ul.stars { list-style: none; padding: 0; margin: 0 0 1.2em; }
ul.stars li { display: flex; gap: 0.7rem; margin-bottom: 0.8em; }
ul.stars li .star { margin-top: 0.42em; width: 0.75em; height: 0.75em; }

/* costs */
.costs { width: 100%; border-collapse: collapse; margin: 0.4rem 0 1.6rem; font-variant-numeric: tabular-nums; }
.costs th, .costs td { padding: 0.55rem 0; border-bottom: 1px dotted var(--line); text-align: left; font-weight: 400; }
.costs td { text-align: right; white-space: nowrap; }
.costs tfoot th, .costs tfoot td {
  border-bottom: 0; border-top: 2px solid var(--wood);
  font-family: var(--serif); font-weight: 600; font-size: 1.15em; padding-top: 0.7rem;
}

/* distances, like a printed timetable */
.distances { margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.distances div { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.35rem 0; }
.distances dt { flex: 0 1 auto; }
.distances div::after { content: ""; order: 1; flex: 1 1 1.5rem; border-bottom: 2px dotted var(--line); min-width: 1rem; }
.distances dd { order: 2; margin: 0; white-space: nowrap; font-weight: 600; color: var(--green); }

/* ------------------------------------------------------------- photos */
figure { margin: 0; }
.lead { max-width: 1600px; margin: 0 auto; }
.lead img { width: 100%; }
.lead-square { max-width: 960px; }
figcaption {
  font-size: 0.85rem; letter-spacing: 0.06em; color: var(--wood-soft);
  padding: 0.55rem var(--gutter) 0; text-align: center; font-style: italic;
}

.row {
  display: flex; flex-direction: column; gap: 0.6rem;
  max-width: 1200px; margin: 1.6rem auto 0;
}
.row .ph img { width: 100%; }
@media (min-width: 700px) {
  .row { flex-direction: row; gap: 0.8rem; padding: 0 var(--gutter); }
  .row .ph { flex: var(--ar) 1 0; min-width: 0; }
  figcaption { padding-inline: 0; }
}
.row-portrait { max-width: 34rem; }
@media (max-width: 699px) {
  .row-portrait { padding: 0 var(--gutter); }
}

/* gentle fade-in, only when scripting is on and motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  .js .fade { opacity: 0; transform: translateY(12px); transition: opacity 0.9s ease, transform 0.9s ease; }
  .js .fade.in { opacity: 1; transform: none; }
}

.divider {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  max-width: 14rem; margin: var(--space) auto 0;
}
.divider span { flex: 1; height: 1px; background: var(--ochre); opacity: 0.6; }
.divider .star { width: 1.1rem; height: 1.1rem; }
.sec + .divider + .sec, .divider + .sec { padding-top: calc(var(--space) * 0.7); }
.contact .divider { margin-top: 0; margin-bottom: 2rem; }

/* ------------------------------------------------------------- life in the pueblo
   The photos carry the color; the frame stays plain. */
.town { margin-top: 1.4rem; }
.town-head { padding-top: 0.6rem; padding-bottom: 0; }
.town-head .small-head { margin-bottom: 0.2rem; }
.town-strip {
  display: flex; gap: 0.6rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 0.8rem var(--gutter) 0.4rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.town-strip:focus-visible { outline-offset: -3px; }
.town-ph { flex: none; scroll-snap-align: start; width: calc(15.5rem * var(--ar)); max-width: 82vw; }
.town-ph img { width: 100%; height: 15.5rem; object-fit: cover; }
.town-ph figcaption { padding: 0.5rem 0 0; text-align: left; font-size: 0.8rem; line-height: 1.35; }
.credit { font-style: normal; opacity: 0.75; white-space: nowrap; }
.credit::before { content: "· "; }
@media (min-width: 700px) {
  /* tall photos are trimmed a little top and bottom so they are not slivers */
  .town-strip { max-width: 1440px; margin: 0 auto; overflow: visible; gap: 0.8rem; }
  .town-ph { flex: var(--fr) 1 0; width: auto; max-width: none; min-width: 0; }
  .town-ph img { height: auto; aspect-ratio: var(--fr); object-position: var(--focus, 50% 50%); }
}

/* ------------------------------------------------------------- evening */
.night {
  margin-top: var(--space);
  padding-bottom: var(--space);
  background: var(--night);
  color: var(--night-text);
  transition: background-color 1.4s ease, color 1.4s ease;
}
.night h2 { color: var(--night-text); transition: color 1.4s ease; }
.night .label { color: var(--gold); transition: color 1.4s ease; }
.night .star { fill: var(--gold); }
.night-p { font-family: var(--serif); font-size: 1.3em; line-height: 1.5; }
/* before it scrolls into view (set by script) it is still daylight */
.js .night.dusk-wait { background: var(--cream); color: var(--wood); }
.js .night.dusk-wait h2 { color: var(--wood); }
.js .night.dusk-wait .label { color: var(--ochre-ink); }
@media (prefers-reduced-motion: reduce) { .night, .night h2, .night .label { transition: none; } }

/* ------------------------------------------------------------- map */
.map-wrap { max-width: 1200px; margin: 2.4rem auto 0; padding: 0 var(--gutter); text-align: center; }
.map { position: relative; aspect-ratio: 4 / 3; background: var(--cream-deep); border: 1px solid var(--line); }
@media (min-width: 700px) { .map { aspect-ratio: 16 / 8; } }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.address { margin: 1rem 0 0; color: var(--wood-soft); font-size: 0.95em; }
.map-wrap .btns { justify-content: center; margin-top: 1rem; }

/* ------------------------------------------------------------- contact */
.contact {
  margin-top: var(--space);
  background: var(--cream-deep);
  padding: var(--space) 0;
  text-align: center;
}
.contact .prose { padding-top: 0; }
.contact p { font-size: 1.08em; }

/* ------------------------------------------------------------- gallery */
.grid {
  list-style: none; margin: 1rem auto 0; padding: 0 var(--gutter);
  max-width: 1200px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 0.7rem; } }
@media (min-width: 1050px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.g-item {
  display: block; width: 100%; padding: 0; border: 0; background: var(--cream-deep);
  cursor: zoom-in; aspect-ratio: 1; overflow: hidden;
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.g-item:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .g-item img { transition: none; } .g-item:hover img { transform: none; } }
.gallery-sec { padding-bottom: var(--space); }

.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #120f0b; color: #eee5d5;
  overscroll-behavior: contain;
}
.lb::backdrop { background: rgb(18 15 11 / 0.96); }
.lb[open] { display: flex; align-items: center; justify-content: center; }
.lb-fig {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 3.5rem 0.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  touch-action: pan-y;
}
.lb-fig img { max-width: 100%; max-height: calc(100% - 3.5rem); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-fig figcaption { color: #d8ccb6; font-style: normal; max-width: 40rem; padding: 0.8rem 1rem 0; font-size: 0.95rem; }
.lb-count { opacity: 0.65; white-space: nowrap; margin-left: 0.4rem; }
.lb-btn {
  position: absolute; background: rgb(255 255 255 / 0.1); color: #fff; border: 0;
  width: 3rem; height: 3rem; border-radius: 999px; font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.22); }
.lb-btn:focus-visible { outline-color: var(--gold); }
.lb-close { top: calc(0.6rem + env(safe-area-inset-top, 0px)); right: 0.6rem; }
.lb-prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.6rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 699px) {
  .lb-prev, .lb-next { top: auto; bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); transform: none; }
  .lb-fig { padding-bottom: 4.5rem; }
}

/* ------------------------------------------------------------- footer */
.foot {
  text-align: center; padding: 3rem var(--gutter) calc(6rem + env(safe-area-inset-bottom, 0px));
  color: var(--wood-soft); font-size: 0.95rem;
}
.foot .star { width: 1.2rem; height: 1.2rem; margin: 0 auto 0.8rem; display: block; }
.foot p { margin: 0 0 0.4rem; }
.foot-name { font-family: var(--serif); font-size: 1.2rem; color: var(--wood); }
.foot a { color: var(--wood-soft); }
