:root {
    --pfc-blue: #024997;
    --pfc-blue-dark: #01366f;
    --pfc-ink: #101828;
    --pfc-muted: #667085;
    --pfc-line: #e9edf3;
    --pfc-soft: #f6f9fd;
}

.pf-community-template-main {
    width: 100%;
}

.pf-community-hub,
.pf-community-hub * {
    box-sizing: border-box;
}

.pf-community-hub {
    width: min(1068px, calc(100% - 32px));
    margin: 28px auto 64px;
    color: var(--pfc-ink);
    font-family: inherit;
}

.pf-community-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: 34px 36px;
    margin-bottom: 22px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 86% 22%, rgba(255,255,255,.18) 0 6%, transparent 6.5%),
        radial-gradient(circle at 77% 88%, rgba(255,255,255,.10) 0 14%, transparent 14.5%),
        linear-gradient(135deg, #013a7b 0%, #024997 48%, #0873d1 100%);
    box-shadow: 0 18px 48px rgba(2, 73, 151, .20);
}

.pf-community-hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 330px;
    height: 330px;
    right: -110px;
    top: -155px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    box-shadow: 0 0 0 48px rgba(255,255,255,.04), 0 0 0 96px rgba(255,255,255,.03);
}

.pf-community-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: rgba(255,255,255,.86);
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .13em;
}

.pf-community-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #72f59e;
    box-shadow: 0 0 0 5px rgba(114,245,158,.14);
}

.pf-community-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 4.2vw, 58px);
    line-height: .98;
    font-weight: 900;
    letter-spacing: -.035em;
}

.pf-community-hero-copy > p {
    max-width: 650px;
    margin: 13px 0 0;
    color: rgba(255,255,255,.84);
    font-size: 16px;
    line-height: 1.55;
}

.pf-community-share-cta {
    min-width: 286px;
    display: grid;
    grid-template-columns: 46px 1fr 22px;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 18px;
    background: rgba(255,255,255,.12);
    color: #fff !important;
    text-decoration: none !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.pf-community-share-cta:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.18);
    box-shadow: 0 14px 28px rgba(0,0,0,.14);
}

.pf-community-share-cta-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    color: var(--pfc-blue);
}

.pf-community-share-cta svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pf-community-share-cta strong,
.pf-community-share-cta small {
    display: block;
}

.pf-community-share-cta strong {
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
}

.pf-community-share-cta small {
    margin-top: 3px;
    color: rgba(255,255,255,.72);
    font-size: 11px;
    line-height: 1.25;
}

.pf-community-cta-arrow {
    width: 18px !important;
    opacity: .75;
}

.pf-community-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 15px;
}

.pf-community-toolbar strong,
.pf-community-toolbar span {
    display: block;
}

.pf-community-toolbar strong {
    color: var(--pfc-ink);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 850;
}

.pf-community-toolbar > div > span {
    margin-top: 3px;
    color: var(--pfc-muted);
    font-size: 13px;
}

.pf-community-fresh-pill {
    padding: 7px 10px;
    border: 1px solid #dce8f7;
    border-radius: 999px;
    color: var(--pfc-blue) !important;
    background: #f3f8fe;
    font-size: 11px !important;
    font-weight: 800;
    white-space: nowrap;
}

.pf-community-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.pf-community-post {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--pfc-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(16,24,40,.045);
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.pf-community-post:hover,
.pf-community-post:focus-visible {
    transform: translateY(-3px);
    border-color: #d8e4f3;
    box-shadow: 0 14px 32px rgba(16,24,40,.10);
    outline: none;
}

.pf-community-post-head {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
}

.pf-community-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pf-community-avatar {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pfc-blue) 0%, #0b78d5 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}

.pf-community-avatar-initial {
    position: relative;
    z-index: 0;
}

.pf-community-avatar-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

.pf-community-profile-copy {
    min-width: 0;
}

.pf-community-profile-copy strong {
    display: block;
    overflow: hidden;
    color: #171b24;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-community-location {
    max-width: 210px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    overflow: hidden;
    color: #7a8492;
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-community-location svg,
.pf-community-view-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pf-community-location svg {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
}

.pf-community-view-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #7f8b99;
    background: #f7f9fc;
}

.pf-community-view-icon svg {
    width: 17px;
    height: 17px;
}

.pf-community-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #eef2f6;
}

