/* =========================================================================
   ZER Els Ceps — full institucional
   Web estàtica (HTML + CSS). Sense build, sense dependències.
   Paleta sòbria: verd de vinya (institucional) + accent granat del Penedès.
   ========================================================================= */

:root {
  --paper:      #faf9f5;
  --paper-2:    #f2f0e8;
  --ink:        #1f2a24;
  --muted:      #566058;
  --green:      #2c5138;
  --green-dark: #1e3a27;
  --wine:       #7a2e39;
  --line:       #dad8cd;
  --line-soft:  #e6e4da;
  --focus:      #9a6a2c;

  --maxw: 1080px;
  --gap: clamp(1.5rem, 4vw, 3rem);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.62;
  font-size: 1.02rem;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- Enllaços base ---- */
a {
  color: var(--green-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--wine); }

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

/* ---- Skip link ---- */
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--green-dark);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip:focus { top: 1rem; color: #fff; }

/* ---- Contenidor ---- */
.wrap {
  width: min(100% - 2.4rem, var(--maxw));
  margin-inline: auto;
}

/* =========================================================================
   Capçalera institucional
   ========================================================================= */
.masthead {
  border-top: 4px solid var(--green);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  padding-block: clamp(1.4rem, 3vw, 2.2rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}
.brand:hover { color: inherit; }

.brand__mark {
  flex: none;
  width: 46px;
  height: 46px;
  color: var(--green);
}

.brand__logo {
  display: block;
  height: clamp(56px, 8vw, 74px);
  width: auto;
  border-radius: 7px;
}

.brand__text { display: flex; flex-direction: column; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.brand__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.masthead__tagline {
  margin-left: auto;
  max-width: 30ch;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

/* ---- Navegació ---- */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}
.nav__list a {
  display: inline-block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  border-bottom: 3px solid transparent;
}
.nav__list a:hover,
.nav__list a:focus-visible {
  color: var(--green-dark);
  border-bottom-color: var(--green);
}

/* =========================================================================
   Seccions
   ========================================================================= */
main { display: block; }

.section { padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--line-soft); }
.section--alt { background: var(--paper-2); }

.section__eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--wine);
  margin: 0 0 0.6rem;
}

.section__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  line-height: 1.55;
  max-width: 60ch;
  color: var(--ink);
  margin: 0 0 1rem;
}

.prose { max-width: 66ch; }
.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

/* ---- Intro / hero ---- */
.intro { padding-block: clamp(2.8rem, 6vw, 4.8rem); }
.intro h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
}
.intro .lead { max-width: 62ch; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
}
.pill {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* =========================================================================
   Targetes de centre
   ========================================================================= */
.centres {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-top: 1.8rem;
}

.centre {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
}
.centre__kicker {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.centre__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.32rem;
  line-height: 1.2;
  margin: 0 0 0.2rem;
  color: var(--ink);
}
.centre__town {
  color: var(--wine);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.9rem;
}
.centre__desc {
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-size: 0.97rem;
}
.centre__code {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 0.8rem;
}
.centre__code b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* =========================================================================
   Blocs de contacte (dades oficials)
   ========================================================================= */
.contact-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  margin-top: 1.8rem;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  border-top: 3px solid var(--green);
  padding: 1.4rem 1.5rem 1.5rem;
}
.card--seu { border-top-color: var(--wine); }

.card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  margin: 0 0 0.15rem;
  color: var(--ink);
}
.card__sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.data {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 0.9rem;
  font-size: 0.94rem;
}
.data dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.1rem;
}
.data dd {
  margin: 0;
  color: var(--ink);
}
.data dd a { word-break: break-word; }
.data address {
  font-style: normal;
  line-height: 1.45;
}
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* =========================================================================
   Enllaços oficials
   ========================================================================= */
.links-group + .links-group { margin-top: 2rem; }
.links-group h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

.linklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.linklist a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.linklist a:hover,
.linklist a:focus-visible {
  border-color: var(--green);
  background: var(--paper-2);
  color: var(--green-dark);
}
.linklist a .ext {
  margin-left: auto;
  color: var(--wine);
  font-weight: 700;
  font-size: 0.95rem;
}
.linklist a small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}
.linklist a span { display: block; }

/* =========================================================================
   Pàgines legals (text llarg)
   ========================================================================= */
.legal { padding-block: clamp(2.4rem, 5vw, 3.6rem); }
.legal .prose { max-width: 70ch; }
.legal h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.12;
  margin: 0 0 0.4rem;
}
.legal .updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 2rem;
}
.legal h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
  color: var(--green-dark);
}
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.4rem; }
.back {
  display: inline-block;
  margin-top: 2.4rem;
  font-weight: 600;
}

/* =========================================================================
   Peu
   ========================================================================= */
.foot {
  border-top: 4px solid var(--green);
  background: var(--green-dark);
  color: #e9ede9;
  padding-block: 2.4rem;
  font-size: 0.9rem;
}
.foot a { color: #fff; }
.foot a:hover { color: #f2d9b8; }

.foot__grid {
  display: grid;
  gap: 1.4rem 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .foot__grid { grid-template-columns: 2fr 1fr; align-items: start; }
}

.foot__name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.35rem;
}
.foot p { margin: 0 0 0.4rem; color: #cfd6cf; }
.foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.foot__links a { text-decoration: none; font-weight: 600; }
.foot__links a:hover { text-decoration: underline; }
.foot__fine {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.18);
  color: #b8c1b8;
  font-size: 0.82rem;
}

/* ---- Ajustos petits ---- */
@media (max-width: 560px) {
  .masthead__tagline {
    margin-left: 0;
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
    max-width: none;
  }
  .data { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .data dt { padding-top: 0.6rem; }
}
