/* ====== BLOG/NEWS FITNESSMANIA ====== */
/* Stile allineato al sito: Bungee, League Spartan, #DC143C, bordi marcati */

@font-face {
    font-family: 'Bungee';
    src: url('../../../fonts/Bungee/Bungee-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'League Spartan';
    src: url('../../../fonts/League_Spartan/LeagueSpartan-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-red: #DC143C;
    --color-gray: #F5F5F5;
    --color-gray-dark: #333333;
    --font-primary: 'Bungee', sans-serif;
    --font-secondary: 'League Spartan', sans-serif;
    --border-thick: 4px;
    --border-medium: 3px;
    --transition-normal: 0.3s ease;
    --text-xs: 1rem;
    --text-sm: 1.0625rem;
    --text-base: 1.25rem;
    --text-md: 1.35rem;
    --text-lg: 1.5rem;
    --text-xl: 1.6rem;
}

/* Contenuto blog (header/footer sono del layout principale) */
.main-content .container,
.main-content .box-interno {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== SEZIONE INTRO / TITOLO BLOG ===== */
.intro-sezione .section-title,
.titolo-pagina {
    font-family: var(--font-primary);
    font-size: clamp(2.35rem, 4vw, 3.4rem);
    color: var(--color-black);
    margin-bottom: 0.5rem;
}

/* ===== FILTRO CATEGORIE ===== */
.categories-filter {
    background: var(--color-white);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: var(--border-medium) solid var(--color-black);
    box-shadow: 6px 6px 0 var(--color-black);
}

.categories-filter h2 {
    font-family: var(--font-primary);
    font-size: clamp(1.35rem, 2.5vw, 1.6rem);
    color: var(--color-black);
    margin-bottom: 1rem;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    border: 2px solid var(--color-black);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font-secondary);
    transition: var(--transition-normal);
}

.category-tag:hover {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-black);
}

.category-tag.active {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}

.category-filter-desc {
    margin: 1rem 0 0;
    max-width: 42rem;
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--color-black);
    opacity: 0.85;
}

/* ===== GRIGLIA ARTICOLI ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.post-card {
    background: var(--color-white);
    border: var(--border-medium) solid var(--color-black);
    box-shadow: 6px 6px 0 var(--color-black);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.post-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--color-black);
    border-color: var(--color-red);
}

.post-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.post-card:hover .post-image img {
    transform: scale(1.03);
}

.post-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--color-red);
    color: var(--color-white);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    align-self: flex-start;
    border: 2px solid var(--color-black);
    font-family: var(--font-secondary);
}

.post-content h2 {
    font-family: var(--font-primary);
    margin-bottom: 0.75rem;
    font-size: clamp(1.35rem, 2.5vw, 1.6rem);
    color: var(--color-black);
    line-height: 1.25;
}

.post-content h2 a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-normal);
}

.post-content h2 a:hover {
    color: var(--color-red);
}

.post-meta {
    color: var(--color-gray-dark);
    font-size: var(--text-sm);
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.post-excerpt {
    color: var(--color-gray-dark);
    margin-bottom: 1rem;
    line-height: 1.6;
    flex-grow: 1;
    font-size: var(--text-base);
}

.read-more {
    color: var(--color-red);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-secondary);
    align-self: flex-start;
    border-bottom: 2px solid var(--color-red);
    padding-bottom: 2px;
    transition: var(--transition-normal);
}

.read-more:hover {
    color: var(--color-black);
    border-bottom-color: var(--color-black);
}

.no-posts {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-gray-dark);
    font-size: var(--text-md);
    grid-column: 1 / -1;
}

.no-posts p {
    margin: 0;
}

/* ===== SINGOLO ARTICOLO ===== */
.single-post {
    background: var(--color-white);
    padding: 2.5rem 2.5rem;
    margin-bottom: 2rem;
    border: var(--border-medium) solid var(--color-black);
    box-shadow: 6px 6px 0 var(--color-black);
}

.post-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--color-black);
}

.post-header h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.1rem, 4vw, 2.85rem);
    color: var(--color-black);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-featured-image {
    margin-bottom: 1.5rem;
    border: var(--border-medium) solid var(--color-black);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-body {
    font-size: var(--text-md);
    line-height: 1.75;
    color: var(--color-black);
    margin-bottom: 2rem;
    font-family: var(--font-secondary);
}

.post-body p {
    margin-bottom: 1.25rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--color-black);
    margin: 1.5rem 0;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    font-family: var(--font-primary);
    color: var(--color-black);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-body a {
    color: var(--color-red);
    font-weight: 600;
    text-decoration: underline;
}

.post-body a:hover {
    color: var(--color-black);
}

/* Galleria nel post */
.post-gallery {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-black);
}

.post-gallery h2 {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    color: var(--color-black);
    margin-bottom: 1.25rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    border: 2px solid var(--color-black);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
}

.gallery-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-black);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-black);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: var(--border-medium) solid var(--color-red);
    background: var(--color-red);
    color: var(--color-white);
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
}

.btn:hover {
    background: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-black);
}

.btn-secondary {
    background: transparent;
    color: var(--color-black);
    border-color: var(--color-black);
}

