/* ========================= */
/* GENERAL */
/* ========================= */

@font-face {
    font-family: 'Open Sans';
    src: url('../font/Open_Sans/static/OpenSans-Regular.ttf');
}

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

html {
    scroll-behavior: smooth;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: rgba(0, 0, 0, 0.5);
    color: red;
}

::-moz-selection {
    background: rgba(0, 0, 0, 0.85);
    color: red;
}

body {
    font-family: "Open Sans", Arial, sans-serif;
    color: white;
    overflow-x: hidden;

    position: relative;
    min-height: 100vh;

    background: transparent;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;

    background-image: url("../img/background.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    z-index: -2;

    will-change: transform;
    transform: translateZ(0) scale(1.02);
}

/* ========================= */
/* NAVBAR */
/* ========================= */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.nav-left {
    font-size: 1.3rem;
    font-weight: bold;
}

.nav-left a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: white;
    text-decoration: none;
    transition: 0.2s;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    display: block;
}

.nav-logo {
    height: 36px;
    width: auto;
    opacity: 0.9;
}

.nav-title-short {
    display: none;
}

.nav-left a:hover {
    opacity: 0.85;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: lightgray;
    text-decoration: none;
    transition: 0.2s;
}

.nav-links a:hover {
    color: white;
}

.nav-links a.panel-link {
    color: white;
    position: relative; /* necessario per posizionare il pallino */
}

.nav-links a.panel-link::after {
    content: '';
    display: none;
    position: absolute;
    top: 0;
    right: -10px;
    width: 8px;
    height: 8px;
    background: red;
    border-radius: 50%;
}

.nav-links a.panel-link.has-notif::after {
    display: block;
}

.home-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.primary-button {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.15);
}

/* =====================================================
   SEZIONE KARATE
   ===================================================== */

.course-section {
    min-height: 100vh;
    width: 100%;
    display: flex;
}

.course-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: calc(70px + 3rem) 3rem 3rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5rem;
}

/* =====================================================
   COLONNA SINISTRA
   ===================================================== */

.course-info {
    flex: 1.3;
    max-width: 700px;
}

.course-info h2 {
    font-size: 2.8rem;
    margin-bottom: 1.6rem;
    letter-spacing: 1px;
}

.course-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.85;
    margin-bottom: 1.3rem;
    max-width: 62ch;
}

/* =====================================================
   COLONNA DESTRA
   ===================================================== */

.course-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

/* =====================================================
   CARD CORSO
   ===================================================== */

.course-card {
    width: 520px;
    min-height: 160px;
    position: relative;
    overflow: hidden;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.8rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.35);
    transition: 0.25s ease;
}

/* testo "Scopri" */
.course-card::after {
    content: "Scopri";
    position: absolute;
    bottom: 1.4rem;
    right: 1.6rem;

    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;

    color: rgba(255,255,255,0.9);
    opacity: 0;

    transform: translateY(6px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* hover */
.course-card.clickable:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* CARD CLICCABILE */
.course-card.clickable {
    cursor: pointer;
    transition: 0.2s;
}

.course-card.clickable:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.16);
}

/* IMMAGINE PLACEHOLDER */
.course-img {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
}

/* TESTO – stato base */
.course-text {
    transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}

/* TESTO – hover */
.course-card.clickable:hover .course-text {
    transform: translateY(-12px);
}

.course-text h3 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.course-text p {
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.75;
}

/* =====================================================
   MODALE CORSI – VERSIONE DEFINITIVA
   ===================================================== */

.course-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.course-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* CONTENITORE MODALE */
.course-modal {
    width: 90%;
    max-width: 640px;
    padding: 2.8rem;
    border-radius: 26px;

    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.14),
        rgba(255,255,255,0.05)
    );
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.14),
        0 24px 70px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(42px) scale(0.97);
    transition:
        opacity 0.25s ease,
        transform 0.4s cubic-bezier(.22,1,.36,1);
}

.course-modal-overlay.active .course-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* HEADER */
.course-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-modal-header h3 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.45);
    margin: 0;          /* ← fondamentale */
    line-height: 1.1;   /* ← riallinea otticamente */
}

/* BOTTONE CHIUSURA */
.modal-close {
    background: none;
    border: none;
    font-size: 1.9rem;
    color: white;
    cursor: pointer;
    line-height: 1;
    transform: translateY(4.5px);
    transform-origin: center;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
    transform: translateY(4.5px) scale(1.1);
}

