/* ==========================================================================
   MAW Details Page - Enhanced Year Navigation & Filter Toolbar
   ========================================================================== */

/* 1. Year Hero Card - Title & Year Select Dropdown */
.details-hero-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.details-year-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.details-year-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(153, 101, 21, 0.35);
  border-radius: 8px;
  padding: 7px 34px 7px 12px;
  min-height: 36px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  color: #4a2e06;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(90, 56, 9, 0.08);
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a4e0c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.details-year-select:hover,
.details-year-select:focus {
  background-color: #ffffff;
  border-color: #996515;
  outline: none;
  box-shadow: 0 0 0 3px rgba(153, 101, 21, 0.2);
}

.details-year-select optgroup {
  font-weight: 700;
  color: #7a4e0c;
  background: #fdfaf5;
}

.details-year-select option {
  font-weight: 500;
  color: #2c241d;
  background: #ffffff;
}

/* 2. Horizontal Decade Bar - Exactly 1 line on desktop, NO horizontal scroll */
.details-decade-scrubber {
  margin: 10px 0 14px 0;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(153, 101, 21, 0.22);
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.decade-scroll-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  overflow-x: hidden; /* No scrollbar on desktop */
  box-sizing: border-box;
}

/* Decade pill default state - expands and contracts flexibly to fill 1 row */
#layoutBodyContent a.decade-pill,
.decade-pill {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  min-height: 30px;
  border-radius: 14px;
  font-size: clamp(0.72rem, 0.82vw, 0.84rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #6a440e !important;
  text-decoration: none;
  background: rgba(153, 101, 21, 0.08);
  border: 1px solid rgba(153, 101, 21, 0.18);
  transition: all 0.18s ease;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

#layoutBodyContent a.decade-pill:hover,
.decade-pill:hover {
  background: rgba(153, 101, 21, 0.18);
  color: #3b2203 !important;
  border-color: rgba(153, 101, 21, 0.35);
}

/* Decade pill active state - bright warm golden amber, high contrast text */
#layoutBodyContent a.decade-pill.is-active,
#layoutBodyContent a.decade-pill.is-active:link,
#layoutBodyContent a.decade-pill.is-active:visited,
#layoutBodyContent a.decade-pill.is-active:hover,
.decade-pill.is-active {
  background: linear-gradient(135deg, #c78323, #a86b12) !important;
  color: #ffffff !important;
  border-color: #8c570a !important;
  box-shadow: 0 2px 6px rgba(168, 107, 18, 0.32);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  font-weight: 700;
}

#layoutBodyContent a.decade-pill.is-active .decade-name,
.decade-pill.is-active .decade-name {
  color: #ffffff !important;
}

/* 3. Filter Toolbar with Chips & Instant Search - Exactly 1 line on desktop */
.details-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap; /* Single line on desktop */
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(153, 101, 21, 0.22);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.details-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap; /* Single line */
  flex: 0 1 auto;
}

/* Filter chip button default */
.filter-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 8px;
  background: #ffffff;
  border: 1.5px solid rgba(153, 101, 21, 0.28);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: #4a3416;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.filter-chip-btn:hover {
  background: #fffcf6;
  border-color: #996515;
  color: #241604;
  box-shadow: 0 2px 5px rgba(153, 101, 21, 0.15);
}

/* Filter chip active state - vibrant golden amber, clearly readable */
.filter-chip-btn.is-active {
  background: linear-gradient(135deg, #c78323, #a86b12) !important;
  color: #ffffff !important;
  border-color: #8c570a !important;
  box-shadow: 0 2px 6px rgba(168, 107, 18, 0.32);
}

.filter-chip-btn.is-active:hover {
  background: linear-gradient(135deg, #d6902e, #b87719) !important;
  color: #ffffff !important;
}

.filter-chip-btn.is-active .chip-label {
  color: #ffffff !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

/* Badges inside filter chips */
.chip-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(153, 101, 21, 0.14);
  color: #5c3b0d;
}

.filter-chip-btn.is-active .chip-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.45);
  text-shadow: none;
}

.chip-badge.badge-warn {
  background: rgba(192, 57, 43, 0.14);
  color: #a93226;
}

.filter-chip-btn.is-active .chip-badge.badge-warn {
  background: #c0392b !important;
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-shadow: none;
}

/* 4. In-Page Live Quick Search */
.details-quick-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 180px;
  max-width: 280px;
  flex: 0 1 260px;
}

.details-quick-search .search-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  stroke: #8c6a34;
}

#gallery-quick-filter {
  width: 100%;
  padding: 6px 26px 6px 30px;
  min-height: 34px;
  border: 1.5px solid rgba(153, 101, 21, 0.28);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.84rem;
  background: #ffffff;
  color: #2c241d;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#gallery-quick-filter:focus {
  outline: none;
  border-color: #996515;
  box-shadow: 0 0 0 3px rgba(153, 101, 21, 0.18);
}

.quick-filter-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: #8c6a34;
  cursor: pointer;
  padding: 2px 4px;
}

.quick-filter-matches {
  position: absolute;
  right: 28px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a4e0c;
  pointer-events: none;
}

/* Mobile & Tablet fallback */
@media (max-width: 860px) {
  .decade-scroll-inner {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }
  #layoutBodyContent a.decade-pill,
  .decade-pill {
    flex: 0 0 auto;
    padding: 5px 12px;
    font-size: 0.82rem;
  }
  .details-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .details-filter-chips {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .details-quick-search {
    max-width: 100%;
    min-width: 100%;
  }
}
