/* ==========================================================================
   Sindicalisme útil — UGT Serveis Públics de Catalunya
   Landing d'una sola pàgina. Sense dependències, sense build.
   Paleta i tipografies presos del disseny original (landing.pdf).
   ========================================================================== */

/* --- Tipografies autoallotjades (League Spartan + Outfit, variables) ------ */
@font-face {
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/leaguespartan-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/leaguespartan-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Variables ------------------------------------------------------------
   Els colors surten del PDF original; no canviïs els valors sense
   confirmar-ho amb Comunicació.                                             */
:root {
  --crema:      #fafbf3;
  --salmo:      #eab394;
  --llima:      #b5ff00;
  --turquesa:   #0dede8;
  --vermell:    #e4002b;
  --rosa:       #f767d3;
  --negre:      #000000;
  --blanc:      #ffffff;
  --gris-camp:  #e6e6df;
  --gris-text:  #55554e;

  --titol: 'League Spartan', 'Arial Black', system-ui, sans-serif;
  --text:  'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ample: 1180px;
  --marge: clamp(1.25rem, 5vw, 3rem);
  --radi:  22px;
  --radi-petit: 12px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--crema);
  color: var(--negre);
  font-family: var(--text);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

.embolcall {
  width: 100%;
  max-width: var(--ample);
  margin-inline: auto;
  padding-inline: var(--marge);
}

.visualment-ocult {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--negre); color: var(--blanc);
  padding: .75rem 1.25rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --- Capçalera / marca ----------------------------------------------------- */
.capcalera { padding: clamp(1.75rem, 5vw, 3.25rem) 0 clamp(1rem, 3vw, 2rem); }

.marca {
  margin: 0;
  text-align: center;
  font-family: var(--titol);
  font-weight: 800;
  font-size: clamp(2.1rem, 7.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.02em;
}
.marca__negre  { color: var(--negre); }
.marca__vermell { color: var(--vermell); position: relative; display: inline-block; }

/* El gargot dibuixat a mà, ancorat sota "útil" */
.marca__gargot {
  position: absolute;
  left: 0; bottom: .04em;
  /* max-width:none anul·la la regla global img{max-width:100%}, que si no
     retallaria el gargot a l'amplada de la paraula. */
  width: 108%; max-width: none; height: auto;
  pointer-events: none;
}

/* --- Vídeo ---------------------------------------------------------------- */
.video { padding-bottom: clamp(2.5rem, 7vw, 4.5rem); }

.video__marc {
  position: relative;
  border-radius: var(--radi);
  overflow: hidden;
  background: var(--negre);
  box-shadow: 0 18px 44px rgb(0 0 0 / .16);
}

.video__facade {
  display: block; width: 100%; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer;
  aspect-ratio: 16 / 9;
}
.video__facade img { width: 100%; height: 100%; object-fit: cover; }

.video__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.video__play svg {
  width: clamp(60px, 9vw, 88px); height: auto;
  filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35));
  transition: transform .2s ease;
}
.video__play-fons   { fill: var(--vermell); transition: fill .2s ease; }
.video__play-fletxa { fill: var(--blanc); }

.video__facade:hover .video__play svg,
.video__facade:focus-visible .video__play svg { transform: scale(1.08); }
.video__facade:hover .video__play-fons,
.video__facade:focus-visible .video__play-fons { fill: #c80026; }

/* Mentre el navegador omple el buffer després del clic */
.video__facade[aria-busy="true"] { cursor: progress; position: absolute; inset: 0; z-index: 1; }
.video__facade[aria-busy="true"] .video__play svg { animation: video-batec 1s ease-in-out infinite; }
@keyframes video-batec { 50% { transform: scale(.92); opacity: .75; } }

/* Un cop premut, el botó és reemplaçat pel <video> */
.video__marc video {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; background: var(--negre);
}

.video__error {
  position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%);
  margin: 0; padding: .6rem 1rem; border-radius: 999px;
  background: rgb(0 0 0 / .8); color: var(--blanc);
  font-size: .9rem; font-weight: 600; text-align: center;
  width: max-content; max-width: calc(100% - 2rem);
}

/* --- Lemes ---------------------------------------------------------------- */
.lemes {
  background: var(--salmo);
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}

.lemes__graella {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  grid-template-columns: 1fr;
}

.targeta {
  background: var(--crema);
  border-radius: var(--radi);
  padding: clamp(1.75rem, 4.5vw, 3rem);
  box-shadow: 0 16px 40px rgb(0 0 0 / .1);
}

.targeta__llista {
  margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  font-family: var(--titol);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.015em;
}

.lema { display: block; }

