@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ============================= */
/* VARIABLES */
/* ============================= */
:root {
  --font-family: "Poppins", sans-serif;
  --text-color: #585b53;
  --hover-color: red;
  --bg-color: #ffffff;
  --container-width: 1200px;
  --gap: 1.5rem;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
input,
textarea,
button {
  font-family: var(--font-family);
}
a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--hover-color);
}
header a:hover {
  text-decoration: none; /* Remove underline for header */
}
ul {
  list-style: none;
}

img[loading="lazy"] {
  filter: blur(10px);
  transition: filter 0.4s ease;
}
img[loading="lazy"]:not([src*="placeholder"]):not(:empty):not(:invalid):not(
    :hover
  ) {
  filter: blur(0);
}

/* ============================= */
/* LAYOUT CONTAINERS */
/* ============================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--gap);
}

/* ============================= */
/* HEADER */
/* ============================= */
header {
  padding: var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
}

nav ul {
  display: flex;
  gap: var(--gap);
}
nav li {
  position: relative;
}

nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 10px; /* This creates the VISIBLE gap */
  background: transparent; /* So the gap area is still hoverable */
  z-index: 1000;
}

nav li:hover > ul,
nav li:focus-within > ul {
  display: block;
}

nav li ul li {
  background: #fff;
  border: none;
  padding: 0.5rem 1rem;
  width: 170px;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
  border-style: solid;
  border-color: var(--ast-global-color-3, #ccc);
}

/* Optional: Add subtle shadow for depth */
nav li ul li {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Ensure logo doesn’t shrink */
.logo {
  flex-shrink: 0;
}
.logo img {
  max-width: 180px;
}
/* Ensure nav takes only as much space as needed */
nav {
  flex-shrink: 1;
}

/* ============================= */
/* MOBILE MENU */
/* ============================= */

.menu-toggle {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav li ul {
    position: static;
    display: none;
    border: none;
    padding-left: 1rem;
  }

  .main-nav li:hover ul {
    display: block;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================= */
/* CATEGORY GRID */
/* ============================= */
/* .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
  padding: 0 1rem;
}

.category-item {
  border: 1px solid #eee;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s;
  background: #fff;
  border-radius: 6px;
}

.category-item:hover {
  border-color: var(--hover-color);
  transform: translateY(-4px);
}

.category-item img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 0.75rem;
}

.category-item h3 {
  font-size: 1rem;
  color: var(--text-color);
  margin: 0;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .category-item img {
    max-height: 120px;
  }

  .category-item h3 {
    font-size: 0.95rem;
  }
} */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 2rem;
  /* padding: 0 1rem; */
}

.category-item {
  padding: 0;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: start;
  height: 100%;
}

.image-wrapper {
  width: 100%;
  height: 530px;
  display: flex;
  /*justify-content: center;*/
  align-items: start;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  /*height: 100%;*/
  /*object-fit: fill;*/
  display: block;
}

.category-label {
  font-size: 0.95rem;
  color: #585b53;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.category-item a {
  color: inherit;
  text-decoration: none;
}

.category-item a:hover .category-label {
  color: red;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .image-wrapper {
    height: 320px;
  }
}
/* ============================= */
/* SEARCH SECTION */
/* ============================= */
.search-section {
  max-width: 100%;
  padding: 1rem;
  margin: 3rem auto;
  text-align: center;
}

.search-box-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.search-container {
  flex: 0 0 80%;
  position: relative;
  display: flex;
  align-items: center;
}

#searchBox {
  width: 100%;
  padding: 12px 40px 12px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#clearButton {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: none;
  color: #888;
  z-index: 2;
}

#searchButton {
  flex: 0 0 10%;
  margin-left: 10px;
  background-color: #000;
  color: #fff;
  border: none;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  min-width: 80px;
}

#searchButton:hover {
  background-color: #333;
}

