/* =====================================================================
   PIRT Theme — Filter chips + search bar
   Per TASK-R3-002. The `.filters` flex layout from styles.css is being
   overridden by `body.skin` somewhere. Re-enforce here.
   ===================================================================== */

.search-bar {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  align-items: center;
}
.search-bar .search-input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill, 999px);
  background: var(--white-05);
  color: var(--white);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.search-bar .search-input:focus {
  border-color: var(--teal);
  background: var(--white-10);
}

.filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px;
  margin: 12px 0 24px;
}
.filters .filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill, 999px);
  background: var(--white-05);
  color: var(--white-70);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filters .filter-btn:hover {
  background: var(--white-10);
  color: var(--white);
  border-color: var(--teal);
}
.filters .filter-btn.active {
  background: linear-gradient(135deg, var(--teal), var(--green));
  color: var(--white);
  border-color: transparent;
}

/* Skin overrides — SPREP white surfaces */
body.skin .filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px;
}
body.skin .filters .filter-btn {
  background: var(--sp-surface) !important;
  border-color: var(--sp-line) !important;
  color: var(--sp-text) !important;
}
body.skin .filters .filter-btn:hover {
  background: var(--sp-bg) !important;
  border-color: var(--sp-primary) !important;
  color: var(--sp-primary) !important;
}
body.skin .filters .filter-btn.active {
  background: var(--sp-primary) !important;
  color: #fff !important;
  border-color: transparent !important;
}
body.skin .search-bar .search-input {
  background: var(--sp-bg) !important;
  border-color: var(--sp-line) !important;
  color: var(--sp-text) !important;
}
body.skin .search-bar .search-input::placeholder {
  color: var(--sp-muted) !important;
}

/* Filter-bar wrapper — groups search + chips together with consistent
   horizontal padding (matches the listing container). */
.filter-bar {
  margin: 12px 0 24px;
}
.filter-bar .search-bar {
  margin: 0 0 12px;
}
.filter-bar .filters {
  margin: 0;
}

/* Search input on listing pages — pill style, magnifier icon background. */
.search-bar .search-input {
  padding-left: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23606060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
body.skin .search-bar .search-input {
  background-color: var(--sp-bg) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23606060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
body.skin .search-bar .search-input:focus {
  border-color: var(--sp-primary) !important;
  box-shadow: 0 0 0 3px rgba(1, 128, 129, 0.12);
}

/* Listing controls bar (R5-046, R5-060) — wraps search + sort + filters */
.listing-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 16px;
  background: var(--sp-bg, #f7fafa);
  border: 1px solid var(--sp-line, #e0e0e0);
  border-radius: var(--radius-card, 16px);
}
.listing-controls .search-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--sp-line, #e0e0e0);
  border-radius: var(--radius-pill, 999px);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 14px;
  font-family: inherit;
}
.listing-controls .search-input:focus {
  outline: none;
  border-color: var(--sp-primary, #018081);
  box-shadow: 0 0 0 3px rgba(1, 128, 129, 0.1);
}
.listing-controls .form-input {
  padding: 10px 14px;
  border: 1px solid var(--sp-line, #e0e0e0);
  border-radius: var(--radius-card, 12px);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.listing-controls .filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.listing-controls .filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--sp-line, #e0e0e0);
  border-radius: var(--radius-pill, 999px);
  background: #fff;
  color: var(--sp-text, #222);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.listing-controls .filter-btn:hover,
.listing-controls .filter-btn.is-active {
  background: var(--sp-primary, #018081);
  color: #fff;
  border-color: var(--sp-primary, #018081);
}

/* About sub-page pill nav (R5-056) */
.about-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sp-line, #e0e0e0);
}
.about-subnav .subnav-pill {
  padding: 8px 18px;
  border: 1px solid var(--sp-line, #e0e0e0);
  border-radius: var(--radius-pill, 999px);
  background: #fff;
  color: var(--sp-text, #222);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.about-subnav .subnav-pill:hover {
  border-color: var(--sp-primary, #018081);
  color: var(--sp-primary, #018081);
}
.about-subnav .subnav-pill.is-active {
  background: var(--sp-primary, #018081);
  color: #fff;
  border-color: var(--sp-primary, #018081);
  font-weight: 600;
}

/* Programme download actions bar (R5-042) */
.programme-downloads {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