.pf-community-media::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.025);
}

.pf-community-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.001);
    transition: transform .35s ease;
}

.pf-community-post:hover .pf-community-media img {
    transform: scale(1.025);
}

.pf-community-caption {
    min-height: 66px;
    padding: 12px 14px 14px;
    overflow: hidden;
    color: #3b4350;
    font-size: 13px;
    line-height: 1.5;
}

/*
 * Clamp the text inside the padded caption wrapper. Applying line-clamp to
 * the padded element itself can expose an additional line in Chromium.
 */
.pf-community-caption-inner {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-height: 4.5em;
}

.pf-community-caption strong {
    color: #202631;
    font-weight: 850;
}

.pf-community-caption-text {
    white-space: pre-line;
}

.pf-community-load-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 0 0;
}

.pf-community-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 154px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid #d7e1ec;
    border-radius: 999px;
    background: #fff;
    color: var(--pfc-blue);
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(16,24,40,.06);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.pf-community-load-more:hover {
    transform: translateY(-1px);
    border-color: #b8cce5;
    background: #f8fbff;
    box-shadow: 0 10px 22px rgba(2,73,151,.10);
}

.pf-community-load-more svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}

.pf-community-load-more:hover svg {
    transform: translateY(2px);
}

.pf-community-load-more.is-loading svg {
    animation: pfc-bounce .8s ease-in-out infinite alternate;
}

@keyframes pfc-bounce {
    to { transform: translateY(4px); }
}

.pf-community-load-status {
    min-height: 18px;
    margin: 0;
    color: var(--pfc-muted);
    font-size: 12px;
}

.pf-community-empty {
    padding: 52px 24px;
    text-align: center;
    border: 1px dashed #ced9e7;
    border-radius: 22px;
    background: var(--pfc-soft);
}

.pf-community-empty > span {
    display: block;
    margin-bottom: 10px;
    font-size: 34px;
}

.pf-community-empty h2 {
    margin: 0;
    font-size: 21px;
}

.pf-community-empty p {
    margin: 8px 0 0;
    color: var(--pfc-muted);
    font-size: 14px;
}

/* Community Hub follows the Newspaper theme content width instead of creating
 * its own full-width canvas. The feed is the page: no duplicate hero/header. */
.pf-community-hero,
.pf-community-toolbar {
    display: none !important;
}

@media (max-width: 980px) {
    .pf-community-hub {
        width: min(920px, calc(100% - 28px));
    }

    .pf-community-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 620px) {
    .pf-community-hub {
        width: auto;
        max-width: none;
        margin: 12px 0 0;
        padding: 0 12px calc(104px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
    }

    .pf-community-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pf-community-post {
        border: 1px solid var(--pfc-line);
        border-radius: 16px;
        box-shadow: 0 3px 12px rgba(16,24,40,.04);
    }

    .pf-community-post:hover,
    .pf-community-post:focus-visible {
        transform: none;
        box-shadow: 0 3px 12px rgba(16,24,40,.04);
    }

    .pf-community-post-head {
        min-height: 60px;
        padding: 9px 12px;
    }

    .pf-community-avatar {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .pf-community-profile-copy strong {
        font-size: 13px;
    }

    .pf-community-location {
        max-width: 72vw;
    }

    .pf-community-view-icon {
        display: none;
    }

    .pf-community-media {
        width: 100%;
        aspect-ratio: auto;
        min-height: 260px;
        max-height: 78vh;
        background: #f1f3f6;
    }

    .pf-community-media img {
        width: 100%;
        height: auto;
        min-height: 260px;
        max-height: 78vh;
        object-fit: contain;
        background: #f1f3f6;
    }

    .pf-community-caption {
        min-height: 0;
        overflow: visible;
        padding: 11px 12px 14px;
        font-size: 13px;
        line-height: 1.5;
    }

    .pf-community-caption-inner {
        display: block;
        overflow: visible;
        max-height: none;
        -webkit-line-clamp: unset;
        -webkit-box-orient: initial;
    }

    .pf-community-post:hover .pf-community-media img {
        transform: none;
    }

    .pf-community-load-wrap {
        padding: 24px 0 0;
    }
}
