.group-latest-posts-card {
    overflow: hidden;
}

.group-post-composer {
    width: 100%;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
}

.group-post-composer:hover {
    border-color: var(--border-dark);
    background: var(--surface);
}

.group-post-composer img,
.group-post-modal-member img,
.group-feed-author-avatar img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
}

.group-post-composer span {
    min-width: 0;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.group-post-composer strong {
    white-space: nowrap;
    color: var(--header-light);
    font-size: .9rem;
}

.group-latest-post-list {
    display: grid;
    gap: 16px;
}

.group-feed-post {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.group-feed-post-header {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 16px 16px 10px;
}

.group-feed-author-avatar {
    flex: 0 0 46px;
}

.group-feed-author {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.group-feed-author > a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.group-feed-author span {
    color: var(--text-muted);
    font-size: .82rem;
}

.group-feed-post-body {
    display: block;
    padding: 4px 16px 14px;
    color: inherit;
    text-decoration: none;
}

.group-feed-post-body h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.05rem;
}

.group-feed-post-body p {
    margin: 0;
    line-height: 1.65;
    color: var(--text-muted);
}

.group-feed-photo-grid {
    display: grid;
    gap: 3px;
    padding: 0 16px 14px;
    text-decoration: none;
}

.group-feed-photo-grid span {
    position: relative;
    display: block;
    min-height: 180px;
    overflow: hidden;
    background: var(--surface-muted);
}

.group-feed-photo-grid img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.group-feed-photo-grid-2,
.group-feed-photo-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-feed-photo-grid-3 {
    grid-template-columns: 1.25fr .75fr;
    grid-template-rows: repeat(2, 170px);
}

.group-feed-photo-grid-3 span:first-child {
    grid-row: 1 / span 2;
}

.group-feed-photo-grid-3 img {
    min-height: 100%;
    max-height: none;
}

.group-feed-photo-grid span strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .52);
    color: #ffffff;
    font-size: 2rem;
}

.group-feed-post-footer {
    display: flex;
    gap: 20px;
    padding: 11px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .88rem;
}

.group-view-more-posts {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--header-light);
    font-weight: 700;
    text-decoration: none;
}

.group-view-more-posts:hover {
    background: var(--surface-muted);
}

.group-post-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.group-post-modal.is-open {
    display: flex;
}

.group-post-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 28, 40, .72);
}

.group-post-modal-dialog {
    position: relative;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
}

.group-post-modal-header,
.group-post-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.group-post-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    border-bottom: 0;
}

.group-post-modal-header h2 {
    margin: 0;
    color: var(--text);
}

.group-post-modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
}

.group-post-modal-close:hover {
    background: var(--account-link-hover);
}

.group-post-modal-member {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 20px 0;
}

.group-post-modal-member div {
    display: flex;
    flex-direction: column;
}

.group-post-modal-member strong {
    color: var(--text);
}

.group-post-modal-member span {
    color: var(--text-muted);
    font-size: .82rem;
}

.group-post-modal-body {
    display: grid;
    gap: 9px;
    padding: 18px 20px;
}

.group-post-modal-body label {
    color: var(--text);
    font-weight: 700;
}

.group-post-modal-body label small {
    color: var(--text-muted);
    font-weight: 400;
}

.group-post-modal-body input[type="text"],
.group-post-modal-body textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 12px 13px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.group-post-modal-body input[type="text"]::placeholder,
.group-post-modal-body textarea::placeholder {
    color: var(--text-muted);
}

.group-post-modal-body input[type="text"]:focus,
.group-post-modal-body textarea:focus {
    outline: 2px solid rgba(12, 111, 145, .22);
    border-color: var(--header-light);
}

.group-post-photo-picker {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
    margin-top: 4px;
    padding: 14px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.group-post-photo-picker:hover {
    background: var(--surface-muted);
}

.group-post-photo-picker i {
    grid-row: 1 / span 2;
    color: var(--header-light);
    font-size: 1.25rem;
}

.group-post-photo-picker small {
    color: var(--text-muted);
    font-weight: 400;
}

.group-post-photo-preview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.group-post-photo-preview:not([hidden]) {
    display: grid;
}

.group-post-photo-preview figure {
    position: relative;
    margin: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface-muted);
}

.group-post-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-post-photo-preview button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .7);
    color: #ffffff;
    cursor: pointer;
}

.group-post-form-message {
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #e0a4a4;
    background: #fff0f0;
    color: #9a2020;
}

[data-theme="dark"] .group-post-form-message {
    border-color: #7b4848;
    background: #3a2020;
    color: #efb1b1;
}

body.group-modal-open {
    overflow: hidden;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 700px) {
    .group-post-composer {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .group-post-composer img {
        width: 40px;
        height: 40px;
    }

    .group-post-composer strong {
        grid-column: 1 / -1;
        justify-self: stretch;
        text-align: center;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .group-feed-photo-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 180px 140px;
    }

    .group-feed-photo-grid-3 span:first-child {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .group-post-photo-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .group-post-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .group-post-modal-dialog {
        max-height: calc(100vh - 20px);
    }
}

.group-post-like-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.group-post-like-button:hover,
.group-post-like-button.is-liked {
    color: var(--header-light);
}

.group-post-like-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.group-post-like-button.is-loading i {
    animation: group-like-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes group-like-pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.18);
    }
}