/* CAECF Community — groups, feed, posts */
.c-av { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; background: var(--navy-l); }
.c-av-ini { display: inline-grid; place-items: center; color: #fff; font-family: var(--f-head); font-weight: 800; letter-spacing: .02em; }

/* sub-navigation */
.c-bar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 70px; z-index: 40; }
.c-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; overflow-x: auto; }
.c-tabs { display: flex; gap: 4px; }
.c-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-family: var(--f-head); font-weight: 600; font-size: .92rem; color: var(--ink); white-space: nowrap; position: relative; }
.c-tabs a:hover { background: var(--soft); color: var(--ink); }
.c-tabs a.on { background: var(--red-l); color: var(--red); }
.c-dot { min-width: 20px; height: 20px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; padding: 0 6px; font-weight: 700; }
.c-me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.c-me a.who { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }

/* community hero */
.c-hero { background: var(--navy-d); color: #C9D2EA; position: relative; overflow: hidden; isolation: isolate; padding: clamp(56px, 7vw, 90px) 0 clamp(50px, 6vw, 80px); }
.c-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 340px at 85% 10%, rgba(184, 40, 44, .55), transparent 65%), radial-gradient(500px 300px at 0% 100%, rgba(255, 255, 255, .07), transparent 70%); }
.c-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: center; }
.c-hero h1 { color: #fff; font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.c-hero p { font-size: 1.15rem; max-width: 600px; }
.c-faces { display: flex; }
.c-faces > * { margin-left: -10px; border: 3px solid var(--navy-d); }
.c-faces > *:first-child { margin-left: 0; }
.c-hstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.c-hstats div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 18px; text-align: center; }
.c-hstats b { display: block; color: #fff; font-family: var(--f-head); font-size: 2rem; line-height: 1; }
.c-hstats small { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #9CA9CE; }

/* layout */
.c-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.c-side { display: grid; gap: 18px; position: sticky; top: 140px; }
.c-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.c-box h4 { font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.c-box h4 i { color: var(--red); }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.c-list a { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.c-list small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.c-gicon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--red-l); color: var(--red); font-size: 1.15rem; flex: none; }

/* group cards */
.g-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: .35s var(--ease); }
.g-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-l); }
.g-cover { position: relative; height: 140px; background: var(--navy) center/cover; }
.g-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 23, 63, .1), rgba(6, 23, 63, .65)); }
.g-cover .g-icon { position: absolute; left: 20px; bottom: -26px; z-index: 2; width: 56px; height: 56px; border-radius: 16px; background: #fff; color: var(--red); display: grid; place-items: center; font-size: 1.5rem; box-shadow: var(--shadow); }
.g-cover .g-priv { position: absolute; right: 14px; top: 14px; z-index: 2; }
.g-body { padding: 36px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.g-body h3 { font-size: 1.2rem; margin-bottom: 6px; }
.g-body h3 a { color: var(--ink); }
.g-body p { color: var(--muted); font-size: .95rem; }
.g-meta { display: flex; gap: 14px; font-size: .86rem; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.g-meta i { color: var(--red); margin-right: 4px; }
.g-foot { margin-top: auto; display: flex; gap: 8px; }

/* group header */
.g-head { background: #fff; border-bottom: 1px solid var(--line); }
.g-banner { height: clamp(170px, 24vw, 280px); background: var(--navy) center/cover; position: relative; }
.g-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 23, 63, .05), rgba(6, 23, 63, .55)); }
.g-headrow { display: flex; gap: 22px; align-items: flex-end; margin-top: -46px; position: relative; z-index: 2; padding-bottom: 18px; flex-wrap: wrap; }
.g-headrow .g-icon { width: 92px; height: 92px; border-radius: 24px; background: #fff; color: var(--red); display: grid; place-items: center; font-size: 2.4rem; box-shadow: var(--shadow-l); border: 4px solid #fff; flex: none; }
.g-headrow h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 4px; }
.g-headrow .g-sub { color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; font-size: .95rem; align-items: center; }
.g-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.g-tabs { display: flex; gap: 4px; border-top: 1px solid var(--line); overflow-x: auto; }
.g-tabs a { padding: 14px 18px; font-family: var(--f-head); font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.g-tabs a.on { color: var(--red); border-color: var(--red); }

/* composer */
.composer { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 20px; }
.composer .row1 { display: flex; gap: 12px; }
.composer textarea { flex: 1; border: 0; resize: vertical; min-height: 56px; font: inherit; font-size: 1.02rem; padding: 10px 2px; outline: none; background: transparent; }
.composer .tools { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; flex-wrap: wrap; }
.composer .tool { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 0; background: var(--soft); color: var(--ink); font-weight: 600; font-size: .88rem; cursor: pointer; position: relative; }
.composer .tool:hover { background: var(--navy-l); }
.composer .tool i { color: var(--red); }
.composer .tool input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer .extra { display: none; margin-top: 12px; }
.composer .extra.on { display: block; }
.composer .previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.composer .previews img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.composer .poll-opts { display: grid; gap: 8px; }
.composer .post-btn { margin-left: auto; }
.c-login-cta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(120deg, var(--navy), var(--navy-m)); color: #C9D2EA; border-radius: 18px; padding: 20px 22px; margin-bottom: 20px; }
.c-login-cta strong { color: #fff; font-family: var(--f-head); font-size: 1.1rem; display: block; }

/* post card */
.post { background: #fff; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 18px; scroll-margin-top: 140px; }
.post.pinned { border-color: rgba(184, 40, 44, .45); box-shadow: 0 0 0 3px var(--red-l); }
.post.pending { border-style: dashed; border-color: #E9A23B; background: #FFFCF4; }
.post-h { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px 6px; }
.post-h .who { flex: 1; min-width: 0; line-height: 1.3; }
.post-h .who a.n { font-weight: 700; color: var(--ink); font-family: var(--f-head); }
.post-h .who small { display: block; color: var(--muted); font-size: .83rem; }
.post-h .who small a { color: var(--muted); }
.badge-c { display: inline-flex; align-items: center; gap: 3px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; vertical-align: 2px; margin-left: 4px; font-family: var(--f-head); }
.badge-off { background: var(--red); color: #fff; }
.badge-mod { background: var(--navy-l); color: var(--navy); }
.badge-mem { background: #E4F5EC; color: var(--ok); }
.badge-pin { background: var(--red-l); color: var(--red); }
.post-menu { position: relative; }
.post-menu > button { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.post-menu > button:hover { background: var(--soft); }
.post-menu .pm-list { position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-l); padding: 6px; min-width: 210px; z-index: 20; display: none; }
.post-menu.open .pm-list { display: block; }
.pm-list form { margin: 0; }
.pm-list button, .pm-list a { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; text-align: left; font: inherit; font-size: .92rem; color: var(--ink); cursor: pointer; }
.pm-list button:hover, .pm-list a:hover { background: var(--soft); }
.pm-list .danger { color: var(--red); }
.post-b { padding: 6px 18px 12px; font-size: 1.02rem; color: var(--ink); line-height: 1.6; word-wrap: break-word; }
.post-b a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.post-b.clamp { max-height: 12.8em; overflow: hidden; position: relative; }
.post-b.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(transparent, #fff); }
.see-more { border: 0; background: none; color: var(--navy); font-weight: 700; cursor: pointer; padding: 0 18px 10px; font: inherit; font-weight: 700; }
.post-imgs { display: grid; gap: 4px; margin: 4px 0 6px; }
.post-imgs.n1 { grid-template-columns: 1fr; }
.post-imgs.n2 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-imgs.n3 a:first-child { grid-row: span 2; }
.post-imgs.n4 { grid-template-columns: 1fr 1fr; }
.post-imgs a { display: block; background: var(--navy-l); overflow: hidden; }
.post-imgs img { width: 100%; height: 100%; object-fit: cover; max-height: 520px; aspect-ratio: 4/3; }
.post-imgs.n1 img { aspect-ratio: auto; max-height: 560px; }
.post-video { position: relative; aspect-ratio: 16/9; margin: 4px 0 8px; background: #000; }
.post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.poll { margin: 6px 18px 12px; display: grid; gap: 8px; }
.poll-opt { position: relative; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; overflow: hidden; font: inherit; text-align: left; color: var(--ink); width: 100%; }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red-l); transition: width .6s var(--ease); z-index: 0; }
.poll-opt span, .poll-opt b { position: relative; z-index: 1; }
.poll-opt.mine { border-color: var(--red); }
.poll-opt.mine span::before { content: "\F26E"; font-family: bootstrap-icons; color: var(--red); margin-right: 6px; }
.poll-opt:hover { border-color: var(--navy); }
.poll small { color: var(--muted); }
.post-stats { display: flex; justify-content: space-between; padding: 6px 18px; font-size: .86rem; color: var(--muted); }
.post-acts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 4px 8px; }
.post-acts > * { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border: 0; background: none; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; font-size: .93rem; }
.post-acts > *:hover { background: var(--soft); color: var(--ink); }
.post-acts .liked { color: var(--red); }
.post-acts .liked i::before { content: "\F415"; }
.like-pop { animation: likePop .45s var(--ease); }
@keyframes likePop { 40% { transform: scale(1.35); } }
.comments { border-top: 1px solid var(--line); padding: 12px 18px 14px; background: #FBFCFE; border-radius: 0 0 18px 18px; }
.cmt { display: flex; gap: 10px; margin-bottom: 10px; }
.cmt .bubble { background: var(--soft); border-radius: 14px; padding: 8px 12px; max-width: 100%; min-width: 0; }
.cmt .bubble a.n { font-weight: 700; color: var(--ink); font-size: .9rem; }
.cmt .bubble p { margin: 2px 0 0; font-size: .95rem; color: var(--ink); word-wrap: break-word; }
.cmt .meta { font-size: .78rem; color: var(--muted); margin: 3px 0 0 12px; display: flex; gap: 12px; }
.cmt .meta button { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.cmt.reply { margin-left: 46px; }
.cmt-form { display: flex; gap: 10px; align-items: flex-start; }
.cmt-form textarea { flex: 1; border: 1.5px solid var(--line); border-radius: 22px; padding: 9px 14px; font: inherit; font-size: .95rem; resize: none; min-height: 42px; max-height: 160px; background: #fff; }
.cmt-form textarea:focus { outline: none; border-color: var(--navy); }
.cmt-form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--red); color: #fff; cursor: pointer; flex: none; }
.more-cmts { display: inline-block; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.pending-note { display: flex; gap: 10px; align-items: center; padding: 10px 18px; background: #FFF4DE; color: #7A5306; font-size: .9rem; border-radius: 18px 18px 0 0; }
.load-more { display: flex; justify-content: center; margin: 10px 0 30px; }

/* members */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.m-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.m-card .who { flex: 1; min-width: 0; }
.m-card .who a { font-weight: 700; color: var(--ink); }
.m-card .who small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card form { display: inline; }
.m-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.m-tools button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: .8rem; cursor: pointer; font-weight: 600; }
.m-tools button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.m-tools button.no { color: var(--red); }

/* auth */
.c-auth { min-height: 70vh; display: grid; place-items: center; padding: 50px 16px; background: var(--soft); }
.c-auth .form-card { width: 100%; max-width: 480px; }
.c-auth .form-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.c-rules { counter-reset: r; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.c-rules li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: .96rem; }
.c-rules li::before { content: counter(r); width: 34px; height: 34px; border-radius: 10px; background: var(--red-l); color: var(--red); display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; }

/* notifications */
.n-item { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.n-item:hover { background: var(--soft); color: var(--ink); }
.n-item.unread { background: #FFF8F8; }
.n-item small { color: var(--muted); display: block; font-size: .82rem; }
.n-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; color: #fff; background: var(--navy); margin: 22px 0 0 -22px; border: 2px solid #fff; flex: none; }

/* profile */
.p-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.p-head h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 4px; color: #fff; }

@media (max-width: 1024px) {
  .c-layout, .c-hero .wrap { grid-template-columns: 1fr; }
  .c-side { position: static; }
}
@media (max-width: 720px) {
  .c-bar { top: 70px; }
  .c-me .who span { display: none; }
  .g-headrow { margin-top: -36px; }
  .g-headrow .g-icon { width: 72px; height: 72px; font-size: 1.9rem; }
  .g-actions { margin-left: 0; width: 100%; }
  .post-acts > * { font-size: .85rem; gap: 5px; }
  .c-hstats b { font-size: 1.5rem; }
}
.c-modal { position: fixed; inset: 0; z-index: 300; background: rgba(6, 23, 63, .55); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.c-modal-box { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-l); }
.c-modal-box h3 { margin-bottom: 4px; }
