/*
 * ClapBackClub solid-red visual layer.
 *
 * The base stylesheet owns layout and responsive behavior. This file only
 * replaces the washed-out red system with opaque, block-based treatments.
 */

:root {
    --brand-red: #da2921;
    --brand-red-dark: #aa1f19;
    --brand-red-deep: #6f1410;
    --brand-red-bright: #f0443b;
    --brand-red-tint: #f1c7c4;
    --brand-red-tint-strong: #e58f89;

    --color-accent: var(--brand-red);
    --color-accent-button: var(--brand-red);
    --color-accent-dark: var(--brand-red-deep);
    --color-accent-surface: #f5dddb;
    --color-accent-surface-soft: var(--brand-red-tint);
    --color-accent-surface-hover: #eba9a4;
    --color-accent-surface-strong: var(--brand-red-tint-strong);
    --color-accent-border: var(--brand-red-dark);
}

html[data-theme="dark"] {
    --color-accent: var(--brand-red);
    --color-accent-button: var(--brand-red);
    --color-accent-dark: var(--brand-red-bright);
    --color-accent-surface: #2c0d0b;
    --color-accent-surface-soft: #38100d;
    --color-accent-surface-hover: #4a120f;
    --color-accent-surface-strong: var(--brand-red-deep);
    --color-accent-border: var(--brand-red-dark);
}

/* Primary actions use the exact brand red and opaque, darker depth blocks. */
.button--primary,
.button--danger,
.top-nav__post,
.sidebar-link--pro,
.clapback-cta {
    border-color: transparent;
    background: var(--brand-red);
    box-shadow: 0 4px 0 var(--brand-red-deep);
    color: #fff;
}

.button--primary:hover,
.button--danger:hover,
.top-nav__post:hover,
.sidebar-link.sidebar-link--pro:hover,
.clapback-cta:hover {
    border-color: transparent;
    background: var(--brand-red-dark);
    box-shadow: 0 2px 0 var(--brand-red-deep);
    color: #fff;
    filter: none;
    transform: translateY(2px);
}

.button--primary:active,
.button--danger:active,
.top-nav__post:active,
.sidebar-link--pro:active,
.clapback-cta:active {
    box-shadow: none;
    transform: translateY(4px);
}

.top-nav .wordmark:hover,
.top-nav .wordmark:focus-visible {
    filter: drop-shadow(0 4px 0 var(--brand-red-dark));
}

.clapback-cta .clapback-mark {
    color: #fff;
}

.clapback-cta .clapback-mark path:last-child {
    fill: var(--brand-red-deep);
}

/* Active navigation is a filled state, not a hairline indicator. */
.sidebar-link.is-active {
    background: var(--brand-red);
    box-shadow: inset 6px 0 0 var(--brand-red-deep);
    color: #fff;
    font-weight: 800;
}

.sidebar-link.is-active::before {
    display: none;
}

html[data-theme="dark"] .sidebar-link.is-active {
    background: var(--brand-red-dark);
    box-shadow: inset 6px 0 0 var(--brand-red-bright);
    color: #fff;
}

.tab::after,
.content-type-tab::after,
.feed-sort-tab::after {
    height: 5px;
}

/* The join module now reads as one solid card with a darker action block. */
.sidebar-join {
    border: 0;
    border-radius: 10px;
    background: var(--brand-red);
    box-shadow: 0 6px 0 var(--brand-red-deep);
    color: #fff;
}

.sidebar-join .sidebar-label,
.sidebar-join p,
.sidebar-join .sidebar-login-link {
    color: #fff;
}

.sidebar-join .button--primary {
    background: #111;
    box-shadow: 0 4px 0 var(--brand-red-deep);
}

.sidebar-join .button--primary:hover {
    background: var(--brand-red-deep);
}

html[data-theme="dark"] .sidebar-join {
    border-color: transparent;
    background: var(--brand-red-dark);
}

html[data-theme="dark"] .sidebar-join p,
html[data-theme="dark"] .sidebar-join .sidebar-login-link {
    color: #fff;
}

