/* =========================================
   Research Insights — SEEDBiomed
   Podcast player + insight-specific styles
   ========================================= */

/* Nav bar styles are now in nav.css */

/* ── Podcast Player ───────────────────────── */
.ri-podcast-player {
    background: linear-gradient(135deg, #f0faf4 0%, #e6f4ea 100%);
    border-left: 4px solid #02812c;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 12px rgba(2, 129, 44, 0.08);
}

.ri-podcast-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.ri-podcast-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.ri-podcast-header h3 {
    margin: 0 0 0.25rem;
    color: #1a3a22;
    font-size: 1.1rem;
}

.ri-podcast-desc {
    margin: 0;
    color: #4a7a56;
    font-size: 0.88rem;
}

.ri-player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.ri-play-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 50%;
    border: none;
    background: #02812c;
    color: white;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s, transform 0.1s;
}

.ri-play-btn:hover {
    background: #026b24;
    transform: scale(1.05);
}

.ri-play-btn.playing {
    background: #026b24;
}

.ri-progress-container {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.ri-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #02812c, #04a83a);
    border-radius: 3px;
    width: 0%;
    transition: width 0.15s linear;
}

.ri-time-display {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: right;
}

/* ── Research Insights Listing Page ──────── */
.ri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    margin: 2rem 0;
}

/* ── Category colour palette (CSS custom properties) ── */
.ri-card {
    --cat-color:  #02812c;
    --cat-color2: #025e20;
    --cat-bg:     #e8f5e9;
}
.ri-cat--computational-biology   { --cat-color: #02812c; --cat-color2: #025e20; --cat-bg: #e8f5e9; }
.ri-cat--systems-biology          { --cat-color: #00838f; --cat-color2: #005662; --cat-bg: #e0f7fa; }
.ri-cat--databases-and-informatics{ --cat-color: #1565c0; --cat-color2: #0d47a1; --cat-bg: #e3f2fd; }
.ri-cat--machine-learning         { --cat-color: #6a1b9a; --cat-color2: #4a148c; --cat-bg: #f3e5f5; }
.ri-cat--immunology               { --cat-color: #c62828; --cat-color2: #b71c1c; --cat-bg: #ffebee; }
.ri-cat--bioinformatics           { --cat-color: #e65100; --cat-color2: #bf360c; --cat-bg: #fff3e0; }
.ri-cat--epidemiology             { --cat-color: #558b2f; --cat-color2: #33691e; --cat-bg: #f1f8e9; }
.ri-cat--neuroscience             { --cat-color: #283593; --cat-color2: #1a237e; --cat-bg: #e8eaf6; }

/* ── Card base ── */
.ri-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: box-shadow 0.22s, transform 0.22s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ri-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 0 0 2px var(--cat-color);
    transform: translateY(-3px);
}

/* ── Coloured accent stripe at top ── */
.ri-card-stripe {
    height: 5px;
    background: linear-gradient(90deg, var(--cat-color), var(--cat-color2));
    flex-shrink: 0;
}

.ri-card-body {
    padding: 1.4rem 1.5rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Tag row (category + sub-cat + badges) ── */
.ri-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.ri-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* Main category tag — uses card's palette */
.ri-tag--category {
    background: var(--cat-bg);
    color: var(--cat-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Sub-category — lighter, no caps */
.ri-tag--sub {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    text-transform: none;
    letter-spacing: 0;
}

/* Podcast badge */
.ri-tag--podcast {
    background: #fff3e0;
    color: #c84b00;
}

/* AI badge */
.ri-tag--ai {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ── Title ── */
.ri-card h3 {
    margin: 0 0 0.65rem;
    font-size: 1.04rem;
    line-height: 1.45;
    flex-shrink: 0;
}

.ri-card h3 a {
    color: #1a202c;
    text-decoration: none;
}

.ri-card h3 a:hover {
    color: var(--cat-color);
}

/* ── Excerpt ── */
.ri-card-excerpt {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1rem;
}

/* ── Footer: author + date + read link ── */
.ri-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f4f0;
    padding-top: 0.8rem;
    margin-top: auto;
    gap: 0.5rem;
}

.ri-card-byline {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ri-card-author {
    font-size: 0.82rem;
    color: #555;
    font-weight: 500;
}

.ri-card-date {
    font-size: 0.76rem;
    color: #aaa;
}

.ri-read-more {
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    background: var(--cat-color);
    text-decoration: none;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.ri-read-more:hover {
    background: var(--cat-color2);
    transform: scale(1.04);
    text-decoration: none;
}

/* Keep backwards-compat for old .ri-card-category/.ri-podcast-badge selectors
   used on the insight pages */
.ri-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.ri-podcast-badge {
    font-size: 0.75rem;
    background: #fff3e0;
    color: #e65100;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* ── Empty state ─────────────────────────── */
.ri-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #888;
}

.ri-empty h3 {
    color: #aaa;
    margin-bottom: 0.5rem;
}

/* ── Collapsible Figures ─────────────────── */
.ri-figure-details {
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.ri-figure-details summary {
    padding: 0.85rem 1.25rem;
    background: #f8faf9;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}

.ri-figure-details summary:hover {
    background: #edf2f0;
}

.ri-figure-details summary::before {
    content: '\25B6';
    font-size: 0.7rem;
    transition: transform 0.2s;
    display: inline-block;
}

.ri-figure-details[open] summary::before {
    transform: rotate(90deg);
}

/* Hide default marker in webkit/blink */
.ri-figure-details summary::-webkit-details-marker {
    display: none;
}

.ri-figure-details .featured-image {
    margin: 0;
    padding: 1rem;
}

.ri-figure-details .featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.ri-figure-details .featured-image figcaption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ── AI Disclaimer ───────────────────────── */
.ri-disclaimer {
    margin: 2rem 0;
    padding: 0.85rem 1.25rem;
    background: #f8f9fa;
    border-left: 3px solid #adb5bd;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
}

.ri-disclaimer p {
    margin: 0;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .ri-podcast-player {
        padding: 1rem;
    }
    .ri-player-controls {
        flex-wrap: wrap;
        border-radius: 12px;
    }
    .ri-time-display {
        min-width: unset;
    }
    .ri-grid {
        grid-template-columns: 1fr;
    }
    .ri-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .ri-read-more {
        align-self: flex-end;
    }
}
