/* ==========================================================================
   Sara Balsells. Nutrició Clínica i PNI
   Sistema de disseny: colors, tipografia i components compartits
   ========================================================================== */

/* --- Tipografia autoallotjada ------------------------------------------- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0300-0304, U+0308, U+0329, U+1E00-1EFF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0300-0304, U+0308, U+0329, U+1E00-1EFF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0300-0304, U+0308, U+0329, U+1E00-1EFF;
}

/* --- Variables ------------------------------------------------------------ */
:root {
  /* Colors */
  --bg: #F7F5F0;          /* blanc trencat */
  --surface: #E8E1D6;     /* beix mineral */
  --surface-soft: #EFEAE1;/* beix molt pàl·lid, per franges de tancament */
  --ink: #1D1D1B;         /* antracita */
  --ink-soft: #3A3936;    /* text secundari */
  --ink-softer: #6b6862;  /* text terciari / gris */
  --line: #CFC7BC;        /* línia cronològica */
  --line-2: #D4CDC1;      /* separadors */
  --terracotta: #B86F5B;
  --terracotta-dark: #864737;

  /* Alias que usen els components legals i el banner de consentiment */
  --beige: #E8E1D6;        /* = --surface */
  --off-white: #F7F5F0;    /* = --bg */
  --line-strong: #C9BFB0;  /* línia més marcada que --line-2 */
  --ink-mute: #6b6862;     /* = --ink-softer */

  /* Tipografia */
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Ritme */
  --container: 1180px;
  --container-narrow: 760px;
  --radius: 6px;
  --gap: clamp(1.25rem, 2vw, 2rem);
}

/* --- Reset bàsic ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* --- Tipografia general -------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
h4 { font-size: 1.25rem; font-family: var(--font-sans); font-weight: 600; }

.eyebrow {
  font: italic 400 1.25rem/1.2 var(--font-serif);
  color: var(--terracotta-dark);
}
.eyebrow + h1 { margin-top: 0.4rem; }
main .eyebrow:has(+ h1):not(.legal-text > .eyebrow) {
  margin-inline-start: clamp(-0.875rem, -1.2vw, -0.5rem);
}

.lede {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  color: var(--ink-soft);
  line-height: 1.55;
}

.text-body { color: var(--ink-soft); }
.text-body p + p { margin-top: 1.1em; }
.text-body strong { color: var(--ink); font-weight: 600; }

.rule {
  width: 56px;
  height: 1px;
  background: var(--line-2);
  border: 0;
  margin: 1.4rem 0;
}
.rule--center { margin-left: auto; margin-right: auto; }

/* --- Layout --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.bg-bg { background: var(--bg); }
.bg-surface { background: var(--surface); }
.bg-surface-soft { background: var(--surface-soft); }

.measure { max-width: 640px; }

/* --- Botons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  justify-content: center;
  padding: 0.65em 1.2em;
  border-radius: var(--radius);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  text-align: center;
}
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn:hover { transform: translateY(-1px); }

.btn--dark { background: var(--ink); color: var(--bg); }
.btn--dark:hover { background: #000; }

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--bg); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-arrow svg { display: none; }
.link-arrow:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }

/* --- Capçalera / navegació -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 1.45vw, 1.5rem);
  padding-block: 1.1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand__mark {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.02em;
}
/* El punt del monograma és l'únic element terracota de la marca. */
.brand__mark .dot { color: var(--terracotta); }
.brand__text { line-height: 1.2; }
.brand__name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand__tagline {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-softer);
}

