/* ============================================================
   Autoimmune Archive — Main Stylesheet
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --blue:        #1a6fe8;
    --blue-dark:   #1558bc;
    --blue-light:  #e8f2ff;
    --nav-bg:      #1a2744;
    --nav-text:    #d6e8ff;
    --footer-bg:   #f0f5fb;
    --text:        #1f2937;
    --text-light:  #6b7280;
    --text-muted:  #9ca3af;
    --border:      #e5e9f0;
    --white:       #ffffff;
    --red-accent:  #c0392b;
    --max-width:   1200px;
    --radius:      6px;
    --card-radius: 12px;
    --font-body:   'Roboto', 'Segoe UI', Arial, sans-serif;
    --font-heading:'Roboto Slab', Georgia, serif;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,.09);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); line-height: 1.6; background: #fff; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Inline prose links must be underlined so they're distinguishable without relying on color alone (WCAG 1.4.1) */
.hero-intro a,
.rich-content a:not(.btn):not(.tag-pill),
.page-content a:not(.btn),
.library-section a:not(.btn):not(.tag-pill):not(.btn-visit-source),
.condition-section a:not(.btn):not(.tag-pill),
.resource-section a:not(.btn):not(.tag-pill) {
    text-decoration: underline;
}
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ── Accessibility utilities ─────────────────────────────── */
/* Screen-reader only — visually hidden but announced */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--blue);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 700;
    font-size: .9rem;
    z-index: 9999;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Global focus indicator — visible for keyboard users only */
:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 2px;
}
/* Remove default outline only when :focus-visible is supported */
:focus:not(:focus-visible) { outline: none; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .article-card:hover, .research-card:hover,
    .condition-card:hover, .resource-card:hover,
    .book-card:hover, .video-card:hover,
    .feature-block:hover { transform: none !important; }
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header { background: #fff; border-bottom: 1px solid var(--border); }

/* ── Top Bar ─────────────────────────────────────────────── */
.header-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.header-logo { flex: 0 0 auto; }
.logo-img    { max-height: 90px; width: auto; }
.logo-text   { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.site-tagline {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-light);
    max-width: 220px;
    line-height: 1.3;
    margin-top: .25rem;
}

.header-center { flex: 1; padding-top: .25rem; }
.search-form {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    max-width: 600px;
    position: relative;
}
.search-ac-wrap {
    flex: 1;
    position: relative;
}
.search-form input {
    width: 100%;
    border: none;
    padding: .5rem .75rem;
    font-size: .95rem;
    outline: none; /* focus shown on .search-ac-wrap container below */
    border-radius: var(--radius) 0 0 var(--radius);
    background: #fff;
}
.search-form input:focus-visible { outline: none; }
.search-ac-wrap:focus-within { box-shadow: 0 0 0 3px rgba(7,94,221,.35); border-radius: var(--radius); }
.search-form button {
    background: #f0f0f0;
    border: none;
    border-left: 1px solid var(--border);
    padding: .5rem .85rem;
    cursor: pointer;
    color: var(--text-light);
    transition: background .2s;
    border-radius: 0 var(--radius) var(--radius) 0;
    flex-shrink: 0;
}
.search-form button:hover { background: var(--blue-light); color: var(--blue); }
.search-hint { font-size: .82rem; color: var(--text-light); margin-top: .4rem; font-style: italic; }

/* ── Autocomplete dropdown ── */
.search-ac-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    list-style: none !important;
    margin: 0;
    padding: .3rem 0;
    z-index: 1000;
}
.search-ac-dropdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .85rem;
    cursor: pointer;
    gap: .75rem;
    font-size: .9rem;
    color: var(--text);
    transition: background .1s;
}
.search-ac-dropdown li:hover,
.search-ac-dropdown li.ac-active { background: var(--blue-light); }
.ac-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-type {
    font-size: .68rem;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-light);
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    flex-shrink: 0;
    padding: .15rem .5rem;
    border-radius: 20px;
    border: 1px solid #c5d9f5;
}

/* ── Search results page ── */
.search-results-page { padding-top: 2rem; padding-bottom: 3rem; }
.search-results-header { margin-bottom: 1rem; }
.search-results-header h1 { font-size: 1.8rem; }
.search-results-header h1 i { color: var(--blue); margin-right: .3rem; }

.search-results-form {
    display: flex;
    gap: 0;
    max-width: 640px;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.search-results-form input {
    flex: 1;
    border: none;
    padding: .65rem 1rem;
    font-size: 1rem;
    outline: none; /* focus shown on .search-results-form container */
}
.search-results-form:focus-within { box-shadow: 0 0 0 3px rgba(7,94,221,.35); }
.search-results-form button {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: .65rem 1.25rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.search-results-form button:hover { background: var(--blue-dark); }

.search-prompt, .search-no-results { color: var(--text-light); font-size: 1rem; }
.search-result-count { color: var(--text-light); font-size: .95rem; margin-bottom: 1.5rem; }

.search-group { margin-bottom: 2.5rem; }
.search-group-heading {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--blue-light);
    margin-bottom: 1rem;
}
.search-group-heading i { color: var(--blue); }
.search-group-count {
    margin-left: auto;
    font-size: .8rem;
    font-weight: 600;
    background: var(--blue-light);
    color: var(--blue);
    padding: .15rem .55rem;
    border-radius: 20px;
}

.search-result-list { list-style: none !important; margin: 0; padding: 0; }
.search-result-item {
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue);
    display: block;
    margin-bottom: .2rem;
}
.search-result-title:hover { text-decoration: underline; }
.search-result-excerpt {
    font-size: .875rem;
    color: var(--text-light);
    margin: .2rem 0 .3rem;
    line-height: 1.5;
}
.search-result-url {
    font-size: .75rem;
    color: #5a8a5a;
    display: block;
}

