/* Dark theme overrides.
   Activated by data-bs-theme="dark" on <html> (also drives Bootstrap 5.3's
   native component theming). Every rule is scoped to [data-bs-theme="dark"] so
   its specificity outranks the bare-class colours hardcoded in the layouts'
   inline <style> blocks and in the per-page stylesheets under public/css/.

   Brand gold (--tla-accent) is kept as the accent in both themes; only the
   supporting admin blue is lightened for legibility on dark surfaces. */

/* ---------------------------------------------------------------------------
   1. Shared CSS custom properties
   Remapped once here; flips the whole public-site palette (defined in
   sections-base.css / new-welcome.css / site-chrome.css) in one place.

   Scoped to :root[data-bs-theme="dark"] (specificity 0,2,0) so it outranks the
   plain :root brand-token blocks in those stylesheets — they load after this
   file, so an equal-specificity [data-bs-theme="dark"] selector would lose the
   tie and the light ink colour would leak back in.
--------------------------------------------------------------------------- */
:root[data-bs-theme="dark"] {
    --tla-ink: #e6e8ec;
    --tla-muted: #9aa0ab;
    --tla-accent: #FCD233;
    --tla-accent-dark: #ffd94d;

    --chrome-light: #23262d;
    --chrome-dark: #16181d;
    --chrome-edge: #2f343d;

    /* Local palette tokens reused by the scoped overrides below. */
    --dk-bg: #12141a;
    --dk-surface: #1e2128;
    --dk-surface-elevated: #262a33;
    --dk-sidebar: #16202b;
    --dk-border: #2f343d;
    --dk-table-head: #20242c;
    --dk-table-hover: #242832;
    --dk-blue: #5dade2;
}

/* ---------------------------------------------------------------------------
   2. Page background (admin, plain, public sections, welcome)
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] body {
    background-color: var(--dk-bg);
    color: var(--tla-ink);
}

/* Public section pages use a subtle gradient in light mode; flatten to the
   base tone in dark. */
[data-bs-theme="dark"] body {
    background-image: none;
}

/* ---------------------------------------------------------------------------
   3. Admin chrome (layouts/app.blade.php inline <style>)
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .sidebar {
    background-color: var(--dk-sidebar);
}

[data-bs-theme="dark"] .sidebar .nav-link:hover,
[data-bs-theme="dark"] .sidebar .nav-link.active {
    border-left-color: var(--dk-blue);
}

/* plain.blade.php top navbar */
[data-bs-theme="dark"] .top-bar {
    background-color: var(--dk-sidebar);
}

[data-bs-theme="dark"] .top-bar .dropdown-menu .dropdown-item {
    color: var(--tla-ink);
}

[data-bs-theme="dark"] .top-bar .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .top-bar .dropdown-menu .dropdown-item:focus {
    color: #fff;
    background-color: var(--dk-surface-elevated);
}

/* ---------------------------------------------------------------------------
   4. Surfaces: cards, content headers
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .content-header {
    background: var(--dk-surface);
}

[data-bs-theme="dark"] .card {
    background: var(--dk-surface);
    color: var(--tla-ink);
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: var(--dk-border);
}

[data-bs-theme="dark"] .card-title {
    color: var(--tla-ink);
}

/* ---------------------------------------------------------------------------
   5. Tables
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .table th,
[data-bs-theme="dark"] .table td {
    border-bottom-color: var(--dk-border);
}

[data-bs-theme="dark"] .table th {
    background-color: var(--dk-table-head);
    color: var(--tla-ink);
}

[data-bs-theme="dark"] .table tr:hover {
    background-color: var(--dk-table-hover);
}

/* ---------------------------------------------------------------------------
   6. Forms
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .form-label {
    color: var(--tla-ink);
}

[data-bs-theme="dark"] .form-control {
    background-color: var(--dk-surface-elevated);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}

[data-bs-theme="dark"] .form-control:focus {
    border-color: var(--dk-blue);
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.25);
}

/* ---------------------------------------------------------------------------
   7. Alerts
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .alert-success {
    background-color: #14331f;
    border-color: #1f5133;
    color: #a3e3b8;
}

[data-bs-theme="dark"] .alert-error {
    background-color: #3a1618;
    border-color: #5c2327;
    color: #f2b8bc;
}

/* ---------------------------------------------------------------------------
   8. Links, pagination, badges (admin blue -> lightened)
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .page-link {
    color: var(--dk-blue);
    border-color: var(--dk-border);
    background-color: var(--dk-surface);
}

[data-bs-theme="dark"] .page-link:hover {
    color: #85c5ea;
    background-color: var(--dk-table-hover);
    border-color: var(--dk-border);
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: var(--dk-blue);
    border-color: var(--dk-blue);
    color: #12141a;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--dk-surface);
    color: var(--tla-muted);
}

/* Filled badges keep their saturated colour + white text; they read fine on
   dark surfaces, so only the primary (blue) is nudged for consistency. */