.nav { display: flex; align-items: center; gap: clamp(0.7rem, 1.15vw, 1.2rem); margin-left: auto; }
.nav__link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding-bottom: 6px;
  white-space: nowrap;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1060px) {
  .site-header__inner { justify-content: flex-start; }
  .site-header__inner > .brand { margin-right: auto; }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    flex: none;
    width: 44px;
    height: 44px;
  }
  .nav {
    position: fixed;
    z-index: 1;
    /* Les quatre propietats abans d'inset: sense això, els Safari
       anteriors al 14.1 deixen el calaix sense posicionar i es veu
       enmig de la pàgina. */
    top: 0; right: 0; bottom: 0; left: auto;
    inset: 0 0 0 auto;
    width: min(78vw, 340px);
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 5rem 1.5rem 1.5rem;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.32s ease;
    box-shadow: -12px 0 32px rgba(0,0,0,0.08);
  }
  .nav.is-open { transform: translateX(0); visibility: visible; }
  /* Fons enfosquit darrere el menú obert: tocar-lo tanca el menú (js/main.js). */
  body.nav-locked .site-header::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgb(29 29 27 / 38%);
  }
  .nav__reserva { display: inline-flex; width: 100%; margin-block: 1rem 0.5rem; }
  .nav__link { font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; }
  body.nav-locked { overflow: hidden; }
}

/* El botó de reserva del menú només surt al menú del mòbil. */
@media (min-width: 1061px) {
  .nav__reserva { display: none; }
}

/* --- Peu de pàgina ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 2.25rem clamp(2rem, 3.2vw, 3.25rem);
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2.25rem, 4.5vw, 3.5rem);
}
.site-footer__identitat { display: inline-flex; }
.site-footer__professio { margin-top: 0.85rem; max-width: 27ch; color: var(--ink-softer); }
.site-footer__titol {
  margin-bottom: 0.95rem;
  color: var(--ink);
  font: 400 1.4rem/1.1 var(--font-serif);
}
.site-footer__adreca { font-style: normal; }
.site-footer__adreca span { display: block; overflow-wrap: anywhere; }
.site-footer__adreca span:empty { display: none; }
.site-footer__adreca span:first-child { margin-bottom: 0.5rem; }
.site-footer__reserva { margin-top: 0.8rem; min-height: 2rem; }
.site-footer__menu ul { display: grid; gap: 0.35rem 1rem; }
.site-footer a:hover, .site-footer__cookies:hover { color: var(--ink); text-decoration: underline; }
.site-footer__legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding-block: 1.15rem 1.35rem;
  border-top: 1px solid var(--line-2);
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-softer);
}
.site-footer__drets { font-size: inherit; }
.site-footer__legal nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.4rem;
}
.site-footer__cookies { padding: 0; }

@media (min-width: 1000px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1.13fr) minmax(0, 0.72fr) minmax(0, 1.16fr) minmax(0, 1.09fr);
  }
}
@media (max-width: 559px) {
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 1.95rem; }
  .site-footer__marca { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line-2); }
  .site-footer__professio { max-width: none; }
  .site-footer__titol { margin-bottom: 0.65rem; }
  .site-footer__menu ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
}

/* --- Pillars / 2x2 (BLOC 2) ------------------------------------------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.75rem 3rem;
}
/* Els àmbits comparteixen una jerarquia de títol i descripció. */
.pillar, .area { border-top: 1px solid var(--line); padding-top: 1rem; }
.area .area__num { display: none; }
.area:has(.area__num--blue) { border-top-color: var(--terracotta); }
.pillar h3, .area h2 {
  font: 400 clamp(1.5rem, 3vw, 1.85rem)/1.15 var(--font-serif);
  margin-bottom: 0.4rem;
}
.pillar p, .area p { color: var(--ink-soft); }

@media (max-width: 640px) {
  .pillars { grid-template-columns: 1fr; gap: 2.25rem; }
}

