/*
Theme Name: Villa Saint-Georges-d'Orques
Theme URI: https://villa-saint-georges-dorques.com
Author: Carrie Watts / Consilium Design Agency
Description: Custom bilingual (FR/EN) brochure theme for the private sale of a villa in 34680 Saint-Georges-d'Orques (Hérault, France). Lightweight, SEO-optimised, schema-rich. No page-builder dependency.
Version: 1.6.0
Requires at least: 6.0
Requires PHP: 8.0
License: All Rights Reserved
Text Domain: villa-sgo
*/

/* ----------------------------------------------------------------------------
   1. CSS variables — adjust these to retune the look without touching markup
---------------------------------------------------------------------------- */
:root {
  /* Each colour represents a real thing in the property:
   *   Sea-sand    — the Mediterranean sand 25 min away, page background
   *   Stone       — drystone walls in the garden, body text + secondary
   *   Pool        — the actual cocktail-pool turquoise in midday sun, action colour
   *   Lilac       — wisteria + lilacs in the garden, decorative accents only
   *   Wood        — shutters + flagstone warmth, footer + decorative
   *
   * Discipline: sand dominates. Pool is the action colour. Lilac and wood
   * are decorative only (never compete with pool for buyer attention).
   * Pool-bright (#9ed6d4) is for backgrounds/washes ONLY — it has too low
   * contrast with white to be used for buttons or text.
   * All body-text contrasts verified WCAG 2.1 AA ≥ 4.5:1.
   */
  --c-bg:             #fbf6ec; /* sea sand — dominant page background */
  --c-surface:        #ffffff; /* white — card backings, photo frames */
  --c-text:           #4a4438; /* warm dark stone — body text, ratio 9.4:1 on sand */
  --c-text-soft:      #7a7062; /* pale stone — secondary text, ratio 4.5:1 */
  --c-accent:         #3d8c8a; /* deep pool — links, buttons (ratio with white = 4.5:1) */
  --c-accent-hover:   #4ea8a5; /* pool in sunlight — hover/active brightness */
  --c-accent-bright:  #9ed6d4; /* actual pool water — decorative washes, eyebrow backgrounds */
  --c-lilac:          #a994c2; /* wisteria — decorative eyebrows, accent washes */
  --c-wood:           #7a6850; /* wooden shutter / drystone wall warmth — footer */
  --c-stone:          #b8a98a; /* drystone wall midtone — decorative beige */
  --c-leaf:           #9bb087; /* silver-olive — used SPARINGLY: just garden-themed sections */
  --c-line:           #e5dac6; /* parchment — soft separators */
  /* Legacy compat — old var names that still appear in the codebase.
   * These map to the new palette so existing CSS keeps working without
   * grep-and-replace pain. */
  --c-accent-dark:    #4ea8a5; /* now points to hover (was a darker accent) */
  --c-terracotta:     #a994c2; /* now points to lilac (was warm beige) */
  --c-pistachio:      #9ed6d4; /* now points to pool-bright (was olive-green) */

  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --gutter:    clamp(1rem, 4vw, 2.5rem);
  --radius:    4px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.06);
}

/* ----------------------------------------------------------------------------
   2. Reset / base
---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
a:hover { color: var(--c-accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
  color: var(--c-text);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-top: 2em;
  position: relative;
  padding-bottom: .35em;
}
/* Small olive-leaf underline — the "hint of green" tying the palette to the garden.
   60px wide, 2px tall, sits below each H2. Subtle by design — buyers feel it
   more than they see it consciously. */
h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--c-leaf);
  margin-top: .35em;
}
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p  { margin: 0 0 1em; }

/* ----------------------------------------------------------------------------
   3. Layout primitives
---------------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section--alt { background: var(--c-surface); border-block: 1px solid var(--c-line); }
.section--accent { background: var(--c-accent); color: #fff; }
.section--accent h2 { color: #fff; }
.section--accent a { color: #fff; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--c-lilac); /* wisteria — small decorative role */
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   4. Header
---------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92); /* white with transparency */
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1rem;
  gap: 1.5rem;
}
.site-brand {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--c-text);
  line-height: 1.1;
}
.site-brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-text-soft);
  font-weight: 400;
  margin-top: 2px;
}
.site-nav { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--c-text); font-size: .95rem; }
.site-nav a:hover { color: var(--c-accent); }
/* When a nav link is also a button (the "Visiter" CTA), restore the button's
   white text — without this, .site-nav a (specificity 0,2,0) beats .btn (0,1,0). */
