


/* Add spacing above post sections */
.latest-posts-section,
.all-posts-section {
  margin-top: 40px;
}
/* Categories Section */
.categories-section {
  margin: 48px 0 40px 0;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}
.category-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(75,108,183,0.08);
  padding: 28px 18px 18px 18px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.category-card:hover {
  box-shadow: 0 6px 24px rgba(75,108,183,0.16);
  transform: translateY(-4px) scale(1.03);
}
.category-icon {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}
.category-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #222;
}
.category-card p {
  font-size: 0.98rem;
  color: #6b7280;
}

/* Call to Action Section */
.cta-section {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  color: #fff;
  border-radius: 24px;
  margin: 48px 0 0 0;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.cta-content h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}
.cta-content p {
  font-size: 1.15rem;
  margin-bottom: 28px;
  color: #e0f7fa;
}
.cta-buttons {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Search Section */
.search-section {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}
.search-form {
  display: flex;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 2px 12px rgba(75,108,183,0.08);
  padding: 6px 12px;
  align-items: center;
  width: 100%;
  max-width: 480px;
}
.search-input {
  border: none;
  outline: none;
  font-size: 1.1rem;
  padding: 12px 16px;
  border-radius: 32px;
  flex: 1;
  background: transparent;
}
.search-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-left: 8px;
  transition: background 0.2s;
}
.search-btn:hover {
  background: #128134;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-all {
  color: #4bb75d;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.view-all:hover {
  color: #18482a;
}

/* Posts Grid & Card Styles */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
}
.post-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(75,108,183,0.08);
  padding: 0 0 18px 0;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}
.post-card:hover {
  box-shadow: 0 6px 24px rgba(75,108,183,0.16);
  transform: translateY(-4px) scale(1.02);
}
.post-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #e0e7ff;
  margin-bottom: 12px;
}
.post-content {
  padding: 0 18px;
}
.post-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #222;
}
.post-meta {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 8px;
}
.post-excerpt {
  font-size: 1rem;
  color: #444;
  margin-bottom: 10px;
}
.post-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.post-tag {
  background: #4adfb8;
  color: #fff;
  border-radius: 12px;
  font-size: 0.85rem;
  padding: 2px 10px;
  margin-right: 4px;
}
.post-date {
  font-size: 0.9rem;
  color: #4bb774;
}
@media (max-width: 700px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* Modern Hero Section */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #fff;
  border-radius: 24px;
  padding: 48px 32px;
  margin-bottom: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  gap: 40px;
}
.hero-content {
  max-width: 520px;
}
.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 18px;
  color: #fff;
}
.hero-content .highlight {
  color: #4adfb8;
  position: relative;
}
.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 32px;
  color: #e0f7fa;
}
.hero-actions {
  display: flex;
  gap: 18px;
}
.hero-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-image {
  width: 340px;
  max-width: 100%;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
@media (max-width: 900px) {
  .hero-section {
    text-align: center;
    padding: 32px 10px;
    gap: 24px;
  }
  .hero-visual {
    width: 100%;
  }
  .hero-image {
    width: 90vw;
    max-width: 340px;
  }
}

/* Fixed 3-column layout for Latest Posts on desktop */
.latest-posts-grid-fixed {
  grid-template-columns: repeat(3, 1fr); /* Force 3 columns of equal width */
}

/* Add a responsive break for the fixed grid to ensure it collapses nicely */
@media (max-width: 1200px) {
  .latest-posts-grid-fixed {
    grid-template-columns: repeat(2, 1fr); /* Change to 2 columns on mid-sized screens */
  }
}

@media (max-width: 700px) {
  /* This is already handled by the existing .posts-grid rule,
     but we'll ensure consistency */
  .latest-posts-grid-fixed {
    grid-template-columns: 1fr; /* Change to 1 column on mobile */
  }
}

/* ... existing home.css content ... */

/* Posts Grid & Card Styles */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); /* THIS CAUSES THE STRETCH */
  gap: 24px;
}
/* Fixed 3-column layout for Latest Posts on desktop */
.latest-posts-grid-fixed {
  grid-template-columns: repeat(3, 1fr); /* Force 3 columns of equal width */
}
/* ... existing post-card styles ... */

@media (max-width: 1200px) {
  /* Add a responsive break for the fixed grid to ensure it collapses nicely */
  .latest-posts-grid-fixed {
    grid-template-columns: repeat(2, 1fr); /* Change to 2 columns on mid-sized screens */
  }
}

@media (max-width: 700px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  /* Ensure fixed grid also collapses */
  .latest-posts-grid-fixed {
    grid-template-columns: 1fr; /* Change to 1 column on mobile */
  }
}
/* ... rest of home.css content ... */

/* Generic grid container settings */
.posts-grid {
  display: grid;
  gap: 24px;
}

/* Rule for All Posts (or any section that should not stretch a single item) */
.all-posts-grid-responsive {
  /* Use a fixed maximum width (e.g., 3 columns) but allow fewer to prevent stretch. */
  /* This setting uses auto-fit but prevents stretching past 3 columns. */
  grid-template-columns: repeat(auto-fit, minmax(270px, 340px));
  /* A simpler, better alternative if you want it to look like the Latest Posts section: */
  /* grid-template-columns: repeat(3, 1fr); */
}