.header-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    padding-top: .25rem;
}
.medical-disclaimer-link {
    color: var(--red-accent);
    font-style: italic;
    font-size: .9rem;
    font-weight: 500;
}
.medical-disclaimer-link:hover { text-decoration: underline; }
.btn-suggest {
    background: var(--blue);
    color: #fff;
    padding: .45rem 1rem;
    border-radius: 20px;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s;
}
.btn-suggest:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

/* ── Primary Nav ─────────────────────────────────────────── */
#primary-nav { background: var(--nav-bg); box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.nav-menu {
    display: flex;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    gap: 0;
}

.nav-item { position: relative; }

/* Shared style for nav links AND keyboard-trigger buttons */
.nav-item > a,
.nav-item > .nav-trigger {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .65rem .9rem;
    color: var(--nav-text);
    font-size: .95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, color .15s;
    border-radius: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: none;
}
.nav-item > a:hover,
.nav-item > .nav-trigger:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-item.active > a,
.nav-item > a[aria-current="page"] { background: rgba(255,255,255,.18); color: #fff; border-radius: var(--radius); font-weight: 600; }
.nav-trigger[aria-expanded="true"] { background: rgba(255,255,255,.1); color: #fff; }

.nav-arrow { font-size: .65rem; margin-left: .15rem; }

/* ── Dropdown ────────────────────────────────────────────── */
.nav-item.has-dropdown > .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    min-width: 200px;
    z-index: 1000;
    padding: .4rem 0;
}
/* Show on hover (mouse) OR when JS opens it (keyboard) */
.nav-item.has-dropdown:hover > .dropdown-menu,
.nav-item.has-dropdown > .dropdown-menu[data-open] { display: block; }
.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 1rem;
    color: var(--text);
    font-size: .875rem;
    transition: background .15s;
}
.dropdown-menu li a:hover,
.dropdown-menu li a[aria-current="page"] { background: var(--blue-light); text-decoration: none; }
.dropdown-menu li a[aria-current="page"] { color: var(--blue); font-weight: 600; }

/* ── Mega Menu ───────────────────────────────────────────── */
.nav-item.has-mega > .mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
    z-index: 1000;
    padding: 1.25rem;
    min-width: 1100px;
}
.nav-item.has-mega:hover > .mega-menu,
.nav-item.has-mega > .mega-menu[data-open] { display: block; }

