/* ==========================================================
   Sumacàrcer participa — full de estils
   Paleta: paper càlid + tinta + terracota
   ========================================================== */

:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --card: #fffdf8;
  --ink: #1d1a16;
  --ink-2: #575046;
  --line: #e3dccd;
  --acc: #bf4318;
  --acc-dark: #96340f;
  --acc-soft: #f6e3d9;
  --ok: #3e6b48;
  --ok-soft: #e4ecdf;
  --radius: 18px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(29, 26, 22, .05), 0 8px 24px -12px rgba(29, 26, 22, .18);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--acc-dark); }
::selection { background: var(--acc-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.4rem; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

/* ---------- Capçalera ---------- */
.top {
  position: sticky; top: 0; z-index: 80;
  background: rgba(246, 242, 234, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1120px; margin: 0 auto; padding: .8rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
}
.marca { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.marca img { height: 42px; width: auto; }
.marca .wordmark { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.1; }
.marca .wordmark em { font-style: italic; color: var(--acc); }
.marca .wordmark small { display: block; font-family: var(--font-body); font-size: .68rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

.nav ul { list-style: none; display: flex; gap: .3rem; }
.nav a {
  display: block; padding: .5rem .95rem; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: .95rem;
  border-radius: 999px; transition: background .15s;
}
.nav a:hover { background: var(--paper-2); }
.nav a.actiu { background: var(--ink); color: var(--paper); }

.menu-btn {
  display: none; background: none; border: 1.5px solid var(--ink);
  border-radius: 999px; padding: .45rem .95rem; font: 500 .9rem var(--font-body);
  color: var(--ink); cursor: pointer;
}

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; }
  .nav.obert { display: block; }
  .top-inner { flex-wrap: wrap; }
  .nav ul { flex-direction: column; padding: .4rem 0 .8rem; }
  .nav a { border-radius: var(--radius-s); }
}

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero .wrap { position: relative; }
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  max-width: 17ch; margin-bottom: 1.3rem;
}
.hero h1 .ressalt { font-style: italic; color: var(--acc); }
.hero .entrada { max-width: 58ch; font-size: 1.09rem; color: var(--ink-2); margin-bottom: .8rem; }
.hero-cta { margin-top: 2rem; display: flex; gap: .8rem; flex-wrap: wrap; }

.hero-decor {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  width: 300px; opacity: .08; pointer-events: none;
}
@media (max-width: 900px) { .hero-decor { display: none; } }

.hero-sub { padding: 3.2rem 0 3.5rem; }

/* Botons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.5rem; border-radius: 999px;
  font: 600 .95rem var(--font-body); text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primari { background: var(--acc); color: #fff; }
.btn-primari:hover { background: var(--acc-dark); }
.btn-contorn { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-contorn:hover { background: var(--ink); color: var(--paper); }
.btn-fosc { background: var(--ink); color: var(--paper); }
.btn-fosc:hover { background: #000; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .fletxa { transition: transform .15s; }
.btn:hover .fletxa { transform: translateX(3px); }

/* ---------- Seccions ---------- */
.seccio { padding: 3.8rem 0; }
.seccio-alt { background: var(--paper-2); }
.kicker {
  font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--acc); margin-bottom: .7rem;
}
.seccio h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: .6rem; max-width: 24ch; }
.seccio .sub { color: var(--ink-2); max-width: 62ch; margin-bottom: 2.2rem; }
.cap-seccio { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cap-seccio .mes { white-space: nowrap; margin-bottom: 2.2rem; }

/* ---------- Targetes ---------- */
.graella { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .7rem;
  transition: transform .18s, box-shadow .18s;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(29,26,22,.06), 0 18px 38px -16px rgba(29,26,22,.25); }
.card h3 { font-size: 1.22rem; }
.card p { color: var(--ink-2); font-size: .95rem; }
.card .peu-card { margin-top: auto; padding-top: .6rem; font-weight: 600; font-size: .9rem; color: var(--acc-dark); display: inline-flex; align-items: center; gap: .4rem; }

.icona-cercle {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--acc-soft); color: var(--acc-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .4rem;
}
.icona-cercle svg { width: 22px; height: 22px; }

/* Etiquetes d'estat */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: .28rem .8rem; border-radius: 999px; width: fit-content;
}
.chip-obert { background: var(--ok-soft); color: var(--ok); }
.chip-obert::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chip-prompte { background: var(--acc-soft); color: var(--acc-dark); }
.chip-tancat { background: #e8e4dc; color: var(--ink-2); }

/* ---------- Llista de processos ---------- */
.proces-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 2rem; box-shadow: var(--shadow); margin-bottom: 1.1rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  text-decoration: none; color: inherit;
  transition: transform .18s, box-shadow .18s;
}
.proces-item:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(29,26,22,.06), 0 18px 38px -16px rgba(29,26,22,.25); }
.proces-item h3 { font-size: 1.35rem; margin: .55rem 0 .35rem; }
.proces-item .resum { color: var(--ink-2); font-size: .96rem; max-width: 68ch; }
.proces-item .meta { margin-top: .6rem; font-size: .85rem; color: var(--ink-2); display: flex; gap: 1.4rem; flex-wrap: wrap; }
.proces-item .meta strong { color: var(--ink); font-weight: 600; }
.proces-item .anar { color: var(--acc); flex-shrink: 0; }
@media (max-width: 640px) { .proces-item { grid-template-columns: 1fr; } .proces-item .anar { display: none; } }

