/* =============================================================================
   HELLO MIDDLETON — Community Feed (Facebook-style)
   /community-board/ — full social feed layout
   ============================================================================= */

/* ── Page wrapper ──────────────────────────────────────────────────────────── */
.hm-feed-page {
    background: #ffffff;
    min-height: 100vh;
    padding: 16px 0 80px;
}

.hm-feed-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ── Post composer (What's on your mind?) ─────────────────────────────────── */
.hm-feed-composer {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hm-feed-composer__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.hm-feed-composer__input {
    flex: 1;
    background: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    color: #65676B;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
}
.hm-feed-composer__input:hover { background: #E4E6EB; }

/* ── Feed card ─────────────────────────────────────────────────────────────── */
.hm-feed-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    overflow: visible;
}

/* Card header */
.hm-feed-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
}

.hm-feed-card__avatar img,
.hm-feed-card__avatar .ct-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.hm-feed-card__avatar .ct-avatar-placeholder {
    background: #F97316;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-feed-card__meta { flex: 1; min-width: 0; }

.hm-feed-card__name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #050505;
    text-decoration: none;
    line-height: 1.3;
}
.hm-feed-card__name:hover { text-decoration: underline; color: #050505; }

.hm-feed-card__time {
    display: block;
    font-size: 0.78rem;
    color: #65676B;
    margin-top: 1px;
}

/* Card body */
.hm-feed-card__body { padding: 4px 16px 12px; }

.hm-feed-card__text {
    font-size: 0.9375rem;
    color: #050505;
    line-height: 1.55;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* See more */
.hm-feed-card__text.hm-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-see-more-btn {
    background: none;
    border: none;
    color: #65676B;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0 0;
    font-family: inherit;
}
.hm-see-more-btn:hover { text-decoration: underline; }

/* Media */
.hm-feed-card__media {
    margin: 0;
    overflow: hidden;
}

.hm-feed-card__media img {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

.hm-feed-card__media video {
    width: 100%;
    display: block;
    background: #000;
    max-height: 400px;
}

/* Photo grid */
.hm-feed-photos { display: grid; gap: 2px; }
.hm-feed-photos--1 { grid-template-columns: 1fr; }
.hm-feed-photos--2 { grid-template-columns: 1fr 1fr; }
.hm-feed-photos--3 { grid-template-columns: 1fr 1fr; }
.hm-feed-photos--3 .hm-feed-photo:first-child { grid-row: span 2; }
.hm-feed-photos--4 { grid-template-columns: 1fr 1fr; }

.hm-feed-photo { overflow: hidden; }
.hm-feed-photo img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.hm-feed-photos--1 .hm-feed-photo img { height: auto; max-height: 500px; }

/* Link preview */
.hm-feed-card__link-preview {
    border-top: 1px solid #E4E6EB;
    border-bottom: 1px solid #E4E6EB;
}
.hm-feed-link-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #F2F3F5;
}
.hm-feed-link-card:hover { background: #E4E6EB; text-decoration: none; }
.hm-feed-link-card .hm-lp-image-wrap {
    width: 120px;
    flex-shrink: 0;
}
.hm-feed-link-card .hm-lp-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hm-feed-link-card .hm-lp-content { padding: 10px 12px; }
.hm-feed-link-card .hm-lp-site {
    font-size: 0.72rem;
    color: #65676B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 3px;
}
.hm-feed-link-card .hm-lp-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-feed-link-card .hm-lp-desc {
    font-size: 0.78rem;
    color: #65676B;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* YouTube embed */
.hm-feed-yt-wrap {
    position: relative;
    cursor: pointer;
}
.hm-feed-yt-wrap img {
    width: 100%;
    display: block;
    max-height: 360px;
    object-fit: cover;
}
.hm-feed-yt-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.hm-feed-yt-play:hover { background: rgba(0,0,0,0.25); }

/* Engagement stats */
.hm-feed-card__stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px 0;
    font-size: 0.82rem;
    color: #65676B;
    border-top: 1px solid transparent;
}
.hm-feed-card__stats:not(:empty) {
    border-top: 1px solid #E4E6EB;
    padding-top: 8px;
    padding-bottom: 4px;
}
.hm-feed-stat { cursor: pointer; }
.hm-feed-stat:hover { text-decoration: underline; }

/* Action bar */
.hm-feed-card__actions {
    display: flex;
    border-top: 1px solid #E4E6EB;
    margin: 0 4px;
}

.hm-feed-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 4px;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #65676B;
    cursor: pointer;
    transition: background 0.1s;
    font-family: inherit;
    text-decoration: none;
    margin: 4px 0;
}
.hm-feed-action:hover { background: #F2F2F2; color: #050505; }
.hm-feed-action.liked { color: #2563EB; }
.hm-feed-action.liked .hm-feed-action__icon { color: #2563EB; }

.hm-feed-action__icon { font-size: 1.1rem; line-height: 1; }

/* Comments section */
.hm-feed-card__comments {
    padding: 4px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-feed-card__comments:empty { display: none; }

/* Mobile */
@media (max-width: 600px) {
    .hm-feed-wrap { padding: 0; }
    .hm-feed-card { border-radius: 0; margin-bottom: 8px; }
    .hm-feed-composer { border-radius: 0; }
    .hm-feed-action__label { display: none; }
    .hm-feed-action { padding: 8px 4px; }
    .hm-feed-action__icon { font-size: 1.3rem; }
}

/* ── Page-level overrides (applied via body class from template) ───────────── */
.page-template-page-community-board body,
.page-template-page-community-board #page,
.page-template-page-community-board .site {
    background: #ffffff !important;
}

/* Tighten container so feed doesn't stretch too wide on desktop */
.page-template-page-community-board .container,
.page-template-page-community-board #primary,
.page-template-page-community-board .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
}

.hm-feed-page {
    padding-top: 20px;
}



/* ── Inline Composer ────────────────────────────────────────────────────────── */
.hm-inline-composer {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

/* Collapsed */
.hm-ic-collapsed {
    padding: 12px 16px;
}

.hm-ic-collapsed > .hm-ic-avatar,
.hm-ic-top > .hm-ic-avatar {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.hm-ic-collapsed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hm-ic-avatar img,
.hm-ic-avatar .ct-avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%; display: block;
}
.hm-ic-avatar .ct-avatar-placeholder {
    background: #F97316; color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}

.hm-ic-prompt {
    flex: 1;
    min-width: 120px;
    background: #F0F2F5;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.9375rem;
    color: #65676B;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.hm-ic-prompt:hover { background: #E4E6EB; }

.hm-ic-quick-btns {
    display: flex;
    gap: 0;
    border-top: 1px solid #E4E6EB;
    margin: 8px -16px -12px;
    padding: 0 4px;
    width: calc(100% + 32px);
}

.hm-ic-quick-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #65676B;
    cursor: pointer;
    font-family: inherit;
    margin: 4px 0;
    transition: background 0.1s;
}
.hm-ic-quick-btn:hover { background: #F0F2F5; }

/* Expanded */
.hm-ic-expanded {
    display: flex;
    flex-direction: column;
}

.hm-ic-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #E4E6EB;
}

.hm-ic-user-info { flex: 1; }
.hm-ic-name { display: block; font-size: 0.9rem; font-weight: 700; color: #050505; }
.hm-ic-privacy { display: block; font-size: 0.75rem; color: #65676B; margin-top: 1px; }

.hm-ic-close {
    background: #E4E6EB;
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #050505;
    transition: background 0.15s;
    flex-shrink: 0;
}
.hm-ic-close:hover { background: #D8DADF; }

.hm-ic-textarea {
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 80px;
    color: #050505;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
}
.hm-ic-textarea::placeholder { color: #BCC0C4; }

.hm-ic-media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px;
}
.hm-ic-media-preview img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #E4E6EB;
}
.hm-ic-media-preview:empty { display: none; }

/* Toolbar */
.hm-ic-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #E4E6EB;
    margin-top: 8px;
}

.hm-ic-toolbar-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #65676B;
    white-space: nowrap;
    margin-right: 4px;
}

.hm-ic-tools { display: flex; gap: 2px; flex: 1; }

.hm-ic-tool {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}
.hm-ic-tool:hover { background: #F0F2F5; }

.hm-ic-submit {
    background: #1877F2;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    flex-shrink: 0;
}
.hm-ic-submit:hover { background: #1558b0; }
.hm-ic-submit:disabled { background: #BCC0C4; cursor: not-allowed; }

/* Link preview in composer */
#hmIcLinkPreview { padding: 0 16px 8px; }
#hmIcLinkPreview:empty { display: none; }

@media (max-width: 480px) {
    .hm-ic-toolbar-label { display: none; }
    .hm-ic-quick-btn span.label { display: none; }
}

/* Mobile Guest Menu */
.buddyx-mobile-guest-menu {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buddypress-login-link,
.buddypress-register-link {
    display: block;
    padding: 10px 15px;
    text-align: center;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.buddypress-register-link {
    background-color: #28a745;
}

/* Guest Join Modal */
.hm-guest-modal-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
}

.hm-guest-modal-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.hm-guest-modal-body .hm-modal-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.hm-guest-modal-desc {
    font-size: 16px;
    color: #65676B;
    margin-bottom: 30px;
}

.hm-guest-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hm-button {
    display: block;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hm-button--primary {
    background-color: #1877F2;
    color: #fff;
    border: 1px solid #1877F2;
}

.hm-button--primary:hover {
    background-color: #1558b0;
    border-color: #1558b0;
}

.hm-button--secondary {
    background-color: #E4E6EB;
    color: #050505;
    border: 1px solid #E4E6EB;
}

.hm-button--secondary:hover {
    background-color: #D8DADF;
    border-color: #D8DADF;
}
