
/* Archive */
/* =========================================
   OAB BLOG ARCHIVE LAYOUT
   ========================================= */


/* Firefox */
#blog-sidebar.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: transparent !important;
}

/* Chrome / Safari / Edge */
#blog-sidebar.custom-scrollbar::-webkit-scrollbar {
  width: 4px; /* extra thin */
  height: 4px;
}

#blog-sidebar.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent !important; /* invisible track */
}

#blog-sidebar.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #00000000 !important; /* faint */
  border-radius: 10px !important;
}

#blog-sidebar.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #00000000 !important; /* slightly more visible on hover */
}
/* Scrollbar for items */
#blog-sidebar.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
#blog-sidebar.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent !important;
}
#blog-sidebar.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1) !important;
  border-radius: 4px;
}


.blog-main-wrapper {
  background-color: var(--color-content-bg); /* #fdfdfd */
  padding: 120px 0;
  padding: 60px 0;
  width: 100%;
  min-height: 100vh;
  direction: rtl;
}

/* --- HEADER --- */
.blog-header {
  text-align: center;
  margin-bottom: 60px;
}
.blog-title {
  font-size: 2.8rem;
  color: var(--color-text-heading);
  margin-bottom: 15px;
  font-weight: 800;
}
.blog-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- LAYOUT GRID --- */
.blog-layout {
  display: grid;
  grid-template-columns: 280px 1fr; /* Sidebar | Content */
  gap: 40px;
  align-items: start;
}

/* --- SIDEBAR (Accordion) --- */
.blog-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 100px;
  background: #fff;
  padding: 25px;
  border-radius: 24px;
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  z-index: 99;
        right: -320px; /* Hide off-screen right */
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.cat-filter-list,
.children {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Main Category Item */
.cat-item {
  margin-bottom: 8px;
}

.cat-item-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-body);
  font-weight: 500;
  padding: 12px 15px;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
  width: 100%;
}

.cat-link .count {
  background: #fff;
  color: var(--color-text-muted);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Hover & Active States */
.cat-link:hover,
.cat-link.active {
  color: var(--color-primary); /* Red Brand */
}
.cat-link.active {
  font-weight: 700;
}

/* Accordion Toggle */
.cat-toggle {
  width: 30px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
  margin-right: 5px; /* RTL */
}
.cat-toggle:hover {
  color: var(--color-primary);
}

/* Sub Menu (Hidden by default) */
.children {
  display: none;
  padding-right: 15px; /* Indent in RTL */
  margin-top: 5px;
  border-right: 2px solid var(--color-border-subtle);
}
.children .cat-link {
  background: transparent;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* Open State */
.cat-item.open > .children {
  display: block;
}
.cat-item.open > .cat-item-inner .cat-toggle {
  transform: rotate(180deg);
}

/* --- SIDEBAR CONTAINER --- */
.blog-sidebar {
  position: sticky;
  top: 70px;
  background: #fff;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--color-border-subtle);
  max-height: calc(100vh - 120px);
  overflow-y: auto; /* Scroll if list is long */
}

/* Scrollbar Styling */
.blog-sidebar::-webkit-scrollbar {
  width: 4px;
}
.blog-sidebar::-webkit-scrollbar-thumb {
  background-color: #eee;
  border-radius: 4px;
}

.cat-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- PARENT ITEM --- */
.cat-item {
  margin-bottom: 5px;
  position: relative;
}

/* The Flex Row (Link + Arrow) */
.cat-item-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-product-card-bg);
  border-radius: 10px;
  transition: all 0.2s;
  border: none;
}

