/* ==========================================================================
   villa-detail-template.css — one reusable structure for EVERY villa page
   Card: t_df3c9b40 (operator note villas-operator-note-77653305f2dc…)

   The operator: "the text is all over the screens, there is no real template
   for a product page — look at how Airbnb/Booking structure one."

   He is right about the cause. `.layout2` is a content column PLUS a named
   second column, and every section was its own grid item, so the browser
   auto-placed them alternately: the title landed in column 1, the spec row in
   column 2, the description in column 1, distances in column 2 … and the
   booking rail sat in row 1 while the section nav was pushed 1500px below it
   by the rail's own height. Measured at 1280: `specrow`, `distances`,
   `amenities`, `cancellation`, `good-to-know` and `related` all at x=830 in
   the 338px rail column; the h1 at x=97. At 768 the rail's `order:-1` put the
   BOOKING CARD (y=597) 1300px ABOVE the villa name (y=1909).

   This layer fixes the structure with CSS placement only — no section is
   moved in the source order, so the 390/768/900/999 dock bands, the consent
   lift and the F5 `bookcol` P0 fix all keep working untouched.

   The template it produces is a product page, in this order, one reading
   column: title and facts -> gallery -> section nav -> overview -> speciality
   and USPs -> amenities -> location -> house rules -> cancellation ->
   payment -> FAQ -> reviews -> related. The price/booking rail is a fixed
   second column at >=1000px; below that it flows under the header.

   Load order: it is the LAST villa-only sheet, at the end of the detail
   renderer's extraHead, so it can shape the template over villa-premium.css
   without !important. launch-polish.css stays the last *global* polish sheet
   and is loaded above it. Public only — nothing reservation-owned is
   restyled, and the card must keep its grid column 2 / row 1 at >=1000 (F5).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Structure. One reading column. Every content child is pinned to column
   1, so the page reads downwards instead of zig-zagging between a 676px
   column and the 338px rail column.
   -------------------------------------------------------------------------- */
body[data-page="villa"] .layout2 > :not(.bookcol) {
  grid-column: 1;
  min-width: 0;
}

/* The measure of the reading column: prose, headings and the section nav all
   stop at a comfortable 64 characters so lines do not run the width of a
   desktop screen. */
body[data-page="villa"] .layout2 .villahead,
body[data-page="villa"] .layout2 .block,
body[data-page="villa"] .layout2 .vibeblock,
body[data-page="villa"] .layout2 .uspblock,
body[data-page="villa"] .layout2 nav.villatabs,
body[data-page="villa"] .layout2 .specrow {
  max-width: 64ch;
}

@media (min-width: 1000px) {
  /* rail: fixed column, sticky, its own scroll cleared by villa-premium; the
     alignment keeps the card's top edge level with the title. */
  body[data-page="villa"] .layout2 {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
  body[data-page="villa"] .layout2 .bookcol { align-self: start; }
  /* gallery and the two-column band keep the full width so the photos are
     not squeezed into the reading measure */
  body[data-page="villa"] .layout2 .villahead { max-width: none; }
}

/* --------------------------------------------------------------------------
   2. Title block. Eyebrow, name, facts, one price line — in that order, tight,
   with the brass hairline that already runs under every h2 in the body.
   -------------------------------------------------------------------------- */
body[data-page="villa"] .villahead {
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s5);
}
body[data-page="villa"] .villahead .eyebrow {
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
  margin: 0 0 .5rem;
}
body[data-page="villa"] .villahead h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.028em;
  margin: 0 0 .6rem;
  text-wrap: balance;
}
body[data-page="villa"] .villahead .vsub { font-size: .95rem; color: var(--ink-3); }

/* The facts row: chips wrap onto as many lines as they need instead of
   fighting for one, and the gaps stay even so it reads as a list of facts,
   not as debris. */
body[data-page="villa"] .villahead .vheadrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  margin: .25rem 0 .75rem;
}
body[data-page="villa"] .villahead .vsub { flex: 0 0 100%; }
body[data-page="villa"] .villahead .vbadges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

