/**
 * BNPP Organizational Management — plugin stylesheet.
 *
 * This is a self-sufficient functional baseline: forms, cards, and widgets
 * render correctly and legibly on ANY active theme, even one that has
 * never heard of BNPP. A theme MAY additionally style these same class
 * names for a richer, branded look (the bundled bnpp-theme does exactly
 * this in its own stylesheet) — but nothing here depends on the theme
 * doing so. This is what keeps membership/committee/donation pages working
 * if the site changes themes.
 */

:root {
  --bnpp-om-primary: #e31e24;
  --bnpp-om-primary-dark: #b8161b;
  --bnpp-om-accent: #0e9f54;
  --bnpp-om-gold: #e8b923;
  --bnpp-om-ink: #1a2430;
  --bnpp-om-ink-soft: #55606b;
  --bnpp-om-line: #dde3e8;
  --bnpp-om-mist: #f2f5f7;
  --bnpp-om-white: #ffffff;
  --bnpp-om-radius: 6px;
}

/* ---- Layout helpers ---- */
.bnpp-two-col { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.bnpp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bnpp-narrow { max-width: 520px; margin-inline: auto; }
.bnpp-center-text { text-align: center; }
@media (max-width: 900px) {
  .bnpp-two-col { grid-template-columns: 1fr; }
  .bnpp-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Cards / panels ---- */
.bnpp-card {
  background: var(--bnpp-om-white);
  border: 1px solid var(--bnpp-om-line);
  border-radius: var(--bnpp-om-radius);
  padding: 28px;
  max-width: 560px;
}
.bnpp-panel {
  background: var(--bnpp-om-white);
  border: 1px solid var(--bnpp-om-line);
  border-radius: var(--bnpp-om-radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.bnpp-panel h4 { margin-top: 0; font-size: 0.95rem; color: var(--bnpp-om-ink); }
.bnpp-member-card {
  background: var(--bnpp-om-white);
  border: 1px solid var(--bnpp-om-line);
  border-radius: var(--bnpp-om-radius);
  padding: 24px;
  text-align: center;
}
.bnpp-member-card h3 { margin: 10px 0 4px; font-size: 1.05rem; }
.bnpp-member-card h3 a { color: var(--bnpp-om-ink); text-decoration: none; }

/* ---- Buttons ---- */
.bnpp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: var(--bnpp-om-radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.bnpp-btn:hover { opacity: 0.88; }
.bnpp-btn-primary { background: var(--bnpp-om-primary); color: #fff; }
.bnpp-btn-gold { background: var(--bnpp-om-gold); color: #fff; }
.bnpp-btn-outline { background: transparent; border-color: var(--bnpp-om-line); color: var(--bnpp-om-ink); }
.bnpp-btn-block { display: flex; width: 100%; justify-content: center; }
.bnpp-btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ---- Forms ---- */
.bnpp-row { margin-bottom: 16px; }
.bnpp-row label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; color: var(--bnpp-om-ink); }
.bnpp-row input[type="text"], .bnpp-row input[type="email"], .bnpp-row input[type="tel"],
.bnpp-row input[type="date"], .bnpp-row input[type="number"], .bnpp-row input[type="file"],
.bnpp-row select, .bnpp-row textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius);
  font-size: 0.92rem; font-family: inherit;
}
.bnpp-row-inline { display: flex; gap: 14px; }
.bnpp-row-inline .bnpp-row { flex: 1; }
.bnpp-row-flex { display: flex; align-items: center; gap: 14px; }
.bnpp-consent-row { display: flex; align-items: flex-start; gap: 8px; }
.bnpp-consent-row label { font-weight: 500; font-size: 0.85rem; line-height: 1.5; }
.bnpp-search-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 14px; align-items: end; margin-bottom: 24px; max-width: none; }
.bnpp-search-form-single { display: flex; gap: 10px; margin-bottom: 24px; max-width: none; }
.bnpp-search-form-single input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius); }
@media (max-width: 720px) {
  .bnpp-row-inline { flex-direction: column; gap: 0; }
  .bnpp-search-form { grid-template-columns: 1fr; }
}

/* ---- Alerts / notes ---- */
.bnpp-alert { padding: 12px 16px; border-radius: var(--bnpp-om-radius); font-weight: 600; margin-bottom: 16px; }
.bnpp-alert-success { background: #e7f5ee; color: #146b4d; }
.bnpp-alert-error { background: #fbeaea; color: #b3402f; }
.bnpp-hint { font-size: 0.8rem; color: var(--bnpp-om-ink-soft); margin-top: 6px; }
.bnpp-muted { color: var(--bnpp-om-ink-soft); font-size: 0.88rem; }
.bnpp-muted-sm { color: var(--bnpp-om-ink-soft); font-size: 0.78rem; }
.bnpp-note { font-size: 0.85rem; color: var(--bnpp-om-ink-soft); margin-top: 18px; line-height: 1.6; }

/* ---- Tags / badges ---- */
.bnpp-tag-green { color: var(--bnpp-om-accent); font-weight: 700; font-size: 0.8rem; }
.bnpp-tag-gold { color: var(--bnpp-om-gold); font-weight: 700; font-size: 0.82rem; }
.bnpp-badge-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.bnpp-role-chip { font-size: 0.8rem; color: var(--bnpp-om-ink-soft); }
.verified-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; color: #6b4c1e;
  background: #f3e2c4; padding: 4px 10px; border-radius: 20px;
}

/* ---- Avatars ---- */
.bnpp-avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.bnpp-avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.bnpp-avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }
.bnpp-avatar-xl { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bnpp-om-gold); }