/* --- Línia de temps vertical (Sobre mi) -------------------------------------- */
.timeline { position: relative; padding-left: 2.4rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 2.6rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -2.4rem;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
}
.timeline__dot--blue { background: var(--terracotta-dark); }
.timeline__item p { font-size: 1.05rem; line-height: 1.75; color: #353431; max-width: 640px; }
.timeline__pubs {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}
.timeline__pubs a.link-arrow { font-size: 0.95rem; }
.timeline__orcid {
  font-size: 0.9rem;
  color: var(--ink-softer);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Línia de temps horitzontal / procés (Consulta) -------------------------- */
.process { position: relative; padding-left: 2.6rem; }
.process::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--terracotta);
  opacity: 0.45;
}
.process__step { position: relative; padding-bottom: 2.75rem; }
.process__step:last-child { padding-bottom: 0; }
.process__dot {
  position: absolute;
  left: -2.6rem;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 4px var(--surface);
}
.process__dot--blue { background: var(--terracotta-dark); }
.process__step p.process__num {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--terracotta);
  line-height: 1;
  margin-top: 0;
}
.process__step p.process__num--blue { color: var(--terracotta-dark); }
.process__step p.process__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-softer);
  margin-top: 0.6rem;
}
.process__title { font-family: var(--font-serif); font-size: 1.6rem; margin-top: 0.15rem; }
.process__step p { margin-top: 0.5rem; color: var(--ink-soft); max-width: 620px; }
.process__step strong { color: var(--terracotta-dark); font-weight: 700; }

/* --- Àrees (composició oberta) ------------------------------------------------ */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 3.5rem;
  row-gap: 3rem;
}

@media (max-width: 640px) {
  .areas-grid { grid-template-columns: 1fr; row-gap: 2.25rem; }
}

/* --- Principis connectats (Consulta bloc 3) ------------------------------------ */
.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  align-items: start;
  text-align: center;
}
.principle__icon {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  color: var(--ink-soft);
}
.principle__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); margin: 1rem auto; }
.principle p { font-family: var(--font-sans); font-weight: 600; font-size: 0.98rem; }
@media (max-width: 760px) {
  .principles { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
}

/* --- Articles (Coneixement) ---------------------------------------------------- */
.articles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.75rem);
}
.article-card__figure { margin: 0 0 1.25rem; }
.article-card__figure img { width: auto; height: auto; border-radius: var(--radius); }
.article-card__figure img[src^="img/illustrations/article-"] {
  max-width: min(100%, 138px);
  filter: drop-shadow(0 0 0 rgb(29 29 27 / 18%));
}
.article-card p.eyebrow { color: var(--terracotta-dark); margin-bottom: 0.4rem; }
.article-card h3 { font-size: 1.7rem; margin-bottom: 0.6rem; }
.article-card p { color: var(--ink-soft); margin-bottom: 1rem; }
@media (max-width: 860px) {
  .articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .articles { grid-template-columns: 1fr; }
}

/* --- Acordió FAQ ----------------------------------------------------------------- */
.faq-item { border-bottom: 1px solid var(--line-2); }
.faq-item:first-child { border-top: 1px solid var(--line-2); }
.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 0;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}
.faq-item__plus {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--terracotta);
}
.faq-item__plus::before, .faq-item__plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.25s ease;
}
.faq-item__plus::before { left: 0; top: 50%; width: 100%; height: 1.5px; transform: translateY(-50%); }
.faq-item__plus::after { top: 0; left: 50%; height: 100%; width: 1.5px; transform: translateX(-50%); }
.faq-item[data-open="true"] .faq-item__plus::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }
.faq-item__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.faq-item__panel p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 620px;
  padding-bottom: 1.4rem;
}


/* --- Hero ------------------------------------------------------------------------ */
/* El text mana sobre la il·lustració: columna més ampla i titular que cap
   en tres línies, com al disseny de referència. */
.hero__title { font-size: clamp(2.55rem, 4.5vw, 4rem); }
.hero__figure { padding-top: 1.5rem; }
/* El traç clar del PNG guanya contrast sense afegir difuminat. */
.hero__figure img, .illustration {
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 0 0 rgb(29 29 27 / 42%));
}
.hero__figure img { width: min(100%, 26rem); }
.illustration { max-width: min(100%, 398px); }
/* En una sola columna la il·lustració va centrada. El dibuix de hero-anatomia.png té 36 px buits a l'esquerra i 220 a
   la dreta (de 656): el desplaçament del 14 % el centra, i el retall evita que el buit transparent faci desplaçar la
   pàgina en horitzontal. */
