/* ============================================
   STYLE.CSS - VERSIONE 4.2 (COMPLETAMENTE RISCRITTO)
   Data: 2026-01-10
   ============================================
   
   CORREZIONI APPLICATE:
   1. SKIP LINK completamente nascosto e visibile solo con focus
   2. COLORI modificati: #2c3e50 sostituito con tonalità più calde
   3. Footer e pulsanti con nuova colorazione coerente
   4. Migliorata coerenza visiva e accessibilità
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333333;
    background-color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ============================================
   SKIP LINK - COMPLETAMENTE NASCOSTO
   ============================================ */
.skip-link {
    position: absolute;
    top: -100px;
    left: -100px;
    background: #b63e3e;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: bold;
    z-index: 9999;
    border-radius: 4px;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s ease;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.skip-link:focus {
    top: 15px;
    left: 15px;
    opacity: 1;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    overflow: visible;
}

/* ============================================
   HEADER FISSO - LINEA UNICA
   ============================================ */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 70px;
}

/* Brand a sinistra */
.header-brand {
    flex: 0 0 auto;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.2;
    white-space: nowrap;
}

.site-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #b63e3e;
}

.site-subtitle {
    font-style: italic;
    color: #b63e3e;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Menu al centro */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.nav-item {
    white-space: nowrap;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    display: block;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    background: #fdf6f0;
    color: #b63e3e;
    outline: none;
}

.nav-link.active {
    background: #b63e3e;
    color: white;
}

/* Elementi a destra */
.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

/* Selettore lingua */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.lang-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.lang-link:hover:not(.active) {
    background: #f8f9fa;
}

.lang-link.active {
    background: #b63e3e;
    color: white;
}

.flag-icon {
    border: 1px solid #dee2e6;
    border-radius: 2px;
    display: block;
}

.lang-separator {
    color: #adb5bd;
    user-select: none;
}

/* Social */
.header-social {
    display: flex;
    gap: 0.8rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #555;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.instagram:hover {
    background: #E4405F;
    color: white;
}

.facebook:hover {
    background: #1877F2;
    color: white;
}

.twitter:hover {
    background: #000000;
    color: white;
}

/* Hamburger menu (nascosto su desktop) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Spazio per header fisso */
.header-spacer {
    height: 90px;
    width: 100%;
    display: block;
    flex-shrink: 0;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #b63e3e;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* Link */
a {
    color: #2c5aa0;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: #1e3a6f;
    text-decoration: underline;
}

/* ============================================
   FOOTER - NUOVI COLORI
   ============================================ */
.main-footer {
    background: #1a252f; /* Sostituito #2c3e50 */
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    flex-shrink: 0;
    border-top: 3px solid #b63e3e;
}

.footer-content {
    text-align: center;
    padding: 0 2rem;
}

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

.footer-section p {
    margin-bottom: 0.5rem;
    color: #e8d7c7;
}

.footer-sub {
    font-size: 0.9rem;
    color: #a0aec0;
}

.footer-link {
    color: #e8d7c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #b63e3e;
    text-decoration: underline;
}

/* Pulsante Torna su */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #b63e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    -webkit-appearance: none;
    appearance: none;
}

