/* Wandem Housing — brand stylesheet
   Colors:
     Capri Blu      #0F3344
     Clair          #F4E4D6
     Velvet Wine    #740B33
     Sunburned      #E19439
     Sage Green     #8FA185
   Fonts:
     Titles  → Fraunces (serif, closest free alt to Arsenica)
     Body    → Manrope  (sans,  closest free alt to TT Drugs)
*/

:root {
  --wine: #740B33;
  --wine-dark: #5A0E27;
  --clair: #F4E4D6;
  --clair-soft: #FBF3E9;
  --navy: #0F3344;
  --navy-soft: #1B5064;
  --sun: #E19439;
  --sage: #8FA185;
  --ink: #1C1A18;
  --muted: #6B6560;

  --ff-title: "Fraunces", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --ff-body:  "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 14px rgba(15, 51, 68, 0.08);
  --shadow-md: 0 10px 30px rgba(15, 51, 68, 0.12);

  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--clair-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--ff-title);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.2rem, 4.2vw + 1rem, 4.2rem); }
h2 { font-size: clamp(1.7rem, 2vw + 1rem, 2.6rem); }
h3 { font-size: 1.35rem; }
p  { margin: 0 0 1em; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* ============ Header / Nav ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 228, 214, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(15, 51, 68, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.8rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ff-title);
  font-size: 1.4rem;
  color: var(--wine);
  font-weight: 600;
}
.brand img { height: 42px; width: auto; }
.nav ul {
  list-style: none;
  display: flex;
  gap: 1.4rem;
  margin: 0 0 0 auto;
  padding: 0;
}
.nav ul a {
  color: var(--navy);
  font-weight: 500;
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav ul a:hover { color: var(--wine); border-color: var(--wine); text-decoration: none; }
.nav ul a[aria-current="page"] { color: var(--wine); border-color: var(--wine); }

.btn {
  display: inline-block;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none !important;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--wine); color: var(--clair); }
.btn-primary:hover { background: var(--wine-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--clair); }
.btn-sun { background: var(--sun); color: var(--navy); }
.btn-sun:hover { background: #c97d29; color: var(--clair); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  color: var(--navy);
  cursor: pointer;
}
.nav-toggle svg { width: 28px; height: 28px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { color: var(--wine); }
.hero h1 em { color: var(--navy); font-style: italic; }
.hero .lead {
  font-size: 1.2rem;
  color: var(--navy);
  max-width: 34ch;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--clair);
}
.hero-image svg { width: 100%; height: auto; display: block; }

/* soft blob decoration */
.hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(closest-side, rgba(225, 148, 57, 0.25), transparent);
  z-index: 0;
}

/* ============ Search bar ============ */
.search {
  margin-top: -2.5rem;
  position: relative;
  z-index: 5;
}
.search form {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.7rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: stretch;
}
.search label {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.9rem;
  border-radius: calc(var(--radius) - 4px);
  transition: background 0.15s;
}
.search label:hover { background: var(--clair-soft); }
.search label + label { border-left: 1px solid rgba(15, 51, 68, 0.08); }
.search span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.search input, .search select {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--navy);
  padding: 0.2rem 0;
  outline: none;
  width: 100%;
}
.search select { padding-right: 1.6rem; }
.search button {
  min-width: 56px;
  padding: 0 1.4rem;
}