[data-bs-theme="dark"] .badge-primary {
    background-color: var(--dk-blue);
    color: #12141a;
}

/* ---------------------------------------------------------------------------
   9. Public section chrome (sections-base.css)
--------------------------------------------------------------------------- */
[data-bs-theme="dark"] .resource-search-bar {
    background: var(--dk-surface);
    border-color: var(--dk-border);
}

/* ---------------------------------------------------------------------------
   10. Theme toggle button (partials/theme-toggle.blade.php)
   Inherits surrounding nav text colour via currentColor so it suits both the
   light public navbars and the dark admin chrome. Shows moon in light mode
   ("switch to dark"), sun in dark mode ("switch to light").
--------------------------------------------------------------------------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background-color: rgba(127, 127, 127, 0.18);
    border-color: rgba(127, 127, 127, 0.35);
    color: currentColor;
}

.theme-toggle .theme-icon-sun {
    display: none;
}

[data-bs-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}

[data-bs-theme="dark"] .theme-toggle .theme-icon-sun {
    display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle {
        transition: none;
    }
}

/* ===========================================================================
   PAGE-SPECIFIC STYLESHEET OVERRIDES
   One scoped override per hardcoded light colour in the per-page stylesheets
   under public/css/. Filled status colours (semantic red/green/blue badges
   with white text) are intentionally kept — they read fine on dark surfaces.
=========================================================================== */

