.image-placeholder {
    width: fit-content;
    max-width: 100%;
    background: rgba(139, 69, 19, 0.1);
    border: 2px dashed #d4a574;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    color: #8B4513;
    font-style: italic;
    margin: 20px auto;
    break-inside: avoid;
    font-size: 0.95rem;
    text-align: center;
    padding: 10px;
}

.image-placeholder img {
    max-width: 100%;
    height: auto; 
    max-height: 180px;  
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.figure-caption {
    font-size: 0.8rem;
    color: #333;
    text-align: center;
    font-style: italic;
    line-height: 1.3;
    padding: 0 10px;
    margin: 0 0 20px 0; 
}

/* References Section */
.references-section {
margin-top: 3rem;
}

.references-toggle {
background: linear-gradient(135deg, #043160, #1e5289);
color: white;
padding: 1rem 1.5rem;
border-radius: 8px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(4, 49, 96, 0.3);
}

.references-toggle:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(4, 49, 96, 0.4);
}

.references-title {
color: white;
font-size: 1.3rem;
font-weight: 700;
margin: 0;
}

.references-arrow {
font-size: 1.5rem;
transition: transform 0.3s ease;
}

.references-toggle.active .references-arrow {
transform: rotate(180deg);
}

.references-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.4s ease-out;
background: white;
border: 1px solid #e0e0e0;
border-top: none;
border-radius: 0 0 8px 8px;
}

.references-content.expanded {
max-height: 3000px;
overflow-y: auto;
}

.references-list {
padding: 2rem;
list-style: none;
margin: 0;
}

.references-list li {
margin-bottom: 1rem;
padding: 0.8rem;
background: #f8f9fa;
border-left: 4px solid var(--par-title-color);
border-radius: 4px;
line-height: 1.5;
font-size: 0.9rem;
}

/* Cycles Grid */
.cycles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin: 60px 0;
    padding: 40px 20px;
}

.cycles-grid {
    display: grid;
    justify-items: center;
    grid-template-columns: repeat(6, 1fr);
    gap: 40px;
    margin: 60px 0 40px 0;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 2px solid #e0e0e0;
}

.cycle-container:nth-child(1) { grid-column: 1 / 3; }
.cycle-container:nth-child(2) { grid-column: 3 / 5; }
.cycle-container:nth-child(3) { grid-column: 5 / 7; }
.cycle-container:nth-child(4) { grid-column: 2 / 4; }
.cycle-container:nth-child(5) { grid-column: 4 / 6; }


.cycle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cycle-container:hover {
    transform: translateY(-10px);
}

.cycle {
    width: 250px;
    height: 250px;
    position: relative;
    transition: all 0.3s ease;
}

.cycle:hover {
    filter: brightness(1.1);
}

.cycle-container:active,
.cycle-container:focus {
    transform: none !important;
}

.cycle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cycle-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 140px;
    height: 140px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.cycle-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    padding: 10px;
}

/* Cycle Sections */
.cycle-section {
    background: white;
    padding: 40px;
    margin: 40px 0;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-left: 6px solid;
}

