/**
 * Global Category Tag System
 * Standardized category display with consistent color coding
 */

/* Category Tag Base Styles */
.category-tag,
.card-category {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

/* Category Color Mapping */
.category-tag.world,
.card-category.world {
    background-color: #e8f4f8;
    color: #0066cc;
    border-left: 3px solid #0066cc;
}

.category-tag.business,
.card-category.business {
    background-color: #f0e8f8;
    color: #7030a0;
    border-left: 3px solid #7030a0;
}

.category-tag.technology,
.card-category.technology {
    background-color: #e8f8f0;
    color: #00a86b;
    border-left: 3px solid #00a86b;
}

.category-tag.sports,
.card-category.sports {
    background-color: #fff8e8;
    color: #ff8c00;
    border-left: 3px solid #ff8c00;
}

.category-tag.entertainment,
.card-category.entertainment {
    background-color: #f8e8f0;
    color: #d946a6;
    border-left: 3px solid #d946a6;
}

.category-tag.politics,
.card-category.politics {
    background-color: #f8e8e8;
    color: #cc0000;
    border-left: 3px solid #cc0000;
}

.category-tag.health,
.card-category.health {
    background-color: #e8f8f0;
    color: #00a86b;
    border-left: 3px solid #00a86b;
}

.category-tag.science,
.card-category.science {
    background-color: #e8f0f8;
    color: #0066cc;
    border-left: 3px solid #0066cc;
}

.category-tag.lifestyle,
.card-category.lifestyle {
    background-color: #f8f0e8;
    color: #cc6600;
    border-left: 3px solid #cc6600;
}

.category-tag.opinion,
.card-category.opinion {
    background-color: #f0f0f0;
    color: #666666;
    border-left: 3px solid #666666;
}

/* Default category (fallback) */
.category-tag.default,
.card-category.default {
    background-color: #f0f0f0;
    color: #666666;
    border-left: 3px solid #666666;
}

/* Category Tag on Article Page */
.article-header .category-tag {
    display: inline-block;
    margin-bottom: 12px;
}

/* Category Label in Cards */
.card .card-category {
    position: relative;
    z-index: 10;
    margin-bottom: 10px;
}

/* Category on Card with Image Overlay (Optional) */
.card-category-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 3px;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-category-overlay.world {
    background-color: #0066cc;
    color: #ffffff;
}

.card-category-overlay.business {
    background-color: #7030a0;
    color: #ffffff;
}

.card-category-overlay.technology {
    background-color: #00a86b;
    color: #ffffff;
}

.card-category-overlay.sports {
    background-color: #ff8c00;
    color: #ffffff;
}

.card-category-overlay.entertainment {
    background-color: #d946a6;
    color: #ffffff;
}

.card-category-overlay.politics {
    background-color: #cc0000;
    color: #ffffff;
}

.card-category-overlay.health {
    background-color: #00a86b;
    color: #ffffff;
}

.card-category-overlay.science {
    background-color: #0066cc;
    color: #ffffff;
}

.card-category-overlay.lifestyle {
    background-color: #cc6600;
    color: #ffffff;
}

.card-category-overlay.opinion {
    background-color: #666666;
    color: #ffffff;
}

.card-category-overlay.default {
    background-color: #666666;
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-tag,
    .card-category {
        font-size: 0.6rem;
        padding: 3px 6px;
    }

    .card-category-overlay {
        font-size: 0.6rem;
        padding: 4px 8px;
        top: 8px;
        left: 8px;
    }
}

/* Modern, unfilled category labels: keep category colors, drop pill backgrounds. */
.category-tag,
.card-category,
.home-story-card-copy .home-section-label,
.related-category-indicator,
.category-badge {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    padding: .12rem 0 .12rem .45rem !important;
    border: 0 !important;
    border-left: 2px solid currentColor !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1.25;
    text-transform: uppercase;
}

.home-story-card-copy .home-section-label {
    align-self: flex-start;
    margin: 0;
}

.related-category-indicator,
.category-badge {
    margin: 0;
}

/* Overlay labels stay legible over photography without a filled pill. */
.card-category-overlay {
    padding: 0 0 .25rem !important;
    border: 0 !important;
    border-bottom: 2px solid rgba(255, 255, 255, .9) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}

/* Contrast-safe category ink for the unfilled tag treatment. */
.category-tag.world, .card-category.world { color: #003d7a !important; }
.category-tag.business, .card-category.business { color: #4a1f66 !important; }
.category-tag.technology, .card-category.technology { color: #006b45 !important; }
.category-tag.sports, .card-category.sports { color: #995500 !important; }
.category-tag.entertainment, .card-category.entertainment { color: #8b2e66 !important; }
.category-tag.politics, .card-category.politics { color: #800000 !important; }
.category-tag.health, .card-category.health { color: #006b45 !important; }
.category-tag.science, .card-category.science { color: #003d7a !important; }
.category-tag.lifestyle, .card-category.lifestyle { color: #804400 !important; }
.category-tag.opinion, .card-category.opinion,
.category-tag.default, .card-category.default { color: #333333 !important; }
.related-category-indicator,
.home-story-card-copy .home-section-label,
.category-badge { color: #9f151b !important; }