/* ---- Profile header ---- */
.bnpp-profile-header {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--bnpp-om-ink); color: #fff;
  padding: 32px; border-radius: var(--bnpp-om-radius); margin-bottom: 24px;
}
.bnpp-profile-header h1 { color: #fff; margin: 0 0 6px; font-size: 1.5rem; }
.bnpp-profile-header p { margin: 0; opacity: 0.85; }
.bnpp-profile-header-info { flex: 1; min-width: 240px; }
.bnpp-profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Application confirmation ---- */
.bnpp-app-confirmation { text-align: center; }
.bnpp-app-confirmation-icon {
  width: 56px; height: 56px; border-radius: 50%; background: #e7f5ee; color: #146b4d;
  display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; margin: 0 auto 16px;
}
.bnpp-app-confirmation h3 { font-size: 1.3rem; margin-bottom: 20px; }
.bnpp-app-confirmation-row {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid var(--bnpp-om-line); text-align: left;
}
.bnpp-label { font-size: 0.82rem; color: var(--bnpp-om-ink-soft); font-weight: 600; }
.bnpp-value { font-weight: 700; }
.bnpp-status-pending { color: var(--bnpp-om-gold); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.03em; }

/* ---- Donation payment cards ---- */
.bnpp-donate-stats { display: flex; gap: 32px; margin-bottom: 24px; }
.bnpp-stat-num { font-size: 1.8rem; font-weight: 700; color: var(--bnpp-om-primary); }
.bnpp-stat-label { font-size: 0.8rem; color: var(--bnpp-om-ink-soft); }
.bnpp-step-title { font-size: 1.05rem; margin: 24px 0 14px; }
.bnpp-payment-instructions { display: flex; flex-direction: column; gap: 12px; }
.bnpp-pay-card { border: 1.5px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius); padding: 14px 16px; }
.bnpp-pay-active { border-color: var(--bnpp-om-gold); background: #fdf7ea; }
.bnpp-pay-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.bnpp-pay-type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--bnpp-om-accent); background: #e7f5ee; padding: 2px 8px; border-radius: 20px; }
.bnpp-pay-card p { margin: 0; font-size: 0.88rem; color: var(--bnpp-om-ink-soft); }
.bnpp-amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.bnpp-method-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.bnpp-pill { padding: 10px 14px; text-align: center; border: 1.5px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius); font-weight: 600; cursor: pointer; font-size: 0.86rem; }
.bnpp-pill.bnpp-active { border-color: var(--bnpp-om-gold); background: #fdf7ea; }
.bnpp-pill input { display: none; }

/* ---- Verify member ---- */
.bnpp-verify-result { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.bnpp-verify-name { display: flex; gap: 8px; align-items: center; font-size: 1.05rem; font-weight: 700; }
.bnpp-verify-name a { color: inherit; text-decoration: none; }

/* ---- Messages ---- */
.bnpp-messages-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.bnpp-thread-list li a { display: flex; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; color: var(--bnpp-om-ink); font-size: 0.88rem; font-weight: 600; }
.bnpp-chat-panel { display: flex; flex-direction: column; min-height: 420px; }
.bnpp-chat-header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--bnpp-om-line); padding-bottom: 14px; margin-bottom: 14px; }
.bnpp-chat-messages { flex: 1; overflow-y: auto; max-height: 380px; margin-bottom: 14px; }
.bnpp-chat-form { display: flex; gap: 10px; }
.bnpp-chat-form textarea { flex: 1; border: 1.5px solid var(--bnpp-om-line); border-radius: 20px; padding: 10px 16px; resize: none; }
.bnpp-chat-empty { margin: auto; text-align: center; color: var(--bnpp-om-ink-soft); }
.bnpp-msg-item { display: flex; margin-bottom: 12px; }
.bnpp-msg-mine { justify-content: flex-end; }
.bnpp-msg-text { display: inline-block; padding: 8px 14px; border-radius: 14px; background: var(--bnpp-om-mist); }
.bnpp-msg-mine .bnpp-msg-text { background: var(--bnpp-om-primary); color: #fff; }
.bnpp-msg-meta { font-size: 0.7rem; color: var(--bnpp-om-ink-soft); margin-top: 3px; }
@media (max-width: 720px) { .bnpp-messages-layout { grid-template-columns: 1fr; } }

/* ---- Community ---- */
.bnpp-community-layout { display: grid; grid-template-columns: 240px 1fr 260px; gap: 20px; align-items: start; }
.bnpp-chapter-list li { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 6px 0; }
.bnpp-count { color: var(--bnpp-om-primary); font-weight: 700; }
.bnpp-request-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.bnpp-request-row span { flex: 1; font-size: 0.85rem; font-weight: 600; }
.bnpp-composer { display: flex; gap: 12px; margin-bottom: 12px; }
.bnpp-composer-input { flex: 1; border: 1.5px solid var(--bnpp-om-line); border-radius: 22px; padding: 11px 18px; color: var(--bnpp-om-ink-soft); font-size: 0.9rem; }
.bnpp-mini-event { padding: 8px 0; border-bottom: 1px solid var(--bnpp-om-line); }
.bnpp-mini-event-title { font-size: 0.85rem; font-weight: 700; }
.bnpp-mini-event-date { font-size: 0.76rem; color: var(--bnpp-om-ink-soft); }
@media (max-width: 900px) { .bnpp-community-layout { grid-template-columns: 1fr; } }

/* ---- Member ID card ---- */
.bnpp-id-card {
  background: linear-gradient(135deg, #063d24 0%, #0a5c34 100%);
  border-radius: 14px; overflow: hidden; max-width: 520px; margin: 0 auto; color: #fff;
}
.bnpp-id-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: rgba(0,0,0,0.15); border-bottom: 2px solid var(--bnpp-om-gold); }
.bnpp-id-card-emblem { width: 40px; height: 40px; }
.bnpp-id-card-org { font-weight: 700; font-size: 1.05rem; }
.bnpp-id-card-sub { font-size: 0.7rem; color: #e0c98f; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.bnpp-id-card-body { display: flex; gap: 16px; padding: 20px; align-items: flex-start; }
.bnpp-id-card-photo { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; flex-shrink: 0; border: 2px solid var(--bnpp-om-gold); }
.bnpp-id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.bnpp-id-card-details { flex: 1; min-width: 0; }
.bnpp-id-card-name { font-size: 1.15rem; font-weight: 700; }
.bnpp-id-card-role { font-size: 0.82rem; color: #e0c98f; margin-bottom: 8px; }
.bnpp-id-card-table { font-size: 0.78rem; border-collapse: collapse; }
.bnpp-id-card-table th { text-align: left; color: rgba(255,255,255,0.55); font-weight: 600; padding-right: 10px; }
.bnpp-id-card-table td { color: rgba(255,255,255,0.9); }
.bnpp-id-card-qr { text-align: center; flex-shrink: 0; }
.bnpp-id-card-qr img { width: 76px; height: 76px; background: #fff; border-radius: 6px; padding: 4px; }
.bnpp-id-card-qr-label { font-size: 0.62rem; color: rgba(255,255,255,0.6); margin-top: 4px; text-transform: uppercase; }
.bnpp-id-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.1); }
.bnpp-id-card-id { font-weight: 700; letter-spacing: 0.03em; font-size: 0.92rem; }
.bnpp-id-card-verified { font-size: 0.72rem; color: #e0c98f; font-weight: 700; }
.bnpp-id-card-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; margin-bottom: 10px; }
@media print {
  body * { visibility: hidden; }
  #bnpp-id-card, #bnpp-id-card * { visibility: visible; }
  #bnpp-id-card { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); }
}

/* ==========================================================================
   Legacy/CPT-template class names — used by the plugin's bundled
   single/archive templates in templates/ (single-bnpp_group.php,
   single-bnpp_committee.php, single-bnpp_poll.php, etc.) and reused as-is
   by the current bundled theme for visual consistency.
   ========================================================================== */
.feed-panel { background: var(--bnpp-om-white); border: 1px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius); padding: 20px; margin-bottom: 16px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--bnpp-om-mist); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.activity-item { display: flex; gap: 12px; padding-block: 18px; border-bottom: 1px solid var(--bnpp-om-line); }
.activity-item:last-child { border-bottom: none; }
.activity-body { flex: 1; }
.activity-meta { font-size: 0.85rem; }
.activity-meta .who { font-weight: 700; }
.activity-meta .when { color: var(--bnpp-om-ink-soft); }
.activity-text { font-size: 0.92rem; margin-top: 4px; }
.activity-actions { display: flex; gap: 16px; margin-top: 10px; font-size: 0.82rem; color: var(--bnpp-om-ink-soft); font-weight: 600; }

.poll-widget { background: var(--bnpp-om-white); border: 1px solid var(--bnpp-om-line); border-top: 3px solid var(--bnpp-om-gold); border-radius: var(--bnpp-om-radius); padding: 24px; }
.poll-badge { display: inline-block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: var(--bnpp-om-accent); background: #e7f5ee; padding: 4px 10px; border-radius: 20px; margin-bottom: 10px; }
.poll-badge.poll-closed { color: var(--bnpp-om-ink-soft); background: var(--bnpp-om-mist); }
.poll-question h3 { font-size: 1.1rem; margin-bottom: 4px; }
.poll-context { font-size: 0.85rem; color: var(--bnpp-om-ink-soft); margin-bottom: 16px; }
.poll-group { margin-top: 16px; }
.poll-group + .poll-group { border-top: 1px solid var(--bnpp-om-line); padding-top: 16px; }
.poll-group-label { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.poll-options { display: flex; flex-direction: column; gap: 10px; }
.poll-option { display: block; width: 100%; text-align: left; background: var(--bnpp-om-white); border: 1.5px solid var(--bnpp-om-line); border-radius: var(--bnpp-om-radius); padding: 10px 14px; cursor: pointer; }
.poll-option-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.poll-option-icon { color: var(--bnpp-om-ink-soft); }
.poll-option-label { font-weight: 700; font-size: 0.9rem; flex: 1; }
.poll-option-pct { font-weight: 800; font-size: 0.88rem; color: var(--bnpp-om-ink-soft); }
.poll-option-selected { border-color: var(--bnpp-om-gold); background: #fdf7ea; }
.poll-bar-track { display: block; height: 8px; border-radius: 4px; background: var(--bnpp-om-mist); overflow: hidden; }
.poll-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--bnpp-om-primary); transition: width 0.4s ease; }
.poll-option-yes .poll-bar-fill, .poll-option-like .poll-bar-fill { background: var(--bnpp-om-accent); }
.poll-option-no .poll-bar-fill, .poll-option-dislike .poll-bar-fill { background: #b3402f; }
.poll-total { font-size: 0.78rem; color: var(--bnpp-om-ink-soft); margin-top: 10px; text-align: right; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card { background: var(--bnpp-om-white); border-radius: var(--bnpp-om-radius); overflow: hidden; border: 1px solid var(--bnpp-om-line); }
.news-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bnpp-om-mist); }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: 18px; }
.news-card .date { font-size: 0.76rem; color: var(--bnpp-om-accent); font-weight: 700; text-transform: uppercase; }
.news-card h3 { font-size: 1.02rem; margin: 8px 0; }
.news-card .excerpt { color: var(--bnpp-om-ink-soft); font-size: 0.88rem; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   RESPONSIVE — final pass covering the smaller pieces the section-level
   breakpoints above don't already handle.
   ========================================================================== */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }

@media (max-width: 600px) {
  .bnpp-card { padding: 20px; }
  .bnpp-narrow { max-width: 100%; }
  .bnpp-profile-header { padding: 22px; text-align: center; justify-content: center; }
  .bnpp-profile-header-info { text-align: center; }
  .bnpp-profile-actions { justify-content: center; }
  .bnpp-verify-result { flex-direction: column; align-items: center; text-align: center; }
  .bnpp-amount-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .bnpp-pill { padding: 9px 8px; font-size: 0.8rem; }
  .bnpp-request-row { flex-wrap: wrap; }
  .bnpp-donate-stats { justify-content: center; text-align: center; }

  /* Member ID card: stack instead of cramming 3 columns into a phone. */
  .bnpp-id-card-body { flex-direction: column; align-items: center; text-align: center; }
  .bnpp-id-card-footer { flex-direction: column; gap: 6px; text-align: center; }
  .bnpp-id-card-actions { flex-direction: column; align-items: stretch; }
  .bnpp-id-card-table { margin-inline: auto; }
}