.mega-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
}
.mega-item {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: .75rem;
    border-radius: var(--radius);
    color: var(--text);
    transition: background .15s;
}
.mega-item:hover { background: var(--blue-light); text-decoration: none; }
.mega-icon { font-size: 1.75rem; color: var(--blue); margin-bottom: .4rem; }
.mega-label { font-weight: 600; font-size: 1rem; }
.mega-desc  { font-size: 0.75rem; color: var(--text-light); margin-top: .2rem; line-height: 1.3; overflow-wrap: break-word; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer { background: var(--nav-bg); margin-top: 3rem; color: var(--nav-text); }

.footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

/* Left */
.footer-left { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem; }
.footer-logo { max-height: 70px; width: auto; }
.footer-qr   { max-width: 140px; }
.footer-bmac-text { font-size: .82rem; color: #8fafd4; max-width: 240px; }
.btn-bmac {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #6241c5;
    color: #fff;
    padding: .55rem 1.25rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: .9rem;
    transition: background .2s;
}
.btn-bmac:hover { background: #4e32a0; text-decoration: none; color: #fff; }

/* Middle — footer nav */
.footer-middle .nav-menu { flex-direction: column; align-items: flex-start; padding: 0; gap: 0; }
.footer-middle .nav-item > a,
.footer-middle .nav-item > .nav-trigger { padding: .3rem 0; font-size: .9rem; color: #8fafd4; font-weight: 400; }
.footer-middle .nav-item > a:hover,
.footer-middle .nav-item > .nav-trigger:hover { text-decoration: underline; background: none; color: #fff; }
.footer-middle .nav-item > a[aria-current="page"] { background: none !important; color: #fff !important; font-weight: 700; text-decoration: underline; border-radius: 0; }

/* Right */
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1.25rem; }
.btn-back-to-top {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--blue);
    color: #fff;
    padding: .45rem 1rem;
    border-radius: 20px;
    font-size: .875rem;
    font-weight: 600;
    transition: background .2s;
}
.btn-back-to-top:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

.footer-social h4 { font-size: 1rem; margin-bottom: .6rem; text-align: right; color: var(--nav-text); }
.social-icons { display: flex; gap: .5rem; justify-content: flex-end; }
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    transition: opacity .2s;
}
.social-icon:hover { opacity: .85; text-decoration: none; color: #fff; }
.social-icon--facebook { background: #1877f2; }
.social-icon--twitter  { background: #000; }
.social-icon--youtube  { background: #ff0000; }

/* Footer bottom bar */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    text-align: center;
    padding: .85rem 1.25rem;
    font-size: .8rem;
    color: #8fafd4;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .header-top    { flex-wrap: wrap; }
    .header-center { order: 3; flex: 0 0 100%; }
    .footer-main   { grid-template-columns: 1fr; }
    .footer-right  { align-items: flex-start; }
    .footer-social h4 { text-align: left; }
    .social-icons  { justify-content: flex-start; }
    .nav-menu      { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .header-actions { flex-direction: row; align-items: center; }
    .mega-menu      { min-width: calc(100vw - 2rem); left: 0; transform: none; }
}

/* ============================================================
   RICH TEXT / TINYMCE CONTENT
   ============================================================ */
.page-content ul,
.card-body ul,
.rich-content ul {
    list-style: disc !important;
    padding-left: 1.75rem !important;
    margin-bottom: .75rem;
}
.page-content ol,
.card-body ol,
.rich-content ol {
    list-style: decimal !important;
    padding-left: 1.75rem !important;
    margin-bottom: .75rem;
}
.page-content ul li,
.page-content ol li,
.card-body ul li,
.card-body ol li,
.rich-content ul li,
.rich-content ol li {
    margin-bottom: .25rem;
    display: list-item !important;
}
.page-content p,
.rich-content p { margin-bottom: .75rem; }
.page-content h1,.page-content h2,.page-content h3,
.page-content h4,.page-content h5,.page-content h6,
.rich-content h1,.rich-content h2,.rich-content h3,
.rich-content h4,.rich-content h5,.rich-content h6 {
    margin-top: 1.25rem;
    margin-bottom: .5rem;
}

/* ============================================================
   HOMEPAGE SECTIONS (index.php)
   ============================================================ */
.hero {
    padding: 3.5rem 0 2.5rem;
    background: linear-gradient(135deg, var(--blue-light) 0%, #fff 55%);
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.4rem; margin-bottom: .85rem; line-height: 1.2; }
.hero-intro { max-width: 860px; line-height: 1.8; font-size: 1.05rem; }
.hero-intro strong { color: var(--blue); }

.features { padding: 2.5rem 0 2.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-block {
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, transform .25s;
}
.feature-block:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon { font-size: 3rem; color: var(--blue); margin-bottom: .75rem; display: block; }
.feature-icon:hover { color: var(--blue-dark); text-decoration: none; }
.feature-block h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.feature-block h2 a { color: var(--text); }
.feature-block h2 a:hover { color: var(--blue); text-decoration: none; }
.feature-block p  { font-size: .9rem; color: var(--text-light); line-height: 1.6; }

.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: var(--max-width);
    margin: 1.5rem auto;
    padding: 0 1.25rem;
    color: var(--border);
}
.section-divider::before,
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider-icon { font-size: 1.1rem; flex-shrink: 0; }

.home-section { padding: 1.5rem 0 2.5rem; }
.home-section--shaded { background: var(--footer-bg); padding: 2rem 0; }
.section-title { font-size: 1.6rem; margin-bottom: 1.25rem; }

.card-grid { display: grid; gap: 1.5rem; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }

.article-card, .research-card {
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, transform .25s;
}
.article-card:hover, .research-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-image-link { position: relative; display: block; overflow: hidden; }
.card-image-link img { width: 100%; height: 200px; object-fit: cover; transition: transform .3s; }
.card-image-link:hover img { transform: scale(1.03); }
.card-badge {
    position: absolute;
    top: .6rem;
    right: .6rem;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .7rem;
    padding: .2rem .5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.card-body  { padding: 1rem; flex: 1; }
.card-body h3 { font-size: 1rem; margin-bottom: .4rem; line-height: 1.4; }
.card-body h3 a { color: var(--blue); }
.card-body h3 a:hover { text-decoration: underline; }
.card-excerpt { font-size: .875rem; color: var(--text-light); margin-bottom: .6rem; }
.read-more { font-size: .875rem; font-weight: 700; color: var(--blue); display: inline-block; margin-top: .5rem; }
.read-more:hover { text-decoration: underline; }
.card-date { padding: .5rem 1rem; font-size: .78rem; color: var(--text-light); border-top: 1px solid var(--border); }

.research-card .card-body { padding: 1rem; }

.product-card { border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden; background: #fafafa; transition: box-shadow .3s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.product-card img { width: 100%; height: 180px; object-fit: contain; padding: .5rem; }
.product-card .card-body { padding: .75rem 1rem 1rem; text-align: center; }
.product-card h3 { font-size: .875rem; margin-bottom: .4rem; color: var(--blue); }
.product-price { font-size: .95rem; font-weight: 600; margin-bottom: .5rem; }
.btn-buynow {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: .4rem .9rem;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    transition: background .2s;
}
.btn-buynow:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

.no-content { color: var(--text-light); font-style: italic; }

.pagination { text-align: center; margin-top: 1.5rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pagination a {
    display: inline-block;
    padding: .35rem .7rem;
    background: #eeeeee;
    border-radius: 4px;
    font-size: .875rem;
    color: var(--text);
    transition: background .15s;
}
.pagination a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.pagination a.active { background: var(--blue); color: #fff; font-weight: 700; }

@media (max-width: 900px) {
    .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .card-grid--3, .card-grid--4, .feature-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CONDITIONS — LISTING PAGE
   ============================================================ */
.conditions-listing-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.conditions-listing-header { margin-bottom: 1.5rem; }
.conditions-listing-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.conditions-listing-header h1 i { color: var(--blue); margin-right: .3rem; }
.conditions-listing-header p { color: var(--text-light); }

.conditions-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.conditions-controls-left { flex-shrink: 0; }

#disease-select {
    font-size: .9rem;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 200px;
}

.az-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    flex: 1;
}
.az-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--blue);
    transition: background .15s;
}
.az-link:hover { background: var(--blue-light); text-decoration: none; }
.az-link.active { background: var(--blue); color: #fff; }
.az-link.az-empty { color: #ccc; pointer-events: none; }

.az-group { margin-bottom: 2.5rem; }
.az-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blue);
    border-bottom: 2px solid var(--blue-light);
    padding-bottom: .3rem;
    margin-bottom: 1rem;
}

.conditions-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.condition-card {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, border-color .25s, transform .25s;
}
.condition-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
    transform: translateY(-2px);
    text-decoration: none;
}
.condition-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: calc(var(--card-radius) - 2px);
    margin: -.25rem -.25rem .5rem -.25rem;
    width: calc(100% + .5rem);
}
.condition-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--blue);
    line-height: 1.3;
}
.condition-card-aka {
    font-size: .78rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.3;
}
.condition-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: auto;
    padding-top: .5rem;
}

/* ============================================================
   CONDITIONS — STATUS BADGES
   ============================================================ */
.condition-status-badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.condition-status-badge.small { font-size: .72rem; padding: .15rem .5rem; }
.badge-confirmed { background: #d4edda; color: #155724; }
.badge-disputed  { background: #fff3cd; color: #856404; }
.badge-emerging  { background: #cce5ff; color: #004085; }
.badge-unknown   { background: #e2e3e5; color: #383d41; }

.condition-system-tag {
    display: inline-block;
    padding: .2rem .6rem;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
}
.condition-system-tag:hover { text-decoration: none; background: var(--blue); color: #fff; }
.condition-system-tag.small { font-size: .72rem; padding: .15rem .5rem; }

/* ============================================================
   CONDITIONS — DETAIL PAGE
   ============================================================ */
.condition-hero {
    background: linear-gradient(135deg, var(--blue-light) 0%, #fff 60%);
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}
.condition-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}
.condition-hero-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--card-radius);
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.condition-hero-text { flex: 1; }
.condition-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.condition-hero-text h1 { font-size: 2rem; margin-bottom: .4rem; }
.condition-aka { font-size: .95rem; color: var(--text-light); margin-bottom: .3rem; }
.condition-organ { font-size: .9rem; color: var(--text-light); }

.condition-nav-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}
.condition-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.condition-section-nav a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .7rem 1rem;
    font-size: .875rem;
    color: var(--text);
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.condition-section-nav a:hover {
    color: var(--blue);
    border-bottom-color: var(--blue);
    text-decoration: none;
}

.condition-body { padding-top: 2rem; padding-bottom: 3rem; }
.condition-section {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.condition-section:last-child { border-bottom: none; }
.condition-section > h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
}
.condition-section > h2 i { color: var(--blue); font-size: 1.2rem; }

.antibody-table-wrap { overflow-x: auto; }
.antibody-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.antibody-table th, .antibody-table td {
    padding: .6rem .9rem;
    text-align: left;
    border: 1px solid var(--border);
}
.antibody-table th { background: var(--footer-bg); font-weight: 600; }
.antibody-table tr:hover td { background: #fafafa; }

.related-group { margin-bottom: 2rem; }
.related-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.related-group-header h3 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.related-group-header h3 i { color: var(--blue); }
.related-view-all {
    font-size: .875rem;
    font-weight: 600;
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}
.related-view-all:hover { text-decoration: underline; }

.condition-viewall-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.condition-viewall-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    color: var(--text-light);
}
.condition-viewall-breadcrumb a { color: var(--blue); }
.condition-viewall-breadcrumb a:hover { text-decoration: underline; }
.condition-viewall-breadcrumb .sep { color: var(--border); }
.condition-viewall-page h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.condition-viewall-count { color: var(--text-light); font-size: .9rem; margin-bottom: 1.5rem; }
.card-body h4 { font-size: .95rem; margin-bottom: .3rem; line-height: 1.4; }
.card-body h4 a { color: var(--blue); }
.card-body h4 a:hover { text-decoration: underline; }

.citations-list {
    list-style: decimal !important;
    padding-left: 1.5rem !important;
    font-size: .875rem;
    color: var(--text-light);
    line-height: 1.7;
}
.citations-list li { margin-bottom: .6rem; }
.citation-link { margin-left: .35rem; font-size: .8rem; color: var(--blue); }

@media (max-width: 700px) {
    .condition-hero-inner { flex-direction: column; }
    .condition-hero-img { width: 100%; height: 220px; }
    .conditions-list-item { flex-direction: column; align-items: flex-start; }
    .conditions-list-meta { justify-content: flex-start; }
}

/* ============================================================
   RESOURCES — LISTING PAGE
   ============================================================ */
.resources-listing-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.resources-listing-header { margin-bottom: 1.5rem; }
.resources-listing-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.resources-listing-header h1 i { color: var(--blue); margin-right: .3rem; }
.resources-listing-header p { color: var(--text-light); }

.resources-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.resource-card {
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, transform .25s;
}
.resource-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.resource-card-img-link { display: block; overflow: hidden; }
.resource-card-img-link img { width: 100%; height: 180px; object-fit: cover; transition: transform .3s; }
.resource-card-img-link:hover img { transform: scale(1.03); }
.resource-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.resource-card-type {
    font-size: .75rem;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.resource-card-body h3 { font-size: 1rem; line-height: 1.4; margin: 0; }
.resource-card-body h3 a { color: var(--text); }
.resource-card-body h3 a:hover { color: var(--blue); text-decoration: none; }
.resource-card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: .5rem;
}
.btn-visit-resource-sm {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--blue);
    padding: .3rem .65rem;
    border: 1px solid var(--blue);
    border-radius: 20px;
    transition: background .15s, color .15s;
}
.btn-visit-resource-sm:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* ============================================================
   RESOURCES — DETAIL PAGE
   ============================================================ */
.resource-detail-hero {
    background: linear-gradient(135deg, var(--blue-light) 0%, #fff 60%);
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}
.resource-detail-inner {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}
.resource-detail-img {
    width: 220px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--card-radius);
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.resource-detail-text { flex: 1; }
.resource-type-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .6rem;
}
.resource-detail-text h1 { font-size: 2rem; margin-bottom: .5rem; }
.resource-excerpt { color: var(--text-light); font-size: 1rem; margin-bottom: 1rem; line-height: 1.6; }
.btn-visit-resource {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--blue);
    color: #fff;
    padding: .75rem 1.6rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background .2s;
}
.btn-visit-resource:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

.resource-store-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }

.btn-appstore {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.6rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.btn-appstore--apple { background: #000; color: #fff; }
.btn-appstore--apple:hover { background: #333; color: #fff; text-decoration: none; }
.btn-appstore--android { background: #01875f; color: #fff; }
.btn-appstore--android:hover { background: #016b4c; color: #fff; text-decoration: none; }

.resource-body { padding-top: 2rem; padding-bottom: 3rem; }
.resource-section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.resource-section:last-child { border-bottom: none; }
.resource-section > h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.resource-section > h2 i { color: var(--blue); }

.resource-group { margin-bottom: 3rem; }
.resource-group-heading {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--blue-light);
    color: var(--text);
}

.resources-categories-heading {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
}
.resources-latest-heading {
    margin-top: 3rem;
}
.resources-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
    font-size: .9rem;
    color: var(--text-light);
}
.resources-breadcrumb a { color: var(--blue); }
.resources-breadcrumb a:hover { text-decoration: underline; }
.resources-breadcrumb .sep { color: var(--border); }

.resources-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.resource-category-card {
    background: #fff;
    border: 1px solid #d0d8e4;
    border-radius: 10px;
    padding: 1.25rem 1.5rem 1.5rem;
    transition: box-shadow .2s;
}
.resource-category-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.resource-category-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .85rem; color: var(--text); }
.resource-category-card h3 a { color: var(--blue); }
.resource-category-card h3 a:hover { text-decoration: underline; }
.resource-category-card ul { list-style: disc !important; padding-left: 1.35rem !important; margin: 0; }
.resource-category-card ul li { margin-bottom: .35rem; font-size: .9rem; }
.resource-category-card ul li a { color: var(--blue); }
.resource-category-card ul li a:hover { text-decoration: underline; }

@media (max-width: 900px) { .resources-category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .resources-category-grid { grid-template-columns: 1fr; } }

.tag-pill-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-pill {
    display: inline-block;
    padding: .35rem .85rem;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 20px;
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.tag-pill:hover { background: var(--blue); color: #fff; text-decoration: none; }

@media (max-width: 700px) {
    .resource-detail-inner { flex-direction: column; }
    .resource-detail-img { width: 100%; height: 200px; }
}

/* ============================================================
   LIBRARY — SHARED (articles, research, books, videos)
   ============================================================ */
.library-listing-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.library-listing-header { margin-bottom: 1.5rem; }
.library-listing-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.library-listing-header h1 i { color: var(--blue); margin-right: .3rem; }
.library-listing-header p { color: var(--text-light); margin: 0; }

.library-type-badge {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .25rem .7rem;
    border-radius: 3px;
    margin-bottom: .75rem;
}

.library-detail-hero {
    background: linear-gradient(135deg, var(--blue-light) 0%, #fff 60%);
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
}
.library-detail-hero h1 { font-size: 2rem; margin: .5rem 0 .75rem; line-height: 1.3; }
.library-detail-hero .container { max-width: 860px; }
.library-detail-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: var(--card-radius);
    margin-bottom: 1.25rem;
}
.library-detail-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.library-detail-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .875rem;
    color: var(--text-light);
    margin-bottom: .75rem;
}
.library-detail-byline i { color: var(--blue); margin-right: .3rem; }
.library-detail-byline a { color: var(--blue); }
.library-detail-byline a:hover { text-decoration: underline; }
.library-detail-excerpt {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-top: .5rem;
}

.library-body {
    padding-top: 2rem;
    padding-bottom: 3rem;
    max-width: 860px;
}
.library-section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.library-section:last-child { border-bottom: none; }
.library-section > h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.library-section > h2 i { color: var(--blue); }

.btn-visit-source {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--blue);
    color: #fff;
    padding: .55rem 1.25rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: .95rem;
    transition: background .2s;
}
.btn-visit-source:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

/* ── Product shortcode block ── */
.sc-product-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: .75rem 1rem;
    margin: 1.5rem 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sc-product-img {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f4f6f9;
}
.sc-product-img img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}
.sc-product-img-placeholder { font-size: 1.75rem; color: #ccc; }
.sc-product-info { flex: 1; min-width: 0; }
.sc-product-title {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.45;
    display: block;
    text-decoration: none;
}
.sc-product-title:hover { color: var(--blue); text-decoration: none; }
.sc-product-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    min-width: 110px;
}
.sc-product-btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: .5rem 1.1rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s;
    text-align: center;
    width: 100%;
}
.sc-product-btn:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.sc-product-source { font-size: .75rem; color: var(--text-light); }
.sc-product-price  { font-size: .8rem; font-weight: 600; color: var(--text); }

@media (max-width: 500px) {
    .sc-product-block { flex-wrap: wrap; }
    .sc-product-action { flex-direction: row; min-width: 0; width: 100%; }
    .sc-product-btn { width: auto; }
}

/* ── Author bio ── */
.author-bio {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: #f9f9f9;
    border: 1px solid #c5d9f5;
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
}
.author-bio-icon {
    font-size: 2rem;
    color: var(--blue);
    flex-shrink: 0;
    margin-top: .1rem;
}
.author-bio-content h4 { font-size: 1rem; margin-bottom: .4rem; }
.author-bio-content p  { font-size: .875rem; color: var(--text); line-height: 1.65; margin-bottom: .6rem; }
.author-bio-content a  { font-size: .875rem; font-weight: 600; color: var(--blue); }
.author-bio-content a:hover { text-decoration: underline; }

/* ── Article disclaimer ── */
.article-disclaimer {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #f9f9f9;
    border: 1px solid #f0c040;
    border-left: 4px solid #e6a817;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 2rem;
    font-size: .85rem;
    color: var(--text);
    line-height: 1.6;
}
.article-disclaimer__icon {
    color: #e6a817;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.article-disclaimer p { margin: 0; }
.article-disclaimer a { color: var(--blue); font-weight: 600; }
.article-disclaimer a:hover { text-decoration: underline; }

/* ── Type filter pills ── */
.library-type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.75rem;
}
.type-filter-pill {
    display: inline-block;
    padding: .35rem .9rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .875rem;
    color: var(--text-light);
    background: #fff;
    transition: background .15s, color .15s, border-color .15s;
}
.type-filter-pill:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.type-filter-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

.lib-listing-disclaimer {
    font-size: .8rem;
    color: var(--text-muted);
    background: #f8f8f8;
    border-left: 3px solid var(--border);
    padding: .55rem .85rem;
    border-radius: 0 4px 4px 0;
    margin-bottom: 2.25rem;
}
.lib-listing-disclaimer i { margin-right: .35rem; opacity: .7; }
.lib-listing-disclaimer a { color: inherit; text-decoration: underline; }

/* ── Filter dropdowns ── */
.lib-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.25rem;
    background: #f5f7fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem 1rem;
    margin-bottom: 2rem;
}
.lib-filter-group {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.lib-filter-select {
    padding: .3rem .55rem;
    border: 1px solid #c8cdd6;
    border-radius: 4px;
    font-size: .875rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 170px;
}

.lib-condition-filters { margin-top: -.75rem; }
.lib-filter-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    align-self: center;
    white-space: nowrap;
}

/* ── Library pagination ── */
.lib-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin-top: 2.5rem;
}
.lib-page-btn {
    display: inline-block;
    padding: .4rem .85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--text);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.lib-page-btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.lib-page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

/* ── Article card tweak ── */
.card-type-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}

/* ============================================================
   LIBRARY — RESEARCH
   ============================================================ */
.research-hero .library-detail-hero { background: var(--footer-bg); }
.research-date { font-size: .9rem; color: var(--text-light); }
.research-authors { font-size: .95rem; color: var(--text-light); margin-bottom: .75rem; }
.research-authors i { color: var(--blue); margin-right: .3rem; }
.research-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.research-meta-row i { color: var(--blue); margin-right: .3rem; }

.research-summary-box {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--text);
}

