/* ============================================================
   SINGLE POST — Articoli & Tutorial — Proposta 4
   Design system: dark #0d1117 · accent #4ecca3 · body #fff / #f8f9fa
   ============================================================ */

/* ── 1. COVER full-bleed ─────────────────────────────────── */
.sp-cover {
    position: relative;
    width: 100%;
    background: #0d1117;
}

.sp-cover__img {
    width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sp-cover__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 22, .45);
}

.sp-cover__accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #4ecca3;
}

/* ── 2. HERO dark ────────────────────────────────────────── */
.sp-hero {
    background: #0d1117;
    padding: 22px 0 20px;
    border-bottom: 0.5px solid rgba(255, 255, 255, .07);
}

.sp-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.sp-hero__breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
    font-size: .75rem;
    color: rgba(255, 255, 255, .22);
    margin-bottom: 10px;
}

.sp-hero__breadcrumb a {
    color: rgba(255, 255, 255, .38);
    text-decoration: none;
    transition: color .2s;
}

.sp-hero__breadcrumb a:hover { color: rgba(255, 255, 255, .7); }

.sp-bc-sep {
    color: rgba(255, 255, 255, .12);
    font-size: .65rem;
}

.sp-hero__date {
    font-size: .75rem;
    font-weight: 700;
    color: #4ecca3;
    letter-spacing: .1em;
    margin: 0 0 8px;
}

.sp-hero__title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin: 0 0 16px;
    max-width: 820px;
}

.sp-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 18px;
    border-bottom: 0.5px solid rgba(255, 255, 255, .07);
}

/* Chip — categorie */
.sp-hero__chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    border: 0.5px solid transparent;
    transition: background .2s, color .2s;
    line-height: 1.4;
}

.sp-hero__chip--cat {
    background: rgba(78, 204, 163, .15);
    color: #4ecca3;
    border-color: rgba(78, 204, 163, .3);
}

.sp-hero__chip--cat:hover {
    background: rgba(78, 204, 163, .25);
}

.sp-hero__chip--tag {
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .45);
    border-color: rgba(255, 255, 255, .1);
}

.sp-hero__chip--tag:hover {
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .7);
}

/* Separatore flessibile tra chip e read time */
.sp-hero__meta-sep { flex: 1; }

.sp-hero__readtime {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: rgba(255, 255, 255, .3);
}

/* Autore inline — desktop */
.sp-hero__author-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: .8125rem;
    color: rgba(255, 255, 255, .55);
}

.sp-hero__author-avatar {
    border-radius: 50%;
    border: 1px solid rgba(78, 204, 163, .35);
    flex-shrink: 0;
}

/* ── 3. AUTHOR STRIP — mobile only ──────────────────────── */
.sp-author-strip {
    display: none;
}

/* ── 4. TOC MOBILE — mobile only ─────────────────────────── */
.sp-toc-mobile {
    display: none;
}

/* ── 5. BODY GRID ────────────────────────────────────────── */
.sp-body {
    background: #f8f9fa;
}

.sp-body__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: start;
}

/* ── 5a. CONTENT ─────────────────────────────────────────── */
.sp-content {
    background: #fff;
    padding: 32px 36px 40px;
    border-right: 0.5px solid #e8eaed;
    min-width: 0;
}

/* Tipografia corpo articolo */
.sp-entry-content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #374151;
}

.sp-entry-content p {
    margin: 0 0 1.375em;
}

.sp-entry-content h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #111827;
    margin: 2.25em 0 .75em;
    line-height: 1.3;
}

.sp-entry-content h3 {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    font-weight: 600;
    color: #4b5563;
    margin: 1.75em 0 .6em;
    line-height: 1.3;
}

.sp-entry-content h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin: 1.5em 0 .5em;
}

.sp-entry-content blockquote {
    border-left: 3px solid #4ecca3;
    background: #f0fdf9;
    padding: 12px 18px;
    margin: 1.5em 0;
    font-style: italic;
    color: #4b5563;
    font-size: .9375rem;
    line-height: 1.7;
    border-radius: 0 4px 4px 0;
}

.sp-entry-content blockquote p { margin: 0; }

.sp-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 1.5em auto;
}

.sp-entry-content a {
    color: #0f6e56;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sp-entry-content a:hover { color: #4ecca3; }

.sp-entry-content ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: .75em 0 1.375em;
}

.sp-entry-content ul li {
    position: relative;
    padding-left: .25rem;
    margin-bottom: .5em;
    color: #374151;
}

.sp-entry-content ul li::before {
    content: "→";
    position: absolute;
    left: -1.25rem;
    color: #4ecca3;
    font-weight: 700;
}

.sp-entry-content ol {
    padding-left: 1.75rem;
    margin: .75em 0 1.375em;
}

.sp-entry-content ol li {
    margin-bottom: .5em;
    color: #374151;
}

.sp-entry-content ol li::marker {
    color: #4ecca3;
    font-weight: 700;
}

.sp-entry-content pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.65;
    margin: 1.5em 0;
}

