@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Mukta', Helvetica, sans-serif;
  background-color: #f5efd9;
  color: #2c1a08;
}

 body, .story-title, .story-content {
     font-family: 'Mukta', sans-serif;
}



a {
  color: #5a2e00;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== Header Section ===== */
header {
  background-color: #fff6e0;
  padding: 10px 20px;
  border-bottom: 2px solid #a86f38;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo .banner {
  font-size: 24px;
  font-weight: bold;
}

header .logo img {
    height: 40px !important;  /* force height to 40px */

    object-fit: contain;      /* ensures it scales correctly */
}


.logo p {
  font-size: 14px;
  color: #6e4e2e;
}

/* ===== NAVIGATION ===== */
nav {
  background-color: #8c4b15; /* Theme color */
  padding: 10px 0;
  position: relative;
  text-align: center;
}

#nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  margin: 0;
  padding: 0;
  z-index: 9999;
}

#nav-menu li a {
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
}
#nav-menu li a:hover {
  text-decoration: underline;
}

/* 🔥 When mobile menu opens, animate category bar out */
#nav-menu.show ~ .category-scroll-wrapper {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.category-scroll-wrapper {
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1), opacity 0.25s ease;
}



/* ===== SEARCH BOX STYLES ===== */
.search-container {
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: #fff;
  border-radius: 25px;
  padding: 3px 8px;
  margin-top: 10px;
}

.search-box-wrapper {
  display: flex;
  gap: 5px;
  align-items: center;
  width: 100%;
}

.search-box-wrapper input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 25px;
  border: none;
  outline: none;
  font-size: 14px;
}

.search-box-wrapper .search-btn {
  background-color: #8c4b15;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
}

/* ===== MOBILE NAV CONTROLS ===== */
.mobile-nav-controls {
  display: none;
  justify-content: space-between;
  align-items: center;
  background-color: #8c4b15;
  padding: 0px 15px;
}

.menu-toggle,
.search-toggle {
  background: none;
  border: none;
  font-size: 26px;
  color: white;
  cursor: pointer;
}

/* ===== MOBILE SEARCH CONTAINER ===== */
.search-container.mobile-search {
  display: none;
  width: 100%;
  padding: 10px 0;
  background-color: #fff6e0;
}

.search-container.mobile-search.active {
  display: block;
}

/* ===== MAIN CONTENT ===== */
main {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  padding: 20px;
  width: 80%;
  margin: auto;
  background-color: #fffaf0;
}

.latest-stories h1,
.sidebar-section h3 {
  background-color: #8c4b15;
  color: white;
  padding: 5px 10px;
  font-size: 18px;
  margin-bottom: 10px;
}

.story-box {
  background-color: #FFFEFA;
  padding: 15px;
  border: 1px solid #d4b992;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.story-box h2 {
/*  font-size: 20px;*/
  font-size: 35px;
  font-weight: bold;
  margin-bottom: 5px;
  line-height: 1.2;
}

