/* Community News — layout matches Events Gallery */
:root {
  --cn-green: #0e7a3e;
  --cn-blue: #00aeef;
  --cn-ink: #0f172a;
  --cn-muted: #64748b;
  --cn-border: #e2e8f0;
  --cn-card: #ffffff;
}

.cn-page {
  min-height: 60vh;
  background: transparent;
}

.cn-directory {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}

.cn-hero {
  background: #fff;
  border-radius: 16px;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 1.1rem 1.35rem;
  border-left: 4px solid #059669;
}
.cn-hero-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 52rem;
}
.cn-hero-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #059669 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.cn-hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e3a8a;
  margin: 0 0 0.2rem;
  line-height: 1.25;
}
.cn-hero-subtitle {
  font-size: 0.92rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.cn-admin-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.cn-btn-manage {
  background: var(--cn-ink);
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.cn-btn-manage.is-on {
  background: linear-gradient(135deg, var(--cn-green), var(--cn-blue));
}

.cn-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .cn-layout { grid-template-columns: 1fr; }
}

.cn-sidebar {
  background: var(--cn-card);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}
@media (max-width: 768px) {
  .cn-sidebar { position: static; max-height: none; }
}
.cn-sidebar h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cn-muted);
  margin: 0 0 0.75rem;
  font-weight: 800;
}
.cn-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cn-news-list li { margin-bottom: 0.25rem; }
.cn-news-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--cn-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}
.cn-news-btn:hover { background: #f1f5f9; }
.cn-news-btn.is-active {
  background: linear-gradient(135deg, rgba(14, 122, 62, 0.12), rgba(0, 174, 239, 0.1));
  color: var(--cn-green);
  font-weight: 800;
}
.cn-news-btn .cn-pill {
  font-size: 0.7rem;
  color: var(--cn-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.cn-news-btn.is-active .cn-pill {
  background: rgba(14, 122, 62, 0.15);
  color: var(--cn-green);
}

.cn-main {
  background: var(--cn-card);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  padding: 1.25rem 1.5rem 1.5rem;
  min-height: 320px;
}

.cn-card-title {
  text-align: center;
  font-weight: 900;
  font-size: 1.45rem;
  color: var(--cn-ink);
  margin: 0.25rem 0 0.85rem;
}
.cn-card-meta {
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--cn-border);
}
.cn-card-date {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}
.cn-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 0.85rem;
}
.cn-social {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cn-comment-count {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.cn-card-actions .pf-share-panel {
  display: inline-flex;
}
.cn-like-btn {
  border: 1px solid var(--cn-border);
  background: #fff;
  color: var(--cn-ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cn-like-btn.is-liked { color: #dc2626; }

.cn-body {
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.75;
  word-break: break-word;
}
.cn-body h1, .cn-body h2, .cn-body h3 {
  color: #0f172a;
  font-weight: 900;
  line-height: 1.25;
  margin: 1rem 0 0.65rem;
}
.cn-body ul, .cn-body ol { margin: 0.5rem 0 0.5rem 1.25rem; }
.cn-body a,
.cn-editor-area a {
  color: #0e7a3e;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cn-body a:hover,
.cn-editor-area a:hover {
  color: #065f46;
}

#cn-images-inline::after {
  content: '';
  display: block;
  clear: both;
}

.cn-card-footer {
  margin-top: 1.5rem;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--cn-border);
  text-align: center;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfeff 100%);
  border-radius: 12px;
}
.cn-card-footer--hidden {
  display: none !important;
}
.cn-card-footer-lead {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.cn-feedback-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #0e7a3e 0%, #00aeef 100%);
  box-shadow: 0 4px 14px rgba(14, 122, 62, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cn-feedback-cta:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 122, 62, 0.28);
}

.cn-img {
  border-radius: 14px;
  background: #e2e8f0;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.cn-img img {
  width: 100%;
  height: auto;
  max-height: min(70vh, 560px);
  display: block;
  object-fit: contain;
  object-position: center;
}
.cn-img--top { margin: 0 0 1rem; }
.cn-img--center { margin: 1rem auto; max-width: 760px; }
.cn-img--left, .cn-img--right {
  max-width: min(340px, 48%);
  margin: 0.35rem 1rem 0.75rem 0;
}
.cn-img--right { float: right; margin: 0.35rem 0 0.75rem 1rem; }
.cn-img--left { float: left; }
@media (max-width: 640px) {
  .cn-img--left, .cn-img--right {
    float: none;
    max-width: 100%;
    margin: 0.85rem 0;
  }
}

.cn-carousel {
  --cn-carousel-height: 280px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #e2e8f0;
  content-visibility: auto;
}
.cn-carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.cn-carousel-nav span {
  display: block;
  margin-top: -0.12rem;
}
.cn-carousel-nav:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}
.cn-carousel-nav:active {
  transform: translateY(-50%) scale(0.96);
}
.cn-carousel-nav:focus-visible {
  outline: 2px solid #0e7a3e;
  outline-offset: 2px;
}
.cn-carousel-nav--prev { left: 0.65rem; }
.cn-carousel-nav--next { right: 0.65rem; }
@media (max-width: 640px) {
  .cn-carousel-nav {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.45rem;
  }
  .cn-carousel-nav--prev { left: 0.4rem; }
  .cn-carousel-nav--next { right: 0.4rem; }
}
.cn-carousel:not(.cn-carousel--ready) {
  min-height: var(--cn-carousel-height);
}
.cn-carousel-track {
  display: flex;
  width: 100%;
  min-height: var(--cn-carousel-height);
  transition: transform 0.45s ease;
  will-change: transform;
}
.cn-carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cn-carousel-height);
}
.cn-carousel-slide .cn-img {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cn-carousel-height);
}
.cn-carousel-slide .cn-img img {
  width: 100%;
  height: auto;
  max-height: var(--cn-carousel-height);
  object-fit: contain;
  object-position: center;
}