.sidebar-clapback {
    border: 0;
    border-radius: 8px;
    background: var(--brand-red-dark);
    box-shadow: inset 6px 0 0 var(--brand-red-bright);
    color: #fff;
}

.sidebar-clapback:hover {
    background: var(--brand-red);
}

.sidebar-clapback small,
.sidebar-clapback__stats {
    color: #fff;
}

html[data-theme="dark"] .sidebar-clapback,
html[data-theme="dark"] .sidebar-clapback:hover {
    border-color: transparent;
    background: var(--brand-red-dark);
    color: #fff;
}

html[data-theme="dark"] .sidebar-clapback small,
html[data-theme="dark"] .sidebar-clapback__stats {
    color: #fff;
}

/* Headings keep the approved red emphasis; feed cards themselves stay flat. */
.feed-intro,
.page-heading {
    border: 0;
    border-top: 6px solid var(--brand-red);
    box-shadow: 0 6px 0 var(--color-surface-muted);
}

.feed-list > .situation-card,
.situation-card--detail {
    border: 0;
    border-radius: 10px;
    box-shadow: none;
}

html[data-theme="dark"] .feed-list > .situation-card,
html[data-theme="dark"] .situation-card--detail {
    box-shadow: none;
}

/*
 * Situation copy is the dominant red mass from the reference: fully opaque,
 * exact red in light mode, one step darker in dark mode, and never a fade.
 */
.situation-text--feed {
    border: 0;
    border-radius: 10px;
    background: var(--brand-red);
    background-image: none;
    box-shadow: inset 0 -7px 0 var(--brand-red-dark);
    color: #fff;
    font-weight: 700;
}

.situation-text--feed::before {
    color: var(--brand-red-deep);
}

a.situation-text--feed:hover {
    background: var(--brand-red-dark);
    background-image: none;
    box-shadow: inset 0 -7px 0 var(--brand-red-deep);
    color: #fff;
    text-decoration: none;
}

html[data-theme="dark"] .situation-text--feed {
    background: var(--brand-red-dark);
    background-image: none;
    box-shadow: inset 0 -7px 0 var(--brand-red-deep);
    color: #fff;
}

html[data-theme="dark"] a.situation-text--feed:hover {
    background: var(--brand-red);
    background-image: none;
    color: #fff;
}

/* Category is quiet metadata: icon + text with a small red cue, never a CTA. */
.situation-category-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    padding: 3px 2px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-text-soft);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .01em;
    line-height: 1.2;
    opacity: 1;
    transition: color .16s ease;
}

.situation-category-pill .icon {
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--brand-red);
    stroke-width: 2;
}

.situation-category-pill:hover {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--color-text);
    transform: none;
}

.situation-category-pill:hover .icon {
    background: transparent;
    color: var(--brand-red-dark);
}

.situation-category-pill:active {
    box-shadow: none;
    transform: none;
}

html[data-theme="dark"] .situation-category-pill {
    border-color: transparent;
    background: transparent;
    color: #d3d3d3;
}

html[data-theme="dark"] .situation-category-pill:hover {
    border-color: transparent;
    background: transparent;
    color: #fff;
}

html[data-theme="dark"] .situation-category-pill .icon {
    background: transparent;
    color: var(--brand-red-bright);
}

/* Pull the red situation and its information strip into one visual unit. */
.situation-text--feed {
    margin-bottom: 3px;
}

/* Feed statistics and actions form one compact, flat strip. */
.situation-card__footer,
.situation-detail-meta,
.situation-actions,
.situation-stats,
.situation-clapback-cta,
.situation-clapback-cta--bottom {
    border: 0;
}

.situation-card__footer {
    min-height: 38px;
    background: var(--color-surface);
}

.situation-card__footer .situation-stats {
    min-height: 38px;
    gap: 12px;
    padding: 5px 12px;
    border: 0;
}

.situation-card__footer .situation-actions {
    min-height: 38px;
}

.situation-card__footer .card-action {
    min-height: 38px;
    padding: 5px 8px;
}

.situation-card__footer .card-action:hover {
    background: transparent;
    color: #555;
}

html[data-theme="dark"] .situation-card__footer .card-action:hover {
    background: transparent;
    color: var(--color-text-soft);
}