.sp-entry-content code {
    background: #f1f5f9;
    color: #be123c;
    border-radius: 4px;
    padding: .125rem .4rem;
    font-size: .88em;
    font-family: ui-monospace, "Cascadia Code", monospace;
}

.sp-entry-content pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
}

.sp-entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: .9375rem;
}

.sp-entry-content th,
.sp-entry-content td {
    border: 1px solid #e2e8f0;
    padding: .75rem 1rem;
    text-align: left;
}

.sp-entry-content th {
    background: #f8fafc;
    font-weight: 700;
    color: #111827;
}

.sp-entry-content hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 2rem 0;
}

/* Share strip — mobile only (dentro content) */
.sp-share-mobile {
    display: none;
}

/* Tags (dentro content) */
.sp-tags {
    margin-top: 2.5em;
    padding-top: 1.25em;
    border-top: 1px solid #f0f2f5;
}

.sp-tags__label {
    font-size: .7rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sp-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sp-tags__pill {
    display: inline-flex;
    align-items: center;
    font-size: .8125rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 0.5px solid #e2e8f0;
    color: #6b7280;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}

.sp-tags__pill:hover {
    background: #e1f5ee;
    color: #0f6e56;
    border-color: #5dcaa5;
}

/* Author bio (dentro content) */
.sp-author-bio {
    margin-top: 2.5em;
}

/* Override stili plugin ct-author-bio — contesto chiaro */
.sp-author-bio .ct-author-box {
    background: #f8fafc;
    border: 0.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: none;
}

.sp-author-bio .ct-author-box__avatar img {
    border: 2px solid #5dcaa5;
    border-radius: 50%;
}

.sp-author-bio .ct-author-box__name {
    color: #111827;
}

.sp-author-bio .ct-author-box__role {
    color: #0f6e56;
}

.sp-author-bio .ct-author-box__bio p {
    color: #6b7280;
    font-size: .9375rem;
    line-height: 1.7;
}

.sp-author-bio .ct-author-box__button {
    background: #fff;
    border: 0.5px solid #e2e8f0;
    color: #6b7280;
    border-radius: 4px;
    font-size: .8125rem;
    padding: 4px 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sp-author-bio .ct-author-box__button:hover {
    background: #f0fdf9;
    color: #0f6e56;
}

/* ── 5b. SIDEBAR ─────────────────────────────────────────── */
.sp-sidebar {
    padding: 24px 16px;
    background: #f8f9fa;
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Progress bar */
.sp-progress {
    margin-bottom: 20px;
}

.sp-progress__label {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: #9ca3af;
    margin-bottom: 5px;
}

.sp-progress__track {
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
}

.sp-progress__fill {
    height: 3px;
    background: #4ecca3;
    border-radius: 2px;
    width: 0%;
    transition: width .15s ease-out;
}

/* TOC sidebar */
.sp-toc-box {
    margin-bottom: 0;
}

.sp-toc__heading {
    font-size: .7rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.sp-toc__nav {
    display: flex;
    flex-direction: column;
}

.sp-toc__nav a {
    display: block;
    font-size: .8125rem;
    color: #6b7280;
    padding: 4px 0 4px 10px;
    border-left: 2px solid #e5e7eb;
    text-decoration: none;
    line-height: 1.4;
    transition: color .15s, border-color .15s;
}

.sp-toc__nav a:hover {
    color: #374151;
}

.sp-toc__nav a[data-level="3"] {
    padding-left: 18px;
    font-size: .75rem;
    color: #9ca3af;
}

.sp-toc__nav a.is-active {
    color: #0f6e56;
    border-left-color: #4ecca3;
    font-weight: 600;
}

.sp-toc__nav a[data-level="3"].is-active {
    color: #0f6e56;
}

/* Share sidebar */
.sp-share {
    border-top: 0.5px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 20px;
}

.sp-share__title {
    font-size: .7rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sp-share__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: .8125rem;
    color: #6b7280;
    text-decoration: none;
    background: #fff;
    border: 0.5px solid #e2e8f0;
    border-radius: 5px;
    padding: 6px 10px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
    font-family: inherit;
}

.sp-share__btn:hover {
    background: #f0fdf9;
    color: #0f6e56;
}

/* ── 6. RELATED ──────────────────────────────────────────── */
.sp-related {
    background: #f1f5f9;
    padding: 40px clamp(1rem, 4vw, 2rem) 48px;
    border-top: 0.5px solid #e2e8f0;
}

.sp-related__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.sp-related__title {
    font-size: .7rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.sp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sp-related-card {
    background: #fff;
    border: 0.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.sp-related-card:hover {
    border-color: #5dcaa5;
    box-shadow: 0 4px 16px rgba(78, 204, 163, .12);
}

.sp-related-card__img-wrap {
    display: block;
    height: 120px;
    overflow: hidden;
    background: #e1f5ee;
}

.sp-related-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.sp-related-card:hover .sp-related-card__img {
    transform: scale(1.04);
}

.sp-related-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #c7f0e1 0%, #e1f5ee 100%);
}

.sp-related-card__body {
    padding: 12px 14px;
}

.sp-related-card__cat {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: #0f6e56;
    letter-spacing: .06em;
    margin-bottom: 4px;
    text-decoration: none;
}

.sp-related-card__title {
    font-size: .9375rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    margin: 0 0 6px;
}

.sp-related-card__title a {
    color: inherit;
    text-decoration: none;
}

.sp-related-card__title a:hover { color: #0f6e56; }

.sp-related-card__date {
    font-size: .75rem;
    color: #9ca3af;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sp-body__inner {
        grid-template-columns: minmax(0, 1fr) 190px;
    }
}

@media (max-width: 767px) {

    /* Cover: full width su mobile */
    .sp-cover__img { width: 100%; margin: 0; }

    /* Hero: autore inline nascosto */
    .sp-hero__author-inline { display: none; }

    /* Author strip visibile */
    .sp-author-strip {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #111827;
        padding: 10px 16px;
        border-bottom: 0.5px solid rgba(255, 255, 255, .06);
    }

    .sp-author-strip__avatar {
        border-radius: 50%;
        border: 1.5px solid rgba(78, 204, 163, .4);
        flex-shrink: 0;
    }

    .sp-author-strip__info { flex: 1; min-width: 0; }

    .sp-author-strip__name {
        font-size: .8125rem;
        font-weight: 600;
        color: rgba(255, 255, 255, .75);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sp-author-strip__role {
        font-size: .6875rem;
        color: rgba(255, 255, 255, .35);
    }

    .sp-author-strip__share {
        background: none;
        border: none;
        cursor: pointer;
        color: rgba(255, 255, 255, .3);
        padding: 4px;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    /* TOC accordion visibile */
    .sp-toc-mobile {
        display: block;
        background: #f8f9fa;
        border-bottom: 0.5px solid #e8eaed;
    }

    .sp-toc-mobile__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 11px 16px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        text-align: left;
    }

    .sp-toc-mobile__label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: .75rem;
        font-weight: 700;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .sp-toc-mobile__chevron {
        color: #9ca3af;
        transition: transform .25s;
        flex-shrink: 0;
    }

    .sp-toc-mobile__header[aria-expanded="true"] .sp-toc-mobile__chevron {
        transform: rotate(180deg);
    }

    .sp-toc-mobile__items {
        padding: 0 16px 12px;
        border-top: 0.5px solid #e8eaed;
    }

    .sp-toc-mobile__items a {
        display: block;
        font-size: .8125rem;
        color: #6b7280;
        padding: 4px 0 4px 10px;
        border-left: 2px solid #e5e7eb;
        text-decoration: none;
        line-height: 1.4;
    }

    .sp-toc-mobile__items a.is-h3 {
        padding-left: 18px;
        font-size: .75rem;
        color: #9ca3af;
    }

    .sp-toc-mobile__items a.is-active {
        color: #0f6e56;
        border-left-color: #4ecca3;
        font-weight: 600;
    }

    /* Body: colonna singola, sidebar nascosta */
    .sp-body__inner {
        grid-template-columns: 1fr;
    }

    .sp-sidebar { display: none; }

    /* Content: padding ridotto */
    .sp-content {
        padding: 20px 16px 28px;
        border-right: none;
    }

    .sp-entry-content { font-size: .9375rem; }
    .sp-entry-content h2 { font-size: 1.1875rem; }
    .sp-entry-content h3 { font-size: 1rem; }

    /* Share strip mobile visibile */
    .sp-share-mobile {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px 0;
        border-top: 0.5px solid #e8eaed;
        border-bottom: 0.5px solid #e8eaed;
        margin: 1.5em 0;
    }

    .sp-share-mobile__label {
        font-size: .7rem;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: .08em;
        margin-right: 4px;
    }

    .sp-share-mobile__btn {
        font-size: .8125rem;
        color: #6b7280;
        background: #fff;
        border: 0.5px solid #e2e8f0;
        border-radius: 5px;
        padding: 5px 10px;
        text-decoration: none;
        cursor: pointer;
        font-family: inherit;
        transition: background .15s, color .15s;
    }

    .sp-share-mobile__btn:hover {
        background: #f0fdf9;
        color: #0f6e56;
    }

    /* Related: lista verticale su mobile */
    .sp-related__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sp-related-card {
        display: grid;
        grid-template-columns: 80px 1fr;
        border-radius: 8px;
    }

    .sp-related-card__img-wrap {
        height: 80px;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .sp-hero__meta { gap: 5px; }
    .sp-tags__list { gap: 5px; }
}

/* ── FAQ inline (articoli e tutorial) ─────────────────────── */
.sp-inline-faq {
    margin: 2.5rem 0 1.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}
.sp-inline-faq__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1.25rem;
}
.sp-inline-faq .faq-item { border-bottom-color: #e2e8f0; }
.sp-inline-faq .faq-item:first-of-type { border-top-color: #e2e8f0; }
.sp-inline-faq .faq-item__question { color: #1e293b; }
.sp-inline-faq .faq-item__question:hover { color: #0e7490; }
.sp-inline-faq .faq-item__answer p { color: #64748b; }
.sp-inline-faq .faq-item__icon { color: #0e7490; }
