/* ===================================================================
   CSS UNIFICATO - Corretto per responsive (risolve overflow/mobile)
   Mantiene gli stili desktop; applica restrizioni solo nelle media query
   =================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=UnifrakturCook:wght@700&display=swap');

/* Box sizing universale (evita calcoli imprevisti di larghezza) */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Evita scroll orizzontale globalmente */
html, body {
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Body and general styles */
body {
    font-family: 'Poppins', sans-serif;
    /* background con attachment fixed su desktop.
       Nota: su schermi stretti verrà overridato nelle media queries per evitare overflow. */
    background: #f8f8f5 url('Images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* PAGE2 FIX - evita overflow causato da background-attachment: fixed su mobile */
@media (max-width: 768px) {
    body {
        background-attachment: scroll !important;
    }
}

/* Oscuramento dello sfondo */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.30);
    z-index: 0;
}

/* Mantieni il contenuto sopra l’overlay */
body > * {
    position: relative;
    z-index: 1;
}

/* Link indice - stile coerente con i titoli */
.index-link {
    color: #0A192F;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
.index-link:hover,
.index-link:focus {
    color: #0d3b66;
    text-decoration: underline;
}

/* Navbar styles */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.8) !important;
    z-index: 10;
}

/* Hero Section (generale, non page2) */
.hero {
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95), rgba(0, 0, 0, 0.85));
    color: #fff;
    height: 50vh;
    width: 100%;
    position: relative;
    padding: 3rem 1rem;
}

/* Logo inside hero */
.logo-wrapper {
    position: relative;
    z-index: 2;
}

.logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}
.logo-img:hover { transform: scale(1.05); }

/* Immagini in generale - sempre fluide (difensivo) */
img { max-width: 100%; height: auto; display: block; }

/* Gothic Title */
.gothic-title {
    font-family: 'UnifrakturCook', 'Old English Text MT', serif;
    font-size: 4rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    margin-bottom: 0.5rem;
    z-index: 2;
}

/* Hero paragraph */
.hero p { z-index: 2; font-weight: 400; }

