/* =========================
   GLOBAL FIX (NO HEADER JUMP)
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f7fa;
}

body.community-page {
  padding-top: 70px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.container {
  flex: 1;
}

/* =========================
   HEADER (FIXED STABLE)
========================= */
.blue-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

.blue-header .container {
  max-width: 1200px;
  width: 100%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  color: var(--white);
  font-weight: 700;
  font-size: 1.3rem;
}

.blue-header nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.blue-header nav a {
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: 0.2s ease;
}

.blue-header nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.blue-header nav a.active {
  background: var(--white);
  color: var(--primary);
}

/* =========================
   HERO
========================= */
.hero {
  padding: 80px 20px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #f0f7ff);
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
}

.hero p {
  max-width: 750px;
  margin: auto;
  color: var(--muted);
}
/* =========================
   MAIN CONTAINER
========================= */
.container {
  max-width: 1280px;
  margin: 30px auto;
  padding: 0 15px;
}

h1 {
  color: #0078d4;
  margin-bottom: 5px;
  font-size: 2rem;
}

.sub {
  color: #4b5563;
  margin-bottom: 2rem;
  border-left: 4px solid #0078d4;
  padding-left: 1rem;
}

/* =========================
   TOOLBAR (FILTER + SEARCH)
========================= */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: white;
  padding: 0.8rem 1.25rem;
  border-radius: 60px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.filter-chip {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  padding: 0.4rem 1rem;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: #0078d4;
  border-color: #0078d4;
  color: white;
}

.filter-chip:hover:not(.active) {
  background: #e6f2fc;
  border-color: #0078d4;
  color: #0078d4;
}

.search-box {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 2rem;
  padding: 0.3rem 0.8rem;
  transition: all 0.2s;
}
.search-box input {
  background: transparent;
  border: none;
  padding: 0.55rem 0.5rem;
  font-size: 0.9rem;
  color: #1f2937;
  outline: none;
  width: 200px;
}
.search-box input::placeholder {
  color: #9ca3af;
}
.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 1rem;
  font-weight: bold;
  padding: 0 4px;
}
.clear-search:hover {
  color: #0078d4;
}

/* =========================
   FEED CARDS (GRID)
========================= */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
  margin-top: 0.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #0078d4;
  box-shadow: 0 20px 25px -12px rgba(0, 120, 212, 0.15);
}

.card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: #111827;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.category-tag {
  background: #eef2ff;
  color: #1e40af;
  padding: 0.25rem 0.85rem;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.post-date {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.excerpt {
  color: #374151;
  margin: 0.5rem 0 1rem;
  line-height: 1.5;
  font-size: 0.9rem;
  flex-grow: 1;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #0078d4;
  text-decoration: none;
  margin-top: 0.75rem;
  transition: gap 0.2s;
}

.read-link:hover {
  gap: 0.75rem;
  text-decoration: underline;
}

/* =========================
   SKELETON LOADING
========================= */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}
.skeleton-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  animation: pulse 1.2s infinite;
}
.skeleton-title {
  height: 28px;
  background: #e5e7eb;
  border-radius: 12px;
  width: 80%;
  margin-bottom: 1rem;
}
.skeleton-meta {
  height: 20px;
  background: #e5e7eb;
  border-radius: 20px;
  width: 40%;
  margin-bottom: 1rem;
}
.skeleton-text {
  height: 60px;
  background: #e5e7eb;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.skeleton-button {
  height: 32px;
  background: #e5e7eb;
  border-radius: 30px;
  width: 30%;
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.empty-state, .error-state {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 2rem;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}
.retry-btn {
  background: #0078d4;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 40px;
  margin-top: 1rem;
  cursor: pointer;
  font-weight: 600;
}

/* =========================
   FOOTER (YOUR BLUE STYLE)
========================= */
.site-footer {
  background: #0078d4;
  color: #fff;
  margin-top: auto;
  padding: 18px 0;
}
.footer-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}
.footer-links a {
  color: #0078d4;
  margin-left: 10px;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
  color: #0078d5;
}
.site-footer p,
.site-footer a {
  color: #0078d4 !important;
}
.site-footer a {
  opacity: 0.9;
}
.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 680px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 1.5rem;
  }
  .search-box input {
    width: 100%;
  }
  .category-filters {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
}