/* Lomas de Olón — "Tide Line" — mobile-first, luxury editorial.
   Base rules are the phone layout; every media query below is min-width. */

@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --paper: #FAF8F2;  --ink: #1E3A2F;  --body: #33403A;  --body-soft: #5A655E;
  --hairline: #E2DCCB;  --dark: #0E1B15;  --brass: #C8A96A;  --sand: #EAD9B0;
  --terracotta: #8A4B2A;  --cream: #EFE9DA;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 48px);
  /* supplemental tokens (not in the brief's starter block, used with restraint) */
  --mist: #F1EDE1;              /* cross-sell band background */
  --max: 1240px;                /* editorial content width cap on large screens */
  --prose: 640px;               /* comfortable paragraph measure */
  --sect-y: clamp(48px, 9vw, 120px);
  --dur: 0.25s;
  --ease: ease;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--body); font: 400 16px/1.6 var(--sans); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
ul, ol { list-style: none; }

h1, h2, .price { font-family: var(--serif); color: var(--ink); font-weight: 500; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); line-height: 1.15; }
p { line-height: 1.65; }

.kicker, .eyebrow { font: 600 11px/1.4 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; }
.eyebrow { color: var(--terracotta); margin-bottom: 0.6em; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
       padding: 0 22px; font: 600 12px/1 var(--sans); letter-spacing: 0.12em;
       text-transform: uppercase; text-decoration: none;
       transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.btn-brass { background: var(--brass); color: var(--dark); }
.btn-brass:hover { background: var(--sand); }
.btn-outline { border: 1px solid var(--brass); color: var(--cream); }
.btn-outline:hover { background: rgba(200, 169, 106, 0.12); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
::selection { background: var(--brass); color: var(--dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Masthead — transparent, absolute over the hero
   ========================================================================== */

.masthead {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--pad);
  padding: clamp(14px, 3vw, 28px) var(--pad);
}
.wordmark {
  font: 500 20px/1 var(--serif); color: var(--cream);
  text-shadow: 0 1px 6px rgba(10, 20, 16, 0.45);
  display: inline-flex; align-items: center; min-height: 44px;
}
.mast-nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.mast-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 600 11px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream); text-shadow: 0 1px 4px rgba(10, 20, 16, 0.45);
  transition: color var(--dur) var(--ease);
}
.mast-nav a:hover { color: var(--brass); }
/* House links live in page content on mobile; only the language toggle shows in the masthead. */
.mast-nav a:not(.lang-toggle) { display: none; }
.lang-toggle { border: 1px solid rgba(239, 233, 218, 0.55); padding: 0 10px; }
.lang-toggle:hover { border-color: var(--brass); }

@media (min-width: 700px) {
  .mast-nav a:not(.lang-toggle) { display: inline-flex; }
}

/* ==========================================================================
   Hero — full-bleed photo, veil, bottom-left copy
   ========================================================================== */

.hero { position: relative; min-height: 72svh; overflow: hidden; background: var(--dark); }
/* Property-page heroes (followed by the stat band) read a touch shorter than
   the homepage hero (followed by the price strip); :has() degrades safely to
   the 72svh base where unsupported. */
.hero:has(+ .stat-band) { min-height: 60svh; }

.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 16, 0.05) 30%, rgba(10, 20, 16, 0.72));
}
.hero-copy {
  position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad); z-index: 2;
  color: var(--cream);
  max-width: 720px;
}
.hero-kicker {
  color: var(--sand); font: 600 11px/1.4 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 0.75em;
}
.hero-headline {
  color: var(--cream); font: 500 clamp(2rem, 6vw, 4rem)/1.08 var(--serif);
}
.hero-price {
  margin-top: 0.6em; color: var(--sand);
  font: 500 clamp(1rem, 2vw, 1.15rem) var(--serif);
}

/* ==========================================================================
   Price strip
   ========================================================================== */

.price-strip { padding: var(--sect-y) var(--pad); max-width: var(--max); margin-inline: auto; }
.strip-eyebrow {
  font: 600 11px/1.4 var(--sans); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--terracotta); text-align: center; margin-bottom: 1.4em;
}
.price-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.price-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: 1px solid var(--hairline);
  padding: clamp(20px, 4vw, 28px) 16px; text-align: center;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.price-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.price-card-value { font: 600 clamp(1.5rem, 4vw, 1.75rem) var(--serif); color: var(--ink); }
.price-card-label {
  font: 600 11px/1.4 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--body-soft);
}
.card-compound { border-color: var(--brass); border-width: 1px; }
.card-compound:hover { border-color: var(--brass); }
.card-compound .price-card-value { color: var(--terracotta); }