@media (max-width: 860px) {
  .hero__figure { padding-top: 0; overflow-x: clip; }
  .hero__figure img { max-width: 23.75rem; transform: translateX(14%); }
}

/* --- Utilitats ------------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.grid-2.hero { align-items: start; }
@media (min-width: 861px) {
  .grid-2.hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    column-gap: clamp(2.2rem, 4.2vw, 3.8rem);
  }
}
@media (max-width: 860px) {
  .grid-2, .hero { grid-template-columns: 1fr; }
}
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.visually-hidden {
  position: absolute; 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: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 0.7rem 1.2rem; border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

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

/* ============================================================
   PÀGINES LEGALS
   Text llarg de lectura seguida: columna estreta, jerarquia
   tranquil·la i cap marc, coherent amb la resta del web.
   ============================================================ */

.legal-text { max-width: 46rem; margin-inline: auto; }
/* Capçalera de les pàgines legals centrada (títol i entradeta). El cos del
   text es manté alineat a l'esquerra, que és el més llegible. */
.legal-text > .eyebrow,
.legal-text > h1,
.legal-intro { text-align: center; }
.legal-text > .rule { margin-inline: auto; }

.legal-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 400;
  color: var(--ink);
  margin: 3rem 0 0.9rem;
}

.legal-text p,
.legal-text li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.legal-text p { margin-bottom: 1rem; }
.legal-text strong { color: var(--ink); font-weight: 600; }

.legal-text a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--terracotta);
  text-decoration-thickness: 1px;
}
.legal-text a:hover { color: var(--terracotta); }

.legal-intro {
  font-size: 1.075rem !important;
  line-height: 1.7 !important;
  color: var(--ink) !important;
  margin-bottom: 2rem;
}

.legal-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.legal-list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.6rem;
}

.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--terracotta);
}

/* Taula finalitat / base jurídica: la manera més clara d'exposar
   l'article 13 del RGPD sense convertir-ho en un mur de text. */
.legal-table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.legal-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
  color: var(--ink-soft);
}

.legal-table th {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--ink);
  padding-bottom: 0.6rem;
}

.legal-table td:first-child { color: var(--ink); font-weight: 500; }

.legal-highlight {
  background: var(--beige);
  padding: 1.5rem 1.75rem;
  margin: 0 0 1.25rem;
  border-left: 2px solid var(--terracotta);
}
.legal-highlight p:last-child { margin-bottom: 0; }

/* Avís de camps pendents: ha de destacar prou perquè ningú publiqui
   una pàgina legal amb buits, i desapareix sol quan s'omplen. */
.legal-warning {
  background: #FBF0EC;
  border: 1px solid var(--terracotta);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2.5rem;
}

.legal-warning__title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.4rem !important;
}

.legal-warning p:last-child { margin-bottom: 0; }

mark.pendent {
  background: #FBE3DC;
  color: #8A4433;
  font-family: var(--font-sans);
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.1em 0.4em;
}

.legal-updated {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem !important;
  color: var(--ink-mute);
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

/* ============================================================
   BANNER DE CONSENTIMENT
   ============================================================ */

.consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  background: var(--off-white);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgba(29, 29, 27, 0.13);
  animation: consent-in 0.35s ease both;
}

@keyframes consent-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .consent { animation: none; }
}

.consent__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 60rem;
  margin: 0 auto;
}

.consent__titol {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--terracotta-dark);
  margin-bottom: 0.5rem;
}

.consent__text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

.consent__text a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--terracotta);
}

.consent__accions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.consent__accions .btn { flex: 1; text-align: center; justify-content: center; }

@media (min-width: 46rem) {
  .consent { left: 2rem; right: 2rem; bottom: 2rem; }
  .consent__inner {
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
    padding: 1.6rem 2rem;
  }
  .consent__accions .btn { flex: 0 0 auto; }
}

