/* =====================================================================
   pages/groups.css — group community space.
   Banner, group header, tab nav, post feed, file/media/member lists.
   ===================================================================== */

/* ===== Banner & header ===== */
.group-banner{
  position:relative;height:240px;overflow:hidden;border-radius:0 0 var(--sp-radius-md) var(--sp-radius-md);
  background:linear-gradient(rgba(6,41,64,.25),rgba(6,41,64,.55)),url("../../../images/hero-bg.jpg") center/cover;
}
.group-header{padding:24px 0 0}
.group-header .crumbs{margin-bottom:14px}
.group-header h1{font-size:28px;font-weight:800;color:var(--sp-secondary-d);margin-bottom:6px;letter-spacing:-.4px}
.group-header .meta{display:flex;align-items:center;gap:14px;font-size:13.5px;color:var(--sp-muted)}
.group-header .meta .badge{
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;
  background:rgba(0,145,194,.1);color:var(--sp-primary);
  border-radius:var(--sp-radius-pill);font-weight:600;font-size:12px;
}
.group-actions{margin-left:auto;display:flex;gap:8px}

/* Top-right header action button (Request to Join / Member badge) */
.group-header-row{display:flex;align-items:flex-start;gap:24px}
.group-header-row > div:first-child{flex:1;min-width:0}
.btn-dark{background:#062940;color:#fff;border-color:#062940}
.btn-dark:hover{background:#0a3654;border-color:#0a3654;color:#fff}
.member-badge{
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(95,217,160,.15);color:#018081;
  padding:8px 14px;border-radius:var(--sp-radius-pill);
  font-size:13px;font-weight:700;
}
.member-badge::before{content:'✓';font-size:12px}

/* ===== Gate panel (private group, not joined) ===== */
.gate-panel{
  background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);
  padding:80px 40px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:14px;
  min-height:320px;justify-content:center;
}
.gate-panel h2{font-size:22px;font-weight:700;color:var(--sp-secondary-d);margin:0}
.gate-panel p{font-size:14.5px;color:var(--sp-muted);margin:0 0 18px;max-width:420px;line-height:1.6}
.gate-panel .btn{padding:12px 28px}
.gate-panel .actions{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  width:100%;
  max-width:520px;
}
.gate-panel .actions .btn,
.gate-panel .actions form,
.gate-panel .actions .button{
  min-width:160px;
}

/* ===== Tabs ===== */
.group-tabs{
  display:flex;gap:4px;border-bottom:1px solid var(--sp-line);
  margin:18px 0 28px;flex-wrap:wrap;
}
.group-tabs .container{width:100%;max-width:1240px}
.group-tabs ul{display:flex;gap:4px;flex-wrap:wrap;margin:0;padding:0;list-style:none}
.group-tabs a{
  padding:12px 18px;font-size:14px;font-weight:600;
  color:var(--sp-muted);border-bottom:2px solid transparent;
  transition:.2s;margin-bottom:-1px;
}
.group-tabs a:hover{color:var(--sp-primary)}
.group-tabs a[aria-current="page"]{
  color:var(--sp-primary);border-bottom-color:var(--sp-primary);
}

.ncwg-hero{
  background:
    linear-gradient(135deg, rgba(6,41,64,.72) 0%, rgba(14,74,115,.52) 58%, rgba(0,140,140,.38) 100%),
    url("../../../images/hero-bg.jpg") center/cover !important;
}
.ncwg-discussion-toolbar{
  display:flex;
  justify-content:flex-end;
  margin-bottom:18px;
}
.ncwg-posts-list{
  display:grid;
  gap:16px;
}
.ncwg-post{
  padding:22px;
  border:1px solid var(--sp-line);
  border-radius:var(--sp-radius-md);
  background:#fff;
  box-shadow:0 8px 22px rgba(6,41,64,.06);
}
.ncwg-post h3{
  margin:0 0 8px;
  color:var(--sp-secondary-d);
  font-size:18px;
  line-height:1.35;
}
.ncwg-post .meta,
.ncwg-posts-list .empty{
  color:var(--sp-muted);
  font-size:14px;
  line-height:1.6;
}
.ncwg-roster{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--sp-line);
  border-radius:var(--sp-radius-md);
  background:#fff;
  box-shadow:0 8px 22px rgba(6,41,64,.06);
}
.ncwg-roster th,
.ncwg-roster td{
  padding:14px 18px;
  border-bottom:1px solid var(--sp-line);
  text-align:left;
}
.ncwg-roster th{
  color:var(--sp-muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.ncwg-roster tr:last-child td{border-bottom:0}

/* ===== 2-col content layout ===== */
.group-grid{display:grid;grid-template-columns:1fr 320px;gap:36px;align-items:start}
@media (max-width:900px){.group-grid{grid-template-columns:1fr}}

/* ===== Sidebar Info card ===== */
.info-card{
  background:#fff;border:1px solid var(--sp-line);
  border-radius:var(--sp-radius-md);padding:20px;
}
.info-card h4{font-size:13px;text-transform:uppercase;letter-spacing:1.4px;color:var(--sp-muted);margin-bottom:14px;font-weight:700}
.info-card .info-row{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--sp-line)}
.info-card .info-row:last-child{border-bottom:0}
.info-card .info-row .ico{width:32px;height:32px;border-radius:50%;background:rgba(0,145,194,.12);color:var(--sp-primary);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:14px}
.info-card .info-row .lbl{font-weight:700;color:var(--sp-secondary-d);font-size:13.5px}
.info-card .info-row .desc{color:var(--sp-muted);font-size:12.5px;line-height:1.5;margin-top:2px}

/* ===== Post composer ===== */
.composer{
  background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);
  padding:14px;margin-bottom:20px;display:flex;gap:12px;align-items:center;
}
.composer .avatar{width:40px;height:40px;border-radius:50%;background:var(--sp-primary);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex-shrink:0}
.composer input{flex:1;border:1px solid var(--sp-line);border-radius:var(--sp-radius-pill);padding:10px 16px;font-family:inherit;font-size:14px;color:var(--sp-text);background:#f4f7f9}
.composer input::placeholder{color:var(--sp-muted)}

/* ===== Post feed ===== */
.post{
  background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);
  padding:22px;margin-bottom:18px;
}
.post-head{display:flex;gap:12px;align-items:center;margin-bottom:14px}
.post-head .avatar{width:40px;height:40px;border-radius:50%;background:var(--sp-secondary);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex-shrink:0}
.post-head .who{display:flex;flex-direction:column}
.post-head .name{font-weight:700;color:var(--sp-secondary-d);font-size:14px}
.post-head .time{font-size:12.5px;color:var(--sp-muted)}
.post-head .menu{margin-left:auto;color:var(--sp-muted);font-size:18px;cursor:pointer}
.post h3{font-size:17px;font-weight:700;color:var(--sp-secondary-d);margin-bottom:10px;line-height:1.3}
.post p{font-size:14.5px;line-height:1.7;color:var(--sp-text);margin-bottom:10px}
.post p:last-of-type{margin-bottom:0}
.post a{color:var(--sp-primary);font-weight:600;border-bottom:1px solid rgba(0,145,194,.32)}
.post .post-actions{
  display:flex;gap:18px;padding-top:12px;margin-top:14px;
  border-top:1px solid var(--sp-line);font-size:13px;color:var(--sp-muted);
}
.post .post-actions a{color:var(--sp-muted);font-weight:600;border-bottom:0;display:inline-flex;align-items:center;gap:4px}
.post .post-actions a:hover{color:var(--sp-primary)}
.post .file-attach{
  display:inline-flex;align-items:center;gap:10px;background:#f4f7f9;
  border:1px solid var(--sp-line);border-radius:8px;padding:10px 14px;margin-top:6px;
  font-size:13px;color:var(--sp-secondary-d);font-weight:600;text-decoration:none;
}
.post .file-attach::before{content:'PDF';background:var(--sp-rose,#dc2626);color:#fff;font-size:9px;padding:2px 6px;border-radius:3px;font-weight:700;letter-spacing:.5px}
.post .reply{
  margin-top:12px;padding:12px;background:#f8fafc;border-radius:8px;
  display:flex;gap:10px;
}
.post .reply .avatar{width:32px;height:32px;font-size:11px;background:var(--sp-muted)}
.post .reply .body{flex:1}
.post .reply .body .name{font-size:13px;font-weight:700;color:var(--sp-secondary-d)}
.post .reply .body .time{font-size:11.5px;color:var(--sp-muted);margin-bottom:4px}
.post .reply .body p{font-size:13.5px;line-height:1.6;margin-bottom:0}

/* ===== Files tab ===== */
.file-list{background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);overflow:hidden}
.file-row{
  display:flex;align-items:center;gap:14px;padding:16px 22px;
  border-bottom:1px solid var(--sp-line);
}
.file-row:last-child{border-bottom:0}
.file-row .file-icon{
  width:38px;height:46px;background:var(--sp-rose,#dc2626);color:#fff;
  border-radius:4px;display:inline-flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:800;letter-spacing:.5px;flex-shrink:0;
}
.file-row .file-meta{flex:1;min-width:0}
.file-row .file-name{font-weight:700;color:var(--sp-secondary-d);font-size:14px;overflow:hidden;text-overflow:ellipsis}
.file-row .file-sub{font-size:12.5px;color:var(--sp-muted);margin-top:2px}
.file-row .menu{color:var(--sp-muted);font-size:18px;cursor:pointer;flex-shrink:0}

/* ===== Members tab ===== */
.member-list{background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);overflow:hidden}
.member-row{
  display:flex;align-items:center;gap:14px;padding:14px 22px;
  border-bottom:1px solid var(--sp-line);
}
.member-row:last-child{border-bottom:0}
.member-row .mem-avatar{
  width:42px;height:42px;border-radius:50%;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--sp-muted);color:#fff;font-weight:700;font-size:13px;
}
.member-row .mem-info{flex:1;min-width:0}
.member-row .mem-name{font-weight:700;color:var(--sp-secondary-d);font-size:14.5px}
.member-row .mem-role{font-size:12.5px;color:var(--sp-muted);margin-top:1px}
.member-row .follow-btn{
  background:var(--sp-secondary-d);color:#fff;padding:6px 18px;
  border-radius:var(--sp-radius-pill);font-size:12.5px;font-weight:700;
  border:none;cursor:pointer;flex-shrink:0;
}
.member-row .follow-btn[aria-pressed="true"]{background:#fff;color:var(--sp-secondary-d);border:1.5px solid var(--sp-secondary-d)}

/* ===== Media tab ===== */
.media-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:14px;
}
@media (max-width:900px){.media-grid{grid-template-columns:repeat(2,1fr)}}
.media-tile{
  aspect-ratio:1;background:#f4f7f9;border:1px solid var(--sp-line);
  border-radius:var(--sp-radius-sm);overflow:hidden;position:relative;cursor:pointer;
}
.media-tile img{width:100%;height:100%;object-fit:cover;display:block}
.media-tile .caption{
  position:absolute;left:0;right:0;bottom:0;padding:8px 10px;
  background:linear-gradient(transparent,rgba(6,41,64,.85));color:#fff;
  font-size:12px;font-weight:600;
}

