/* SayIntentions.AI — News Releases Widget (embeddable) */

.si-news-widget {
    background: var(--bg-card, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.si-news-widget__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    background: linear-gradient(90deg, rgba(244, 183, 64, 0.08), transparent);
}

/* Header is a bar so the collapse toggle and the admin Manage button can be
   siblings — a button cannot legally nest inside another button. */
.si-news-widget__header--bar {
    padding: 0;
    padding-right: 0.75rem;
}

.si-news-widget__toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: background-color 0.15s ease;
}

.si-news-widget__toggle:hover {
    background: linear-gradient(90deg, rgba(244, 183, 64, 0.14), rgba(255, 255, 255, 0.02));
}

.si-news-widget__manage {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.si-news-widget__chevron {
    color: var(--text-secondary, #9ca3af);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.si-news-widget__toggle:not(.collapsed) .si-news-widget__chevron {
    transform: rotate(180deg);
}

.si-news-widget__page-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem 0;
}

.si-news-widget__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--si-yellow, #f4b740);
    color: var(--si-blue, #1a2332);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.si-news-widget__title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary, #a0a0a0);
}

.si-news-widget__body {
    padding: 0.25rem 0;
}

.si-news-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.12);
    transition: background-color 0.15s ease;
}

.si-news-item:last-child {
    border-bottom: none;
}

.si-news-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.si-news-item__thumb {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    background: #1a1a1a;
}

.si-news-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.si-news-item__content {
    flex: 1;
    min-width: 0;
}

.si-news-item__date {
    font-size: 0.78rem;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 0.25rem;
}

