/* ==========================================================================
   Colosian Markets — News Terminal
   ========================================================================== */

.news-page {
    --news-border: rgba(255, 255, 255, 0.08);
    --news-border-strong: rgba(255, 255, 255, 0.13);
    --news-surface: rgba(255, 255, 255, 0.018);
    --news-surface-hover: rgba(255, 255, 255, 0.035);
    --news-muted: rgba(255, 255, 255, 0.42);
    --news-dim: rgba(255, 255, 255, 0.26);
    --news-text: rgba(255, 255, 255, 0.92);
    --news-green: #20c997;

    width: 100%;
    min-width: 0;
    padding: 8px 18px 24px;
}


/* ==========================================================================
   Compact terminal header
   ========================================================================== */

.news-page__header {
    display: grid;
    grid-template-columns:
        auto minmax(220px, 1fr) auto;
    align-items: center;
    gap: 24px;

    min-height: 46px;
    padding: 0 2px 8px;

    border-bottom: 1px solid var(--news-border);
}


/*
   The first child originally wraps both the eyebrow and title row.
   display: contents allows those two elements to become direct grid items.
*/

.news-page__header>div:first-child {
    display: contents;
}


/* Left — section identity */

.news-page__eyebrow {
    margin: 0;

    color: var(--news-muted);

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.22em;

    white-space: nowrap;
}


/* Centre — News / Live Feed */

.news-page__title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-width: 0;
}

.news-page__title-row h1 {
    margin: 0;

    color: var(--news-text);

    font-size: 20px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.035em;
}

.news-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 4px 7px;

    border: 1px solid rgba(32, 201, 151, 0.25);
    border-radius: 4px;

    background: rgba(32, 201, 151, 0.06);

    color: var(--news-green);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.15em;

    white-space: nowrap;
}

.news-live-badge>span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--news-green);

    box-shadow:
        0 0 8px rgba(32, 201, 151, 0.65);
}


/* Right — terminal metrics */

.news-page__stats {
    display: flex;
    align-items: stretch;

    min-width: 0;

    border: 1px solid var(--news-border);
    border-radius: 5px;

    overflow: hidden;
}

.news-page__stats>div {
    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 100px;
    padding: 7px 10px;
}

.news-page__stats>div+div {
    border-left: 1px solid var(--news-border);
}

.news-page__stats span {
    color: var(--news-dim);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.news-page__stats strong {
    color: var(--news-text);

    font-size: 10px;
    font-weight: 650;
}


/* ==========================================================================
   Terminal shell
   ========================================================================== */

.news-terminal {
    margin-top: 7px;

    border: 1px solid var(--news-border);
    border-radius: 7px;

    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.012),
            rgba(255, 255, 255, 0.004));

    overflow: hidden;
}


/* ==========================================================================
   Toolbar
   ========================================================================== */

.news-toolbar {
    display: grid;
    grid-template-columns:
        minmax(320px, 1fr) auto;
    align-items: center;
    gap: 16px;

    min-height: 54px;
    padding: 8px 10px;

    border-bottom: 1px solid var(--news-border);
}

.news-search {
    display: flex;
    align-items: center;
    gap: 9px;

    width: 100%;
    height: 36px;
    padding: 0 12px;

    border: 1px solid var(--news-border);
    border-radius: 5px;

    background: rgba(0, 0, 0, 0.14);
}

.news-search>span {
    color: var(--news-muted);
}

.news-search input {
    width: 100%;
    min-width: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--news-text);

    font: inherit;
    font-size: 11px;
}

.news-search input::placeholder {
    color: var(--news-dim);
}

.news-toolbar__status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;

    white-space: nowrap;

    color: var(--news-muted);

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.news-refresh {
    height: 34px;
    padding: 0 13px;

    border: 1px solid var(--news-border-strong);
    border-radius: 4px;

    background: rgba(255, 255, 255, 0.035);

    color: rgba(255, 255, 255, 0.72);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;

    cursor: pointer;
}