@media (min-width: 700px) {
  .price-cards { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ==========================================================================
   Compound — prose section
   ========================================================================== */

.compound { padding: var(--sect-y) var(--pad); max-width: var(--max); margin-inline: auto; }
.compound-heading { max-width: var(--prose); margin-bottom: 0.6em; }
.compound-body { max-width: var(--prose); color: var(--body); }

/* ==========================================================================
   House panels — full-bleed magazine link-blocks
   ========================================================================== */

.house-panel {
  position: relative; display: block; overflow: hidden; min-height: 56svh; background: var(--dark);
}
.house-panel .hero-img { transition: transform 0.6s var(--ease); }
.house-panel:hover .hero-img, .house-panel:focus-visible .hero-img { transform: scale(1.04); }
.panel-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 16, 0.05) 30%, rgba(10, 20, 16, 0.72));
}
.panel-copy {
  position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad); z-index: 2;
  color: var(--cream); max-width: 720px;
}
.panel-name { color: var(--cream); font: 500 clamp(1.6rem, 4.5vw, 2.4rem)/1.1 var(--serif); }
.panel-price {
  margin-top: 0.4em; color: var(--sand); font: 600 1rem/1.4 var(--serif);
  display: flex; flex-wrap: wrap; gap: 0 0.6em; align-items: baseline;
}
.panel-stats { font: 600 11px/1.4 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream); }
.panel-tagline { margin-top: 0.5em; color: var(--cream); font-size: 0.95rem; max-width: 46ch; }
.panel-cta {
  display: inline-block; margin-top: 0.9em; color: var(--cream);
  font: 600 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  transition: transform var(--dur) var(--ease);
}
.house-panel:hover .panel-cta, .house-panel:focus-visible .panel-cta { transform: translateX(4px); }

/* ==========================================================================
   Stat band
   ========================================================================== */

.stat-band {
  display: flex; flex-wrap: wrap;
  background: #fff; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.stat {
  flex: 1 1 33.333%; text-align: center;
  padding: clamp(16px, 3vw, 22px) 8px;
}
.stat-value { display: block; font: 600 clamp(1.15rem, 2.5vw, 1.4rem) var(--serif); color: var(--ink); }
.stat-label {
  display: block; margin-top: 0.3em;
  font: 600 10px/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--body-soft);
}

@media (min-width: 700px) {
  .stat-band { flex-wrap: nowrap; justify-content: center; gap: clamp(16px, 4vw, 56px); }
  .stat { flex: 0 0 auto; }
}

/* ==========================================================================
   Narrative sections (+ blind Task-7 .s-photo pairing)
   ========================================================================== */

.narrative { padding: var(--sect-y) var(--pad); max-width: var(--max); margin-inline: auto; }
.narrative-heading { max-width: var(--prose); margin-bottom: 0.5em; }
.narrative-body { max-width: var(--prose); color: var(--body); }

.s-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.g-caption {
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--body-soft);
  margin-top: 0.6em;
}
@media (min-width: 900px) {
  .narrative:has(.s-photo) {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--pad); align-items: start;
  }
  .narrative:has(.s-photo) .narrative-heading,
  .narrative:has(.s-photo) .narrative-body { grid-column: 1; }
  .narrative:has(.s-photo) .s-photo { grid-column: 2; grid-row: 1 / -1; }
  .narrative:has(.s-photo) .s-photo img { height: 100%; }
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery { padding: var(--sect-y) var(--pad); max-width: var(--max); margin-inline: auto; }
.gallery > h2 { margin-bottom: 1.1em; }
.gallery-grid { display: grid; gap: 8px; }
.gallery-grid img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  transition: transform 0.45s var(--ease);
}
.gallery-grid a, .gallery-grid button {
  display: block; overflow: hidden; cursor: pointer;
  width: 100%; padding: 0; border: 0; background: none;
}
.gallery-grid a:hover img, .gallery-grid button:hover img,
.gallery-grid a:focus-visible img, .gallery-grid button:focus-visible img { transform: scale(1.035); }

.g-feature { display: grid; grid-template-columns: 1fr; gap: 8px; }
.g-feature > :first-child img { aspect-ratio: 16 / 10; }
.g-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-single {}

@media (min-width: 900px) {
  .g-feature { grid-template-columns: 2fr 1fr; align-items: start; }
}

.g-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 100%; aspect-ratio: 4 / 3; box-sizing: border-box; padding: 16px; text-align: center;
  border: 1px dashed var(--hairline); background: var(--paper); color: var(--body-soft);
}
.g-feature > :first-child.g-placeholder { aspect-ratio: 16 / 10; }
.g-placeholder-caption {
  margin: 0; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--body-soft);
}

.gallery-empty {
  margin-top: 24px; padding: clamp(28px, 6vw, 48px) 16px; text-align: center;
  border: 1px dashed var(--hairline); color: var(--body-soft);
  font-family: var(--serif); font-style: italic; font-size: 1.05rem;
}

/* ==========================================================================
   Details zone — "The details" / "Los detalles": native <details>/<summary>
   accordion, one per data-sheet group (src/details.js)
   ========================================================================== */

.details-zone { padding: var(--sect-y) var(--pad); max-width: var(--max); margin-inline: auto; }
.details-heading { max-width: var(--prose); margin-bottom: 0.4em; }

.detail-group { border-top: 1px solid var(--hairline); }
.detail-group:last-child { border-bottom: 1px solid var(--hairline); }