/* Link Styling */
.cat-link {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--color-text-body);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Count Badge */
.cat-link .count {
  background: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Toggle Arrow */
.cat-toggle {
  width: 35px;
  height: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  border-right: 1px solid rgba(0, 0, 0, 0.05); /* Separator */
  transition: color 0.2s;
}
.cat-toggle:hover {
  color: var(--color-primary);
}

/* --- HOVER & ACTIVE STATES --- */
.cat-item-inner:hover {
  border-color: var(--color-border-muted);
}

.cat-link.active {
  font-weight: 700;
  color: var(--color-primary);
}
.cat-link.active .count {
  background: var(--color-primary);
  color: #fff;
}

/* --- NESTED CHILDREN (The Magic Part) --- */
ul.children {
  list-style: none;
  padding: 0;
  margin: 0;

  /* 1. Indentation for RTL */
  padding-right: 20px;

  /* 2. Hidden by default */
  display: none;

  /* 3. Visual Connector Line (Optional) */
  border-right: 2px solid var(--cat-oats);
  margin-right: 15px; /* Aligns line with parent */
  margin-top: 5px;
}

/* --- OPEN STATE (Triggered by JS) --- */
.cat-item.open > .cat-item-inner {
  background: #fff; /* Highlight parent when open */
  border-color: var(--color-primary);
}

/* Rotate Arrow */
.cat-item.open > .cat-item-inner .cat-toggle {
  transform: rotate(180deg);
  color: var(--color-primary);
}

/* Show Children */
.cat-item.open > ul.children {
  display: block;
  animation: slideDown 0.3s ease-out;
}

/* --- STYLING THE CHILD ITEMS --- */
ul.children .cat-item {
  margin-bottom: 2px;
}

ul.children .cat-item-inner {
  background: transparent; /* No background for children */
  border: none;
  border-radius: 0;
}

ul.children .cat-link {
  padding: 8px 12px;
  font-size: 0.9rem; /* Smaller font */
}

ul.children .cat-toggle {
  border-right: none; /* No separator for children */
}

/* Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- BLOG CARDS --- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 1fr);
  gap: 30px;
}


@media (min-width: 420px) {
    .blog-grid {
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
     }
}

#oab-blog-grid:has(.no-posts) {
    grid-template-columns: 1fr;
}
#oab-blog-grid .no-posts{
    margin:0;
}

.oab-blog-card {
  background: var(--color-card-bg);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.oab-blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
  border-color: var(--color-border-muted);
}

/* Image */
.card-image {
  position: relative;
  height: auto;
  overflow: hidden;
  border-radius: 18px;
  max-height: 340px;
}
.card-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.oab-blog-card:hover .card-image img {
  transform: scale(1.05);
}
.is-loading-hidden {
    opacity: 0 !important; /* Use !important if needed to override other CSS */
    visibility: hidden; /* Helps ensure it's not clickable during FOUC */
}
/* Date Badge */
.card-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  padding: 10px 12px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  color: var(--color-text-heading);
  line-height: 1.1;
  min-width: 55px;
  display:none;
}
.card-date .day {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
}
.card-date .month {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Content */
.card-content {
  padding: 25px;
  padding-top: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-cat {
  color: var(--color-text-h6);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0 0 12px 0;
  font-weight: 800;
}
.card-title a {
  color: var(--color-text-heading) !important;
  text-decoration: none;
  transition: color 0.2s;
}
.card-title a:hover {
  color: var(--color-primary);
}

.card-excerpt {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Read More Button */
.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: gap 0.2s;
}
.read-more-link svg {
  width: 16px;
  transition: transform 0.2s;
}
.read-more-link:hover {
  color: var(--color-primary);
  gap: 12px;
}

/* --- PAGINATION --- */
.blog-pagination {
  margin-top: 60px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap:wrap;
}


/* Optional: smooth hover effect for other pages */
.blog-pagination a:hover {
    box-shadow: 0 0 5px rgba(215, 63, 63, 0.5);
}
.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-body) !important;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
  padding-top:3px;
}
span.page-numbers.dots,.prev.page-numbers,.next.page-numbers {
    padding-bottom: 5px;
}
.page-numbers.current{

  background: var(--color-primary);
  color: #fff !important;
  border-color: var(--color-primary);
  position: relative;
    z-index: 1;
    border-radius: 50%; /* make it circular if not already */
    box-shadow: 0 0 0 2px rgba(215, 63, 63, 0.4), /* outer glow */
                0 0 10px rgba(215, 63, 63, 0.6); /* softer halo */
    transition: box-shadow 0.3s ease;
}
.page-numbers:not(.dots):hover{
    box-shadow: 0 0 5px rgba(215, 63, 63, 0.5);
}
/* --- MOBILE & RESPONSIVE --- */
.mobile-filter-bar {
  display: none;
}
.sidebar-mobile-header {
  display: none;
}
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 98;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  #oab-blog-grid .no-posts{
    margin:0 auto;
}

  .mobile-filter-bar {
    display: block;
    margin-bottom: 30px;
  }
  .filter-toggle-btn {
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--color-border-subtle);
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: var(--color-text-heading);
  }

  /* Off-canvas Sidebar */
  .blog-sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    right: 0; /* Hidden off screen */
    left: 0; /* Hidden off screen */
    width: 100%;
    border-radius: 27px 27px 0 0;

    border-radius: 0;
    overflow-y: auto;
    transition: right 0.3s ease;
    border: none;
  }
  .blog-sidebar.active {
    right: 0;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border-subtle);
    font-weight: 800;
    font-size: 1.2rem;
  }
  .filter-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
  }
}