/* ============ Sezioni ============ */
section { padding: 4rem 0; }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 0.8rem;
}
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ============ Cards ============ */
.grid {
  display: grid;
  gap: 1.4rem;
}
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media { aspect-ratio: 8 / 5; background: var(--clair); }
.card-media svg, .card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card-title { font-family: var(--ff-title); font-size: 1.25rem; color: var(--navy); margin-bottom: 0.3rem; }
.card-meta { font-size: 0.92rem; color: var(--muted); display: flex; gap: 0.8rem; flex-wrap: wrap; }
.card-meta strong { color: var(--wine); font-weight: 700; }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--clair);
  color: var(--wine);
  margin-bottom: 0.6rem;
}
.tag.sun   { background: rgba(225, 148, 57, 0.18); color: #A6631F; }
.tag.sage  { background: rgba(143, 161, 133, 0.2);  color: #4F6348; }
.tag.navy  { background: rgba(15, 51, 68, 0.1);     color: var(--navy); }

/* Category cards (larger, illustrated) */
.cat-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-sm);
  color: #fff;
  transition: transform 0.2s ease;
}
.cat-card:hover { transform: translateY(-4px); text-decoration: none; }
.cat-card svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-card .cat-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.4rem 1.2rem;
  background: linear-gradient(to top, rgba(15, 51, 68, 0.85) 0%, transparent 100%);
  font-family: var(--ff-title);
  font-size: 1.4rem;
}
.cat-card .cat-label small {
  display: block;
  font-family: var(--ff-body);
  font-size: 0.82rem;
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ============ Why Wandem (features) ============ */
.why {
  background: var(--clair);
  border-top: 1px solid rgba(15, 51, 68, 0.06);
  border-bottom: 1px solid rgba(15, 51, 68, 0.06);
}
.feature {
  text-align: left;
}
.feature .icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--wine);
  color: var(--clair);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.feature .icon svg { width: 26px; height: 26px; }
.feature h3 { color: var(--navy); font-size: 1.2rem; margin-bottom: 0.3rem; }
.feature p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* ============ Quote / testimonial ============ */
.quote {
  background: var(--navy);
  color: var(--clair);
  padding: 5rem 0;
  text-align: center;
}
.quote blockquote {
  font-family: var(--ff-title);
  font-size: clamp(1.4rem, 2vw + 1rem, 2.1rem);
  font-style: italic;
  line-height: 1.35;
  max-width: 820px;
  margin: 0 auto 1.2rem;
}
.quote cite { font-style: normal; color: var(--sun); letter-spacing: 0.06em; font-size: 0.9rem; text-transform: uppercase; }

/* ============ CTA banner ============ */
.cta {
  background: var(--wine);
  color: var(--clair);
  border-radius: var(--radius-lg);
  padding: 3rem 2.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 4rem;
}
.cta h2 { color: var(--clair); margin: 0 0 0.4rem; }
.cta p  { margin: 0; opacity: 0.9; }

/* ============ Footer ============ */
.site-footer {
  background: var(--navy);
  color: var(--clair);
  padding: 3.5rem 0 1.5rem;
}
.site-footer .grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: var(--clair); font-family: var(--ff-body); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.site-footer a { color: var(--clair); opacity: 0.8; }
.site-footer a:hover { opacity: 1; color: var(--sun); text-decoration: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer .brand { color: var(--clair); }
.site-footer .tagline { opacity: 0.75; margin-top: 0.6rem; max-width: 34ch; font-size: 0.95rem; }
.legal {
  margin-top: 2.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 228, 214, 0.18);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ============ Forms (contatti) ============ */
.form {
  display: grid;
  gap: 1rem;
  max-width: 620px;
  margin: 0 auto;
}
.form label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--navy); font-weight: 600; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(15, 51, 68, 0.2);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(116, 11, 51, 0.12);
}
.form textarea { min-height: 140px; resize: vertical; }

/* ============ Custom <select> chrome ============
   Native select kept for accessibility & mobile pickers,
   but with a brand chevron and consistent spacing. */
.search select,
.form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23740B33' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 8px;
}
.form select { padding-right: 2.6rem; }
/* Remove Firefox's dotted focus outline inside the select */
.form select::-ms-expand,
.search select::-ms-expand { display: none; }
.form select:focus-visible,
.search select:focus-visible { outline: none; }
.form option, .search option { color: var(--ink); }