/* ===== About tab — activity stats ===== */
.activity-card{
  background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);
  padding:24px;margin-bottom:18px;
}
.activity-card h3{font-size:14px;font-weight:700;color:var(--sp-secondary-d);margin-bottom:18px}
.activity-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.activity-stats .stat{text-align:center;padding:16px}
.activity-stats .num{font-size:30px;font-weight:800;color:var(--sp-primary);line-height:1}
.activity-stats .lbl{font-size:12.5px;color:var(--sp-muted);margin-top:8px;font-weight:600;text-transform:uppercase;letter-spacing:1.2px}

/* ===== Groups directory ===== */
.group-grid-dir{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
@media (max-width:900px){.group-grid-dir{grid-template-columns:1fr}}
.group-card{
  background:#fff;border:1px solid var(--sp-line);border-radius:var(--sp-radius-md);
  padding:24px;display:flex;flex-direction:column;gap:10px;text-decoration:none;
  transition:.2s;
}
.group-card:hover{transform:translateY(-3px);box-shadow:var(--sp-shadow-xl);border-color:var(--sp-primary)}
.group-card h3{font-size:18px;font-weight:700;color:var(--sp-secondary-d);line-height:1.3}
.group-card p{font-size:13.5px;line-height:1.55;color:var(--sp-text);flex:1}
.group-card .group-meta{display:flex;gap:14px;font-size:12px;color:var(--sp-muted);padding-top:8px;border-top:1px solid var(--sp-line);font-weight:600;text-transform:uppercase;letter-spacing:1px}
.group-card .group-tag{
  display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:1.4px;
  text-transform:uppercase;color:var(--sp-primary);
  padding:4px 10px;background:rgba(0,145,194,.1);border-radius:var(--sp-radius-pill);
  align-self:flex-start;
}

/* =====================================================================
   Working-group community surface (controller-rendered tabs).
   Selectors used by WorkingGroupCommunityController + Group*Form classes.
   ===================================================================== */

/* --- Hero + tab strip alignment ----------------------------------------
   The community pages render the hero and tabs as <section>/<nav> blocks
   that sit OUTSIDE the theme's #block-pirt-main-content container, so we
   need to neutralise the default container padding on the main region
   when an .ncwg-hero is present. Without this the hero band sits inside
   a 1240px column with white gutters either side. */
body.skin main.section:has(.ncwg-hero.wg-community-hero) { padding: 0 !important; }
body.skin main.section:has(.ncwg-hero.wg-community-hero) > .container,
body.skin main.section:has(.ncwg-hero.wg-community-hero) #block-pirt-main-content > .container {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}
body.skin main.section:has(.ncwg-hero.wg-community-hero) #block-pirt-main-content { width: 100%; }
body.skin .ncwg-hero.wg-community-hero { width: 100%; }
body.skin .ncwg-hero.wg-community-hero h1 {
  font-size: clamp(28px, 3.6vw, 38px);
  color: #fff;
  margin: 6px 0 8px;
  letter-spacing: 0;
  max-width: 920px;
}
body.skin .ncwg-hero.wg-community-hero .lede,
body.skin .ncwg-hero.wg-community-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, .9) !important;
}
body.skin .ncwg-hero.wg-community-hero .crumbs,
body.skin .ncwg-hero.wg-community-hero .crumbs a,
body.skin .ncwg-hero.wg-community-hero .eyebrow {
  color: #fff !important;
}