/* BODY */
.course-modal-body {
    margin-top: 1.8rem;
}

body.modal-open {
    overflow: hidden;
}

/* SEZIONI */
.modal-section {
    margin-top: 2.2rem;
}

.modal-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.modal-section p {
    font-size: 1.05rem;
    line-height: 1.65;
    opacity: 0.85;
}

/* LISTE */
.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list li {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.85;
    margin-bottom: 0.5rem;
    padding-left: 1.1rem;
    position: relative;
}

.modal-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: rgba(255,255,255,0.55);
}

/* FOOTER */
.course-modal-footer {
    margin-top: 2.4rem;
    display: flex;
    justify-content: flex-end;
}

/* =====================================================
   ANIMAZIONI INGRESSO SEZIONI
   ===================================================== */

/* Stato iniziale */
.course-section .course-info {
    opacity: 0;
    transform: translateX(-40px);
    will-change: opacity, transform;
}

.course-section .course-card {
    opacity: 0;
    transform: translateY(32px);
    will-change: opacity, transform;
}

/* Stato visibile – parte sinistra */
.course-section.is-visible .course-info {
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity 0.6s ease,
        transform 0.6s cubic-bezier(.22,1,.36,1);
}

/* Stato visibile – cards */
.course-section.is-visible .course-card {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.5s ease,
        transform 0.5s cubic-bezier(.22,1,.36,1);
}

/* Cascata leggera (parte subito, no lag) */
.course-section.is-visible .course-card:nth-child(1) {
    transition-delay: 0.06s;
}

.course-section.is-visible .course-card:nth-child(2) {
    transition-delay: 0.12s;
}

.course-section.is-visible .course-card:nth-child(3) {
    transition-delay: 0.18s;
}

/* =====================================================
   ACCESSIBILITÀ – riduzione animazioni
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    .course-section .course-info,
    .course-section .course-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ========================= */
/* FOOTER */
/* ========================= */

.site-footer {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem 2rem 1.5rem;
    color: rgba(255,255,255,0.85);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer .footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-column h4 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

.footer-contact-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.85;
}

