/**
 * Article Content Table Styles
 * Theme: Rosso Corsa (Red Theme)
 */

/* Main container */
.article-ctable-container {
    background-color: #f8f8f8;
    border-radius: 8px;
    border-left: 5px solid #D40000; /* Rosso Corsa Red */
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

/* Title styling */
.article-ctable-title {
    color: #D40000; /* Rosso Corsa Red */
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 0, 0, 0.2);
    position: relative;
}

.article-ctable-title:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #D40000; /* Rosso Corsa Red */
}

/* Table of contents list */
.article-ctable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual TOC item */
.article-ctable-item {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.article-ctable-item:hover {
    background-color: rgba(212, 0, 0, 0.08);
    color: #D40000; /* Rosso Corsa Red */
    padding-left: 15px;
}

.article-ctable-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #D40000; /* Rosso Corsa Red */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-ctable-item:hover:before {
    opacity: 1;
}

/* Active TOC item */
.article-ctable-item.active {
    background-color: rgba(212, 0, 0, 0.12);
    color: #D40000; /* Rosso Corsa Red */
    font-weight: 600;
    padding-left: 15px;
}

.article-ctable-item.active:before {
    opacity: 1;
}

/* Heading levels indentation */
.article-ctable-level-1 {
    font-weight: 600;
    font-size: 16px;
}

.article-ctable-level-2 {
    padding-left: 20px;
    font-size: 15px;
}

.article-ctable-level-3 {
    padding-left: 40px;
    font-size: 14px;
}

.article-ctable-level-4,
.article-ctable-level-5,
.article-ctable-level-6 {
    padding-left: 60px;
    font-size: 14px;
    color: #555;
}

/* Error message */
.article-ctable-error {
    color: #666;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* Highlighted content in the article */
.article-heading-highlight {
    animation: headingHighlight 2.5s ease;
    scroll-margin-top: 20vh;
    position: relative;
}

@keyframes headingHighlight {
    0% {
        background-color: rgba(212, 0, 0, 0.25);
        box-shadow: 0 0 15px rgba(212, 0, 0, 0.2);
    }
    20% {
        background-color: rgba(212, 0, 0, 0.25);
        box-shadow: 0 0 15px rgba(212, 0, 0, 0.2);
    }
    80% {
        background-color: rgba(212, 0, 0, 0.1);
        box-shadow: 0 0 10px rgba(212, 0, 0, 0.1);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Additional focus visual effect */
.article-heading-highlight:before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #D40000;
    animation: pulseIndicator 2s ease;
}

@keyframes pulseIndicator {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .article-ctable-container {
        padding: 15px;
    }
    
    .article-ctable-title {
        font-size: 18px;
    }
    
    .article-ctable-level-1 {
        font-size: 15px;
    }
    
    .article-ctable-level-2,
    .article-ctable-level-3,
    .article-ctable-level-4,
    .article-ctable-level-5,
    .article-ctable-level-6 {
        font-size: 14px;
    }
}