.news-refresh:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}


/* ==========================================================================
   Grid / List switch
   ========================================================================== */

.news-view-switch {
    display: inline-flex;
    align-items: center;

    height: 34px;
    padding: 3px;

    border: 1px solid var(--news-border);
    border-radius: 4px;

    background: rgba(0, 0, 0, 0.12);
}

.news-view-switch__button {
    height: 26px;
    padding: 0 10px;

    border: 0;
    border-radius: 3px;

    background: transparent;

    color: var(--news-dim);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;

    cursor: pointer;
}

.news-view-switch__button:hover {
    color: rgba(255, 255, 255, 0.72);
}

.news-view-switch__button.is-active {
    background: rgba(255, 255, 255, 0.07);

    color: rgba(255, 255, 255, 0.9);
}


/* ==========================================================================
   Categories
   ========================================================================== */

.news-categories {
    display: flex;
    align-items: stretch;

    min-height: 36px;

    border-bottom: 1px solid var(--news-border);

    overflow-x: auto;
}

.news-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 0 13px;

    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.035);

    background: transparent;

    color: var(--news-muted);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    cursor: pointer;

    white-space: nowrap;
}

.news-category:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.02);
}

.news-category.is-active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.news-category__count {
    color: var(--news-dim);

    font-size: 7px;
}


/* ==========================================================================
   Workspace
   ========================================================================== */

.news-workspace {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) minmax(290px, 0.32fr);

    min-height: 620px;
}

.news-feed {
    min-width: 0;

    border-right: 1px solid var(--news-border);
}

.news-intelligence {
    min-width: 0;

    background: rgba(0, 0, 0, 0.07);
}

.news-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 32px;
    padding: 0 11px;

    border-bottom: 1px solid var(--news-border);

    color: var(--news-muted);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.news-feed__rows {
    max-height: 680px;

    overflow-y: auto;
}


/* ==========================================================================
   Story rows
   ========================================================================== */

.news-story {
    display: grid;
    grid-template-columns:
        34px 48px minmax(0, 1fr) 34px 18px;
    gap: 10px;
    align-items: start;

    width: 100%;
    min-height: 91px;
    padding: 13px 12px;

    border: 0;
    border-bottom: 1px solid var(--news-border);

    background: transparent;

    text-align: left;

    cursor: pointer;
}

.news-story:hover {
    background: var(--news-surface-hover);
}

.news-story.is-selected {
    background:
        linear-gradient(90deg,
            rgba(32, 201, 151, 0.07),
            rgba(32, 201, 151, 0.015));

    box-shadow:
        inset 2px 0 0 var(--news-green);
}

.news-story__index,
.news-story__time,
.news-story__score,
.news-story__arrow {
    padding-top: 2px;

    color: var(--news-dim);

    font-size: 9px;
    font-weight: 700;
}

.news-story__time {
    color: rgba(255, 255, 255, 0.5);
}

.news-story__body {
    display: flex;
    flex-direction: column;
    gap: 6px;

    min-width: 0;
}

