/**
 * Taxonomy Overview CSS (shared by categories + tags overview pages)
 * Path: public_html/css/taxonomy-overview.css
 * Version: 2.3.0
 *
 * Changelog v2.2.0:
 * - Card header heading selectors now target both h2 and h3 for flexible heading hierarchy
 *
 * Changelog v2.1.0:
 * - Fix WCAG AA contrast on .tax-overview-tag-count (light: #94a3b8→#556477, dark: #777→#aaa)
 *
 * Changelog v2.0.0:
 * - Renamed from categories-overview.css to taxonomy-overview.css
 * - All class prefixes changed: cat-overview-* → tax-overview-*
 * - Now shared between all_categories_view.php and all_tags_view.php
 *
 * Changelog v1.4.0:
 * - Category titles use h2 tags with proper styling
 *
 * Changelog v1.3.0:
 * - Tags now vertical list matching tools column style
 *
 * Changelog v1.2.0:
 * - Card body: tags + tools side-by-side (two-column layout)
 * - Tools column: vertical list of up to 5 tools
 * - Removed view-all link styles (link removed from view)
 *
 * Changelog v1.1.0:
 * - Centered view-all link text
 *
 * Styles for the redesigned taxonomy overview pages (categories + tags).
 */

/* ====================================================================
   TAXONOMY CARDS GRID - 2-column layout
   ==================================================================== */
.tax-overview-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Center the last card if odd number */
.tax-overview-grid > .tax-overview-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 538px;
    justify-self: center;
    width: 100%;
}

/* ====================================================================
   TAXONOMY CARD
   ==================================================================== */
.tax-overview-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
    .tax-overview-card:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        border-color: #cbd5e1;
    }
}

/* ====================================================================
   CARD HEADER - emoji + name link + count badge
   ==================================================================== */
.tax-overview-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 0;
}

.tax-overview-card-header h2,
.tax-overview-card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.tax-overview-card-header h2 a,
.tax-overview-card-header h3 a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    transition: color 0.15s ease;
}

@media (hover: hover) {
    .tax-overview-card-header h2 a:hover,
    .tax-overview-card-header h3 a:hover {
        color: #3b82f6;
    }
}

.tax-overview-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tax-overview-count {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* ====================================================================
   CARD BODY - Two-column: left taxonomy items, right tools
   ==================================================================== */
.tax-overview-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 20px 18px;
}

/* ====================================================================
   LEFT COLUMN - taxonomy items (tags or categories) with counts
   ==================================================================== */
.tax-overview-tags {
    min-width: 0;
}

.tax-overview-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tax-overview-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tax-overview-tag:hover {
    color: #3b82f6;
}

.tax-overview-tag-count {
    font-size: 0.7rem;
    color: #556477;
    font-weight: 500;
}

/* ====================================================================
   RIGHT COLUMN - vertical list of tool links
   ==================================================================== */
.tax-overview-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tax-overview-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tax-overview-tool:hover {
    color: #3b82f6;
}

.tax-overview-tool-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: contain;
    background: #f8fafc;
    flex-shrink: 0;
}

/* ====================================================================
   SECTION HEADING above taxonomy grid
   ==================================================================== */
.tax-overview-section-heading {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 16px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
}

/* ====================================================================
   RESPONSIVE - Tablet (card grid → 1 col, card body stays 2 cols)
   ==================================================================== */
@media (max-width: 768px) {
    .tax-overview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px 40px;
    }

    .tax-overview-grid > .tax-overview-card:last-child:nth-child(odd) {
        max-width: none;
    }

    .tax-overview-card-header {
        padding: 16px 16px 0;
    }

    .tax-overview-body {
        padding: 12px 16px 16px;
    }

    .tax-overview-section-heading {
        padding: 32px 16px 12px;
        font-size: 1.25rem;
    }
}

/* ====================================================================
   RESPONSIVE - Small mobile (card body stacks to 1 col)
   ==================================================================== */
@media (max-width: 480px) {
    .tax-overview-grid {
        padding: 0 12px 30px;
        gap: 14px;
    }

    .tax-overview-card-header {
        padding: 14px 14px 0;
    }

    .tax-overview-card-header h2,
    .tax-overview-card-header h3 {
        font-size: 1.1rem;
    }

    .tax-overview-body {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px 14px 14px;
    }
}

/* ====================================================================
   DARK MODE
   ==================================================================== */
[data-theme="dark"] .tax-overview-card {
    background: #252525;
    border-color: #3d3d3d;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
    [data-theme="dark"] .tax-overview-card:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        border-color: #555;
    }
}

[data-theme="dark"] .tax-overview-card-header h2,
[data-theme="dark"] .tax-overview-card-header h2 a,
[data-theme="dark"] .tax-overview-card-header h3,
[data-theme="dark"] .tax-overview-card-header h3 a {
    color: #e4e4e4;
}

@media (hover: hover) {
    [data-theme="dark"] .tax-overview-card-header h2 a:hover,
    [data-theme="dark"] .tax-overview-card-header h3 a:hover {
        color: #6db3f2;
    }
}

[data-theme="dark"] .tax-overview-count {
    background: #333333;
    color: #aaaaaa;
}

[data-theme="dark"] .tax-overview-tag {
    color: #ccc;
}

[data-theme="dark"] .tax-overview-tag:hover {
    color: #6db3f2;
}

[data-theme="dark"] .tax-overview-tag-count {
    color: #aaaaaa;
}

[data-theme="dark"] .tax-overview-tool {
    color: #ccc;
}

[data-theme="dark"] .tax-overview-tool:hover {
    color: #6db3f2;
}

[data-theme="dark"] .tax-overview-tool-logo {
    background: #333;
}

[data-theme="dark"] .tax-overview-section-heading {
    color: #e4e4e4;
}

/* ====================================================================
   HIGH CONTRAST
   ==================================================================== */
@media (prefers-contrast: high) {
    .tax-overview-card {
        border: 2px solid #000;
    }

    [data-theme="dark"] .tax-overview-card {
        border-color: #fff;
    }
}

/* ====================================================================
   REDUCED MOTION
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
    .tax-overview-card,
    .tax-overview-tag,
    .tax-overview-tool,
    .tax-overview-card-header h2 a,
    .tax-overview-card-header h3 a {
        transition: none;
    }
}