/* ============================================================
   SELECTOR D'IDIOMA I PECES BILINGÜES
   ============================================================ */

/* Dos enllaços reals (CA · ES), no un desplegable amb JavaScript: així
   funciona sense scripts, Google els segueix i es pot fer clic amb el dit
   sense encertar un menú petit. */
.tria-idioma {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.15rem;
  margin-left: 0.4rem;
}
.tria-idioma__opcio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 2.25rem d'alt perquè el dit hi encerti al mòbil sense haver d'apuntar */
  min-width: 2.4rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-softer);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.tria-idioma__opcio:hover { color: var(--ink); }
.tria-idioma__opcio[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
}

@media (max-width: 1060px) {
  /* Dins del calaix del mòbil el selector va sol a la seva línia i més gran */
  .tria-idioma {
    margin-left: 0;
    margin-top: 0.6rem;
    align-self: flex-start;
  }
  .tria-idioma__opcio { min-width: 3rem; min-height: 44px; font-size: 0.85rem; }
}

/* Avís quan un article encara no té versió en l'idioma que es consulta */
.avis-idioma {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--terracotta);
  background: var(--surface, #F0EDE6);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ============================================================
   CLASSES QUE ABANS ERAN ESTILS INLINE
   Treure els style="..." del HTML permet endurir la política de
   seguretat i, de passada, deixa el disseny en un sol lloc.
   ============================================================ */

/* Fil de passos de la pàgina de consulta */
.fil-passos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55em;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Frase gran de tancament */
.frase-gran {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  max-width: 760px;
  line-height: 1.35;
}

/* Parell de botons que al mòbil s'apilen i ocupen tota l'amplada */
.botons-fila {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  .botons-fila { flex-direction: column; align-items: stretch; }
  .botons-fila .btn { justify-content: center; }
}

/* Blocs d'adreça i preus */
.blocs-contacte { align-items: start; gap: clamp(2rem, 5vw, 4rem); }
.bloc-icona { display: flex; gap: 0.9rem; }
.bloc-icona > svg { width: 1.6rem; height: 1.6rem; flex: none; }
.bloc-icona__titol { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.25; }
.preu {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  line-height: 1.2;
}
.preu span {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.preu-separador {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 1rem 0;
  max-width: 240px;
}

/* Cos d'un article: el text el compon la Sara, així que ha de resistir
   paràgrafs llargs, llistes i cites sense desmuntar-se. */
.article-ruta { margin-bottom: 0.9rem; color: var(--ink-softer); font-size: 0.9rem; }
.article-ruta a { text-decoration: underline; text-underline-offset: 0.2em; }
.article-ruta a:hover { color: var(--terracotta-dark); }
.enllacos-context { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1.4rem; }
.quadre-resum .enllacos-context { justify-content: center; }
.article-cos { font-size: 1.05rem; line-height: 1.75; }
.article-cos h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.25rem; }
.article-cos h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); margin-top: 1.75rem; }
.article-cos p { margin-bottom: 1rem; }
.article-cos ul, .article-cos ol { margin: 0 0 1rem 1.25rem; }
.article-cos li { margin-bottom: 0.4rem; }
.article-cos blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--terracotta);
  font-family: var(--font-serif);
  font-size: 1.15em;
}
.article-cos a { color: var(--terracotta-dark, #9A5744); }
/* Mides de text triables des de l'editor (predefinides, per mantenir el web coherent). */
.text-gran { font-size: 1.35em; }
.text-petit { font-size: 0.82em; }

/* ============================================================
   LECTURA CÒMODA A QUALSEVOL PANTALLA I NAVEGADOR
   ============================================================ */

/* iOS: amb 100vh, la barra d'adreces del Safari tapa el final del calaix del
   menú i les últimes opcions queden fora de la pantalla. dvh mesura l'alçada
   que es veu de debò; el 100vh de la línia anterior queda de recanvi per als
   navegadors que encara no entenen dvh. */
@media (max-width: 1060px) {
  .nav { height: 100vh; height: 100dvh; overflow-y: auto; }
}

/* Cap element pot ser més ample que la pantalla: és el que provoca la
   barra de desplaçament horitzontal al mòbil. */
img, svg, video, table { max-width: 100%; }
body { overflow-x: hidden; }

/* Paraules llargues (noms de fàrmacs, adreces de correu) no han de sobresortir */
h1, h2, h3, h4, p, li, td, th, .lede { overflow-wrap: break-word; }

/* Taules llargues es desplacen dins el seu marc, no arrosseguen la pàgina */
.legal-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }


/* Cap zona per tocar per sota de 44px, que és el mínim recomanat per poder
   encertar-la amb el dit. */
@media (pointer: coarse) {
  .nav__link, .site-footer a, .site-footer__cookies, .link-arrow, .faq-item__trigger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .faq-item__trigger { display: flex; }
}

/* Impressió: sense menús ni botons, només el contingut */
@media print {
  .site-header, .site-footer, .consent, .skip-link, .tria-idioma, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1rem; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
}


/* Bloc de col·legiació amb alternativa local i logo editable des del gestor. */
.collegiada { width: min(18rem, 100%); }
.collegiada__marca {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.85rem;
  width: min(15rem, 86%);
}
.collegiada__icona { width: 2rem; height: 2rem; flex: none; color: var(--terracotta-dark); }
.collegiada__marca:has(.collegiada__logo) { flex-direction: column; align-items: flex-start; }
.collegiada__logo { max-height: 8.5rem; max-width: 100%; width: auto; height: auto; }

/* El marc només amaga el marge buit del PNG local. */
.collegiada__fitxer-local {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 120 / 31;
  overflow: hidden;
  mix-blend-mode: multiply;
}
.collegiada__fitxer-local img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 131.25%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}

