/* OLH Valls v4 — Mix v2 + v3 */

:root {
  --primary: #D72B2B;
  --primary-dark: #C62828;
  --primary-deeper: #A42627;
  --primary-light: #E04545;
  --primary-bg: #FDF0F0;
  --dark: #1A1014;
  --dark-mid: #2C1E22;
  --dark-soft: #3D2D31;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-on-dark: #F5F5F7;
  --text-on-dark-muted: #A1A1A6;
  --bg: #FBFBFD;
  --bg-gray: #F5F5F7;
  --bg-warm: #FAF7F5;
  --gold: #C4985A;
  --link: #D72B2B;
  --link-on-dark: #D44043;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main, #main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  z-index: 9999;
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
}
.skip-link:focus { top: 8px; }

/* NAV */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 82px;
  background: transparent;
  border-bottom: 1px solid var(--primary);
  z-index: 1000;
}
.nav--hero {
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0.10) 100%);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}
.nav-logo img { height: 44px; width: auto; display: block; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-phone {
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.3s;
}
.nav-phone:hover { color: #fff; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  background: #fff;
  color: #1D1D1F;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s;
  white-space: nowrap;
}
.nav-cta:hover { background: #e5e5e5; color: #1D1D1F; }
.nav-burger {
  display: none;
  width: 18px;
  height: 18px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: white;
  position: absolute;
  left: 0;
  transition: 0.3s var(--ease);
}
.nav-burger span:first-child { top: 5px; }
.nav-burger span:last-child { top: 11px; }
.nav-burger.active span:first-child { transform: rotate(45deg); top: 8px; }
.nav-burger.active span:last-child { transform: rotate(-45deg); top: 8px; }

/* SUB-NAV */
.sub-nav {
  position: fixed;
  top: 82px;
  width: 100%;
  height: 40px;
  z-index: 999;
  background: rgba(251,251,253,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.sub-nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sub-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}
.sub-nav-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.sub-nav-cta {
  font-size: 12px;
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.3s;
}
.sub-nav-cta:hover { background: var(--primary-dark); }

/* MOBILE MENU */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  /* Flux des de dalt (sota el nav de 82px) + scroll si no hi cap: així els
     enllaços i el peu no se sobreposen mai en pantalles curtes. */
  padding: 104px 24px 40px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.mobile-menu.active { opacity: 1; pointer-events: auto; }
.mobile-menu-links { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.mobile-menu-links a {
  color: var(--text-on-dark);
  font-size: 28px;
  font-weight: 600;
  text-decoration: none;
}
.mobile-menu-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mobile-menu-footer a {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  text-decoration: none;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .3s var(--ease);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(215,43,43,0.25); }
.btn-white { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.4); backdrop-filter: blur(10px); }
.btn-white:hover { background: #fff; color: var(--primary); border-color: #fff; }
.btn-lg { padding: 16px 36px; font-size: 15px; }

/* HERO SLIDER (v2) */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
  background-size: cover;
  background-position: center;
}
.hero-slide--gradient .hero-slide-bg {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary-deeper) 50%, var(--dark-mid) 100%);
}
.hero-slide-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(26,16,20,0.72) 0%, rgba(26,16,20,0.45) 40%, rgba(164,38,39,0.20) 100%);
}

.hero-slide-content {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
}
.hero-container { pointer-events: auto; }
.hero-container {
  text-align: right;
  max-width: 750px;
  padding: 0 180px 180px 0;
}

