/* ==========================================================
   AAP · Blog
   Complementa campanya.css — reutilitza les seves variables
   (--ink, --muted, --line, --soft, --blue, --blue-dark, --red)
   i els tokens de marca (--font-display, --font-body,
   --circuit-gradient). Indicacions completes a
   docs/identitat-de-marca.md — llegeix-lo abans de tocar colors
   o tipografia aqui.
   ========================================================== */

.container-narrow {
    max-width: 720px;
}

/* ---------- Portada i capçaleres de llistat ---------- */

.blog-hero {
    background: var(--soft);
    border-bottom: 1px solid var(--line);
    padding: 64px 0 48px;
    margin-bottom: 40px;
}

.blog-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 12px;
}

.blog-hero h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.8rem);
    line-height: 1.15;
    max-width: 18ch;
    text-wrap: balance;
}

.blog-lead {
    margin-top: 16px;
    max-width: 60ch;
    font-size: 1.08rem;
    color: var(--muted);
}

/* ---------- Filtre per pilars ---------- */

.temes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.tema {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
    color: var(--muted);
    background: var(--white);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.tema:hover {
    border-color: var(--blue);
    color: var(--blue-dark);
}

.tema.actiu {
    background: var(--circuit-gradient);
    border-color: transparent;
    color: var(--white);
}

/* ---------- Graella d'articles ---------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.post-card-tag {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue-dark);
    background: var(--soft);
    border-radius: 999px;
    padding: 4px 10px;
    text-decoration: none;
}

.post-card h2 {
    font-size: 1.22rem;
    line-height: 1.3;
    text-wrap: balance;
}

.post-card h2 a {
    text-decoration: none;
    color: var(--ink);
}

.post-card h2 a:hover {
    color: var(--blue-dark);
}

.post-card-excerpt {
    color: var(--muted);
    font-size: 0.95rem;
    flex-grow: 1;
}

.post-card-meta {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.buit {
    color: var(--muted);
    padding: 48px 0 64px;
    text-align: center;
}

/* ---------- Paginació ---------- */

.paginacio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 0 56px;
    flex-wrap: wrap;
}

.pag-link {
    text-decoration: none;
    color: var(--blue-dark);
    font-weight: 600;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 18px;
}

.pag-link:hover {
    border-color: var(--blue);
}

.pag-estat {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Article ---------- */

.post {
    padding: 40px 0 24px;
}

.molles {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 24px;
}

.molles a {
    color: var(--muted);
    text-decoration: none;
}

.molles a:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

.post-header h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.18;
    text-wrap: balance;
    margin-bottom: 14px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.post-entradeta {
    margin-top: 20px;
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--muted);
    border-left: 3px solid var(--red);
    padding-left: 18px;
}

.post-cover {
    margin: 32px 0;
}

.post-cover img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
}

/* Cos de l'article: serif per a lectura llarga */
.post-body {
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-size: 1.09rem;
    line-height: 1.75;
    margin-top: 32px;
}

.post-body > * + * {
    margin-top: 1.15em;
}

.post-body h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
    margin-top: 2.2em;
    padding-top: 0.4em;
    border-top: 1px solid var(--line);
    text-wrap: balance;
}

.post-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 1.9em;
    text-wrap: balance;
}

.post-body h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.02rem;
    margin-top: 1.6em;
    color: var(--muted);
}

.post-body a {
    color: var(--blue-dark);
    text-underline-offset: 3px;
}

.post-body ul,
.post-body ol {
    padding-left: 1.4em;
}

.post-body li + li {
    margin-top: 0.5em;
}

.post-body blockquote {
    border-left: 3px solid var(--blue);
    background: var(--soft);
    padding: 16px 22px;
    border-radius: 0 10px 10px 0;
    color: var(--ink);
    font-style: italic;
}

.post-body blockquote p + p {
    margin-top: 0.8em;
}

.post-body code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 6px;
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.4em 0;
}

.post-body img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ---------- Peu d'article ---------- */

.post-autor {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 48px;
    padding: 22px;
    background: var(--soft);
    border-radius: 14px;
}

.post-autor img {
    border-radius: 10px;
    flex-shrink: 0;
}

.post-autor p {
    margin: 0;
}

.post-autor .small {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 4px;
}

.relacionats {
    margin-top: 48px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.relacionats h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 14px;
}

.relacionats ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relacionats li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.relacionats a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}

.relacionats a:hover {
    color: var(--blue-dark);
}

.relacionats .small {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ---------- Crida final ---------- */

.blog-cta {
    background: var(--soft);
    border-top: 1px solid var(--line);
    margin-top: 64px;
    padding: 56px 0;
    text-align: center;
}

.blog-cta h2 {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    text-wrap: balance;
}

.blog-cta p {
    max-width: 52ch;
    margin: 14px auto 0;
    color: var(--muted);
}

.blog-cta .btn {
    margin-top: 22px;
}

@media (prefers-reduced-motion: reduce) {
    .post-card {
        transition: none;
    }
}