.footer-contact-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-contact-item a:hover {
    color: white;
    opacity: 1;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* =====================================================
   MOBILE – max 768px
   ===================================================== */

@media (max-width: 768px) {

    /* =========================
       BODY + BLUR MENU
       ========================= */

    body {
        position: relative;
    }

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: -1;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }

    body.menu-open::before {
        opacity: 0;
    }

    body.menu-open .navbar {
        z-index: 10000;
    }

    body.menu-open .nav-toggle {
        z-index: 10001;
    }

    body.menu-open .page-content {
        filter: blur(12px) brightness(0.5);
        transform: scale(0.98);
    }

    body.menu-open .section,
    body.menu-open .side-panel {
        pointer-events: none;
    }

    .page-content {
        transition: filter 0.25s ease, transform 0.25s ease;
        will-change: filter, transform;
    }

    .navbar,
    .page-content,
    .site-footer {
        position: relative;
        z-index: 1;
    }

    /* =========================
       NAVBAR
       ========================= */

    .navbar {
        height: 70px;
        padding: 0 1rem;
        z-index: 4000;
    }

    .nav-left {
        display: flex;
        align-items: center;
        font-size: 1.05rem;
    }

    .nav-title-full {
        display: none;
    }

    .nav-title-short {
        display: inline;
        font-weight: bold;
        letter-spacing: 1px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        position: relative;
        z-index: 5000;
    }

    .nav-toggle span {
        width: 24px;
        height: 2px;
        background: white;
        display: block;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        padding: 1.5rem 1.2rem 2rem;
        background: rgba(20, 20, 20, 0.55);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 9000;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.05rem;
        padding: 0.4rem 0;
        color: white;
        text-decoration: none;
    }

/* =========================
       CONTAINER SEZIONE
       ========================= */

    .course-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 2.6rem;
        padding: calc(70px + 1.6rem) 1.5rem 2.5rem;
    }

    /* =========================
       COLONNA SINISTRA
       ========================= */

    .course-info h2 {
        font-size: 2.1rem;
    }

    .course-info p {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* CTA nascosta su mobile */
    .course-info .home-buttons {
        display: none;
    }

    /* =========================
       COLONNA DESTRA
       ========================= */

    .course-cards {
        width: 100%;
        gap: 1.8rem;
    }

    /* =========================
       CARD CORSO – LAYOUT MOBILE
       ========================= */

    .course-card {
        width: 100%;
        position: relative;
        padding: 1.6rem 1.4rem 2.6rem;
        align-items: flex-start;
    }

    /* Disattiva hover inutili su mobile */
    .course-card.clickable:hover {
        transform: none;
        background: rgba(255,255,255,0.12);
    }

    /* =========================
       IMMAGINE – IN ALTO A DESTRA
       ========================= */

    .course-img {
        position: absolute;
        top: 1.2rem;
        right: 1.2rem;
        width: 64px;
        height: 64px;
        border-radius: 14px;
        opacity: 0.9;
    }

    /* =========================
       TESTO
       ========================= */

    .course-text {
        margin-right: 4.8rem; /* spazio per immagine */
        transform: none !important;
    }

    .course-text h3 {
        font-size: 1.35rem;
        margin-bottom: 0.35rem;
    }

    .course-text p {
        font-size: 0.95rem;
        line-height: 1.45;
        opacity: 0.8;
    }

    /* =========================
       CTA “SCOPRI” + LINEA (OPZIONE B)
       ========================= */

    /* Testo CTA */
    .course-card::after {
        content: "Scopri";
        position: absolute;
        bottom: 1.4rem;
        right: 1.6rem;

        font-size: 0.85rem;
        letter-spacing: 1px;
        text-transform: uppercase;

        color: rgba(255,255,255,0.9);
        opacity: 1;
        transform: none;
    }

    /* Linea a sinistra di “Scopri” */
    .course-card::before {
        content: "";
        position: absolute;
        bottom: 1.9rem;
        left: 1.6rem;
        right: 7.2rem;
        height: 1px;
        background: linear-gradient(
            to right,
            rgba(255,255,255,0.25),
            rgba(255,255,255,0.05)
        );
    }

    /* =========================
       ANIMAZIONI INGRESSO – MOBILE
       ========================= */

    /* Stato iniziale */
    .course-section .course-info {
        opacity: 0;
        transform: translateY(32px);
    }

    .course-section .course-card {
        opacity: 0;
        transform: translateY(28px);
    }

    /* Stato visibile */
    .course-section.is-visible .course-info {
        opacity: 1;
        transform: translateY(0);
        transition:
            opacity 0.55s ease,
            transform 0.55s cubic-bezier(.22,1,.36,1);
    }

    .course-section.is-visible .course-card {
        opacity: 1;
        transform: translateY(0);
        transition:
            opacity 0.45s ease,
            transform 0.45s cubic-bezier(.22,1,.36,1);
    }

    /* Cascata leggera */
    .course-section.is-visible .course-card:nth-child(1) {
        transition-delay: 0.08s;
    }

    .course-section.is-visible .course-card:nth-child(2) {
        transition-delay: 0.16s;
    }

    .course-section.is-visible .course-card:nth-child(3) {
        transition-delay: 0.24s;
    }

    /* =========================
       ACCESSIBILITÀ
       ========================= */

    @media (prefers-reduced-motion: reduce) {
        .course-section .course-info,
        .course-section .course-card {
            opacity: 1;
            transform: none;
            transition: none;
        }
    }

    .course-modal {
        max-height: calc(100dvh - 4.5rem); /* ↓ più bassa di prima */
        padding: 2.1rem 2rem 2rem;         /* ↓ padding più compatto */
        display: flex;
        flex-direction: column;
        padding-bottom: calc(2.2rem + env(safe-area-inset-bottom));
    }

    .course-modal-body {
        overflow-y: auto;
        padding-right: 0.4rem; /* evita taglio testo con scrollbar */
    }

    .course-modal-footer {
        flex-shrink: 0;
    }

    /* =========================
       FOOTER – CENTRATO
       ========================= */

    .site-footer {
        padding-top: 2.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .site-footer .footer-column {
        align-items: center;
        text-align: center;
    }

    .footer-contact-item {
        justify-content: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom {
        font-size: 0.75rem;
        padding: 1rem 0 0.5rem;
    }
}
