html {
  min-height: 100%;
  background: #071b3a;
}

body.comunidade-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: #eaf5ff;
  color: #10233f;
}

.comunidade-main {
  position: relative;
  flex: 1 0 auto;
  background:
    radial-gradient(circle at 14% 8%, rgba(29, 78, 216, 0.12), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(20, 184, 166, 0.1), transparent 26%),
    linear-gradient(180deg, #eaf5ff 0%, #f5f9ff 52%, #eef7ff 78%, #eaf5ff 100%);
}

.comunidade-container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

/* =========================
   HERO
========================= */

.comunidade-hero {
  min-height: calc(100vh - var(--blog-public-header-height, 76px));
  min-height: calc(100dvh - var(--blog-public-header-height, 76px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 4vw, 4rem) 0 clamp(2.5rem, 4vw, 4rem);
  background:
    radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.28), transparent 30%),
    radial-gradient(circle at 100% 6%, rgba(37, 99, 235, 0.28), transparent 32%),
    linear-gradient(120deg, #06172f 0%, #08223f 34%, #0a2f68 64%, #1155b8 100%);
  color: #ffffff;
}

.comunidade-hero-compact {
  padding-bottom: 44px;
}

.comunidade-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 28px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.76);
}

.comunidade-breadcrumb a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.comunidade-breadcrumb a:hover {
  text-decoration: underline;
}

.comunidade-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 32px;
  align-items: stretch;
}

.comunidade-hero-content,
.comunidade-page-title {
  max-width: 760px;
}

.comunidade-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(40, 104, 255, 0.1);
  color: #2156d9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comunidade-hero .comunidade-eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #dbeafe;
}

.comunidade-hero h1,
.comunidade-page-title h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.comunidade-hero p,
.comunidade-page-title p {
  max-width: 690px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
  line-height: 1.7;
}

.comunidade-hero-actions,
.comunidade-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}

.comunidade-primary-link,
.comunidade-secondary-link,
.comunidade-small-action,
.comunidade-primary-button,
.comunidade-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.comunidade-primary-link,
.comunidade-primary-button {
  background: #ffffff;
  color: #09275b;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.comunidade-primary-button {
  background: #0e4aa6;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(14, 74, 166, 0.22);
}

.comunidade-secondary-link {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.comunidade-small-action {
  background: #0e4aa6;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(14, 74, 166, 0.18);
}

.comunidade-danger-button {
  min-height: 34px;
  padding: 9px 12px;
  border: 1px solid rgba(185, 28, 28, 0.16);
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.78rem;
  box-shadow: none;
}

.comunidade-primary-link:hover,
.comunidade-secondary-link:hover,
.comunidade-small-action:hover,
.comunidade-primary-button:hover,
.comunidade-danger-button:hover {
  transform: translateY(-2px);
}

.comunidade-danger-button:hover {
  background: #fee2e2;
}

.comunidade-hero-panel,
.comunidade-sidebar-card,
.comunidade-form-card,
.comunidade-topic-detail,
.comunidade-reply-card,
.comunidade-empty-state,
.comunidade-notice {
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 22px 50px rgba(14, 34, 67, 0.1);
}

.comunidade-hero-panel {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 5%, rgba(37, 99, 235, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(20, 47, 91, 0.94) 0%, rgba(17, 42, 82, 0.94) 100%);
  border-color: rgba(96, 165, 250, 0.34);
  color: #ffffff;
  box-shadow: 0 26px 60px rgba(2, 6, 23, 0.34);
  backdrop-filter: blur(18px);
}

.comunidade-hero-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comunidade-hero-panel-header span {
  color: #dbeafe;
  font-size: 1.0rem;
  font-weight: 700;
}

.comunidade-hero-brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}

.comunidade-hero-brand-mark .brand-mark-primary {
  color: #93c5fd !important;
}

.comunidade-hero-brand-mark .brand-mark-accent {
  color: #4ade80 !important;
}

.comunidade-hero-topic-list {
  display: grid;
  gap: 0;
}