.situation-card__footer .situation-save-button.is-saved:hover,
html[data-theme="dark"] .situation-card__footer .situation-save-button.is-saved:hover {
    background: var(--color-accent-surface);
    color: var(--color-accent);
}

.situation-card__footer .card-action--strong:hover {
    color: var(--brand-red);
}

html[data-theme="dark"] .situation-card__footer .card-action--strong:hover {
    color: var(--brand-red-bright);
}

.situation-card__footer .situation-save-button:hover .icon {
    transform: none;
}

html[data-theme="dark"] .situation-card__footer {
    background: var(--color-surface);
}

.card-action--strong {
    color: var(--brand-red);
    font-weight: 850;
}

html[data-theme="dark"] .card-action--strong {
    color: var(--brand-red-bright);
}

/* Previous / Next stay readable against both page palettes. */
.situation-navigation__button {
    border-color: #777;
    background: #f3f3f3;
    color: #111;
    font-weight: 800;
}

.situation-navigation__button:hover {
    border-color: #111;
    background: #e7e7e7;
    color: #000;
}

.situation-navigation__button .icon {
    color: currentColor;
}

.situation-navigation__button:hover .icon {
    color: currentColor;
}

.situation-navigation__button:disabled {
    border-color: #aaa;
    background: #ededed;
    color: #555;
    opacity: .72;
}

html[data-theme="dark"] .situation-navigation__button {
    border-color: #888;
    background: #252525;
    color: #f4f4f4;
}

html[data-theme="dark"] .situation-navigation__button:hover {
    border-color: #fff;
    background: #353535;
    color: #fff;
}

html[data-theme="dark"] .situation-navigation__button:disabled {
    border-color: #666;
    background: #202020;
    color: #bcbcbc;
    opacity: .72;
}

/* On detail pages the compact Clap Back CTA sits directly left of Share. */
.situation-card--detail .situation-detail-meta {
    min-height: 40px;
    border: 0;
    background: var(--color-surface);
}

.situation-card--detail .situation-detail-meta .situation-stats {
    min-width: 180px;
    min-height: 40px;
    padding-block: 5px;
    border: 0;
    background: var(--color-surface);
}

.situation-card--detail .situation-detail-actions {
    min-height: 40px;
    align-items: stretch;
    background: var(--color-surface);
}

.situation-card--detail .situation-detail-actions .card-action + .card-action {
    border-left: 0;
}

.situation-card--detail .situation-detail-share,
.situation-card--detail .situation-save-button {
    min-height: 40px;
    padding: 5px 12px;
}

.situation-card--detail .clapback-cta--inline {
    width: auto;
    min-width: 132px;
    min-height: 36px;
    align-self: center;
    gap: 7px;
    margin: 2px 6px;
    padding: 5px 11px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 12px;
    letter-spacing: .04em;
}

.situation-card--detail .clapback-cta--inline .clapback-mark {
    width: 22px;
    height: 22px;
}

.situation-card--detail .clapback-cta--inline:hover {
    background: var(--brand-red-dark);
    box-shadow: none;
    transform: none;
}

/* Speech bubbles regain a complete outline and restrained interaction states. */
.clapback-popularity-label {
    z-index: 3;
    min-height: 31px;
    margin-bottom: -10px;
    padding: 6px 18px;
    border: 0;
    border-radius: 6px 6px 3px 3px;
    background: var(--brand-red);
    box-shadow: none;
}

.clapback-row,
html[data-theme="dark"] .clapback-row {
    border: 1px solid #b8b8b8;
    background: var(--color-clapback-surface);
    box-shadow: 0 2px 5px rgb(0 0 0 / 8%);
}

html[data-theme="dark"] .clapback-row {
    border-color: #555;
    box-shadow: 0 2px 5px rgb(0 0 0 / 32%);
}

.clapback-row::before,
html[data-theme="dark"] .clapback-row::before {
    display: block;
    border-top-color: #b8b8b8;
}

.clapback-row::after,
html[data-theme="dark"] .clapback-row::after {
    left: 20px;
    border-width: 22px 22px 0 0;
    border-top-color: var(--color-clapback-surface);
}

