/**
 * Community Feed styles
 * File: /wp-content/themes/wrestlerfinder/assets/css/community.css
 *
 * Enqueued only on the Community Feed template. Two-column desktop
 * (feed 65% / sidebar 35%), single-column mobile with the sidebar
 * hidden. All colors + spacing come from design-system.css tokens —
 * no hardcoded values.
 */

/* =========================================================================
   Layout
   ========================================================================= */

.wf-community {
    padding-block: var(--space-6) var(--space-12);
    background:    var(--color-bg);
    min-height:    50vh;
}

.wf-community__inner {
    max-width:      1200px;
    margin-inline:  auto;
    padding-inline: var(--space-4);
    display:        block;
}

@media ( min-width: 900px ) {
    .wf-community__inner {
        display:               grid;
        grid-template-columns: minmax( 0, 1fr ) 340px;
        gap:                   var(--space-8);
        align-items:           start;
    }
}

.wf-community__feed-col {
    min-width: 0; /* prevent grid child overflow */
}

.wf-community__sidebar {
    display: none;
}

@media ( min-width: 900px ) {
    .wf-community__sidebar {
        display: block;
        position: sticky;
        top: calc( var(--wf-site-header-height, 53px) + var(--space-4) );
    }
}

/* =========================================================================
   Sidebar — stats card
   ========================================================================= */

.wf-community__stats-card {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding:       var(--space-5);
}

.wf-community__card-title {
    font-family: var(--font-heading);
    font-size:   var(--text-lg);
    margin:      0 0 var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color:       var(--color-text);
}

.wf-community__stats-list {
    list-style: none;
    margin:     0;
    padding:    0;
    display:    flex;
    flex-direction: column;
    gap:        var(--space-3);
}

.wf-community__stats-list li {
    display:     flex;
    align-items: baseline;
    gap:         var(--space-2);
}

.wf-community__stat-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.wf-community__stats-list strong {
    font-size: var(--text-lg);
    color: var(--color-text);
    font-weight: 700;
}

.wf-community__stat-label {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* =========================================================================
   Post composer
   ========================================================================= */

.wf-post-form {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    overflow:      hidden;
}

.wf-post-form__prompt {
    width:       100%;
    display:     flex;
    align-items: center;
    gap:         var(--space-3);
    padding:     var(--space-3) var(--space-4);
    background:  transparent;
    border:      none;
    color:       var(--color-text-muted);
    cursor:      pointer;
    font:        inherit;
    text-align:  left;
}

.wf-post-form__prompt:hover {
    background: var(--color-surface-2);
}

.wf-post-form--expanded .wf-post-form__prompt { display: none; }
.wf-post-form--expanded .wf-post-form__body   { display: block; }
.wf-post-form__body { padding: var(--space-4); }

.wf-post-form__avatar {
    flex-shrink:  0;
    width:        36px;
    height:       36px;
    border-radius: 50%;
    background:   var(--color-primary);
    color:        #0D1117;
    display:      inline-flex;
    align-items:  center;
    justify-content: center;
    font-weight:  700;
    overflow:     hidden;
}

.wf-post-form__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wf-post-form__avatar-initials {
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
}

.wf-post-form__row {
    display:      flex;
    gap:          var(--space-3);
    align-items:  flex-start;
}

.wf-post-form__textarea {
    flex:          1 1 auto;
    min-width:     0;
    padding:       var(--space-3);
    background:    var(--color-surface-2);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-md);
    color:         var(--color-text);
    font:          inherit;
    line-height:   1.5;
    resize:        vertical;
}

.wf-post-form__actions-row {
    display:       flex;
    align-items:   center;
    gap:           var(--space-3);
    margin-top:    var(--space-3);
    flex-wrap:     wrap;
}

.wf-post-form__media-btn {
    display:       inline-flex;
    align-items:   center;
    gap:           var(--space-1);
    padding:       var(--space-2) var(--space-3);
    background:    var(--color-surface-2);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-md);
    color:         var(--color-text);
    cursor:        pointer;
    font-size:     var(--text-sm);
    user-select:   none;
}