/* Fixed 3-column layout for Latest Posts on desktop (from previous step, keeping it simple) */
.latest-posts-grid-fixed {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive overrides for the 'latest-posts-grid-fixed' (from previous step) */
@media (max-width: 1200px) {
  .latest-posts-grid-fixed {
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (max-width: 700px) {
  .latest-posts-grid-fixed {
    grid-template-columns: 1fr; 
  }
}

/* Apply the same responsive overrides to the 'all-posts-grid-responsive' if using 1fr units */
@media (max-width: 1200px) {
  .all-posts-grid-responsive {
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (max-width: 700px) {
  .all-posts-grid-responsive {
    grid-template-columns: 1fr; 
  }
}

/* ---------------------------
   MOBILE HERO + TYPOGRAPHY TWEAKS
   (applies only to small screens)
   --------------------------- */

@media (max-width: 700px) {

  /* overall main content padding for small phones */
  .main-content {
    padding: 14px !important;
  }

  /* Hero box tighter */
  .hero-section {
    padding: 22px 16px;
    border-radius: 16px;
    gap: 20px;
  }

  .hero-content {
    max-width: 100%;
    text-align: left;
    width: 100%;
  }

  /* smaller brand + headline */
  .hero-content h1 {
    font-size: 1.25rem; /* smaller */
    line-height: 1.1;
    margin-bottom: 8px;
    font-weight: 800;
  }

  .hero-content .highlight {
    font-size: 1.35rem;
    display: inline-block;
  }

  .hero-content p {
    font-size: 0.95rem; /* smaller subtitle */
    margin-bottom: 12px;
  }

  .hero-actions {
    gap: 10px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  .hero-actions .btn {
    font-size: 0.92rem;
    padding: 8px 12px;
    border-radius: 999px;
  }

  /* Visual / avatar */
  .hero-visual {
    width: auto;
    display: flex;
    justify-content: center;
  }
  .hero-image {
    width: 140px;
    height: auto;
    border-radius: 12px;
  }

  /* reduce post card image height so first post is visible under hero */
  .post-card .post-image {
    height: 120px;
  }

  /* smaller card text */
  .post-title { font-size: 1rem; }
  .post-excerpt { font-size: 0.95rem; }
  .post-meta { font-size: 0.85rem; }

  /* margins between sections to reduce scrolling */
  .latest-posts-section,
  .all-posts-section {
    margin-top: 18px;
  }

  /* posts grid spacing a bit tighter */
  .posts-grid {
    gap: 14px;
  }

  /* shrink the search input a little */
  .search-form { padding: 6px 10px; }
  .search-input { font-size: 0.95rem; padding: 10px 12px; }

  /* reduce section header size */
  .section-header h2 { font-size: 1.05rem; }

  /* ensure bottom nav does not overlap hero area */
  main.main-content {
    padding-bottom: 110px; /* leave space for bottom nav */
  }

  /* Typography fine-tune: slightly smaller base text */
  body { font-size: 14px; }
}

/* Additional tweak for slightly larger phones/tablets */
@media (min-width: 701px) and (max-width: 992px) {
  .hero-section { padding: 22px 18px; border-radius: 16px; }
  .hero-content h1 { font-size: 1.6rem; }
  .hero-content p { font-size: 1rem; }
  .hero-image { width: 250px; }
  .post-card .post-image { height: 140px; }
  body { font-size: 15px; }
}

@media (max-width: 700px) {

  /* HERO LAYOUT – KEEP EVERYTHING IN ONE ROW */
  .hero-section {
    flex-direction: row;              /* ✅ TEXT + IMAGE SIDE BY SIDE */
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    gap: 10px;                         /* ✅ small gap only */
    border-radius: 12px;
  }

  /* TEXT AREA */
  .hero-content {
    flex: 1;                           /* ✅ text takes remaining space */
    max-width: calc(100% - 110px);
  }

  .hero-content h1 {
    font-size: 1.55rem;
    line-height: 1.1;
    margin-bottom: 6px;
  }

  .hero-content p {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }

  /* IMAGE AREA – REMOVE EXTRA GAP */
  .hero-visual {
    flex-shrink: 0;                    /* ✅ do NOT shrink too much */
    width: auto;
    margin: 0;                         /* ✅ remove unwanted space */
    padding: 0;
    display: flex;
    align-items: center;
  }

  .hero-image {
    width: 250px;                       /* ✅ fixed readable size */
    min-width: 120px;                   /* ✅ prevents over-shrinking */
    height: auto;
    border-radius: 10px;
    margin: 0;                         /* ✅ kill extra gap */
  }
}

/* PREVENT HERO IMAGE FROM SHRINKING ON TABLET/DESKTOP */
.hero-visual {
  flex-shrink: 0;           /* ✅ stops rapid shrinking */
}

.hero-image {
  width: 320px;             /* ✅ stable desktop size */
  max-width: 320px;
}
@media (max-width: 1200px) {
  .hero-image {
    width: 200px;
    max-width: 260px;
  }
}

@media (max-width: 992px) {
  .hero-image {
    width: 200px;
    max-width: 200px;
  }
}

/* ======================================
   VERY SMALL DEVICES (iPhone XR & below)
   ====================================== */

@media (max-width: 420px) {

  .hero-section {
    gap: 8px;
    padding: 12px;
  }

  /* Reduce text slightly */
  .hero-content h1 {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .hero-content .highlight {
    font-size: 1.2rem;
  }

  

  .hero-content p {
    font-size: 0.82rem;
  }

  /* ✅ HARD LIMIT IMAGE SIZE */
  .hero-image {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
  }

  /* ✅ Let text breathe */
  .hero-content {
    max-width: calc(100% - 120px);
  }
}

.hero-image {
  width: clamp(100px, 22vw, 320px);
  height: auto;
  flex-shrink: 0;
}

/* Channel tag styling */
.post-tag.channel-tag {
  background: #fff3e0;
  color: #8a4b00;
  border: 1px solid rgba(138, 75, 0, 0.25);
  font-weight: 500;
}


@media (max-width: 992px) {
    .mobile-top-bar {
        display: flex;
        pointer-events: auto;
        padding-right: -56px;
    }
}

