/**
 * StageOn — assets/css/blog.css
 *
 * Stili per: post-card, archivio blog, singolo articolo, ricerca, paginazione.
 * Design: dark theme coerente con brand StageOn.
 *
 * @package StageOn
 * @version 1.0.0
 */

/* ============================================================
   POST CARD (lista blog)
   ============================================================ */

.st-post-card {
    background    : var(--color-bg-2, #111);
    border        : 1px solid var(--color-border, rgba(255,255,255,.12));
    border-radius : 12px;
    overflow      : hidden;
    display       : flex;
    flex-direction: column;
    transition    : border-color .25s, transform .25s;
    text-decoration: none;
    color         : inherit;
}

.st-post-card:hover {
    border-color : rgba(230,48,48,.5);
    transform    : translateY(-4px);
}

.st-post-card__img-wrap {
    position       : relative;
    aspect-ratio   : 16/9;
    overflow       : hidden;
    background     : #0a0a0a;
}

.st-post-card__img {
    width     : 100%;
    height    : 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.st-post-card:hover .st-post-card__img {
    transform: scale(1.04);
}

.st-post-card__img-placeholder {
    width     : 100%;
    height    : 100%;
    display   : flex;
    align-items   : center;
    justify-content: center;
    color     : rgba(255,255,255,.2);
}

.st-post-card__cat {
    position  : absolute;
    top       : 12px;
    left      : 12px;
    background: var(--color-primary, #E63030);
    color     : #fff;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size : .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding   : 3px 10px;
    border-radius: 4px;
}

.st-post-card__body {
    padding      : 20px 22px 22px;
    display      : flex;
    flex-direction: column;
    flex         : 1;
    gap          : 8px;
}

.st-post-card__meta {
    display    : flex;
    align-items: center;
    gap        : 10px;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .75rem;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
}

.st-post-card__meta svg {
    width : 14px;
    height: 14px;
    flex-shrink: 0;
}

.st-post-card__title {
    font-family  : var(--font-heading, 'Bebas Neue', sans-serif);
    font-size    : clamp(1.1rem, 2.2vw, 1.4rem);
    line-height  : 1.15;
    letter-spacing: .02em;
    color        : var(--color-text, #fff);
    margin       : 0;
}

.st-post-card__excerpt {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .875rem;
    line-height: 1.6;
    color      : var(--color-text-muted, rgba(255,255,255,.65));
    margin     : 0;
    flex       : 1;
    display    : -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow   : hidden;
}

.st-post-card__footer {
    display    : flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top : 1px solid var(--color-border, rgba(255,255,255,.1));
    margin-top : auto;
}

.st-post-card__read-more {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .8rem;
    font-weight: 600;
    color      : var(--color-primary, #E63030);
    display    : flex;
    align-items: center;
    gap        : 4px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ============================================================
   BLOG GRID (template-blog.php + sezione homepage)
   ============================================================ */

.st-blog-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap                  : 28px;
}

.st-blog-grid--featured {
    grid-template-columns: 1fr 1fr;
}

.st-blog-grid--featured .st-post-card:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
}

.st-blog-grid--featured .st-post-card:first-child .st-post-card__img-wrap {
    flex-shrink: 0;
    width      : 45%;
    aspect-ratio: auto;
}

@media (max-width: 768px) {
    .st-blog-grid--featured {
        grid-template-columns: 1fr;
    }
    .st-blog-grid--featured .st-post-card:first-child {
        flex-direction: column;
    }
    .st-blog-grid--featured .st-post-card:first-child .st-post-card__img-wrap {
        width       : 100%;
        aspect-ratio: 16/9;
    }
}

/* ============================================================
   FILTRI CATEGORIA BLOG
   ============================================================ */

.st-blog-filters {
    display        : flex;
    flex-wrap      : wrap;
    gap            : 8px;
    margin-bottom  : 36px;
}

.st-blog-filter-btn {
    background    : transparent;
    border        : 1px solid var(--color-border, rgba(255,255,255,.2));
    color         : var(--color-text-muted, rgba(255,255,255,.65));
    font-family   : var(--font-body, 'Outfit', sans-serif);
    font-size     : .8rem;
    font-weight   : 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding       : 7px 18px;
    border-radius : 20px;
    cursor        : pointer;
    transition    : all .2s;
    text-decoration: none;
    display       : inline-block;
}

.st-blog-filter-btn:hover,
.st-blog-filter-btn.is-active {
    background  : var(--color-primary, #E63030);
    border-color: var(--color-primary, #E63030);
    color       : #fff;
}

/* ============================================================
   SINGOLO ARTICOLO
   ============================================================ */

.st-article-wrap {
    max-width: 860px;
    margin   : 0 auto;
    padding  : var(--spacing-3xl, 64px) var(--spacing-xl, 24px);
}

.st-article-hero {
    position     : relative;
    aspect-ratio : 16/7;
    border-radius: 12px;
    overflow     : hidden;
    margin-bottom: 40px;
    background   : #111;
}

.st-article-hero img {
    width     : 100%;
    height    : 100%;
    object-fit: cover;
}

.st-article-header {
    margin-bottom: 32px;
}

.st-article-cats {
    display    : flex;
    flex-wrap  : wrap;
    gap        : 8px;
    margin-bottom: 16px;
}

.st-article-cat-badge {
    font-family   : var(--font-body, 'Outfit', sans-serif);
    font-size     : .75rem;
    font-weight   : 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color         : var(--color-primary, #E63030);
    border        : 1px solid rgba(230,48,48,.4);
    padding       : 3px 10px;
    border-radius : 4px;
    text-decoration: none;
}

.st-article-title {
    font-family  : var(--font-heading, 'Bebas Neue', sans-serif);
    font-size    : clamp(2rem, 5vw, 3.5rem);
    line-height  : 1.05;
    letter-spacing: .02em;
    color        : var(--color-text, #fff);
    margin       : 0 0 16px;
}

.st-article-meta {
    display    : flex;
    align-items: center;
    flex-wrap  : wrap;
    gap        : 16px;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .8rem;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
    padding-bottom: 20px;
    border-bottom : 1px solid var(--color-border, rgba(255,255,255,.12));
    margin-bottom : 32px;
}

.st-article-meta svg {
    width     : 15px;
    height    : 15px;
    flex-shrink: 0;
}

.st-article-meta-item {
    display    : flex;
    align-items: center;
    gap        : 5px;
}

/* ---- Corpo articolo ---- */

.st-article-content {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : 1rem;
    line-height: 1.8;
    color      : rgba(255,255,255,.85);
}

.st-article-content h2,
.st-article-content h3,
.st-article-content h4 {
    font-family  : var(--font-heading, 'Bebas Neue', sans-serif);
    letter-spacing: .02em;
    color        : var(--color-text, #fff);
    margin       : 2em 0 .6em;
}

.st-article-content h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.st-article-content h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

.st-article-content p   { margin: 0 0 1.4em; }
.st-article-content ul,
.st-article-content ol  { padding-left: 1.5em; margin-bottom: 1.4em; }
.st-article-content li  { margin-bottom: .4em; }

.st-article-content a {
    color          : var(--color-primary, #E63030);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.st-article-content a:hover { opacity: .8; }

.st-article-content blockquote {
    margin     : 2em 0;
    padding    : 20px 28px;
    border-left: 4px solid var(--color-primary, #E63030);
    background : rgba(230,48,48,.06);
    border-radius: 0 8px 8px 0;
    font-style : italic;
    font-size  : 1.05em;
    color      : rgba(255,255,255,.9);
}

.st-article-content blockquote p { margin: 0; }

.st-article-content img {
    max-width    : 100%;
    height       : auto;
    border-radius: 8px;
    margin       : 1.5em 0;
}

.st-article-content code {
    background   : rgba(255,255,255,.08);
    padding      : 2px 6px;
    border-radius: 4px;
    font-size    : .9em;
}

.st-article-content pre {
    background   : #1a1a1a;
    border       : 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding      : 20px;
    overflow-x   : auto;
    margin       : 1.5em 0;
}

.st-article-content hr {
    border    : none;
    border-top: 1px solid var(--color-border, rgba(255,255,255,.15));
    margin    : 2.5em 0;
}

/* ---- Tag articolo ---- */

.st-article-tags {
    display  : flex;
    flex-wrap: wrap;
    gap      : 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border, rgba(255,255,255,.12));
}

.st-article-tag {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .75rem;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
    border     : 1px solid var(--color-border, rgba(255,255,255,.15));
    padding    : 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition : all .2s;
}

.st-article-tag:hover {
    color       : #fff;
    border-color: rgba(255,255,255,.35);
}

/* ---- Condivisione articolo ---- */

.st-article-share {
    display    : flex;
    align-items: center;
    gap        : 12px;
    margin-top : 32px;
    flex-wrap  : wrap;
}

.st-article-share__label {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
}

.st-article-share__btn {
    background  : rgba(255,255,255,.08);
    border      : 1px solid var(--color-border, rgba(255,255,255,.15));
    color       : rgba(255,255,255,.8);
    width       : 38px;
    height      : 38px;
    border-radius: 50%;
    display     : flex;
    align-items : center;
    justify-content: center;
    cursor      : pointer;
    transition  : all .2s;
    text-decoration: none;
}

.st-article-share__btn:hover {
    background  : var(--color-primary, #E63030);
    border-color: var(--color-primary, #E63030);
    color       : #fff;
}

/* ---- Articoli correlati ---- */

.st-related-posts {
    margin-top  : 56px;
    padding-top : 40px;
    border-top  : 1px solid var(--color-border, rgba(255,255,255,.12));
}

.st-related-posts__title {
    font-family   : var(--font-heading, 'Bebas Neue', sans-serif);
    font-size     : clamp(1.4rem, 3vw, 2rem);
    letter-spacing: .04em;
    color         : var(--color-text, #fff);
    margin-bottom : 24px;
}

/* ============================================================
   ARCHIVIO / RICERCA
   ============================================================ */

.st-archive-header {
    padding    : calc(var(--nav-height, 72px) + 40px) 0 40px;
    text-align : center;
}

.st-archive-eyebrow {
    font-family   : var(--font-body, 'Outfit', sans-serif);
    font-size     : .8rem;
    font-weight   : 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color         : var(--color-primary, #E63030);
    margin-bottom : 8px;
}

.st-archive-title {
    font-family  : var(--font-heading, 'Bebas Neue', sans-serif);
    font-size    : clamp(2rem, 5vw, 3.5rem);
    letter-spacing: .02em;
    color        : var(--color-text, #fff);
    margin       : 0 0 12px;
}

.st-archive-desc {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .95rem;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
    max-width  : 540px;
    margin     : 0 auto;
}

/* ============================================================
   RICERCA — search.php
   ============================================================ */

.st-search-form {
    display        : flex;
    gap            : 0;
    max-width      : 580px;
    margin         : 0 auto 48px;
    background     : rgba(255,255,255,.06);
    border         : 1px solid var(--color-border, rgba(255,255,255,.2));
    border-radius  : 8px;
    overflow       : hidden;
}

.st-search-input {
    flex       : 1;
    background : transparent;
    border     : none;
    outline    : none;
    padding    : 14px 20px;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : 1rem;
    color      : var(--color-text, #fff);
}

.st-search-input::placeholder { color: rgba(255,255,255,.35); }

.st-search-btn {
    background : var(--color-primary, #E63030);
    border     : none;
    padding    : 0 24px;
    cursor     : pointer;
    color      : #fff;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-weight: 600;
    font-size  : .9rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition : background .2s;
    white-space: nowrap;
}

.st-search-btn:hover { background: var(--color-primary-dark, #C02020); }

.st-search-results-count {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .85rem;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
    margin-bottom: 24px;
}

.st-search-results-count strong { color: var(--color-text, #fff); }

/* ============================================================
   PAGINAZIONE
   ============================================================ */

.st-pagination {
    display        : flex;
    justify-content: center;
    gap            : 8px;
    margin-top     : 48px;
    flex-wrap      : wrap;
}

.st-pagination .page-numbers {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size  : .85rem;
    font-weight: 500;
    width      : 40px;
    height     : 40px;
    display    : flex;
    align-items: center;
    justify-content: center;
    border     : 1px solid var(--color-border, rgba(255,255,255,.15));
    border-radius: 6px;
    color      : rgba(255,255,255,.7);
    text-decoration: none;
    transition : all .2s;
}

.st-pagination .page-numbers:hover,
.st-pagination .page-numbers.current {
    background  : var(--color-primary, #E63030);
    border-color: var(--color-primary, #E63030);
    color       : #fff;
}

.st-pagination .page-numbers.dots {
    background: transparent;
    border    : none;
    color     : rgba(255,255,255,.4);
    cursor    : default;
}

/* ============================================================
   SEZIONE BLOG IN HOMEPAGE
   ============================================================ */

.st-section-blog {
    padding: var(--spacing-section, 80px) 0;
}

.st-section-blog .stageon-section-header {
    margin-bottom: 40px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.st-empty-state {
    text-align : center;
    padding    : 60px 20px;
    color      : var(--color-text-muted, rgba(255,255,255,.6));
}

.st-empty-state__icon { font-size: 3rem; margin-bottom: 12px; }
.st-empty-state__text { font-family: var(--font-heading, 'Bebas Neue', sans-serif); font-size: 1.4rem; color: var(--color-text, #fff); }
.st-empty-state__sub  { font-family: var(--font-body, 'Outfit', sans-serif); font-size: .9rem; margin-top: 8px; }
