/* =========================================================
   Villa I Tre Fratelli — Sagone, Corse
   Palette derived from the villa itself:
   granite (walls), tomette (terrace tiles), volet (shutters),
   pin (parasol pine), mer (golfe de Sagone), chaux (walls)
   ========================================================= */

:root {
  --granite:  #8a7a66;
  --tomette:  #c1663f;
  --volet:    #6b8f6a;
  --pin:      #3d4a3a;
  --mer:      #2f6d80;
  --chaux:    #f5f1e8;
  --chaux-2:  #ebe4d6;
  --encre:    #2b2723;
  --encre-60: #6d6660;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 2px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--chaux);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--mer); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 720px; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.35rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tomette);
  margin: 0 0 1rem;
}

.lede { font-size: 1.2rem; color: var(--encre-60); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,241,232,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--chaux-2);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px;
}
.brand { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; color: var(--encre); line-height: 1.1; }
.brand span { display: block; font-family: var(--sans); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--granite); }

.nav { display: flex; gap: 1.75rem; align-items: center; }
.nav a {
  font-size: .9rem; text-decoration: none; color: var(--encre);
  padding: .3rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--tomette); }
.nav a.btn { border: 0; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--granite);
  border-radius: var(--radius); padding: .5rem .7rem; cursor: pointer; font-size: 1rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--chaux); border-bottom: 1px solid var(--chaux-2);
    padding: .5rem var(--gutter) 1.25rem;
  }
  .nav:not(.open) { display: none; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--chaux-2); }
  .nav a.btn { margin-top: .75rem; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--tomette); color: #fff;
  padding: .8rem 1.6rem; border-radius: var(--radius);
  text-decoration: none; font-size: .9rem; font-weight: 500;
  letter-spacing: .04em; border: 1px solid var(--tomette);
  cursor: pointer; transition: background .2s, color .2s;
}
.btn:hover { background: #a8542f; border-color: #a8542f; color: #fff; }
.btn-ghost { background: transparent; color: var(--encre); border-color: var(--granite); }
.btn-ghost:hover { background: var(--encre); border-color: var(--encre); color: var(--chaux); }

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

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(88vh, 760px); display: flex; align-items: flex-end; }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,17,14,.78) 0%, rgba(20,17,14,.25) 45%, rgba(20,17,14,.1) 100%);
}
.hero-content { position: relative; color: #fff; padding-block: 3.5rem; max-width: 760px; }
.hero-content h1 { color: #fff; }
.hero-content .eyebrow { color: #f0c8a8; }
.hero-content p { font-size: 1.15rem; color: rgba(255,255,255,.9); max-width: 54ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero-actions .btn-ghost:hover { background: #fff; color: var(--encre); border-color: #fff; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-alt { background: var(--chaux-2); }
.section-dark { background: var(--pin); color: var(--chaux); }
.section-dark h2, .section-dark h3 { color: var(--chaux); }
.section-dark .eyebrow { color: #b8cbb2; }

/* ---------- Key figures ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--chaux-2); border: 1px solid var(--chaux-2); }
.fact { background: var(--chaux); padding: 1.75rem 1.25rem; text-align: center; }
.fact strong { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--tomette); }
.fact span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-60); }
@media (max-width: 700px) { .facts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split.reverse .split-media { order: 2; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
}
.split-media img { border-radius: var(--radius); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card { background: var(--chaux); border: 1px solid var(--chaux-2); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card img { aspect-ratio: 4/3; object-fit: cover; }
.card-body { padding: 1.5rem; }
.card-body h3 { margin-bottom: .35rem; }
.card-body p { margin: 0; color: var(--encre-60); font-size: .95rem; }

/* ---------- Feature list ---------- */
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .1rem 2rem; }
.features li { padding: .6rem 0 .6rem 1.5rem; position: relative; border-bottom: 1px solid var(--chaux-2); font-size: .95rem; }
.features li::before { content: "—"; position: absolute; left: 0; color: var(--tomette); }
.section-dark .features li { border-bottom-color: rgba(245,241,232,.15); }

/* ---------- Gallery ---------- */
.gallery-filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter {
  background: transparent; border: 1px solid var(--chaux-2); color: var(--encre-60);
  padding: .5rem 1.1rem; border-radius: 100px; cursor: pointer;
  font-size: .85rem; font-family: var(--sans); transition: all .2s;
}
.filter:hover { border-color: var(--granite); }
.filter.active { background: var(--encre); border-color: var(--encre); color: var(--chaux); }

.grid { columns: 3; column-gap: 1rem; }
@media (max-width: 900px) { .grid { columns: 2; } }
@media (max-width: 560px) { .grid { columns: 1; } }
.grid figure { break-inside: avoid; margin: 0 0 1rem; position: relative; cursor: zoom-in; overflow: hidden; border-radius: var(--radius); }
.grid figure img { transition: transform .5s ease; width: 100%; }
.grid figure:hover img { transform: scale(1.04); }
.grid figcaption {
  position: absolute; inset: auto 0 0 0; padding: 2rem .9rem .7rem;
  background: linear-gradient(to top, rgba(20,17,14,.8), transparent);
  color: #fff; font-size: .8rem; opacity: 0; transition: opacity .3s;
}
.grid figure:hover figcaption, .grid figure:focus-within figcaption { opacity: 1; }
.grid figure.hide { display: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,17,14,.95);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox-cap { position: absolute; bottom: 1.5rem; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: .85rem; }
.lb-btn {
  position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1;
}
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* ---------- Activities ---------- */
.activity { border-top: 1px solid var(--chaux-2); padding-block: 2.25rem; display: grid; grid-template-columns: 190px 1fr auto; gap: 2rem; align-items: baseline; }
.activity:last-child { border-bottom: 1px solid var(--chaux-2); }
.activity h3 { margin: 0; }
.activity p { margin: .35rem 0 0; color: var(--encre-60); font-size: .95rem; }
.activity-meta { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tomette); white-space: nowrap; }
@media (max-width: 760px) {
  .activity { grid-template-columns: 1fr; gap: .5rem; }
  .activity-meta { order: -1; }
}

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 1rem; border-bottom: 1px solid var(--chaux-2); }
th { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-60); font-weight: 600; }
td strong { font-family: var(--serif); font-size: 1.25rem; color: var(--tomette); }

/* ---------- Form ---------- */
.form { display: grid; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 500; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--encre);
  padding: .8rem .9rem; border: 1px solid var(--chaux-2);
  background: #fff; border-radius: var(--radius); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--mer); outline: 0; box-shadow: 0 0 0 3px rgba(47,109,128,.12); }
.field textarea { min-height: 140px; resize: vertical; }
.field-hint { font-size: .78rem; color: var(--encre-60); }
.hp { position: absolute; left: -9999px; }

.form-status { padding: 1rem 1.25rem; border-radius: var(--radius); font-size: .92rem; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: #e7f0e6; border: 1px solid var(--volet); color: #2f4d2e; }
.form-status.err { background: #f7e4dc; border: 1px solid var(--tomette); color: #7d3418; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pin); color: rgba(245,241,232,.75); padding-block: 3.5rem 2rem; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.site-footer h4 { font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--chaux); margin: 0 0 1rem; }
.site-footer a { color: rgba(245,241,232,.75); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-brand { font-family: var(--serif); font-size: 1.6rem; color: var(--chaux); margin: 0 0 .5rem; }
.footer-bottom { border-top: 1px solid rgba(245,241,232,.15); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .8rem; color: rgba(245,241,232,.5); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
/* Language switcher — appended to style.css at build */
.lang-switch { display: flex; gap: .35rem; align-items: center; margin-left: .5rem; }
.lang-switch a {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--encre-60); padding: .3rem .5rem;
  border: 1px solid var(--chaux-2); border-radius: var(--radius); line-height: 1;
}
.lang-switch a:hover { border-color: var(--granite); color: var(--encre); }
.lang-switch a[aria-current="true"] { background: var(--encre); border-color: var(--encre); color: var(--chaux); }
@media (max-width: 860px) {
  .lang-switch { margin: .75rem 0 0; }
  .nav .lang-switch a { border: 1px solid var(--chaux-2); padding: .5rem .8rem; flex: 1; text-align: center; }
}

/* Agency callout */
.agency-note {
  border-left: 3px solid var(--volet);
  background: rgba(107,143,106,.08);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .93rem;
}
.agency-note p { margin: 0; }
.agency-note p + p { margin-top: .6rem; }
.agency-note strong { color: var(--pin); }

.price-note { font-size: .82rem; color: var(--encre-60); margin-top: .75rem; }
