/*
 * blog.css — Sebastian Hornoi
 * Stile per archive.php (blog)
 * CSS nesting nativo — richiede browser moderno o PostCSS
 * ─────────────────────────────────────────────────────────
 */

/* ══════════════════════════════════════════════
   SHARED UTILITIES usate nel blog
   (se già presenti nel tema, rimuovi questi blocchi)
══════════════════════════════════════════════ */

.label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--fd);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;

    &::before {
        content: '';
        display: inline-block;
        width: 18px;
        height: 2px;
        background: var(--gold);
        flex-shrink: 0;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--fd);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 13px 22px;
    border-radius: var(--r);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;

    &.btn-lg { padding: 16px 28px; font-size: 14px; }

    &.btn-gold {
        background: var(--gold);
        color: var(--dark);
        border-color: var(--gold);
        &:hover { background: var(--gold-lt); border-color: var(--gold-lt); }
    }

    &.btn-ghost-dark {
        background: transparent;
        color: #fff;
        border-color: rgba(255,255,255,.22);
        &:hover { border-color: var(--gold); color: var(--gold); }
    }
}


/* ══════════════════════════════════════════════
   BLOG HERO
══════════════════════════════════════════════ */
.blog-hero {
    background: var(--dark);
    padding-top: 64px; /* altezza navbar */
    overflow: hidden;
    position: relative;

    /* grid texture gold */
    &::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background-image:
                linear-gradient(rgba(232,164,0,.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(232,164,0,.02) 1px, transparent 1px);
        background-size: 52px 52px;
    }

    /* ── inner ── */
    .bh-inner {
        position: relative;
        z-index: 1;
        padding-block: 64px 0;
    }

    /* ── top row: titolo + stats ── */
    .bh-top {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 32px;
        margin-bottom: 52px;
        flex-wrap: wrap;

        .bh-copy {
            .bh-headline {
                font-family: var(--fd);
                font-weight: 900;
                font-size: clamp(46px, 6.5vw, 88px);
                line-height: .88;
                text-transform: uppercase;
                letter-spacing: -.01em;
                color: #fff;

                .ital {
                    font-family: var(--fs);
                    font-style: italic;
                    font-size: .78em;
                    font-weight: 400;
                    text-transform: none;
                    display: block;
                    margin-top: 4px;
                }
            }

            .bh-sub {
                font-size: 17px;
                color: rgba(255,255,255,.44);
                line-height: 1.75;
                max-width: 480px;
                margin-top: 18px;
            }
        }

        .bh-stats {
            display: flex;
            gap: 32px;
            align-items: center;
            padding-bottom: 8px;
            flex-shrink: 0;

            .bs-item {
                text-align: right;

                .bs-n {
                    font-family: var(--fd);
                    font-size: 38px;
                    font-weight: 900;
                    color: var(--gold);
                    line-height: 1;
                }

                .bs-l {
                    font-family: var(--fd);
                    font-size: 10px;
                    font-weight: 700;
                    letter-spacing: .14em;
                    text-transform: uppercase;
                    color: rgba(255,255,255,.28);
                }
            }

            .bs-div {
                width: 1px;
                height: 40px;
                background: rgba(255,255,255,.1);
            }
        }

        @media (max-width: 700px) {
            flex-direction: column;
            align-items: flex-start;
            margin-bottom: 36px;

            .bh-stats { align-self: flex-start; }
        }
    }

    /* ── articolo featured ── */
    .bh-featured {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 0;
        background: var(--dark-3);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: var(--rl) var(--rl) 0 0;
        border-bottom: none;
        overflow: hidden;
        transition: border-color var(--t);
        text-decoration: none;
        color: inherit;

        &:hover {
            border-color: rgba(232,164,0,.2);

            .bf-img img { transform: scale(1.03); }
        }

        .bf-img {
            position: relative;
            overflow: hidden;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                min-height: 400px;
                display: block;
                transition: transform .5s ease;
            }

            &::after {
                content: '';
                position: absolute;
                inset: 0;
                background: linear-gradient(90deg, rgba(11,13,18,.55) 0%, transparent 60%);
            }
        }

        .bf-body {
            padding: 40px 36px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            .bf-top {
                .bf-badges {
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    margin-bottom: 20px;
                    flex-wrap: wrap;
                }

                .bf-badge {
                    display: inline-flex;
                    align-items: center;
                    font-family: var(--fd);
                    font-size: 9px;
                    font-weight: 800;
                    letter-spacing: .18em;
                    text-transform: uppercase;
                    background: var(--gold);
                    color: var(--dark);
                    padding: 5px 10px;
                    border-radius: var(--r);
                }

                .bf-cat {
                    display: inline-flex;
                    align-items: center;
                    font-family: var(--fd);
                    font-size: 9px;
                    font-weight: 800;
                    letter-spacing: .18em;
                    text-transform: uppercase;
                    background: rgba(255,255,255,.07);
                    border: 1px solid rgba(255,255,255,.1);
                    color: rgba(255,255,255,.5);
                    padding: 5px 10px;
                    border-radius: var(--r);
                }

                .bf-title {
                    font-family: var(--fd);
                    font-size: clamp(22px, 2.8vw, 36px);
                    font-weight: 900;
                    text-transform: uppercase;
                    color: #fff;
                    letter-spacing: .02em;
                    line-height: .96;
                    margin-bottom: 14px;
                }

                .bf-exc {
                    font-size: 15px;
                    color: rgba(255,255,255,.45);
                    line-height: 1.75;
                    margin-bottom: 24px;

                    strong { color: rgba(255,255,255,.75); font-weight: 500; }
                }
            }

            .bf-bottom {
                .bf-meta {
                    display: flex;
                    align-items: center;
                    gap: 16px;
                    margin-bottom: 22px;
                    flex-wrap: wrap;
                    font-family: var(--fd);
                    font-size: 11px;
                    font-weight: 700;
                    letter-spacing: .08em;
                    text-transform: uppercase;
                    color: rgba(255,255,255,.28);

                    .bm-dot {
                        width: 3px;
                        height: 3px;
                        border-radius: 50%;
                        background: rgba(255,255,255,.2);
                    }
                }

                .bf-cta {
                    display: inline-flex;
                    align-items: center;
                    gap: 8px;
                    font-family: var(--fd);
                    font-size: 13px;
                    font-weight: 800;
                    letter-spacing: .1em;
                    text-transform: uppercase;
                    color: var(--gold);
                    transition: gap var(--t);

                    &:hover { gap: 14px; }
                }
            }
        }

        @media (max-width: 860px) {
            grid-template-columns: 1fr;

            .bf-img img { min-height: 260px; }
        }
    }
}


