/* Stili globali */
.page-content { padding-top: 120px; padding-bottom: 120px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-title { text-align: center; margin-bottom: 80px; }
.section-title h1 { font-size: 3rem; color: var(--highlight-color); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; }
.section-subtitle { font-size: 1.1rem; color: var(--text-color); }
.divider { width: 80px; height: 2px; background-color: var(--accent-color, #4A90E2); margin: 0 auto 20px auto; }

/* Layout a due colonne */
.career-wrapper {
    display: grid;
    grid-template-columns: 1fr 3fr; /* Colonna sinistra più piccola */
    gap: 80px;
    position: relative;
}

/* Colonna sinistra (gradi) */
.rank-list-column {
    position: sticky; /* Rimane fissa durante lo scroll */
    top: 120px; /* Distanza dall'alto (header + padding) */
    height: calc(100vh - 160px); /* Occupa l'altezza visibile */
    overflow: hidden;
}
.rank-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Card 3D */
.rank-card-container {
    width: 120px;
    height: 120px;
    perspective: 1000px; /* Abilita la prospettiva 3D */
    cursor: pointer;
}
.rank-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.rank-card-container:hover .rank-card-inner {
    transform: rotateY(180deg);
}
.rank-card-front, .rank-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Per Safari */
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    background-color: rgba(13, 15, 16, 0.8);
}
.rank-card-front img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: grayscale(1) opacity(0.5); /* Stato di default: desaturato */
}
.rank-card-back {
    background-color: var(--accent-color, #4A90E2);
    color: var(--bg-color);
    transform: rotateY(180deg);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

/* Stato "attivo" per il grado illuminato */
.rank-card-container.active .rank-card-front img {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}
.rank-card-container.active .rank-card-front {
    border-color: var(--highlight-color);
    box-shadow: 0 0 20px var(--accent-color, #4A90E2);
}

/* Colonna destra (descrizioni) */
.rank-description-section {
    min-height: 500px; /* Assicura abbastanza spazio per lo scroll */
    padding-bottom: 80px;
}
.rank-description-section h2 {
    font-size: 2.5rem;
    color: var(--highlight-color);
    margin-bottom: 20px;
    text-transform: uppercase;
}
.rank-description-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}
.rank-description-section h4 {
    font-size: 1.2rem;
    color: var(--highlight-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}
.rank-description-section ul {
    list-style: none;
    padding-left: 20px;
}
.rank-description-section li {
    position: relative;
    margin-bottom: 10px;
    line-height: 1.6;
}
.rank-description-section li::before {
    content: '■';
    position: absolute;
    left: -20px;
    color: var(--accent-color, #4A90E2);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 900px) {
    .career-wrapper {
        grid-template-columns: 1fr; /* Le colonne si impilano */
    }
    .rank-list-column {
        position: relative; /* Rimuove lo sticky */
        top: 0;
        height: auto;
        margin-bottom: 60px;
    }
    .rank-list {
        flex-direction: row; /* Gradi in orizzontale su mobile */
        flex-wrap: wrap;
        justify-content: center;
    }
    .rank-card-container {
        width: 80px;
        height: 80px;
    }
}