.site-nav a.btn { color: #fff; }
.site-nav a.btn:hover { color: #fff; }
.lang-switch {
  border: 1px solid var(--c-line);
  border-radius: 99px;
  padding: 4px;
  display: inline-flex;
  font-size: .8rem;
}
.lang-switch a {
  padding: .25rem .7rem;
  border-radius: 99px;
  text-decoration: none;
}
.lang-switch a.is-active { background: var(--c-accent); color: #fff; }

/* ----------------------------------------------------------------------------
   5. Hero
---------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: clamp(420px, 70vh, 720px);
  display: flex; align-items: end;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
  z-index: -1;
}
.hero img.hero__image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero__inner { padding-block: clamp(2rem, 5vw, 4rem); width: 100%; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero p.hero__lede {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  max-width: 55ch;
  opacity: .95;
}
.hero__meta {
  display: flex; gap: 2rem; flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: .9rem;
}
.hero__meta strong { display: block; font-size: 1.5rem; font-family: var(--font-serif); font-weight: 500; }

/* ----------------------------------------------------------------------------
   6. Property facts strip (under the hero)
---------------------------------------------------------------------------- */
.facts {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  padding-block: 1.5rem;
}
.facts__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 2rem;
  margin: 0; padding: 0; list-style: none;
}
.facts__list li {
  text-align: center;
}
.facts__list dt {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-text-soft);
  margin-bottom: .25rem;
}
.facts__list dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
   7. Gallery
---------------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 200px;
  gap: 6px;
}
.gallery a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  position: relative;
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.gallery a:hover img { transform: scale(1.04); }

/* Mosaic placement — designed for 12 photos */
.gallery a:nth-child(1) { grid-column: span 6; grid-row: span 2; }
.gallery a:nth-child(2) { grid-column: span 3; grid-row: span 1; }
.gallery a:nth-child(3) { grid-column: span 3; grid-row: span 1; }
.gallery a:nth-child(4) { grid-column: span 3; grid-row: span 1; }
.gallery a:nth-child(5) { grid-column: span 3; grid-row: span 1; }
.gallery a:nth-child(6) { grid-column: span 4; grid-row: span 2; }
.gallery a:nth-child(7) { grid-column: span 4; grid-row: span 1; }
.gallery a:nth-child(8) { grid-column: span 4; grid-row: span 1; }
.gallery a:nth-child(9) { grid-column: span 4; grid-row: span 1; }
.gallery a:nth-child(10){ grid-column: span 4; grid-row: span 1; }
.gallery a:nth-child(11){ grid-column: span 6; grid-row: span 1; }
.gallery a:nth-child(12){ grid-column: span 6; grid-row: span 1; }

@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery a { grid-column: span 1 !important; grid-row: span 1 !important; }
}

/* ----------------------------------------------------------------------------
   8. Buttons
---------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--c-accent-dark); color: #fff; }
.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.6);
}
.btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ----------------------------------------------------------------------------
   9. Feature blocks
---------------------------------------------------------------------------- */
.feature {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0;
}
.feature__icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  color: var(--c-accent);
}
.feature h3 { font-size: 1.05rem; margin-bottom: .25em; font-family: var(--font-sans); font-weight: 600; }
.feature p { font-size: .95rem; color: var(--c-text-soft); margin: 0; }