.back-to-top:hover {
    background: #9e3333;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ============================================
   STILI COMUNI PER TUTTE LE PAGINE
   ============================================ */

/* Titoli delle pagine */
.page-header {
    text-align: center;
    margin: 2rem 0 3rem;
    padding: 2rem 0;
    border-bottom: 2px solid #e8d7c7;
}

.page-title {
    font-size: 2.5rem;
    color: #b63e3e;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Bottoni standard */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: #b63e3e;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #9e3333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(182, 62, 62, 0.3);
}

.btn-secondary {
    background: white;
    color: #333;
    border-color: #dee2e6;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #b63e3e;
    color: #b63e3e;
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* PULSANTI BACK - NUOVO COLORE */
.back-button,
.legal-back-link {
    background: #b63e3e !important; /* Sostituito #2c3e50 */
    color: white !important;
    border-color: #b63e3e !important;
}

.back-button:hover,
.legal-back-link:hover {
    background: #9e3333 !important;
    border-color: #9e3333 !important;
}

/* Card di informazioni */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-top: 4px solid #b63e3e;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Navigazione tra pagine */
.page-navigation {
    margin: 4rem 0 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e8d7c7;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-button {
    padding: 1rem 2rem;
    background: #fdf6f0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-block;
    text-align: center;
    min-width: 200px;
}

.nav-button:hover {
    background: #b63e3e;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(182, 62, 62, 0.3);
}

/* ============================================
   INDEX.PHP - STILI SPECIFICI
   ============================================ */

/* Hero Image */
.hero-section {
    margin: 2rem auto 3rem;
    padding-top: 1rem;
}

.hero-wrapper {
    display: flex;
    justify-content: center;
}

.hero-image {
    width: 66.666%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 2/1;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: scale(1.02);
}

/* Introduzione */
.intro-section {
    margin: 4rem auto;
    padding: 3rem 0;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.intro-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #444;
}

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

.feature {
    padding: 1.5rem;
    background: #fdf6f0;
    border-radius: 8px;
    border-left: 4px solid #b63e3e;
}

.feature h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature p {
    font-size: 1rem;
    margin: 0;
    color: #666;
}

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

/* ============================================
   GALLERY.PHP - STILI SPECIFICI
   ============================================ */

/* Galleria 3 per riga */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    aspect-ratio: 1/1;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    z-index: 10;
}

.gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
    display: block;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(10px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay-text {
    color: white;
    font-weight: bold;
    font-size: 1rem;
    display: block;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

#lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.close-lightbox {
    position: absolute;
    top: -60px;
    right: 0;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

.close-lightbox:hover {
    background: #b63e3e;
    transform: scale(1.1);
}

/* ============================================
   CONTACT.PHP - STILI SPECIFICI
   ============================================ */

/* Form di contatto */
.contact-form-section {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* CAMPO VERIFICA MATEMATICA - CORRETTO */
.math-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.math-input::-webkit-outer-spin-button,
.math-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b63e3e;
    box-shadow: 0 0 0 3px rgba(182, 62, 62, 0.1);
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Honeypot */
.honeypot {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Verifica matematica */
.math-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.math-verification {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.math-problem {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 2px solid #b63e3e;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 180px;
}

#refresh-math {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#refresh-math:hover {
    color: #b63e3e;
    transform: rotate(90deg);
}

/* Messaggi di stato */
.success-message,
.error-message {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

.success-message {
    background: #e8f5e9;
    border: 2px solid #c8e6c9;
}

.error-message {
    background: #ffebee;
    border: 2px solid #ffcdd2;
}

.message-icon {
    font-size: 2rem;
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.success-message .message-icon {
    color: #2e7d32;
    border: 3px solid #2e7d32;
}

.error-message .message-icon {
    color: #c62828;
    border: 3px solid #c62828;
}

/* Info box sommario */
.contact-info-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.info-box {
    background: #fdf6f0;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border-top: 4px solid #b63e3e;
    transition: transform 0.3s ease;
}

.info-box:hover {
    transform: translateY(-5px);
}

.info-box h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================
   INFO.PHP - STILI SPECIFICI
   ============================================ */

/* Layout a 2 colonne */
.info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin: 3rem 0;
}

.info-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Mappa grande */
.map-large {
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.map-large iframe {
    display: block;
    border: none;
    width: 100%;
    height: 400px;
}

.map-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.map-button,
.directions-button {
    padding: 0.8rem 1.5rem;
    background: #1a252f; /* Sostituito #2c3e50 */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
    justify-content: center;
    border: 2px solid #1a252f;
}

.directions-button {
    background: #b63e3e;
    border-color: #b63e3e;
}

.map-button:hover {
    background: #0d1319;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 37, 47, 0.3);
}

.directions-button:hover {
    background: #9e3333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(182, 62, 62, 0.3);
}

/* Contatti */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.contact-item:hover {
    background: #f1f3f4;
}

.contact-icon {
    font-size: 1.5rem;
    background: #b63e3e;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-text {
    flex: 1;
}

.contact-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.contact-link {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-block;
    margin-top: 0.2rem;
}

.contact-link:hover {
    color: #1e3a6f;
    text-decoration: underline;
}

/* Orari */
.hours-container {
    background: #fdf6f0;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e8d7c7;
}

.hours-day {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8d7c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hours-day:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.hours-day strong {
    color: #2c3e50;
    min-width: 150px;
}

/* Servizi */
.services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.services-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 1.1rem;
    padding-left: 2rem;
    position: relative;
}

.services-list li:last-child {
    border-bottom: none;
}

.services-list li:before {
    content: "✓";
    color: #2e7d32;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0.8rem;
}

/* ============================================
   PAGINE LEGALI - NUOVI COLORI
   ============================================ */

.legal-main-title {
    background: #1a252f; /* Sostituito #2c3e50 */
    color: white;
    padding: 2rem;
    margin: 0;
    text-align: center;
    font-size: 2.2rem;
    border-bottom: 3px solid #b63e3e;
}

.legal-back-link {
    background: #b63e3e !important; /* Sostituito #2c3e50 */
    color: white !important;
}

.legal-back-link:hover {
    background: #9e3333 !important;
}

/* ============================================
   ANIMAZIONI
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }
    
    .header-brand {
        min-width: 180px;
    }
    
    .site-title {
        font-size: 1.6rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }
    
    .header-right {
        gap: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .info-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .contact-info-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-button,
    .directions-button {
        min-width: 180px;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .skip-link:focus {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Mobile Landscape (max 768px) */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0 1rem;
        gap: 1rem;
    }
    
    /* Nascondi menu e destra su mobile */
    .main-navigation,
    .header-right {
        display: none;
        order: 3;
        width: 100%;
    }
    
    /* Mostra hamburger menu */
    .hamburger-menu {
        display: flex;
        order: 2;
        margin-left: auto;
    }
    
    /* Menu mobile (si apre con hamburger) */
    .main-navigation.mobile-open {
        display: flex;
        margin-top: 1rem;
    }
    
    .nav-menu.mobile-open {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .header-right.mobile-open {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e8d7c7;
    }
    
    .header-brand {
        flex: 1;
        min-width: auto;
        order: 1;
    }
    
    .site-subtitle {
        font-size: 0.8rem;
    }
    
    .header-spacer {
        height: 70px;
    }
    
    /* Contenuto responsive */
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    .hero-image {
        width: 95%;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .gallery-item {
        box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    }
    
    .gallery-item:hover {
        transform: translateY(-3px);
    }
    
    .map-large iframe {
        height: 350px;
    }
    
    .map-actions {
        flex-direction: column;
    }
    
    .map-button,
    .directions-button {
        min-width: 100%;
        justify-content: center;
    }
    
    .contact-item {
        padding: 0.8rem;
    }
    
    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .math-verification {
        flex-direction: column;
        align-items: stretch;
    }
    
    .math-problem {
        justify-content: space-between;
    }
    
    .nav-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .nav-button {
        width: 100%;
        max-width: 300px;
        padding: 0.9rem 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: auto;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* Mobile Portrait (max 576px) */
@media (max-width: 576px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .site-title {
        font-size: 1.4rem;
    }
    
    .site-subtitle {
        font-size: 0.75rem;
    }
    
    .header-spacer {
        height: 65px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .page-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .page-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .gallery-item {
        aspect-ratio: 4/3;
        max-width: 100%;
    }
    
    .hero-image {
        width: 100%;
        border-radius: 8px;
    }
    
    .info-section,
    .contact-section {
        padding: 2rem 0;
    }
    
    .contact-form {
        padding: 1rem;
    }
    
    .map-large iframe {
        height: 300px;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .hours-day {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .hours-day strong {
        min-width: auto;
    }
    
    .services-list li {
        font-size: 1rem;
        padding-left: 1.5rem;
    }
    
    .contact-info-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-navigation,
    .contact-navigation,
    .gallery-navigation {
        margin: 3rem 0 1.5rem;
        padding-top: 1.5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .skip-link:focus {
        top: 5px;
        left: 5px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ============================================
   FINE FILE STYLE.CSS
   ============================================ */