/* ══════════════════════════════════════════════
   FILTRI + GRIGLIA
══════════════════════════════════════════════ */
.blog-main {
    background: var(--dark-2);
    padding-bottom: var(--py, 96px);

    /* ── filtri sticky ── */
    .filters-bar {
        position: sticky;
        top: 110px;
        z-index: 50;
        background: var(--dark-2);
        border-bottom: 1px solid rgba(255,255,255,.06);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);

        .filters-inner {
            display: flex;
            align-items: center;
            gap: 8px;
            padding-block: 14px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;

            &::-webkit-scrollbar { display: none; }
        }

        .filter-btn {
            font-family: var(--fd);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: .12em;
            text-transform: uppercase;
            padding: 8px 16px;
            border-radius: 100px;
            border: 1.5px solid rgba(255,255,255,.1);
            background: transparent;
            color: rgba(255,255,255,.4);
            cursor: pointer;
            transition: all var(--t);
            white-space: nowrap;
            text-decoration: none;

            &:hover {
                border-color: rgba(232,164,0,.3);
                color: rgba(255,255,255,.7);
            }

            &.active {
                background: var(--gold);
                border-color: var(--gold);
                color: var(--dark);
            }
        }

        .filters-count {
            margin-left: auto;
            flex-shrink: 0;
            font-family: var(--fd);
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .14em;
            text-transform: uppercase;
            color: rgba(255,255,255,.22);
        }
    }

    /* ── griglia ── */
    .blog-grid {
        padding-top: 48px;

        /* griglia 4 colonne uniforme */
        .posts-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;

            @media (max-width: 1024px) { grid-template-columns: repeat(3, 1fr); }
            @media (max-width: 700px)  { grid-template-columns: repeat(2, 1fr); }
            @media (max-width: 440px)  { grid-template-columns: 1fr; }
        }

        /* ══ ARTICLE CARD — foto sfondo, overlay, glow hover ══ */
        .article-card {
            position: relative;
            height: 450px;
            border-radius: 10px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            text-decoration: none;
            color: inherit;
            cursor: pointer;

            /* ── foto sfondo ── */
            .ac-img {
                position: absolute;
                inset: 0;
                z-index: 0;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    display: block;
                    transition: transform .6s cubic-bezier(.25,.46,.45,.94);
                }
            }

            /* ── gradiente permanente — legge sempre il testo ── */
            &::before {
                content: '';
                position: absolute;
                inset: 0;
                z-index: 1;
                background: linear-gradient(
                        to top,
                        rgba(11,13,18,.97) 0%,
                        rgba(11,13,18,.65) 45%,
                        rgba(11,13,18,.15) 80%,
                        transparent 100%
                );
                transition: opacity var(--t);
            }

            /* ── glow gold: invisibile a riposo ── */
            &::after {
                content: '';
                position: absolute;
                inset: 0;
                z-index: 2;
                background: radial-gradient(
                        ellipse at 50% 110%,
                        rgba(232,164,0,.28) 0%,
                        transparent 65%
                );
                opacity: 0;
                transition: opacity .45s ease;
            }

            /* bordo gold bottom — invisibile a riposo */
            .ac-border {
                position: absolute;
                bottom: 0; left: 0; right: 0;
                height: 2px;
                background: linear-gradient(90deg, var(--gold), var(--gold-lt), var(--gold));
                z-index: 10;
                transform: scaleX(0);
                transform-origin: left;
                transition: transform .4s cubic-bezier(.25,.46,.45,.94);
            }

            /* ── body overlay — sempre in basso ── */
            .ac-body {
                position: relative;
                z-index: 5;
                padding: 24px 22px 22px;
                display: flex;
                flex-direction: column;
                gap: 8px;

                .ac-meta {
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    flex-wrap: wrap;

                    .ac-cat {
                        font-family: var(--fd);
                        font-size: 9px;
                        font-weight: 800;
                        letter-spacing: .16em;
                        text-transform: uppercase;
                        color: var(--dark);
                        background: var(--gold);
                        padding: 3px 9px;
                        border-radius: var(--r);
                    }

                    .ac-date {
                        font-family: var(--fd);
                        font-size: 10px;
                        font-weight: 700;
                        letter-spacing: .1em;
                        text-transform: uppercase;
                        color: rgba(255,255,255,.45);
                    }

                    .ac-read {
                        font-family: var(--fd);
                        font-size: 10px;
                        font-weight: 700;
                        letter-spacing: .1em;
                        text-transform: uppercase;
                        color: rgba(255,255,255,.32);
                        margin-left: auto;
                    }
                }

                .ac-title {
                    font-family: var(--fd);
                    font-size: clamp(17px, 2vw, 22px);
                    font-weight: 900;
                    text-transform: uppercase;
                    letter-spacing: .02em;
                    color: #fff;
                    line-height: 1.0;
                    transition: color .3s ease;
                }

                /* excerpt: nascosto a riposo, visibile all'hover */
                .ac-exc {
                    font-size: 13px;
                    color: rgba(255,255,255,.7);
                    line-height: 1.6;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    max-height: 0;
                    opacity: 0;
                    transform: translateY(6px);
                    transition:
                            max-height .4s ease,
                            opacity .35s ease,
                            transform .35s ease;
                }

                .ac-arrow {
                    font-family: var(--fd);
                    font-size: 11px;
                    font-weight: 800;
                    letter-spacing: .1em;
                    text-transform: uppercase;
                    color: var(--gold);
                    display: flex;
                    align-items: center;
                    gap: 6px;
                    opacity: 0;
                    transform: translateY(4px);
                    transition: opacity .3s ease .05s, transform .3s ease .05s, gap .2s ease;
                }
            }

            /* ══ HOVER ══ */
            &:hover {
                /* zoom foto */
                .ac-img img { transform: scale(1.07); }

                /* glow */
                &::after { opacity: 1; }

                /* bordo animato */
                .ac-border { transform: scaleX(1); }

                /* titolo diventa gold */
                .ac-title { color: var(--gold-lt); }

                /* excerpt appare */
                .ac-body .ac-exc {
                    max-height: 60px;
                    opacity: 1;
                    transform: translateY(0);
                }

                /* freccia appare */
                .ac-body .ac-arrow {
                    opacity: 1;
                    transform: translateY(0);
                    gap: 10px;
                }
            }
        }
    }

    /* ── paginazione ── */
    .pagination-wrap {
        margin-top: 56px;
        text-align: center;

        .nav-links {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;

            a,
            span {
                font-family: var(--fd);
                font-size: 13px;
                font-weight: 700;
                letter-spacing: .08em;
                text-transform: uppercase;
                padding: 10px 16px;
                border-radius: var(--r);
                border: 1.5px solid rgba(255,255,255,.1);
                color: rgba(255,255,255,.4);
                transition: all var(--t);
                text-decoration: none;
            }

            a:hover {
                border-color: rgba(232,164,0,.3);
                color: rgba(255,255,255,.8);
            }

            .current {
                background: var(--gold);
                border-color: var(--gold);
                color: var(--dark);
            }

            .prev, .next {
                gap: 6px;
                display: flex;
                align-items: center;
            }
        }
    }

    /* ── nessun post ── */
    .no-posts {
        padding: 64px 0;
        text-align: center;

        p {
            font-size: 17px;
            color: rgba(255,255,255,.42);
            margin-bottom: 24px;
        }
    }
}