.si-news-item__date-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.si-news-item__ago {
    color: var(--si-yellow, #f4b740);
    font-weight: 500;
}

.si-news-item__headline {
    font-size: 1rem;
    line-height: 1.35;
    color: #fff;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.si-news-item__excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary, #cbd5e1);
    margin: 0;
}

.si-news-item__link {
    color: var(--si-yellow, #f4b740);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.si-news-item__link:hover {
    color: #ffd166;
}

.si-news-widget__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
    text-align: center;
}

.si-news-widget__read-all {
    font-weight: 600;
}

.si-news-widget__read-all:hover {
    color: var(--si-blue, #1a2332);
}

.si-news-widget--compact .si-news-item__thumb {
    width: 96px;
    height: 64px;
}

.si-news-widget--page {
    margin-top: 0.5rem;
}

.si-news-widget__pagination {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
}

.si-news-widget__pagination-summary {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--text-secondary, #9ca3af);
    font-size: 0.8rem;
}

/* Dark-theme pagination — matches portal cards, not default Bootstrap light */
.si-news-widget__pagination .pagination {
    gap: 0.35rem;
}

.si-news-widget__pagination .page-item .page-link {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, #3a3a3a);
    color: var(--text-secondary, #9ca3af);
    border-radius: 0.375rem;
    min-width: 2.1rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.si-news-widget__pagination .page-item .page-link:hover {
    background: rgba(244, 183, 64, 0.1);
    border-color: rgba(244, 183, 64, 0.35);
    color: var(--text-primary, #e5e7eb);
}

.si-news-widget__pagination .page-item.active .page-link {
    background: var(--si-yellow, #f4b740);
    border-color: var(--si-yellow, #f4b740);
    color: var(--si-blue, #1a2332);
    font-weight: 600;
}

.si-news-widget__pagination .page-item.active .page-link:hover {
    background: #ffd166;
    border-color: #ffd166;
    color: var(--si-blue, #1a2332);
}

.si-news-widget__pagination .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.22);
    pointer-events: none;
}

.si-news-widget--page .si-news-item:last-child {
    border-bottom: 1px dotted rgba(255, 255, 255, 0.12);
}

.si-news-widget--loading,
.si-news-widget--empty,
.si-news-widget--error {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-secondary, #9ca3af);
}

/* Compact account profile (under pilot badge) */
.si-profile-compact .card-body {
    font-size: 0.85rem;
}

.si-profile-compact-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.si-profile-compact-row:last-child {
    border-bottom: none;
}

.si-profile-compact-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 0.1rem;
}

.si-profile-compact-value {
    color: var(--text-primary, #e5e7eb);
    word-break: break-word;
}

.si-profile-compact-actions {
    flex-shrink: 0;
}

/* Account page — news + badge side-by-side */
.si-account-main-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.si-account-top-row .si-news-widget {
    margin-bottom: 0;
}

.si-account-badge-column {
    align-self: flex-start;
}

@media (max-width: 991.98px) {
    .si-account-badge-column {
        width: 100% !important;
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── In-portal story reader ─────────────────────────────────────────────── */

.si-news-story {
    max-width: 860px;
    margin: 0 auto;
}

.si-news-story__card {
    background: var(--bg-card, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.75rem;
    overflow: hidden;
}

.si-news-story__hero img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
}

.si-news-story__inner {
    padding: 1.75rem;
}

.si-news-story__date {
    font-size: 0.8rem;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 0.5rem;
}

.si-news-story__headline {
    font-size: 1.85rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.si-news-story__body {
    color: var(--text-primary, #e5e7eb);
    font-size: 1rem;
    line-height: 1.7;
}

.si-news-story__body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.si-news-story__body h1,
.si-news-story__body h2,
.si-news-story__body h3,
.si-news-story__body h4 {
    color: #fff;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.si-news-story__body a {
    color: var(--si-yellow, #f4b740);
}

.si-news-story__body ul,
.si-news-story__body ol {
    padding-left: 1.25rem;
    margin: 0 0 1rem;
}

.si-news-story__body li {
    margin-bottom: 0.5rem;
}

.si-news-story__body li::marker {
    color: var(--si-yellow, #f4b740);
}

.si-news-story__body blockquote {
    border-left: 3px solid var(--si-yellow, #f4b740);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary, #cbd5e1);
    font-style: italic;
}

.si-news-story__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.si-news-story__body table td,
.si-news-story__body table th {
    border: 1px solid var(--border-color, #3a3a3a);
    padding: 0.5rem 0.75rem;
}

.si-news-story__body pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

/* ── News Manager (admin) ───────────────────────────────────────────────── */

.news-mgr__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.news-mgr__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.news-mgr__card {
    background: var(--bg-card, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.75rem;
    overflow: hidden;
}

.news-mgr__card .form-control {
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--border-color, #3a3a3a);
    color: var(--text-primary, #e5e7eb);
}

.news-mgr__card .form-control:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(244, 183, 64, 0.5);
    color: var(--text-primary, #e5e7eb);
    box-shadow: 0 0 0 0.2rem rgba(244, 183, 64, 0.15);
}

/* Native date/time pickers render a light widget unless told otherwise. */
.news-mgr__card input[type="datetime-local"] {
    color-scheme: dark;
}

.news-mgr__card .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #9ca3af);
}

/* Bootstrap's .table defaults to a white surface; re-point its CSS variables at
   the dark card instead, or white headline text renders on white. */
.news-mgr__table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary, #e5e7eb);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: var(--text-primary, #e5e7eb);
    --bs-table-hover-bg: rgba(244, 183, 64, 0.07);
    --bs-table-hover-color: var(--text-primary, #e5e7eb);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #e5e7eb);
    background-color: transparent;
}

.news-mgr__table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary, #9ca3af);
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    color: var(--text-secondary, #9ca3af);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.news-mgr__table td {
    border-color: rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.news-mgr__thumb {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1a1a;
}

.news-mgr__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
}

.news-mgr__headline {
    font-weight: 600;
    color: #fff;
}

.news-mgr__excerpt {
    font-size: 0.82rem;
    color: var(--text-secondary, #9ca3af);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-mgr__dropzone {
    border: 2px dashed var(--border-color, #3a3a3a);
    border-radius: 0.5rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.news-mgr__dropzone:hover,
.news-mgr__dropzone:focus-visible {
    border-color: rgba(244, 183, 64, 0.5);
    background: rgba(244, 183, 64, 0.05);
}

.news-mgr__dropzone.drag-over {
    border-color: var(--si-yellow, #f4b740);
    background: rgba(244, 183, 64, 0.12);
}

.news-mgr__dropzone.uploading {
    opacity: 0.55;
    pointer-events: none;
}

.news-mgr__dropzone-empty {
    text-align: center;
    color: var(--text-secondary, #9ca3af);
    padding: 1.25rem;
}

.news-mgr__dropzone-empty i {
    font-size: 1.75rem;
    color: rgba(244, 183, 64, 0.6);
    margin-bottom: 0.5rem;
    display: block;
}

.news-mgr__dropzone-preview {
    width: 100%;
    position: relative;
}

.news-mgr__dropzone-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.news-mgr__dropzone--preview-only {
    cursor: default;
}

.news-mgr__dropzone--preview-only:hover {
    border-color: var(--border-color, #3a3a3a);
    background: rgba(0, 0, 0, 0.2);
}

.news-mgr__hero-actions .btn {
    flex: 1 1 auto;
}

.news-mgr__library-modal {
    background: var(--bg-secondary, #1e1e1e);
    border: 1px solid var(--border-color, #3a3a3a);
    color: var(--text-primary, #e5e7eb);
}

.news-mgr__hero-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.news-mgr__hero-library-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.news-mgr__hero-library-item:hover {
    border-color: rgba(244, 183, 64, 0.45);
    transform: translateY(-1px);
}

.news-mgr__hero-library-item.is-selected {
    border-color: var(--si-yellow, #f4b740);
    box-shadow: 0 0 0 1px rgba(244, 183, 64, 0.35);
}

.news-mgr__hero-library-item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.news-mgr__hero-library-label {
    display: block;
    padding: 0 0.5rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--text-secondary, #9ca3af);
}

.news-mgr__hero-clear {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.65);
}

/* TinyMCE sits on the dark card, so soften its default chrome to match. */
.news-mgr .tox-tinymce {
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.5rem;
}

@media (max-width: 575.98px) {
    .si-news-item {
        flex-direction: column;
    }

    .si-news-item__thumb {
        width: 100%;
        height: 140px;
    }

    .si-news-story__inner {
        padding: 1.25rem;
    }

    .si-news-story__headline {
        font-size: 1.4rem;
    }
}

/* ── Unlinked Payments (admin) ──────────────────────────────────────────────
   Same dark-surface treatment as .news-mgr above. Bootstrap's default .table
   and .list-group-item both render white unless their CSS variables are reset. */

.stripe-orphans-mgr__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stripe-orphans-mgr__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.stripe-orphans-mgr__card {
    background: var(--bg-card, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 0.75rem;
    overflow: hidden;
}

.stripe-orphans-mgr__card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    color: var(--text-primary, #e5e7eb);
    font-weight: 600;
}

.stripe-orphans-mgr__card .form-control {
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--border-color, #3a3a3a);
    color: var(--text-primary, #e5e7eb);
}

.stripe-orphans-mgr__card .form-control:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(244, 183, 64, 0.5);
    color: var(--text-primary, #e5e7eb);
    box-shadow: 0 0 0 0.2rem rgba(244, 183, 64, 0.15);
}

.stripe-orphans-mgr__card .form-label {
    color: var(--text-secondary, #9ca3af);
}

.stripe-orphans-mgr__table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary, #e5e7eb);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: var(--text-primary, #e5e7eb);
    --bs-table-hover-bg: rgba(244, 183, 64, 0.07);
    --bs-table-hover-color: var(--text-primary, #e5e7eb);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #e5e7eb);
    background-color: transparent;
}

.stripe-orphans-mgr__table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary, #9ca3af);
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stripe-orphans-mgr__table td {
    border-color: rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.stripe-orphans-mgr__list .list-group-item {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #e5e7eb);
}

.stripe-orphans-mgr__list .list-group-item:hover {
    background: rgba(244, 183, 64, 0.05);
}

.stripe-orphans-mgr__candidate .fw-semibold {
    color: var(--text-primary, #e5e7eb);
}

.stripe-orphans-mgr__dl dt {
    color: var(--text-secondary, #9ca3af);
}

.stripe-orphans-mgr__dl dd {
    color: var(--text-primary, #e5e7eb);
}

.stripe-orphans-mgr__dl code {
    color: var(--si-yellow, #f4b740);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.stripe-orphans-mgr .alert-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color, #3a3a3a);
    color: var(--text-primary, #e5e7eb);
}
