/* Reset stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0f0f0;
}

.main-header {
    /* Gradiente di sfondo fedele all'immagine */
    background: linear-gradient(to bottom, #1e2a3a 0%, #2c343f 40%, #8e94a0 100%);
    height: 500px; /* Regola l'altezza secondo le tue necessità */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 20px;
    position: relative;
}

/* Titoli */
.title {
    font-size: 5rem; /* Molto grande e bold */
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 2.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #cbd5e0; /* Grigio chiaro/azzurrato */
    margin-bottom: 30px;
}

/* Bottone HOME */
.home-button-container {
    margin-bottom: 40px;
}

.home-btn {
    background-color: #000;
    color: white;
    text-decoration: none;
    padding: 10px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.2s;
    display: inline-block;
}

.home-btn:hover {
    transform: scale(1.05);
}

/* Navbar a forma di pillola */
.navbar-container {
    background-color: white;
    padding: 10px 30px;
    border-radius: 100px; /* Crea l'effetto pillola */
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: absolute;
    bottom: 30px; /* Posiziona la barra in fondo all'header */
}

.navbar {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar li {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 1px solid #ddd; /* Separatori tra voci */
}

.navbar li:last-child {
    border-right: none;
}

.navbar a {
    text-decoration: none;
    color: #000;
    font-weight: 800;
    font-size: 0.85rem;
    text-align: center;
    padding: 5px 10px;
    line-height: 1.2;
}

.navbar a:hover {
    color: #555;
}

/* Responsive per schermi piccoli */
@media (max-width: 768px) {
    .title { font-size: 2.5rem; }
    .subtitle { font-size: 1.2rem; }
    .navbar-container { 
        border-radius: 20px;
        bottom: 10px;
    }
    .navbar { flex-wrap: wrap; }
    .navbar li { border-right: none; margin: 5px 0; }
}






/* --- Linea sotto le voci della NAVBAR quando attive --- */
.navbar li.active a {
    position: relative;
    font-weight: 900; /* Rende il testo leggermente più marcato */
}

.navbar li.active a::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;      /* Linea lunga quanto la parola */
    height: 3px;
    background-color: #000;
    border-radius: 5px;
}





.foto-universo-section {
    padding: 40px 20px;
    background-color: #ffffff;
    font-family: sans-serif; /* O il font del tuo sito */
    text-align: center;
}

.fu-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #eee;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.fu-logo {
    max-width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.fu-title {
    font-size: 1.8rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #222;
}

.fu-author {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 10px;
}

.fu-date {
    display: inline-block;
    background: #f0f0f0;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 30px;
}

.fu-content {
    text-align: left;
    line-height: 1.6;
    color: #444;
}

.fu-text {
    margin-bottom: 15px;
}

.fu-highlight {
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-style: italic;
}








/* Container principale */
.custom-kb-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Griglia flessibile */
.custom-kb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

/* Struttura della Card (ora è un tag <a>) */
.custom-kb-card {
    text-decoration: none; /* Rimuove sottolineatura link */
    color: inherit; /* Mantiene il colore del testo */
    background-color: #f2f2f2;
    border: 2px solid #000000;
    border-radius: 45px;
    width: 190px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                background-color 0.3s ease;
}

/* Effetto Hover (Ingrandimento) */
.custom-kb-card:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
}

/* Effetto Click (Pressione) */
.custom-kb-card:active {
    transform: scale(0.96);
}

/* Box Icona */
.custom-kb-icon-box {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-kb-icon-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Testo */
.custom-kb-text {
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 15px;
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
    line-height: 1.1;
}

/* Responsive Mobile */
@media (max-width: 500px) {
    .custom-kb-card {
        width: 150px;
        height: 200px;
        border-radius: 35px;
    }
    .custom-kb-icon-box {
        width: 75px;
        height: 75px;
    }
    .custom-kb-text {
        font-size: 12px;
    }
}

.custom-kb-card:hover .custom-kb-icon-box {
    transform: translateY(-5px); /* Fa saltare l'icona verso l'alto di 5px */
    transition: transform 0.3s ease;
}


/* Container principale */
.custom-kb-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
}

.custom-kb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* Struttura della Card */
.custom-kb-card {
    position: relative;
    text-decoration: none;
    color: inherit;
    background-color: #f2f2f2;
    border-radius: 45px;
    width: 190px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    overflow: hidden; /* Fondamentale per la scia */
    box-sizing: border-box;
    z-index: 1;
    /* Bordo nero base */
    border: 3px solid #000;
    /* Transizioni per ingrandimento e click */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

/* La scia arcobaleno che ruota */
.custom-kb-card::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    /* Gradiente arcobaleno a raggio stretto per fare l'effetto "scia" */
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        transparent 70%,
        #ff0000 75%,
        #ffff00 80%,
        #00ff00 85%,
        #00ffff 90%,
        #0000ff 95%,
        #ff00ff 100%
    );
    top: -25%;
    left: -25%;
    z-index: -1;
    animation: rotate-scia 2s linear infinite;
    opacity: 0; /* Nascosta di base */
    transition: opacity 0.3s ease;
}

/* Copertura interna per mantenere il bordo sottile */
.custom-kb-card::after {
    content: '';
    position: absolute;
    inset: 3px; /* Stessa dimensione del bordo */
    background: #f2f2f2;
    border-radius: 41px;
    z-index: -1;
    transition: background-color 0.3s ease;
}

/* Keyframes Rotazione */
@keyframes rotate-scia {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- STATI DELLA CARD --- */

/* Hover: mostra la scia arcobaleno e ingrandisce */
.custom-kb-card:hover {
    transform: scale(1.08);
    border-color: rgba(0,0,0,0.1); /* Il bordo nero diventa quasi trasparente per far vedere l'arcobaleno sotto */
}

.custom-kb-card:hover::before {
    opacity: 1;
}

.custom-kb-card:hover::after {
    background-color: #ffffff;
}

/* Click: Effetto pressione mantenuto */
.custom-kb-card:active {
    transform: scale(0.95);
}

/* Icona e Testo */
.custom-kb-icon-box {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.custom-kb-icon-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.custom-kb-text {
    font-family: 'Arial Black', sans-serif;
    font-size: 15px;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
    z-index: 2;
}