/* --- Tab strip: hero is full-bleed so the tab bar needs its own gutter -- */
body.skin .group-tabs { margin: 0; padding: 0; background: #fff; border-bottom: 1px solid var(--sp-line); }
body.skin .group-tabs > .container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}
body.skin .group-tabs ul { padding: 0; }

/* --- Free-standing form shells (composer, upload, create, edit, leave) -
   Render arrays for these forms are wrapped in:
     .wg-form-section > .container > .wg-form-card > .wg-form-card__heading + <form>
   The shell gives the form the same width + a card background so it
   doesn't spill full-bleed with default Drupal form chrome. */
.wg-form-section { padding: 28px 0 4px; }
.wg-form-section > .container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wg-form-card {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  box-shadow: 0 8px 22px rgba(6, 41, 64, .06);
  padding: 22px 24px;
}
.wg-form-card__heading {
  font-size: 14px;
  font-weight: 800;
  color: var(--sp-secondary-d);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 16px;
}
.wg-form-card form { margin: 0; }
.wg-form-card .form-item { margin-bottom: 14px; }
.wg-form-card label { display: block; font-size: 13px; font-weight: 700; color: var(--sp-secondary-d); margin-bottom: 6px; }
.wg-form-card input[type="text"],
.wg-form-card input[type="email"],
.wg-form-card input[type="date"],
.wg-form-card input[type="datetime-local"],
.wg-form-card input[type="url"],
.wg-form-card textarea,
.wg-form-card select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sp-line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--sp-text);
  font-size: 14px;
  font-family: inherit;
}
.wg-form-card textarea { resize: vertical; min-height: 110px; }
.wg-form-card input:focus, .wg-form-card textarea:focus, .wg-form-card select:focus {
  outline: none; border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px rgba(1, 128, 129, .12); background: #fff;
}
.wg-form-card .form-managed-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #f8fafc; border: 1px dashed var(--sp-line); border-radius: 6px; }
.wg-form-card .form-managed-file input[type="file"] { width: auto; background: transparent; border: none; padding: 0; }
.wg-form-card .description { font-size: 12px; color: var(--sp-muted); margin-top: 4px; }
.wg-form-card .form-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.wg-form-card .button { padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 700; border: 1px solid transparent; cursor: pointer; }
.wg-form-card .button--primary { background: var(--sp-primary); color: #fff; }
.wg-form-card .button--primary:hover { background: var(--sp-primary-d, #016868); }
.wg-form-card .button--secondary { background: #fff; color: var(--sp-secondary-d); border-color: var(--sp-line); }
.wg-form-card .button--secondary:hover { border-color: var(--sp-secondary-d); }
.wg-form-card .button--danger { background: #fff; color: #c2410c; border-color: rgba(194, 65, 12, .35); }
.wg-form-card .button--danger:hover { background: rgba(220, 38, 38, .08); border-color: #c2410c; }
.wg-form-card fieldset {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  background: #f8fafc;
}
.wg-form-card legend {
  padding: 0 6px;
  color: var(--sp-secondary-d);
  font-size: 13px;
  font-weight: 800;
}
.wg-form-card .form-radios,
.wg-form-card .form-checkboxes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wg-form-card .form-type-radio,
.wg-form-card .form-type-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  background: #fff;
}
.wg-form-card .form-type-radio label,
.wg-form-card .form-type-checkbox label {
  margin: 0;
  color: var(--sp-text);
  font-size: 12.5px;
  font-weight: 700;
}
.wg-composer-details {
  margin: 0;
  width: 100%;
}
.wg-composer-details > summary {
  cursor: pointer;
  color: var(--sp-secondary-d);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wg-composer-details__description {
  margin: 10px 0 16px;
  color: var(--sp-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* --- Shared private-tab header, layout, and sidebar ------------------- */
.wg-community-shell {
  padding-top: 34px !important;
}
.wg-summary-header {
  box-sizing: border-box;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid #d9edf3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(6, 41, 64, .07);
}
.wg-summary-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--sp-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wg-summary-header h2 {
  margin: 0 0 6px;
  color: var(--sp-secondary-d);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}
.wg-summary-header p {
  margin: 0;
  color: var(--sp-muted);
  font-size: 14px;
  line-height: 1.6;
}
.wg-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  margin: 0;
}
.wg-summary-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}
.wg-summary-settings {
  width: max-content;
}
.wg-summary-stats div {
  min-width: 82px;
  padding: 12px 14px;
  border: 1px solid #d9edf3;
  border-radius: 8px;
  background: #f8fbfc;
  text-align: center;
}
.wg-summary-stats dt {
  color: var(--sp-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.wg-summary-stats dd {
  margin: 4px 0 0;
  color: var(--sp-secondary-d);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}
.wg-community-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.wg-community-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.wg-community-aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}
.wg-community-aside .info-card {
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(6, 41, 64, .06);
}
.wg-community-aside h3 {
  margin: 0 0 14px;
  color: var(--sp-secondary-d);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wg-suggested-groups .suggested-list {
  display: grid;
  gap: 8px;
}
.wg-suggested-groups a {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--sp-line);
  color: var(--sp-text);
  text-decoration: none;
}
.wg-suggested-groups a:first-child {
  border-top: 0;
}
.wg-suggested-groups strong {
  color: var(--sp-primary);
  font-size: 12px;
  font-weight: 800;
}
.wg-suggested-groups span {
  color: var(--sp-secondary-d);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.wg-panel {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  padding: 20px;
  border: 1px solid #d9edf3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(6, 41, 64, .055);
}
.wg-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}
.wg-panel-head h2 {
  margin: 0;
  color: var(--sp-secondary-d);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}
.wg-panel-head p {
  margin: 0;
  color: var(--sp-muted);
  font-size: 13px;
  font-weight: 700;
}
.wg-empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px dashed #b9d9df;
  border-radius: 8px;
  background: #f8fbfc;
  text-align: center;
}
.wg-empty-state h3 {
  margin: 0 0 6px;
  color: var(--sp-secondary-d);
  font-size: 16px;
}
.wg-empty-state p {
  margin: 0 auto;
  max-width: 480px;
  color: var(--sp-muted);
  font-size: 14px;
  line-height: 1.6;
}
.ncwg-post .post-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--sp-line);
}
.ncwg-post .post-actions a {
  color: var(--sp-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
}
.wg-option-menu {
  position: relative;
  justify-self: end;
}
.wg-option-menu summary {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--sp-line);
  border-radius: 50%;
  background: #fff;
  color: var(--sp-secondary-d);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}
.wg-option-menu summary::-webkit-details-marker {
  display: none;
}
.wg-option-menu div {
  position: absolute;
  right: 0;
  z-index: 6;
  display: grid;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(6, 41, 64, .12);
}
.wg-option-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sp-secondary-d);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.wg-option-menu a:hover {
  background: #f4f7f9;
  color: var(--sp-primary);
}
.wg-media-tile .tile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.wg-load-more {
  margin-top: 16px;
}
.wg-load-more summary {
  width: max-content;
  padding: 10px 16px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-secondary-d);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.wg-load-more .ncwg-posts-list {
  margin-top: 16px;
}

/* --- Per-row inline action group (post/file/event/member admin) --------
   Render arrays for these are wrapped in:
     .wg-row-actions > .container > .wg-row-actions__card { label + buttons }
   .wg-row-actions__buttons holds N <form> children rendered inline. */
.wg-row-actions { padding: 0; margin: -6px 0 12px; }
.wg-row-actions > .container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wg-community-main .wg-row-actions > .container {
  max-width: 100%;
  padding: 0;
}
.wg-row-actions__card {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(6, 41, 64, .025);
  border: 1px solid var(--sp-line);
  border-radius: 8px;
}
.wg-row-actions__label {
  font-size: 12px;
  color: var(--sp-muted);
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 180px;
}
.wg-row-actions__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.wg-row-actions__buttons form { margin: 0; display: inline; }
.wg-row-actions__buttons .button {
  padding: 6px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--sp-line); cursor: pointer; background: #fff;
  color: var(--sp-secondary-d);
}
.wg-row-actions__buttons .button:hover { border-color: var(--sp-primary); color: var(--sp-primary); }
.wg-row-actions__buttons .button--primary { background: var(--sp-primary); color: #fff; border-color: var(--sp-primary); }
.wg-row-actions__buttons .button--primary:hover { background: var(--sp-primary-d, #016868); color: #fff; }
.wg-row-actions__buttons .button--danger { background: #fff; color: #c2410c; border-color: rgba(194, 65, 12, .4); }
.wg-row-actions__buttons .button--danger:hover { background: rgba(220, 38, 38, .08); }

/* --- Media tab grid (controller emits .wg-media-grid > .wg-media-tile) -- */
.wg-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.wg-media-tile {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  box-shadow: 0 6px 18px rgba(6, 41, 64, .05);
  display: flex; flex-direction: column; gap: 10px;
}
.wg-media-tile h3 { font-size: 14.5px; color: var(--sp-secondary-d); margin: 0; line-height: 1.35; }
.wg-media-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; }
.wg-media-tile .meta { font-size: 12px; color: var(--sp-muted); margin: 0; }
.wg-media-tile a { color: var(--sp-primary); font-weight: 600; }

/* --- About tab 2-col grid (article + aside-card) ----------------------- */
.wg-about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) { .wg-about-grid { grid-template-columns: 1fr; } }
.wg-about-grid .prose h2 {
  font-size: 20px; color: var(--sp-secondary-d); margin: 18px 0 10px;
  font-weight: 800; letter-spacing: -.2px;
}
.wg-about-grid .prose h2:first-child { margin-top: 0; }
.wg-about-grid .prose p { font-size: 15px; line-height: 1.65; color: var(--sp-text); margin-bottom: 12px; }
.wg-about-grid .aside-card {
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  padding: 20px 22px;
  box-shadow: 0 8px 22px rgba(6, 41, 64, .06);
  position: sticky; top: 88px;
}
.wg-about-grid .aside-card h3 {
  font-size: 12px; color: var(--sp-muted); margin: 0 0 12px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 1.4px;
}
.wg-about-grid .aside-card .list { display: flex; flex-direction: column; }
.wg-about-grid .aside-card .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--sp-line); font-size: 13.5px;
}
.wg-about-grid .aside-card .row:last-child { border-bottom: 0; }
.wg-about-grid .aside-card .row strong { color: var(--sp-secondary-d); font-weight: 700; }
.wg-about-grid .aside-card .row span { color: var(--sp-primary); font-weight: 700; }

/* --- Roster table polish (members + files share .ncwg-roster) ---------- */
.wg-member-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.wg-member-filter {
  min-width: min(100%, 300px);
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--sp-text);
  font-family: inherit;
  font-size: 14px;
}
.wg-member-filter:focus {
  outline: none;
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px rgba(1, 128, 129, .12);
  background: #fff;
}
.wg-member-actions-link {
  white-space: nowrap;
}
.wg-queue-card {
  border-color: #ead7af;
  background: #fffdf7;
}
.wg-request-card p {
  margin: 8px 0 0;
  color: var(--sp-text);
  font-size: 14px;
  line-height: 1.6;
}
.ncwg-roster td .mg-pill-status { font-size: 10.5px; }
.ncwg-roster a { color: var(--sp-primary); font-weight: 600; }
.ncwg-roster a:hover { text-decoration: underline; }
.ncwg-roster td:first-child,
.ncwg-roster th:first-child {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wg-activity-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.wg-activity-stats div {
  padding: 16px;
  border: 1px solid #d9edf3;
  border-radius: 8px;
  background: #f8fbfc;
  text-align: center;
}
.wg-activity-stats strong {
  display: block;
  color: var(--sp-primary);
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}
.wg-activity-stats span {
  display: block;
  margin-top: 7px;
  color: var(--sp-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

/* --- Hidden / pinned post variants ------------------------------------ */
.ncwg-post.is-hidden { opacity: .55; background: #f8fafc; }
.ncwg-post .post-head { display: block; margin-bottom: 8px; }
.ncwg-post .post-body { font-size: 14.5px; line-height: 1.7; color: var(--sp-text); margin-top: 6px; }
.ncwg-post .file-attach {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  box-sizing: border-box; max-width: 100%;
  padding: 8px 12px; background: #f4f7f9; border: 1px solid var(--sp-line);
  border-radius: 8px; font-size: 13px; color: var(--sp-secondary-d);
  font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.ncwg-post .file-attach:hover { border-color: var(--sp-primary); color: var(--sp-primary); }

/* --- Discussion cards and replies ------------------------------------- */
.wg-discussion-panel {
  padding: 18px;
}
.wg-discussion-panel .wg-panel-head {
  align-items: flex-start;
}
.wg-discussion-list {
  gap: 14px;
}
.wg-discussion-post {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  padding: 18px;
}
.wg-discussion-post.is-pinned {
  border-color: rgba(1, 128, 129, .35);
  box-shadow: 0 10px 24px rgba(1, 128, 129, .09);
}
.wg-discussion-post .post-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.wg-discussion-post .post-head .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  background: var(--sp-secondary-d);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
.wg-discussion-post .post-head .who {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.wg-discussion-post .post-head .who strong {
  color: var(--sp-secondary-d);
  font-size: 14px;
  line-height: 1.3;
}
.wg-discussion-post .post-head .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--sp-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.wg-post-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px 50px;
}
.wg-discussion-post h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.wg-discussion-post .post-body {
  overflow-wrap: anywhere;
  word-break: normal;
}
.wg-discussion-post .post-body p:last-child {
  margin-bottom: 0;
}
.wg-discussion-post .post-actions {
  margin-top: 12px;
}
.wg-post-comments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.wg-post-comments h4 {
  margin: 0;
  color: var(--sp-muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wg-post-comment {
  padding: 10px 12px;
  border: 1px solid var(--sp-line);
  border-radius: 8px;
  background: #f8fafc;
}
.wg-post-comment.is-reply {
  margin-left: 20px;
}
.wg-post-comment .post-head {
  margin-bottom: 6px;
}
.wg-post-comment .post-body {
  font-size: 13.5px;
  line-height: 1.6;
}
.wg-reply-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--sp-line);
}
.wg-reply-details > summary {
  width: max-content;
  cursor: pointer;
  padding: 7px 14px;
  border: 1px solid rgba(1, 128, 129, .28);
  border-radius: 999px;
  background: #f1fbfb;
  color: var(--sp-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  list-style-position: outside;
  text-transform: uppercase;
}
.wg-reply-trigger{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:6px 12px;
  border:1px solid rgba(1,128,129,.25);
  border-radius:999px;
  background:#f1fbfb;
  color:var(--sp-primary) !important;
  font-size:12px;
  font-weight:800;
  text-decoration:none;
}
.wg-reply-trigger:hover,
.wg-reply-details > summary:hover{
  background:#e3f6f6;
  border-color:var(--sp-primary);
}
.wg-reply-details form {
  margin-top: 10px;
}
.wg-reply-form textarea {
  min-height: 92px;
}
.wg-post-admin-actions {
  margin: 14px 0 0;
}
.wg-post-admin-actions__card {
  background: #f8fbfc;
}
.wg-older-posts {
  margin-top: 14px;
}
.wg-older-posts[open] > summary {
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .wg-form-section > .container,
  .wg-row-actions > .container,
  body.skin .group-tabs > .container { padding: 0 16px; }
  .wg-form-card { padding: 18px 16px; }
  .wg-row-actions__card { gap: 8px; padding: 10px 12px; }
  .wg-row-actions__label { min-width: 100%; }
  .wg-summary-header,
  .wg-community-layout {
    grid-template-columns: 1fr;
  }
  .wg-community-shell > .container {
    max-width: 100%;
    overflow: hidden;
  }
  .wg-discussion-panel {
    padding: 14px;
  }
  .wg-discussion-post {
    padding: 15px;
  }
  .wg-post-status-row {
    margin-left: 0;
  }
  .wg-post-comment.is-reply {
    margin-left: 8px;
  }
  .wg-summary-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wg-summary-side,
  .wg-summary-settings {
    width: 100%;
    justify-items: stretch;
  }
  .wg-community-aside {
    position: static;
  }
  .wg-panel-head {
    display: block;
  }
  .wg-activity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wg-panel {
    overflow: hidden;
  }
  .ncwg-roster {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ncwg-roster th,
  .ncwg-roster td {
    min-width: 112px;
    padding: 12px 14px;
  }
  .ncwg-roster th:first-child,
  .ncwg-roster td:first-child {
    min-width: 190px;
  }
}

/* ISSUE-0348: WG public detail — membership state chip in hero + state-aware CTA. */
.wg-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: middle;
}
.wg-member-chip--joined { background: #d4f3dd; color: #0b4f24; border: 1px solid #87d2a0; }
.wg-member-chip--pending { background: #fef1c4; color: #6b4a06; border: 1px solid #e9c97a; }
.join-actions [data-cta-state="member"]  { border-color: #0b4f24; color: #0b4f24; }
.join-actions [data-cta-state="pending"] { border-color: #6b4a06; color: #6b4a06; }

/* ISSUE-0344 follow-on: inline action buttons inside table cells & post cards. */
.ncwg-roster .wg-row-actions--inline,
.ncwg-post .wg-row-actions--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ncwg-roster .wg-row-actions--inline form,
.ncwg-post .wg-row-actions--inline form {
  margin: 0;
  display: inline-flex;
}
.ncwg-roster .wg-row-actions--inline .button,
.ncwg-post .wg-row-actions--inline .button {
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
}

/* ISSUE-0346: compact activity timeline (Activity tab). */
.wg-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e3e7eb;
}
.wg-timeline__item {
  display: grid;
  grid-template-columns: 28px 70px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f4;
  font-size: 0.94rem;
}
.wg-timeline__item:nth-child(odd) { background: #fafbfc; }
.wg-timeline__marker { font-size: 1rem; text-align: center; }
.wg-timeline__type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6470;
  font-weight: 600;
}
.wg-timeline__item--post .wg-timeline__type   { color: #1f5fbf; }
.wg-timeline__item--file .wg-timeline__type   { color: #6b4a06; }
.wg-timeline__item--media .wg-timeline__type  { color: #7a3e9b; }
.wg-timeline__item--event .wg-timeline__type  { color: #b14b1a; }
.wg-timeline__item--member .wg-timeline__type { color: #0b6b34; }
.wg-timeline__label a { font-weight: 500; }
.wg-timeline__time   { color: #6b7480; font-size: 0.82rem; }

/* ISSUE-0346: collapsible older-member roster. */
.wg-roster-older {
  margin-top: 12px;
  border-top: 1px dashed #d2d8df;
  padding-top: 10px;
}
.wg-roster-older > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
  color: #1f4f8f;
}
.wg-roster-older[open] > summary { color: #0b3866; }