/* Prioritat al logo del gestor. Per a altres col·legis queda la icona i el nom. */
.collegiada__marca:has(.collegiada__logo) .collegiada__fitxer-local,
.collegiada__marca:has(
  [data-collegi]:not([data-collegi="COFB" i], [data-collegi*="Farmacèutics de Barcelona" i],
    [data-collegi*="Farmacéuticos de Barcelona" i])
) .collegiada__fitxer-local { display: none; }

.collegiada__marca:has(
  [data-collegi="COFB" i], [data-collegi*="Farmacèutics de Barcelona" i], [data-collegi*="Farmacéuticos de Barcelona" i]
) .collegiada__icona,
.collegiada__text:is(
  [data-collegi="COFB" i], [data-collegi*="Farmacèutics de Barcelona" i], [data-collegi*="Farmacéuticos de Barcelona" i]
) .collegiada__nom { display: none; }
.collegiada__text { line-height: 1.45; }
.collegiada__nom { display: block; font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink); }
.collegiada__num { display: block; font-size: 0.875rem; color: var(--ink-softer); }

@media (max-width: 580px) {
  h1 { font-size: clamp(2.35rem, 8vw, 3rem); }
  .container { padding-inline: 1.6rem; }
  .section { padding-block: 3.75rem; }
  .section--tight { padding-block: 3rem; }
  main .eyebrow:has(+ h1):not(.legal-text > .eyebrow) { margin-inline-start: 0; }
  .text-body p + p { margin-top: 1.35em; }
  .rule { margin-block: 1.75rem; }
  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.5rem;
    padding-block: 0.8rem;
  }
  .site-header__inner > .nav-toggle { grid-column: 2; grid-row: 1; }
  .timeline, .process { margin-left: 0.125rem; }
  .timeline { padding-left: 1.4rem; }
  .timeline__dot { left: -1.4rem; }
  .process { padding-left: 1.5rem; }
  .process__dot { left: -1.5rem; }
  .principles { gap: 1.5rem 0.85rem; }
  .principle__icon { width: 3rem; height: 3rem; }
  .consent__accions { flex-wrap: wrap; }
}

