/*
 * Announcement cards — the styling that goes with js/components/announcement-card.js.
 *
 * These rules used to live in an inline <style> block in pages/club.html. When
 * the renderer was shared with the dashboard Club Feed (TODO 135) the markup
 * moved and the CSS did not, so the dashboard rendered the right elements with
 * none of the styling — no card, no padding, no accent. A shared renderer needs
 * a shared stylesheet; keeping them apart is how that happens again.
 *
 * The club page's announcement FORM and SIDEBAR styles are deliberately NOT
 * here — they belong to that page's authoring UI, which the feed does not have.
 *
 * Loaded by: index.html (dashboard feed), pages/club.html (announcements tab).
 */

/* ---- The card itself ---------------------------------------------------- */

.ann-card {
    background: #fff;
    border-radius: 10px;
    border-left: 4px solid #111037;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow .2s;
}
.ann-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }
.ann-pinned { border: 1px solid #ffc107; border-left: 4px solid #ffc107; }

.ann-banner img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.ann-body { padding: 20px; }

.ann-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ann-type-badge {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ann-pin-badge,
.ann-priority-badge {
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ann-pin-badge { color: #ffc107; }
.ann-priority-badge { color: #dc3545; }

.ann-actions { margin-left: auto; display: flex; gap: 4px; }
.ann-action-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 13px;
    transition: all .15s;
}
.ann-action-btn:hover { background: #f8f9fa; color: #333; }
.ann-action-delete:hover { background: #dc3545; color: #fff; border-color: #dc3545; }

.ann-title { margin: 0 0 8px; color: #2c3e50; font-size: 17px; font-weight: 600; }
.ann-message {
    margin: 0 0 14px;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.ann-footer {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.ann-footer i { margin-right: 3px; }

.ann-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.ann-media-item img,
.ann-media-item video {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    max-height: 180px;
    object-fit: cover;
}
/* Read-only surfaces suppress the lightbox click, so don't imply one. */
.club-feed-list .ann-media-item img,
.club-feed-list .ann-media-item video { cursor: default; }

/* ---- Compact variant: the dashboard feed column ------------------------- *
 *
 * The feed is a sidebar, not a page. At full card sizing a single release-notes
 * post fills the whole column and the feed stops being scannable — which is the
 * one thing TODO 135 asked for. So in the feed: tighter padding, smaller type,
 * and long bodies clamped to a few lines rather than running to any length.
 */

.club-feed-list .ann-card { margin-bottom: 10px; border-radius: 12px; }
.club-feed-list .ann-body { padding: 16px; }
.club-feed-list .ann-title {
    font-size: 15px;
    margin-bottom: 6px;
    color: #101828;
    letter-spacing: -.01em;
}
.club-feed-list .ann-message { color: #475467; }

/* ---- Feed post composition --------------------------------------------- *
 *
 * A post reads: who, when, then what. The left accent bar is dropped — on a
 * card that already leads with a coloured avatar it is a second, weaker signal
 * of the same thing, and a column of stripes is what made this read as a list
 * of filed notices rather than people talking.
 */

/* A feed is one continuous surface with posts separated by a hairline, not a
   stack of boxed cards. Boxes make each item look like a filed record; a
   divider makes them look like a conversation running down the page. */
.ann-feed-post {
    display: block;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eef1f5;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 16px 4px 18px;
    cursor: pointer;
    transition: background .12s;
}
.ann-feed-post:last-child { border-bottom: 0; }
.ann-feed-post:hover { background: #f8fafc; }
.ann-feed-post:focus-visible {
    outline: 2px solid var(--primary-color, #1f6feb);
    outline-offset: -2px;
}
.ann-feed-post.ann-pinned { background: #fffdf3; }
.ann-feed-post.ann-pinned:hover { background: #fffaea; }

/* The title leads the body as a bold opening rather than sitting above it as a
   heading — a post has a voice, not a headline and an abstract. */
.ann-post-content { font-size: 13.5px; line-height: 1.6; color: #475467; }
.ann-feed-post .ann-title {
    display: inline;
    font-size: 13.5px;
    font-weight: 700;
    color: #101828;
    margin: 0 6px 0 0;
}
.ann-feed-post .ann-message {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #475467;
    white-space: pre-wrap;
}

/* Media sits full-bleed under the text, the way a post's photo does. */
.ann-feed-post .ann-banner { margin-top: 10px; }
.ann-feed-post .ann-banner img { border-radius: 10px; max-height: 150px; }
.ann-feed-post .ann-media-grid { margin: 10px 0 0; }

.ann-post-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ann-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    /* A soft ring lifts the avatar off the card without a drop shadow. */
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 1px 3px rgba(16, 24, 40, .12);
}

.ann-post-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.ann-author {
    font-weight: 600;
    font-size: 13.5px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ann-when { font-size: 11.5px; color: #98a2b3; }

.ann-post-chips {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.ann-feed-post .ann-release-tag {
    background: #0f172a;
    color: #fff;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}

/* The title is the post's voice; in a feed it sits with the body rather than
   shouting above a row of metadata. */
.ann-feed-post .ann-title { font-size: 14.5px; line-height: 1.35; }

.club-feed-list .ann-message {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 10px;
    /* Clamp rather than truncate with an ellipsis span: the full post lives on
       the club page, and a feed's job is to tell you something happened. */
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-feed-list .ann-banner img { max-height: 120px; }
.club-feed-list .ann-media-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.club-feed-list .ann-media-item img,
.club-feed-list .ann-media-item video { max-height: 110px; }

.club-feed-list .ann-type-badge { font-size: 10px; padding: 3px 8px; }
.club-feed-list .ann-footer { font-size: 11px; gap: 10px; }

/* Release notes are long by nature. In the feed, keep the version chip and the
   summary, but drop the expander — a changelog unrolled inside a sidebar column
   is what stops the feed being scannable. The full notes are on the club page.
   `.ann-release-details` is the <details> element; hiding it takes its
   `.ann-release-body` with it. */
.club-feed-list .ann-release-details { display: none; }

/* ---- One post, opened in full ------------------------------------------ *
 *
 * The feed clamps a long body, which is right for scanning and useless for
 * reading. Opening in place beats linking away to the club page: the reader
 * keeps their position in the feed.
 */

.ann-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(16, 24, 40, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
.ann-modal-panel {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(16, 24, 40, .28);
}
.ann-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 1;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #475467;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .18);
}
.ann-modal-close:hover { background: #fff; color: #101828; }
/* Inside the modal the card is the whole surface, so it drops its own frame. */
.ann-modal-body .ann-card {
    margin: 0;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
}
.ann-modal-body .ann-message {
    -webkit-line-clamp: none;
    line-clamp: none;
    overflow: visible;
    display: block;
}

.club-feed-list .no-data {
    color: #6c757d;
    font-size: 13px;
    text-align: center;
    padding: 24px 12px;
    margin: 0;
}
