/* Ignasi Corney Oller — full d'estil (negre, blanc i vermell, com el disseny de Wix) */

:root {
  --fons: #000000;
  --fons-2: #1c1c1c;
  --text: #ffffff;
  --suau: #bdbdbd;
  --vermell: #af0d0d;
  --lletra: "Open Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fons);
  color: var(--text);
  font-family: var(--lletra);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.salt { position: absolute; left: -999px; }
.salt:focus { left: 1rem; top: 1rem; background: var(--fons); padding: .5rem 1rem; z-index: 10; }
.ocult { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Capçalera */
.capcal {
  max-width: 68rem; margin: 0 auto; padding: 2rem 1rem 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap;
}
.nom {
  color: var(--vermell); text-decoration: none; text-transform: uppercase; font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.05;
  border-left: 4px solid var(--vermell); padding-left: .55rem; max-width: 9.5em;
}
.capcal nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .6rem; font-size: .9rem; text-transform: uppercase; }
.capcal nav a { display: block; color: var(--text); text-decoration: none; border-top: 1px solid var(--text); padding: .7rem .5rem .3rem; min-width: 4.5rem; text-align: center; }
.capcal nav a:hover { border-top-width: 3px; padding-top: calc(.7rem - 2px); }
.capcal nav a[aria-current="page"] { border-top: 4px solid var(--text); padding-top: calc(.7rem - 3px); }
.capcal nav a[href="/latdg/"] { text-transform: none; }

/* Mòbil (07.11.2026): nom en una línia i menú en graella de 4 columnes (Publicacions ocupa dues caselles),
   sense ratlles a cada botó; només una ratlla vermella sota l'apartat actiu. L'ordinador no canvia. */
@media (max-width: 600px) {
  .capcal { gap: 1.1rem; }
  .nom { font-size: min(5.6vw, 1.5rem); max-width: none; white-space: nowrap; }
  .capcal nav { width: 100%; }
  .capcal nav ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem 0; font-size: .8rem; }
  .capcal nav li:nth-child(3) { grid-column: span 2; }
  .capcal nav a,
  .capcal nav a:hover,
  .capcal nav a[aria-current="page"] { border-top: 0; border-bottom: 2px solid transparent; padding: .55rem 0 .4rem; min-width: 0; white-space: nowrap; }
  .capcal nav a[aria-current="page"] { border-bottom-color: var(--vermell); }
}

