/* /app/static/significantstories_com/css/toc-cards.css */
/* Stories page - Visual Cards Layout (Alternative) */

/* --- Layout Toggle Link --- */
.layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5a6a7a;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.layout-toggle:hover {
    color: #3498db;
    border-color: #3498db;
    background-color: #f0f7fc;
}

.layout-toggle svg {
    opacity: 0.7;
}

/* --- Topic Tabs --- */
.topics-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.topic-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #5a6a7a;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.topic-tab:hover {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.08);
}

.topic-tab.active {
    color: #34495e;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --- Articles List --- */
.articles-grid-container {
    padding: 1rem 1.5rem 1.5rem;
}

.articles-grid {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #e8eef3;
}

.articles-grid.active {
    display: flex;
}

/* --- Article Card (Link inside wrapper) --- */
.article-card {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
    /* Wrapper handles padding, background, and hover - link just contains icon + title */
}

.article-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #34495e;
    line-height: 1.4;
    transition: color 0.2s ease;
}

/* Title color change on wrapper hover */
.article-card-wrapper:hover .article-card-title {
    color: #3498db;
}

.article-card-arrow {
    display: none;
}

/* --- Article Badges --- */
.article-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.article-badge.start-here {
    background-color: #d4edda;
    color: #155724;
}

.article-badge.or-here {
    background-color: #fff3cd;
    color: #856404;
}

/* --- Topic Tab with Practice Icons --- */
.topic-tab-title {
    /* Default display */
}

.topic-tab-practices {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 0.5rem;
}

.topic-tab-practice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #8b7355;
    opacity: 0.7;
}

.topic-tab-practice-icon svg {
    width: 16px;
    height: 16px;
}

.topic-tab.active .topic-tab-practice-icon {
    color: #ffffff;
    opacity: 0.9;
}

/* --- Article Card Practice Icons --- */
.article-card-practices {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: auto;
    flex-shrink: 0;
}

.article-card-practice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #8b7355;
    opacity: 0.6;
}

.article-card-practice-icon svg {
    width: 16px;
    height: 16px;
}

/* Increase opacity on wrapper hover since practices are outside the link */
.article-card-wrapper:hover .article-card-practice-icon {
    opacity: 0.8;
}

/* --- Filtered Out State (Cards) --- */
/* Hide filtered elements (unified with list view behavior) */
.topic-tab.filtered-out {
    display: none !important;
}

.article-card.filtered-out,
.article-card-wrapper.filtered-out {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .series-card-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .series-card-header h2 {
        font-size: 1.5rem;
    }

    .topics-tabs {
        padding: 0.75rem 1.25rem;
    }

    .topic-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        min-width: unset;
    }

    .articles-grid-container {
        padding: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .article-card {
        gap: 0.25rem;
    }

    .article-card-title {
        font-size: 0.85rem;
    }

    /* Smaller practice icons on mobile */
    .article-card-practice-icon {
        width: 16px;
        height: 16px;
    }

    .article-card-practice-icon svg {
        width: 14px;
        height: 14px;
    }

    .article-card-practices {
        gap: 0.25rem;
    }

    .layout-toggle {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* --- Reading State Icons for Card View --- */

.article-card .reading-state-icon {
    flex-shrink: 0;
}

.article-card .reading-state-icon svg {
    width: 16px;
    height: 16px;
}

/* Tooltip positioning adjustment for cards */
.article-card .reading-state-tooltip {
    bottom: auto;
    top: calc(100% + 4px);
    left: 0;
    transform: none;
}

.article-card .reading-state-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #2c3e50;
}

/* =============================================================================
   PUBLISH STATE STYLING (Early/Preview content)
   ============================================================================= */

/* Combined: Background Tint + Left Border Accent */
.article-card-wrapper.state-early {
    background: linear-gradient(135deg, #f6faf5 0%, #eef4ec 100%);
    border-left: 4px solid #9ab392;
}

.article-card-wrapper.state-preview {
    background: linear-gradient(135deg, #f4faf9 0%, #e8f4f2 100%);
    border-left: 4px solid #7dbdb4;
}