.hero-slide-content--center {
  justify-content: center;
  align-items: center;
}
.hero-container--center {
  text-align: center;
  max-width: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-logo-slide {
  width: 360px;
  height: auto;
}
.hero-container--logo {
  flex-direction: column;
  gap: 20px;
}
.hero-logo-tagline {
  color: rgba(255, 255, 255, 0.85);
  font-size: 17px;
  font-weight: 400;
  max-width: 480px;
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

/* Staggered fadeUp */
.hero-slide .hero-label,
.hero-slide .hero-title,
.hero-slide .hero-desc,
.hero-slide .hero-actions {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero-slide.active .hero-label { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
.hero-slide.active .hero-title { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.hero-slide.active .hero-desc { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
.hero-slide.active .hero-actions { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }

.hero-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
  padding-right: 40px;
  position: relative;
}
.hero-label::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.hero-title {
  color: #fff;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}
/* Accent editorial: la paraula clau del titular en Playfair cursiva, vermell clar,
   pes més fi que el titular (700) per crear contrast tipogràfic. */
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--primary-light);
}

/* Frase fixa del hero: sempre visible a dalt, sota la capçalera, a totes les slides */
.hero-tagline {
  position: absolute;
  top: 82px;
  left: 0;
  right: 0;
  z-index: 8;
  margin: 0 auto;
  max-width: 680px;
  padding: 30px 24px 0;
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: normal;
  font-size: clamp(15px, 1.7vw, 20px);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
/* Paraules clau de la frase fixa: cursiva vermella (contrast amb la resta en normal) */
.hero-tagline em {
  font-style: italic;
  color: var(--primary-light);
}

.hero-desc {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  max-width: 500px;
  margin-bottom: 36px;
  margin-left: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Hero counter */
.hero-counter {
  position: absolute;
  left: 60px;
  bottom: 40px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255,255,255,0.12);
  z-index: 10;
  line-height: 1;
}
.hero-counter span { color: rgba(255,255,255,0.25); }

/* Hero navigation */
.hero-nav {
  position: absolute;
  z-index: 10;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-nav button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
}
.hero-nav button:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* Hero indicators */
.hero-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-indicators button {
  width: 12px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all .4s;
  padding: 0;
}
.hero-indicators button.active { width: 32px; background: #fff; }

/* Hero novetats */
.hero-novetats {
  position: absolute;
  left: 0;
  bottom: 280px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(26,16,20,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0 16px 16px 0;
  padding: 24px 28px;
  max-width: 320px;
  pointer-events: auto;
}
.hero-novetats-title {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 12px;
  padding-right: 40px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.hero-novetats-title::before {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  width: 28px;
  height: 1px;
  background: var(--gold);
}
.hero-novetat {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hero-novetat:last-child { border-bottom: none; }
.hero-novetat span,
.hero-novetat a {
  display: block;
  color: rgba(255,255,255,0.92);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.1px;
  text-decoration: none;
  transition: color .3s;
}
.hero-novetat em {
  font-style: italic;
  color: var(--primary-light);
  font-weight: 400;
}
.hero-novetat a:hover { text-decoration: underline; }
.hero-novetat a:hover em { color: #fff; }

/* Hero scroll */
.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-scroll span {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollPulse 2s ease infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* SECTION--TABS */
.section--tabs {
  background: var(--bg-gray);
  padding: 100px 24px;
  text-align: center;
}
.section--tabs h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 40px;
  letter-spacing: -0.03em;
}
.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  padding: 0 16px;
}
.tab {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s;
  white-space: nowrap;
}
.tab.active { color: white; background: var(--primary); }
.tab:hover:not(.active) { background: rgba(0,0,0,0.06); }
.tab-panels { max-width: 1100px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.4s var(--ease); }
.tab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tab-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: block;
}
.tab-card:hover { transform: translateY(-4px); }
.tab-card-icon { font-size: 32px; display: block; margin-bottom: 16px; }
.tab-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.tab-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.tab-detail { max-width: 600px; margin: 0 auto; text-align: center; padding: 48px 24px; }
.tab-detail-icon { font-size: 48px; margin-bottom: 24px; }
.tab-detail h3 { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.tab-detail p { font-size: 17px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }

/* SECTION--PROFILES */
.section--profiles {
  background: linear-gradient(180deg, #D72B2B 0%, #C62828 100%);
  padding: 140px 24px;
  text-align: center;
  position: relative;
  overflow: visible;
}
.profile-card--with-illustration {
  position: relative;
  overflow: visible;
}
.profiles-illustration {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: auto;
  z-index: 1;
  pointer-events: none;
}
.profile-card--with-illustration h3,
.profile-card--with-illustration .profile-icon,
.profile-card--with-illustration p,
.profile-card--with-illustration .cta-link {
  position: relative;
  z-index: 2;
}
.profiles-illustration--ninots {
  width: 240px;
  bottom: calc(100% - 120px);
}
.profiles-illustration--jove {
  width: 200px;
  bottom: calc(100% - 115px);
}
.section--profiles::before,
.section--profiles::after {
  display: none;
}
.section--profiles .section-inner { position: relative; z-index: 4; }
.section--profiles .section-label,
.section--profiles .section-title,
.section--profiles .section-subtitle {
  position: relative;
  z-index: 5;
  color: #FFFFFF;
}
.section--profiles .section-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.section--profiles .section-subtitle {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  font-size: 19px;
}
.section--profiles h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.profile-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
}
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 660px;
  margin: 220px auto 0;
  will-change: transform;
}
.profile-card {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  transition: transform 0.3s;
  will-change: transform;
}
.profile-card:hover { transform: translateY(-4px); }
.profile-icon { font-size: 40px; display: block; margin-bottom: 20px; }
.profile-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; color: #FFFFFF; }
.profile-card p { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.5; margin-bottom: 20px; }

/* TEAM SECTION */
.team-section {
  padding: 100px 24px;
  text-align: center;
  background: var(--bg-gray);
}
.team-section h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.team-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}
.team-card {
  text-align: center;
}
.team-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
}
.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.team-role {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 12px;
}
.team-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.team-email {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.team-email:hover {
  text-decoration: underline;
}

/* SECTION--FEATURE */
.section--feature {
  position: relative;
  padding: 120px 24px;
  overflow: hidden;
}
.section--feature-dark {
  background-size: cover;
  background-position: center;
  color: var(--text-on-dark);
  min-height: 600px;
  display: flex;
  align-items: center;
}
.gap-dark {
  height: 20px;
  background: #383838;
}
.section--feature-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #383838;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  z-index: 3;
}
.feature-overlay {
  position: absolute;
  inset: 0;
  background: rgba(50,50,50,0.92);
}
.section--feature-light { background: var(--bg); }
.feature-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.feature-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
  display: block;
}
.section--feature-light .feature-label { color: var(--primary); }
.feature-content h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.feature-content p {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 32px;
}
.section--feature-dark .feature-content p { color: rgba(255,255,255,0.7); }
.section--feature-light .feature-content p { color: var(--text-secondary); }
.feature-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 32px;
}
.feature-stats div { font-size: 14px; color: rgba(255,255,255,0.7); }
.feature-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}
.feature-list { max-width: 500px; margin: 0 auto 32px; text-align: left; }
.feature-list-item { padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.08); }
.feature-list--dark .feature-list-item { border-color: rgba(255,255,255,0.1); }
.feature-list-item strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.feature-list-item span { font-size: 14px; color: var(--text-secondary); }
.feature-list--dark .feature-list-item strong { color: white; }
.feature-list--dark .feature-list-item span { color: rgba(255,255,255,0.5); }

/* CTA LINKS */
.cta-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  transition: color 0.3s;
}
.cta-link:hover { text-decoration: underline; }
.cta-link--light { color: var(--link-on-dark); }
.cta-link--light:hover { color: white; }
.section--profiles .cta-link { color: #FFFFFF; }
.section--profiles .cta-link:hover { color: rgba(255,255,255,0.7); }

/* SECTION--STATS */
.section--stats {
  background: var(--dark);
  padding: 100px 24px;
  text-align: center;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 60px;
  max-width: 700px;
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}
.stats-grid .stat-card {
  text-align: center;
}
.stats-grid .stat-number {
  font-size: clamp(56px, 7vw, 84px);
}
.stats-grid .stat-label {
  font-size: 15px;
}
.stat-number {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  color: white;
  display: block;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 13px;
  color: var(--text-on-dark-muted);
  margin-top: 8px;
  display: block;
}

/* SECTION--NEWS */
.section--news {
  background: var(--bg-gray);
  padding: 100px 24px;
  text-align: center;
}
.section--news h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.news-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  text-align: left;
  transition: transform 0.3s;
}
.news-card:hover { transform: translateY(-4px); }
/* Imatge destacada de la targeta: a sang dins la card (compensa el padding 32px),
   cantonades superiors arrodonides com la card. Imatges quadrades (1:1). */
.news-card-imglink { display: block; margin: -32px -32px 20px; }
.news-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}
/* Imatge destacada a la pàgina de l'article */
.article-img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 32px;
  border-radius: 16px;
}
.news-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: block;
}
.news-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.3;
}
.news-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.section-cta { margin-top: 48px; }

