/* Stili generali e reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #faf6f5;
    color: #2d3748;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header: Arancione più caldo, elegante e meno acceso */
.site-header {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border-bottom: 4px solid #ba4a00;
    padding: 25px 15px 15px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.15);
}

.header-container .logo {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #000000;
}

.header-container .logo span {
    color: #ffe0b2;
}

.tagline {
    color: #fdebd0;
    font-size: 1rem;
    margin-top: 4px;
    margin-bottom: 18px;
    font-weight: 500;
}

/* Menu Macroaree (Ottimizzato anche per non andare su due righe su mobile) */
.menu-macroaree {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.menu-macroaree a {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.menu-macroaree a:hover, .menu-macroaree a.active {
    background: #ffffff;
    color: #d35400;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* Barra di ricerca responsive */
.search-box {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    background: #ffffff;
    border-radius: 30px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 14px;
    color: #2d3748;
    font-size: 0.95rem;
    outline: none;
    min-width: 0; /* Fondamentale per evitare overflow su flexbox mobile */
}

.search-box input::placeholder {
    color: #a0aec0;
}

.search-box button {
    background: #ba4a00;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-box button:hover {
    background: #a04000;
}

/* Container principale */
.container {
    max-width: 1100px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
}

/* Filtri attivi */
.filter-status {
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #e67e22;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

.filter-status a {
    color: #e67e22;
    text-decoration: underline;
}

/* Post in primo piano (Featured) */
.featured-post {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.featured-post:hover {
    transform: translateY(-3px);
}

.featured-img-container svg, .card-img-container svg {
    width: 100%;
    height: 100%;
    min-height: 240px;
    display: block;
    object-fit: cover;
}

.featured-content {
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.meta {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 12px;
}

.badge {
    background: #e67e22;
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Colori badge per categoria */
.badge-hardware { background: #d35400; }
.badge-gaming { background: #8e44ad; }
.badge-sicurezzareti { background: #c0392b; }
.badge-guide { background: #e67e22; }
.badge-software { background: #27ae60; }

.featured-content h2 a {
    color: #1a202c;
    font-size: 1.8rem;
    line-height: 1.25;
    margin-bottom: 12px;
    display: block;
    transition: color 0.2s;
}

.featured-content h2 a:hover {
    color: #e67e22;
}

.featured-content p {
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 20px;
}

.btn-leggi {
    display: inline-block;
    background: #e67e22;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3);
}

.btn-leggi:hover {
    background: #d35400;
    box-shadow: 0 6px 15px rgba(211, 84, 0, 0.4);
}

/* Griglia post successivi (2 e 3) */
.grid-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.card-post {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.card-post:hover {
    transform: translateY(-3px);
}

.card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.card-body h3 a {
    color: #1a202c;
    font-size: 1.3rem;
    line-height: 1.3;
    margin-bottom: 10px;
    display: block;
}

.card-body h3 a:hover {
    color: #e67e22;
}

.card-body p {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card-link {
    color: #e67e22;
    font-weight: bold;
    font-size: 0.95rem;
}

.card-link:hover {
    text-decoration: underline;
}

/* Sezione Banner AdSense */
.adsense-container {
    background: #ffffff;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 40px 0;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.ads-label {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #edf2f7;
    color: #718096;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Titoli sezioni */
.section-title {
    font-size: 1.5rem;
    color: #1a202c;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* Lista articoli recenti lineari */
.recent-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.linear-post-list {
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform 0.2s, border-color 0.2s;
}

.linear-post-list:hover {
    border-color: #e67e22;
    transform: translateX(3px);
}

.linear-post-list h4 a {
    color: #1a202c;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.linear-post-list h4 a:hover {
    color: #e67e22;
}

.read-link {
    color: #e67e22;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 15px;
}

/* Footer */
.site-footer {
    background: #1a202c;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    padding: 30px 20px;
    color: #a0aec0;
    font-size: 0.9rem;
}

.site-footer strong {
    color: #ffffff;
}

/* Responsive Design per Smartphone / Tablet */
@media (max-width: 768px) {
    .site-header {
        padding: 20px 10px 12px;
    }

    .header-container .logo {
        font-size: 2.1rem;
    }

    /* Rende il menu delle categorie scorrevole in orizzontale su mobile senza sprecare spazio verticale */
    .menu-macroaree {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
        margin-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Nasconde la scrollbar su Firefox */
    }

    .menu-macroaree::-webkit-scrollbar {
        display: none; /* Nasconde la scrollbar su Chrome/Safari */
    }

    .menu-macroaree a {
        padding: 5px 12px;
        font-size: 0.85rem;
    }

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

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

    .featured-content {
        padding: 20px;
    }

    .linear-post-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .read-link {
        margin-left: 0;
    }
}