/* mshelley · tema "moit": inspirat en un tema antic de danielribes.com.
   Franja amb degradat blau → coral → magenta → blau nit, caixa negra amb el nom
   i el menú, tot en Fira Code, etiquetes fluorescents inclinades i una llista
   d'articles "subratllada amb retolador" groc.
   Contrast revisat amb WCAG 2.2 AA: vegeu els comentaris. */

/* Fira Code (SIL Open Font License 1.1, fonts/OFL.txt), allotjada al mateix servidor.
   Font variable: un sol fitxer per a tots els pesos. Retallada per blocs de caràcters,
   com ho fa Google Fonts: el navegador només baixa els blocs que la pàgina fa servir. */
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/fira-code-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: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/fira-code-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/fira-code-symbols2.woff2") format("woff2");
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}

:root {
  color-scheme: light;

  /* degradat de la capçalera: només hi va text gran en negreta (≥ 3:1 a tot arreu) */
  --grad-hero: linear-gradient(90deg, #0051ff 0%, #e16b53 19%, #d73b88 42%, #cc0fc5 64%, #7d17b5 82%, #0a328a 100%);
  /* el del peu porta text petit: el coral i el magenta són més fosc (≥ 4,6:1) */
  --grad-foot: linear-gradient(90deg, #0051ff 0%, #c4502f 19%, #b82a74 42%, #a80fb3 64%, #6a14a0 82%, #0a328a 100%);

  --bg: #fff;
  --text: #2e2e2e;          /* 13:1 */
  --heading: #111;
  --muted: #5f5f5f;         /* 6,4:1 */
  --link: #0050e0;          /* 6,5:1 sobre blanc · 5,8:1 sobre el groc */
  --link-hover: #0037a0;
  --magenta: #d916d9;       /* etiquetes: text blanc en negreta gran · 4,1:1 */
  --marker: #fff2ac;        /* retolador groc */
  --border: #e6e6e6;
  --code-bg: #f5f5f2;

  /* vora pixelada de les franges (20×20, 3 files, 1920 px d'ample) */
  --pixel-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1920' height='60' shape-rendering='crispEdges' fill='white'%3E%3Crect x='0' y='0' width='20' height='20'/%3E%3Crect x='160' y='0' width='20' height='20'/%3E%3Crect x='260' y='0' width='20' height='20'/%3E%3Crect x='280' y='0' width='20' height='20'/%3E%3Crect x='340' y='0' width='20' height='20'/%3E%3Crect x='360' y='0' width='20' height='20'/%3E%3Crect x='760' y='0' width='20' height='20'/%3E%3Crect x='780' y='0' width='20' height='20'/%3E%3Crect x='920' y='0' width='20' height='20'/%3E%3Crect x='940' y='0' width='20' height='20'/%3E%3Crect x='960' y='0' width='20' height='20'/%3E%3Crect x='1100' y='0' width='20' height='20'/%3E%3Crect x='1200' y='0' width='20' height='20'/%3E%3Crect x='1400' y='0' width='20' height='20'/%3E%3Crect x='1420' y='0' width='20' height='20'/%3E%3Crect x='1480' y='0' width='20' height='20'/%3E%3Crect x='1640' y='0' width='20' height='20'/%3E%3Crect x='1700' y='0' width='20' height='20'/%3E%3Crect x='1720' y='0' width='20' height='20'/%3E%3Crect x='1860' y='0' width='20' height='20'/%3E%3Crect x='1900' y='0' width='20' height='20'/%3E%3Crect x='0' y='20' width='20' height='20'/%3E%3Crect x='40' y='20' width='20' height='20'/%3E%3Crect x='100' y='20' width='20' height='20'/%3E%3Crect x='120' y='20' width='20' height='20'/%3E%3Crect x='180' y='20' width='20' height='20'/%3E%3Crect x='240' y='20' width='20' height='20'/%3E%3Crect x='300' y='20' width='20' height='20'/%3E%3Crect x='340' y='20' width='20' height='20'/%3E%3Crect x='400' y='20' width='20' height='20'/%3E%3Crect x='420' y='20' width='20' height='20'/%3E%3Crect x='480' y='20' width='20' height='20'/%3E%3Crect x='520' y='20' width='20' height='20'/%3E%3Crect x='620' y='20' width='20' height='20'/%3E%3Crect x='640' y='20' width='20' height='20'/%3E%3Crect x='700' y='20' width='20' height='20'/%3E%3Crect x='720' y='20' width='20' height='20'/%3E%3Crect x='780' y='20' width='20' height='20'/%3E%3Crect x='800' y='20' width='20' height='20'/%3E%3Crect x='820' y='20' width='20' height='20'/%3E%3Crect x='840' y='20' width='20' height='20'/%3E%3Crect x='860' y='20' width='20' height='20'/%3E%3Crect x='880' y='20' width='20' height='20'/%3E%3Crect x='940' y='20' width='20' height='20'/%3E%3Crect x='960' y='20' width='20' height='20'/%3E%3Crect x='980' y='20' width='20' height='20'/%3E%3Crect x='1000' y='20' width='20' height='20'/%3E%3Crect x='1020' y='20' width='20' height='20'/%3E%3Crect x='1040' y='20' width='20' height='20'/%3E%3Crect x='1080' y='20' width='20' height='20'/%3E%3Crect x='1140' y='20' width='20' height='20'/%3E%3Crect x='1160' y='20' width='20' height='20'/%3E%3Crect x='1200' y='20' width='20' height='20'/%3E%3Crect x='1300' y='20' width='20' height='20'/%3E%3Crect x='1320' y='20' width='20' height='20'/%3E%3Crect x='1340' y='20' width='20' height='20'/%3E%3Crect x='1360' y='20' width='20' height='20'/%3E%3Crect x='1380' y='20' width='20' height='20'/%3E%3Crect x='1400' y='20' width='20' height='20'/%3E%3Crect x='1420' y='20' width='20' height='20'/%3E%3Crect x='1440' y='20' width='20' height='20'/%3E%3Crect x='1480' y='20' width='20' height='20'/%3E%3Crect x='1500' y='20' width='20' height='20'/%3E%3Crect x='1520' y='20' width='20' height='20'/%3E%3Crect x='1540' y='20' width='20' height='20'/%3E%3Crect x='1560' y='20' width='20' height='20'/%3E%3Crect x='1580' y='20' width='20' height='20'/%3E%3Crect x='1620' y='20' width='20' height='20'/%3E%3Crect x='1660' y='20' width='20' height='20'/%3E%3Crect x='1720' y='20' width='20' height='20'/%3E%3Crect x='1740' y='20' width='20' height='20'/%3E%3Crect x='1820' y='20' width='20' height='20'/%3E%3Crect x='1840' y='20' width='20' height='20'/%3E%3Crect x='1860' y='20' width='20' height='20'/%3E%3Crect x='1880' y='20' width='20' height='20'/%3E%3Crect x='1900' y='20' width='20' height='20'/%3E%3Crect x='0' y='40' width='20' height='20'/%3E%3Crect x='20' y='40' width='20' height='20'/%3E%3Crect x='40' y='40' width='20' height='20'/%3E%3Crect x='100' y='40' width='20' height='20'/%3E%3Crect x='120' y='40' width='20' height='20'/%3E%3Crect x='140' y='40' width='20' height='20'/%3E%3Crect x='160' y='40' width='20' height='20'/%3E%3Crect x='200' y='40' width='20' height='20'/%3E%3Crect x='220' y='40' width='20' height='20'/%3E%3Crect x='260' y='40' width='20' height='20'/%3E%3Crect x='280' y='40' width='20' height='20'/%3E%3Crect x='300' y='40' width='20' height='20'/%3E%3Crect x='320' y='40' width='20' height='20'/%3E%3Crect x='340' y='40' width='20' height='20'/%3E%3Crect x='360' y='40' width='20' height='20'/%3E%3Crect x='380' y='40' width='20' height='20'/%3E%3Crect x='420' y='40' width='20' height='20'/%3E%3Crect x='440' y='40' width='20' height='20'/%3E%3Crect x='460' y='40' width='20' height='20'/%3E%3Crect x='480' y='40' width='20' height='20'/%3E%3Crect x='520' y='40' width='20' height='20'/%3E%3Crect x='540' y='40' width='20' height='20'/%3E%3Crect x='560' y='40' width='20' height='20'/%3E%3Crect x='580' y='40' width='20' height='20'/%3E%3Crect x='600' y='40' width='20' height='20'/%3E%3Crect x='620' y='40' width='20' height='20'/%3E%3Crect x='640' y='40' width='20' height='20'/%3E%3Crect x='660' y='40' width='20' height='20'/%3E%3Crect x='680' y='40' width='20' height='20'/%3E%3Crect x='700' y='40' width='20' height='20'/%3E%3Crect x='720' y='40' width='20' height='20'/%3E%3Crect x='740' y='40' width='20' height='20'/%3E%3Crect x='760' y='40' width='20' height='20'/%3E%3Crect x='780' y='40' width='20' height='20'/%3E%3Crect x='820' y='40' width='20' height='20'/%3E%3Crect x='840' y='40' width='20' height='20'/%3E%3Crect x='860' y='40' width='20' height='20'/%3E%3Crect x='880' y='40' width='20' height='20'/%3E%3Crect x='900' y='40' width='20' height='20'/%3E%3Crect x='920' y='40' width='20' height='20'/%3E%3Crect x='960' y='40' width='20' height='20'/%3E%3Crect x='980' y='40' width='20' height='20'/%3E%3Crect x='1000' y='40' width='20' height='20'/%3E%3Crect x='1020' y='40' width='20' height='20'/%3E%3Crect x='1040' y='40' width='20' height='20'/%3E%3Crect x='1060' y='40' width='20' height='20'/%3E%3Crect x='1100' y='40' width='20' height='20'/%3E%3Crect x='1120' y='40' width='20' height='20'/%3E%3Crect x='1140' y='40' width='20' height='20'/%3E%3Crect x='1160' y='40' width='20' height='20'/%3E%3Crect x='1180' y='40' width='20' height='20'/%3E%3Crect x='1200' y='40' width='20' height='20'/%3E%3Crect x='1220' y='40' width='20' height='20'/%3E%3Crect x='1240' y='40' width='20' height='20'/%3E%3Crect x='1300' y='40' width='20' height='20'/%3E%3Crect x='1360' y='40' width='20' height='20'/%3E%3Crect x='1400' y='40' width='20' height='20'/%3E%3Crect x='1440' y='40' width='20' height='20'/%3E%3Crect x='1480' y='40' width='20' height='20'/%3E%3Crect x='1500' y='40' width='20' height='20'/%3E%3Crect x='1520' y='40' width='20' height='20'/%3E%3Crect x='1560' y='40' width='20' height='20'/%3E%3Crect x='1580' y='40' width='20' height='20'/%3E%3Crect x='1640' y='40' width='20' height='20'/%3E%3Crect x='1660' y='40' width='20' height='20'/%3E%3Crect x='1680' y='40' width='20' height='20'/%3E%3Crect x='1720' y='40' width='20' height='20'/%3E%3Crect x='1740' y='40' width='20' height='20'/%3E%3Crect x='1760' y='40' width='20' height='20'/%3E%3Crect x='1780' y='40' width='20' height='20'/%3E%3Crect x='1800' y='40' width='20' height='20'/%3E%3Crect x='1820' y='40' width='20' height='20'/%3E%3Crect x='1860' y='40' width='20' height='20'/%3E%3Crect x='1880' y='40' width='20' height='20'/%3E%3Crect x='1900' y='40' width='20' height='20'/%3E%3C/svg%3E");

  --font-mono: "Fira Code", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 46rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;              /* la mono es veu gran: 16px es llegeix com 17-18 */
  line-height: 1.7;
  font-variant-ligatures: none; /* sense lligadures de codi al text corrent (-> =>) */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--link); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
/* sobre el negre i el degradat, el contorn blau no es veuria prou: en blanc */
.topbar :focus-visible, .site-footer :focus-visible { outline-color: #fff; }

::selection { background: var(--magenta); color: #fff; }

.visually-hidden {
  position: absolute !important; 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: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; background: #000; color: #fff; padding: .5rem 1rem; z-index: 10; }

.wrap { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.muted { color: var(--muted); }

/* ---------- capçalera amb degradat ---------- */

.hero { background: var(--grad-hero); color: #fff; padding-bottom: calc(2.25rem + 60px); position: relative; }

/* La franja no acaba amb una línia recta: el blanc "es menja" el degradat amb píxels
   de 20×20 en tres files, cada una més plena que l'anterior (22 %, 50 %, 80 %), i pels
   forats es veu el degradat. El patró fa 1920 px d'ample perquè no es noti que es repeteix. */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  background: var(--pixel-edge) repeat-x left bottom / 1920px 60px;
  pointer-events: none;
}

/* caixa negra enganxada a dalt, amb el nom i el menú */
.topbar {
  background: #000;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  padding: .9rem 1.25rem;
  margin-inline: -1.25rem;
}

.site-title { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; margin-right: auto; white-space: nowrap; }
.site-title:hover { color: #fff; text-decoration: underline; }

.main-nav ul, .lang-switch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav ul { gap: .15rem 1.25rem; }
.main-nav a { color: #fff; font-size: .9rem; text-decoration-color: rgba(255, 255, 255, .6); }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; text-decoration-color: #fff; text-decoration-thickness: 2px; }

.lang-switch ul { gap: .3rem; }
.lang-switch a, .lang-switch span { display: block; padding: 0 .4rem; font-size: .8rem; font-weight: 700; border: 1px solid #fff; color: #fff; text-decoration: none; }
.lang-switch span { background: #fff; color: #000; }
.lang-switch a:hover { background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* títol de la pàgina dins la franja (article, categoria, etiqueta...) */
.hero-title {
  margin: 1.6rem 0 0;
  font-weight: 700;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .12);   /* una mica d'aire sobre el coral */
}
/* a la portada hi va el lema, més gran */
.hero-title.is-tagline { font-size: clamp(1.9rem, 6vw, 3.1rem); max-width: none; }

/* ---------- etiqueta fluorescent inclinada ---------- */

.label { margin: 0 0 1rem; }
.label span {
  display: inline-block;
  background: var(--magenta);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;         /* 19px en negreta: text gran per a WCAG */
  line-height: 1.3;
  padding: .1rem .45rem .15rem;
  margin-left: -.45rem;
  transform: rotate(-2.5deg);
  transform-origin: left center;
}

main.wrap { flex: 1; padding-top: 3rem; padding-bottom: 4rem; }

/* ---------- portada ---------- */

.featured { margin-bottom: 4rem; }
.featured-title { font-size: 1.45rem; font-weight: 500; line-height: 1.3; margin: 0 0 .8rem; }
.featured-summary { margin: 0 0 .75rem; }
.read-more { font-weight: 700; }

/* llista "subratllada amb retolador": cada línia es tomba una mica, alternant */
.more { margin-top: 4.5rem; }
.featured + .more { margin-top: 0; }
.more .label { margin-bottom: 1.75rem; }
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list li { margin: 0 0 .7rem; }
.more-list li > span {
  display: inline;
  background: var(--marker);
  padding: .2rem .4rem;
  line-height: 2;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.more-list li { transform: rotate(-.6deg); transform-origin: left center; }
.more-list li:nth-child(3n+2) { transform: rotate(.4deg); }
.more-list li:nth-child(3n) { transform: rotate(-1.1deg); }
.more-list time { color: var(--link); font-weight: 700; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; font-weight: 700; }
.pagination-count { color: var(--muted); font-weight: 400; }

/* ---------- article ---------- */

.post-header { margin-bottom: 2.25rem; }
.post-header .label { margin-bottom: .5rem; }
.post-header h1, .page-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--link);
  margin: 0;
}
.page-header { margin-bottom: 2.5rem; }

.post-meta, .post-updated { margin: .5rem 0 0; font-size: .85rem; color: var(--muted); }
.post-meta a { color: var(--muted); }
.post-meta .tag { margin-right: .15rem; }
.post-meta a:hover { color: var(--link); }

.post-image { margin: 0 0 2rem; }
.post-image img { display: block; width: 100%; }

.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose li + li { margin-top: .3em; }
.prose strong { color: var(--heading); font-weight: 700; }

.prose h2, .prose h3 { color: var(--heading); font-weight: 700; line-height: 1.3; margin: 2.2em 0 .7em; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }
/* el títol sencer és l'enllaç a la secció */
.prose h2, .prose h3 { position: relative; }
.prose .header-anchor { position: absolute; inset: 0; font-size: 0; color: transparent; }
.prose .header-anchor:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.prose h2:hover, .prose h3:hover { color: var(--magenta); cursor: pointer; }

/* cita: més gran, sagnada i sense cursiva, com a l'original */
.prose blockquote { margin: 1.75em 0 1.75em 3rem; padding: 0; font-size: 1.1rem; line-height: 1.6; color: var(--heading); }
.prose blockquote p { margin: 0 0 .6em; }
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr { border: 0; height: 6px; background: var(--grad-hero); margin: 3em 0; }

.prose img { display: block; }
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.prose .note { font-size: .85rem; line-height: 1.55; color: var(--muted); margin-top: 2.5em; }

.prose .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .5rem; margin: 2em 0; }
.prose .gallery figure { margin: 0; }
.prose .gallery img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .9rem; }
.prose th { text-align: left; border-bottom: 2px solid #000; padding: .45rem .6rem; }
.prose td { border-bottom: 1px solid var(--border); padding: .45rem .6rem; }

code { font-family: var(--font-mono); font-size: .92em; background: var(--code-bg); padding: .05em .3em; }
pre { background: var(--code-bg); padding: 1rem 1.2rem; overflow-x: auto; line-height: 1.55; border-left: 4px solid var(--magenta); margin: 1.5em 0; }
pre code { background: none; padding: 0; font-size: .88rem; font-variant-ligatures: normal; }

.footnotes { font-size: .85rem; color: var(--muted); }
.footnotes-sep { border: 0; border-top: 1px solid var(--border); margin-top: 3em; }

.post-footer { margin-top: 3rem; }
.tags { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.tags a { font-weight: 500; }
.post-alt { font-size: .85rem; color: var(--muted); margin: 0; }

.term-list { list-style: none; padding: 0; margin: 0; }
.term-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }

.eyebrow { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.not-found .eyebrow { font-size: 4rem; font-weight: 700; color: var(--magenta); line-height: 1; }

/* ---------- peu amb degradat ---------- */

.site-footer { background: var(--grad-foot); color: #fff; padding: calc(2.5rem + 60px) 0 1.5rem; position: relative; }
/* el mateix patró que la capçalera, girat 180°: aquí és el blanc el que s'esmicola cap al degradat */
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 60px;
  background: var(--pixel-edge) repeat-x left bottom / 1920px 60px;
  transform: rotate(180deg);
  pointer-events: none;
}
.site-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }

.footer-tags { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 0; font-size: .9rem; line-height: 2; }
.footer-tags li:not(:last-child)::after { content: ",\00a0"; }
.footer-tags a { text-decoration: none; }
.footer-tags a:hover { text-decoration: underline; }

.footer-meta { margin: 0; font-size: .75rem; text-align: right; }

/* ---------- mòbil ---------- */

@media (max-width: 640px) {
  .topbar { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .topbar { gap: .4rem 1rem; }
  .site-title { flex: 1 1 100%; }
  .main-nav { margin-right: auto; }
  .main-nav ul { gap: .1rem 1rem; }
  .prose blockquote { margin-left: 1.25rem; }
  .footer-meta { text-align: left; }
}

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

@media print {
  .hero, .site-footer, .more, .pagination { display: none; }
  body { font-size: 10pt; }
}

/* ---------- anterior / següent (dins d'un article) ----------
   La pastilla magenta és informació (la data); la blava és una acció (anar a un altre article). */

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 4.5rem; align-items: start; }

.post-nav-item { display: block; text-decoration: none; color: var(--link); }
.post-nav-item .pill {
  display: inline-block;
  background: var(--link);              /* blanc sobre aquest blau: 6,5:1 */
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  padding: .1rem .45rem .15rem;
  margin: 0 0 1rem -.45rem;
  transform: rotate(-2.5deg);
  transform-origin: left center;
  transition: background .15s;
}
.post-nav-item .marker { display: block; line-height: 2; transform: rotate(-.6deg); transform-origin: left center; }
.post-nav-item .marker > span {
  background: var(--marker);
  padding: .2rem .4rem;
  text-decoration: underline;
  text-underline-offset: .18em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.post-nav-item:hover .pill { background: var(--link-hover); }
.post-nav-item:hover .marker > span { color: var(--link-hover); text-decoration-thickness: 2px; }

/* el següent, a la dreta; també puja, que és cap on s'avança */
.post-nav .next { text-align: right; }
.post-nav .next .pill { margin: 0 -.45rem 1rem 0; transform-origin: right center; }
.post-nav .next .marker { transform-origin: right center; }

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; gap: 2rem; }
  .post-nav > span { display: none; }
  /* en una sola columna, tot alineat a l'esquerra */
  .post-nav .next { text-align: left; }
  .post-nav .next .pill { margin: 0 0 1rem -.45rem; transform-origin: left center; }
  .post-nav .next .marker { transform-origin: left center; }
}

/* ---------- índex de seccions de l'article ---------- */

.toc {
  font-size: .82rem;
  line-height: 1.45;
  padding: .1rem 0 .1rem 1rem;
  margin: 0 0 2.5rem;
  border-left: 2px solid transparent;
  border-image: linear-gradient(180deg, #0051ff, #e16b53, #cc0fc5, #0a328a) 1;   /* el degradat de la capçalera */
}
.toc-title { margin: 0 0 .7rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a { color: var(--text); text-decoration: none; display: block; padding-block: .2rem; }   /* àrea de clic ≥ 24 px */
.toc a:hover { color: var(--link); text-decoration: underline; }
.toc .toc-h3 { padding-left: .9rem; font-size: .78rem; }

html { scroll-behavior: smooth; }
.prose h2, .prose h3 { scroll-margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* pantalla ampla: tot el lloc s'eixampla per fer lloc a l'índex a la dreta.
   El text es queda a l'amplada de lectura, alineat amb el nom del blog. */
@media (min-width: 1000px) {
  .wrap { max-width: calc(var(--measure) + 14rem + 3.5rem + 2 * var(--gutter)); }
  main.wrap > * { max-width: var(--measure); }
  main.wrap > .post.has-toc { max-width: none; }

  .post.has-toc { display: grid; grid-template-columns: minmax(0, var(--measure)) 14rem; column-gap: 3.5rem; }
  .post.has-toc > * { grid-column: 1; }
  .post.has-toc > .toc {
    grid-column: 2; grid-row: 1 / span 20; align-self: start;
    position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; margin: .3rem 0 0;
  }
}

/* ---------- escriptori: text dels articles una mica més gran ---------- */
@media (min-width: 1000px) {
  .prose { font-size: 1.0625rem; }            /* 17 px (16 al mòbil) */
  .prose h2 { font-size: 1.45rem; }          /* en proporció al cos */
  .prose h3 { font-size: 1.2rem; }
  .prose blockquote { font-size: 1.15rem; }
}

/* ---------- esborranys (només a la previsualització) ----------
   Negre: ni informació (magenta) ni acció (blau), és un estat. */
.draft-badge {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 .45rem;
  vertical-align: .15em;
}
.post-header .draft-badge, .featured > .draft-badge { margin: 0 0 .6rem; }
.more-list .draft-badge { font-size: .65rem; margin-left: .3rem; }

/* vídeos incrustats (YouTube sense galetes): <div class="video"><iframe …></iframe></div> */
.prose .video { margin: 2em 0; }
.prose .video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }

/* paginació de la portada: fa servir l'estil de .post-nav */
.pagination-count { margin: 1.5rem 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