.story-meta {
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.short-description {
  font-size: 16px;
  margin-bottom: 15px;
  color: #443322;
}

.story-content{
  font-size: 20px;
}

/*----------------------------------------------------Pagination-------------------------------------*/

.pagination-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
  text-align: center;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-btn {
  padding: 10px 14px;
  min-width: 42px;
  background-color: #f4f4f4;
  color: #333;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.page-btn:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}

.page-btn.active {
  background-color: #b84d16;
  color: white;
  border-color: #b84d16;
  font-weight: bold;
}

.page-ellipsis {
  padding: 10px;
  color: #999;
  font-size: 18px;
}

.jump-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jump-form input[type="number"] {
  padding: 8px 10px;
  width: 90px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fafafa;
}

.jump-form input[type="number"]:focus {
  border-color: #007BFF;
  background-color: #fff;
  outline: none;
}

.jump-form button {
  padding: 8px 14px;
  font-size: 15px;
  background-color: #007BFF;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.jump-form button:hover {
  background-color: #0056b3;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.page-btn {
  padding: 8px 14px;
  background-color: #f1f1f1;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  transition: 0.3s ease;
}

.page-btn.active,
.page-btn:hover {
  background-color: #ca6524;
  color: #fff;
}

.jump-to-page-container {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 6px;
}

.jump-input {
  padding: 6px 10px;
  width: 100px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px; /* Rounded corners only on the left side */
  /*border-right: none;  Remove the right border to make it seamless with the button */
}

.jump-button {
  padding: 6px 12px;
  font-size: 16px;
  background-color: #8c4b15;
  color: white;
  border: 1px solid #ccc;
  border-radius: 0 4px 4px 0; /* Rounded corners only on the right side */
  cursor: pointer;
  height: 40px;
  border-left: none; /* Remove the left border to make it seamless with the input */
}

/* Toast */
.toast {
  visibility: hidden;
  min-width: 180px;
  background-color: #e74c3c;
  color: white;
  text-align: center;
  border-radius: 4px;
  padding: 10px;
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 14px;
  transition: visibility 0s, opacity 0.4s ease-in-out;
  opacity: 0;
}

.toast.show {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 768px) {
  .pagination-controls a,
  .page-ellipsis {
    display: none;
  }
  .pagination-controls a.page-btn.active,
  .pagination-controls a.page-btn:first-child,
  .pagination-controls a.page-btn:last-child,
  .pagination-controls a.page-btn[href*="page=<?= $current_page - 1 ?>"],
  .pagination-controls a.page-btn[href*="page=<?= $current_page + 1 ?>"] {
    display: inline-block;
  }
  /* Hide pagination by default on mobile */
@media (max-width: 768px) {
  .pagination-controls .page-btn,
  .pagination-controls .page-ellipsis {
    display: none;
  }

  /* Show only important ones on mobile */
  .pagination-controls .page-btn.mobile-show {
    display: inline-block;
  }
}

}

/* ===== PAGINATION ONLY ===== */
.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pg-btn {
  padding: 8px 14px;
  background-color: #f1f1f1;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

.pg-btn.active,
.pg-btn:hover {
  background-color: #ca6524;
  color: #fff;
}

.pg-ellipsis {
  padding: 8px 10px;
  color: #999;
  font-size: 18px;
}

/* ✅ MOBILE ONLY */
@media (max-width: 768px) {

  /* Hide all pagination buttons */
  .pagination-controls .pg-btn {
    display: none;
  }

  /* Show only selected ones */
  .pagination-controls .pg-btn.mobile-show {
    display: inline-block;
  }

  /* Always show dots */
  .pagination-controls .pg-ellipsis {
    display: inline-block;
  }
}


/*----------------------------------------------------Realted Story-------------------------------------*/
  .story-link-box {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 0px 20px;
  margin: -20px auto -70px;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  font-size: 18px;
  color: #333;
  line-height: 1.3;
}

.story-text {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.story-link {
  display: inline-block;
  background-color: #e9f2ff; /* Highlighted by default */
  color: #084298;
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.story-link:hover {
  background-color: #d6e9ff;
  text-decoration: underline;
}

/* ✅ Responsive: Break into 2 lines on mobile */
@media (max-width: 600px) {
  .story-text {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-link {
    margin-top: 6px;
    font-size: 15px;
  }

  .story-link-box {
    padding: 0px 16px;
    font-size: 15px;
  }
}

/*--------------------------------------------------------------------------------------------------------------------*/

.category-tag,
  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 20px;
  }

.tags a {
  font-size: 11px;
  margin-bottom: 7px;
}

.category-tag span {
  /*background-color: #eee2d0;*/
  background-color: #eee2d0;
  padding: 5px 10px;
  border-radius: 5px;
  color: #4c2f0b;

}

.tags span {
  background-color: #F0EEE8;
  padding: 5px 10px;
  border-radius: 5px;
  color: #4c2f0b;

}


.read-button {
  background-color: #5c2d0b;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  align-self: flex-end;
  text-align: center;
}
.read-button:hover {
  background-color: #3c1d04;
}

.sidebar {
  background-color: #fff8e6;
  padding: 10px;
  border-left: 2px solid #d8c1a3;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section ul {
  list-style: none;
  padding-left: 0;
}

.sidebar-section li {
  margin-bottom: 8px;
}

.sidebar-section a {
  color: #8c3a00;
  font-weight: 600;
}

.ads-placeholder {
  width: 100%;
  height: 320px;
  background-color: #e4d4b7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a88;
  font-weight: bold;
  margin-bottom: 20px;
}


.story-box {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.story-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/*.short-description {*/
/*  max-height: 105px;*/
/*  overflow: hidden;*/
/*  position: relative;*/
/*}*/
/*.short-description::after {*/
/*  content: "";*/
/*  position: absolute;*/
/*  bottom: 0; left: 0;*/
/*  width: 100%;*/
/*  height: 25px;*/
/*  background: linear-gradient(to top, #FFFEFA, transparent);*/
/*}*/



footer {
  background-color: #42210b;
  color: #f5e8d8;
  padding: 30px 20px 10px;
  font-size: 15px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  max-width: 1600px;
  margin: auto;
}

.footer-section {
  flex: 1 1 250px;
}

.footer-section h4 {
  font-size: 19px;
  margin-bottom: 10px;
  color: #ffd8a9;
  border-bottom: 1px solid #a86f38;
  padding-bottom: 5px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 8px;
}

.footer-section a {
  color: #ffddb0;
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #7a4a2c;
  position: relative;
}

#scrollTopBtn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffb366;
  color: #2c1a08;
  border: none;
  padding: 8px 14px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

#scrollTopBtn:hover {
  background-color: #ffaa33;
}

/* =======================================================
   🧱 UPDATED SIDEBAR STYLE (Unified with Story Page)
   ======================================================= */

.sidebar {
  background-color: #fffef9 !important;
  border: 1px solid #d4b992 !important;
  color: #3f210a !important;
  border-radius: 8px;
  padding: 15px !important;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

/* Section boxes inside sidebar */
.sidebar-section {
  background-color: #fffaf0 !important;
  border: 1px solid #e8d9b5 !important;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 10px 15px;
  box-sizing: border-box;
}

.sidebar-section h3 {
  /*color: #5a2e00 !important;*/
  color: white !important;
  border-bottom: 1px solid #caa66b;
  padding-bottom: 6px;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
}

/* Sidebar Links */
.sidebar-section a {
  color: #3f210a !important;
  text-decoration: none;
  transition: color 0.2s ease;
  word-wrap: break-word;
}
.sidebar-section a:hover {
  color: #008080 !important;
}

/* Lists */
.sidebar-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.sidebar-section ul li {
  border-bottom: 1px solid #f0e2cc;
  padding: 6px 0;
}

/* Ads Section */
.ads-placeholder {
  background-color: #fffdf7 !important;
  border: 1px solid #e9dec3;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  overflow-x: hidden;
}

/* Search Box */
.search-box-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
#sidebar-search-box {
  flex: 1;
  background-color: #fff;
  border: 1px solid #d4b992;
  color: #3f210a;
  border-radius: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
}
#sidebar-search-box::placeholder {
  color: #bfa682;
}
.search-btn {
  background-color: #f4e1c2;
  border: 1px solid #d4b992;
  color: #5a2e00;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.search-btn:hover {
  background-color: #f0dcb5;
}

/* DMCA Badge Fix */
.dmca-badge img {
  max-width: 100%;
  height: auto;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.dmca-badge img:hover {
  opacity: 1;
}

/* =======================================================
   🎯 SIDEBAR "MORE" BUTTON — FIXED + MATCHES NEW UI
   ======================================================= */

/* Style the "More Categories..." & "More Tags..." buttons */
.sidebar-section ul li a[href*="all-categories"],
.sidebar-section ul li a[href*="all-tags"] {
  display: inline-block;
  background-color: #c8642a;
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #b85721;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-top: 6px;
  line-height: 1.3;
  text-align: center;
}

/* Hover style */
.sidebar-section ul li a[href*="all-categories"]:hover,
.sidebar-section ul li a[href*="all-tags"]:hover {
  background-color: #a44e1c;
  border-color: #944417;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Center these buttons cleanly */
.sidebar-section ul li:has(a[href*="all-categories"]),
.sidebar-section ul li:has(a[href*="all-tags"]) {
  text-align: center;
  border-bottom: none !important;
  padding: 8px 0 4px;
  margin: 0;
}

/* Responsive fine-tune */
@media (max-width: 768px) {
  .sidebar-section ul li a[href*="all-categories"],
  .sidebar-section ul li a[href*="all-tags"] {
    font-size: 16px;
    padding: 6px 8px;
  }
}



/* Responsive for smaller screens */
@media (max-width: 768px) {

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1px;
    justify-content: center;
  }

  #scrollTopBtn {
    position: static;
    transform: none;
    margin-top: 15px;
  }
} 

.story-thumbnail-wrapper{
  max-width: 100%;
  height: auto;
  display: block;
}

.story-thumbnail-wrapper:empty {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
    width: 98%;
      padding: 10px;
  }

  .latest-stories {
      margin-top: 5px;
  }

  .story-box h2 {
  font-size: 28px;
}

  .read-button {
    align-self: flex-end;
    margin-top: 10px;
  }

  .logo {
    text-align: center;
  }

  header p {
    color: white;
  }

.story-content{
  font-size: 18px;
}
  /* NAV MENU TOGGLE ON MOBILE */
  #nav-menu {
    display: none;
    flex-direction: column;
    background-color: #8c4b15;
    position: absolute;
    top: 50px;
    gap: 23px;
    left: 0;
    width: 100%;
    padding: 10px 0;
    z-index: 999;
  }

  #nav-menu.show {
    display: flex;
  }

  /* Mobile controls visible */
  .mobile-nav-controls {
    display: flex;
  }

  /* Search box inside nav toggled */
  .desktop-search {
    display: none !important;
  }

  .search-box-wrapper input {
    width: 100%;
  }

  
  .sidebar {
  border-left: none;
}

  .search-toggle {
    margin-left: auto;
  }
}

@media (min-width: 769px) {
  /* Mobile search hidden */
  .mobile-search {
    display: none !important;
  }


  /* Desktop search aligned right */
  .desktop-search {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: 10px;
    right: 20px;
  } 
}

/* ----------------------------
   FINAL: Mobile Category Bar
   (prevents page horizontal overflow)
   ---------------------------- */

/* Make the wrapper a layout containment context so overflow inside it won't push the page */
.category-scroll-wrapper {
  position: sticky;
  inset: 0 auto auto 0; /* top:0; left/right 0 */
  width: 100%;
  max-inline-size: 100%;       /* avoids 100vw issues */
  box-sizing: border-box;
  background-color: #fffaf0;
  border-bottom: 1px solid #e1c8a0;
  z-index: 997;
  overflow: hidden;            /* hide any spill inside wrapper */
  contain: layout inline-size; /* important: contain layout & inline size so children can't expand page */
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1), opacity 0.25s ease;
  margin: 0;
  padding: 0;
}