/* Clickable cards */
.clickable-card {
    display: block;
    width: 90%;
    max-width: 750px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem;
    text-decoration: none;
    color: #222;
    transition: all 0.4s ease;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
    margin-left: auto;
    margin-right: auto; /* centra sempre le card */
}
.clickable-card:hover {
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.3);
    transform: translateY(-5px) scale(1.03);
}
.clickable-card h3 { font-weight: 600; margin-bottom: 0.5rem; color: #0d3b66; }
.clickable-card p { color: #333; margin: 0; font-size: 1rem; }

/* Custom HR */
.custom-hr {
    width: 80%;
    border: none;
    height: 3px;
    background-color: #0A192FF2;
    margin: 2rem auto;
    border-radius: 2px;
}

/* Colonne sinistra/destra - impostazioni generali flessibili */
.left-side {
    flex: 0 0 auto;
    background: transparent;
    min-height: 400px;
    width: 100%;
}

.right-side {
    flex: 1 1 auto;
    background: transparent;
    min-height: 400px;
    width: 100%;
}

/* Divider verticale (desktop) */
.custom-hr-vertical { width: 2px; background-color: #0A192FF2; margin: 0 1rem; }

/* Form e input */
.form-light {
    background-color: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #000;
}
.form-light:focus {
    border-color: #0d6efd;
    background-color: #e9e9e9;
    box-shadow: none;
}

/* Footer */
.fixed-footer {
    background: #0A192FF2;
    color: #fff;
    padding: 1rem 1rem;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 20;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.3);
}
.fixed-footer .footer-left,
.fixed-footer .footer-right { min-width: 200px; }
.footer-link { color: #64b5f6; text-decoration: none; transition: color 0.3s ease; }
.footer-link:hover, .footer-link:focus { color: #90caf9; text-decoration: underline; }

/* Padding to prevent content behind footer */
body::after { content: ""; display: block; height: 80px; }

/* =========================================================
   PAGE 2 – SEZIONE PRESENTAZIONE (SYd)
   ========================================================= */

.page2-hero {
    background: linear-gradient(135deg, rgba(18, 103, 227, 0.95), rgba(0, 0, 0, 0.85));
    color: #fff;
    text-align: center;
    padding: 5rem 1rem 5rem;
    position: relative;
}

/* page2 logos */
.page2-hero .page2-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.page2-hero .page2-logo-wrapper img {
    width: 80px;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}
.page2-hero .page2-logo-wrapper img:hover { transform: scale(1.05); }
.page2-hero .page2-title {
    font-family: 'UnifrakturCook', serif;
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    margin-top: 1rem;
}

/* Page2 content box */
.page2-content {
    max-width: 900px;
    margin: 4rem auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 3rem 2rem;
    color: #222;
}
.page2-content h2 { font-weight: 700; font-size: 1.8rem; text-align: center; color: #0A192F; margin-bottom: 2rem; }
.page2-content p { font-size: 1rem; line-height: 1.7; margin-bottom: 1rem; }
.page2-content strong { color: #0d3b66; }
.page2-contact { text-align: center; margin-top: 2rem; font-size: 1rem; }
.page2-contact a { color: #0d6efd; text-decoration: none; font-weight: 500; }
.page2-contact a:hover { text-decoration: underline; }
.page2-notes { margin-top: 2rem; font-size: 0.95rem; background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 1.5rem; }
.page2-notes ul { list-style: none; padding: 0; margin: 0; }
.page2-notes li::before { content: "• "; color: #0A192F; font-weight: bold; }

/* Footer della page2 */
.page2-footer {
    background: #0A192FF2;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
}

/* Piccolo miglioramento per le carte */
.clickable-card p { font-size: 0.95rem; color: #444; }
.clickable-card i { vertical-align: middle; }

/* Form centrato */
.form-wrapper {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   SEZIONE CONTATTI - CARD BLU (rework responsive-safe)
   ========================================================= */

/* Contenitore base sezione contatti */
.info-section-clean {
    display: flex;
    justify-content: center;
    padding: 5rem 1rem;
    background: transparent;
}

/* La .info-card è ora responsive by default:
   - usa flex-wrap: wrap per permettere il flow su mobile
   - max-width calcolato per evitare overflow dovuto a padding
*/
.info-card {
    background: linear-gradient(135deg, rgba(18, 103, 227, 0.95), rgba(0,0,0,0.85));
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    display: flex;
    flex-wrap: wrap;              /* permetti il wrapping su view stretti */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    gap: 2rem;
    padding: 2rem;
    margin-left: auto;
    margin-right: auto;
    overflow: visible;
}

/* Colonna sinistra (mobile-friendly) */
.info-card .left-side {
    flex: 0 0 30%;
    min-width: 0;                 /* rimuove possibile overflow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

/* immagini loghi nella left-side */
.info-card .left-side img {
    max-width: 120px;
    margin-bottom: 1.5rem;
    height: auto;
    transition: transform 0.3s ease;
}
.info-card .left-side img:hover { transform: scale(1.05); }

/* Divider verticale (visibile solo su schermi larghi) */
.divider-vertical {
    width: 2px;
    background-color: rgba(255,255,255,0.3);
    margin: 0 1rem;
    display: none; /* default hidden, show via mq per desktop */
}

/* Colonna destra */
.info-card .right-side {
    flex: 1 1 65%;
    min-width: 0;                 /* rimuove overflow */
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* form wrapper per la destra */
.info-card .right-side .form-wrapper {
    background: transparent;
    padding: 2rem;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
}

/* Input e textarea (versione scura sopra sfondo) */
.form-light {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #fff;
}
.form-light:focus {
    border-color: #0d6efd;
    background-color: rgba(255,255,255,0.2);
    box-shadow: none;
    color: #fff;
}

/* ============================
   MEDIA QUERIES (responsive)
   - qui riattiviamo i comportamenti desktop sui dispositivi larghi
   ============================ */

/* Mobile & Tablet stretti - preveniamo overflow e centriamo */
@media (max-width: 991.98px) {
    /* Riduci padding della sezione per non eccedere larghezza */
    .info-section-clean { padding: 3rem 0.75rem; }

    /* Le colonne prendono tutta la larghezza e si impilano */
    .info-card {
        width: 100%;
        padding: 1.25rem;
        gap: 1rem;
    }

    .info-card .left-side,
    .info-card .right-side {
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        text-align: center;
        padding: 0.5rem;
    }

    /* Nascondi la divider verticale su mobile */
    .divider-vertical { display: none; }

    /* Form wrapper piena larghezza su mobile */
    .info-card .right-side .form-wrapper { max-width: 100%; padding: 1.25rem; }

    /* Hero e page2 adattamenti mobili */
    .page2-hero { padding: 3rem 0.75rem; }
    .page2-hero .page2-title { font-size: 2.2rem; }

    /* Assicura che il footer non crei overflow */
    .fixed-footer { left: 0; right: 0; width: 100%; }
}

/* Desktop large: riattiviamo layout a colonne, divider e min-width utili */
@media (min-width: 992px) {
    /* mostra divider verticale su desktop */
    .divider-vertical { display: block; }

    /* imposta le proporzioni desiderate solo su schermi larghi */
    .info-card {
        flex-wrap: nowrap;            /* evita wrap su desktop */
        padding: 2rem;
    }
    .info-card .left-side {
        flex: 0 0 30%;
        min-width: 220px;            /* solo desktop */
    }
    .info-card .right-side {
        flex: 1 1 65%;
        min-width: 400px;            /* solo desktop */
    }
}

/* Ulteriori micro-adattamenti per schermi molto piccoli */
@media (max-width: 575.98px) {
    .fixed-footer .footer-content {
        flex-direction: column;
        text-align: center !important;
        align-items: center;
    }
    .fixed-footer .footer-left,
    .fixed-footer .footer-right {
        text-align: center !important;
        margin: 0.2rem 0;
    }
    .page2-hero .page2-title { font-size: 1.9rem; padding: 1rem 0; }
    .clickable-card { padding: 1.5rem; width: 94%; }
}

/* Ultime difese: evita overflow su elementi inline lunghi (es. email, link lunghi) */
a, p, span, li, label {
    word-wrap: break-word;
    word-break: break-word;
}

/* ==========================================
   FIX MOBILE EXTRA - evita overflow e riduce larghezza
   ========================================== */

@media (max-width: 768px) {
    body {
        background-attachment: scroll !important; /* evita overflow da fixed bg */
    }

    .page2-content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        width: 100%;
        max-width: 100%;
    }

    .page2-content img {
        max-width: 100% !important;
        height: auto !important;
    }

    .page2-content ul,
    .page2-content ol {
        padding-left: 1.2rem !important;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .page2-content blockquote {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .row.justify-content-center {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-left: 0;
        margin-right: 0;
    }

    .col-12 img {
        max-width: 100% !important;
    }
}

/* Fine CSS */