/* SECTION--CTA */
.section--cta {
  background: var(--dark);
  padding: 120px 24px;
  text-align: center;
}
.cta-inner { max-width: 700px; margin: 0 auto; }
.section--cta h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: white;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.section--cta p {
  font-size: 17px;
  color: var(--text-on-dark-muted);
  margin-bottom: 32px;
}
.cta-buttons { display: flex; justify-content: center; gap: 24px; }

/* MAP */
.map-section {
  width: 100%;
  line-height: 0;
}
.map-section iframe {
  width: 100%;
  height: 500px;
}

/* FOOTER */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  padding: 60px 24px 24px;
  font-size: 13px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  margin-bottom: 40px;
}
.footer-about p { line-height: 1.6; margin-top: 16px; }
.footer-logo-link { display: inline-block; }
.footer-logo { height: 48px; width: auto; }
.footer-aj-link {
  display: inline-block;
  margin-top: 20px;
  opacity: 0.85;
  transition: opacity 0.3s;
}
.footer-aj-link:hover { opacity: 1; }
.footer-aj-logo { height: 48px; width: auto; display: block; }

/* Conjunt de badges institucionals al final del footer, centrats */
.footer-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin: 40px 0 24px;
  padding: 28px 0 0;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-badges .footer-aj-link { margin-top: 0; }

