/*
 * Science Post Theme - Blue science colors (same as Space Book)
 */

:root {
    /* Primary colors */
    --color-primary: #1b277b;
    --color-primary-light: #2f6f9e;
    --color-section-bg: #def1f3;

    /* Gradients */
    --gradient-primary: linear-gradient(90deg, #1b277b, #2f6f9e);
    --gradient-sidebar: linear-gradient(180deg, #1b277b 0%, #2f6f9e 100%);
    --gradient-button: linear-gradient(135deg, #1b277b, #2f6f9e);
    --gradient-welcome: linear-gradient(135deg, #def1f3 0%, #e8f4f8 100%);

    /* Tooltip */
    --color-tooltip-bg: rgba(27, 39, 123, 0.95);
}

/* Filter visibility rules */
.filter-container:has(#filter-physics:checked) ~ .content .section[data-tags*="physics"] {
    display: block;
}

.filter-container:has(#filter-astronomy:checked) ~ .content .section[data-tags*="astronomy"] {
    display: block;
}

.filter-container:has(#filter-biology:checked) ~ .content .section[data-tags*="biology"] {
    display: block;
}

.filter-container:has(#filter-earth:checked) ~ .content .section[data-tags*="earth"] {
    display: block;
}

/* Filter chip active states */
#filter-all:checked ~ .quick-filter-bar label[for="filter-all"],
#filter-physics:checked ~ .quick-filter-bar label[for="filter-physics"],
#filter-astronomy:checked ~ .quick-filter-bar label[for="filter-astronomy"],
#filter-biology:checked ~ .quick-filter-bar label[for="filter-biology"],
#filter-earth:checked ~ .quick-filter-bar label[for="filter-earth"] {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(27, 39, 123, 0.3);
}

#filter-all:checked ~ .quick-filter-bar label[for="filter-all"] .chip-count,
#filter-physics:checked ~ .quick-filter-bar label[for="filter-physics"] .chip-count,
#filter-astronomy:checked ~ .quick-filter-bar label[for="filter-astronomy"] .chip-count,
#filter-biology:checked ~ .quick-filter-bar label[for="filter-biology"] .chip-count,
#filter-earth:checked ~ .quick-filter-bar label[for="filter-earth"] .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* MathML equation styling */
.details-body math {
    display: inline-block;
    margin: 0.4em 0 0.2em 1.5em;
    font-size: 1.2em;
}

/* TOC sync rules */
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#tree-of-life"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#viruses"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#expanding-cosmos"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#plate-tectonics"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#snowball-earth"],
body:has(#filter-physics:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#tree-of-life"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#viruses"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#standard-model"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#maxwells-equations"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#plate-tectonics"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#snowball-earth"],
body:has(#filter-astronomy:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#gravitational-waves"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#standard-model"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#maxwells-equations"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#expanding-cosmos"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#plate-tectonics"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#snowball-earth"],
body:has(#filter-biology:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#gravitational-waves"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#standard-model"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#maxwells-equations"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#expanding-cosmos"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#tree-of-life"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#viruses"],
body:has(#filter-earth:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}