.research-abstract {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

/* Research listing: use a stacked list instead of cards */
.research-list { display: flex; flex-direction: column; gap: 0; }
.research-list-item {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}
.research-list-item:first-child { border-top: 1px solid var(--border); }
.research-list-body { flex: 1; }
.research-list-body h3 { font-size: 1rem; margin-bottom: .25rem; line-height: 1.4; }
.research-list-body h3 a { color: var(--blue); }
.research-list-body h3 a:hover { text-decoration: underline; }
.research-list-authors { font-size: .85rem; color: var(--text-light); margin-bottom: .35rem; }
.research-list-meta { display: flex; gap: .75rem; font-size: .8rem; color: var(--text-light); margin-top: .4rem; }
.research-list-meta span::after { content: '·'; margin-left: .75rem; }
.research-list-meta span:last-child::after { content: ''; }

/* ============================================================
   LIBRARY — BOOKS
   ============================================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.book-card {
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, transform .25s;
}
.book-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.book-card-cover-link { display: block; background: #f0f0f0; }
.book-card-cover-link img { width: 100%; height: 280px; object-fit: cover; display: block; }
.book-card .card-body { flex: 1; display: flex; flex-direction: column; }
.book-card-author { font-size: .85rem; color: var(--text-light); margin-bottom: .35rem; }
.book-card-actions { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: .5rem; }
.btn-buy-sm {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--blue);
    padding: .3rem .65rem;
    border: 1px solid var(--blue);
    border-radius: 20px;
    transition: background .15s, color .15s;
}
.btn-buy-sm:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* Book detail */
.book-detail-page { padding-top: 2rem; padding-bottom: 3rem; }
.book-detail-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.book-cover-col { flex-shrink: 0; width: 220px; }
.book-cover-img {
    width: 100%;
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 1rem;
}
.book-info-col { flex: 1; }
.book-info-col h1 { font-size: 1.8rem; margin: .4rem 0 .6rem; line-height: 1.3; }
.book-author { font-size: 1rem; color: var(--text-light); margin-bottom: .75rem; }
.book-author i { color: var(--blue); margin-right: .3rem; }
.book-meta-row { display: flex; gap: 1.25rem; font-size: .875rem; color: var(--text-light); margin-bottom: .75rem; flex-wrap: wrap; }
.book-meta-row i { color: var(--blue); margin-right: .3rem; }
.book-excerpt { font-size: 1rem; color: var(--text-light); line-height: 1.65; margin-bottom: 1rem; }
.btn-buy-book {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--blue);
    color: #fff;
    padding: .6rem 1.4rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: .95rem;
    transition: background .2s;
}
.btn-buy-book:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