/* ============ Radio cards (segmented visual selector) ============
   Usage: <div class="radio-cards">
            <label class="radio-card">
              <input type="radio" name="tipo-richiesta" value="privato" />
              <span class="radio-card-icon"><svg>…</svg></span>
              <span class="radio-card-title">Privato</span>
              <span class="radio-card-desc">Ricerca casa personale</span>
            </label>
            …
          </div>
*/
.radio-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 0.4rem;
}
.radio-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.8rem;
  row-gap: 0.1rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid rgba(15, 51, 68, 0.15);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  align-items: center;
}
.radio-card:hover {
  border-color: rgba(116, 11, 51, 0.35);
  background: var(--clair-soft);
}
.radio-card input[type="radio"] {
  /* Hide the native input but keep it focusable (a11y). */
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.radio-card-icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--clair);
  color: var(--wine);
  transition: background 0.15s, color 0.15s;
}
.radio-card-icon svg { width: 22px; height: 22px; }
.radio-card-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.2;
}
.radio-card-desc {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
}
/* Selected state */
.radio-card:has(input[type="radio"]:checked) {
  border-color: var(--wine);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(116, 11, 51, 0.12);
}
.radio-card:has(input[type="radio"]:checked) .radio-card-icon {
  background: var(--wine);
  color: var(--clair);
}
.radio-card:has(input[type="radio"]:checked) .radio-card-title {
  color: var(--wine);
}
/* Keyboard focus on the hidden radio reveals a visible ring on the card */
.radio-card:has(input[type="radio"]:focus-visible) {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(116, 11, 51, 0.18);
}
@media (max-width: 540px) {
  .radio-cards { grid-template-columns: 1fr; }
}
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form button { justify-self: start; margin-top: 0.5rem; }
.form-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }
.form-success {
  background: rgba(143, 161, 133, 0.2);
  color: #3F5238;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-top: 1rem;
  display: none;
  font-weight: 600;
}
.form-success.visible { display: block; }

/* ============ Immobili page ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.filters button {
  padding: 0.5rem 1.1rem;
  border: 1.5px solid rgba(15, 51, 68, 0.18);
  background: #fff;
  border-radius: 999px;
  font: inherit;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.92rem;
  font-weight: 500;
}
.filters button:hover { border-color: var(--wine); color: var(--wine); }
.filters button.active { background: var(--wine); color: var(--clair); border-color: var(--wine); }

/* ============ Install prompt ============ */
.install-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  background: var(--navy);
  color: var(--clair);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 100;
  max-width: 520px;
  margin-inline: auto;
}
.install-banner.visible { display: flex; }
.install-banner p { margin: 0; font-size: 0.92rem; }
.install-banner button {
  border: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--sun); color: var(--navy);
}
.install-banner .close {
  background: transparent;
  color: var(--clair);
  opacity: 0.7;
  padding: 0.3rem;
}

/* ============ Offline banner ============ */
.offline-banner {
  display: none;
  background: var(--sun);
  color: var(--navy);
  text-align: center;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}