.comunidade-hero-topic {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 15px;
  padding: 18px 24px;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comunidade-hero-topic:last-child {
  border-bottom: 0;
}

.comunidade-hero-topic > span {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
  font-size: 1.0rem;
  font-weight: 950;
}

.comunidade-hero-topic h2 {
  margin: 0 0 5px;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.comunidade-hero-topic p {
  margin: 0;
  color: #94a3b8;
  font-size: 1.02rem;
  line-height: 1.52;
}

/* =========================
   SEÇÕES
========================= */

.comunidade-section {
  padding: 56px 0;
}

.comunidade-section-alt {
  background: transparent;
}

.comunidade-section-header {
  max-width: 720px;
  margin-bottom: 28px;
}

.comunidade-section-header-row {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.comunidade-section-header h2 {
  margin: 0;
  color: #0b2346;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.comunidade-section-header p {
  margin: 12px 0 0;
  color: #53647d;
  font-size: 1rem;
  line-height: 1.7;
}

/* =========================
   CATEGORIAS
========================= */

.comunidade-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.comunidade-category-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 28px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(14, 34, 67, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.comunidade-category-card:hover,
.comunidade-topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 58px rgba(14, 34, 67, 0.13);
}

.comunidade-category-count {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}

.comunidade-category-card h3 {
  margin: 18px 0 10px;
  color: #0b2346;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.comunidade-category-card p {
  margin: 0;
  color: #53647d;
  line-height: 1.6;
}

.comunidade-card-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  color: #0e4aa6;
  font-weight: 800;
  text-decoration: none;
}

/* =========================
   LISTAGEM DE TÓPICOS
========================= */

.comunidade-topic-list {
  display: grid;
  gap: 16px;
}

.comunidade-topic-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(14, 34, 67, 0.07);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.comunidade-topic-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.comunidade-topic-card-link:focus-visible {
  outline: 3px solid rgba(14, 74, 166, 0.34);
  outline-offset: 4px;
}

.comunidade-topic-card.is-pinned {
  border-color: rgba(14, 74, 166, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.comunidade-topic-card:hover {
  border-color: rgba(14, 74, 166, 0.2);
}

.comunidade-topic-main,
.comunidade-topic-stats {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.comunidade-topic-main a,
.comunidade-topic-category-link {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.comunidade-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  color: #6a7890;
  font-size: 0.88rem;
  font-weight: 700;
}

.comunidade-topic-meta a {
  color: #0e4aa6;
  text-decoration: none;
}

.comunidade-topic-meta a:hover {
  text-decoration: underline;
}

.comunidade-meta-separator {
  color: #94a3b8;
  font-weight: 800;
}

.comunidade-author-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
}

.comunidade-author-avatar {
  position: static;
  inset: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.16);
  transform: none;
}

.comunidade-author-avatar-lg {
  width: 34px;
  height: 34px;
  font-size: 0.82rem;
  box-shadow: 0 7px 15px rgba(29, 78, 216, 0.14);
}

.comunidade-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comunidade-badge-pinned {
  background: #fff7ed;
  color: #c2410c;
}

.comunidade-badge-closed {
  background: #eef2ff;
  color: #3730a3;
}

.comunidade-topic-card h3 {
  margin: 0;
  color: #0b2346;
  font-size: 1.18rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.comunidade-topic-card h3 a {
  color: inherit;
  text-decoration: none;
}

.comunidade-topic-card h3 a:hover {
  color: #0e4aa6;
}

.comunidade-topic-card p {
  margin: 10px 0 0;
  color: #53647d;
  line-height: 1.6;
}

.comunidade-open-topic {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: #0e4aa6;
  font-size: 0.94rem;
  font-weight: 900;
}

.comunidade-topic-card:hover .comunidade-open-topic {
  text-decoration: underline;
}

.comunidade-topic-stats,
.comunidade-topic-detail-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.comunidade-topic-stats {
  flex-direction: column;
  align-items: flex-end;
  color: #53647d;
  font-size: 0.9rem;
  white-space: nowrap;
}

.comunidade-topic-stats strong,
.comunidade-topic-detail-stats strong {
  color: #0b2346;
}

/* =========================
   TÓPICO
========================= */

.comunidade-topic-detail {
  padding: 30px;
  color: #10233f;
}

.comunidade-topic-detail-header h1 {
  margin: 0;
  color: #0b2346;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.comunidade-topic-detail-stats {
  margin-top: 18px;
  color: #53647d;
  font-weight: 700;
}

.comunidade-rich-text {
  display: block;
  margin-top: 24px;
  color: #233957;
  font-size: 1.05rem;
  line-height: 1.78;
}

.comunidade-rich-text p {
  display: block;
  margin: 0 0 16px;
  color: #233957;
  font-size: inherit;
  line-height: inherit;
}

.comunidade-topic-layout,
.comunidade-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}

/* =========================
   RESPOSTAS
========================= */

.comunidade-reply-list {
  display: grid;
  gap: 16px;
}

.comunidade-reply-card {
  position: relative;
  padding: 24px 26px;
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(14, 34, 67, 0.08);
}

.comunidade-reply-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
  background: transparent;
  box-shadow: none;
}

.comunidade-reply-author {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.comunidade-reply-author > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.comunidade-reply-header strong {
  display: block;
  color: #0b2346;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.2;
}

.comunidade-reply-header span:not(.comunidade-author-avatar) {
  color: #6a7890;
  font-size: 0.84rem;
  line-height: 1.3;
}

.comunidade-reply-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.comunidade-reply-number {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 900;
}

.comunidade-reply-moderation-form {
  margin: 0;
}

.comunidade-reply-text {
  margin-top: 16px;
}

.comunidade-reply-box {
  margin-top: 28px;
}

/* =========================
   FORMULÁRIOS
========================= */

.comunidade-form-card,
.comunidade-sidebar-card {
  padding: 26px;
}

.comunidade-form {
  display: grid;
  gap: 20px;
}

.comunidade-form-group {
  display: grid;
  gap: 8px;
}

.comunidade-form-group label {
  color: #0b2346;
  font-weight: 800;
}

.comunidade-form-group input,
.comunidade-form-group select,
.comunidade-form-group textarea {
  width: 100%;
  border: 1px solid #d5ddeb;
  border-radius: 18px;
  background: #ffffff;
  color: #10233f;
  font: inherit;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.comunidade-form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.comunidade-form-group input:focus,
.comunidade-form-group select:focus,
.comunidade-form-group textarea:focus {
  border-color: #0e4aa6;
  box-shadow: 0 0 0 4px rgba(14, 74, 166, 0.12);
}

.comunidade-form-group small {
  color: #6a7890;
  line-height: 1.5;
}

/* =========================
   ALERTAS / ESTADOS
========================= */

.comunidade-alert,
.comunidade-notice {
  padding: 18px;
  margin-bottom: 18px;
}

.comunidade-alert {
  border-radius: 18px;
  font-weight: 800;
}

.comunidade-alert-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.comunidade-alert-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.comunidade-notice {
  margin-top: 24px;
  background: #ffffff;
  color: #10233f;
}

.comunidade-notice strong {
  display: block;
  margin-bottom: 6px;
  color: #0b2346;
  font-size: 1.05rem;
}

.comunidade-notice p {
  margin: 0 0 14px;
  color: #53647d;
  line-height: 1.6;
}

.comunidade-empty-state {
  padding: 28px;
  text-align: center;
}

.comunidade-empty-state-left {
  text-align: left;
}

.comunidade-empty-state h3 {
  margin: 0;
  color: #0b2346;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.comunidade-empty-state p {
  margin: 10px auto 18px;
  max-width: 560px;
  color: #53647d;
  line-height: 1.6;
}

.comunidade-empty-state-left p {
  margin-left: 0;
}

/* =========================
   SIDEBAR
========================= */

.comunidade-sidebar-card {
  position: sticky;
  top: 20px;
}

.comunidade-sidebar-card h2,
.comunidade-sidebar-card h3 {
  margin: 0;
  color: #0b2346;
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.comunidade-sidebar-card p {
  color: #53647d;
  line-height: 1.65;
}

.comunidade-check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: #53647d;
}

.comunidade-check-list li {
  position: relative;
  padding-left: 28px;
  line-height: 1.55;
}

.comunidade-check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #0e4aa6;
  font-weight: 900;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 991.98px) {
  .comunidade-hero-grid,
  .comunidade-topic-layout,
  .comunidade-form-layout {
    grid-template-columns: 1fr;
  }

  .comunidade-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comunidade-sidebar-card {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .comunidade-container {
    width: min(100% - 22px, 1120px);
  }

  .comunidade-hero {
    min-height: calc(100vh - var(--blog-public-header-height, 72px));
    min-height: calc(100dvh - var(--blog-public-header-height, 72px));
    padding: 2rem 0 2.5rem;
  }

  .comunidade-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.86rem;
  }

  .comunidade-hero h1,
  .comunidade-page-title h1,
  .comunidade-topic-detail-header h1 {
    font-size: 2.05rem;
    line-height: 1.03;
  }

  .comunidade-hero p,
  .comunidade-page-title p {
    font-size: 1.0625rem;
    line-height: 1.62;
  }

  .comunidade-hero-actions,
  .comunidade-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .comunidade-primary-link,
  .comunidade-secondary-link,
  .comunidade-small-action,
  .comunidade-primary-button {
    width: 100%;
  }

  .comunidade-section {
    padding: 38px 0;
  }

  .comunidade-section-header-row {
    align-items: stretch;
    flex-direction: column;
  }

  .comunidade-category-grid {
    grid-template-columns: 1fr;
  }

  .comunidade-category-card {
    min-height: 220px;
    padding: 22px;
  }

  .comunidade-topic-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .comunidade-topic-stats {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    white-space: normal;
  }

  .comunidade-topic-detail,
  .comunidade-form-card,
  .comunidade-sidebar-card,
  .comunidade-reply-card {
    padding: 20px;
    border-radius: 22px;
  }

  .comunidade-topic-detail-stats {
    align-items: flex-start;
    flex-direction: column;
  }

  .comunidade-reply-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .comunidade-reply-author {
    align-items: flex-start;
  }

  .comunidade-reply-side {
    width: 100%;
    align-items: flex-start;
  }

  .comunidade-section-header p,
  .comunidade-category-card p,
  .comunidade-topic-card p,
  .comunidade-topic-detail-content,
  .comunidade-topic-detail-content p,
  .comunidade-reply-content,
  .comunidade-reply-content p,
  .comunidade-sidebar-card p,
  .comunidade-check-list li,
  .comunidade-form-card input,
  .comunidade-form-card textarea,
  .comunidade-form-card select {
    font-size: 1.0625rem;
    line-height: 1.62;
  }

  .comunidade-breadcrumb,
  .comunidade-topic-meta,
  .comunidade-topic-stats,
  .comunidade-reply-meta,
  .comunidade-form-card label {
    font-size: 0.875rem;
  }

  .comunidade-primary-link,
  .comunidade-secondary-link,
  .comunidade-small-action,
  .comunidade-primary-button {
    min-height: 50px;
    font-size: 1.0625rem;
    line-height: 1.15;
  }
}
