/* ============================================================
   style-article.css — Stili articoli blog lb-cons.eu
   Carica in root. Deve essere linkato DOPO style_min.css.
   ============================================================ */

/* ── LAYOUT CONTAINER ──────────────────────────────────────── */
.article-container {
    width: 100%; /* fix iOS Safari: non affidarsi allo stretch automatico del flex item */
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 24px 80px 24px;
    overflow-x: hidden;
    box-sizing: border-box;
    min-width: 0; /* fix: previene overflow su iOS/WebKit quando body è flex (min-width:auto di default sui figli flex blocca lo shrink al contenuto) */
}

/* ── HEADER ARTICOLO ───────────────────────────────────────── */
.article-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--md-sys-color-surface-3);
    padding-bottom: 40px;
}

.blog-date {
    font-size: 0.8rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--md-sys-color-outline);
    margin-top: 16px;
}

/* ── CONTENUTO ─────────────────────────────────────────────── */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--md-sys-color-on-background);
}

.article-content p {
    margin-bottom: 24px;
    text-align: left;
}

.article-content h2 {
    color: var(--md-sys-color-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.article-content h3 {
    color: var(--md-sys-color-primary);
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: 1.3rem;
}

.article-content ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 24px;
    color: var(--md-sys-color-outline);
}

.article-content ol {
    padding-left: 20px;
    margin-bottom: 24px;
    color: var(--md-sys-color-outline);
}

.article-content li {
    margin-bottom: 10px;
}

.article-content strong {
    color: var(--md-sys-color-on-surface);
}

.article-content code {
    font-family: 'Courier New', Courier, monospace;
    background: var(--md-sys-color-surface-variant);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ── BLOCCHI CODICE ────────────────────────────────────────── */
.article-container pre {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    background: var(--md-sys-color-surface-variant);
    padding: 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.article-container pre code {
    white-space: pre;
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* ── TABELLE ───────────────────────────────────────────────── */
.article-container table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── SHARE BUTTONS ─────────────────────────────────────────── */
.share-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px auto;
    padding: 16px 24px;
    background: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 50px;
    width: fit-content;
    transition: 0.3s ease;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--md-sys-color-outline);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--md-sys-color-on-background);
    background: rgb(255 255 255 / 0.05);
    border: 1px solid rgb(255 255 255 / 0.1);
    transition: all 0.3s cubic-bezier(.175, .885, .32, 1.275);
    text-decoration: none;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-btn:hover {
    transform: translateY(-5px) scale(1.1);
}

.share-btn.whatsapp:hover  { background-color: #25D366; color: #fff; box-shadow: 0 5px 15px rgb(37 211 102 / .4); }
.share-btn.telegram:hover  { background-color: #24A1DE; color: #fff; box-shadow: 0 5px 15px rgb(36 161 222 / .4); }
.share-btn.linkedin:hover  { background-color: #0077B5; color: #fff; box-shadow: 0 5px 15px rgb(0 119 181 / .4); }
.share-btn.twitter:hover   { background-color: #000;    color: #fff; }
.share-btn.facebook:hover  { background-color: #1877F2; color: #fff; box-shadow: 0 5px 15px rgb(24 119 242 / .4); }
.share-btn.threads:hover   { background-color: #000;    color: #fff; }
.share-btn.email:hover     { background-color: #777;    color: #fff; box-shadow: 0 5px 15px rgb(119 119 119 / .4); }

[data-theme="light"] .share-btn {
    background: #fff;
    border-color: #E0E0E0;
    color: #444;
}
[data-theme="light"] .share-btn.twitter:hover  { background-color: #fff; color: #000; box-shadow: 0 5px 15px rgb(255 255 255 / .4); }
[data-theme="light"] .share-btn.threads:hover  { background-color: #fff; color: #000; box-shadow: 0 5px 15px rgb(255 255 255 / .4); }
[data-theme="light"] .share-container { background: #F0EBFF; border-color: #E0D4FF; }

/* ── AUTHOR BOX ────────────────────────────────────────────── */
.author-box {
    background: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    padding: 32px;
    margin-top: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── ANIMAZIONE SCROLL ─────────────────────────────────────── */
/* NON ridefinire qui .fade-in-on-scroll: l'animazione è già gestita
   in modo sicuro da style_min.css tramite "body.js-fade-in .fade-in-on-scroll"
   + la sua controparte ".visible". Una regola non-scoped come
   ".fade-in-on-scroll { opacity: 0; }" qui vince per specificità/ordine
   e nasconde il contenuto per sempre se manca ".visible" corrispondente. */

/* ── CALLOUT / NOTE BOX ────────────────────────────────────── */
.callout-box {
    font-size: 0.9rem;
    background: var(--md-sys-color-surface-variant);
    border-left: 3px solid var(--md-sys-color-primary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

/* ── RESPONSIVE MOBILE ─────────────────────────────────────── */
@media (max-width: 768px) {

    .article-container {
        padding: 100px 16px 60px 16px;
    }

    .article-header h1 {
        font-size: 1.75rem;
        line-height: 1.25;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-content h2 { font-size: 1.35rem; }
    .article-content h3 { font-size: 1.1rem; }

    .article-container pre {
        font-size: 0.75rem;
        padding: 12px;
    }

    .share-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        border-radius: 24px;
        padding: 20px 10px;
        gap: 12px;
        margin-left: 0;
        margin-right: 0;
    }

    .share-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .share-btn { width: 38px; height: 38px; }

    .author-box {
        flex-direction: column;
        padding: 24px 16px;
        text-align: center;
    }

    .author-box .btn {
        width: 100%;
        justify-content: center;
    }
}