.book-review {
    background: var(--blue-light);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

@media (max-width: 700px) {
    .book-detail-layout { flex-direction: column; }
    .book-cover-col { width: 100%; max-width: 260px; }
}

/* ============================================================
   LIBRARY — VIDEOS
   ============================================================ */
.video-card { border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s; }
.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.video-thumb-link { position: relative; display: block; overflow: hidden; background: #111; }
.video-thumb-link img { width: 100%; height: 180px; object-fit: cover; opacity: .85; transition: opacity .25s; }
.video-thumb-link:hover img { opacity: 1; }
.video-thumb-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: rgba(255,255,255,.3);
    font-size: 3rem;
}
.video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.85);
    font-size: 2.5rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
    transition: color .2s;
}
.video-thumb-link:hover .video-play-icon { color: #fff; }
.video-date { font-size: .85rem; color: var(--text-light); }

/* Video embed */
.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: #000;
    margin-bottom: 1.5rem;
}
.video-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.video-detail-page { padding-bottom: 3rem; }

/* ============================================================
   SUGGEST A RESOURCE — PUBLIC FORM
   ============================================================ */
.suggest-page { padding-top: 2rem; padding-bottom: 3rem; max-width: 780px; }
.suggest-header { margin-bottom: 2rem; }
.suggest-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.suggest-header h1 i { color: var(--blue); margin-right: .3rem; }
.suggest-header p { color: var(--text-light); }