/* The price line in the header is a summary, the card is the decision — keep
   it quiet and inline, above the rule, not as a second hero. */
body[data-page="villa"] .villahead .vprice {
  margin: .25rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   3. Section nav. A real in-page index: wraps (D11), sticks under the site
   header on desktop, and is visually a band rather than a row of loose links.
   -------------------------------------------------------------------------- */
body[data-page="villa"] nav.villatabs {
  position: sticky;
  top: var(--hdr-h, 64px);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .35rem;
  padding: .45rem 0;
  margin: 0 0 var(--s5);
  background: linear-gradient(var(--bg) 72%, rgba(250, 248, 244, 0));
  border-bottom: 1px solid var(--line);
}
body[data-page="villa"] nav.villatabs a {
  padding: 0 .7rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: .875rem;
  color: var(--ink-2);
  text-decoration: none;
}
body[data-page="villa"] nav.villatabs a:hover,
body[data-page="villa"] nav.villatabs a:focus-visible {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   4. Modules. Every body section is a module of the same shape: generous
   space above, a display-serif heading with the brass rule already defined in
   lux.css, then the content. One rhythm for all twelve, so the page has a
   beat instead of twelve different inventions.
   -------------------------------------------------------------------------- */
body[data-page="villa"] .block {
  border-top: 1px solid var(--line);
  padding-top: var(--s5);
  margin-top: var(--s7);
}
body[data-page="villa"] .block:first-of-type { margin-top: var(--s5); }
body[data-page="villa"] .block h2,
body[data-page="villa"] .vibeblock h3,
body[data-page="villa"] .uspblock h3 {
  font-family: "Villa Display", "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  letter-spacing: -.01em;
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: var(--s4);
}
body[data-page="villa"] .block h2 small {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: .5rem;
  white-space: nowrap;
}

/* Body copy: readable size, generous leading, hard measure. */
body[data-page="villa"] .prose {
  font-size: 1.0625rem;
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 60ch;
}
body[data-page="villa"] .prose > br { line-height: 2.1; }

/* 4b. Overview fold. Long descriptions are cut at ~10 lines with a fade and
   re-opened by a real <label> on a checkbox (no JS); the text stays in the
   DOM and findable. The control only renders when the description is long. */
body[data-page="villa"] #desc { position: relative; }
body[data-page="villa"] #desc .foldcb {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
body[data-page="villa"] #desc .foldcb:not(:checked) ~ .prose {
  max-height: 17em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
body[data-page="villa"] #desc .foldlab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  margin-top: .5rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 1px;
}
body[data-page="villa"] #desc .foldlab::after {
  content: "";
  width: .5rem;
  height: .5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-micro);
}
body[data-page="villa"] #desc .foldcb:checked ~ .foldlab::after {
  transform: rotate(-135deg) translateY(-1px);
}
body[data-page="villa"] #desc .foldlab-less { display: none; }
body[data-page="villa"] #desc .foldcb:checked ~ .foldlab .foldlab-more { display: none; }
body[data-page="villa"] #desc .foldcb:checked ~ .foldlab .foldlab-less { display: inline; }
body[data-page="villa"] #desc .foldcb:focus-visible ~ .foldlab {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 4c. Amenities: chips become a two-column list of rows with a tick, at the
   12.5px floor launch-polish already set for small print. */
body[data-page="villa"] .amen {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 64ch;
}
body[data-page="villa"] .amen li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .35rem 0;
  background: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line-2);
  font-size: .95rem;
  color: var(--ink-2);
}
body[data-page="villa"] .amen li::before {
  content: "";
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: .18rem;
  background: var(--ok);
  color: #fff;
  border-radius: 50%;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23000" d="M6.2 11.4L3 8.2l1.3-1.3 1.9 1.9 4.5-4.5L12 5.6z"/></svg>') center / 100% no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="%23000" d="M6.2 11.4L3 8.2l1.3-1.3 1.9 1.9 4.5-4.5L12 5.6z"/></svg>') center / 100% no-repeat;
  background-color: var(--ok);
}
body[data-page="villa"] .flagrow { margin-top: var(--s4); }