/* ----------------------------------------------------------------------------
   10. DPE / energy block (legally required visual)
---------------------------------------------------------------------------- */
.dpe {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.dpe__bars { display: flex; flex-direction: column; gap: 4px; margin: 1rem 0; }
.dpe__bar {
  display: flex; align-items: center;
  height: 28px;
  border-radius: 3px;
  padding: 0 .75rem;
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  position: relative;
}
.dpe__bar.is-current::after {
  content: "▶";
  position: absolute;
  right: -22px;
  color: var(--c-text);
  font-size: 1.1rem;
}
.dpe__bar--A { background: #319834; width: 35%; }
.dpe__bar--B { background: #54a737; width: 45%; }
.dpe__bar--C { background: #c0d343; width: 55%; }
.dpe__bar--D { background: #fff138; color: #2b2a26; width: 65%; }
.dpe__bar--E { background: #f8b133; width: 75%; }
.dpe__bar--F { background: #e8511c; width: 85%; }
.dpe__bar--G { background: #d70d12; width: 95%; }

/* GES (greenhouse-gas) ramp — matches the blue ADEME palette on the official
   2021+ DPE certificate. A = very pale blue (best), G = near-black navy
   (worst). Distinct from the energy ramp so colour-blind buyers don't
   conflate them. Hex values aligned with the ADEME style sheet. */
.dpe__bar--ges-A { background: #b3d9ed; color: #2b2a26; width: 35%; }
.dpe__bar--ges-B { background: #8cc1de; color: #2b2a26; width: 45%; }
.dpe__bar--ges-C { background: #5fa3c9; width: 55%; }
.dpe__bar--ges-D { background: #3a7fab; width: 65%; }
.dpe__bar--ges-E { background: #2a5d85; width: 75%; }
.dpe__bar--ges-F { background: #1f3f5e; width: 85%; }
.dpe__bar--ges-G { background: #11223a; width: 95%; }

/* N° ADEME — visually clear, easy to read & copy. */
.dpe__ademe-no {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .95rem;
  letter-spacing: .02em;
  user-select: all;
}

/* New supporting structure for the expanded DPE block (v1.5.1) */
.dpe__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 2rem;
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--c-line);
}
.dpe__validity {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.4rem;
  font-size: .9rem;
  color: var(--c-text-soft);
}
.dpe__validity strong { color: var(--c-text); }
.dpe__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 720px) { .dpe__grid { grid-template-columns: 1fr; } }
.dpe__col-title {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  color: var(--c-text-soft);
  margin-bottom: .6rem;
}
.dpe__bar-letter { min-width: 1.1em; }
.dpe__bar-value { margin-left: auto; font-weight: 500; font-size: .85rem; }
.dpe__footnote {
  font-size: .85rem;
  color: var(--c-text-soft);
  margin: .8rem 0 0;
  line-height: 1.5;
}
.dpe__costs {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--c-bg);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
}
.dpe__costs-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-text-soft);
  font-weight: 600;
}
.dpe__costs-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-text);
}
.dpe__costs-note {
  flex-basis: 100%;
  font-size: .8rem;
  color: var(--c-text-soft);
  line-height: 1.5;
}
.dpe__verify {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.dpe__verify-qr img {
  display: block;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--c-line);
  border-radius: 4px;
}
.dpe__verify-text {
  flex: 1;
  min-width: 220px;
  font-size: .9rem;
}
.dpe__verify-text a {
  color: var(--c-accent);
  text-decoration: underline;
  word-break: break-all;
}

/* ----------------------------------------------------------------------------
   11. Contact form
---------------------------------------------------------------------------- */
.form { max-width: 600px; margin: 0 auto; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form label { display: block; margin-bottom: 1rem; font-size: .9rem; }
.form label > span { display: block; margin-bottom: .35rem; color: var(--c-text-soft); }
.form input,
.form textarea,
.form select {
  width: 100%;
  padding: .75rem .9rem;
  font: inherit;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--c-text);
}
/* Form fields stay pure white because the page bg is now beige —
   pure white reads as "this is the input you write into" while the
   beige surrounds it like paper. */
.form input:focus,
.form textarea:focus { outline: 2px solid var(--c-accent); outline-offset: -1px; border-color: transparent; }
.form textarea { min-height: 140px; resize: vertical; }
.form__consent { font-size: .85rem; color: var(--c-text-soft); margin: 1rem 0; }
.form__consent input { width: auto; margin-right: .5rem; }

@media (max-width: 600px) {
  .form__row { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------------
   11b. Specifications — expandable details block
---------------------------------------------------------------------------- */
.specs {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 0;
}
.specs__toggle {
  cursor: pointer;
  list-style: none;
  padding: 1.5rem clamp(1.25rem, 3vw, 2rem);
  position: relative;
  user-select: none;
}
.specs__toggle::-webkit-details-marker { display: none; }
.specs__toggle h2 {
  margin: .25em 0 .25em !important;
  display: inline-block;
}
.specs__toggle h2::after { content: none; }   /* skip the olive underline here */
.specs__toggle::after {
  content: "";
  position: absolute;
  right: clamp(1.25rem, 3vw, 2rem);
  top: 50%;
  width: 12px; height: 12px;
  border-right: 2px solid var(--c-accent);
  border-bottom: 2px solid var(--c-accent);
  transform: translateY(-50%) rotate(45deg);
  transition: transform .25s ease;
}
.specs[open] .specs__toggle::after {
  transform: translateY(-25%) rotate(-135deg);
}
.specs__hint {
  display: block;
  font-size: .9rem;
  color: var(--c-text-soft);
  margin-top: .5em;
}
.specs__list {
  padding: 0 clamp(1.25rem, 3vw, 2rem) 1.5rem;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 720px) {
  .specs__list { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.spec {
  display: grid;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-line);
}
.spec--has-image { grid-template-columns: 120px 1fr; align-items: start; }
.spec--text-only { grid-template-columns: 1fr; }
.spec__image img { width: 100%; height: 120px; object-fit: cover; }
.spec__body h3 {
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 600;
  margin: 0 0 .35em;
}
.spec__body p {
  font-size: .92rem;
  color: var(--c-text-soft);
  margin: 0;
  line-height: 1.6;
}

/* ----------------------------------------------------------------------------
   11d. Details page — magazine-style row layout
   Used on /details/ — alternating image-left / image-right rows, each one
   a self-contained section with H2 + paragraph. Mobile stacks vertically.
---------------------------------------------------------------------------- */
.detail-row {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}
.detail-row:not(.detail-row--text-only) {
  grid-template-columns: 1fr 1fr;
}
.detail-row--text-only {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}
.detail-row__body h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin-top: 0;
}
.detail-row__body h2::after {
  /* Smaller olive underline on detail rows than on main H2s */
  width: 40px;
}
@media (max-width: 720px) {
  .detail-row:not(.detail-row--text-only) { grid-template-columns: 1fr; }
}

.detail-hero__image img {
  width: 100%;
}

/* ----------------------------------------------------------------------------
   11c. Editorial first-word treatment for major H2s — opt-in via class
   The first word of the heading is replicated as a faded backdrop, big
   italic serif, slightly overflowing left. Subtle but distinctive.
   Applied via class="h2--editorial" on specific section H2s where it makes
   sense — NOT every H2 (would be visual noise).
---------------------------------------------------------------------------- */
.h2--editorial {
  position: relative;
  isolation: isolate;
}
.h2--editorial::before {
  content: attr(data-first-word);
  position: absolute;
  top: -0.45em;
  left: -0.15em;
  font-style: italic;
  font-weight: 500;
  font-size: 1.85em;
  line-height: 0.85;
  color: var(--c-accent-bright);
  opacity: 0.30;
  pointer-events: none;
  z-index: -1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
@media (max-width: 600px) {
  /* Mobile: tone the effect down so it doesn't overflow narrow screens */
  .h2--editorial::before {
    font-size: 1.4em;
    opacity: 0.22;
    top: -0.3em;
  }
}

/* ----------------------------------------------------------------------------
   12. Footer
---------------------------------------------------------------------------- */
.site-footer {
  background: var(--c-wood); /* warm wooden-shutter brown */
  color: #f5ebd9;            /* cream — ratio 8.4:1 on wood-brown, well above WCAG AA */
  padding: 3rem 0 2rem;
  font-size: .9rem;
}
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: var(--c-accent-bright); } /* pool-bright on hover — visual joke */
.site-footer__legal {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #968372; /* slightly lighter wood for the divider */
  font-size: .8rem;
  color: #c9b7a0;                /* muted warm taupe, ratio 4.5:1 — meets WCAG AA */
}

/* ----------------------------------------------------------------------------
   13. Utilities
---------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--c-text-soft); max-width: 65ch; margin-inline: auto; }
