/**
 * Table of Contents - Stili
 *
 * @package Magazine Pro
 */

/* Container principale */
.toc-container {
    background-color: rgba(230, 232, 237, .2);
    border: 1px solid #e6e8ed;
    border-radius: 4px;
    margin-bottom: 30px;
    /*margin-top: 20px;*/
    font-size: 14px;
    line-height: 1.2;
}

img + .toc-container {
    margin-top: 20px;
}

/* Bottone toggle */
.toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.toc-toggle:hover {
    color: #ff6668;
    background: none;
}

.toc-toggle:focus {
    outline: none;
    background-color: transparent;
}

.toc-title {
    font-weight: 600;
    font-size: 16px;
    color: #071948;
}

/* Icona chevron */
.toc-icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    margin-left: 10px;
}

.toc-icon::before,
.toc-icon::after {
    content: '';
    position: absolute;
    background-color: #071948;
    transition: transform 0.3s ease;
}

.toc-icon::before {
    width: 10px;
    height: 2px;
    top: 50%;
    left: 2px;
    transform: rotate(45deg);
}

.toc-icon::after {
    width: 10px;
    height: 2px;
    top: 50%;
    right: 2px;
    transform: rotate(-45deg);
}

/* Stato collapsed - ruota icona */
.toc-collapsed .toc-icon::before {
    transform: rotate(-45deg);
}

.toc-collapsed .toc-icon::after {
    transform: rotate(45deg);
}

/* Contenuto TOC */
.toc-content {
    padding: 0 24px 20px;
}

/* Lista principale */
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.entry-content .toc-list {
    padding: 0;
    margin: 0;
    border-top: 1px solid #e6e8ed;
    padding-top: 12px;
}

.entry-content .toc-list>.toc-item {
    list-style: none;
}

/* Item singolo */
.toc-item {
    margin: 0;
    padding: 0;
}

/* Link */
.toc-link {
    display: block;
    padding: 6px 0;
    color: #071948;
    text-decoration: none;
    transition: color 0.2s ease;
}

.toc-link:hover,
.toc-link:focus {
    color: #ff6668;
}

/* Livello H2 */
.toc-level-2>.toc-link {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.toc-level-2>.toc-link::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    flex-shrink: 0;
    background-color: #071948;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: background-color 0.2s ease;
}


.toc-level-2>.toc-link:hover::before,
.toc-level-2>.toc-link:focus::before {
    background-color: #ff6668;
}

/* Sottolista H3 - indentata */
.entry-content .toc-list .toc-sublist {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.entry-content .toc-list .toc-sublist>li {
    list-style-type: none;
}

/* Livello H3 */
.toc-level-3>.toc-link {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: rgba(7, 25, 72, .6);
    padding: 6px 0;
}

.toc-level-3>.toc-link::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    flex-shrink: 0;
    background-color: rgba(7, 25, 72, .4);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: background-color 0.2s ease;
}

.toc-level-3>.toc-link:hover,
.toc-level-3>.toc-link:focus {
    color: #ff6668;
}

.toc-level-3>.toc-link:hover::before,
.toc-level-3>.toc-link:focus::before {
    background-color: #ff6668;
}

/* Smooth scroll target highlight */
:target {
    scroll-margin-top: 20px;
}

/* Responsive */
@media only screen and (max-width: 600px) {
    .toc-container {
        font-size: 14px;
    }

    .toc-toggle {
        padding: 12px 15px;
    }

    .toc-content {
        padding: 0 15px 15px;
    }

    .toc-sublist {
        padding-left: 15px;
    }

    .toc-link {
        padding: 6px 0;
    }

    .toc-level-3>.toc-link {
        font-size: 13px;
    }
}