/* Cos */
main { max-width: 68rem; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
.text { max-width: 58rem; margin: 0 auto; }
.text p { margin: 0 0 1.1em; }
.text ul, .text ol { padding-left: 1.4rem; margin: 0 0 1.1em; }
.text li { margin-bottom: .5rem; }
h1, h2, h3 { font-family: var(--lletra); text-transform: uppercase; line-height: 1.2; }
h1, h2 { font-size: 1.25rem; margin: 2.6rem 0 1rem; }
.text > h2:first-child { margin-top: 0; }
h3 { font-size: 1.05rem; margin: 1.8rem 0 .6rem; }
.text blockquote { margin: 1.2rem 0; padding-left: 1rem; border-left: 4px solid var(--vermell); }

/* Imatges soltes: posició i mida definides a l'editor */
.imatges { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1.5rem 8rem; margin: 1.6rem auto 2rem; max-width: 58rem; }
.imatges figure { margin: 0; max-width: 100%; }
.imatges img { width: 100%; }
.imatges figcaption { font-size: .9rem; color: var(--suau); margin-top: .45rem; }
.imatges.rodo img { border-radius: 6px; }
.imatges.pos-ample figure { width: 100% !important; }
.imatges.pos-esquerra { float: left; margin: .3rem 2rem 1rem 0; display: block; max-width: 50%; }
.imatges.pos-dreta { float: right; margin: .3rem 0 1rem 2rem; display: block; max-width: 50%; }
.imatges.pos-esquerra figure, .imatges.pos-dreta figure { margin-bottom: .8rem; }
main::after { content: ""; display: block; clear: both; }
@media (max-width: 700px) {
  .imatges { gap: 1.2rem; }
  .imatges.pos-esquerra, .imatges.pos-dreta { float: none; max-width: none; margin: 1.2rem auto; display: flex; }
}

/* Vídeos */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; margin: .6rem auto 2.6rem; max-width: 700px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Carrussels, a l'estil dels de Wix */
.carrussel { position: relative; margin: 1.5rem auto 2.5rem; }
.carrussel .pistes {
  list-style: none; margin: 0; padding: 0;
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.carrussel .pistes::-webkit-scrollbar { display: none; }
.carrussel .pistes > li { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.carrussel .pistes a { display: block; }
.carrussel .fletxa {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: .4rem; cursor: pointer; color: #fff;
  width: 3rem; height: 4rem; display: grid; place-items: center;
}
.carrussel .fletxa svg { width: 2.2rem; height: 2.2rem; fill: none; stroke: currentColor; stroke-width: 1.4; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.carrussel .fletxa.ant { left: .3rem; }
.carrussel .fletxa.seg { right: .3rem; }
.carrussel .fletxa[hidden] { display: none !important; }

.carrussel.diapos { max-width: 700px; }
.carrussel.diapos .pistes { background: var(--fons-2); }
.carrussel.diapos .pistes img { width: 100%; height: clamp(15rem, 62vw, 455px); object-fit: contain; }
.carrussel.diapos .sobre {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  padding: .6rem .9rem; background: rgba(0, 0, 0, .55); color: #fff; font-size: .92rem; line-height: 1.35;
  pointer-events: none;
}
.carrussel.diapos .sobre p { margin: 0; }
.carrussel.diapos .sobre .t { display: block; font-size: 1rem; }
.carrussel.diapos .sobre .d { display: block; font-size: .85rem; opacity: .9; }
.carrussel.diapos .compta { font-size: .8rem; white-space: nowrap; }
@media (hover: hover) {
  .carrussel.diapos .sobre, .carrussel.diapos .fletxa { opacity: 0; transition: opacity .2s; }
  .carrussel.diapos:hover .sobre, .carrussel.diapos:hover .fletxa,
  .carrussel.diapos:focus-within .sobre, .carrussel.diapos:focus-within .fletxa { opacity: 1; }
}

.carrussel.portada { margin-top: 0; }
.carrussel.portada .pistes img { width: 100%; height: clamp(14rem, 48vw, 470px); object-fit: cover; }
.carrussel.portada .punts { position: absolute; left: 0; right: 0; bottom: .8rem; display: flex; justify-content: center; gap: .45rem; }
.carrussel.portada .punts button { width: .75rem; height: .75rem; border-radius: 50%; padding: 0; cursor: pointer; border: 1.5px solid #fff; background: transparent; box-shadow: 0 0 2px rgba(0,0,0,.6); }
.carrussel.portada .punts button[aria-current="true"] { background: #fff; }

.carrussel.tira .pistes { gap: .6rem; }
.carrussel.tira .pistes > li { flex: 0 0 auto; }
.carrussel.tira .pistes img { height: clamp(16rem, 40vw, 460px); width: auto; max-width: none; }
.carrussel.tira .fletxa { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #fff; color: #000; padding: 0; }
.carrussel.tira .fletxa svg { width: 1.3rem; height: 1.3rem; stroke-width: 2.2; filter: none; }
.carrussel.tira .fletxa.ant { left: .6rem; }
.carrussel.tira .fletxa.seg { right: .6rem; }

/* Blog */
.entrades { list-style: none; padding: 0; max-width: 58rem; margin: 0 auto; }
.entrades li { padding: 1.2rem 0; border-top: 1px solid #333; }
.entrades h2 { margin: 0 0 .3rem; text-transform: none; font-size: 1.3rem; }
.entrades h2 a { text-decoration: none; }
.entrades h2 a:hover { text-decoration: underline; }
.data { color: var(--suau); font-size: .95rem; }
.entrada .capentrada { max-width: 58rem; margin: 0 auto 1.6rem; }
.entrada .capentrada h1 { text-transform: none; font-size: 1.7rem; margin: 0 0 .3rem; }
.buit { max-width: 58rem; margin: 0 auto; color: var(--suau); }

/* Peu */
.peu {
  max-width: 68rem; margin: 0 auto; padding: 1.4rem 1rem 3rem; border-top: 1px solid #444;
  color: var(--suau); font-size: .85rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 2rem;
}
.peu p { margin: 0; }
.xarxes { display: flex; gap: 1rem; align-items: center; }
.xarxes a { display: inline-flex; color: var(--text); }
.xarxes .ico { width: 1.4rem; height: 1.4rem; display: block; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.xarxes a:hover { color: var(--vermell); }

/* Visor d'imatges */
.visor { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.visor::backdrop { background: rgba(0, 0, 0, .94); }
.visor[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.visor figure { margin: 0; padding: 0 1rem; display: flex; flex-direction: column; align-items: center; max-height: calc(100vh - 7rem); }
.visor img { max-height: calc(100vh - 9.5rem); width: auto; max-width: min(100%, 1400px); object-fit: contain; }
.visor figcaption { color: #e8e8e8; text-align: center; margin-top: .5rem; font-size: .95rem; }
.visor-nav { display: flex; gap: 1.5rem; align-items: center; margin-top: .8rem; }
.visor-nav button, .visor .tanca { font: inherit; color: #fff; background: none; border: 1px solid rgba(255,255,255,.4); padding: .4rem .9rem; cursor: pointer; }
.visor-nav button:hover, .visor .tanca:hover { border-color: #fff; }
.visor-nav a { color: #fff; }
.visor .tanca { position: fixed; top: 1rem; right: 1rem; font-size: 1.6rem; line-height: 1; padding: .3rem .7rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* 28.11.2026: els enllaços llargs (URL) es parteixen i no fan desbordar la pàgina al mòbil */
main { overflow-wrap: anywhere; }
@media (max-width: 600px) { html, body { overflow-x: clip; } }