/* Subratllat de retolador: el traç real del disseny, estirat rere el text */
.lema--destacat {
  /* És un ítem de grid, i el grid converteix inline-block en block: sense
     width:fit-content el traç s'estiraria fins al final de la targeta. */
  display: inline-block;
  width: fit-content;
  padding: .16em .34em;
  margin-inline-start: -.34em;
  /* El traç va de fons de l'element: així queda rere el text sense z-index
     negatiu, que depèn del context d'apilament i pot desaparèixer. */
  background: url('../images/stroke-turquesa.png') center / 100% 100% no-repeat;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}

.targeta__accio {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem 1.1rem;
}

.targeta__nota {
  font-size: .9rem;
  color: var(--gris-text);
  line-height: 1.35;
}

.lemes__imatge { margin: 0; justify-self: center; }
.lemes__imatge img { width: min(320px, 68vw); }

/* --- Botons --------------------------------------------------------------- */
.boto {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.boto:hover { transform: translateY(-2px); }
.boto:active { transform: translateY(0); }

.boto--vermell {
  background: var(--vermell);
  color: var(--blanc);
  box-shadow: 0 8px 20px rgb(228 0 43 / .32);
}
.boto--vermell:hover { background: #c80026; box-shadow: 0 12px 26px rgb(228 0 43 / .4); }

.boto--negre {
  background: var(--negre);
  color: var(--blanc);
  width: 100%;
  justify-content: center;
  padding-block: 1.05rem;
}
.boto--negre:hover { background: var(--vermell); }
.boto--negre[disabled] {
  background: var(--gris-camp); color: var(--gris-text);
  cursor: not-allowed; transform: none; box-shadow: none;
}

.boto__icona { flex: none; }

/* --- Contacte ------------------------------------------------------------- */
.contacte { padding: clamp(3rem, 8vw, 5.5rem) 0; }

.contacte__graella {
  display: grid;
  gap: clamp(2.25rem, 6vw, 4rem);
  grid-template-columns: 1fr;
  align-items: start;
}

.contacte__panell {
  background: var(--blanc);
  border-radius: var(--radi);
  padding: clamp(1.75rem, 4.5vw, 2.75rem);
  box-shadow: 0 14px 38px rgb(0 0 0 / .08);
}

.contacte__titol {
  margin: 0 0 .5rem;
  font-family: var(--titol);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.contacte__entradeta {
  margin: 0 0 clamp(1.5rem, 4vw, 2rem);
  color: var(--gris-text);
}

/* Claim lateral amb el gargot vermell */
.contacte__claim { align-self: center; }

.claim {
  position: relative;
  margin: 0;
  font-family: var(--titol);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.claim__gargot {
  display: block;
  width: min(360px, 78%);
  margin-top: .3em;
}

/* --- Formulari ------------------------------------------------------------ */
.camp { margin-bottom: 1.25rem; }

.camp > label,
.camp legend {
  display: block;
  margin-bottom: .45rem;
  font-weight: 600;
  font-size: .95rem;
}

.obligatori { color: var(--vermell); }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: .85rem 1rem;
  font: inherit;
  color: var(--negre);
  background: var(--blanc);
  border: 2px solid var(--negre);
  border-radius: var(--radi-petit);
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; min-height: 7rem; }

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: 0;
  border-color: var(--vermell);
  box-shadow: 0 0 0 4px rgb(228 0 43 / .16);
}

[aria-invalid="true"] { border-color: var(--vermell) !important; }

.camp--opcions {
  border: 0; padding: 0; margin-bottom: 1.25rem; min-width: 0;
}
.camp--opcions legend { padding: 0; }

.opcions { display: grid; gap: .55rem; }

.opcio {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .7rem 1rem;
  background: var(--gris-camp);
  border-radius: var(--radi-petit);
  cursor: pointer;
  font-weight: 500;
  transition: background-color .18s ease;
}
.opcio:hover { background: #dcdcd3; }

.opcio input {
  flex: none;
  width: 1.15rem; height: 1.15rem;
  margin: .2rem 0 0;
  accent-color: var(--vermell);
  cursor: pointer;
}

.opcio--check {
  background: none;
  padding: 0;
  font-size: .92rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--gris-text);
}
.opcio--check:hover { background: none; }
.opcio--check a { color: var(--vermell); font-weight: 600; }

.camp--consentiment { margin-bottom: 1.6rem; }

.error {
  margin: .4rem 0 0;
  min-height: 1.1em;
  font-size: .85rem;
  font-weight: 600;
  color: var(--vermell);
}
.error:empty { min-height: 0; }

.form__accio { margin: 0; }

/* Parany antibot: fora de pantalla però no display:none (alguns bots ho detecten) */
.parany {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.alerta {
  margin: 1rem 0 0;
  padding: .9rem 1.1rem;
  border-radius: var(--radi-petit);
  font-weight: 600;
  font-size: .95rem;
}
.alerta-success { background: #e9f8e9; color: #17632a; border: 2px solid #17632a; }
.alerta-error   { background: #fdeaee; color: #a1001e; border: 2px solid var(--vermell); }

/* --- Tancament ------------------------------------------------------------ */
.tancament { position: relative; }

.tancament__mar { display: block; }
.tancament__mar img {
  width: 100%;
  height: clamp(200px, 38vw, 420px);
  object-fit: cover;
}

.tancament__barra { height: 10px; background: var(--rosa); }

.tancament__peu {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 3vw, 2rem);
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
}

.tancament__fletxes { margin: 0; flex: none; line-height: 0; }
/* Fletxes cap a la dreta, apuntant al lema */
.tancament__fletxes img { width: auto; height: clamp(72px, 13vw, 130px); }

.tancament__lema { margin: 0; }
.tancament__lema span {
  display: inline-block;
  padding: .34em .55em;
  font-family: var(--text);
  font-weight: 400;
  font-size: clamp(1.25rem, 4vw, 2.1rem);
  line-height: 1.15;
  background: url('../images/stroke-llima.png') center / 100% 100% no-repeat;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
.tancament__lema strong { font-weight: 700; }

/* --- Peu ------------------------------------------------------------------ */
.peu {
  background: var(--crema);
  padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  border-top: 2px solid rgb(0 0 0 / .08);
}

.peu__graella {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  align-items: start;
}

.peu__logo { margin: 0; }
.peu__logo img { width: clamp(180px, 34vw, 240px); }

.peu__dades {
  margin: 0;
  display: grid;
  gap: .55rem;
  font-style: normal;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.45;
}
.peu__dades a { text-decoration: none; font-weight: 600; }
.peu__dades a:hover { color: var(--vermell); text-decoration: underline; }

.peu__legal {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  font-size: .82rem;
  color: var(--gris-text);
}
.peu__legal a { color: var(--gris-text); }

/* --- Punts de ruptura ------------------------------------------------------ */
@media (min-width: 720px) {
  .opcions { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .peu__graella { grid-template-columns: auto 1fr; column-gap: 3rem; }
  .peu__legal { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .lemes__graella   { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
  .contacte__graella { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); }
  .lemes__imatge img { width: min(400px, 100%); }
}

@media print {
  .video, .boto { display: none; }
  body { background: #fff; }
}

/* --- Popup dels textos legals -------------------------------------------- */
/* <dialog> natiu: porta de sèrie el focus atrapat, Esc per tancar i el
   fons inert. Sense JavaScript els enllaços porten a la web oficial. */
.modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(84vh, 900px);
  padding: 0;
  border: 0;
  border-radius: var(--radi);
  background: var(--crema);
  color: var(--negre);
  box-shadow: 0 24px 60px rgb(0 0 0 / .3);
  overflow: hidden;
}

.modal::backdrop {
  background: rgb(0 0 0 / .55);
  backdrop-filter: blur(2px);
}

.modal[open] { animation: modal-entra .22s ease-out; }
.modal[open]::backdrop { animation: modal-fos .22s ease-out; }

@keyframes modal-entra {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes modal-fos { from { opacity: 0; } to { opacity: 1; } }

.modal__caixa {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.modal__capcalera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 2rem);
  border-bottom: 2px solid rgb(0 0 0 / .1);
  background: var(--crema);
}

.modal__titol {
  margin: 0;
  font-family: var(--titol);
  font-weight: 800;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}

.modal__tanca {
  flex: none;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--gris-camp);
  color: var(--negre);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.modal__tanca:hover { background: var(--vermell); color: var(--blanc); }

.modal__cos {
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: .95rem;
  line-height: 1.6;
}

.modal__cos h3 {
  margin: 1.75rem 0 .5rem;
  font-family: var(--titol);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}
.modal__cos h3:first-child { margin-top: 0; }

.modal__cos p { margin: 0 0 .9rem; }
.modal__cos ul { margin: 0 0 .9rem; padding-left: 1.2rem; display: grid; gap: .35rem; }
.modal__cos a { color: var(--vermell); font-weight: 600; }
.modal__cos code {
  font-size: .9em;
  background: var(--gris-camp);
  padding: .1em .4em;
  border-radius: 5px;
}

.modal__origen {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(0 0 0 / .1);
  font-size: .85rem;
  color: var(--gris-text);
}

.modal__peu {
  padding: 1rem clamp(1.25rem, 4vw, 2rem);
  border-top: 2px solid rgb(0 0 0 / .1);
  background: var(--crema);
}
.modal__peu .boto { width: 100%; }

/* Mentre el popup és obert, el fons no es desplaça darrere. */
body.te-modal { overflow: hidden; }