.suggest-success {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #edfaf3;
    border: 1px solid #a3d9b8;
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.suggest-success i { font-size: 2rem; color: #1e8c4e; flex-shrink: 0; }
.suggest-success strong { display: block; margin-bottom: .3rem; font-size: 1.05rem; }
.suggest-success p { margin: 0; color: var(--text-light); }

.suggest-errors {
    background: #fff3f3;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    color: #721c24;
}
.suggest-errors ul { margin: 0; padding-left: 1.25rem; }

/* Honeypot — visually hidden but not display:none (bots detect that) */
.suggest-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.suggest-form { display: flex; flex-direction: column; gap: 1.25rem; }

/* Type selector grid */
.suggest-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
}
.type-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .9rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: border-color .15s, color .15s, background .15s;
    user-select: none;
}
.type-option input[type="radio"] { display: none; }
.type-option i { color: var(--blue); font-size: 1rem; }
.type-option:hover { border-color: var(--blue); color: var(--text); }
.type-option.selected { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 600; }

/* Fields */
.suggest-field { display: flex; flex-direction: column; gap: .35rem; }
.suggest-field label { font-size: .9rem; font-weight: 600; color: var(--text); }
.suggest-field input[type="text"],
.suggest-field input[type="url"],
.suggest-field input[type="email"],
.suggest-field input[type="date"],
.suggest-field input[type="number"],
.suggest-field select,
.suggest-field textarea {
    padding: .55rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    width: 100%;
    transition: border-color .15s;
}
.suggest-field input:focus-visible,
.suggest-field select:focus-visible,
.suggest-field textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,94,221,.25); }
.suggest-field textarea { resize: vertical; }
.suggest-field .req { color: #c0392b; }
.field-hint { font-size: .8rem; color: var(--text-light); }

.suggest-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

.suggest-type-fields { display: none; flex-direction: column; gap: 1rem; }

.suggest-divider {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.suggest-divider .hint { font-weight: 400; text-transform: none; letter-spacing: 0; }

.btn-suggest-submit {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--blue);
    color: #fff;
    border: none;
    padding: .75rem 1.75rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    align-self: flex-start;
}
.btn-suggest-submit:hover { background: var(--blue-dark); }

@media (max-width: 600px) {
    .suggest-type-grid { grid-template-columns: repeat(2, 1fr); }
}

.suggest-callout {
    background: #fff8e6;
    border: 1px solid #f0c040;
    border-left: 4px solid #e6a817;
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
    font-size: .9rem;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}
.suggest-callout i { color: #e6a817; margin-top: .1rem; flex-shrink: 0; }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page { padding-top: 2rem; padding-bottom: 3rem; }
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: flex-start;
}
.contact-form-col h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.contact-form-col h1 i { color: var(--blue); margin-right: .3rem; }
.contact-intro { color: var(--text-light); margin-bottom: 1.5rem; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.contact-info-col { display: flex; flex-direction: column; gap: 1.25rem; padding-top: 3.5rem; }
.contact-info-card {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
}
.contact-info-card h3 {
    font-size: 1rem;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.contact-info-card h3 i { color: var(--blue); }
.contact-info-card p { font-size: .9rem; color: var(--text-light); margin-bottom: .75rem; }
.contact-info-card ul {
    list-style: disc !important;
    padding-left: 1.25rem !important;
    font-size: .9rem;
    color: var(--text-light);
    margin: 0;
}
.contact-info-card ul li { margin-bottom: .35rem; }
.contact-suggest-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 700;
    color: var(--blue);
}
.contact-suggest-link:hover { text-decoration: underline; }

@media (max-width: 800px) {
    .contact-layout { grid-template-columns: 1fr; }
    .contact-info-col { padding-top: 0; }
}

/* ── Shop ─────────────────────────────────────────────────────── */
.shop-listing-page { padding: 2.5rem 0; }
.shop-listing-title {
    font-size: 2rem;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.shop-listing-title i { color: var(--blue); }
.shop-intro {
    color: var(--text-light);
    font-size: .95rem;
    max-width: 700px;
    margin-bottom: 2.5rem;
}
.shop-section-heading {
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--border);
}

/* Sub-category pills (shown inside a parent category listing) */
.shop-subcategory-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}
.shop-subcat-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--blue-light);
    color: var(--blue-dark);
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s, color .18s;
}
.shop-subcat-pill:hover {
    background: var(--blue);
    color: #fff;
}
.shop-subcat-count {
    background: rgba(0,0,0,.1);
    border-radius: 999px;
    font-size: .75rem;
    padding: .1rem .45rem;
    font-weight: 400;
}

