/* Free Reddit Tools - the Reddit skin on top of the shared
 * platform-tools.css shell: a community header with a banner, a sort
 * bar, and a single-column feed of post cards with a vote rail, flair,
 * and a "Join"-style button, all in the site's brand red instead of
 * Reddit orange (operator request). */

:root {
    --rd-accent:      #a63534;   /* the site header's red */
    --rd-accent-dark: #8e2c2b;
    --rd-accent-soft: #fdecec;
    --rd-ink:         #1c1c1c;
    --rd-muted:       #576f76;
    --rd-border:      #e5e7eb;
    --rd-chip:        #f6f7f8;
    --rd-chip-hov:    #eaedef;
    --rd-blue:        #0079d3;
    --rd-down:        #5c6bc0;

    --pp-h1:    #962F2E;
    --pp-muted: var(--rd-muted);
    --pp-link:  var(--rd-blue);
    --pp-faq-highlight: var(--rd-accent-soft);
}

/* The community header and feed fill the page column
 * (--pp-col, 1100px, the same width as the About / FAQ sections below).
 * They used to be capped at 880px; widened 2026-09-03 on operator
 * request. */
.frt-community,
.frt-feed {
    margin-left: auto;
    margin-right: auto;
}

/* -------------------------------------------------------------------
 * Community header
 * ------------------------------------------------------------------- */
/* No shared hero above the card any more, so give it room under the
 * red site bar (the renderer's default 6px assumed a hero in between). */
.pp-reddit .pp-profile-section { padding-top: 26px; }
.frt-community {
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.frt-banner {
    height: 88px;
    background:
        radial-gradient(360px 120px at 90% 20%, rgba(255, 255, 255, 0.16), transparent 70%),
        linear-gradient(100deg, #8e2c2b 0%, #a63534 60%, #cb5f59 100%);
}
.frt-community-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 0 24px 22px;
}
.frt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    margin-top: -30px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.frt-icon img {
    display: block;
    width: 64%;
    height: 64%;
    object-fit: contain;
}
.frt-community-main {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 10px;
}
.frt-community-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 10px;
}
/* The community name is the page <h1> (no shared hero on this page). */
.frt-community-name {
    margin: 0 0 2px;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--rd-ink);
}
.frt-community-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    margin: 0;
    font-size: 13px;
    color: var(--rd-muted);
    font-feature-settings: var(--tnum);
}
.frt-community-meta span + span::before {
    content: "\2022";
    margin: 0 7px;
}

/* Buttons: Reddit's orange pill. Anchor-styled, so :hover restates color. */
.frt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.frt-btn:focus-visible {
    outline: 2px solid var(--rd-blue);
    outline-offset: 2px;
}
.frt-btn-primary {
    background: var(--rd-accent);
    color: #fff;
}
.frt-btn-primary:hover,
.frt-btn-primary:focus-visible {
    background: var(--rd-accent-dark);
    color: #fff;
}
.frt-btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}
.frt-btn:active {
    transform: translateY(1px);
}

/* -------------------------------------------------------------------
 * Post feed
 * ------------------------------------------------------------------- */
.frt-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.frt-post {
    display: flex;
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: 12px;
    overflow: hidden;
    scroll-margin-top: 24px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.frt-post:hover {
    border-color: #c9ced3;
    box-shadow: var(--shadow-md);
}

/* Vote rail: real buttons, no fabricated counts. Up fills brand red when
 * pressed; Down fills slate and tucks the card away. */
.frt-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    width: 44px;
    padding: 10px 0;
    background: var(--rd-chip);
}
.frt-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--rd-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.frt-arrow svg {
    width: 24px;
    height: 24px;
}
.frt-arrow svg path {
    transition: fill 0.15s ease;
}
.frt-arrow:hover {
    background: var(--rd-chip-hov);
}
.frt-arrow:focus-visible {
    outline: 2px solid var(--rd-blue);
    outline-offset: 1px;
}
.frt-arrow-up:hover,
.frt-arrow-up.is-active {
    color: var(--rd-accent);
}
.frt-arrow-up.is-active svg path {
    fill: var(--rd-accent);
}
.frt-arrow-down:hover,
.frt-arrow-down.is-active {
    color: var(--rd-down);
}
.frt-arrow-down.is-active svg path {
    fill: var(--rd-down);
}

.frt-post-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 16px 14px;
}
.frt-post-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--rd-muted);
}
.frt-post-head strong {
    color: var(--rd-ink);
    font-weight: 700;
}
.frt-post-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--rd-chip-hov);
    color: var(--rd-accent-dark);
    font-size: 13px;
}
.frt-post-dot {
    color: var(--rd-muted);
}
.frt-post-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--rd-ink);
}
.frt-post-title a {
    color: inherit;
}
.frt-post-title a:hover {
    color: var(--rd-ink);
    text-decoration: underline;
}
.frt-flair {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rd-accent-soft);
    color: var(--rd-accent-dark);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: 2px;
    white-space: nowrap;
}
.frt-post-facts {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--rd-muted);
    font-feature-settings: var(--tnum);
}
.frt-post-body {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--rd-ink);
}
.frt-post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.frt-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--rd-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.frt-action:hover {
    background: var(--rd-chip-hov);
    color: var(--rd-ink);
}
.frt-action:focus-visible {
    outline: 2px solid var(--rd-blue);
    outline-offset: 1px;
}
.frt-action svg {
    width: 18px;
    height: 18px;
}

/* Downvoted: the card collapses to one line with a Show button. */
.frt-post-collapsed {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    color: var(--rd-muted);
}
.frt-post-collapsed strong {
    color: var(--rd-ink);
    font-weight: 700;
}
.frt-post.is-hidden .frt-post-head,
.frt-post.is-hidden .frt-post-title,
.frt-post.is-hidden .frt-post-facts,
.frt-post.is-hidden .frt-post-body,
.frt-post.is-hidden .frt-post-actions {
    display: none;
}
.frt-post.is-hidden .frt-post-collapsed {
    display: flex;
}
.frt-post.is-hidden .frt-post-main {
    padding: 8px 16px;
}
.frt-action-show {
    color: var(--rd-blue);
}

/* -------------------------------------------------------------------
 * Mobile (project breakpoints: 640px, 420px)
 * ------------------------------------------------------------------- */
@media (max-width: 640px) {
    .frt-banner { height: 64px; }
    .frt-community-body { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 18px 18px; }
    .frt-icon { width: 72px; height: 72px; margin-top: -36px; }
    .frt-community-main { padding-top: 0; }
    .frt-community-row { flex-direction: column; align-items: center; gap: 10px; }
    .frt-community-meta { justify-content: center; }
    .frt-vote { width: 36px; }
    .frt-post-main { padding: 10px 12px 12px; }
    .frt-post-title { font-size: 16.5px; }
    .frt-flair { margin-left: 0; margin-top: 4px; display: inline-block; }
}
@media (max-width: 420px) {
    .frt-community-name { font-size: 20px; }
    .frt-post-body { font-size: 13.5px; }
    .frt-action:not(.frt-action-show) { display: none; }
}
