/* =========================================================
   Adjaranet Archive Styles (v2.2 Responsive & Complete)
========================================================= */

:root {
  --adj-bg: #f4f5f7;
  --adj-surface: #ffffff;
  --adj-text: #111;
  --adj-muted: #777;
  --adj-border: #e2e2e2;
  --adj-radius: 12px;
  --adj-shadow: 0 4px 12px rgba(0,0,0,0.05);
  --white: #ffffff;
}

body.dark-mode {
  --adj-bg: #121212;
  --adj-surface: #1e1e1e;
  --adj-text: #eee;
  --adj-muted: #aaa;
  --adj-border: #333;
  --adj-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.adj-archive {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--adj-text);
  box-sizing: border-box;
  width: 100%;
}

.adj-archive * {
  box-sizing: border-box;
}

/* --- LAYOUT UTILS --- */
.adj-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

/* Primary Row (Genres) */
.adj-row-primary {
  background: var(--adj-surface);
  border: 1px solid var(--adj-border);
  border-radius: var(--adj-radius);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  box-shadow: var(--adj-shadow);
  gap: 16px; 
}

/* Toolbar */
.adj-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.adj-tools-left { display: flex; gap: 10px; }

/* Drawer (Countries) */
.adj-drawer {
  width: 100%;
  background: var(--adj-surface);
  border: 1px solid var(--adj-border);
  border-radius: var(--adj-radius);
  box-shadow: var(--adj-shadow);
  overflow: hidden;
  margin-top: -4px;
  animation: slideDown 0.2s ease-out;
}
.adj-drawer[hidden] { display: none; }
.adj-drawer-inner {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- SLIDER COMPONENTS --- */
.adj-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--adj-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.adj-slider-wrapper {
  flex: 1; /* Takes remaining space */
  min-width: 0; /* Important for flex child scroll */
  position: relative;
  display: flex;
  align-items: center;
}

/* The scrollable area */
.adj-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scroll-behavior: smooth;
}
.adj-slider::-webkit-scrollbar { display: none; }

/* Chips */
.adj-chip {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--adj-bg);
  color: var(--adj-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.2s;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.adj-chip:hover { background: rgba(0,0,0,0.05); }
body.dark-mode .adj-chip:hover { background: rgba(255,255,255,0.1); }

.adj-chip.is-active {
  background: var(--adjaranet-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 110, 15, 0.3);
}

/* --- NAVIGATION ARROWS --- */
.adj-slider-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--adj-border);
}

.adj-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--adj-border);
  background: var(--adj-bg);
  color: var(--adj-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.adj-arrow-btn:hover {
  background: var(--adj-surface);
  border-color: var(--adj-muted);
  transform: scale(1.05);
}
.adj-arrow-btn:active { transform: scale(0.95); }

/* Chevron Icons */
.adj-chev-left, .adj-chev-right {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  display: block;
}
.adj-chev-right { transform: rotate(45deg); margin-left: -2px; }
.adj-chev-left { transform: rotate(-135deg); margin-left: 2px; }

/* --- OTHER ELEMENTS --- */
.adj-label-sm { font-size: 12px; font-weight: 700; color: var(--adj-muted); margin-right: 8px; }

.adj-btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--adj-surface);
  border: 1px solid var(--adj-border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--adj-text);
  cursor: pointer;
  box-shadow: var(--adj-shadow);
  transition: all 0.2s;
}

.adj-chev {
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -3px;
  transition: transform 0.2s;
}
.adj-btn-toggle[aria-expanded="true"] .adj-chev { transform: rotate(-135deg); margin-top: 3px; }

.adj-sort-wrap {
  display: flex; align-items: center;
  background: var(--adj-surface);
  border: 1px solid var(--adj-border);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: var(--adj-shadow);
}
.adj-sort-link {
  padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--adj-muted);
  text-decoration: none; border-radius: 6px;
  transition: 0.2s;
}
.adj-sort-link.is-active { background: var(--adjaranet-color); color: #fff; }

/* Popover */
.adj-dropdown-wrap { position: relative; }
.adj-popover {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--adj-surface); border: 1px solid var(--adj-border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px; z-index: 50; overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.adj-popover-list a {
  display: block; padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--adj-text); text-decoration: none;
}
.adj-popover-list a:hover {
  background: var(--adj-bg);
}

/* Active State Logic (Blue/Primary Highlight) */
.adj-popover-list .is-active,
.adj-dropdown-wrap:has(.is-active:not(:first-of-type)) .adj-btn-toggle,
.adj-btn-toggle.is-active {
    background: var(--adjaranet-color);
    color: var(--white);
    border-color: var(--adjaranet-color);
}
.adj-btn-toggle.is-active .adj-chev { opacity: 0.8; }


/* --- GRID & PAGINATION --- */
.adj-cards-grid { 
  display: grid; 
  gap: 36px; 
  /* Desktop default */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
  align-items: start;
}

.adj-pagination { margin: 40px 0; display: flex; justify-content: center; }
.adj-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--adj-surface); border: 1px solid var(--adj-border);
  color: var(--adj-text); text-decoration: none; font-weight: 700; margin: 0 4px;
  transition: 0.2s;
}
.adj-pagination .page-numbers:hover { border-color: var(--adj-muted); }
.adj-pagination .page-numbers.current { 
  background: var(--adjaranet-color); 
  border-color: var(--adjaranet-color); 
  color: #fff; 
}


/* =========================================================
   RESPONSIVE QUERIES
========================================================= */



/* Tablet & Smaller Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
  .adj-cards-grid {
    gap: 32px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Mobile Landscape & Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .adj-archive { padding: 15px; }

  /* Stack toolbar elements */
  .adj-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .adj-tools-left {
    justify-content: space-between; /* Spread filter buttons */
  }

  .adj-sort-wrap {
    justify-content: center;
    width: 100%;
  }

  /* Hide arrows on touch devices */
  .adj-slider-nav { display: none; }
  
  /* Remove separator border on mobile since arrows are gone */
  .adj-row-primary { gap: 10px; padding: 10px 15px; }
  .adj-drawer-inner { gap: 10px; padding: 10px 15px; }
  
  /* Labels can be smaller or hidden if needed */
  .adj-label { font-size: 12px; margin-right: 8px; }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .adj-archive { padding: 10px; }

  /* Filters */
  .adj-filters { gap: 8px; margin-bottom: 20px; }
  .adj-label { display: none; /* Save space by hiding labels like "Genres" */ }
  .adj-label-sm { display: none; /* Hide "Sort:" label */ }

  /* Buttons */
  .adj-btn-toggle { flex: 1; justify-content: center; padding: 10px; }
  .adj-sort-wrap { gap: 4px; padding: 6px; }
  .adj-sort-link { flex: 1; text-align: center; padding: 8px 4px; font-size: 12px; }

  /* Grid: Ensure 2 columns on small screens (140px min) */
  .adj-cards-grid {
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* Pagination */
  .adj-pagination { margin: 30px 0; }
  .adj-pagination .page-numbers { width: 34px; height: 34px; font-size: 13px; margin: 0 2px; }
}

.home-hero__search { margin-top: 80px; }

@media only screen and (max-width: 400px) {
   .adj-cards-grid {
    grid-template-columns: 1fr !important;
  } 
}