/* ====== Hero ====== */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    background: #f0f0f0;
}
.hero img {
    max-width: 53%;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.hero h2 {
    font-size: 34px;
}

/* ====== About ====== */
.about {
    max-width: 1100px;
    margin: 30px auto;
    padding: 2rem 1rem;
    background: #fff;
    text-align: center;
}
.about-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.about-item {
    flex: 1 1 200px;
    margin: 0.5rem;
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
}

.about-item h4 {
    font-size: 20px;
}

.about-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
}
.about-text {
    text-align: center;
    max-width: 1100px;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 40px 0;
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
}

/* ====== Latest Stories ====== */
.latest-stories {
    padding: 3rem 1rem;
    background: #f0f0f0;
}
.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.story-search {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
}
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    min-height: 600px;
    max-height: 900px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .hero img {
        width: 100%;
        max-width: 500px;
    }
    .hero h2 {
        font-size: 36px;
        line-height: 1;
    }
    .about-grid {
        flex-direction: column;
    }
}

/* Tablet: reduce to 2 columns */
@media (max-width: 1024px) {
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    overflow-x: hidden; /* stop horizontal scroll */
    overflow-y: auto;   /* keep vertical scroll */
    padding-right: 0.5rem;
  }
}

/* Mobile: single column */
@media (max-width: 640px) {
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    overflow-x: hidden;
    overflow-y: auto;   /* keep the vertical scroll active */
    max-height: 900px;  /* keep your scroll window size */
    padding-right: 0.5rem;
  }
  
  .stories-header {
    flex-direction: column;
    align-items: stretch;  /* full-width inputs */
    gap: 0.5rem;           /* space between dropdown and search */
  }

  .story-search,
  .stories-header select {
    width: 100%;
    min-width: 0;          /* override the 200px minimum */
    box-sizing: border-box;
  }
}
