/* ==========================================================
   HERO BLOG
========================================================== */

.blog-hero {
    position: relative;
    overflow: hidden;
}

.blog-hero-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
}

.blog-hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-title {
    font-size: 60px;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}


/* ==========================================================
   BLOG LAYOUT
========================================================== */

.blog-layout {
    margin: 70px auto;
}

.blog-main {
    width: 100%;
}


/* ==========================================================
   BLOG FILTER – PREMIUM TOOLBAR
========================================================== */
body.admin-bar .blog-filter{
    top: 110px;
}

.blog-filter {
    margin-bottom: 70px;
    position: sticky;
    top: 80px;
    z-index: 50;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    backdrop-filter: blur(6px);
}
/* Quando si attacca in alto */
.blog-filter:has(.filter-categories ul) {
    border-radius: 0;
}

/* Toggle button (mobile only) */
.filter-toggle {
    display: none;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #ff8c00, #ffb347);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.filter-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.35);
}

/* Categories wrapper */
.filter-categories ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    padding: 14px 18px;
    margin: 0;
    list-style: none;

    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04);
}

/* Pills */
.filter-categories li a {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 999px;

    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);

    font-size: 14px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    white-space: nowrap;

    transition: all 0.25s ease;
}

/* Hover */
.filter-categories li a:hover {
    background: #fff7f0;
    color: #ff8c00;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

/* Active */
.filter-categories li.current-cat a {
    background: linear-gradient(135deg, #ff8c00, #ffb347);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 26px rgba(255, 140, 0, 0.35);
    font-weight: 600;
}


/* ==========================================================
   POSTS GRID
========================================================== */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
}

@media (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==========================================================
   POST CARD
========================================================== */

.post-card {
    position: relative;
    height: 420px;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 15px 35px rgba(0, 0,  0, 0.07);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.14);
}

/* Link wrapper */
.post-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Force white text inside */
.post-card-link a,
.post-card-link span {
    color: #fff;
}


/* ==========================================================
   CARD IMAGE
========================================================== */

.post-card-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.08);
}


/* ==========================================================
   OVERLAY
========================================================== */

.post-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.15) 30%,
            rgba(0, 0, 0, 0.85) 100%
    );
    opacity: 0.9;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.post-card:hover .post-card-overlay {
    opacity: 1;
}


/* ==========================================================
   CARD BODY
========================================================== */

.post-card-body {
    position: absolute;
    inset: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 2;
}

.post-card-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.post-card-title {
    font-size: 22px;
    line-height: 1.3;
    margin: 6px 0 0;
    color: #fff;
}


/* ==========================================================
   EXCERPT + PREMIUM GLOW
========================================================== */

.post-card-excerpt {
    position: relative;
}

.post-card-excerpt p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;

    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.post-card:hover .post-card-excerpt p {
    opacity: 1;
    transform: translateY(0);
}

/* Glow underline */
.post-card-excerpt::after {
    content: "";
    display: block;
    width: 0%;
    height: 4px;
    margin-top: 10px;
    border-radius: 4px;

    background: linear-gradient(
            90deg,
            rgba(255, 140, 0, 0),
            rgba(255, 140, 0, 0.9),
            rgba(255, 140, 0, 0)
    );

    opacity: 0;
    transform: translateY(6px);
    transition: all 0.45s ease;
}

.post-card:hover .post-card-excerpt::after {
    width: 100%;
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================
   PAGINATION
========================================================== */

.navigation.pagination {
    margin-top: 60px;
    text-align: center;
}


/* ==========================================================
   RESPONSIVE – MOBILE
========================================================== */

@media (max-width: 900px) {

    /* Hero */
    .blog-title {
        font-size: 38px;
        text-align: center;
        padding: 0 20px;
    }

    /* Grid */
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card {
        height: 360px;
    }

    /* Filter toggle */
    .filter-toggle {
        display: inline-block;
        margin-bottom: 14px;
    }

    /* Hide categories until open */
    .filter-categories {
        display: none;
    }

    .blog-filter.is-open .filter-categories {
        display: block;
    }

    /* Scrollable pills */
    .filter-categories ul {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding: 12px 14px;
        scrollbar-width: none;
    }

    .filter-categories ul::-webkit-scrollbar {
        display: none;
    }

    /* Smaller pills */
    .filter-categories li a {
        font-size: 13px;
        padding: 8px 16px;
    }

    /* Excerpt always visible */
    .post-card-excerpt p,
    .post-card-excerpt::after {
        opacity: 1;
        transform: translateY(0);
        width: 100%;
    }
}
