/* ===================================
   ILOS DE SEDA E DE ORO - CSS Principale
   Progetto TOCC 2023 - Ministero della Cultura
   =================================== */

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

:root {
    /* Colori Primari */
    --oro: #D4AF37;
    --bordeaux: #8B1538;
    --blu-notte: #1A2332;
    --bianco-lino: #FAF7F0;
    
    /* Colori Secondari */
    --fucsia: #C71585;
    --verde-olivo: #6B8E23;
    --arancio-terra: #CC5500;
    --grigio-perla: #E5E4E2;
    
    /* Testi */
    --testo-scuro: #333333;
    --testo-chiaro: #666666;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Transizioni */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 300ms ease-in-out;
    --transition-slow: 400ms ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--testo-scuro);
    background-color: var(--bianco-lino);
    overflow-x: hidden;
}

/* ===== TIPOGRAFIA ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
}

h4 {
    font-size: 1.25rem;
}

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

a {
    color: var(--oro);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--bordeaux);
}

/* ===== LAYOUT CONTAINERS ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-sm);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

section {
    padding: var(--spacing-lg) 0;
}

/* ===== HEADER E NAVIGAZIONE ===== */
.site-header {
    background: var(--blu-notte);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-top {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header-info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-info a {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.header-info a:hover {
    color: var(--oro);
}

.header-social {
    display: flex;
    gap: 1rem;
}

.header-social a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.header-social a:hover {
    color: var(--oro);
    transform: translateY(-2px);
}

.header-main {
    padding: 1rem 0;
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--oro);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.site-logo .subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
}

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

.main-nav a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    display: block;
}

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

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.45) 0%, rgba(139, 21, 56, 0.35) 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: var(--spacing-md);
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7), 1px 1px 3px rgba(0, 0, 0, 0.9);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.98);
    font-weight: 300;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7), 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.hero-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.3);
    border: 2px solid var(--oro);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--oro);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
}

.btn-primary {
    background: var(--oro);
    color: white;
    border-color: var(--oro);
}

.btn-primary:hover {
    background: var(--bordeaux);
    border-color: var(--bordeaux);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background: white;
    color: var(--blu-notte);
}

.btn-outline {
    background: transparent;
    color: var(--oro);
    border-color: var(--oro);
}

.btn-outline:hover {
    background: var(--oro);
    color: white;
}

/* ===== SEZIONI ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-subtitle {
    color: var(--oro);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--blu-notte);
    margin-bottom: 1rem;
}

.section-description {
    max-width: 700px;
    margin: 0 auto;
    color: var(--testo-chiaro);
    font-size: 1.1rem;
}

/* Background variations */
.bg-white {
    background: white;
}

.bg-lino {
    background: var(--bianco-lino);
}

.bg-dark {
    background: var(--blu-notte);
    color: white;
}

.bg-dark .section-title {
    color: white;
}

/* ===== PROGETTO TOCC SECTION ===== */
.progetto-tocc {
    position: relative;
}

.progetto-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto var(--spacing-lg);
}

.badge-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.institutional-badge {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blu-notte);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-data-box {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--oro);
}

.project-data-box h4 {
    color: var(--oro);
    margin-bottom: 1rem;
}

.project-data-box ul {
    list-style: none;
}

.project-data-box li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--grigio-perla);
}

.project-data-box li:last-child {
    border-bottom: none;
}

.project-data-box strong {
    color: var(--blu-notte);
    margin-right: 0.5rem;
}

/* ===== AZIONI GRID ===== */
.azioni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.azione-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-medium);
    cursor: pointer;
    border: 2px solid transparent;
}

.azione-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--oro);
}

.azione-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.azione-card h3 {
    color: var(--blu-notte);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.azione-card p {
    color: var(--testo-chiaro);
    margin-bottom: 0;
}

/* ===== GRID LAYOUTS ===== */
.two-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.content-column h2 {
    margin-bottom: 1.5rem;
}

.content-column p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.image-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform var(--transition-medium);
}

.image-gallery img:hover {
    transform: scale(1.05);
}

/* ===== CARD GENERICHE ===== */
.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-medium);
}

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

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

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--blu-notte);
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--testo-chiaro);
    margin-bottom: 1rem;
}

.card-description {
    color: var(--testo-chiaro);
    line-height: 1.6;
}

/* ===== CONTATORI ===== */
.stats-section {
    background: linear-gradient(135deg, var(--blu-notte) 0%, var(--bordeaux) 100%);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 2rem 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--oro);
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ===== TIMELINE ===== */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 3rem auto;
}

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grigio-perla);
    transform: translateY(-50%);
}

.timeline-item {
    position: relative;
    text-align: center;
    flex: 1;
}

.timeline-marker {
    width: 60px;
    height: 60px;
    background: white;
    border: 4px solid var(--oro);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
    transition: all var(--transition-medium);
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.2);
    background: var(--oro);
}

.timeline-content h4 {
    color: var(--blu-notte);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.875rem;
    color: var(--testo-chiaro);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--blu-notte);
    color: rgba(255, 255, 255, 0.9);
}

.footer-main {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-section h4 {
    color: var(--oro);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: var(--oro);
    padding-left: 5px;
}

/* Loghi Istituzionali */
.footer-logos {
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition-fast);
}

.logo-item:hover {
    transform: translateY(-5px);
}

.logo-item img {
    max-height: 100px;
    width: auto;
    transition: opacity var(--transition-fast);
    opacity: 1;
}

.logo-item:hover img {
    opacity: 0.9;
}

.logo-caption {
    font-size: 0.75rem;
    text-align: center;
    opacity: 0.7;
    max-width: 200px;
}

/* Footer Bottom */
.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 3rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 2rem; padding-bottom: 2rem; }
.py-4 { padding-top: 3rem; padding-bottom: 3rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--blu-notte);
        padding: 2rem;
        transform: translateY(-100%);
        transition: var(--transition-medium);
        opacity: 0;
        visibility: hidden;
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .timeline {
        flex-direction: column;
        gap: 2rem;
    }
    
    .timeline::before {
        width: 4px;
        height: 100%;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .header-top {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .logos-container {
        flex-direction: column;
        gap: 2rem;
    }
}

/* ===== ACCESSIBILITÀ ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--oro);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus states per accessibilità */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--oro);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .site-header,
    .site-footer,
    .btn,
    .nav-toggle {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