.news-story__eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--news-muted);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.news-story__eyebrow>span:last-child {
    overflow: hidden;

    color: var(--news-dim);

    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-story__indicator {
    flex: 0 0 auto;

    width: 4px;
    height: 11px;

    border-radius: 2px;

    background: rgba(255, 255, 255, 0.35);
}

.news-story__indicator--deals {
    background: #20c997;
}

.news-story__indicator--finance {
    background: #4dabf7;
}

.news-story__indicator--regulation {
    background: #f0b429;
}

.news-story__indicator--technology {
    background: #4dabf7;
}

.news-story__indicator--companies {
    background: #4dabf7;
}

.news-story__indicator--platforms {
    background: #55c2b8;
}

.news-story__indicator--advertising {
    background: #c4a46a;
}

.news-story__indicator--creators {
    background: #ff6b6b;
}

.news-story__title {
    overflow: hidden;

    color: rgba(255, 255, 255, 0.88);

    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-story__summary {
    display: -webkit-box;
    overflow: hidden;

    color: var(--news-muted);

    font-size: 10px;
    line-height: 1.45;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.news-story__score {
    text-align: center;
}

.news-story__arrow {
    font-size: 15px;
}


/* ==========================================================================
   News pulse
   ========================================================================== */

.news-pulse {
    border-bottom: 1px solid var(--news-border);
}

.news-pulse__rows {
    padding: 8px 0;
}

.news-pulse__row {
    display: grid;
    grid-template-columns:
        84px minmax(30px, 1fr) 25px;
    gap: 9px;
    align-items: center;

    width: 100%;
    padding: 7px 12px;

    border: 0;

    background: transparent;

    color: var(--news-muted);

    cursor: pointer;
}

.news-pulse__row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.news-pulse__label {
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.news-pulse__track {
    height: 3px;

    background: rgba(255, 255, 255, 0.06);
}

.news-pulse__bar {
    display: block;

    height: 100%;

    background: rgba(255, 255, 255, 0.38);
}

.news-pulse__value {
    text-align: right;

    color: rgba(255, 255, 255, 0.65);

    font-size: 9px;
}

.news-pulse__empty {
    padding: 20px 12px;

    color: var(--news-dim);

    font-size: 9px;
}


/* ==========================================================================
   Detail
   ========================================================================== */

.news-detail__close {
    border: 0;

    background: transparent;

    color: var(--news-muted);

    font-size: 18px;

    cursor: pointer;
}

.news-detail__content {
    padding: 18px;
}

.news-detail__meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    color: var(--news-dim);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.news-detail__category {
    color: var(--news-green);
}

.news-detail h2 {
    margin: 15px 0 9px;

    color: rgba(255, 255, 255, 0.94);

    font-size: 20px;
    font-weight: 620;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.news-detail__source {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    color: var(--news-muted);

    font-size: 10px;
}

.news-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    margin-top: 15px;
}

.news-detail__tag {
    padding: 5px 7px;

    border: 1px solid var(--news-border);

    color: rgba(255, 255, 255, 0.55);

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.news-detail__summary {
    margin-top: 22px;
    padding-top: 16px;

    border-top: 1px solid var(--news-border);
}

.news-detail__label {
    margin-bottom: 9px;

    color: var(--news-dim);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.news-detail__summary p {
    margin: 0;

    color: rgba(255, 255, 255, 0.58);

    font-size: 11px;
    line-height: 1.65;
}

.news-detail__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;

    margin-top: 20px;

    border: 1px solid var(--news-border);
}

.news-detail__metrics>div {
    display: flex;
    flex-direction: column;
    gap: 6px;

    padding: 10px;
}

.news-detail__metrics>div+div {
    border-left: 1px solid var(--news-border);
}

.news-detail__metrics span {
    color: var(--news-dim);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.news-detail__metrics strong {
    color: rgba(255, 255, 255, 0.72);

    font-size: 10px;
    font-weight: 650;
}

.news-detail__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;

    margin-top: 18px;
}

.news-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 0 10px;

    border: 1px solid var(--news-border-strong);
    border-radius: 4px;

    background: rgba(255, 255, 255, 0.025);

    color: rgba(255, 255, 255, 0.68);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-decoration: none;

    cursor: pointer;
}

.news-button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.news-button--primary {
    border-color: rgba(32, 201, 151, 0.28);

    background: rgba(32, 201, 151, 0.08);

    color: var(--news-green);
}

.news-detail--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 300px;
    padding: 30px;

    color: var(--news-dim);

    text-align: center;
}

.news-detail__empty-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;
    margin-bottom: 10px;

    border: 1px solid var(--news-border);
    border-radius: 50%;

    font-size: 12px;
}

.news-detail--empty p {
    max-width: 180px;

    font-size: 10px;
    line-height: 1.5;
}


/* ==========================================================================
   States
   ========================================================================== */

.news-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 220px;

    color: var(--news-muted);

    font-size: 10px;
}

.news-state--error {
    color: #ff6b6b;
}

.news-state__pulse {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--news-green);
}