.footer-ghs-link {
  display: inline-block;
  opacity: 0.92;
  transition: opacity 0.3s, transform 0.3s;
}
.footer-ghs-link:hover { opacity: 1; transform: scale(1.05); }
.footer-ghs-logo {
  height: 56px;
  width: 56px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.footer-agencia-link {
  display: inline-block;
  opacity: 0.92;
  transition: opacity 0.3s, transform 0.3s;
}
.footer-agencia-link:hover { opacity: 1; transform: scale(1.05); }
.footer-agencia-logo {
  height: 48px;
  width: auto;
  display: block;
}

/* Icones xarxes socials al footer */
.footer-social {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.footer-social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.footer a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.3s;
  font-size: 13px;
}
.footer a:hover { color: white; }
.footer-col span { color: rgba(255,255,255,0.5); font-size: 13px; }
.footer-horari { margin-top: 8px; font-size: 12px !important; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
}
.footer-bottom p { margin-bottom: 4px; }

/* PAGE HERO */
.page-hero {
  padding: 160px 24px 60px;
  padding-top: calc(82px + 60px);
  text-align: center;
  background: linear-gradient(180deg, #D72B2B 0%, #C62828 100%);
  position: relative;
  overflow: hidden;
}
body:has(.page-hero) .nav {
  background: #D72B2B;
  border-bottom: none;
}
.page-hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,165,116,0.08) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.03em;
}
.page-hero p,
.page-hero .news-date {
  font-size: 17px;
  color: rgba(255,255,255,0.8);
  margin-top: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Contacte hero with illustration */
.page-hero--contacte {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: calc(82px + 50px);
  padding-bottom: 50px;
}
.page-hero--contacte .page-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.page-hero-text {
  flex: 1;
  text-align: left;
}
.page-hero--contacte .page-hero-text p {
  margin-left: 0;
  margin-right: 0;
}
.page-hero-illustration {
  width: 200px;
  height: auto;
  flex-shrink: 0;
  pointer-events: none;
}
@media (max-width: 768px) {
  .page-hero--contacte .page-hero-inner { flex-direction: column; gap: 20px; }
  .page-hero-text { text-align: center; }
  .page-hero--contacte .page-hero-text p { margin-left: auto; margin-right: auto; }
  .page-hero-illustration { width: 130px; }
}

/* Noticies hero — tele retallada per la corba */
/* Serveis hero — mà amb claus, retallada per la corba */
.hero-illus-serveis {
  position: absolute;
  left: calc(50% + 240px);
  bottom: 0;
  width: 220px;
  height: auto;
  pointer-events: none;
  z-index: 5;
}
@media (max-width: 1068px) {
  .hero-illus-serveis { width: 180px; left: calc(50% + 200px); }
}
@media (max-width: 768px) {
  .hero-illus-serveis { width: 140px; left: calc(50% + 150px); }
}
@media (max-width: 560px) {
  .hero-illus-serveis { display: none; }
}

/* Contacte hero — persona amb mòbil, retallada per la corba */
.hero-illus-contacte {
  position: absolute;
  left: calc(50% + 240px);
  bottom: 0;
  width: 220px;
  height: auto;
  pointer-events: none;
  z-index: 5;
}
@media (max-width: 1068px) {
  .hero-illus-contacte { width: 180px; left: calc(50% + 200px); }
}
@media (max-width: 768px) {
  .hero-illus-contacte { width: 140px; left: calc(50% + 150px); }
}
@media (max-width: 560px) {
  .hero-illus-contacte { display: none; }
}

.hero-illus-noticies {
  position: absolute;
  left: calc(50% + 200px);
  bottom: 55px;
  width: 240px;
  height: auto;
  pointer-events: none;
  z-index: 5;
}
@media (max-width: 1068px) {
  .hero-illus-noticies { width: 200px; left: calc(50% + 160px); bottom: 50px; }
}
@media (max-width: 768px) {
  .hero-illus-noticies { width: 150px; left: calc(50% + 110px); bottom: 40px; }
}
@media (max-width: 560px) {
  .hero-illus-noticies { display: none; }
}

/* Qui som hero — 3 persones, retallades per la corba */
.page-hero--qui-som {
  padding-top: calc(82px + 50px);
  padding-bottom: 50px;
}
.section-divider-hero--qui-som {
  position: relative;
  overflow: visible;
}
.hero-illus-qui-som {
  position: absolute;
  left: 58%;
  bottom: 0;
  width: 240px;
  height: auto;
  pointer-events: none;
  z-index: 5;
}
.section-divider-hero--qui-som svg {
  position: relative;
  z-index: 6;
}
@media (max-width: 1068px) {
  .hero-illus-qui-som { width: 200px; left: 60%; }
}
@media (max-width: 768px) {
  .page-hero--qui-som { padding-top: calc(82px + 24px); padding-bottom: 30px; }
  .hero-illus-qui-som { width: 140px; left: 60%; }
}

/* Transparència — dona amb lupa a l'esquerra del títol */
.hero-illus-transparencia {
  position: absolute;
  right: calc(50% + 240px);
  bottom: 0;
  width: 180px;
  height: auto;
  pointer-events: none;
  z-index: 5;
}
@media (max-width: 1068px) {
  .hero-illus-transparencia { width: 150px; right: calc(50% + 200px); }
}
@media (max-width: 768px) {
  .hero-illus-transparencia { width: 110px; right: calc(50% + 150px); }
}
@media (max-width: 560px) {
  .hero-illus-transparencia { display: none; }
}

/* FAQs hero illustration */
.section-divider-hero--faqs {
  position: relative;
}
.hero-illus-faqs {
  position: absolute;
  right: 25%;
  top: -195px;
  width: 150px;
  height: auto;
  pointer-events: none;
  z-index: 10;
}
@media (max-width: 768px) {
  .hero-illus-faqs { width: 100px; top: -20px; right: 15%; }
}

/* SECTION WAVE DIVIDER */
.section-divider-hero {
  background: #C62828;
  line-height: 0;
  margin-top: -1px;
}

/* PAGE BODY WRAPPER (internal pages) */
.page-body {
  position: relative;
  overflow: hidden;
}
.page-body--gradient-a { background: linear-gradient(180deg, #FFFFFF 0%, #FDF8F4 100%); }
.page-body--gradient-b { background: linear-gradient(160deg, #FFFFFF 0%, #F9F0EB 50%, #FFFFFF 100%); }
.page-body--gradient-c { background: linear-gradient(135deg, #FFFFFF 0%, #FDF8F4 40%, #F9F0EB 100%); }
.page-body::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,26,26,0.05) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  z-index: 0;
  pointer-events: none;
}
.page-body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,165,116,0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
  z-index: 0;
  pointer-events: none;
}
.page-body > * { position: relative; z-index: 1; }

/* PAGE CONTENT */
.page-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-content h2, .page-content h3 {
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.page-content p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.page-content ul, .page-content ol { margin-bottom: 16px; padding-left: 24px; }
.page-content li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.page-content a { color: var(--link); }
.page-content strong { color: var(--text-primary); }

/* SERVICES SUB-NAV (pestanyes horitzontals dins de cada servei) */
.services-subnav {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: sticky;
  top: 70px;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.services-subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.services-subnav-inner::-webkit-scrollbar { display: none; }
.services-subnav-link {
  flex: 0 0 auto;
  padding: 18px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.services-subnav-link:hover { color: var(--primary); }
.services-subnav-link[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
@media (max-width: 768px) {
  .services-subnav { top: 60px; }
  .services-subnav-inner { padding: 0 16px; gap: 0; }
  .services-subnav-link { padding: 14px 14px; font-size: 13px; }
}

/* BENEFITS (Borsa d'habitatge): targetes APILADES (propietat / llogater),
   cada una amb id (#propietat / #llogater) per enllaçar-hi amb àncora. */
.benefits-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 32px 0;
}
.benefits-col {
  background: rgba(164, 38, 39, 0.05);
  border-left: 4px solid var(--primary);
  padding: 24px 28px;
  border-radius: 8px;
  scroll-margin-top: 140px; /* nav fix (82px) + sub-nav (40px) + aire */
}
.benefits-col h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 22px;
}
.benefits-col ul { padding-left: 20px; margin: 0; }
.benefits-col li { margin-bottom: 10px; line-height: 1.5; }
.benefits-col ul ul { margin-top: 8px; margin-bottom: 4px; }
.benefits-col em { color: var(--text-secondary); font-style: italic; }
@media (max-width: 768px) {
  .benefits-grid { grid-template-columns: 1fr; gap: 20px; }
  .benefits-col { padding: 20px 22px; }
}

/* SERVICES PAGE GRID */
.services-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px 80px;
}
.service-page-card {
  background: var(--bg-gray);
  border-radius: 20px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s;
  display: block;
}
.service-page-card:hover { transform: translateY(-4px); }
.service-page-card .card-icon { font-size: 32px; margin-bottom: 16px; display: block; }
.service-page-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.service-page-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.service-page-card.is-pending { opacity: 0.7; cursor: default; }
.service-page-card.is-pending:hover { transform: none; }
.card-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}

/* NEWS PAGE GRID */
.news-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* FAQ */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.faq-group-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--primary);
  margin: 48px 0 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.faq-group-title:first-child { margin-top: 0; }
.faq-item { border-bottom: 1px solid rgba(0,0,0,0.08); }
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}
.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item.active .faq-question::after { content: '\2212'; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.faq-answer p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-bottom: 20px;
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.contact-info h3, .contact-form-wrap h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.contact-info p { font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.contact-info a { color: var(--link); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: block;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  background: white;
  transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  outline: none;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-submit:hover { background: var(--primary-dark); }
.form-success {
  font-size: 16px;
  color: var(--primary);
  padding: 24px;
  background: var(--primary-bg);
  border-radius: 12px;
  text-align: center;
}

/* ============================================
   ORGANIGRAMA — transparència
   ============================================ */
.org-chart {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.org-chart-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: var(--dark, #1A1014);
}
.org-chart-subtitle {
  text-align: center;
  color: var(--text-secondary, #555);
  margin: 0 0 48px;
  font-size: 16px;
}
.org-chart-level {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 24px;
  position: relative;
}
.org-chart-level--areas {
  flex-wrap: wrap;
  align-items: stretch;
}
.org-connector {
  width: 2px;
  height: 32px;
  background: rgba(0, 0, 0, 0.18);
  margin: 0 auto;
}
.org-connector--branched {
  position: relative;
  height: 40px;
}
.org-connector--branched::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(0, 0, 0, 0.18);
}
.org-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.org-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.org-card-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary, #D72B2B);
  margin-bottom: 6px;
}
.org-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--dark, #1A1014);
  letter-spacing: -0.01em;
}
.org-card h4 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark, #1A1014);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.org-card--root {
  background: linear-gradient(135deg, var(--primary, #D72B2B) 0%, var(--primary-dark, #C62828) 100%);
  border: none;
  min-width: 320px;
  color: #fff;
}
.org-card--root .org-card-eyebrow,
.org-card--root h3 { color: #fff; }
.org-card--root .org-card-eyebrow { opacity: 0.85; }
.org-card--management {
  background: #1A1014;
  border: none;
  min-width: 260px;
  color: #fff;
}
.org-card--management .org-card-eyebrow { color: rgba(255, 255, 255, 0.7); }
.org-card--management h3 { color: #fff; }
.org-card--area {
  flex: 1 1 280px;
  max-width: 340px;
  text-align: left;
  padding: 24px 24px 22px;
}
.org-card--area h4 { text-align: left; }
.org-card--area .org-card-eyebrow { text-align: left; }
.org-card-role {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: rgba(215, 43, 43, 0.06);
  border-left: 3px solid var(--primary, #D72B2B);
  border-radius: 6px;
  margin-bottom: 16px;
}
.org-card-role-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #D72B2B);
}
.org-card-role-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark, #1A1014);
}
.org-card-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-card-tasks li {
  padding-left: 18px;
  position: relative;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary, #555);
}
.org-card-tasks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #D72B2B);
}
@media (max-width: 768px) {
  .org-chart { margin-bottom: 60px; padding: 0 18px; }
  .org-chart-subtitle { margin-bottom: 32px; }
  .org-chart-level--areas { flex-direction: column; align-items: stretch; }
  .org-card--root,
  .org-card--management { min-width: 0; width: 100%; max-width: 360px; }
  .org-card--area { max-width: none; flex: 1 1 auto; }
}

/* TRANSPARENCY */
.transparency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.transparency-section {
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.05);
}
.transparency-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--primary);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.transparency-docs { list-style: none; padding: 0; margin: 0; }
.transparency-docs li { margin: 0 0 6px; }
.transparency-doc {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.transparency-doc:hover { background: rgba(215,43,43,0.06); color: var(--primary); }
.transparency-doc-icon { color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.transparency-doc-title { flex: 1; }
.transparency-empty { color: rgba(0,0,0,0.4); font-style: italic; font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  .transparency-grid { grid-template-columns: 1fr; }
}
.transparency-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 32px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.transparency-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}
.transparency-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.transparency-card .card-icon svg { width: 28px; height: 28px; }
.transparency-card h3 { font-size: 17px; font-weight: 700; margin: 0; color: var(--text-primary); }
.transparency-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.transparency-card .cta-link { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: auto; }

/* ANIMATIONS */
[data-fade] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-fade].visible { opacity: 1; transform: translateY(0); }
[data-fade-delay="1"] { transition-delay: 0.1s; }
[data-fade-delay="2"] { transition-delay: 0.2s; }
[data-fade-delay="3"] { transition-delay: 0.3s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ACCESSIBILITY */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* TABLET */
@media (max-width: 1068px) {
  .tab-grid { grid-template-columns: repeat(2, 1fr); }
  .profiles-grid { grid-template-columns: repeat(2, 1fr); }
  .profiles-illustration--ninots { width: 180px; bottom: calc(100% - 90px); }
  .profiles-illustration--jove { width: 150px; bottom: calc(100% - 90px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .news-page-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: repeat(2, 1fr); }
  .services-page-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .transparency-grid { grid-template-columns: 1fr; }
}

/* --- HERO EN PANTALLES BAIXES (desktop/tablet amb poca alçada útil) ---
   El titular va alineat a baix (.hero-container, padding-bottom) i la frase
   fixa (.hero-tagline) i la capçalera van a dalt. Si el viewport és curt
   (p. ex. monitor amb moltes barres del navegador), el bloc de baix i la
   caixa Novetats pugen i es trepitgen amb la frase fixa. Aquests trams
   compacten el hero perquè res se solapi. Només min-width:735px: a mòbil el
   hero ja és 60vh i aquests blocs absoluts estan amagats. */
@media (min-width: 735px) and (max-height: 880px) {
  .hero-container { padding-bottom: 120px; }
  .hero-title { font-size: clamp(2.2rem, 4.4vw, 3.3rem); }
  .hero-label { margin-bottom: 14px; }
  .hero-desc { margin-bottom: 26px; }
  .hero-tagline { padding-top: 20px; }
  .hero-novetats { bottom: 200px; }
}
@media (min-width: 735px) and (max-height: 760px) {
  .hero-container { padding-bottom: 88px; }
  .hero-title { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 16px; }
  .hero-desc { font-size: 15px; line-height: 1.55; margin-bottom: 18px; }
  .hero-label { margin-bottom: 8px; }
  .hero-tagline { top: 78px; padding-top: 12px; font-size: 16px; }
  .hero-novetats { bottom: 150px; padding: 18px 24px; max-width: 300px; }
  .hero-novetat { padding: 10px 0; }
  .hero-counter { bottom: 24px; }
  .hero-scroll { display: none; }
}
@media (min-width: 735px) and (max-height: 640px) {
  .hero-container { padding: 0 120px 60px 0; }
  .hero-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 12px; }
  .hero-desc { margin-bottom: 12px; }
  .hero-tagline { top: 74px; padding-top: 8px; font-size: 15px; }
  .hero-novetats { display: none; }
}

/* MOBILE */
@media (max-width: 734px) {
  .nav-links { display: none; }
  .nav-phone { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .hero { height: 86vh; min-height: 600px; max-height: none; }
  .hero-slide-bg { background-position: center 30%; }
  .hero-indicators { display: none; }
  .hero-container { padding: 0 24px 100px; text-align: left; max-width: 100%; }
  .hero-title { font-size: 32px; }
  .hero-logo-slide { width: min(70vw, 240px); }
  .hero-tagline { padding-top: 14px; font-size: 13.5px; max-width: 90%; }
  .hero-novetats, .hero-counter, .hero-scroll { display: none; }
  /* El contingut va centrat; li reservem espai a dalt (padding-top) perquè no
     se sobreposi amb la frase fixa (.hero-tagline, top:82px, ~2 línies a mòbil). */
  .hero-slide-content { align-items: center; justify-content: center; padding-top: 150px; padding-bottom: 28px; }
  .hero-slide-content--center { align-items: center; justify-content: center; padding-top: 120px; padding-bottom: 28px; }
  .hero-container { text-align: center; padding: 0 28px 40px; }
  .hero-container--logo { padding: 0 24px; text-align: center; }
  .hero-logo-tagline { font-size: 15px; max-width: 320px; }
  .hero-slide-overlay { background: linear-gradient(135deg, rgba(26,16,20,0.85) 0%, rgba(26,16,20,0.65) 60%, rgba(164,38,39,0.40) 100%); }
  .hero-label { font-size: 11px; letter-spacing: 0.12em; margin-bottom: 10px; }
  .hero-title { font-size: 24px; line-height: 1.2; }
  .hero-desc { font-size: 13px; line-height: 1.5; margin: 14px auto 22px; max-width: 320px; }
  .hero-actions { width: auto; justify-content: center; }
  .hero-actions .btn-primary { width: auto; max-width: none; padding: 9px 18px; font-size: 13px; }
  .hero-desc { margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
  .hero-nav { left: 50%; right: auto; bottom: 24px; transform: translateX(-50%); gap: 16px; }
  .hero-nav button { width: 40px; height: 40px; }
  .tab-grid { grid-template-columns: 1fr; }
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .profiles-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-page-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr; }
  .services-page-grid { grid-template-columns: 1fr; padding: 0 24px 60px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .feature-stats { flex-direction: column; gap: 16px; }
  .section--feature { padding: 80px 24px; min-height: auto; }
  .page-body::before, .page-body::after, .page-hero::before { display: none; }
  .section-divider-hero svg { height: 80px; }
  .section--feature-dark { min-height: auto; }
  .section--tabs, .section--profiles, .section--stats, .section--news { padding: 60px 24px; }
  .section--cta { padding: 80px 24px; }
  .cta-buttons { flex-direction: column; align-items: center; gap: 12px; }
  .cta-buttons .btn-lg { width: 100%; max-width: 320px; justify-content: center; text-align: center; }
  .profiles-illustration--ninots { width: 150px; bottom: calc(100% - 75px); }
  .profiles-illustration--jove { width: 120px; bottom: calc(100% - 75px); }
  .services-v2-cta { flex-direction: column; text-align: center; padding: 28px 22px; gap: 18px; }
  .services-v2-cta-actions { width: 100%; justify-content: center; flex-wrap: wrap; }
  .services-v2-cta-text h3 { font-size: 19px; }
  .services-v2-cta-text p { font-size: 14px; }
}

/* FLOATING PHONE BUTTON */
.fab-phone {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(164,38,39,0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
  text-decoration: none;
}
.fab-phone:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(164,38,39,0.45);
}
.fab-phone svg { width: 24px; height: 24px; }

/* SMALL MOBILE */
@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .hero-logo-slide { width: min(65vw, 200px); }
  .stats-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; gap: 20px; }
  .team-photo { width: 110px; height: 110px; }
  .section-divider-hero svg { height: 60px; }
  .profiles-illustration--ninots { width: 120px; bottom: calc(100% - 60px); }
  .profiles-illustration--jove { width: 100px; bottom: calc(100% - 60px); }
  .fab-phone { bottom: 20px; right: 20px; width: 50px; height: 50px; }
  .fab-phone svg { width: 22px; height: 22px; }
  .footer-top { gap: 32px; }
  .footer-aj-logo { width: 40px; height: auto; }
  .footer-ghs-logo { width: 48px; height: auto; }
  .services-v2-cta { padding: 24px 18px; }
  .services-v2-cta-btn { padding: 11px 18px; font-size: 14px; }
}

.nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.nav-lang-btn {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  letter-spacing: 0.04em;
}
.nav-lang-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.nav-lang-btn.is-active { color: #fff; }
.nav-lang-sep { color: rgba(255, 255, 255, 0.35); pointer-events: none; }
body:has(.page-hero) .nav-lang-btn { color: rgba(255, 255, 255, 0.7); }
body:has(.page-hero) .nav-lang-btn.is-active { color: #fff; }

.mobile-menu-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
}
.mobile-menu-lang .nav-lang-btn { color: rgba(255, 255, 255, 0.65); padding: 6px 10px; }
.mobile-menu-lang .nav-lang-btn.is-active { color: #fff; }
.mobile-menu-lang .nav-lang-sep { color: rgba(255, 255, 255, 0.35); }

@media (max-width: 1068px) {
  .nav-lang { display: none; }
}

/* Icones xarxes socials al nav */
.nav-social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}
.nav-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.75;
  transition: opacity 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}
.nav-social-link:hover {
  opacity: 1;
  color: var(--primary);
  transform: translateY(-1px);
  background: rgba(0,0,0,0.05);
}
.nav--hero .nav-social-link {
  color: #fff;
}
.nav--hero .nav-social-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
}
.nav-social--mobile {
  margin-top: 14px;
  gap: 14px;
  justify-content: center;
}
.nav-social--mobile .nav-social-link {
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.05);
  opacity: 1;
}
@media (max-width: 1067px) {
  .nav .nav-social { display: none; }
}

/* ===== Serveis v2 — acordeó amb logos ===== */
.services-v2-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 920px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
}
.services-v2-item + .services-v2-item {
  border-top: 1px solid rgba(0,0,0,0.08);
}
.services-v2-item details summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s;
}
.services-v2-item details summary::-webkit-details-marker { display: none; }
.services-v2-item details summary::marker { content: ''; }
.services-v2-item details summary:hover { background: rgba(0,0,0,0.02); }
.services-v2-item details[open] summary { background: rgba(212,43,43,0.04); }

