/* ===== RESET E VARIABILI ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bordeaux: #800020;
    --blu-notte: #1a1a2e;
    --blu-chiaro: #16213e;
    --oro: #c9a84c;
    --bianco: #ffffff;
    --grigio-chiaro: #f4f4f4;
    --grigio-testo: #555;
    --font-principale: 'Poppins', sans-serif;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-principale);
    background-color: var(--grigio-chiaro);
    color: #333;
    line-height: 1.6;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
header {
    background: var(--blu-notte);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--bianco);
    letter-spacing: -1px;
}

.logo span {
    color: var(--oro);
}

.logo i {
    color: var(--oro);
    margin-right: 8px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    color: var(--bianco);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

nav ul li a:hover {
    color: var(--oro);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--oro);
    transition: var(--transition);
}

nav ul li a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-actions .search-btn {
    color: var(--bianco);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.header-actions .search-btn:hover {
    color: var(--oro);
}

/* ===== HERO / ARTICOLO PRINCIPALE ===== */
.hero {
    margin: 30px 0 40px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--blu-notte);
    box-shadow: var(--shadow-card);
}

.hero-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    opacity: 0.7;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 40px;
    background: linear-gradient(transparent, rgba(26, 26, 46, 0.9));
    width: 100%;
}

.hero-content .badge {
    background: var(--bordeaux);
    color: var(--bianco);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.hero-content h1 {
    font-size: 38px;
    font-weight: 800;
    color: var(--bianco);
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-content p {
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    max-width: 600px;
}

.hero-content .meta {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-top: 10px;
}

/* ===== GRIGLIA ARTICOLI ===== */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--blu-notte);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--bordeaux);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.article-card {
    background: var(--bianco);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card .card-content {
    padding: 20px;
}

.article-card .badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.badge-gossip { background: #e74c3c; color: #fff; }
.badge-social { background: #3498db; color: #fff; }
.badge-influencer { background: #9b59b6; color: #fff; }
.badge-tendenze { background: #f39c12; color: #fff; }

.article-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--blu-notte);
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-card h3 a:hover {
    color: var(--bordeaux);
}

.article-card p {
    color: var(--grigio-testo);
    font-size: 14px;
    margin-bottom: 12px;
}

.article-card .meta {
    font-size: 13px;
    color: #999;
}

/* ===== LAYOUT PRINCIPALE (Homepage) ===== */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: var(--bianco);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-card);
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--blu-notte);
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--bordeaux);
}

.sidebar-article {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.sidebar-article:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-article img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar-article .info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--blu-notte);
    line-height: 1.3;
}

.sidebar-article .info h4 a:hover {
    color: var(--bordeaux);
}

.sidebar-article .info .meta {
    font-size: 12px;
    color: #999;
}

/* ===== NEWSLETTER ===== */
.newsletter-widget {
    text-align: center;
    background: var(--blu-notte);
    color: var(--bianco);
    padding: 30px 20px;
    border-radius: 12px;
}

.newsletter-widget h3 {
    color: var(--bianco);
    font-size: 20px;
}

.newsletter-widget h3::after {
    background: var(--oro);
}

.newsletter-widget p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 18px;
}

.newsletter-widget input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: var(--font-principale);
}

.newsletter-widget button {
    background: var(--bordeaux);
    color: var(--bianco);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-principale);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.newsletter-widget button:hover {
    background: var(--oro);
    color: var(--blu-notte);
}

/* ===== FOOTER ===== */
footer {
    background: var(--blu-notte);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 30px;
    margin-top: 40px;
}

footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

footer h4 {
    color: var(--bianco);
    font-size: 18px;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 10px;
}

footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--oro);
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 10px;
}

footer ul li a:hover {
    color: var(--oro);
}

footer .social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

footer .social-icons a {
    background: rgba(255,255,255,0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bianco);
    transition: var(--transition);
}

footer .social-icons a:hover {
    background: var(--oro);
    color: var(--blu-notte);
    transform: translateY(-3px);
}

footer .copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
    text-align: center;
    font-size: 14px;
}

/* ===== MENU HAMBURGER (mobile) ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--bianco);
    border-radius: 3px;
    transition: var(--transition);
}

/* Firebase Auth */
#user-container {
    display: flex;
    align-items: center;
}

#login-button {
    background-color: var(--bordeaux);
    color: var(--bianco);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

#login-button:hover {
    background-color: var(--oro);
    color: var(--blu-notte);
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--oro);
}

#user-name {
    color: var(--bianco);
    font-weight: 600;
}

#logout-button {
    background: transparent;
    border: none;
    color: var(--bianco);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

#logout-button:hover {
    color: var(--oro);
}

/* ============================================================
   PULSANTI CONDIVISIONE NELLA GRIGLIA
   ============================================================ */

.share-buttons-grid {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.share-btn-grid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    background: #e0e0e0;
}

.share-btn-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.share-btn-grid.fb {
    background: #1877f2;
}

.share-btn-grid.tw {
    background: #000000;
}

.share-btn-grid.wa {
    background: #25d366;
}

.share-btn-grid.copy {
    background: var(--blu-notte);
}