/* ══════════════════════════════════════════════
   CTA FINALE
══════════════════════════════════════════════ */
.blog-cta {
    background: var(--dark-2);
    padding-block: var(--py, 96px);
    border-top: 1px solid rgba(255,255,255,.06);
    position: relative;
    overflow: hidden;
    text-align: center;

    /* glow ambientale */
    &::before {
        content: '';
        position: absolute;
        top: -200px;
        left: 50%;
        transform: translateX(-50%);
        width: 900px;
        height: 900px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(232,164,0,.05) 0%, transparent 65%);
        pointer-events: none;
    }

    .bc-inner {
        position: relative;
        z-index: 1;
        max-width: 640px;
        margin: 0 auto;
    }

    .bc-over {
        font-family: var(--fd);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .22em;
        text-transform: uppercase;
        color: var(--gold);
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;

        &::before, &::after { content: '—'; opacity: .4; }
    }

    .bc-hl {
        font-family: var(--fd);
        font-weight: 900;
        font-size: clamp(36px, 5vw, 64px);
        line-height: .9;
        text-transform: uppercase;
        color: #fff;
        margin-bottom: 20px;

        .ital {
            color: var(--gold);
            display: block;
            font-family: var(--fs);
            font-style: italic;
            font-size: .78em;
            font-weight: 400;
            text-transform: none;
            margin-top: 6px;
        }
    }

    .bc-desc {
        font-size: 16px;
        color: rgba(255,255,255,.44);
        line-height: 1.78;
        margin-bottom: 32px;

        strong { color: rgba(255,255,255,.75); font-weight: 500; }
    }

    .bc-btns {
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .bc-proof {
        display: flex;
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 18px;

        span {
            font-family: var(--fd);
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .12em;
            text-transform: uppercase;
            color: rgba(255,255,255,.2);
        }
    }
}