/* The scrolling strip itself — horizontal scroll inside only */
.category-scroll {
  display: flex;
  gap: 10px;
  padding: 10px 12px;         /* visual padding; safe because wrapper uses box-sizing */
  overflow-x: auto;           /* scroll inside this container only */
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  width: 100%;
  box-sizing: border-box;
  overscroll-behavior-x: contain; /* prevents page from being pulled horizontally on edge */
  scrollbar-width: none;           /* firefox */
}

/* hide native scrollbar visuals */
.category-scroll::-webkit-scrollbar { display: none; }

/* category pills */
.category-scroll a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background-color: #fff;
  border: 1px solid #d4b992;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #5a2e00;
  text-decoration: none;
  white-space: nowrap;
}

/* active / hover */
.category-scroll a:hover,
.category-scroll a.active {
  background-color: #8c4b15;
  color: #fff;
}

/* Let ads appear visually above category bar */
.leaderboard-ad-wrapper {
  order: -1; /* moves ads above in visual order */
}

/* Wrap section content in flex to use order */
.latest-stories {
  display: flex;
  flex-direction: column;
}


/* hide the bar on wide screens */
@media (min-width: 769px) {
  .category-scroll-wrapper { display: none; }
}

/* hide on scroll down */
.category-scroll-wrapper.hidden {
  transform: translateY(-110%); /* slide fully up */
  opacity: 0;
  pointer-events: none;
}

/* Defensive: ensure images, iframes, ad containers can't overflow the page */
img, iframe, embed, object {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Defensive: common ad container classes — constrain them */
.ad-container, .desktop-ad, ins[class^="eas"], .ad-slot {
  max-inline-size: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Optional: make focus visible for accessibility */
.category-scroll a:focus {
  outline: 3px solid rgba(200,100,30,0.18);
  outline-offset: 2px;
}

.category-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar {
    display: none;
}

/* Mobile only */
@media (max-width: 768px) {

  .category-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .category-scroll-wrapper::-webkit-scrollbar {
    display: none;
  }

  .category-marquee {
    display: inline-flex;
    animation: autoScroll 22s linear infinite;
  }

  .category-scroll {
    display: inline-flex;
    gap: 10px;
    padding: 8px 12px;
  }

  .category-scroll a {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: 30px;
    background: #fff;
    border: 1px solid #d4b992;
    color: #5a2e00;
    font-weight: 600;
    white-space: nowrap;
  }

  @keyframes autoScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }
}

/* Desktop hidden */
@media (min-width: 769px) {
  .category-scroll-wrapper {
    display: none;
  }
}