/* Classes compartides per evitar estils dispersos al marcatge. */
.introduccio-illustrada {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 13rem);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
}
.introduccio-illustrada__imatge {
  width: 100%;
  height: auto;
  /* Tint oliva sobre els traços transparents. */
  filter: brightness(0) invert(32%) sepia(95%) hue-rotate(33deg);
}
@media (max-width: 580px) {
  .introduccio-illustrada { grid-template-columns: 1fr; gap: 0.6rem; }
  .introduccio-illustrada__imatge { width: clamp(7rem, 31vw, 9rem); }
}

.titol-pagina { max-width: 22ch; }
.titol-seccio { font-size: clamp(1.85rem, 3vw, 2.6rem); }
.ample-text { max-width: 62ch; }
.seccio-inici { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.sense-marge-superior { padding-top: 0; }
.seccio-articles { padding-top: 1rem; }
.pes-mitja { font-weight: 600; }
.quadre-resum { max-width: var(--container-narrow); margin-inline: auto; text-align: center; }
.llista-arees { display: grid; gap: 0.65rem; }
.ubicacio { display: flex; align-items: flex-start; gap: 0.55rem; }
.ubicacio svg { width: 1.2em; height: 1.2em; flex: none; margin-top: 0.23em; }
.separador-ample { border: 0; border-top: 1px solid var(--line-2); }
.destacat { color: var(--terracotta-dark); }
.fil-passos svg { display: none; }
.fil-passos span + span::before, .fil-passos svg + span::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 0.2em;
  height: 0.2em;
  margin-right: 0.55em;
  border-radius: 50%;
  background: var(--terracotta);
}
.article-cos ul { list-style: disc; }
.article-cos ol { list-style: decimal; }
.article-cos a { text-decoration: underline; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
#reserva { scroll-margin-top: 5.5rem; }

.newsletter-finestra {
  position: fixed;
  width: min(45rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
}
.newsletter-finestra[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 1rem;
}
.newsletter-finestra::backdrop { background: rgb(29 29 27 / 42%); }
.newsletter-tanca {
  position: absolute;
  inset: 0.35rem 0.35rem auto auto;
  z-index: 1;
  min-width: 44px;
  min-height: 44px;
  background: var(--bg);
  font-size: 1.4rem;
}
.newsletter-finestra__text { padding: clamp(1.25rem, 4vw, 2rem); }
.newsletter-finestra__imatge { width: calc(100% - 1rem); height: auto; margin: 0.5rem; }
.newsletter-form { display: grid; gap: 0.7rem; }
.newsletter-form label { display: grid; gap: 0.25rem; font-size: 0.95rem; }
.newsletter-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--ink-softer);
  border-radius: 4px;
  background: var(--bg);
  font-size: 1rem;
}
.newsletter-form label.newsletter-mesura { display: flex; align-items: start; gap: 0.5rem; }
.newsletter-privacitat { text-decoration: underline; font-size: 0.875rem; }
.newsletter-trampa { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.bloc-web__contingut { max-width: 46rem; }
.bloc-web__contingut--foto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  align-items: center;
  gap: var(--gap);
  max-width: none;
}
.bloc-web img { width: auto; height: auto; max-width: 100%; }
.bloc-web p { margin-top: 0.65rem; }
.bloc-web--sans h2, .bloc-web--sans h3 { font-family: var(--font-sans); }
.bloc-web--serif p { font-family: var(--font-serif); }
.bloc-web--gran p { font-size: 1.15em; }
.bloc-web--molt-gran p { font-size: 1.3em; }
.bloc-web--terracota, .bloc-web--terracota :is(h2, h3) { color: var(--terracotta-dark); }
@media (max-width: 580px) {
  .newsletter-finestra[open] { grid-template-columns: 1fr; }
  .newsletter-finestra__imatge { width: min(48%, 12rem); margin: 0 auto 1rem; }
}
@media (max-width: 580px) {
  #reserva { scroll-margin-top: 8rem; }
}