html[data-theme="dark"] .clapback-row::before {
    border-top-color: #555;
}

.clapback-row:focus-within,
html[data-theme="dark"] .clapback-row:focus-within {
    border-color: var(--brand-red);
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
    background: var(--color-clapback-surface);
    box-shadow: none;
}

.clapback-row:focus-within::before,
html[data-theme="dark"] .clapback-row:focus-within::before {
    border-top-color: var(--brand-red);
}

/* Nested replies use the same lighter-weight border language. */
.reply-card,
.reply-composer,
html[data-theme="dark"] .reply-card,
html[data-theme="dark"] .reply-composer {
    border: 1px solid var(--color-control-border);
    box-shadow: none;
}

.reply-children {
    border-left: 2px solid var(--color-control-border);
}

.reply-children > .reply-node::before {
    border-top: 2px solid var(--color-control-border);
}

.add-clapback,
html[data-theme="dark"] .add-clapback {
    border: 0;
    border-radius: 10px;
    background: var(--brand-red-dark);
    box-shadow: inset 6px 0 0 var(--brand-red-bright), 0 6px 0 var(--brand-red-deep);
    color: #fff;
}

.add-clapback:hover,
.add-clapback:focus-within,
html[data-theme="dark"] .add-clapback:hover,
html[data-theme="dark"] .add-clapback:focus-within {
    border-color: transparent;
    background: var(--brand-red);
    box-shadow: inset 6px 0 0 var(--brand-red-deep), 0 6px 0 var(--brand-red-deep);
}

.add-clapback__guest:hover,
html[data-theme="dark"] .add-clapback__guest:hover {
    background: var(--brand-red-deep);
}

.add-clapback__guest strong,
.add-clapback__guest small,
html[data-theme="dark"] .add-clapback__guest strong,
html[data-theme="dark"] .add-clapback__guest small {
    color: #fff;
}

.add-clapback textarea:focus,
.reply-composer textarea:focus {
    border-color: var(--brand-red-deep);
    outline: 3px solid var(--brand-red-bright);
    outline-offset: 2px;
    box-shadow: none;
}

/* Remaining branded callouts use the new hue and thicker solid emphasis. */
.admin-inline-tools,
.media-upload,
.generator-load-form,
.pro-cancel-note,
.cms-content blockquote,
.app-page__notice {
    border-color: var(--brand-red-dark);
    border-left-width: 6px;
}

.app-page__mark {
    background: var(--brand-red);
    box-shadow: 0 6px 0 var(--brand-red-deep);
}

.auth-form-error {
    border: 0;
    background: var(--brand-red-deep);
    box-shadow: inset 6px 0 0 var(--brand-red-bright);
    color: #fff;
}

@media (hover: hover) {
    .feed-list > .situation-card:hover,
    html[data-theme="dark"] .feed-list > .situation-card:hover {
        border-color: transparent;
        background: var(--color-surface);
        box-shadow: none;
    }

    .clapback-row:hover,
    html[data-theme="dark"] .clapback-row:hover {
        border-color: var(--brand-red);
        background: var(--color-clapback-surface);
        box-shadow: none;
    }

    .clapback-row:hover::before,
    html[data-theme="dark"] .clapback-row:hover::before {
        border-top-color: var(--brand-red);
    }
}

@media (max-width: 1100px) {
    .situation-card__footer .situation-stats {
        border: 0;
    }
}

@media (max-width: 560px) {
    /* Keep the same quiet icon + text category treatment on phones. */
    .situation-category-pill {
        width: auto;
        min-width: 0;
        max-width: min(150px, 42vw);
        justify-content: flex-start;
        padding: 3px 2px;
    }

    .situation-category-pill .icon {
        width: 16px;
        height: 16px;
    }

    .situation-category-pill span {
        position: static;
        width: auto;
        height: auto;
        overflow: hidden;
        clip: auto;
        clip-path: none;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .situation-text--feed {
        margin-bottom: 2px;
    }

    .situation-card__footer .situation-stats {
        border: 0;
        background: var(--color-surface);
    }

    html[data-theme="dark"] .situation-card__footer .situation-stats {
        background: var(--color-surface);
    }
}