.services-v2-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}
.services-v2-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
/* Agència de l'Habitatge — logo amb text blanc, cal fons fosc */
.services-v2-logo--agencia {
  background: #2C3E50;
  border-color: #1F2C38;
}
/* Ajuntament de Valls — logo amb text blanc, cal fons fosc */
.services-v2-logo--ajuntament {
  background: #2C3E50;
  border-color: #1F2C38;
}

.services-v2-titol {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.services-v2-titol strong {
  font-weight: 700;
  font-size: 16px;
  color: var(--dark, #1A1014);
  line-height: 1.3;
}
.services-v2-titol small {
  font-size: 13.5px;
  color: rgba(0,0,0,0.6);
  line-height: 1.45;
}

.services-v2-chevron {
  flex-shrink: 0;
  color: rgba(0,0,0,0.4);
  transition: transform 0.2s, color 0.2s;
}
.services-v2-item details[open] .services-v2-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.services-v2-content {
  padding: 8px 28px 28px 94px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(0,0,0,0.78);
  border-top: 1px dashed rgba(0,0,0,0.08);
  margin-top: 0;
}
.services-v2-content > *:first-child { margin-top: 16px; }
.services-v2-content h2,
.services-v2-content h3 {
  font-size: 17px;
  margin: 22px 0 8px;
  color: var(--dark, #1A1014);
}
.services-v2-content p { margin: 0 0 12px; }
.services-v2-content ul, .services-v2-content ol { margin: 0 0 12px; padding-left: 22px; }
.services-v2-content li { margin-bottom: 4px; }
.services-v2-content a { color: var(--primary); text-decoration: underline; }

.services-v2-org-info {
  margin-top: 20px !important;
  padding: 10px 14px;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  font-size: 13.5px;
  color: rgba(0,0,0,0.65);
}
.services-v2-pagecompleta {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.services-v2-pagecompleta:hover { text-decoration: underline; }

.services-v2-legenda {
  max-width: 920px;
  margin: 32px auto 0;
  padding: 18px 22px;
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  font-size: 13px;
  color: rgba(0,0,0,0.7);
}
.services-v2-legenda span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.services-v2-logo--mini {
  width: 48px;
  height: 48px;
  padding: 5px;
  border-radius: 8px;
}

/* CTA serveis-2 */
.services-v2-cta {
  max-width: 920px;
  margin: 48px auto 80px;
  padding: 32px 36px;
  background: linear-gradient(135deg, #D72B2B 0%, #A42627 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(215, 43, 43, 0.25);
}
.services-v2-cta-text h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.services-v2-cta-text p {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}
.services-v2-cta-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.services-v2-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.services-v2-cta-btn--primary {
  background: #fff;
  color: #A42627;
}
.services-v2-cta-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.services-v2-cta-btn--secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.services-v2-cta-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}
@media (max-width: 720px) {
  .services-v2-cta {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
    gap: 20px;
  }
  .services-v2-cta-actions { width: 100%; justify-content: center; flex-wrap: wrap; }
}

.services-v2-help-line {
  max-width: 920px;
  margin: 24px auto 0;
  text-align: center;
  font-size: 14px;
  color: rgba(0,0,0,0.6);
}
.services-v2-help-line a {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 733px) {
  .services-v2-item details summary { padding: 14px 16px; gap: 12px; }
  .services-v2-logo { width: 44px; height: 44px; padding: 4px; }
  .services-v2-titol strong { font-size: 15px; }
  .services-v2-titol small { font-size: 12.5px; }
  .services-v2-content { padding: 8px 18px 22px 18px; }
  .services-v2-legenda { flex-direction: column; gap: 10px; align-items: flex-start; }
  .services-v2-logo--mini { width: 40px; height: 40px; }
}
