/* ==========================================================================
   Apartaments l'Arrel d'Espot — Estils
   Paleta "Bosc Pirinenc": verd pissarra + verd salvia + fusta, sobre un
   blanc trencat càlid. Playfair Display als títols, Inter al text.
   Sense frameworks, sense build step.
   ========================================================================== */

:root {
  --primary: #2F4F4F;
  --primary-dark: #223A3A;
  --secondary: #5B8C6E;
  --secondary-dark: #4A7359;
  --earth: #8B5A2B;
  --accent-bright: #6FCF00;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --text: #1C1C1E;
  --text-soft: #48484A;
  --text-mute: #7A7A72;
  --line: rgba(47, 79, 79, 0.12);
  --line-strong: rgba(47, 79, 79, 0.2);
  --shadow-sm: 0 4px 14px rgba(30, 40, 35, 0.06);
  --shadow-md: 0 10px 30px rgba(30, 40, 35, 0.1);
  --shadow-lg: 0 26px 60px rgba(30, 40, 35, 0.16), 0 8px 24px rgba(30, 40, 35, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-reveal: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
}
/* Gra de paper molt subtil sobre tota la web — trenca la fredor "digital"
   sense afectar la llegibilitat (opacitat mínima, no interactiu). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* ---- Fulles caient: atmosfera global sobre tota la web ----
   Contenidor fixe a tot el viewport, per sobre del contingut però per sota
   del header/modals. pointer-events: none perquè mai bloquegi cap clic. */
.leaves-fx {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
.leaves-fx .leaf {
  position: absolute;
  top: 0; left: 0;
  opacity: 0.6;
  will-change: transform;
}

/* ---- Barra de progrés de lectura ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--primary);
  z-index: 200;
  pointer-events: none;
  transition: width 0.1s linear;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

section { position: relative; }

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--earth);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.18;
}
.section-sub {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--secondary-dark); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--accent-bright); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { color: var(--secondary-dark); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Botó d'enviament dels formularis: gran, pill-shape, verd bosc */
.btn-submit {
  padding: 16px 38px;
  border-radius: 999px;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-submit:hover { background: var(--secondary-dark); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* "Reserva ara": latid elegant — urgència subtil i acollidora */
@keyframes heartbeatElegant {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.btn-heartbeat {
  animation: heartbeatElegant 3s ease-in-out infinite;
  will-change: transform;
}
.btn-heartbeat:hover {
  animation-duration: 1.4s;
  filter: brightness(1.12);
}
@media (prefers-reduced-motion: reduce) {
  .btn-heartbeat { animation: none; }
}

/* ---- Reveal on scroll ----
   Robustesa crítica: per defecte el contingut és VISIBLE. Només s'amaga
   per animar-lo si el JS arrenca correctament i afegeix ".js-ready" al
   <html> (main.js ho fa com a primera instrucció). Així, si el JS falla
   per qualsevol motiu (bloquejat, error, xarxa lenta...), la web mai es
   queda en blanc — simplement es veu sense l'animació d'entrada. */
.reveal { opacity: 1; transform: none; }
.js-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-reveal), transform 0.8s var(--ease-reveal);
  will-change: transform, opacity;
}
.js-ready .reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* Retard esglaonat per a targetes en graella (0.1s entre cada una) */
.js-ready .apt-grid .reveal:nth-child(1) { transition-delay: 0s; }
.js-ready .apt-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.js-ready .apt-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.js-ready .apt-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
.js-ready .apt-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.js-ready .apt-grid .reveal:nth-child(6) { transition-delay: 0.5s; }
.js-ready .entorn-grid .reveal:nth-child(1) { transition-delay: 0s; }
.js-ready .entorn-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.js-ready .entorn-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.js-ready .entorn-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
.js-ready .entorn-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.js-ready .entorn-grid .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(250, 249, 246, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(250, 249, 246, 0.97); }
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(30,40,35,0.02), 0 8px 24px rgba(30,40,35,0.05);
}
.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img {
  height: 44px;
  width: auto;
  display: block;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--accent-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.main-nav a:hover { color: var(--primary); }
.main-nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Selector d'idioma (CA / ES / EN) */
.lang-switch { display: flex; align-items: center; gap: 2px; }
.lang-link {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-link:hover { color: var(--primary); background: rgba(91,140,110,0.12); }
.lang-link.is-active { color: var(--primary); background: rgba(91,140,110,0.14); }
.lang-switch-mobile { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.nav-toggle:hover { background: rgba(91,140,110,0.12); }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-primary { padding: 10px 18px; font-size: 0.88rem; }
  .logo img { height: 36px; }
  .header-actions > .lang-switch { display: none; }
}

.mobile-nav {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: 16px 8px;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-h);
  background-color: var(--primary-dark);
  background-image:
    linear-gradient(rgba(30, 50, 40, 0.6), rgba(30, 50, 40, 0.6)),
    url("../images/hero.jpg"),
    linear-gradient(135deg, #223A3A 0%, #2F4F4F 45%, #5B8C6E 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* background-attachment:fixed és inconsistent/pesat en mòbils tàctils —
   es desactiva i torna a l'scroll normal per sota de 900px. */
@media (max-width: 900px) {
  .hero { background-attachment: scroll; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-bottom: 88px;
  color: #fff;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 18px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.2vw, 4.8rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.06;
  max-width: 16ch;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  max-width: 46ch;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-actions .btn-outline {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  backdrop-filter: blur(6px);
}
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.2); border-color: var(--accent-bright); }
.hero-scroll-cue {
  position: absolute;
  right: 24px;
  bottom: 28px;
  writing-mode: vertical-rl;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-scroll-cue::after {
  content: "";
  width: 1px;
  height: 42px;
  background: rgba(255,255,255,0.5);
}
@media (max-width: 700px) {
  .hero-scroll-cue { display: none; }
}

/* ==========================================================================
   Ratings bar
   ========================================================================== */
.ratings-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ratings-inner {
  padding-block: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  text-align: center;
}
.ratings-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--secondary);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.ratings-text strong { font-weight: 700; }
.ratings-text span { color: var(--text-mute); }
.ratings-divider { width: 1px; height: 22px; background: var(--line-strong); }
.ratings-hutl { font-size: 0.85rem; color: var(--text-mute); }

/* ==========================================================================
   About — foto de fons + overlay (sense bloc de color pla)
   ========================================================================== */
.about {
  padding-block: 150px;
  color: #fff;
  background-color: var(--primary-dark);
  background-image:
    linear-gradient(rgba(30, 50, 40, 0.6), rgba(30, 50, 40, 0.6)),
    url("../images/poble.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
@media (max-width: 900px) {
  .about { background-attachment: scroll; }
}
.about-inner { max-width: 620px; }
.about-text p + p { margin-top: 16px; }
.about-text p { color: rgba(255,255,255,0.86); line-height: 1.75; font-size: 1.05rem; }
.about .eyebrow { color: var(--accent-bright); }
.about .section-title { color: #fff; }
.about-facts {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 32px;
}
.about-fact strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
.about-fact span { font-size: 0.85rem; color: rgba(255,255,255,0.65); }

@media (max-width: 900px) {
  .about { padding-block: 100px; }
  .about-facts { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ==========================================================================
   Apartments grid
   ========================================================================== */
.apartments {
  padding-block: 96px;
  background-color: #F2F5F3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200'%3E%3Cpath d='M0 200 L0 140 L180 60 L340 150 L520 40 L720 130 L900 30 L1100 140 L1280 70 L1440 150 L1440 200 Z' fill='%232F4F4F' fill-opacity='0.05'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
}
.apt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.apt-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  will-change: transform, opacity;
}
.apt-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
/* Brillantor subtil que recorre la targeta d'esquerra a dreta al hover */
.apt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.14) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}
.apt-card:hover::after { transform: translateX(120%); }
/* Curvatura orgànica en algunes targetes destacades (2 de cada 3) */
.apt-card:nth-child(3n+2) { border-radius: 20px 6px 20px 6px; }

/* Elements decoratius de branca/fulla a les cantonades — molt subtils */
.apt-card-body { position: relative; }
.apt-card-body::after {
  content: "";
  position: absolute;
  bottom: 8px; right: 8px;
  width: 30px; height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B5A2B' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M20 4C14 4 6 8 6 16c0 2 1 4 3 4M6 16c3-1 6-3 8-6M9 20c2-2 4-5 5-9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  pointer-events: none;
}
.apt-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: var(--line);
}
.apt-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(10%) contrast(105%);
  transition: transform 0.6s var(--ease);
}
.apt-card:hover .apt-card-media img { transform: scale(1.06); }
.apt-card-tag {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}
.apt-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.apt-card-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.5px; }
.apt-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.86rem;
  color: var(--text-soft);
}
.apt-meta li { display: flex; align-items: center; gap: 6px; }
.apt-meta svg { width: 15px; height: 15px; color: var(--secondary); flex-shrink: 0; filter: url(#organic-roughen); }
.apt-card-desc {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--text-mute);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.apt-card-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.apt-price { font-size: 0.86rem; color: var(--text-mute); }
.apt-price strong { display: block; color: var(--text); font-size: 1rem; font-weight: 700; }

/* "Més informació": vida al hover — fons verd salvia, fletxa que llisca */
.apt-card-foot .btn-outline {
  gap: 0;
  overflow: hidden;
}
.apt-card-foot .btn-outline::after {
  content: "→";
  display: inline-block;
  width: 0;
  margin-left: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: width 0.3s ease-out, margin-left 0.3s ease-out, opacity 0.3s ease-out, transform 0.3s ease-out;
}
.apt-card-foot .btn-outline:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12), var(--shadow-sm);
}
.apt-card-foot .btn-outline:hover::after {
  width: 1em;
  margin-left: 6px;
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 980px) {
  .apt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .apt-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Modal (apartment detail) — galeria en GRID, sense carrusel
   ========================================================================== */
dialog.apt-modal {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  width: min(920px, 92vw);
  max-height: 88vh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
dialog.apt-modal::backdrop {
  background: rgba(20, 24, 21, 0.6);
  backdrop-filter: blur(3px);
}
.modal-scroll {
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin-right: 16px;
  z-index: 5;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(28,28,30,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { background: rgba(28,28,30,0.78); transform: scale(1.06); }
.modal-close svg { width: 18px; height: 18px; }

.modal-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 20px 20px 4px;
}
.modal-gallery-grid button {
  border: none;
  padding: 0;
  background: none;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
}
.modal-gallery-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(10%) contrast(105%);
  transition: transform 0.4s var(--ease);
}
.modal-gallery-grid button:hover img { transform: scale(1.08); }

@media (max-width: 560px) {
  .modal-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.modal-body { padding: 20px 32px 36px; }
.modal-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: 0.5px; }
.modal-reg { margin-top: 6px; font-size: 0.82rem; color: var(--text-mute); }
.modal-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.modal-meta li {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.modal-meta svg { width: 15px; height: 15px; color: var(--secondary); filter: url(#organic-roughen); }
.modal-desc { margin-top: 20px; color: var(--text-soft); line-height: 1.7; font-size: 1rem; max-width: 60ch; }

.modal-form {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.modal-form h4 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }

/* ---- Lightbox (clic a una foto de la graella) ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 20, 18, 0.88);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  filter: sepia(10%) contrast(105%);
}
.lightbox-close {
  position: fixed;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.24); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ==========================================================================
   Forms (shared) — elegants, vores fines, padding generós
   ========================================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { position: relative; display: flex; flex-direction: column; gap: 7px; }
/* Petita fulla que apareix a la cantonada de l'input en fer focus */
.form-field::after {
  content: "";
  position: absolute;
  top: 30px; right: 10px;
  width: 14px; height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7 6 4 11 4 15a8 8 0 0 0 16 0c0-4-3-9-8-13Z' fill='%235B8C6E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0;
  transform: scale(0.4) rotate(-25deg);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.form-field:focus-within::after {
  opacity: 0.85;
  transform: scale(1) rotate(0deg);
}
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.form-field input,
.form-field select,
.form-field textarea {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(91, 140, 110, 0.16);
}
.form-field textarea { resize: vertical; min-height: 96px; }
.form-actions { margin-top: 6px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-note { font-size: 0.82rem; color: var(--text-mute); }
.form-status {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
}
.form-status[data-state="success"] { color: var(--secondary-dark); }
.form-status[data-state="error"] { color: #B3261E; }

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

/* ==========================================================================
   Entorn
   ========================================================================== */
.entorn { padding-block: 96px; background: #F2F5F3; }
.entorn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.entorn-card {
  padding: 30px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.entorn-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.entorn-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: rgba(91, 140, 110, 0.14);
  color: var(--secondary-dark);
  margin-bottom: 18px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s ease;
}
.entorn-card:hover .entorn-icon { background: rgba(111, 207, 0, 0.16); color: var(--primary); transform: rotate(5deg); }
.entorn-icon svg { width: 24px; height: 24px; filter: url(#organic-roughen); transition: transform 0.3s ease; }
.entorn-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.entorn-card p { margin-top: 8px; font-size: 0.92rem; color: var(--text-soft); line-height: 1.6; }

@media (max-width: 900px) { .entorn-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .entorn-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonials { padding-block: 96px; background: var(--surface); }
.testi-track-wrap { position: relative; max-width: 720px; margin-inline: auto; }
.testi-track { overflow: hidden; }
/* Graella d'una sola cel·la: totes les targetes se superposen i es creuen
   amb un fade suau (sense desplaçament lateral). */
.testi-slides { display: grid; }
.testi-slide {
  grid-area: 1 / 1;
  padding: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.testi-slide.is-active { opacity: 1; pointer-events: auto; }
.testi-card {
  position: relative;
  background: #FAF9F6;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 36px 40px;
  text-align: center;
}
/* Marc rústic a les cantonades — decoratiu, opacitat molt baixa */
.testi-card::before,
.testi-card::after {
  content: "";
  position: absolute;
  width: 34px; height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B8C6E' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M2 10C2 5 5 2 10 2M14 2c3 1 5 3 6 6M18 22c3-1 5-4 6-8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  pointer-events: none;
}
.testi-card::before { top: 10px; left: 10px; }
.testi-card::after { bottom: 10px; right: 10px; transform: rotate(180deg); }
.testi-stars { color: var(--secondary); font-size: 1.1rem; letter-spacing: 2px; }
.testi-quote { margin-top: 16px; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; line-height: 1.6; color: var(--text); }
.testi-author { margin-top: 18px; font-size: 0.9rem; color: var(--text-mute); font-weight: 600; }
.testi-nav {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.testi-dots { display: flex; gap: 8px; }
.testi-dots button {
  width: 8px; height: 8px; border-radius: 50%;
  border: none; background: var(--line-strong); padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.testi-dots button.is-active { background: var(--accent-bright); transform: scale(1.3); }
.testi-arrow {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.testi-arrow:hover { border-color: var(--accent-bright); transform: translateY(-1px); }
.testi-arrow svg { width: 16px; height: 16px; }

/* ==========================================================================
   Com arribar
   ========================================================================== */
.arribar { padding-block: 96px; background: #F2F5F3; }
.arribar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.arribar-map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}
.arribar-map iframe { width: 100%; height: 100%; border: 0; }
.arribar-steps { display: flex; flex-direction: column; gap: 22px; }
.arribar-step { display: flex; gap: 16px; }
.arribar-step-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(91,140,110,0.14);
  color: var(--secondary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.arribar-step h4 { font-size: 1rem; font-weight: 700; }
.arribar-step p { margin-top: 4px; font-size: 0.92rem; color: var(--text-soft); line-height: 1.6; }
.arribar-address { margin-top: 8px; font-size: 0.92rem; color: var(--text-soft); }

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

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding-block: 96px;
  color: #fff;
  background-color: var(--primary);
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 26px),
    linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.08));
}
.contact .eyebrow { color: var(--accent-bright); }
.contact .section-title { color: #fff; }
.contact .section-sub { color: rgba(255,255,255,0.82); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 56px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
  color: var(--text);
}
.contact-side { display: flex; flex-direction: column; gap: 24px; }
.contact-info-block h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; color: #fff; }
.contact-info-block p, .contact-info-block a { font-size: 0.92rem; color: rgba(255,255,255,0.82); line-height: 1.6; }
.contact-info-block a:hover { color: var(--accent-bright); }
.contact-hutl-list { margin-top: 6px; font-size: 0.85rem; color: rgba(255,255,255,0.6); }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 26px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--primary);
  color: rgba(250, 249, 246, 0.82);
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-brand-mark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.footer-brand-mark span { color: var(--accent-bright); }
.footer-brand p { margin-top: 14px; font-size: 0.9rem; line-height: 1.6; color: rgba(250,249,246,0.65); max-width: 34ch; }
.footer-contact { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.footer-contact a { font-size: 0.9rem; color: rgba(250,249,246,0.85); }
.footer-contact a:hover { color: #fff; }
.footer-social { margin-top: 18px; display: flex; gap: 10px; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(250,249,246,0.25);
  display: flex; align-items: center; justify-content: center;
  color: rgba(250,249,246,0.85);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.footer-social a:hover { background: rgba(111,207,0,0.18); border-color: var(--accent-bright); }
.footer-social svg { width: 17px; height: 17px; transition: transform 0.3s ease; }
.footer-social a:hover svg { transform: rotate(5deg); }
.footer-col h5 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(250,249,246,0.55); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a, .footer-col span { font-size: 0.9rem; color: rgba(250,249,246,0.8); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(250,249,246,0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(250,249,246,0.55);
}
.footer-bottom a { color: rgba(250,249,246,0.75); }
.footer-bottom a:hover { color: #fff; }

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   Divisors ondulats — entre seccions clares i fosques
   ========================================================================== */
.wave-divider {
  display: block;
  width: 100%;
  height: 60px;
  line-height: 0;
  position: relative;
  z-index: 2;
}
.wave-divider svg { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   Separadors entre seccions — línia fina degradada + icona de muntanya
   ========================================================================== */
.section-divider::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 52px; height: 52px;
  transform: translate(-50%, -50%);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F4F4F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 3 4 8 5-5 5 15H2L8 3Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  z-index: 3;
}
.section-divider::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 50%, transparent);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