/* --- dashboard.css --- */
[data-bs-theme="dark"] .stats-card {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .trend-flat {
    color: var(--tla-muted);
}

/* --- analytics.css --- */
[data-bs-theme="dark"] .filter-bar {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .filter-bar label {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .filter-bar input[type="date"] {
    background: var(--dk-surface-elevated);
    color: var(--tla-ink);
    border: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .top-submitters-table th {
    background: var(--dk-table-head);
    color: var(--tla-ink);
    border-bottom: 2px solid var(--dk-border);
}
[data-bs-theme="dark"] .top-submitters-table td {
    border-bottom: 1px solid var(--dk-border);
}

/* --- users-index.css --- */
[data-bs-theme="dark"] .datatable-top,
[data-bs-theme="dark"] .datatable-bottom {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .datatable-selector,
[data-bs-theme="dark"] .datatable-input {
    background: var(--dk-surface-elevated);
    color: var(--tla-ink);
    border: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .datatable-input:focus,
[data-bs-theme="dark"] .datatable-selector:focus {
    border-color: var(--dk-blue);
}
[data-bs-theme="dark"] .datatable-pagination a {
    color: var(--dk-blue);
}

/* --- activities.css --- */
[data-bs-theme="dark"] .activity-card,
[data-bs-theme="dark"] .about-card {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .activity-card-title {
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .activity-card-body {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .activity-card hr {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .about-card-title {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .about-card h6 {
    color: var(--tla-muted);
}

/* --- ai-chat.css --- */
[data-bs-theme="dark"] .chat-container,
[data-bs-theme="dark"] .chat-input-area {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .chat-input-area {
    border-top: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .chat-message.assistant .chat-bubble {
    background: var(--dk-surface-elevated);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .chat-bubble th,
[data-bs-theme="dark"] .chat-bubble td {
    border: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .chat-bubble th {
    background: var(--dk-table-head);
}
[data-bs-theme="dark"] .chat-bubble code:not(pre code) {
    background: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .chat-input-wrapper textarea,
[data-bs-theme="dark"] .suggestion-chip {
    background: var(--dk-surface-elevated);
    color: var(--tla-ink);
    border: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .chat-input-wrapper textarea:focus {
    border-color: var(--dk-blue);
}
[data-bs-theme="dark"] .typing-indicator span {
    background: var(--tla-muted);
}
[data-bs-theme="dark"] .welcome-message,
[data-bs-theme="dark"] .welcome-message i,
[data-bs-theme="dark"] .chat-timestamp {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .welcome-message h4 {
    color: var(--tla-ink);
}

/* --- audit-tools-create.css --- */
[data-bs-theme="dark"] .item-block {
    background: var(--dk-surface-elevated);
    border: 1px solid var(--dk-border);
}
[data-bs-theme="dark"] .item-block .item-number {
    color: var(--tla-ink);
}

/* --- audit-tools-list.css --- */
@media (max-width: 767.98px) {
    [data-bs-theme="dark"] .audit-card .field-label {
        color: var(--tla-muted);
    }
}

/* --- google-gems-create.css --- */
[data-bs-theme="dark"] .gem-section {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .gem-section-header {
    border-bottom-color: var(--dk-border);
}
[data-bs-theme="dark"] .gem-section-title,
[data-bs-theme="dark"] .gem-field .form-label {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .gem-section-subtitle,
[data-bs-theme="dark"] .gem-file-list {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .gem-field .form-control:focus {
    border-color: var(--dk-blue);
}

/* --- google-gems-index.css --- */
[data-bs-theme="dark"] .gem-card,
[data-bs-theme="dark"] .gem-empty {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .gem-card-title {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .gem-card-name,
[data-bs-theme="dark"] .gem-card-link {
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .gem-card-tool {
    background: var(--dk-surface-elevated);
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .gem-card-desc,
[data-bs-theme="dark"] .gem-empty,
[data-bs-theme="dark"] .gem-empty-icon {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .gem-card-footer {
    border-top-color: var(--dk-border);
    color: var(--tla-muted);
}

/* --- google-gems-show.css --- */
[data-bs-theme="dark"] .gem-show-section {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .gem-show-section-title {
    color: var(--tla-ink);
    border-bottom-color: var(--dk-border);
}
[data-bs-theme="dark"] .gem-show-grid dt,
[data-bs-theme="dark"] .gem-show-body {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .gem-show-grid dd,
[data-bs-theme="dark"] .gem-show-subtitle {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .gem-show-pill {
    background: var(--dk-surface-elevated);
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .gem-show-instructions {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}

/* --- platform-nominations-create.css --- */
[data-bs-theme="dark"] .nom-section {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .nom-section-header {
    border-bottom-color: var(--dk-border);
}
[data-bs-theme="dark"] .nom-section-title,
[data-bs-theme="dark"] .nom-field .form-label,
[data-bs-theme="dark"] .nom-confirmation-label {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .nom-section-subtitle,
[data-bs-theme="dark"] .nom-field-help {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .nom-field .form-control:focus {
    border-color: var(--dk-blue);
}
[data-bs-theme="dark"] .nom-radio {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .nom-radio:hover {
    background-color: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .nom-radio:has(input:checked) {
    border-color: var(--dk-blue);
}
[data-bs-theme="dark"] .nom-confirmation {
    background-color: var(--dk-surface-elevated);
    border-color: var(--dk-border);
}

/* --- platform-nominations-index.css --- */
[data-bs-theme="dark"] .nom-card,
[data-bs-theme="dark"] .nom-empty {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .nom-card-title {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .nom-card-dept,
[data-bs-theme="dark"] .nom-card-author,
[data-bs-theme="dark"] .nom-card-cost,
[data-bs-theme="dark"] .nom-card-desc,
[data-bs-theme="dark"] .nom-card-date,
[data-bs-theme="dark"] .nom-empty,
[data-bs-theme="dark"] .nom-empty-icon {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .nom-card-flag {
    background: rgba(185, 28, 28, 0.18);
    color: #fca5a5;
}
[data-bs-theme="dark"] .nom-card-flag-neutral {
    background: var(--dk-surface-elevated);
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .nom-card-footer {
    border-top-color: var(--dk-border);
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .nom-card-link {
    color: var(--dk-blue);
}

/* --- platform-nominations-show.css --- */
[data-bs-theme="dark"] .nom-show-section {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .nom-show-section-title {
    color: var(--tla-ink);
    border-bottom-color: var(--dk-border);
}
[data-bs-theme="dark"] .nom-show-subtitle,
[data-bs-theme="dark"] .nom-show-grid dd {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .nom-show-grid dt,
[data-bs-theme="dark"] .nom-show-body {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .nom-show-pill {
    background: var(--dk-surface-elevated);
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .nom-show-confirm {
    background: rgba(22, 101, 52, 0.18);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

/* --- digital-journeys.css --- */
[data-bs-theme="dark"] .dj-card,
[data-bs-theme="dark"] .dj-conversation-btn {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .dj-card-heading,
[data-bs-theme="dark"] .dj-conversation-label,
[data-bs-theme="dark"] .dj-step-notes-label,
[data-bs-theme="dark"] .dj-conversation-title,
[data-bs-theme="dark"] .dj-score-preview-label {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .dj-department-name,
[data-bs-theme="dark"] .dj-step-3,
[data-bs-theme="dark"] .dj-score-preview-value {
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .dj-step-title,
[data-bs-theme="dark"] .dj-conversation,
[data-bs-theme="dark"] .dj-conversation-btn {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .dj-conversation-question,
[data-bs-theme="dark"] .dj-selected,
[data-bs-theme="dark"] .dj-list-table th {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .dj-conversation-id,
[data-bs-theme="dark"] .dj-score-box {
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .dj-rating-btn {
    border-color: var(--dk-border);
    background: var(--dk-surface-elevated);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .dj-rating-btn:hover {
    background: var(--dk-border);
}
[data-bs-theme="dark"] .dj-rating-btn-static:hover {
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .dj-step-notes-body,
[data-bs-theme="dark"] .dj-readonly-text {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .dj-step-notes-body {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .dj-readonly-text {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .mj-editor .ql-toolbar {
    border-color: var(--dk-border);
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .mj-editor .ql-container {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .dj-score-total {
    background: var(--dk-table-head);
}

/* --- my-journeys.css --- */
[data-bs-theme="dark"] .mj-start-card {
    background: var(--dk-surface);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .mj-start-title {
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .mj-start-desc,
[data-bs-theme="dark"] .mj-start-meta,
[data-bs-theme="dark"] .mj-empty-icon,
[data-bs-theme="dark"] .mj-question-list:empty::after {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .mj-answer {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .mj-step-message {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-blue);
    color: var(--dk-blue);
}
[data-bs-theme="dark"] .description-box {
    border-color: var(--dk-border);
}

/* --- welcome.css --- */
[data-bs-theme="dark"] .feature-card {
    background: var(--dk-surface);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .landing-card {
    border-color: var(--dk-border);
}

/* --- new-welcome.css --- */
[data-bs-theme="dark"] .nav-item-color .btn-tla-outline:hover {
    color: var(--tla-ink);
    border-color: var(--dk-border);
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .homepage-panel-frame {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .homepage-panel-pdf {
    background: var(--dk-surface);
}
[data-bs-theme="dark"] .homepage-panel-audio,
[data-bs-theme="dark"] .homepage-bottom {
    background: var(--dk-surface);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .btn-tla {
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .btn-tla-outline {
    border-color: var(--dk-border);
}

/* --- catalyst.css --- */
[data-bs-theme="dark"] .pathways-intro {
    background: var(--dk-surface);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
/* Mirrors the light card's ramp, elevated tone down to the base surface. */
[data-bs-theme="dark"] .practitioner-card {
    background: linear-gradient(180deg, var(--dk-surface-elevated) 0%, var(--dk-surface) 100%);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .practitioner-intro {
    color: var(--tla-muted);
}
/* Episode tiles keep their gold panel and dark tiles in both themes — the
   contrast is the design — so only the surrounding text needs help. */
[data-bs-theme="dark"] .sparks-player-detail .newsletter-posted,
[data-bs-theme="dark"] .sparks-close {
    color: var(--tla-muted);
}
/* TLA Forums. The comment/reaction markup is shared between the light staff
   page and the dark admin panel, so only the surfaces need overriding. */
[data-bs-theme="dark"] .forum-card {
    background: linear-gradient(180deg, var(--dk-surface-elevated) 0%, var(--dk-surface) 100%);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .forum-card-description,
[data-bs-theme="dark"] .forum-card-meta,
[data-bs-theme="dark"] .forum-comment-time,
[data-bs-theme="dark"] .forum-empty,
[data-bs-theme="dark"] .forum-closed-note,
[data-bs-theme="dark"] .forum-link-button {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .forum-comment {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .forum-comment-reply {
    background: rgba(255, 255, 255, 0.04);
}
[data-bs-theme="dark"] .forum-reaction {
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
/* The viewer's own reaction keeps the gold fill, so its text must stay dark. */
[data-bs-theme="dark"] .forum-reaction.is-mine {
    border-color: var(--tla-accent);
    background: var(--tla-accent);
    color: #1f2330;
}
[data-bs-theme="dark"] .forum-link-danger {
    color: #ff6b6b;
}
/* Bootstrap gives .card-footer its own cap background, which would band the
   card's gradient; the gold pathway buttons carry their own colour already. */
[data-bs-theme="dark"] .practitioner-pathway-links {
    background: transparent;
    border-top: 0;
}
[data-bs-theme="dark"] .practitioner-no-pathways,
[data-bs-theme="dark"] .pathway-siblings-label {
    color: var(--tla-muted);
}
/* Ink on light becomes ink-on-dark: outline in the body text colour instead. */
[data-bs-theme="dark"] .pathway-sibling-link {
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .pathway-sibling-link:hover,
[data-bs-theme="dark"] .pathway-sibling-link:focus-visible {
    background: var(--tla-accent);
    border-color: var(--tla-accent);
    color: #1f2330;
}
/* Bootstrap 5.3 themes .modal-content itself; only our own copy needs help. */
[data-bs-theme="dark"] .team-modal-site {
    color: var(--tla-muted);
}
/* Team cards carry no surface of their own, so they must opt out of the
   generic dark .card background above (which outranks a bare .team-card). */
[data-bs-theme="dark"] .team-card {
    background: transparent;
    border: 0;
}
/* Pathway destination pages: panels, back-issue rows and the reader frame. */
[data-bs-theme="dark"] .newsletter-panel {
    background: var(--dk-surface);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .newsletter-issue {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .newsletter-issue.is-current {
    background: var(--dk-surface-elevated);
    border-color: var(--tla-accent);
}
[data-bs-theme="dark"] .newsletter-frame {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .newsletter-offsite {
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .newsletter-plain-item + .newsletter-plain-item {
    border-top-color: var(--dk-border);
}
[data-bs-theme="dark"] .newsletter-issue-date,
[data-bs-theme="dark"] .newsletter-issue-open,
[data-bs-theme="dark"] .newsletter-posted,
[data-bs-theme="dark"] .newsletter-byline,
[data-bs-theme="dark"] .newsletter-empty {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .section-card {
    background: var(--dk-surface);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .section-card-text,
[data-bs-theme="dark"] .catalyst-video-placeholder,
[data-bs-theme="dark"] .catalyst-video-description {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .catalyst-thumb {
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .catalyst-thumb-title {
    color: var(--tla-ink);
}

/* --- events.css --- */
[data-bs-theme="dark"] .events-doc-link,
[data-bs-theme="dark"] .events-doc-category {
    background: var(--dk-surface);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .events-doc-category .events-doc-link {
    background: var(--dk-surface-elevated);
}
[data-bs-theme="dark"] .events-doc-classroom {
    background: var(--dk-surface-elevated);
    border-color: var(--dk-border);
    color: var(--tla-ink);
}
[data-bs-theme="dark"] .events-empty {
    color: var(--tla-muted);
}
[data-bs-theme="dark"] .events-gallery-item,
[data-bs-theme="dark"] .event-item + .event-item,
[data-bs-theme="dark"] .events-media-grid {
    border-color: var(--dk-border);
}

/* --- resource-bank.css --- */
[data-bs-theme="dark"] .resource-tabs {
    border-bottom-color: var(--dk-border);
}
[data-bs-theme="dark"] .resource-row,
[data-bs-theme="dark"] .section-message,
[data-bs-theme="dark"] .section-audio-frame,
[data-bs-theme="dark"] .section-video-empty {
    background: var(--dk-surface);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .resource-classroom {
    color: var(--tla-ink);
    border-color: var(--dk-border);
}
[data-bs-theme="dark"] .section-video-frame {
    border-color: var(--dk-border);
}