/* 4d. Distances: label left, value right, hairline between — a table that
   reads at a glance instead of a run of short lines. */
body[data-page="villa"] .disttable { width: 100%; border-collapse: collapse; max-width: 44ch; }
body[data-page="villa"] .disttable th,
body[data-page="villa"] .disttable td { padding: .45rem 0; border-bottom: 1px solid var(--line-2); }
body[data-page="villa"] .disttable td:last-child,
body[data-page="villa"] .disttable th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body[data-page="villa"] .dist-note { margin-top: .6rem; }

/* 4e. House rules: two columns of short facts at >=760, one column on
   phones; the bullet is a brass diamond, not a dot. */
body[data-page="villa"] .rules {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .3rem 1.5rem;
  max-width: 64ch;
  font-size: .95rem;
  color: var(--ink-2);
}
body[data-page="villa"] .rules li {
  position: relative;
  padding-left: 1.15rem;
  margin: 0;
  line-height: 1.5;
  break-inside: avoid;
}
body[data-page="villa"] .rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: .42rem;
  height: .42rem;
  background: var(--accent-2);
  transform: rotate(45deg);
}

/* 4f. Payment: the deposit band is the one thing to read here. */
body[data-page="villa"] .paypanel {
  display: grid;
  gap: .5rem;
  max-width: 64ch;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s4);
  background: var(--card);
}

/* 4g. FAQ: <details> rows as one bordered list, each summary a 44px row. */
body[data-page="villa"] .faq { max-width: 64ch; border-top: 1px solid var(--line-2); }
body[data-page="villa"] .faq details { border-bottom: 1px solid var(--line-2); }
body[data-page="villa"] .faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: .35rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
}
body[data-page="villa"] .faq summary::-webkit-details-marker { display: none; }
body[data-page="villa"] .faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.1rem;
  color: var(--accent-2);
}
body[data-page="villa"] .faq details[open] summary::after { content: "–"; }
body[data-page="villa"] .faq p { margin: .1rem 0 .8rem; color: var(--ink-2); font-size: .95rem; }

/* 4h. Speciality + USP lists: same module rhythm as everything else. */
body[data-page="villa"] .specrow {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0;
  margin: 0 0 var(--s5);
  list-style: none;
}
body[data-page="villa"] .specrow li {
  font-size: .8125rem;
  padding: .3rem .65rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: var(--card);
}
body[data-page="villa"] .uspblock,
body[data-page="villa"] .vibeblock {
  border-top: 1px solid var(--line);
  padding-top: var(--s5);
  margin-top: var(--s7);
}
body[data-page="villa"] .vibeblock .vibe {
  font-family: "Villa Display", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 48ch;
}
body[data-page="villa"] .usplist { columns: 2; column-gap: 2rem; max-width: 64ch; }

/* 4j. Enquiry CTA (D28). On an inquiry villa the enquiry button is the only
   working path, so it must not look like the secondary option beside the
   book CTA — give it the strong outline and full weight it never had. */
body[data-page="villa"] .bc-actions #bc-enquire {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
  background: var(--card);
}
body[data-page="villa"] .bc-actions #bc-enquire:hover { background: var(--accent-soft); }

/* 4k. Reviews and the "other villas" band close the page under a double
   rule, and related cards use the full content column. */
body[data-page="villa"] #reviews { border-top: 1px solid var(--line); }
body[data-page="villa"] #related,
body[data-page="villa"] #reviews + section {
  border-top: 3px double var(--line);
  padding-top: var(--s6);
  margin-top: var(--s7);
}

/* --------------------------------------------------------------------------
   5. Gallery. Same mosaic, but framed and captioned like a gallery: even
   inset radius, captions on a scrim at the 12px floor.
   -------------------------------------------------------------------------- */