.share-btn-grid.copy:hover {
    background: var(--bordeaux);
}

/* ============================================================
   CONDIVISIONE COMPATTA NELLA PAGINA ARTICOLO
   ============================================================ */

.article-container .meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: #888;
    font-size: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.article-container .share-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.article-container .share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.article-container .share-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.article-container .share-icon.fb { background: #1877f2; }
.article-container .share-icon.tw { background: #000000; }
.article-container .share-icon.wa { background: #25d366; }
.article-container .share-icon.copy { background: var(--blu-notte); }
.article-container .share-icon.copy:hover { background: var(--bordeaux); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet e schermi medi */
@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
    }
}

/* Smartphone */
@media (max-width: 768px) {
    /* HEADER */
    .header-actions {
        gap: 10px;
    }
    
    .header-actions .search-btn {
        font-size: 16px;
    }
    
    .btn-login-header {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    #user-profile img {
        width: 28px;
        height: 28px;
    }
    
    #userName {
        font-size: 12px;
    }
    
    /* LOGO */
    .logo {
        font-size: 20px;
    }
    
    .logo i {
        font-size: 18px;
    }
    
    /* MENU NAV */
    nav ul {
        display: none;
        flex-direction: column;
        background: var(--blu-notte);
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        gap: 15px;
        z-index: 999;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        display: block;
        padding: 8px 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    /* HERO */
    .hero {
        margin: 15px 0 25px;
        border-radius: 12px;
    }
    
    .hero-image {
        height: 200px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .hero-content h1 {
        font-size: 20px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .hero-content .badge {
        font-size: 10px;
        padding: 4px 12px;
    }
    
    .hero-content .meta {
        font-size: 12px;
    }
    
    /* GRIGLIA ARTICOLI */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-card .card-content {
        padding: 15px;
    }
    
    .article-card h3 {
        font-size: 16px;
    }
    
    .article-card p {
        font-size: 13px;
    }
    
    .article-card .meta {
        font-size: 12px;
    }
    
    /* SIDEBAR */
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-widget {
        padding: 20px;
    }
    
    .sidebar-article img {
        width: 60px;
        height: 60px;
    }
    
    .sidebar-article .info h4 {
        font-size: 13px;
    }
    
    /* NEWSLETTER */
    .newsletter-widget {
        padding: 20px;
    }
    
    .newsletter-widget h3 {
        font-size: 18px;
    }
    
    .newsletter-widget input {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .newsletter-widget button {
        font-size: 14px;
        padding: 10px;
    }
    
    /* FOOTER */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .footer-grid h4 {
        font-size: 16px;
    }
    
    .footer-grid p {
        font-size: 13px;
    }
    
    .social-icons a {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* ARTICOLO SINGOLO (overrides) */
    .article-container {
        padding: 0 15px;
    }
    
    .article-container h1 {
        font-size: 24px;
    }
    
    .article-container .meta {
        font-size: 13px;
        gap: 12px;
    }
    
    .article-container .content {
        font-size: 15px;
    }
    
    .article-container .featured-image {
        max-height: 250px;
    }
    
    .article-container .share-meta {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 6px;
    }
    
    /* ARTICOLI CORRELATI */
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* CATEGORIA */
    .category-header h1 {
        font-size: 24px;
    }
    
    .articles-grid-category {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* ADMIN */
    .admin-container {
        padding: 0 15px;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .admin-header h1 {
        font-size: 22px;
    }
    
    .admin-form {
        padding: 20px;
    }
    
    .admin-form .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .admin-form input,
    .admin-form textarea,
    .admin-form select {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .btn-publish {
        font-size: 16px;
        padding: 12px;
    }
    
    .edit-form-container {
        padding: 20px;
    }
    
    .edit-form-container .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* PULSANTI MODIFICA/ELIMINA */
    #articlesList > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    #articlesList > div > div:last-child {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    #articlesList > div > div:last-child button {
        flex: 1;
    }
}

/* Smartphone piccoli */
@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }
    
    .hero-content h1 {
        font-size: 18px;
    }
    
    .hero-image {
        height: 160px;
    }
    
    .hero-content {
        padding: 15px;
    }
    
    .hero-content .badge {
        font-size: 9px;
        padding: 3px 10px;
    }
    
    .hero-content p {
        font-size: 13px;
    }
    
    .articles-grid {
        gap: 15px;
    }
    
    .article-card .card-content {
        padding: 12px;
    }
    
    .article-card h3 {
        font-size: 15px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .article-container h1 {
        font-size: 20px;
    }
    
    .article-container .meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .admin-form {
        padding: 15px;
    }
}
/* ===== MENU HAMBURGER (mobile) ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--bianco);
    border-radius: 3px;
    transition: var(--transition);
}

/* Su mobile, mostra l'hamburger e nasconde il menu */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    nav ul {
        display: none !important; /* nasconde il menu di default */
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--blu-notte);
        padding: 20px;
        gap: 15px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        z-index: 999;
    }
    
    /* Quando il menu ha la classe .show, diventa visibile */
    nav ul.show {
        display: flex !important;
    }
    
    nav ul li {
        margin: 5px 0;
    }
}