/* Blog pubblico (/blog). Le regole .post-body sono usate anche dall'editor
   del pannello admin, cosi' l'articolo si vede uguale mentre lo si scrive. */

:root {
    --coral: #EA604E;
    --coral-dark: #db5543;
    --cream: #fceee9;
    --cream-soft: #fff8f5;
    --ink: #263238;
    --text: #3f4548;
    --muted: #5c6469;
    --line: rgba(234, 96, 78, 0.16);
    --shadow: 0 18px 50px rgba(38, 50, 56, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.blog {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.blog main { flex: 1; }
.blog a { color: inherit; }
.blog img { max-width: 100%; }

/* ── Barra in alto ── */
.b-top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    max-width: 1080px; width: 100%; margin: 0 auto; padding: 18px 20px;
}
.b-logo { display: block; flex: none; }
.b-logo img { display: block; height: 44px; width: auto; }
.b-nav { display: flex; align-items: center; gap: 6px; }
.b-nav a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 9px 14px; border-radius: 999px; }
.b-nav a.-active, .b-nav a:hover { color: var(--coral); }

.b-wrap { max-width: 1080px; margin: 0 auto; padding: 8px 20px 64px; }
.b-narrow { max-width: 760px; }

/* ── Elenco articoli ── */
.b-hero { text-align: center; padding: 28px 0 36px; }
.b-hero h1 { margin: 0; font-size: 44px; font-weight: 900; letter-spacing: -0.03em; color: var(--coral); line-height: 1.1; }
.b-hero p { margin: 12px auto 0; max-width: 560px; font-size: 18px; color: var(--muted); }

.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.b-card {
    display: flex; flex-direction: column; background: #fff; border-radius: 24px; overflow: hidden;
    box-shadow: var(--shadow); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.b-card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(38, 50, 56, 0.14); }
.b-card-img { aspect-ratio: 16 / 9; background: linear-gradient(150deg, #fff4f0, #f8d9cf); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.b-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-card-img .ph { font-size: 52px; opacity: .8; }
.b-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.b-card h2 { margin: 6px 0 0; font-size: 21px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.25; }
.b-card:hover h2 { color: var(--coral); }
.b-card p { margin: 10px 0 0; font-size: 15px; color: var(--text); }
.b-card .more { margin-top: auto; padding-top: 14px; font-weight: 800; font-size: 14px; color: var(--coral); }

/* Primo articolo in evidenza, su due colonne da desktop */
@media (min-width: 900px) {
    .b-grid > .b-card.-featured { grid-column: 1 / -1; flex-direction: row; }
    .b-card.-featured .b-card-img { flex: 0 0 56%; aspect-ratio: auto; min-height: 340px; }
    .b-card.-featured .b-card-body { padding: 36px 36px 36px; justify-content: center; }
    .b-card.-featured h2 { font-size: 30px; }
    .b-card.-featured p { font-size: 17px; }
    .b-card.-featured .more { margin-top: 0; padding-top: 22px; }
}

.b-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.b-meta .dot { margin: 0 6px; opacity: .5; }

.b-empty { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 48px 28px; text-align: center; max-width: 560px; margin: 0 auto; }
.b-empty .e { font-size: 48px; }
.b-empty p { margin: 12px 0 0; font-size: 17px; color: var(--muted); }

.b-pages { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.b-pages a, .b-pages span { padding: 10px 18px; border-radius: 999px; background: #fff; text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px rgba(38,50,56,.08); }
.b-pages a:hover { color: var(--coral); }
.b-pages span { opacity: .45; }

/* ── Articolo ── */
.b-crumbs { font-size: 13px; color: var(--muted); font-weight: 600; margin: 4px 0 18px; }
.b-crumbs a { text-decoration: none; }
.b-crumbs a:hover { color: var(--coral); }
.b-crumbs span { margin: 0 6px; opacity: .5; }

.b-head h1 { margin: 0; font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
.b-head .lead { margin: 14px 0 0; font-size: 19px; color: var(--muted); line-height: 1.55; }
.b-head .b-meta { margin-top: 16px; }

.b-cover { margin: 26px 0 0; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; background: #fff; }
.b-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.b-article { margin-top: 26px; background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 40px 44px; }

.b-cta {
    margin-top: 26px; background: var(--coral); color: #fff; border-radius: 28px; padding: 32px 28px; text-align: center;
    box-shadow: 0 18px 44px rgba(234, 96, 78, .30); position: relative; overflow: hidden;
}
.b-cta .t { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
.b-cta .s { margin: 8px auto 0; font-size: 16px; opacity: .9; max-width: 480px; }
.b-stores { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
/* .b-cta davanti: altrimenti ".blog a { color: inherit }" rende il testo bianco su bianco */
.b-cta .b-store {
    display: inline-flex; align-items: center; gap: 12px; background: #fff; color: var(--coral); text-decoration: none;
    padding: 11px 20px; border-radius: 16px; font-weight: 800; transition: transform .15s ease;
}
.b-cta .b-store:hover { transform: translateY(-2px); }
.b-store svg { width: 22px; height: 22px; fill: var(--coral); flex: none; }
.b-store .lbl { text-align: left; line-height: 1.15; }
.b-store .lbl small { display: block; font-size: 11px; font-weight: 600; opacity: .8; }
.b-store .lbl span { display: block; font-size: 16px; font-weight: 900; }

.b-related { margin-top: 56px; }
.b-related > h2 { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--coral); margin: 0 0 18px; }
.b-related .b-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.b-related .b-card h2 { font-size: 18px; }

.b-preview-bar { background: #263238; color: #fff; text-align: center; font-size: 14px; font-weight: 700; padding: 10px 16px; position: sticky; top: 0; z-index: 10; }

/* ── Footer (come la landing) ── */
.b-foot { background: var(--coral); }
.b-foot .in { max-width: 1080px; margin: 0 auto; padding: 16px 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 14px; }
.b-foot a { color: rgba(255,255,255,.9); text-decoration: none; white-space: nowrap; }
.b-foot a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 640px) {
    .b-top { padding: 14px 16px; }
    .b-logo img { height: 36px; }
    .b-nav a { padding: 8px 10px; font-size: 14px; }
    .b-wrap { padding: 4px 16px 48px; }
    .b-hero { padding: 16px 0 24px; }
    .b-hero h1 { font-size: 34px; }
    .b-hero p { font-size: 16px; }
    .b-grid { grid-template-columns: 1fr; gap: 18px; }
    .b-head h1 { font-size: 29px; }
    .b-head .lead { font-size: 17px; }
    .b-cover { border-radius: 18px; margin-top: 20px; }
    .b-article { padding: 24px 20px; border-radius: 22px; margin-top: 20px; }
    .b-cta { padding: 26px 20px; border-radius: 22px; }
    .b-store { flex: 1 1 100%; justify-content: center; }
}

/* ── Testo dell'articolo ── */
.post-body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 17.5px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin: 0 0 1.1em; }
.post-body p.lead { font-size: 1.15em; line-height: 1.65; color: var(--ink); font-weight: 500; }

/* Titoli: corallo, con la linea tratteggiata "a mano" della landing */
.post-body h2 {
    font-size: 1.6em; font-weight: 900; color: var(--coral); letter-spacing: -0.02em; line-height: 1.22;
    margin: 2em 0 .8em; padding-bottom: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M2 7 Q 17 1 32 6 T 62 6 T 92 6 T 118 5' fill='none' stroke='%23EA604E' stroke-width='2.2' stroke-linecap='round' stroke-dasharray='6 5'/%3E%3C/svg%3E") left bottom / 120px 12px no-repeat;
}
.post-body h3 { font-size: 1.22em; font-weight: 800; color: var(--ink); line-height: 1.3; margin: 1.7em 0 .5em; }
.post-body h4 { font-size: .95em; font-weight: 900; color: var(--coral); text-transform: uppercase; letter-spacing: .06em; margin: 1.5em 0 .4em; }
.post-body h2 + h3 { margin-top: 0; }

.post-body strong, .post-body b { font-weight: 700; color: var(--ink); }
.post-body mark { background: linear-gradient(180deg, transparent 52%, rgba(234, 96, 78, .28) 52%); color: var(--ink); padding: 0 .1em; border-radius: 2px; }
.post-body a { color: var(--coral); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.post-body a:hover { color: var(--coral-dark); }

/* Elenchi: pallini corallo; .list-check e .list-cross per pro e contro */
.post-body ul, .post-body ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.post-body li { margin: .45em 0; padding-left: .2em; }
.post-body li::marker { color: var(--coral); font-weight: 900; }
.post-body li > p { margin: 0; }
.post-body ul.list-check, .post-body ul.list-cross { list-style: none; padding-left: 0; }
.post-body ul.list-check li, .post-body ul.list-cross li { position: relative; padding-left: 2.1em; }
.post-body ul.list-check li::before, .post-body ul.list-cross li::before {
    position: absolute; left: 0; top: .2em; width: 1.4em; height: 1.4em; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .78em; font-weight: 900; line-height: 1;
}
.post-body ul.list-check li::before { content: '✓'; background: var(--coral); color: #fff; }
.post-body ul.list-cross li::before { content: '✕'; background: #eceff1; color: #78858b; }

.post-body blockquote {
    margin: 1.8em 0; padding: 1.1em 1.4em 1.1em 3.2em; background: var(--cream-soft); border-radius: 18px;
    color: var(--ink); font-size: 1.06em; font-weight: 500; position: relative;
}
.post-body blockquote::before { content: '“'; position: absolute; left: .35em; top: -.05em; font-size: 3.4em; font-weight: 900; color: var(--coral); line-height: 1; }
.post-body blockquote > :last-child { margin-bottom: 0; }

/* Separatore: tre puntini corallo */
.post-body hr {
    border: 0; height: 14px; margin: 2.4em 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='14'%3E%3Cg fill='%23EA604E'%3E%3Ccircle cx='10' cy='7' r='3.5' opacity='.45'/%3E%3Ccircle cx='30' cy='7' r='3.5' opacity='.7'/%3E%3Ccircle cx='50' cy='7' r='3.5' opacity='.45'/%3E%3C/g%3E%3C/svg%3E") center / 60px 14px no-repeat;
}

/* Riquadri (menu "Stili Librato" dell'editor) */
.post-body .box-tip, .post-body .box-info, .post-body .box-librato { margin: 1.8em 0; padding: 1.2em 1.4em; border-radius: 20px; }
.post-body .box-tip > :last-child, .post-body .box-info > :last-child, .post-body .box-librato > :last-child { margin-bottom: 0; }
.post-body .box-tip > :first-child, .post-body .box-info > :first-child, .post-body .box-librato > :first-child { margin-top: 0; }
.post-body .box-tip { background: var(--cream-soft); border: 2px solid rgba(234, 96, 78, .25); }
.post-body .box-tip::before { content: '💡 Consiglio'; display: block; font-size: .78em; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--coral); margin-bottom: .5em; }
.post-body .box-info { background: #fff; border: 2px dashed rgba(234, 96, 78, .45); }
.post-body .box-info::before { content: 'ℹ️ Da sapere'; display: block; font-size: .78em; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--coral); margin-bottom: .5em; }
.post-body .box-librato { background: var(--coral); color: #fff; box-shadow: 0 16px 40px rgba(234, 96, 78, .28); }
.post-body .box-librato h2, .post-body .box-librato h3, .post-body .box-librato strong, .post-body .box-librato mark { color: #fff; }
.post-body .box-librato h2 { background: none; padding: 0; margin: 0 0 .5em; }
.post-body .box-librato li::marker { color: #fff; }
.post-body .box-librato ul.list-check li::before { background: #fff; color: var(--coral); }
.post-body .box-librato a:not(.button) { color: #fff; }
.post-body .box-librato mark { background: linear-gradient(180deg, transparent 55%, rgba(255, 255, 255, .3) 55%); }

/* Link a bottone */
.post-body a.button {
    display: inline-block; background: var(--coral); color: #fff; text-decoration: none; font-weight: 800;
    padding: .7em 1.4em; border-radius: 999px; box-shadow: 0 10px 24px rgba(234, 96, 78, .3); transition: transform .15s, background .15s;
}
.post-body a.button:hover { background: var(--coral-dark); color: #fff; transform: translateY(-2px); }
.post-body .box-librato a.button { background: #fff; color: var(--coral); box-shadow: none; }

/* Immagini */
.post-body img { display: block; max-width: 100%; height: auto; border-radius: 18px; margin: 1.8em auto; box-shadow: 0 12px 32px rgba(38, 50, 56, .10); }
.post-body figure { margin: 2em 0; }
.post-body figure img { margin: 0 auto; }
.post-body figcaption { text-align: center; font-size: .85em; color: var(--muted); margin-top: .8em; }
/* Immagine larga: esce dai margini del riquadro bianco */
.post-body img.wide, .post-body figure.wide { width: calc(100% + 88px); max-width: none; margin-left: -44px; margin-right: -44px; border-radius: 0; }
.post-body figure.wide img { width: 100%; border-radius: 0; box-shadow: none; }

.post-body iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 18px; margin: 1.8em 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .92em; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: .6em .8em; text-align: left; vertical-align: top; }
.post-body th, .post-body thead td { background: var(--cream-soft); color: var(--ink); font-weight: 800; }
.post-body code { background: var(--cream-soft); padding: .1em .35em; border-radius: 6px; font-size: .9em; }
.post-body pre { background: var(--cream-soft); padding: 1em; border-radius: 12px; overflow-x: auto; }
.post-body pre code { background: none; padding: 0; }

@media (max-width: 640px) {
    .post-body { font-size: 16.5px; }
    .post-body h2 { font-size: 1.42em; }
    .post-body .box-tip, .post-body .box-info, .post-body .box-librato { padding: 1em 1.1em; border-radius: 16px; }
    .post-body img.wide, .post-body figure.wide { width: calc(100% + 40px); margin-left: -20px; margin-right: -20px; }
    /* Tabelle larghe: scorrono di lato invece di allargare la pagina */
    .post-body table { display: block; overflow-x: auto; }
}
