/*!
 * W22.1 — Community feed styles (moved verbatim from the W22.0 inline
 * resources/views/frontend/community/_feed-styles.blade.php).
 * Scoped under .eg-community-* / .eg-post-* / .eg-comment* so nothing leaks
 * into other public pages or the dashboard. RTL + mobile-first.
 * Loaded ONLY on /community via @section('custom_css') in community/index.blade.php.
 */
.eg-community-feed { --eg-green:#16a085; --eg-green-dark:#138a72; max-width: 720px; margin: 0 auto; direction: rtl; text-align: right; }

/* Filter bar */
.eg-community-filter {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid #eef0f3; border-radius: 14px;
    padding: 14px 18px; margin-bottom: 22px; box-shadow: 0 6px 24px rgba(17,24,39,.04);
}
.eg-community-filter__label { font-size: 14px; font-weight: 700; color: #374151; margin: 0; white-space: nowrap; }
.eg-community-filter__control { flex: 1 1 220px; min-width: 0; }
.eg-community-filter__select {
    width: 100%; appearance: none; -webkit-appearance: none;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat left 14px center;
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px;
    font-size: 14px; font-weight: 600; color: #1f2937; cursor: pointer;
}
.eg-community-filter__select:focus { outline: none; border-color: var(--eg-green); box-shadow: 0 0 0 3px rgba(22,160,133,.12); }
.eg-community-filter__go { background: var(--eg-green); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer; }

/* Feed stream */
.eg-community-list { display: flex; flex-direction: column; gap: 18px; }

.eg-post-card {
    background: #fff; border: 1px solid #eef0f3; border-radius: 16px; padding: 20px 22px;
    box-shadow: 0 6px 24px rgba(17,24,39,.04); cursor: pointer;
    transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
}
.eg-post-card:hover { box-shadow: 0 10px 30px rgba(17,24,39,.08); transform: translateY(-2px); border-color: #e3e8ee; }
.eg-post-card:focus-visible { outline: 2px solid var(--eg-green); outline-offset: 2px; }

.eg-post-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.eg-post-card__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid #eef0f3; flex: 0 0 auto; }
.eg-post-card__id { display: flex; flex-direction: column; min-width: 0; }
.eg-post-card__author { font-weight: 700; color: #1f2937; font-size: 15px; }
.eg-post-card__date { font-size: 12px; color: #9ca3af; }

.eg-post-badge {
    margin-right: auto; display: inline-block; flex: 0 0 auto;
    font-size: 12px; font-weight: 700; color: var(--eg-green);
    background: rgba(22,160,133,.10); padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}

.eg-post-card__title { font-size: 18px; font-weight: 800; color: #1f2937; margin: 0 0 8px; line-height: 1.6; }
.eg-post-card__excerpt { font-size: 15px; color: #4b5563; line-height: 1.9; margin: 0 0 14px; word-wrap: break-word; }

.eg-post-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid #f1f3f5; }
.eg-post-card__count { font-size: 13px; color: #6b7280; font-weight: 600; }
.eg-post-card__count .fa { margin-left: 5px; color: #9ca3af; }
.eg-post-card__open { font-size: 13px; font-weight: 700; color: var(--eg-green); }
.eg-post-card__open:hover { color: var(--eg-green-dark); text-decoration: underline; }

.eg-post-comments--preview { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed #f1f3f5; }
.eg-post-comments__item { font-size: 14px; color: #4b5563; line-height: 1.8; padding: 3px 0; }
.eg-post-comments__name { font-weight: 700; color: #1f2937; }

.eg-community-empty { text-align: center; color: #9ca3af; padding: 56px 16px; font-size: 16px; background: #fff; border: 1px solid #eef0f3; border-radius: 16px; }
.eg-community-empty .fa { display: block; font-size: 34px; margin-bottom: 12px; opacity: .6; }

.eg-community-pager { margin-top: 26px; }
.eg-community-pager .pagination { justify-content: center; display: flex; flex-wrap: wrap; gap: 4px; }

/* Modal */
.eg-community-modal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.eg-community-modal[hidden] { display: none; }
.eg-community-modal__overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); }
.eg-community-modal__dialog {
    position: relative; z-index: 1; width: 100%; max-width: 640px; direction: rtl; text-align: right;
    background: #fff; border-radius: 18px; padding: 26px 28px; margin: auto;
    box-shadow: 0 24px 60px rgba(15,23,42,.28); animation: egModalIn .18s ease;
}
@keyframes egModalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.eg-community-modal__close { position: absolute; top: 14px; left: 16px; background: #f1f5f9; border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: #475569; cursor: pointer; }
.eg-community-modal__close:hover { background: #e2e8f0; color: #1f2937; }
.eg-community-modal__head { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f1f3f5; }
.eg-community-modal__head .eg-post-card__id { flex-direction: row; align-items: center; gap: 12px; }
.eg-community-modal__title { font-size: 22px; font-weight: 800; color: #1f2937; margin: 14px 0 0; line-height: 1.6; }
.eg-community-modal__body { font-size: 16px; line-height: 2; color: #374151; margin-bottom: 22px; word-wrap: break-word; }
.eg-community-modal__body img { max-width: 100%; height: auto; }
.eg-community-modal__commentsTitle { font-size: 17px; font-weight: 800; color: #1f2937; margin: 0 0 16px; }
.eg-community-modal__commentsTitle span { color: #9ca3af; font-weight: 600; font-size: 14px; }
.eg-community-modal__empty { text-align: center; color: #9ca3af; padding: 26px 16px; font-size: 15px; }
.eg-community-modal__empty .fa { display: block; font-size: 28px; margin-bottom: 10px; opacity: .6; }

.eg-comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f1f3f5; }
.eg-comment:last-child { border-bottom: 0; }
.eg-comment__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid #eef0f3; flex: 0 0 auto; }
.eg-comment__body { flex: 1 1 auto; min-width: 0; }
.eg-comment__head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.eg-comment__name { font-weight: 700; color: #1f2937; font-size: 14px; }
.eg-comment__date { font-size: 12px; color: #9ca3af; }
.eg-comment__text { color: #4b5563; font-size: 15px; line-height: 1.9; margin: 0; word-wrap: break-word; }

.eg-comment-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid #f1f3f5; }
.eg-comment-form__label { display: block; font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 8px; }
.eg-comment-form__input { width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; font-size: 15px; resize: vertical; font-family: inherit; }
.eg-comment-form__input:focus { outline: none; border-color: var(--eg-green); box-shadow: 0 0 0 3px rgba(22,160,133,.12); }
.eg-comment-form__submit { display: inline-block; margin-top: 12px; background: var(--eg-green); color: #fff !important; font-weight: 700; font-size: 14px; padding: 10px 26px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .2s ease; }
.eg-comment-form__submit:hover { background: var(--eg-green-dark); color: #fff !important; text-decoration: none; }
.eg-comment-form--guest { text-align: center; background: #f8fafc; border: 1px dashed #d7dde5; border-radius: 14px; padding: 22px; }
.eg-comment-form--guest p { color: #6b7280; font-size: 15px; margin: 0 0 14px; }

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

@media (max-width: 575px) {
    .eg-community-filter { flex-direction: column; align-items: stretch; }
    .eg-community-filter__label { white-space: normal; }
    .eg-post-card { padding: 16px 16px; }
    .eg-post-card__title { font-size: 16px; }
    .eg-community-modal { padding: 0; }
    .eg-community-modal__dialog { border-radius: 0; min-height: 100%; max-width: 100%; padding: 22px 18px; }
}