.detail-group summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; padding: 14px 0;
  font: 500 clamp(1.15rem, 2.5vw, 1.3rem)/1.3 var(--serif); color: var(--ink);
  cursor: pointer; list-style: none;
}
.detail-group summary::-webkit-details-marker { display: none; }
.detail-group summary::after {
  content: '+' / ''; flex: 0 0 auto; color: var(--terracotta);
  font: 400 22px/1 var(--serif);
}
.detail-group[open] summary::after { content: '\2212' / ''; } /* − */

.detail-body { max-width: var(--prose); color: var(--body); padding: 2px 0 26px; }
.detail-body > * + * { margin-top: 1em; }

.detail-sub {
  font: 600 15px/1.4 var(--serif); color: var(--ink);
}
.detail-sub:first-child { margin-top: 0; }

.detail-list li {
  padding: 9px 0 9px 18px; position: relative;
  border-bottom: 1px solid var(--hairline);
}
.detail-list li:first-child { border-top: 1px solid var(--hairline); }
.detail-list li::before { content: '\2013'; position: absolute; left: 0; color: var(--terracotta); } /* – */

.detail-note {
  font-size: 13px; font-style: italic; color: var(--body-soft);
}

.areas-table { width: 100%; max-width: var(--prose); border-collapse: collapse; font-size: 0.95rem; }
.areas-table th, .areas-table td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--hairline); }
.areas-table th:first-child, .areas-table td:first-child { text-align: left; padding-left: 0; }
.areas-table th {
  font: 600 10px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--body-soft);
}
.detail-sub-row td:first-child { padding-left: 16px; color: var(--body-soft); }
.detail-total-row td { color: var(--ink); font-family: var(--serif); font-weight: 600; }

.costs-stats {
  display: flex; flex-wrap: wrap; gap: 18px 32px;
  padding: 16px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.cost-stat-value { display: block; font: 600 22px/1.2 var(--serif); color: var(--ink); }
.cost-stat-label {
  display: block; margin-top: 0.3em;
  font: 600 10px/1.4 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--body-soft);
}

/* ==========================================================================
   Cross-sell
   ========================================================================== */

.cross-sell { background: var(--mist); padding: var(--sect-y) var(--pad); }
.cross-sell > * { max-width: var(--max); margin-inline: auto; }
.cross-panel {
  display: flex; align-items: center; gap: 16px;
}
.cross-panel .hero-img {
  position: static; width: 96px; height: 96px; flex: 0 0 96px;
  aspect-ratio: 1 / 1; object-fit: cover;
}
.cross-label {
  font: 600 11px/1.4 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--terracotta);
}
.cross-name {
  font: 500 clamp(1.15rem, 2.5vw, 1.4rem) var(--serif); color: var(--ink);
  margin-top: 0.2em; transition: color var(--dur) var(--ease);
}
.cross-panel:hover .cross-name, .cross-panel:focus-visible .cross-name { color: var(--terracotta); }
.cross-price { margin-top: 0.15em; font: 600 0.95rem var(--serif); color: var(--body-soft); }
.cross-compound { margin-top: 18px; color: var(--body); }
.cross-compound b { font-family: var(--serif); color: var(--terracotta); }

@media (min-width: 700px) {
  .cross-panel .hero-img { width: 140px; height: 140px; flex-basis: 140px; }
}

/* ==========================================================================
   Contact footer
   ========================================================================== */

.contact { background: var(--dark); color: var(--cream); padding: var(--sect-y) var(--pad); }
.contact > * { max-width: var(--prose); margin-inline: auto; text-align: center; }
.agent-line {
  font: 600 11px/1.6 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass);
}
.contact-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 1.6em; }
.footer-lang {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 1.2em;
  font: 600 11px/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream);
  opacity: 0.75; transition: opacity var(--dur) var(--ease);
}
.footer-lang:hover { opacity: 1; }

/* ==========================================================================
   Sticky bar (mobile-only CTA; hidden ≥900px, hidden entirely until Task 7 unhides it)
   ========================================================================== */

#stickybar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(14, 27, 21, 0.94);
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
}
.sb-price { font: 600 1.1rem var(--serif); color: var(--cream); }

@media (min-width: 900px) {
  #stickybar { display: none; }
}

/* ==========================================================================
   Lightbox (Task-7 JS-mounted, styled blind)
   ========================================================================== */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 27, 21, 0.96); padding: var(--pad);
}
.lightbox figure { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 82svh; width: auto; object-fit: contain; }
.lightbox .g-caption { color: var(--cream); text-align: center; }

.lb-close, .lb-prev, .lb-next {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; color: var(--cream); cursor: pointer;
  font-size: 1.4rem; line-height: 1;
  transition: color var(--dur) var(--ease);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--brass); }
.lb-close { top: var(--pad); right: var(--pad); }
.lb-prev { left: var(--pad); top: 50%; transform: translateY(-50%); }
.lb-next { right: var(--pad); top: 50%; transform: translateY(-50%); }
