/* Community portal supplemental styles */
/* Inherits design tokens from theme.css */

/* ── NAV additions ──────────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--green); }

.nav-link-cta {
  background: var(--green);
  color: var(--bg) !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
}

.nav-link-cta:hover { background: var(--green-light); }

.nav-member {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.nav-signout {
  background: none;
  border: 1px solid rgba(27,67,50,0.2);
  color: var(--fg-muted);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.nav-signout:hover { border-color: var(--green); color: var(--green); }

/* ── Portal page shell ──────────────────────────────────────────────────── */
.portal-main {
  min-height: calc(100vh - 85px);
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 24px 80px;
}

.portal-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.portal-headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--green);
  line-height: 1.15;
  margin-bottom: 16px;
}

.portal-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 32px;
}

/* ── Apply / Login form wrapper ─────────────────────────────────────────── */
.apply-wrap {
  width: 100%;
  max-width: 680px;
}

.apply-wrap-sm {
  max-width: 440px;
}

.apply-header {
  margin-bottom: 40px;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.form-input {
  background: #fff;
  border: 1.5px solid rgba(27,67,50,0.18);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--fg);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-error {
  background: rgba(180,40,40,0.07);
  border: 1px solid rgba(180,40,40,0.25);
  color: #b42828;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.875rem;
}

.form-footnote {
  margin-top: 20px;
  color: var(--fg-muted);
  font-size: 0.875rem;
  text-align: center;
}

.link-underline {
  color: var(--green);
  text-decoration: underline;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  text-align: center;
}

.btn-primary:hover { background: var(--green-light); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 8px;
  padding: 11px 28px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  text-align: center;
}

.btn-secondary:hover { background: var(--green); color: var(--bg); }

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
}

/* ── Success states ──────────────────────────────────────────────────────── */
.apply-success {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  font-weight: 700;
}

/* ── Auth gate ───────────────────────────────────────────────────────────── */
.auth-gate {
  min-height: calc(100vh - 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.auth-gate-inner {
  max-width: 480px;
  text-align: center;
}

.auth-gate-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Community layout ────────────────────────────────────────────────────── */
.community-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px 80px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.community-sidebar {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-section {}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(27,67,50,0.1);
  border-radius: 10px;
  padding: 16px;
}

.member-avatar {
  width: 44px;
  height: 44px;
  background: var(--green);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.3;
}

.member-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* Program access list */
.program-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.program-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.program-active {
  background: rgba(27,67,50,0.07);
  border-color: rgba(27,67,50,0.12);
}

.program-locked {
  opacity: 0.5;
}

.program-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.program-dot-locked {
  background: var(--fg-muted);
}

.program-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.program-sub {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* Category filter buttons */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  background: transparent;
  border: 1.5px solid rgba(27,67,50,0.2);
  color: var(--fg-muted);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-btn:hover { border-color: var(--green); color: var(--green); }

.cat-btn-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--bg);
}

/* ── Feed ────────────────────────────────────────────────────────────────── */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.feed-title {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  color: var(--green);
}

.feed-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-loading {
  color: var(--fg-muted);
  font-size: 0.9rem;
  padding: 40px 0;
  text-align: center;
}

.feed-empty {
  text-align: center;
  padding: 60px 20px;
}

.feed-empty-title {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  color: var(--green);
  margin-bottom: 8px;
}

.feed-empty-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.post-card {
  background: #fff;
  border: 1px solid rgba(27,67,50,0.1);
  border-radius: 12px;
  padding: 22px 24px;
  transition: box-shadow 0.15s;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(27,67,50,0.08);
}

.post-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.post-author-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-alt);
  border: 1.5px solid rgba(27,67,50,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.post-author-info { flex: 1; min-width: 0; }

.post-author-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.post-author-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.post-cat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.post-delete-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
  margin-left: auto;
}

.post-delete-btn:hover { opacity: 1; color: #b42828; }

.post-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-body {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,43,30,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--bg);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--green);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--fg-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-close:hover { color: var(--fg); }

.modal form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .community-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 60px;
    gap: 28px;
  }

  .community-sidebar {
    position: static;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .portal-main {
    padding: 40px 16px 60px;
  }

  .modal {
    padding: 24px;
  }
}