/* Comments area */
.cn-comments {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cn-border);
}
.cn-comments h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 900;
  color: #0f172a;
}
.cn-comment-list {
  display: grid;
  gap: 0.65rem;
}
.cn-comment-item {
  border: 1px solid var(--cn-border);
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.cn-comment-meta {
  font-size: 0.8rem;
  color: var(--cn-muted);
  margin-bottom: 0.25rem;
}
.cn-comment-meta strong { color: #0f172a; }
.cn-comment-body { font-size: 0.95rem; line-height: 1.55; color: #334155; }
.cn-comment-body ul, .cn-comment-body ol { margin: 0.35rem 0 0.35rem 1.1rem; }
.cn-comment-actions { margin-top: 0.45rem; }
.cn-comment-like-btn {
  border: 1px solid var(--cn-border);
  background: #fff;
  color: var(--cn-ink);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.cn-comment-like-btn.is-liked { color: #dc2626; }
.cn-comment-item--pending { border-color: #fde68a; background: #fffbeb; }
.cn-comment-item--rejected { opacity: 0.75; }
.cn-badge-pending {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  margin-left: 0.25rem;
}
.cn-comment-pending-note {
  font-size: 0.8rem;
  color: #92400e;
  font-weight: 700;
}

.cn-pending-panel {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #fde68a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.cn-pending-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 900;
  color: #92400e;
}
.cn-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.cn-pending-item {
  padding: 0.75rem;
  border: 1px solid var(--cn-border);
  border-radius: 12px;
  background: #fffbeb;
}
.cn-pending-preview {
  display: block;
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.45;
}
.cn-pending-news {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 700;
}
.cn-pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.cn-pending-empty {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
}

.cn-rt {
  border: 1px solid var(--cn-border);
  border-radius: 12px;
  background: #fff;
  overflow: visible;
}
.cn-rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--cn-border);
  position: relative;
}
.cn-rt-toolbar button {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}
.cn-rt-editor {
  min-height: 88px;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  outline: none;
}
.cn-rt-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}
.cn-comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  font-weight: 900;
  background: #1d4ed8;
  border: 2px solid #1e3a8a;
  color: #fff;
  cursor: pointer;
}
.cn-comment-submit:hover { background: #1e40af; border-color: #172554; }

.cn-login-prompt {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--cn-border);
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
}
.cn-login-prompt a {
  color: #0e7a3e;
  font-weight: 700;
  text-decoration: none;
}
.cn-login-prompt a:hover { text-decoration: underline; }

.cn-comment-moderation-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
}

/* Admin panel (inline) */
.cn-admin-panel {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px dashed var(--cn-border);
  border-radius: 14px;
}
body.cn-admin-mode .cn-admin-panel { display: block; }
.cn-admin-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.cn-admin-row input[type="text"], .cn-admin-row select {
  flex: 1;
  min-width: 160px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--cn-border);
  border-radius: 10px;
  background: #fff;
}
.cn-admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.cn-btn {
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--cn-border);
  background: #fff;
}
.cn-btn-primary { background: var(--cn-green); border-color: var(--cn-green); color: #fff; }
.cn-btn-danger { color: #b91c1c; border-color: #fecaca; }
.cn-admin-help { font-size: 0.82rem; color: var(--cn-muted); margin: 0 0 0.75rem; }

/* News editor rich text */
.cn-editor {
  border: 1px solid var(--cn-border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.cn-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.6rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--cn-border);
}
.cn-editor-toolbar button, .cn-editor-toolbar select {
  padding: 0.3rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}
.cn-editor-area {
  min-height: 220px;
  padding: 0.75rem 0.85rem;
  outline: none;
  font-size: 1rem;
  line-height: 1.7;
}
.cn-editor-area:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.cn-image-admin {
  display: grid;
  gap: 0.5rem;
}
.cn-image-chip {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  background: #fff;
  border: 1px solid var(--cn-border);
  border-radius: 12px;
}
.cn-image-chip img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
}
.cn-image-chip select { width: 100%; }
.cn-image-chip .cn-btn { justify-self: start; }