.wf-post-form__media-btn:hover {
    background:  var(--color-surface-3);
    border-color: var(--color-primary);
}

.wf-post-form__media-btn--locked {
    opacity: 0.7;
}

.wf-post-form__media-btn--locked:hover {
    border-color: var(--color-border);
    background:   var(--color-surface-2);
    cursor:       help;
}

.wf-post-form__lock { font-size: var(--text-xs); }

.wf-post-form__char-count {
    margin-left: auto;
    font-size:   var(--text-xs);
    color:       var(--color-text-muted);
}

.wf-post-form__char-count--warn { color: var(--color-danger, #F85149); }

/* Media previews — hidden by default, revealed by .is-visible when
   media exists. Class-based (rather than [hidden]) so all the
   composer's progressive-reveal elements share one mechanism. Bump
   specificity via the compound selector so nobody can accidentally
   override with a same-single-class rule. */

.wf-post-form__photo-preview {
    display: none;
    margin-top: var(--space-3);
    grid-template-columns: repeat( 4, 1fr );
    gap: var(--space-2);
}

.wf-post-form__photo-preview.is-visible {
    display: grid;
}

.wf-post-form__photo-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.wf-post-form__photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wf-post-form__thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba( 0, 0, 0, 0.7 );
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wf-post-form__video-preview {
    display: none;
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.wf-post-form__video-preview.is-visible {
    display: flex;
}

.wf-post-form__profile-toggle {
    display: none;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text);
}

.wf-post-form__profile-toggle.is-visible {
    display: block;
}

/* Video cap note — same progressive-reveal pattern. Displayed when the
   athlete's profile already has the max number of videos so the
   "set as primary" flow explains why it can't run. */
.wf-post-form__video-cap-note {
    display: none;
    margin: var(--space-3) 0 0;
    padding: var(--space-2) var(--space-3);
    background: var(--color-teal-dim);
    color: var(--color-text);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.wf-post-form__video-cap-note.is-visible {
    display: block;
}

.wf-post-form__profile-toggle input {
    margin-right: var(--space-2);
    accent-color: var(--color-primary);
}

.wf-post-form__profile-toggle small {
    display: block;
    margin-top: 2px;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.wf-post-form__submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.wf-post-form__visibility {
    display: none;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}

.wf-post-form__visibility.is-visible {
    display: inline-flex;
}

.wf-post-form__vis-pill {
    padding: var(--space-1) var(--space-3);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    border-radius: calc( var(--radius-md) - 2px );
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: inherit;
}

.wf-post-form__vis-pill.is-active {
    background: var(--color-primary);
    color: #0D1117;
    font-weight: 600;
}

.wf-post-form__buttons {
    display: inline-flex;
    gap: var(--space-2);
}

.wf-post-form__error {
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: rgba( 248, 81, 73, 0.1 );
    border: 1px solid var(--color-danger, #F85149);
    border-radius: var(--radius-md);
    color: var(--color-danger, #F85149);
    font-size: var(--text-sm);
}

/* =========================================================================
   Skeleton loader (visible during initial fetch)
   ========================================================================= */

.wf-feed-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.wf-feed-skeleton__card {
    background: linear-gradient( 90deg,
        var(--color-surface) 0%,
        var(--color-surface-2) 50%,
        var(--color-surface) 100% );
    background-size: 200% 100%;
    height: 140px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    animation: wf-feed-skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes wf-feed-skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wf-feed-skeleton[hidden] { display: none; }

/* =========================================================================
   Feed items
   ========================================================================= */

.wf-feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.wf-feed-item {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding:       var(--space-4);
    transition:    box-shadow 0.15s ease, transform 0.15s ease;
    position:      relative;
}

.wf-feed-item:hover {
    box-shadow: 0 8px 20px rgba( 0, 0, 0, 0.25 );
}

.wf-feed-item--system {
    border-left: 3px solid var(--color-primary);
}

.wf-feed-item__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.wf-feed-item__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #0D1117;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    overflow: hidden;
}

.wf-feed-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wf-feed-item__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wf-feed-item__name-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: baseline;
}

.wf-feed-item__name {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.wf-feed-item__name:hover { color: var(--color-primary); }

.wf-feed-item__submeta {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.wf-feed-item__submeta-sep::before {
    content: '·';
    margin: 0 var(--space-1);
    color: var(--color-text-subtle);
}

.wf-feed-item__timestamp {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.wf-feed-item__visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
}

.wf-feed-item__body {
    margin-top: var(--space-3);
}

.wf-feed-item__content {
    margin: 0 0 var(--space-3);
    color: var(--color-text);
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

/* Media block — photos + video */

.wf-feed-item__media {
    margin: var(--space-3) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.wf-feed-item__photos {
    display: grid;
    gap: 2px;
}

.wf-feed-item__photos--1 { grid-template-columns: 1fr; }
.wf-feed-item__photos--2 { grid-template-columns: 1fr 1fr; }
.wf-feed-item__photos--3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.wf-feed-item__photos--3 > *:first-child { grid-row: 1 / 3; }
.wf-feed-item__photos--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.wf-feed-item__photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--color-surface-2);
    overflow: hidden;
}

.wf-feed-item__photos--1 .wf-feed-item__photo {
    aspect-ratio: auto;
    max-height: 400px;
}

.wf-feed-item__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wf-feed-item__photo--gated img {
    filter: blur( 12px );
}

/* Logged-out placeholder — no image URL in the DOM. Same footprint
   as the real photo cell so the "Sign in to view" overlay reads. */
.wf-feed-item__photo--placeholder {
    background: linear-gradient( 135deg,
        var(--color-surface-2) 0%,
        var(--color-surface-3) 100% );
}

.wf-feed-item__photo-gate {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba( 0, 0, 0, 0.4 );
    font-size: var(--text-sm);
    font-weight: 600;
    text-shadow: 0 1px 4px rgba( 0, 0, 0, 0.6 );
}

.wf-feed-item__video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.wf-feed-item__video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wf-feed-item__video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba( 0, 0, 0, 0.3 );
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 48px;
    line-height: 1;
    transition: background 0.15s ease;
}

.wf-feed-item__video-play:hover { background: rgba( 0, 0, 0, 0.5 ); }

.wf-feed-item__video-gate {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba( 0, 0, 0, 0.55 );
    color: #fff;
    font-weight: 600;
}

/* Reaction bar + footer */

.wf-feed-item__footer {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.wf-reaction-bar {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    /* Anchor for the absolute-positioned reactor popover. */
    position: relative;
}

.wf-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wf-reaction-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.wf-reaction-btn.is-active {
    background: var(--color-primary);
    color: #0D1117;
    border-color: var(--color-primary);
    font-weight: 600;
}

.wf-reaction-btn[data-loading="1"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Reaction unit — pairs an icon button with its clickable count.
   The button toggles the reaction; the count opens the reactor
   attribution popover. Split so each click target has a distinct
   semantic + a distinct hover treatment. */
.wf-reaction-unit {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.wf-reaction-count {
    background: transparent;
    border: 1px solid transparent;
    padding: 2px var(--space-1);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    min-width: 20px;
}

.wf-reaction-count:hover,
.wf-reaction-count:focus-visible {
    color: var(--color-text);
    background: var(--color-surface-3);
    border-color: var(--color-border);
    outline: none;
}

.wf-reaction-count[hidden] { display: none; }

/* Subtle "⚡ Coach reacted" dot — hidden by default, revealed only
   when the bar wrapper carries the has-coach modifier. Teal, small,
   spaced from the last count so it reads as a signal, not chrome. */
.wf-reaction-coach-indicator {
    display: none;
    width: 6px;
    height: 6px;
    background: var(--color-teal);
    border-radius: 50%;
    margin-left: var(--space-1);
    box-shadow: 0 0 6px var(--color-teal-glow);
}

.wf-reaction-bar--has-coach .wf-reaction-coach-indicator {
    display: inline-block;
}

/* Sign-in tooltip surfaced on logged-out count click. Ephemeral —
   auto-removed after ~2.5s in JS. */
.wf-reaction-signin-tip {
    position: absolute;
    left: 0;
    bottom: calc(100% + var(--space-1));
    background: var(--color-surface-3);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: 90;
    pointer-events: none;
    animation: wf-reaction-signin-tip-in 0.15s ease both;
}

@keyframes wf-reaction-signin-tip-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wf-feed-item__view-profile {
    font-size: var(--text-sm);
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.wf-feed-item__view-profile:hover { text-decoration: underline; }

/* =========================================================================
   Feed item three-dot menu — delete post flow.
   Visibility gated in JS: admin sees on every card, athlete sees only
   on their own athlete posts. Rendered as a direct child of
   .wf-feed-item__header so it can sit at the far right via margin-auto.
   ========================================================================= */

.wf-feed-item__menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.wf-feed-item__menu-trigger {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-lg);
    line-height: 1;
    font-family: inherit;
}

.wf-feed-item__menu-trigger:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

.wf-feed-item__menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 180px;
    z-index: 50;
    box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.3 );
}

.wf-feed-item__delete-btn {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    color: var(--color-danger, #F85149);
    cursor: pointer;
    text-align: left;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    font-family: inherit;
}

.wf-feed-item__delete-btn:hover {
    background: var(--color-surface-3);
}

.wf-feed-item__confirm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

.wf-feed-item__confirm p {
    color: var(--color-text);
    margin: 0 0 var(--space-2);
    line-height: 1.4;
}

.wf-feed-item__confirm-actions {
    display: flex;
    gap: var(--space-2);
}

.wf-feed-item__confirm-yes {
    background: var(--color-danger, #F85149);
    color: #fff;
    border: none;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-xs);
    font-family: inherit;
    font-weight: 600;
}

.wf-feed-item__confirm-yes:disabled {
    opacity: 0.6;
    cursor: wait;
}

.wf-feed-item__confirm-no {
    background: var(--color-surface-3);
    color: var(--color-text);
    border: none;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-xs);
    font-family: inherit;
}

.wf-feed-item__confirm-error {
    color: var(--color-danger, #F85149);
    margin: 0 0 var(--space-2);
    line-height: 1.4;
}

.wf-feed-item--deleting {
    opacity: 0;
    transform: translateY( -8px );
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* =========================================================================
   Logged-out soft gate (inserted after 5th item)
   ========================================================================= */

.wf-feed-gate {
    background:    var(--color-surface);
    border:        1px dashed var(--color-primary);
    border-radius: var(--radius-lg);
    padding:       var(--space-6);
    text-align:    center;
}

.wf-feed-gate__title {
    margin: 0 0 var(--space-2);
    color:  var(--color-text);
    font-family: var(--font-heading);
    font-size: var(--text-lg);
}

.wf-feed-gate__sub {
    margin: 0 0 var(--space-4);
    color:  var(--color-text-muted);
}

.wf-feed-gate__actions {
    display: inline-flex;
    gap: var(--space-2);
}

/* =========================================================================
   Load more + empty state
   ========================================================================= */

.wf-community__load-more {
    display: block;
    margin: var(--space-6) auto 0;
    min-width: 160px;
}

/* [hidden]-guard — WITHOUT this, the class rule above beats the UA
   stylesheet's [hidden] { display: none } by source order (same
   0,1,0 specificity, but our class rule loads later). JS setting
   loadMore.hidden = true correctly writes the attribute, but the
   button still renders visible. This is the CSS-specificity gotcha
   documented in CLAUDE.md § "CSS specificity must match or exceed
   competing rules to win". Same-selector [hidden] rule at (0,2,0)
   wins the cascade in both directions.
   Bug found on logged-out /community/ with zero public items —
   empty branch in renderInitial() set hidden=true, but the button
   still rendered visible until this rule shipped. */
.wf-community__load-more[hidden] {
    display: none;
}

.wf-feed-empty {
    padding:    var(--space-8);
    background: var(--color-surface);
    border:     1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color:      var(--color-text-muted);
    text-align: center;
}

/* =========================================================================
   Public athlete profile — Recent Activity band (Session 4).
   Reuses .wf-feed-item card styles from above; adds only the section
   framing + heading.
   ========================================================================= */

.wf-profile-feed {
    margin-top: var(--space-8);
    padding-block: var(--space-6);
}

.wf-profile-feed__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 var(--space-4);
    color: var(--color-text);
}

.wf-profile-feed__link {
    margin: var(--space-4) 0 0;
    text-align: right;
}

.wf-profile-feed__link a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.wf-profile-feed__link a:hover { text-decoration: underline; }

/* =========================================================================
   Athlete-filter banner (Session 4, Part 10 — "?athlete=" URL param)
   ========================================================================= */

.wf-feed-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--color-surface-2);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text);
    flex-wrap: wrap;
}

.wf-feed-filter-banner a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.wf-feed-filter-banner a:hover { text-decoration: underline; }

/* =============================================================================
   Reactor attribution popover
   ----------------------------------------------------------------------------
   Anchored to .wf-reaction-bar (which sets position: relative). Opens above
   the bar; the fixed 280px width keeps it inside a feed card at every
   viewport. Tabs let the viewer switch between reaction types; the list
   surfaces coach reactors first with a teal badge next to their names.
============================================================================= */

.wf-reaction-popover {
    position: absolute;
    bottom: calc(100% + var(--space-2));
    left: 0;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 280px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: wf-reaction-popover-in 0.15s ease both;
}

@keyframes wf-reaction-popover-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wf-reaction-popover__tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-2) 0;
    gap: var(--space-1);
}

.wf-reaction-popover__tabs button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-1) var(--space-2);
    cursor: pointer;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: var(--text-sm);
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.wf-reaction-popover__tabs button:hover:not(:disabled) {
    color: var(--color-text);
}

.wf-reaction-popover__tabs button.active {
    border-bottom-color: var(--color-teal);
    color: var(--color-text);
}

.wf-reaction-popover__tabs button:disabled {
    opacity: 0.4;
    cursor: default;
}

.wf-reaction-popover__list {
    padding: var(--space-2);
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-subtle) transparent;
}

.wf-reaction-popover__list::-webkit-scrollbar         { width: 4px; }
.wf-reaction-popover__list::-webkit-scrollbar-track   { background: transparent; }
.wf-reaction-popover__list::-webkit-scrollbar-thumb   {
    background: var(--color-border-subtle);
    border-radius: 2px;
}

.wf-reaction-popover__reactor {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    /* Selector matches both <div> and <a> variants — reset the anchor
       defaults (underline, browser link color) so the <a> row looks
       identical to the <div> row. Coaches / non-athlete reactors
       render as <div>. */
    text-decoration: none;
    color: inherit;
}

.wf-reaction-popover__reactor:hover,
.wf-reaction-popover__reactor:focus-visible {
    background: var(--color-surface-3);
    text-decoration: none;
    outline: none;
}

.wf-reaction-popover__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-surface-3);
}

.wf-reaction-popover__avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-bg);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
}

.wf-reaction-popover__name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-reaction-popover__badge--coach {
    font-size: var(--text-xs);
    background: var(--color-teal);
    color: var(--color-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.wf-reaction-popover__more {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    padding: var(--space-2);
}

.wf-reaction-popover__empty {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    padding: var(--space-3);
    margin: 0;
}

/* Skeleton placeholders while the reactions fetch is in flight. Reuses
   the same pulse keyframes as the feed-card skeletons. */
.wf-reaction-popover__skeleton {
    background: var(--color-surface-3);
    border-radius: var(--radius-sm);
    animation: wf-feed-skeleton-pulse 1.4s ease-in-out infinite;
}

.wf-reaction-popover__skeleton--tab {
    height: 20px;
    width: 60px;
    margin: 0 var(--space-1) var(--space-2);
}

.wf-reaction-popover__skeleton--row {
    height: 40px;
    margin: var(--space-1) 0;
}