/* Category cards */
.shop-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.shop-category-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}
.shop-category-card:hover {
    border-color: var(--blue);
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    color: var(--blue);
}
.shop-cat-name { font-weight: 700; font-size: 1rem; margin-bottom: .3rem; }
.shop-cat-count { font-size: .8rem; color: var(--text-light); }

/* Product grid */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.shop-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow .18s, transform .18s;
}
.shop-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.shop-card-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f6f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-img-placeholder { font-size: 2.5rem; color: #ccc; }
.shop-card-body { padding: .9rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.shop-card-body h3 { font-size: .95rem; margin: 0; line-height: 1.3; }
.shop-card-excerpt { font-size: .8rem; color: var(--text-light); margin: 0; }
.shop-card-footer { display: flex; flex-direction: column; align-items: center; margin-top: auto; padding-top: .5rem; gap: .35rem; }
.shop-card-price { font-size: 1rem; font-weight: 700; color: var(--blue); }
.shop-card-btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .85rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background .18s;
}
a.shop-product-card:hover .shop-card-btn { background: var(--blue-dark); }

/* Shop breadcrumb */
.shop-breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.shop-breadcrumb a { color: var(--blue); text-decoration: none; }
.shop-breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #bbb; }

/* Shop detail page */
.shop-detail-page { padding: 2.5rem 0; }
.shop-detail-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 3rem;
}
.shop-detail-img {
    width: 100%;
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    display: block;
}
.shop-detail-img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f4f6f9;
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #ccc;
}
.shop-detail-title { font-size: 1.9rem; margin-bottom: .6rem; line-height: 1.2; }
.shop-detail-cats { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.shop-cat-badge {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue);
    border: 1px solid #c5d9f5;
    border-radius: 20px;
    padding: .2rem .75rem;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}
