/* ============================================================
   Quadern — full d'estil del blog
   Títols: Inknut Antiqua · Cos: Instrument Sans · Accent: oliva
   Tipografies incrustades (a /assets/fonts), sense dependències externes
   ============================================================ */

/* ---------- Tipografies (subconjunts latin + latin-ext) ---------- */

/* Instrument Sans — normal (fitxer variable, pesos 400–700) */
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/InstrumentSans-Regular.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: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/InstrumentSans-Regular-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;
}
/* Instrument Sans — cursiva */
@font-face {
  font-family: 'Instrument Sans'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('fonts/InstrumentSans-Italic.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: 'Instrument Sans'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('fonts/InstrumentSans-Italic-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;
}
/* Inknut Antiqua — Regular (400) */
@font-face {
  font-family: 'Inknut Antiqua'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/InknutAntiqua-Regular.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: 'Inknut Antiqua'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/InknutAntiqua-Regular-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;
}
/* Inknut Antiqua — Medium (500) */
@font-face {
  font-family: 'Inknut Antiqua'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/InknutAntiqua-Medium.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: 'Inknut Antiqua'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/InknutAntiqua-Medium-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 ---------- */
:root {
  --serif: 'Inknut Antiqua', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg:          #fbfaf8;
  --ink:         #322f2b;
  --ink-strong:  #211f1c;
  --muted:       #8c867c;
  --accent:      #55683f;
  --accent-deep: #41512f;
  --rule:        #e7e2d9;
  --code-bg:     #f2efe9;
  --code-ink:    #4a463f;

  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1b1a18;
    --ink:         #d7d3cb;
    --ink-strong:  #ece8e0;
    --muted:       #948e84;
    --accent:      #a6bd87;
    --accent-deep: #bcd0a3;
    --rule:        #34322e;
    --code-bg:     #262320;
    --code-ink:    #c9c4bb;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;       /* 19px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(85,104,63,0.18); }
@media (prefers-color-scheme: dark) { ::selection { background: rgba(166,189,135,0.26); } }

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Capçalera ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; padding-bottom: 1.5rem;
}
.site-name {
  font-family: var(--serif); font-weight: 500; font-size: 1.25rem;
  color: var(--ink-strong); text-decoration: none; letter-spacing: -0.01em;
}
.site-nav { font-size: 0.9rem; display: flex; gap: 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent-deep); }
.site-nav a[aria-current="page"] { color: var(--ink-strong); }

/* ---------- Intro (inici) ---------- */
.intro { padding: 3.25rem 0 0.5rem; }
.intro-lead { font-size: 1.3rem; line-height: 1.5; color: var(--ink); margin: 0; max-width: 32rem; }
.intro-lead .soft { color: var(--muted); }

/* ---------- Llistat d'entrades (inici) ---------- */
.posts { padding: 2.5rem 0 1rem; }
.post-item { padding: 2rem 0; border-top: 1px solid var(--rule); }
.post-item:first-child { border-top: 0; padding-top: 0.5rem; }
.post-item-meta {
  font-size: 0.85rem; color: var(--muted); margin: 0 0 0.5rem;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.post-item-meta .cat {
  color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem;
}
.post-item-meta .dot { color: var(--rule); }
.post-item-title {
  font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.22;
  letter-spacing: -0.01em; margin: 0 0 0.45rem;
}
.post-item-title a { color: var(--ink-strong); text-decoration: none; }
.post-item-title a:hover { color: var(--accent); }
.post-item-dek { margin: 0; color: color-mix(in srgb, var(--ink) 90%, var(--bg)); font-size: 1.05rem; }

/* ---------- Entrada ---------- */
.post { padding: 3.5rem 0 1rem; }
.post-kicker {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin: 0 0 1rem;
}
.post-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 2.8rem); line-height: 1.16; letter-spacing: -0.01em;
  color: var(--ink-strong); margin: 0 0 1rem;
}
.post-meta { font-size: 0.92rem; color: var(--muted); margin: 0 0 2.75rem; }

/* ---------- Prosa ---------- */
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.3rem; }
.prose h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.25;
  letter-spacing: -0.003em; color: var(--ink-strong); margin: 2.6rem 0 0.9rem;
}
.prose h3 { font-weight: 650; font-size: 1.22rem; color: var(--ink-strong); margin: 2.1rem 0 0.6rem; }
.prose h4 { font-weight: 600; font-size: 1.02rem; letter-spacing: 0.005em; color: var(--ink-strong); margin: 1.7rem 0 0.5rem; }
.prose a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }
.prose strong { font-weight: 700; color: var(--ink-strong); }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin: 1.8rem 0; padding: 0.1rem 0 0.1rem 1.2rem; border-left: 2px solid var(--accent);
  color: color-mix(in srgb, var(--ink) 88%, var(--bg)); font-size: 1.08rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono); font-size: 0.86em; background: var(--code-bg); color: var(--code-ink);
  padding: 0.15em 0.36em; border-radius: 3px;
}
.prose pre { background: var(--code-bg); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto; margin: 1.6rem 0; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: 0.85rem; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1.8rem auto; border-radius: 3px; }
.prose figure { margin: 1.8rem 0; }
.prose figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* ---------- Peu ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; }
.site-footer .wrap {
  padding-top: 2rem; padding-bottom: 3rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: space-between; align-items: baseline;
  font-size: 0.88rem; color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-deep); }

/* ---------- Mòbil ---------- */
@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .wrap { padding: 0 1.75rem; }
  .post { padding-top: 2.5rem; }
  .intro { padding-top: 2.5rem; }
  .intro-lead { font-size: 1.2rem; }
  .post-meta { margin-bottom: 2rem; }
}