/* --- BLOG SIDEBAR SEARCH --- */
/* 1. Hide the default browser X */
.search-field::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  /* NOTE:  %23d73f3f is color-primary*/
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d73f3f'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");

  background-size: contain;
  cursor: pointer;
}
.sidebar-search-wrapper {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.oab-search-form {
  position: relative;
  width: 100%;
}

.oab-search-form label {
  width: 100%;
  display: block;
  margin: 0;
}
.cat-name {
  color: var(--color-text-body) !important;
}
.oab-search-form .search-field {
  width: 100%;
  background-color: var(--color-product-card-bg);
  border: 1px solid transparent;
  border-radius: 50px; /* Pill shape */
  padding: 12px 20px;
  padding-left: 50px; /* Space for the button on the left */
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text-body);
  transition: all 0.3s ease;
  outline: none;
}

.oab-search-form .search-field:focus {
  background-color: #fff;
  border-color: var(--color-border-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.oab-search-form .search-field::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.oab-search-form .search-submit {
  position: absolute;
  top: 50%;
  left: 8px; /* Left side for RTL */
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.oab-search-form .search-submit:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Optional Title Styling */
.sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text-heading);
  margin-bottom: 15px;
}

/* Mobile Filter Bar (Only visible on mobile) */
.mobile-filter-bar {
  display: none; /* Hidden on desktop */
  padding: 10px 0;
  margin-bottom: 20px;
}

/* Sidebar Default State (Mobile) */
@media (max-width: 900px) {
  .mobile-filter-bar {
    display: block;
  }

  .blog-sidebar {
    position: fixed;
    bottom: -100%;
    right: 0; /* Hidden off-screen to the right */
    left: 0; /* Hidden off-screen to the right */
    width: 100%;
    border-radius: 27px 27px 0 0;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    transition: bottom 0.3s ease-in-out;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  }

  /* Active State (Triggered by JS) */
  .blog-sidebar.is-active {
    bottom: 0; /* Slide in */
  }

  /* Dark Overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 18px;
  }
}



/* Hide mobile header elements on desktop */
@media (min-width: 992px) {
  .sidebar-mobile-header {
    display: none;
  }
}

/* Blog Header Area */
.blog-description-container {
  background: #f8f7f6;
  padding: 40px 42px 20px;
  margin-bottom: 30px;
  text-align: right;
  direction: rtl;
  border-radius: 24px;
}

/* Hide mobile header elements on desktop */
@media (max-width: 450px) {
  .blog-description-container {
     padding: 40px 21px 20px;
  }
}
.blog-main-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #333;
}

/* The Text Box */
.blog-intro-text {
  position: relative;
  max-height: 110px; /* Only show ~3 lines */
  overflow: hidden;
  transition: max-height 0.5s ease;
  line-height: 1.8;
  color: #555;
  font-size: 15px;
}

/* The Fade Effect at the bottom */
.intro-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to bottom, #f8f7f600, #f8f7f6);
  pointer-events: none;
  transition: opacity 0.3s;
}

/* When Expanded */
.blog-intro-text.expanded {
  max-height: 2000px; /* Allow full height */
}
.blog-intro-text.expanded .intro-fade {
  opacity: 0;
}

/* The Button */
.intro-toggle-btn {
  background: none;
  border: none;
  color: var(--color-btn-primary);
  font-weight: bold;
  cursor: pointer;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 14px;
  margin: 0 auto;
}

.intro-toggle-btn svg {
  transition: transform 0.3s;
}

.intro-toggle-btn.active svg {
  transform: rotate(180deg);
}
