/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BODY ===== */
body {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  background: #f9f9f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Push footer to bottom when content is short */
#footer {
  margin-top: auto;
}

.menu-toggle,
.menu-close {
  display: none;
}

/* ===== CONTAINER ===== */

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ===== TITLE ===== */

.page-title {
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 30px;
  /* color: #1e3a8a; */
  color: #2f6f3e;
}

/* ===== FILTER ===== */

.filter-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 25px;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-container label {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.filter-container select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
  cursor: pointer;
  font-size: 14px;
  max-width: 100%;
}

.filter-container select:focus {
  border: 1px solid #2f6f3e;
  box-shadow: 0 0 0 2px rgba(47, 111, 62, 0.15);
}

/* ===== GRID ===== */

.stories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 25px;
}

/* ===== CARD ===== */

.story {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: 0.3s ease;
}

/* .story:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
} */

/* ===== IMAGE ===== */

.story img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* ===== CONTENT ===== */

.story-content {
  padding: 15px;
}

.story-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.story-title a {
  text-decoration: none;
  color: #1e3a8a;
}

.story-title a:hover {
  text-decoration: underline;
}

.story-category {
  font-size: 12px;
  margin-bottom: 10px;
}

/* ===== BUTTON ===== */

.story-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: #1b8f3a;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  text-decoration: none;
}

/* ===== PAGINATION ===== */

.pagination {
  text-align: center;
  margin-top: 30px;
}

button {
  padding: 10px 18px;
  border: none;
  background: #1e3a8a;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  margin: 5px;
}

button:disabled {
  background: #ccc;
}

/* ===== LIGHTBOX ===== */

/* .lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
} */

/* IMAGE */

/* .lightbox-content {
  display: block;
  margin: auto;
  max-width: 80%;
  max-height: 80%;
  border-radius: 8px;

  border: 1.5px solid #ffffff;
} */

/* CAPTION */

#caption {
  margin: 15px auto;
  text-align: center;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

/* CLOSE BUTTON */

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #ffffff;
  font-size: 35px;
  cursor: pointer;
  transition: 0.2s;
}

.close:hover {
  color: #dddddd;
}

/* ===== FOOTER ===== */

.footer {
  background: #0f172a;
  color: #fff;
  margin-top: 60px;
  padding: 40px 20px;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer p {
  font-size: 14px;
  line-height: 1.6;
}

.footer a {
  display: block;
  text-decoration: none;
  color: #cbd5f5;
  margin-bottom: 8px;
  font-size: 14px;
  transition: 0.3s;
}

.footer a:hover {
  color: #ffffff;
}

.footer-icons p {
  margin-bottom: 8px;
  font-size: 14px;
}

.footer-icons i {
  margin-right: 8px;
  color: #38bdf8;
}

.repo-layout {
  display: flex;
  gap: 30px;
  margin-top: 30px;
}

.categories {
  width: 220px;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
}

.categories ul {
  list-style: none;
  padding: 0;
}

.categories li {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
  font-weight: 500;
}

.categories li:hover {
  background: #e7f0ff;
}

.content-area {
  flex: 1;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.pdf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.pdf-list a {
  text-decoration: none;
  color: #1a4ed8;
  font-weight: 500;
}

.gallery-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: none;
  background: #eaeaea;
  cursor: pointer;
  border-radius: 20px;
  font-weight: 500;
}

.filter-btn.active {
  background: #1e3a8a;
  color: white;
}

/* RESOURCE CARD STYLE */

.simple-link {
  margin-bottom: 12px;
  /* display: grid;
  grid-template-columns: repeat(3, fr); */
}

.simple-link a {
  display: block;
  /* padding-bottom: 10px; */
  padding: 12px 14px;
  /* background: #f3f4f6; */
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  font-weight: 500;
  transition: 0.3s ease;
}

.simple-link a:hover {
  /* background: #1e3a8a; */
  /* color: #fff; */
  transform: translateX(5px);
}

/* ===== FIX CARD UNIFORM SIZE ===== */

.story {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Top section (image / pdf / thumbnail) */
.story img,
.pdf-thumb,
.resource-thumb {
  width: 100%;
  /* height: 180px; */
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}

/* Fix PDF canvas specifically */
.pdf-thumb {
  border-bottom: 1px solid #eee;
}

/* Content area should stretch equally */
.story-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Title fix (same height for all cards) */
.story-title {
  min-height: 40px;
  font-size: 15px;
  line-height: 1.3;
}

/* Button always bottom aligned */
.story-btn {
  align-self: flex-start;
}

/* resources link css */

.resource-links-wrapper {
  padding: 20px;
}

.resource-heading {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
}

.resource-list {
  list-style: disc;
  padding-left: 25px;
}

.resource-list li {
  margin-bottom: 10px;
}

.resource-list a {
  text-decoration: none;
  color: #2563eb;
  font-weight: 500;
}

/* 🔥 REMOVE GRID ONLY FOR RESOURCE LINKS */
.stories.links-mode {
  display: block !important;
}

/* .resource-list a:hover {
  text-decoration: underline;
} */

/* PDF embed preview for report cards */
.pdf-preview {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f3f4f6;
  border-bottom: 1px solid #eee;
  pointer-events: none;
}

.pdf-preview embed {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== BACK BUTTON & BREADCRUMBS ===== */
.back-btn-container {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  gap: 15px;
  animation: fadeIn 0.3s ease;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background-color: #ffffff;
  color: #2f6f3e;
  border: 1.5px solid #2f6f3e;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.back-btn:hover {
  background-color: #2f6f3e;
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(47, 111, 62, 0.15);
}

.back-btn i {
  font-size: 13px;
  transition: transform 0.25s ease;
}

.back-btn:hover i {
  transform: translateX(-3px);
}

.breadcrumb-path {
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-path .parent {
  color: #888;
}

.breadcrumb-path .separator {
  color: #ccc;
}

.breadcrumb-path .current {
  font-weight: 600;
  color: #2f6f3e;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .stories {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .story {
    width: 100%;
  }

  .pdf-preview {
    height: 350px; /* increase from 220px */
  }

  .story img,
  .pdf-thumb,
  .resource-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f5f5f5;
  }

  .pdf-preview embed {
    width: 100%;
    height: 100%;
    display: block;
  }

  .story-content {
    padding: 15px;
  }

  .story-title {
    min-height: auto;
    font-size: 18px;
    line-height: 1.4;
  }

  .story-btn {
    margin-top: 12px;
  }

  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-container select {
    width: 100%;
  }
}
