/* Estils de les pàgines de text (com-es-juga.html, abreviatures.html, sobre.html), amb la mateixa paleta que el joc. */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Libre+Franklin:wght@500;700;800&display=swap");
:root { --bg: #F7F3EA; --surface: #FFFDF8; --ink: #15204A; --muted: #6A6B78; --line: #E6DFCF; --edge: #D6CCB5; --cobalt: #24379A; --saffron: #F5BE1E; --saffron-edge: #C99300; --def: #FCEFC4; --ind: #E2E7FA; --mat: #D6F1EA; }
/* Tema: segueix el del sistema, tret que el jugador n'hagi triat un (js/tema.js posa data-theme a <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0D1330; --surface: #151C42; --ink: #F3EFE4; --muted: #A6ABC6; --line: #252E62; --edge: #070B22; --cobalt: #9DB0FF; --def: #3E3416; --ind: #26316F; --mat: #123A33; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0D1330; --surface: #151C42; --ink: #F3EFE4; --muted: #A6ABC6; --line: #252E62; --edge: #070B22; --cobalt: #9DB0FF; --def: #3E3416; --ind: #26316F; --mat: #123A33; color-scheme: dark; }
.tema { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.tema button { font: inherit; font-size: .78rem; font-weight: 700; border: 0; background: none; color: var(--muted); padding: 2px 10px; border-radius: 999px; cursor: pointer; }
.tema button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Libre Franklin", "Segoe UI", system-ui, sans-serif; font-weight: 500; line-height: 1.6; padding: 24px 16px 48px; }
main { max-width: 680px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 0 var(--edge); padding: 24px; }
b, strong { font-weight: 800; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 700; line-height: 1.15; margin-top: 0; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.45rem; line-height: 1.2; margin: 1.6em 0 .4em; }
h3 { font-size: 1rem; margin: 1.2em 0 .3em; }
a { color: var(--cobalt); }
.nota { color: var(--muted); font-size: .9rem; }
.pista { font-family: Fraunces, Georgia, serif; font-weight: 500; font-size: 1.3rem; margin: .4em 0; }
.def, .ind, .mat { border-radius: 4px; padding: 0 3px; }
.def { background: var(--def); }
.ind { background: var(--ind); }
.mat { background: var(--mat); }
.r { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .04em; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: .4em 0 1em; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 400; font-size: .85rem; }
.boto { display: inline-block; background: var(--saffron); color: #15204A; text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 10px; box-shadow: 0 3px 0 var(--saffron-edge); margin-top: .6em; }
/* Anunci al final del text, amb l'alçada reservada perquè la pàgina no salti. */
.anunci { display: flex; flex-direction: column; gap: 6px; min-height: 120px; margin: 1.6em 0 1em; }
.anunci[hidden] { display: none; }
.anunci-et { font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; opacity: .8; }

/* Exercicis al final de les fitxes del C2 (js/c2-exercicis.js) */
.ex-llista { padding-left: 1.4em; }
.ex-llista li { margin: 1em 0; }
.ex-frase { line-height: 1.6; }
.ex-buit { color: var(--cobalt); font-weight: 700; }
.ex-buit.ple { background: var(--def); border-radius: 4px; padding: 0 4px; color: var(--ink); }
.ex-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ex-op { font: inherit; font-size: .92rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ex-op:hover:not(:disabled) { border-color: var(--cobalt); } }
.ex-op:disabled { cursor: default; opacity: .6; }
.ex-op.bona, .ex-in.bona { background: #D8EFDF; border-color: #3C8D5A; color: #15204A; opacity: 1; }
.ex-op.dolenta, .ex-in.dolenta { background: #F6D9D6; border-color: #C2362B; color: #15204A; opacity: 1; }
.ex-in { font: inherit; width: 8em; padding: 2px 8px; margin: 0 4px; border-radius: 8px; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); }
.ex-corr { margin-top: 6px; font-size: .9rem; padding: 6px 10px; border-radius: 8px; color: #15204A; }
.ex-corr.ok { background: #D8EFDF; }
.ex-corr.ko { background: #F6D9D6; }
.ex-resultat { font-size: 1.05rem; }
.ex-resultat .ex-op { margin-left: 8px; }

/* Botó per descarregar la fitxa en PDF (c2/pdf/, fet amb eines/genera-pdf-fitxes.js) */
.baixa-pdf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: .2em 0 1.2em; }
.baixa-pdf a, .pdf-nivell a { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .92rem; color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 5px 14px 5px 11px; background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .baixa-pdf a:hover, .pdf-nivell a:hover { background: var(--saffron); color: #15204A; border-color: #15204A; } }
.baixa-pdf svg, .pdf-nivell svg, .pdf-mini svg { width: 16px; height: 16px; flex: none; }
.baixa-pdf span { color: var(--muted); font-size: .85rem; }

/* Fitxa anterior i següent, al peu de cada fitxa */
.fitxes-veines { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line, #e5e0d4); }
.fitxes-veines span:last-child { margin-left: auto; text-align: right; }

/* Detalls de tacte i lectura (regles de mobile-native, make-interfaces-feel-better i web-interface-guidelines) */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a, button, label, summary { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
/* L'iPhone fa zoom a la pàgina si un camp té la lletra de menys de 16 px. */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px !important; } }
.boto { transition: transform .1s ease-out, box-shadow .1s ease-out; }
.boto:active { transform: translateY(3px); box-shadow: none; }
.ex-op { transition: transform .1s ease-out; }
.ex-op:active:not(:disabled) { transform: scale(.96); }
/* El selector de tema és petit: la zona que es pot tocar és més alta que el que es veu. */
.tema button { position: relative; }
.tema button::after { content: ""; position: absolute; inset: -8px 0; }

/* Contingut del dia (solucions.html, enigma-del-dia.html, mot-del-dia.html, paraula-del-dia.html; js/dia.js) */
.dia-bloc { border-top: 1px solid var(--line); margin-top: 1.4em; padding-top: .2em; }
.dia-bloc h2 { margin-top: .8em; }
.dia-bloc h2 .nota { font-family: "Libre Franklin", system-ui, sans-serif; font-size: .85rem; font-weight: 500; }
.paraula-avui { text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; }
.paraula-avui .paraula { font-size: 2.2rem; margin: .1em 0 0; overflow-wrap: anywhere; }
.paraula-avui .significat { font-size: 1.1rem; margin: .6em 0 .3em; }
.paraula-avui .exemple { font-style: italic; color: var(--muted); margin: 0; }
.paraules dt { margin-top: .8em; }
.paraules dd { margin: .1em 0 0; }
td .r { white-space: nowrap; }

/* Articles amb aire de diari (idees de les referències editorials Medium, Antimetal i André Cândido):
   avantítol amb el temps de lectura, entradeta amb caplletra, subratllat de retolador groc i sumari numerat. */
.kicker { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.2em 0 .5em; font-variant-numeric: tabular-nums; }
.kicker + h1, .kicker + h2 { margin-top: 0; }
.article h1 { letter-spacing: -.015em; }
.entradeta { font-size: 1.08rem; line-height: 1.65; }
.entradeta::first-letter { float: left; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 3.4em; line-height: .82; margin: .06em .1em 0 0; color: var(--ink); }
.article mark { color: inherit; background: linear-gradient(to bottom, transparent 58%, color-mix(in srgb, var(--saffron) 55%, transparent) 58%, color-mix(in srgb, var(--saffron) 55%, transparent) 92%, transparent 92%); padding: 0 .1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
td, th { font-variant-numeric: tabular-nums; }
.article details { margin: .6em 0 1em; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.article details summary { cursor: pointer; }
.sumari { list-style: none; margin: 1.4em 0 0; padding: 0; }
.sumari li { border-top: 1px solid var(--line); padding: .2em 0 .6em; }
.sumari .kicker { margin: .9em 0 .2em; }
.sumari h2 { margin: 0 0 .25em; font-size: 1.3rem; }
.sumari h2 a { color: var(--ink); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .sumari h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } }
.sumari p:last-child { margin: 0; color: var(--muted); }
.signatura { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.comparteix { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85rem; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px 6px 11px; min-height: 36px; cursor: pointer; }
.comparteix svg { width: 15px; height: 15px; flex: none; }
@media (hover: hover) and (pointer: fine) { .comparteix:hover { border-color: var(--ink); } }
.comparteix:active { transform: scale(.97); }

/* Pàgina 404 (404.html) */
.p404 { text-align: center; }
.p404 .caselles { display: flex; justify-content: center; gap: 8px; margin: 8px 0 18px; }
.p404 .caselles span { width: 56px; height: 56px; display: grid; place-items: center; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.8rem; border-radius: 8px; background: var(--ink); color: var(--surface); box-shadow: 0 3px 0 var(--edge); }
.p404 .caselles span:nth-child(2) { background: var(--saffron); color: #15204A; }
.p404 ul { list-style: none; padding: 0; margin: 1.2em 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.p404 li a { display: inline-block; padding: 7px 14px; border: 1px solid var(--edge); border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--ink); background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .p404 li a:hover { border-color: var(--ink); } }