.suggestions-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: row;
  z-index: 1000;
  margin-top: 2px;
  max-height: 460px; /* Slightly taller than right panel for border + padding */
  box-sizing: border-box;
  overflow: hidden; /* clip overflow */
}

/* Left list with scrollbar */
.suggestion-list {
  width: 50%;
  box-sizing: border-box;
  overflow-y: auto;
  padding-right: 10px; /* prevent content hidden behind scrollbar */
  position: relative; /* for separator */

  /* scrollbar styling */
  scrollbar-width: thin;
  max-height: 450px; /* match right panel height */
}

/* Vertical separator line on right edge of left panel */
.suggestion-list::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background-color: #ccc;
  pointer-events: none;
}

.suggestion-list::-webkit-scrollbar {
  width: 6px;
}

.suggestion-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* Right preview panel fixed height */
.suggestion-preview {
  width: 50%;
  padding: 10px 20px;
  box-sizing: border-box;
  height: 450px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Image at top of right panel - width 100% minus padding, height auto */
.suggestion-preview img {
  width: 50%;
  height: auto;
  object-fit: fill;
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* Text content container below image - takes remaining space */
.preview-meta {
  flex: 1 1 auto; /* grow to fill remaining space */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow-y: auto; /* scroll if content too long */
}

.preview-meta .category {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
}

.preview-meta .title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #000;
  margin: 0;
  text-align: center;
}

.preview-meta .date {
  font-size: 0.8rem;
  color: #999;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  width: 30%;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

.read-more:hover {
  text-decoration: none;
  color: white;
}

/* Items in suggestion list */
.suggestion-item {
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.suggestion-item img {
  width: 40px;
  height: 40px;
  object-fit: fill;
  margin-right: 10px;
}

/* Hover effect */
.suggestion-item:hover,
.suggestion-item.hovered {
  background-color: #f0f0f0;
  box-shadow: inset 0 0 0 1px #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-box-wrapper {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  #searchButton {
    width: 100%;
    margin-left: 0;
  }

  .suggestions-panel {
    flex-direction: column;
    max-height: none;
    position: static;
    border: 1px solid #ccc;
  }

  .suggestion-list,
  .suggestion-preview {
    width: 100%;
    height: auto;
    overflow-y: visible;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid #ccc;
    max-height: none;
  }

  .suggestion-list::after {
    display: none;
  }

  .read-more {
    width: 100%;
  }
}
/* ============================= */
/* FOOTER */
/* ============================= */
footer {
  padding: 1rem 0;
  border-top: 1px solid #ccc;
  margin-top: 3rem;
  font-size: 0.9rem;
}

.footer-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  color: var(--text-color);
}

.footer-links {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}

.footer-links li {
  list-style: none;
}

.footer-links a {
  color: var(--text-color);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--hover-color);
}

/* Responsive stack on mobile */
@media (max-width: 600px) {
  .footer-wrapper {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ============================= */
/* SCROLL TO */
/* ============================= */
#scrollToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--text-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  z-index: 1000;
  transition: background-color 0.3s, opacity 0.3s;
}

#scrollToTop:hover {
  background-color: var(--hover-color);
}

@media (max-width: 600px) {
  #scrollToTop {
    right: 15px;
    bottom: 15px;
    padding: 0.6rem 0.9rem;
  }
}

/* Pagination */
.pagination {
  text-align: center;
  margin: 2rem 0;
}

.pagination a {
  display: inline-block;
  margin: 0 5px;
  padding: 6px 12px;
  text-decoration: none;
  color: #585b53;
  border: 1px solid #ccc;
}

.pagination a.active,
.pagination a:hover {
  color: red;
  border-color: red;
}

#load-more {
  display: block;
  margin: 2rem auto;
  padding: 10px 20px;
  background: #f4f4f4;
  border: 1px solid #ccc;
  color: #585b53;
  cursor: pointer;
  text-align: center;
}

#load-more:hover {
  background: #ddd;
  border-color: #999;
}

#load-more.loading {
  pointer-events: none;
  opacity: 0.6;
}