/* ==========================================================================
   Scrollbars
   ========================================================================== */

.news-page * {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(255, 255, 255, 0.12) transparent;
}

.news-page *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.news-page *::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}


/* ==========================================================================
   News grid
   ========================================================================== */

.news-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    align-content: start;
}

.news-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 175px;
    padding: 14px;

    border: 0;
    border-right: 1px solid var(--news-border);
    border-bottom: 1px solid var(--news-border);

    background: transparent;

    color: inherit;
    text-align: left;

    cursor: pointer;
}

.news-card:nth-child(3n) {
    border-right: 0;
}

.news-card:hover {
    background: var(--news-surface-hover);
}

.news-card.is-selected {
    background:
        linear-gradient(135deg,
            rgba(32, 201, 151, 0.07),
            rgba(32, 201, 151, 0.012));

    box-shadow:
        inset 2px 0 0 var(--news-green);
}

.news-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.news-card__category {
    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--news-muted);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.news-card__time {
    flex: 0 0 auto;

    color: var(--news-dim);

    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.news-card__title {
    display: -webkit-box;
    overflow: hidden;

    margin-top: 13px;

    color: rgba(255, 255, 255, 0.9);

    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.news-card__summary {
    display: -webkit-box;
    overflow: hidden;

    margin-top: 8px;

    color: var(--news-muted);

    font-size: 9px;
    line-height: 1.5;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: auto;
    padding-top: 13px;
}

.news-card__source {
    overflow: hidden;

    color: var(--news-dim);

    font-size: 8px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-card__score {
    flex: 0 0 auto;

    color: rgba(32, 201, 151, 0.7);

    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.1em;
}


/* ==========================================================================
   Selected-story panel
   ========================================================================== */

.news-workspace.has-selection .news-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1250px) {

    .news-grid,
    .news-workspace.has-selection .news-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .news-card:nth-child(3n) {
        border-right: 1px solid var(--news-border);
    }

    .news-card:nth-child(2n) {
        border-right: 0;
    }
}


@media (max-width: 1100px) {
    .news-page__header {
        grid-template-columns:
            auto minmax(160px, 1fr) auto;

        gap: 14px;
    }

    .news-page__eyebrow {
        font-size: 7px;
        letter-spacing: 0.16em;
    }

    .news-workspace {
        grid-template-columns:
            minmax(0, 1fr) 300px;
    }

    .news-story {
        grid-template-columns:
            28px 44px minmax(0, 1fr) 28px;
    }

    .news-story__arrow {
        display: none;
    }

    .news-toolbar {
        grid-template-columns:
            minmax(260px, 1fr) auto;
    }

    .news-toolbar__status {
        gap: 8px;
    }
}


@media (max-width: 850px) {
    .news-page {
        padding:
            8px 12px 20px;
    }

    .news-page__header {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;

        min-height: 0;
        padding-bottom: 8px;
    }

    .news-page__header>div:first-child {
        display: block;
    }

    .news-page__eyebrow {
        margin-bottom: 5px;
    }

    .news-page__title-row {
        justify-content: flex-start;
    }

    .news-page__stats {
        width: 100%;
    }

    .news-page__stats>div {
        flex: 1;
    }

    .news-toolbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .news-search {
        width: 100%;
    }

    .news-toolbar__status {
        justify-content: space-between;
    }

    .news-workspace {
        grid-template-columns: 1fr;
    }

    .news-feed {
        border-right: 0;
    }

    .news-intelligence {
        border-top: 1px solid var(--news-border);
    }

    .news-feed__rows {
        max-height: none;
    }

    .news-grid,
    .news-workspace.has-selection .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card,
    .news-card:nth-child(2n),
    .news-card:nth-child(3n) {
        border-right: 0;
    }
}