/* ==========================================================================
   Divi Tabbed Blog Filter Styles - Modern Design
   ========================================================================== */

/* Tab Navigation */
.dbs-tabs-header {
  position: relative;
  margin-bottom: 2rem;
}
.dbs-tabs-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 102, 204, 0.3) transparent;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  padding: 0.5rem 0;
  margin-bottom: 0;
  max-width: 100%;
}
.dbs-tabs-nav::-webkit-scrollbar {
  height: 6px;
}
.dbs-tabs-nav::-webkit-scrollbar-track {
  background: transparent;
}
.dbs-tabs-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 102, 204, 0.3);
  border-radius: 3px;
}
.dbs-tabs-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 102, 204, 0.5);
}
.dbs-tabs-nav li {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}
.dbs-tabs-nav a {
  display: inline-block;
  padding: 0.75em 1.5em;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.dbs-tabs-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dbs-tabs-nav a:hover {
  background: #005bb5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}
.dbs-tabs-nav a:hover::before {
  opacity: 1;
}
.dbs-tabs-nav a.active {
  background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
  box-shadow: 0 4px 16px rgba(0, 74, 153, 0.4);
  transform: translateY(-1px);
}

/* Hamburger for tabs */
.dbs-tabs-hamburger {
  display: none;
  background: linear-gradient(135deg, #0066cc 0%, #005bb5 100%);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 1rem;
  align-self: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}
.dbs-tabs-hamburger:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}
.dbs-tabs-hamburger:active {
  transform: scale(0.95);
}

@media (max-width: 1024px) {
  .dbs-tabs-header {
    flex-wrap: nowrap !important;
  }
  .dbs-tabs-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .dbs-tabs-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #fff;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 1em 0;
    margin-bottom: 0;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
  }
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .dbs-tabs-nav.dbs-tabs-nav-open {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
  }
  .dbs-tabs-nav li {
    width: 100%;
    margin: 0;
  }
  .dbs-tabs-nav a {
    width: 100%;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    text-align: left;
    padding: 1em 1.5em;
  }
  .dbs-tabs-nav a:hover {
    transform: translateY(0);
  }
}

/* Sort Dropdown */
.dbs-sort {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dbs-sort label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}
.dbs-sort select {
  padding: .6em 1em;
  font-size: 0.95rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}
.dbs-sort select:hover {
  border-color: #0066cc;
}
.dbs-sort select:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Tab Content Wrapper */
.dbs-tab-content {
  margin-bottom: 2rem;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading State */
.dbs-tabs-content.dbs-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}
.dbs-tabs-content.dbs-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Post Grid */
.dbs-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--dbs-cols,1), 1fr) !important;
  gap: 1.5rem !important;
  animation: fadeIn 0.5s ease;
}
.dbs-grid.dbs-single {
  grid-template-columns: 1fr !important;
  justify-items: center;
}
.dbs-grid.dbs-single .dbs-post {
  max-width: 500px;
  width: 100%;
}

/* Post Card */
.dbs-post {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8e8e8;
  padding: 0;
  box-sizing: border-box;
  justify-self: center;
  height: auto;
  max-width: 400px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dbs-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #d0d0d0;
}
.dbs-post a {
  color: inherit;
  transition: color 0.3s ease;
}
.dbs-post img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.dbs-post:hover img {
  transform: scale(1.05);
}
.dbs-post > a {
  overflow: hidden;
}
.dbs-post h2 {
  margin: 1rem 1.25rem 0.5rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.3;
  font-weight: 700;
}
.dbs-post h2 a:hover {
  color: #0066cc;
}
.dbs-date {
  color: #888;
  font-size: 0.9em;
  margin: 0 1.25rem 0.75rem;
  font-weight: 500;
}
.dbs-excerpt {
  flex-grow: 1;
  margin: 0 1.25rem;
  color: #555;
  line-height: 1.6;
  font-size: 0.95rem;
}


/* See More Link */
.dbs-see-more {
  margin: 1.25rem;
  margin-top: auto;
  padding-top: 1rem;
  text-align: right;
}
.dbs-see-more-link {
  display: inline-block;
  padding: 0.65em 1.5em;
  background: #0073aa;
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
  position: relative;
  overflow: hidden;
}
.dbs-see-more-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.dbs-see-more-link:hover {
  background: #005bb5;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}
.dbs-see-more-link:hover::before {
  left: 100%;
}

/* Pagination */
.dbs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.dbs-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0.5em 0.75em;
  background: #fff;
  color: #0066cc;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}
.dbs-pagination a:hover {
  background: #f0f7ff;
  border-color: #0066cc;
  transform: translateY(-2px);
}
.dbs-pagination a.current {
  background: linear-gradient(135deg, #0066cc 0%, #005bb5 100%);
  color: #fff;
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Phones */
@media (max-width: 768px) {
  .dbs-grid:not([style*="--dbs-cols"]) {
    grid-template-columns: 1fr !important;
  }
  .dbs-grid[style*="--dbs-cols"] {
    grid-template-columns: repeat(var(--dbs-cols), 1fr) !important;
  }
  .dbs-post {
    max-width: 100% !important;
    width: 100%;
  }
  .dbs-post img {
    max-width: 100%;
    height: auto;
  }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .dbs-grid:not([style*="--dbs-cols"]) {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dbs-grid[style*="--dbs-cols"] {
    grid-template-columns: repeat(var(--dbs-cols), 1fr) !important;
  }
}