.btn-secondary:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* ===== PAGINAZIONE ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-info {
    color: var(--color-gray-dark);
    font-size: var(--text-sm);
}

.pagination-btn {
    padding: 0.6rem 1.25rem;
    background: var(--color-white);
    color: var(--color-red);
    text-decoration: none;
    border: 2px solid var(--color-red);
    font-weight: 600;
    font-family: var(--font-secondary);
    transition: var(--transition-normal);
}

.pagination-btn:hover {
    background: var(--color-red);
    color: var(--color-white);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--color-black);
}

/* ===== LIGHTBOX GALLERY ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border: var(--border-medium) solid var(--color-white);
}

.lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: var(--color-white);
    border: 2px solid var(--color-black);
    width: 44px;
    height: 44px;
    font-size: var(--text-xl);
    cursor: pointer;
    color: var(--color-black);
    transition: var(--transition-normal);
}

.lightbox-close:hover {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}

/* ===== DARK THEME: News & Blog + Catalogo ===== */
[data-theme="dark"] .main-content .posts-grid .post-card,
[data-theme="dark"] .main-content .product-card {
    background: #3a3a3a;
    border-color: #fff;
}

[data-theme="dark"] .main-content .post-content h2,
[data-theme="dark"] .main-content .post-content h2 a,
[data-theme="dark"] .main-content .product-card h2 {
    color: #fff;
}

[data-theme="dark"] .main-content .post-excerpt,
[data-theme="dark"] .main-content .post-meta,
[data-theme="dark"] .main-content .product-card .product-desc,
[data-theme="dark"] .main-content .no-posts,
[data-theme="dark"] .main-content .pagination-info {
    color: #E0E0E0;
}

[data-theme="dark"] .main-content .read-more {
    color: #FF6B81;
    border-bottom-color: #FF6B81;
}

[data-theme="dark"] .main-content .read-more:hover {
    color: #fff;
    border-bottom-color: #fff;
}

[data-theme="dark"] .main-content .post-content h2 a:hover {
    color: #FF6B81;
}

[data-theme="dark"] .main-content .categories-filter {
    background: #3a3a3a;
    border-color: #fff;
}

[data-theme="dark"] .main-content .categories-filter h2 {
    color: #fff;
}

[data-theme="dark"] .main-content .category-filter-desc {
    color: #fff;
    opacity: 0.8;
}

[data-theme="dark"] .main-content .category-tag {
    background: #3a3a3a;
    color: #fff;
    border-color: #fff;
}

[data-theme="dark"] .main-content .category-tag:hover,
[data-theme="dark"] .main-content .category-tag.active {
    background: var(--color-red);
    color: #fff;
    border-color: var(--color-red);
}

[data-theme="dark"] .main-content .post-category {
    border-color: #fff;
}

[data-theme="dark"] .main-content .single-post {
    background: #3a3a3a;
    border-color: #fff;
}

[data-theme="dark"] .main-content .single-post .post-header h1,
[data-theme="dark"] .main-content .single-post .post-body,
[data-theme="dark"] .main-content .single-post .post-body p,
[data-theme="dark"] .main-content .single-post .post-body h2,
[data-theme="dark"] .main-content .single-post .post-body h3,
[data-theme="dark"] .main-content .single-post .post-body h4 {
    color: #fff;
}

[data-theme="dark"] .main-content .single-post .post-header {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .main-content .single-post .post-gallery {
    border-top-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .main-content .single-post .post-gallery h2 {
    color: #fff;
}

[data-theme="dark"] .main-content .single-post .post-footer {
    border-top-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .main-content .single-post .post-body a {
    color: #FF6B81;
}

[data-theme="dark"] .main-content .single-post .post-body a:hover {
    color: #fff;
}

[data-theme="dark"] .main-content .pagination-btn {
    background: #3a3a3a;
    color: #FF6B81;
    border-color: #FF6B81;
}

[data-theme="dark"] .main-content .pagination-btn:hover {
    background: var(--color-red);
    color: #fff;
}

/* Dark: catalogo filtri e card */
[data-theme="dark"] .main-content .product-card .product-category {
    color: #FF6B81;
}

[data-theme="dark"] .main-content .product-card .product-link {
    color: #FF6B81;
    border-color: #FF6B81;
}

[data-theme="dark"] .main-content .product-card .product-link:hover {
    background: var(--color-red);
    color: #fff;
    border-color: var(--color-red);
}

[data-theme="dark"] .main-content .catalogo-filters select {
    background: #3a3a3a;
    color: #fff;
    border-color: #fff;
}

[data-theme="dark"] .main-content .catalogo-filters label {
    color: #E0E0E0;
}

[data-theme="dark"] .main-content .product-card .product-placeholder {
    background: #2a2a2a;
    color: #aaa;
}

[data-theme="dark"] .main-content .badge-promo {
    border-color: #fff;
}

/* Dark: Google promo section */
[data-theme="dark"] .google-promo-section {
    border-color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content .container,
    .main-content .box-interno {
        padding: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .single-post {
        padding: 1.5rem;
    }

    .post-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
    }

    .post-body {
        font-size: var(--text-base);
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