body.offline .offline-banner { display: block; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .search form { grid-template-columns: 1fr 1fr; }
  .search label + label { border-left: 0; border-top: 1px solid rgba(15, 51, 68, 0.08); }
  .search button { grid-column: 1 / -1; padding: 0.9rem; }
}
@media (max-width: 640px) {
  .nav ul { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--clair); flex-direction: column; padding: 1rem 1.2rem; gap: 0.6rem; box-shadow: var(--shadow-md); }
  .nav ul.open { display: flex; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav .btn { display: none; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .site-footer .grid { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; text-align: center; }
  .form .row { grid-template-columns: 1fr; }
}

/* ============ Legal pages (Privacy, Cookie) ============ */
.legal-page { padding: 4rem 0 5rem; background: var(--clair-soft); }
.legal-page .legal-head { max-width: 780px; margin: 0 auto 2.5rem; }
.legal-page .legal-head .eyebrow { color: var(--wine); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.78rem; }
.legal-page .legal-head h1 { color: var(--wine); margin: 0.5rem 0 1rem; }
.legal-page .legal-head .lead { color: var(--navy); font-size: 1.05rem; }
.legal-page .legal-head .meta { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.legal-page article > .container > section { max-width: 780px; margin: 0 auto; padding: 2rem 0; border-top: 1px solid rgba(15,51,68,0.08); }
.legal-page article > .container > section:first-of-type { border-top: 0; }
.legal-page h2 { font-size: 1.5rem; color: var(--navy); margin: 0 0 0.8rem; scroll-margin-top: 6rem; }
.legal-page h3 { font-size: 1.1rem; color: var(--navy); margin: 1.4rem 0 0.6rem; }
.legal-page p, .legal-page li { color: var(--ink); font-size: 0.98rem; }
.legal-page code { background: rgba(116,11,51,0.08); color: var(--wine); padding: 0.1rem 0.45rem; border-radius: 6px; font-size: 0.9em; }
.legal-page ul, .legal-page ol { padding-left: 1.4rem; }
.legal-page ul li, .legal-page ol li { margin-bottom: 0.4rem; }
.legal-toc {
  max-width: 780px;
  margin: 0 auto 2.5rem;
  padding: 1.4rem 1.6rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.legal-toc strong { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.6rem; }
.legal-toc ol { margin: 0; columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
.legal-toc li { break-inside: avoid; font-size: 0.95rem; margin-bottom: 0.35rem; }
.legal-toc a { color: var(--navy); }
.legal-toc a:hover { color: var(--wine); }
.legal-kv { display: grid; grid-template-columns: 220px 1fr; gap: 0.35rem 1.2rem; margin: 0.5rem 0 1rem; }
.legal-kv dt { font-weight: 600; color: var(--navy); }
.legal-kv dd { margin: 0; color: var(--ink); }
.legal-table { width: 100%; border-collapse: collapse; margin: 0.8rem 0 1rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); font-size: 0.92rem; }
.legal-table th, .legal-table td { padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(15,51,68,0.08); }
.legal-table th { background: var(--clair); color: var(--navy); font-weight: 700; font-size: 0.85rem; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-note { background: rgba(143, 161, 133, 0.16); border-left: 3px solid var(--sage); padding: 0.9rem 1.1rem; border-radius: 10px; color: var(--navy); font-size: 0.92rem; }
.legal-footer {
  max-width: 780px; margin: 2.5rem auto 0;
  padding: 2rem; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-align: center;
}
.legal-inline-btn,
.footer-link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}
.legal-inline-btn { color: var(--wine); font-weight: 600; }
.legal-inline-btn:hover { color: var(--wine-dark); }
.footer-link-btn { color: inherit; opacity: 0.8; text-decoration: none; }
.footer-link-btn:hover { opacity: 1; color: var(--sun); }

@media (max-width: 720px) {
  .legal-kv { grid-template-columns: 1fr; gap: 0 0; }
  .legal-kv dd { margin: 0 0 0.7rem; }
  .legal-toc ol { columns: 1; }
  .legal-table { font-size: 0.85rem; }
  .legal-table th, .legal-table td { padding: 0.6rem 0.6rem; }
}

/* ============ Cookie banner (first visit) ============ */
.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  max-width: 760px;
  margin-inline: auto;
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 51, 68, 0.25);
  padding: 1.3rem 1.4rem 1.2rem;
  z-index: 200;
  display: none;
  border-top: 4px solid var(--wine);
  animation: cookie-rise 0.3s ease-out;
}
@keyframes cookie-rise {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.cookie-banner.visible { display: block; }
.cookie-banner h3 { margin: 0 0 0.4rem; color: var(--wine); font-size: 1.15rem; font-family: var(--ff-title); }
.cookie-banner p { margin: 0 0 1rem; color: var(--ink); font-size: 0.94rem; line-height: 1.5; }
.cookie-banner p a { color: var(--wine); font-weight: 600; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.cookie-banner .cookie-actions .btn { padding: 0.6rem 1.1rem; font-size: 0.92rem; }

/* ============ Back-to-top button ============
   Appears after scrolling past the hero; smooth return to the top.
   Bottom-right so it doesn't collide with the bottom-left consent pill. */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--wine);
  color: var(--clair);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(116, 11, 51, 0.28);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s, box-shadow 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover { background: var(--wine-dark); box-shadow: 0 12px 32px rgba(116, 11, 51, 0.38); }
.back-to-top:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }
.back-to-top svg { width: 20px; height: 20px; }
@media (max-width: 540px) {
  .back-to-top { right: 0.75rem; bottom: 0.75rem; width: 42px; height: 42px; }
}

/* ============ Floating consent pill ============
   Visible once the user has expressed a choice. One-click re-entry
   to the preferences modal, as required by GDPR art. 7 c. 3. */
.consent-pill {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: var(--navy);
  color: var(--clair);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(15, 51, 68, 0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  opacity: 0.95;
}
.consent-pill.visible { display: inline-flex; }
.consent-pill:hover { background: var(--wine); transform: translateY(-1px); opacity: 1; }
.consent-pill:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.consent-pill svg { width: 16px; height: 16px; flex: none; }
/* Hide it while the banner or modal is on screen to avoid overlap */
body.consent-active .consent-pill { display: none !important; }
@media (max-width: 540px) {
  .consent-pill { left: 0.75rem; bottom: 0.75rem; padding: 0.5rem 0.8rem; font-size: 0.78rem; }
  .consent-pill .consent-pill-label { display: none; }
  .consent-pill svg { width: 18px; height: 18px; }
}

/* ============ Cookie preferences modal ============ */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 51, 68, 0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-modal.visible { display: flex; }
.cookie-modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 30px 80px rgba(15, 51, 68, 0.4);
  padding: 2rem 2rem 1.6rem;
  animation: cookie-rise 0.25s ease-out;
}
.cookie-modal-card h2 { color: var(--wine); margin: 0 0 0.4rem; font-size: 1.6rem; }
.cookie-modal-card p.lead { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.2rem; }
.cookie-cat {
  border: 1px solid rgba(15, 51, 68, 0.12);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.7rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem 1rem;
}
.cookie-cat h3 { margin: 0; color: var(--navy); font-family: var(--ff-body); font-size: 1rem; }
.cookie-cat p { grid-column: 1 / -1; margin: 0.3rem 0 0; color: var(--muted); font-size: 0.88rem; }
.cookie-cat small { font-size: 0.75rem; color: var(--sage); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.cookie-cat.locked small { color: var(--wine); }

/* iOS-style toggle (pure CSS, no JS needed for visual state) */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex: none;
}
.toggle input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.toggle .track {
  position: absolute; inset: 0;
  background: rgba(15, 51, 68, 0.2);
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked ~ .track { background: var(--wine); }
.toggle input:checked ~ .track::after { transform: translateX(20px); }
.toggle input:focus-visible ~ .track { box-shadow: 0 0 0 3px rgba(116,11,51,0.3); }
.toggle input:disabled ~ .track { background: rgba(116,11,51,0.5); cursor: not-allowed; opacity: 0.7; }

.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(15,51,68,0.08);
}
.cookie-modal-actions .group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

@media (max-width: 540px) {
  .cookie-banner .cookie-actions { justify-content: stretch; }
  .cookie-banner .cookie-actions .btn { flex: 1 1 auto; text-align: center; }
  .cookie-modal-card { padding: 1.4rem 1.2rem 1.2rem; }
  .cookie-modal-actions .group { width: 100%; }
  .cookie-modal-actions .btn { flex: 1 1 auto; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