body[data-page="villa"] .gallery2 { gap: 6px; padding: 0 var(--gutter); }
body[data-page="villa"] .gallery2 .gcell { overflow: hidden; border-radius: var(--r-md); }
body[data-page="villa"] .gallery2 .gcell figcaption {
  font-size: 12px;
  padding: .35rem .6rem;
  background: linear-gradient(transparent, rgba(9, 24, 21, .55));
  color: #fff;
}
body[data-page="villa"] .gshowall {
  font-weight: 600;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   6. Tablet band (761–999). One column, and the title must come first — the
   rail's own `order:-1` was putting the booking card 1300px above the name.
   -------------------------------------------------------------------------- */
@media (min-width: 761px) and (max-width: 999px) {
  body[data-page="villa"] .layout2 {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    gap: var(--s5);
  }
  body[data-page="villa"] .layout2 .villahead { order: -3; }
  body[data-page="villa"] .layout2 nav.villatabs { order: -2; position: static; }
  /* the card is a slab at 676px here — cap it and centre it so its one-input
     rows keep their desktop proportions instead of floating in dead space */
  body[data-page="villa"] .layout2 .bookcol {
    order: -1;
    position: static;
    max-width: 540px;
    width: 100%;
    justify-self: center;
  }
  /* one column here is 646px ≈ 75ch: let the modules use it */
  body[data-page="villa"] .layout2 > .block,
  body[data-page="villa"] .layout2 > .vibeblock,
  body[data-page="villa"] .layout2 > .uspblock,
  body[data-page="villa"] .layout2 > nav.villatabs,
  body[data-page="villa"] .layout2 > .villahead,
  body[data-page="villa"] .layout2 .prose,
  body[data-page="villa"] .layout2 .amen,
  body[data-page="villa"] .layout2 .rules,
  body[data-page="villa"] .layout2 .faq,
  body[data-page="villa"] .layout2 .paypanel,
  body[data-page="villa"] .layout2 .disttable { max-width: none; }
  body[data-page="villa"] .layout2 .amen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-page="villa"] .layout2 .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   7. Phones (<=760). The card itself is hidden here by villa-premium (the
   dock carries dates, price and CTA), so this band is about the document:
   a big quiet title, a 36px module rhythm, one-column amenities and rules,
   and no fold control fighting the sticky bar.
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  body[data-page="villa"] .layout2 { display: block; }
  body[data-page="villa"] .villahead { padding-bottom: var(--s4); margin-bottom: var(--s4); }
  body[data-page="villa"] .villahead h1 { font-size: 1.7rem; }
  body[data-page="villa"] .villahead .vbadges { gap: .3rem; }
  body[data-page="villa"] nav.villatabs {
    position: sticky;
    top: var(--hdr-h, 56px);
    margin-bottom: var(--s4);
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  body[data-page="villa"] nav.villatabs::-webkit-scrollbar { display: none; }
  body[data-page="villa"] .block,
  body[data-page="villa"] .vibeblock,
  body[data-page="villa"] .uspblock { margin-top: 36px; padding-top: 24px; }
  body[data-page="villa"] .block h2 { font-size: 1.3rem; }
  body[data-page="villa"] .prose { font-size: 1rem; line-height: 1.62; }
  body[data-page="villa"] #desc .foldcb:not(:checked) ~ .prose { max-height: 15em; }
  body[data-page="villa"] .amen { grid-template-columns: 1fr; }
  body[data-page="villa"] .rules,
  body[data-page="villa"] .usplist { columns: 1; display: block; }
  body[data-page="villa"] .rules li { margin-bottom: .4rem; }
  body[data-page="villa"] .gallery2 { padding: 0 var(--gutter); gap: 4px; }
}

/* --------------------------------------------------------------------------
   8. Houses and rules of engagement for anyone editing this layer.
   - Never load this sheet after launch-polish.css.
   - Never move `.bookcol` out of column 2 / row 1 at >=1000 (F5 P0).
   - The dock bands (site.css:142, lux.css:634/636/675) stay as they are.
   - reservation-scroll.regress.js must stay 21 / 0.
   -------------------------------------------------------------------------- */
