/* assets/css/style.css - MDC Smart Solutions Blog */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background: #fff;
}

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

/* Navigation */
.navbar {
    background: var(--dark-text);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.logo a {
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin: 2rem 0;
    border-radius: 8px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.article-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.article-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.article-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.article-content h3 a {
    color: var(--dark-text);
    text-decoration: none;
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-content p {
    color: #555;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Full Article Page */
.article-full {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--dark-text);
}

.article-image {
    margin: 2rem 0;
}

.article-image img {
    width: 100%;
    border-radius: 8px;
}

.article-full .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-full .article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--dark-text);
}

.article-full .article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    color: var(--dark-text);
}

.article-full .article-content p {
    margin-bottom: 1rem;
}

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

.article-full .article-content ul,
.article-full .article-content ol {
    margin: 1rem 0 1rem 2rem;
}

.article-full .article-content li {
    margin-bottom: 0.5rem;
}

.article-full .article-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.article-full .article-content a:hover {
    text-decoration: underline;
}

.article-full .article-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.article-full .article-content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Share Buttons */
.share-buttons {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.share-buttons h3 {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #545b62;
}

/* About Section */
.about {
    background: var(--light-bg);
    padding: 3rem 2rem;
    margin: 3rem 0;
    border-radius: 8px;
}

.about h2 {
    margin-bottom: 1rem;
}

.about p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about a {
    color: var(--primary-color);
    text-decoration: none;
}

.about a:hover {
    text-decoration: underline;
}

/* Recent and Most Read Sections */
.most-read,
.recent-articles,
.related-articles {
    margin: 3rem 0;
}

.most-read h2,
.recent-articles h2,
.related-articles h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--dark-text);
}

/* Footer */
footer {
    background: var(--dark-text);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #aaa;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .articles-grid,
    .articles-list {
        grid-template-columns: 1fr;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-full {
        padding: 1rem;
    }
}

/* Pulsante "Leggi Articolo" nelle card */
.btn-read-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.65rem 1.25rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-read-more:hover {
    background: #0056b3;
    transform: translateX(5px);
}

/* Data di pubblicazione prominente nell'articolo */
.article-date-prominent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.publish-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-date-prominent time {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

.updated-label {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.85;
}

/* Tempo di lettura */
.reading-time {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Share buttons migliorati */
.share-buttons {
    margin: 3rem 0 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.share-buttons h3 {
    margin-bottom: 1.5rem;
    color: #212529;
    font-size: 1.3rem;
}

.share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.btn-facebook {
    background: #1877f2;
}

.btn-facebook:hover {
    background: #145dbf;
}

.btn-twitter {
    background: #1da1f2;
}

.btn-twitter:hover {
    background: #0d8bd9;
}

.btn-linkedin {
    background: #0077b5;
}

.btn-linkedin:hover {
    background: #005885;
}

/* Immagini article card cliccabili */
.article-card img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.article-card a:hover img {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .article-date-prominent time {
        font-size: 1.1rem;
    }

    .share-buttons-grid {
        grid-template-columns: 1fr;
    }

    .btn-read-more {
        display: block;
        text-align: center;
    }
}

/* Share Section Minimalista */
.share-section {
    margin: 3rem 0 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    font-weight: 500;
}

.share-icons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

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

.share-icon.facebook:hover {
    background: #1877f2;
    color: white;
}

.share-icon.twitter:hover {
    background: #1da1f2;
    color: white;
}

.share-icon.linkedin:hover {
    background: #0077b5;
    color: white;
}

.share-icon.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.share-icon.whatsapp:hover {
    background: #25d366;
    color: white;
}

.share-icon.copy:hover {
    background: #6c757d;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .share-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .share-icons {
        width: 100%;
        justify-content: center;
    }
}


/* ===== OTTIMIZZAZIONI MOBILE AVANZATE ===== */

/* Font più leggibile su mobile */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }
    
    /* Padding ridotto per massimizzare lo spazio */
    .container {
        padding: 0 1rem;
    }
    
    /* Hero section ottimizzato */
    .hero {
        padding: 2rem 1.5rem;
        margin: 1rem 0;
    }
    
    .hero h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    /* Articolo completo - Miglioramenti tipografia */
    .article-full {
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .article-header h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }
    
    /* Contenuto articolo - Spaziatura ottimale */
    .article-full .article-content {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0;
    }
    
    .article-full .article-content h2 {
        font-size: 1.4rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    
    .article-full .article-content h3 {
        font-size: 1.2rem;
        margin-top: 1.25rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }
    
    .article-full .article-content p {
        margin-bottom: 1.25rem;
        text-align: justify;
    }
    
    /* Liste più compatte e leggibili */
    .article-full .article-content ul,
    .article-full .article-content ol {
        margin: 1rem 0 1rem 1.5rem;
        padding-left: 0.5rem;
    }
    
    .article-full .article-content li {
        margin-bottom: 0.75rem;
        line-height: 1.6;
    }
    
    /* Immagini responsive ottimizzate */
    .article-image img,
    .article-full .article-content img {
        width: 100%;
        height: auto;
        margin: 1.25rem 0;
        border-radius: 8px;
        display: block;
    }
    
    /* Codice ottimizzato per mobile */
    .article-full .article-content pre {
        padding: 0.75rem;
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
    
    .article-full .article-content code {
        font-size: 0.9rem;
        word-wrap: break-word;
    }
    
    /* Meta informazioni articolo */
    .article-meta {
        font-size: 0.85rem;
        gap: 0.75rem;
    }
    
    /* Tag più compatti */
    .tags {
        gap: 0.4rem;
        margin-top: 0.75rem;
    }
    
    .tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Data pubblicazione ottimizzata */
    .article-date-prominent {
        padding: 0.75rem 1rem;
        margin: 1rem 0;
    }
    
    .article-date-prominent time {
        font-size: 1.1rem;
    }
    
    /* Share buttons mobile-friendly */
    .share-section {
        padding: 1.25rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .share-icons {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    .share-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    /* Card articoli ottimizzate */
    .article-card {
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .article-card img {
        height: 180px;
    }
    
    .article-content {
        padding: 1.25rem;
    }
    
    .article-content h3 {
        font-size: 1.15rem;
        line-height: 1.4;
    }
    
    .article-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Navbar mobile migliorato */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        gap: 0.75rem;
        padding-top: 0.5rem;
    }
    
    .nav-menu a {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    
    /* Footer ottimizzato */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    /* Bottoni touch-friendly */
    .btn,
    .btn-read-more {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Tabelle responsive */
    .article-full .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    /* About section mobile */
    .about {
        padding: 2rem 1.5rem;
        margin: 2rem 0;
    }
    
    /* Sezioni correlate */
    .most-read h2,
    .recent-articles h2,
    .related-articles h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Ottimizzazioni per schermi molto piccoli */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .article-full {
        padding: 0.75rem;
    }
    
    .article-header h1 {
        font-size: 1.4rem;
    }
    
    .article-full .article-content h2 {
        font-size: 1.25rem;
    }
    
    .article-full .article-content h3 {
        font-size: 1.1rem;
    }
    
    .hero {
        padding: 1.5rem 1rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
}

/* Miglioramento touch per link */
@media (hover: none) and (pointer: coarse) {
    a, button, .btn, .share-icon {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
}