.shop-cat-badge:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.shop-detail-price { font-size: 1.8rem; font-weight: 700; color: var(--blue); margin-bottom: .75rem; }
.shop-detail-excerpt { font-size: 1rem; color: var(--text-light); margin-bottom: 1.5rem; line-height: 1.6; }
.btn-shop-buy {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: .8rem 1.75rem;
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s;
}
.btn-shop-buy:hover { background: #2563eb; color: #fff; }
.shop-affiliate-note { font-size: .75rem; color: var(--text-light); margin-top: .6rem; }
.shop-detail-description { border-top: 1px solid var(--border); padding-top: 2rem; }
.shop-detail-description h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.shop-detail-body { line-height: 1.7; }

/* Homepage product cards — now anchor links */
a.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}
a.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
a.product-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }

@media (max-width: 900px) {
    .shop-detail-layout { grid-template-columns: 1fr; }
    .shop-detail-image-col { max-width: 380px; }
}
@media (max-width: 600px) {
    .shop-product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .shop-category-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ── Digital Products ────────────────────────────────────────── */
.digital-products-page { padding: 2.5rem 0 3rem; }
.digital-products-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.75rem; }

.digital-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.digital-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow .18s, transform .18s;
}
.digital-product-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.dp-card-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f4f6f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dp-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.dp-card-img-placeholder { font-size: 3rem; color: #ccc; }
.dp-card-body {
    padding: 1.1rem 1.1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.dp-card-body h3 { font-size: 1.05rem; font-weight: 700; margin: 0; line-height: 1.3; }
.dp-card-desc { font-size: .875rem; color: var(--text-light); margin: 0; flex: 1; }
.dp-card-btn {
    display: inline-block;
    align-self: flex-start;
    margin-top: .6rem;
    background: var(--blue);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    padding: .35rem 1rem;
    border-radius: 999px;
    transition: background .18s;
}
.digital-product-card:hover .dp-card-btn { background: var(--blue-dark); }

@media (max-width: 900px) {
    .digital-products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .digital-products-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LIBRARY HUB PAGE
   ============================================================ */
.library-hub-page { padding-top: 2rem; padding-bottom: 3rem; }
.library-hub-header { margin-bottom: 2rem; }
.library-hub-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.library-hub-header h1 i { color: var(--blue); margin-right: .3rem; }
.library-hub-header p { color: var(--text-light); }

.library-hub-section {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 3px solid var(--blue-light);
}
.library-hub-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.library-hub-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.library-hub-section-head h2 {
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.library-hub-section-head h2 i { color: var(--blue); }
.library-hub-view-all {
    font-size: .875rem;
    font-weight: 600;
    color: var(--blue);
    white-space: nowrap;
}
.library-hub-view-all:hover { text-decoration: underline; }

/* ============================================================
   TOPICS
   ============================================================ */
.topics-listing-page { padding-top: 2rem; padding-bottom: 3rem; }
.topics-listing-header { margin-bottom: 1.75rem; }
.topics-listing-header h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.topics-listing-header h1 i { color: var(--blue); margin-right: .3rem; }
.topics-listing-header p { color: var(--text-light); }

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.topic-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}
.topic-card:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.topic-card-name { font-weight: 700; font-size: 1rem; color: var(--blue); }
.topic-card-desc { font-size: .85rem; color: var(--text-light); line-height: 1.4; }
.topic-card-count { font-size: .78rem; color: var(--text-light); margin-top: auto; padding-top: .4rem; }

/* Topic detail */
.topic-detail-page { padding-top: 2rem; padding-bottom: 3rem; }
.topic-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}
.topic-breadcrumb a { color: var(--blue); }
.topic-breadcrumb a:hover { text-decoration: underline; }
.topic-breadcrumb .sep { color: #bbb; }

.topic-detail-header { margin-bottom: 2rem; }
.topic-detail-header h1 { font-size: 2rem; margin-bottom: .4rem; }
.topic-detail-header h1 i { color: var(--blue); margin-right: .3rem; }
.topic-detail-desc { font-size: 1rem; color: var(--text-light); max-width: 680px; }

.topic-group {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.topic-group:last-child { border-bottom: none; }
.topic-group h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}
.topic-group h2 i { color: var(--blue); }

.topic-item-list {
    list-style: none !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .4rem .75rem;
    padding: 0 !important;
}
.topic-item-list li a {
    color: var(--blue);
    font-size: .95rem;
}
.topic-item-list li a:hover { text-decoration: underline; }