.cycle-section h3 {
    font-size: 2em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cycle-section h4 {
    font-size: 1.5em;
    margin: 30px 0 15px 0;
    color: #444;
}

.cycle-section p {
    margin: 15px 0;
    font-size: 1.05em;
    line-height: 1.8;
}

.phase {
    background: #f8f9fa;
    padding: 25px;
    margin: 25px 0;
    border-radius: 10px;
    border-left: 4px solid;
}

.phase h5 {
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 600;
}

.phase ul {
    margin-left: 25px;
}

.phase li {
    margin: 10px 0;
    line-height: 1.6;
}

.sub-cycle {
    background: #f8f9fa;
    padding: 30px;
    margin: 30px 0;
    border-radius: 10px;
    border-left: 4px solid;
}

.sub-cycle h4 {
    text-align: center;
    font-weight: 600;
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Color schemes */
.green { border-color: #27ae60; }
.green .phase { border-color: #27ae60; }
.green .sub-cycle { background-color: #afface8b; }

.purple { border-color: #8e44ad; }
.purple .phase { border-color: #8e44ad; }
.purple .sub-cycle { background-color: #e8b2ff86; }

.orange { border-color: #e67e22; }
.orange .phase { border-left-color: #e67e22; }
.orange .sub-cycle { background-color: #eec29b96; }

.blue { border-color: #3498db; }
.blue .phase { border-left-color: #3498db; }
.blue .sub-cycle { background-color: #8fcef8a5; }

.pink { border-color: #e91e63; }
.pink .phase { border-color: #e91e63; }
.pink .sub-cycle { background-color: #faadc78b; }

.cyan { border-color: #00bcd4; }
.cyan .phase { border-left-color: #00bcd4; }
.cyan .sub-cycle { background-color: #b5f6ff8a; }

/*.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.5em;
}*/

/*.back-to-top:hover {
    background: #764ba2;
    transform: translateY(-5px);
}*/

/* BUTTONS */
.btn-download {
    background: linear-gradient(135deg, #7d3c98, #5b2c6f);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(125, 60, 152, 0.4);
    color: white;
}

@media (max-width: 768px) {
    .cycles-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .cycle {
        width: 200px;
        height: 200px;
    }
    
    .cycle-center {
        width: 120px;
        height: 120px;
    }
}

/* -----------------------
    Styles for interactive sub-cycles (modular)
    -----------------------*/
.dbtl-container-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 15px;
}

.dbtl-main-small {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    max-width: 820px;
    width: 100%;
}

.dbtl-cycle-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cycle-visual-small {
    width: 150px;
    height: 150px;
    position: relative;
}

.cycle-visual-small svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));

}

.cycle-visual-small .segment {
    opacity: 0.2;
    transition: opacity 0.4s ease;
}

.cycle-visual-small .segment.active {
    opacity: 1;
}

.segment {
    opacity: 0.88;
    transition: all 0.35s ease;
}


.cycle-center-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.phase-label-small {
    font-size: 0.95em;
    font-weight: 700;
    color: #2c3e50;
}

.phase-content-small {
    flex: 1;
    min-height: 140px;
    position: relative;
}

.phase-text-small {
    display: none;
    animation: dbtlFade 0.28s ease;
}

.phase-text-small.active {
    display: block;
}

.phase-text-small h5 {
    font-size: 1.15em;
    margin-bottom: 10px;
    font-weight: 700;
}

.phase-text-small p {
    font-size: 1em;
    line-height: 1.7;
    color: #444;
}

@keyframes dbtlFade {
    from { opacity: 0; transform: translateX(6px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Arrow button (reused for small cycles) */
/*.arrow-btn {
    background: var(--arrow-bg, #00000066);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    flex-shrink: 0;
}

.arrow-btn:hover {
    transform: scale(1.08);
}*/

/* Arrow button (reused for small cycles) */
.arrow-btn {
    background: var(--arrow-bg, #00000066);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    flex-shrink: 0;
    
    /* Necessario per il pseudo-elemento */
    position: relative;
}

/* Area cliccabile espansa (invisibile) */
.arrow-btn::before {
    content: '';
    position: absolute;
    /* Espandi l'area di 15px in tutte le direzioni */
    top: 100px;
    bottom: 100px;
    left: 0;
    right: 0;
    /* Opzionale: per debug, puoi vedere l'area */
    /* background: rgba(255, 0, 0, 0.1); */
}

.arrow-btn:hover {
    transform: scale(1.08);
}

.cycle-container.active .cycle-center {
background: #f0f0f0;
box-shadow: 0 0 20px rgba(0,0,0,0.15);
transform: translate(-50%, -50%) scale(1.05);
transition: all 0.3s ease;
}

.cycle-container.active .cycle-title {
color: #000;
}

@media (max-width: 768px) {
    .dbtl-container-small {
        flex-direction: column;
    }

    .dbtl-main-small {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .arrow-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1em;
    }

    .prev-btn { order: -1; } /* put prev on top on mobile */
}

@media (max-width: 768px) {
    /* Regole già esistenti */
    .cycles-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .cycle {
        width: 200px;
        height: 200px;
    }
    
    .cycle-center {
        width: 120px;
        height: 120px;
    }

    .dbtl-container-small {
        flex-direction: column;
    }

    .dbtl-main-small {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .arrow-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1em;
    }

    .prev-btn { order: -1; }

    /* AGGIUNGI QUESTE NUOVE REGOLE ↓ */
    
    /* Cicli - mobile layout */
    .cycles-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
        padding: 20px 10px;
    }

    .cycle-container:nth-child(1),
    .cycle-container:nth-child(2),
    .cycle-container:nth-child(3),
    .cycle-container:nth-child(4),
    .cycle-container:nth-child(5) {
        grid-column: auto !important;
    }

    /* Sezioni cicli */
    .cycle-section {
        padding: 20px;
        margin: 20px 0;
    }

    .cycle-section h3 {
        font-size: 1.5em;
        flex-direction: column;
        gap: 10px;
    }

    .cycle-section h4 {
        font-size: 1.2em;
    }

    .cycle-section p {
        font-size: 0.95em;
    }

    /* Sub-cycles */
    .sub-cycle {
        padding: 20px;
        margin: 20px 0;
    }

    .sub-cycle h4 {
        font-size: 1.2em;
    }

    /* Cicli visual piccoli */
    .cycle-visual-small {
        width: 120px;
        height: 120px;
    }

    .cycle-center-small {
        width: 80px;
        height: 80px;
    }

    .phase-label-small {
        font-size: 0.8em;
    }

    /* Contenuto fasi */
    .phase-text-small {
        font-size: 0.9em;
    }

    .phase-text-small h5 {
        font-size: 1em;
    }

    .phase-text-small p {
        font-size: 0.9em;
        line-height: 1.6;
    }

    /* Immagini */
    .image-placeholder {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .image-placeholder img {
        max-height: 250px;
    }

    /* Bottoni download */
    .btn-download {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin: 5px 0;
    }

    /* References */
    .references-section {
        margin-top: 2rem;
    }

    .references-toggle {
        padding: 0.8rem 1rem;
    }

    .references-title {
        font-size: 1.1rem;
    }

    .references-list {
        padding: 1rem;
    }

    .references-list li {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
}

/* Mobile molto piccolo */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
        padding: 0 10px;
    }

    .cycle {
        width: 150px;
        height: 150px;
    }

    .cycle-center {
        width: 90px;
        height: 90px;
    }

    .cycle-title {
        font-size: 1em;
    }

    .cycle-section {
        padding: 15px;
    }

    .cycle-section h3 {
        font-size: 1.3em;
    }
}