/* ---------- Pàgina de detall ---------- */
.detall-cap { padding: 3.6rem 0 2.4rem; border-bottom: 1px solid var(--line); }
.detall-cap .tornar {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; font-weight: 600; text-decoration: none; color: var(--ink-2);
  margin-bottom: 1.6rem;
}
.detall-cap .tornar:hover { color: var(--acc-dark); }
.detall-cap h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 24ch; margin: .9rem 0 .8rem; }
.detall-cap .entrada { color: var(--ink-2); max-width: 62ch; font-size: 1.06rem; }

.detall-cos { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; padding: 2.8rem 0 3.5rem; }
@media (max-width: 900px) { .detall-cos { grid-template-columns: 1fr; } }

.prosa h2 { font-size: 1.45rem; margin: 1.8rem 0 .7rem; }
.prosa h2:first-child { margin-top: 0; }
.prosa p { margin-bottom: 1rem; color: #33302b; }
.prosa ul { margin: 0 0 1rem 1.2rem; color: #33302b; }
.prosa li { margin-bottom: .4rem; }

.lateral { display: flex; flex-direction: column; gap: 1.2rem; }
.bloc-lateral {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
}
.bloc-lateral h3 { font-size: 1.02rem; margin-bottom: .8rem; }
.dada { padding: .55rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.dada:first-of-type { border-top: 0; padding-top: 0; }
.dada dt { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.dada dd { margin: 0; color: var(--ink); }
.dada dd a { word-break: break-word; }

.doc-enllac {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .2rem; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-size: .92rem; font-weight: 500;
}
.doc-enllac:first-of-type { border-top: 0; }
.doc-enllac svg { flex-shrink: 0; color: var(--acc); }
.doc-enllac:hover { color: var(--acc-dark); }
.doc-enllac small { display: block; color: var(--ink-2); font-weight: 400; }

/* ---------- Votació ---------- */
.votacio {
  background: var(--card); border: 1.5px solid var(--ink);
  border-radius: var(--radius); padding: 2rem; margin-top: 2rem;
  box-shadow: var(--shadow);
}
.votacio h2 { font-size: 1.5rem; margin-bottom: .4rem; }
.votacio > p { color: var(--ink-2); margin-bottom: 1.6rem; }
.pregunta { margin-bottom: 1.8rem; }
.pregunta legend { font-weight: 600; font-size: 1.02rem; margin-bottom: .7rem; }
.pregunta fieldset { border: 0; }
.opcions { display: flex; flex-wrap: wrap; gap: .55rem; }
.opcio { position: relative; }
.opcio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcio span {
  display: inline-block; padding: .5rem 1.1rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: .92rem; font-weight: 500; cursor: pointer;
  transition: all .12s;
}
.opcio input:hover + span { border-color: var(--ink-2); }
.opcio input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.opcio input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }

.camp label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.camp { margin-bottom: 1.2rem; }
.camp input, .camp textarea, .camp select {
  width: 100%; padding: .7rem .9rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  font: inherit; background: var(--paper); color: var(--ink);
}
.camp input:focus, .camp textarea:focus, .camp select:focus {
  outline: 2px solid var(--acc); border-color: var(--acc); background: #fff;
}

.confirmacio {
  background: var(--ok-soft); border: 1px solid var(--ok);
  color: var(--ok); border-radius: var(--radius-s);
  padding: 1rem 1.3rem; font-weight: 500; margin-top: 1rem;
}
.avis {
  background: var(--acc-soft); border: 1px solid #e5b8a2;
  color: var(--acc-dark); border-radius: var(--radius-s);
  padding: 1rem 1.3rem; font-size: .92rem; margin-top: 1rem;
}

/* ---------- Associacions ---------- */
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filtre {
  background: transparent; border: 1.5px solid var(--line); border-radius: 999px;
  padding: .48rem 1.15rem; font: 500 .9rem var(--font-body); color: var(--ink);
  cursor: pointer; transition: all .12s;
}
.filtre:hover { border-color: var(--ink-2); }
.filtre.actiu { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.assoc-card { padding: 1.7rem; }
.assoc-card .inicial {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .5rem;
}
.assoc-card .ambit-chip {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--acc-dark);
}

/* Franja CTA */
.franja {
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius); padding: 2.6rem 2.8rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.franja h2 { color: #fff; font-size: 1.7rem; max-width: 26ch; }
.franja p { color: #b8b0a4; max-width: 52ch; }

/* ---------- Passos ---------- */
.passos { list-style: none; counter-reset: pas; display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.passos li { counter-increment: pas; position: relative; padding-top: 3.2rem; }
.passos li::before {
  content: "0" counter(pas);
  position: absolute; top: 0; left: 0;
  font-family: var(--font-display); font-style: italic; font-size: 2rem; color: var(--acc);
}
.passos li strong { display: block; margin-bottom: .2rem; }
.passos li span { color: var(--ink-2); font-size: .94rem; }

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 1.15rem 3rem 1.15rem 0;
  font-family: var(--font-display); font-size: 1.12rem; font-weight: 600;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--acc);
}
details.faq[open] summary::after { content: "−"; }
details.faq .cos { padding: 0 0 1.2rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- Formularis ---------- */
.formulari {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--shadow);
  max-width: 660px;
}
.nota { font-size: .85rem; color: var(--ink-2); margin-top: .9rem; }

/* ---------- Peu ---------- */
.peu { background: var(--ink); color: #a89f92; margin-top: 4rem; padding: 3.2rem 0 1.8rem; font-size: .93rem; }
.peu .cols { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 2.5rem; padding-bottom: 2.2rem; }
@media (max-width: 800px) { .peu .cols { grid-template-columns: 1fr; } }
.peu .marca-peu { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.peu .marca-peu img { height: 46px; filter: invert(1) opacity(.9); }
.peu .marca-peu span { font-family: var(--font-display); font-size: 1.2rem; color: #fff; }
.peu .marca-peu em { color: #e58a63; }
.peu h4 { color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; }
.peu ul { list-style: none; }
.peu li { margin-bottom: .45rem; }
.peu a { color: #cfc7ba; text-decoration: none; }
.peu a:hover { color: #fff; text-decoration: underline; }
.peu .credits {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.4rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .82rem; color: #7d7568;
}

/* Accessibilitat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
.visualment-ocult {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
