/* File: style.css */
/* Versione: 1.0 */

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

:root {
    /* Colori tema italiano */
    --verde-italiano: #009246;
    --bianco-italiano: #FFFFFF;
    --rosso-italiano: #CE2B37;
    
    /* Colori principali */
    --primary-color: #1a472a;
    --primary-light: #2d5a3d;
    --primary-dark: #0d2415;
    --accent-color: #d4af37;
    
    /* Colori UI */
    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e6ed;
    
    /* Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-secondary: Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-light);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* === HEADER === */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-lg) 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.site-header h1 a {
    color: white;
    text-decoration: none;
}

.site-header .tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.breadcrumb {
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.breadcrumb a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* === SEZIONI HOMEPAGE === */
.intro-section {
    background: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.intro-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.info-box {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.info-box h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xs);
}

/* === ARTICOLI === */
.articoli-section {
    margin: var(--spacing-xl) 0;
}

.articoli-section > h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.titolo-gruppo {
    background: white;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.titolo-sezione {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--accent-color);
}

.articoli-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.articolo-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    background: var(--bg-light);
    border-radius: 8px;
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    position: relative;
}

.articolo-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.articolo-numero {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

.articolo-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.badge-modificato {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: var(--rosso-italiano);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* === FAQ === */
.faq-section {
    background: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.faq-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.faq-question {
    margin-bottom: 0;
}

.faq-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: var(--spacing-md) 0;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color 0.3s;
}

.faq-toggle:hover {
    color: var(--primary-light);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    min-width: 30px;
    text-align: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 var(--spacing-md);
}

.faq-answer.active {
    max-height: 1000px;
    padding: 0 var(--spacing-md) var(--spacing-md);
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* === CTA === */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    margin: var(--spacing-xl) 0;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.btn-primary {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--accent-color);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s;
    margin-top: var(--spacing-md);
}

.btn-primary:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* === PAGINA ARTICOLO === */
.articolo-page {
    padding: var(--spacing-lg) 0;
}

.articolo-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: var(--spacing-lg);
}

.articolo-header {
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.articolo-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.categoria {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-modificato-large {
    background: var(--rosso-italiano);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.articolo-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.articolo-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.articolo-testo h2,
.articolo-spiegazione h2,
.articolo-modifiche h2,
.articolo-contesto h2,
.articolo-correlati h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: var(--spacing-xl) 0 var(--spacing-md) 0;
}

.testo-costituzionale {
    background: var(--bg-light);
    border-left: 5px solid var(--accent-color);
    padding: var(--spacing-lg);
    margin: var(--spacing-md) 0;
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    border-radius: 0 8px 8px 0;
}

.spiegazione-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
    text-align: justify;
}

/* === TIMELINE MODIFICHE === */
.timeline {
    position: relative;
    padding-left: 40px;
    margin: var(--spacing-lg) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.timeline-marker {
    position: absolute;
    left: -34px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-content h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xs);
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-banner {
    background: #e8f5e9;
    border-left: 5px solid #4caf50;
    padding: var(--spacing-md);
    border-radius: 0 8px 8px 0;
    color: #2e7d32;
}

/* === CONTESTO === */
.contesto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.contesto-item {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-top: 3px solid var(--accent-color);
}

.contesto-item h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.contesto-item p {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* === CORRELATI === */
.correlati-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.correlato-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    background: var(--bg-light);
    border-radius: 8px;
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.correlato-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.correlato-numero {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
}

.correlato-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === NAVIGAZIONE ARTICOLI === */
.articolo-navigation {
    margin: var(--spacing-xl) 0;
}

.nav-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: stretch;
}

.nav-button {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    justify-content: center;
}

.nav-button:hover:not(.nav-disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.nav-prev {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.nav-home {
    text-align: center;
}

.nav-disabled {
    opacity: 0.3;
    cursor: default;
}

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: var(--spacing-xs);
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* === FOOTER === */
.site-footer {
    background: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

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

.footer-col h4 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-md);
}

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

.footer-col ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-col a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-col a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--spacing-md);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.disclaimer {
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    font-style: italic;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 1.8rem;
    }
    
    .site-header .tagline {
        font-size: 0.95rem;
    }
    
    .articoli-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        grid-template-columns: 1fr;
    }
    
    .nav-home {
        order: -1;
    }
    
    .articolo-content {
        padding: var(--spacing-md);
    }
    
    .articolo-header h1 {
        font-size: 1.8rem;
    }
    
    .contesto-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .info-boxes {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* === PRINT === */
@media print {
    .site-header,
    .articolo-navigation,
    .site-footer,
    .articolo-correlati,
    .cta-section {
        display: none;
    }
    
    .articolo-content {
        box-shadow: none;
        padding: 0;
    }
}

/* === FAQ PER CATEGORIA === */
.faq-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 1.05rem;
}

.faq-categoria {
    margin-bottom: var(--spacing-xl);
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.faq-categoria-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.faq-categoria-title::before {
    content: '📌';
    font-size: 1.3rem;
}

.faq-question h4 {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .faq-categoria {
        padding: var(--spacing-md);
    }
    
    .faq-categoria-title {
        font-size: 1.2rem;
    }
}
