* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background: #f5f7fa;
  color: #20242a;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(4, 105, 227, 0.28);
  outline-offset: 2px;
}

.visually_hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.article_hub {
  width: min(1180px, calc(100% - 48px));
  min-height: 70vh;
  margin: 0 auto;
  padding: 36px 0 72px;
}

.page_header {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 28px;
}

.page_header h1 {
  margin: 0;
  color: #20242a;
  font-size: 34px;
  line-height: 1.25;
}

.search_form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 46px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search_form:focus-within {
  border-color: #0469e3;
  box-shadow: 0 0 0 3px rgba(4, 105, 227, 0.1);
}

.search_form input {
  min-width: 0;
  padding: 11px 14px;
  border: 0;
  outline: 0;
  color: #20242a;
  background: transparent;
}

.search_form input::placeholder {
  color: #8a929d;
}

.clear_search,
.search_submit {
  border: 0;
  padding: 0 16px;
}

.clear_search {
  color: #69727e;
  background: #fff;
}

.clear_search:hover {
  color: #0469e3;
}

.search_submit {
  min-width: 72px;
  color: #fff;
  background: #0469e3;
  font-weight: 500;
}

.search_submit:hover {
  background: #035cbd;
}

.category_nav {
  margin-bottom: 24px;
  border-bottom: 1px solid #dfe3e8;
}

.category_tabs {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category_tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #59626e;
  white-space: nowrap;
}

.category_tab:hover {
  color: #0469e3;
}

.category_tab:disabled {
  color: #a5abb3;
  cursor: default;
}

.category_tab[aria-selected="true"] {
  color: #0469e3;
  font-weight: 500;
}

.category_tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #0469e3;
}

.category_count {
  margin-left: 5px;
  color: #8a929d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.category_tab[aria-selected="true"] .category_count {
  color: #0469e3;
}

.mobile_filter_bar {
  display: none;
}

.active_filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e1e5ea;
}

.active_filter_list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active_filter_chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #b8cee9;
  border-radius: 4px;
  color: #134d91;
  background: #edf5ff;
  font-size: 13px;
}

.active_filter_chip:hover {
  border-color: #0469e3;
  background: #e3f0ff;
}

.chip_remove {
  color: #5f7084;
  font-size: 16px;
  line-height: 1;
}

.clear_all_filters,
.filter_reset {
  flex: 0 0 auto;
  border: 0;
  color: #657080;
  background: transparent;
  font-size: 13px;
}

.clear_all_filters:hover,
.filter_reset:hover {
  color: #0469e3;
}

.article_hub_layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.filter_panel {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  padding-right: 24px;
  overflow-y: auto;
  border-right: 1px solid #dfe3e8;
  scrollbar-width: thin;
}

.filter_panel_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.filter_panel_header h2,
.results_toolbar h2 {
  margin: 0;
  color: #2b3037;
  font-size: 18px;
  line-height: 1.4;
}

.filter_group {
  min-width: 0;
  margin: 0;
  padding: 18px 0 16px;
  border: 0;
  border-bottom: 1px solid #e5e8ec;
}

fieldset.filter_group {
  padding-top: 0;
  margin-top: 16px;
}

.filter_group:last-child {
  border-bottom: 0;
}

.filter_group legend,
.select_label {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  color: #333941;
  font-size: 14px;
  font-weight: 500;
}

fieldset.filter_group legend {
  margin-top: 18px;
}

.filter_options {
  display: grid;
  gap: 4px;
}

.filter_options.is_collapsed .filter_option:nth-child(n + 7) {
  display: none;
}

.filter_option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: #515a65;
  font-size: 13px;
}

.filter_option:hover {
  color: #0469e3;
}

.filter_option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #0469e3;
}

.filter_option_count {
  color: #9098a2;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.filter_option.is_unavailable {
  color: #a5abb3;
}

.expand_options {
  margin-top: 8px;
  padding: 3px 0;
  border: 0;
  color: #0469e3;
  background: transparent;
  font-size: 13px;
}

.filter_select {
  width: 100%;
  min-height: 38px;
  padding: 7px 38px 7px 10px;
  border: 1px solid #ccd2da;
  border-radius: 4px;
  color: #3e4650;
  background-color: #fff;
}

.results_panel {
  min-width: 0;
}

.results_toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin-bottom: 16px;
}

.results_controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7480;
  font-size: 13px;
}

.result_count {
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.results_controls select {
  min-height: 36px;
  padding: 6px 38px 6px 10px;
  border: 1px solid #ccd2da;
  border-radius: 4px;
  color: #353b43;
  background-color: #fff;
}

.filter_select,
.results_controls select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6470' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

.article_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.article_card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 15px;
  min-height: 152px;
  padding: 14px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.article_card:hover {
  border-color: #91b8e8;
  box-shadow: 0 5px 16px rgba(29, 54, 85, 0.08);
  transform: translateY(-1px);
}

.article_cover {
  position: relative;
  width: 132px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  background: #f6f7f8;
}

.article_cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video_badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 3px;
  color: #fff;
  background: rgba(20, 24, 30, 0.82);
  font-size: 11px;
  line-height: 1.2;
}

.article_card_content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.article_card_title {
  display: -webkit-box;
  margin: 0 0 7px;
  overflow: hidden;
  color: #252a31;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article_card_description {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: #69727e;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article_card_footer {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
}

.article_tags {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 5px;
  overflow: hidden;
}

.article_tag {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 110px;
  overflow: hidden;
  padding: 2px 6px;
  border-radius: 3px;
  color: #506174;
  background: #eef2f6;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article_tag.category_tag {
  color: #075bbf;
  background: #e9f3ff;
}

.article_date {
  align-self: flex-end;
  color: #9299a2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.loading_message,
.noscript_message,
.empty_state,
.error_state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 56px 24px;
  text-align: center;
  color: #68717d;
}

.empty_state h3,
.error_state h3 {
  margin: 0 0 16px;
  color: #3c434c;
  font-size: 17px;
}

.empty_state button,
.error_state button,
.filter_toggle {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #9dbce1;
  border-radius: 4px;
  color: #075bbf;
  background: #fff;
}

.empty_state button:hover,
.error_state button:hover,
.filter_toggle:hover {
  border-color: #0469e3;
  background: #f2f7fd;
}

@media screen and (max-width: 980px) {
  .article_grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 820px) {
  .article_hub {
    width: min(100% - 32px, 720px);
    padding-top: 28px;
  }

  .page_header {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
  }

  .category_nav {
    margin-right: -16px;
    margin-left: -16px;
  }

  .category_tabs {
    gap: 24px;
    padding: 0 16px;
  }

  .mobile_filter_bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
  }

  .filter_toggle {
    min-width: 84px;
  }

  .mobile_filter_count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 10px;
    color: #fff;
    background: #0469e3;
    font-size: 11px;
  }

  .article_hub_layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .filter_panel {
    position: static;
    display: none;
    max-height: none;
    padding: 0 0 18px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #dfe3e8;
  }

  .filter_panel.is_open {
    display: block;
  }

  .filter_group {
    padding: 14px 0 12px;
  }

  fieldset.filter_group {
    padding-top: 0;
  }

  fieldset.filter_group legend {
    margin-top: 14px;
  }

  .filter_options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }

  .filter_options.is_collapsed .filter_option:nth-child(n + 7) {
    display: grid;
  }

  .expand_options {
    display: none;
  }
}

@media screen and (max-width: 520px) {
  .article_hub {
    width: 100%;
    padding: 22px 14px 48px;
  }

  .page_header h1 {
    font-size: 28px;
  }

  .search_form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .clear_search {
    display: none;
  }

  .search_submit {
    min-width: 64px;
    padding: 0 13px;
  }

  .category_nav {
    margin-right: -14px;
    margin-left: -14px;
  }

  .category_tabs {
    padding: 0 14px;
  }

  .active_filters {
    align-items: flex-start;
  }

  .results_toolbar {
    align-items: flex-start;
  }

  .results_controls {
    display: grid;
    grid-template-columns: auto auto;
  }

  .result_count {
    grid-column: 1 / -1;
    margin: 0;
    text-align: right;
  }

  .article_card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 132px;
    gap: 12px;
    padding: 12px;
  }

  .article_cover {
    width: 104px;
  }

  .article_card_title {
    font-size: 15px;
  }

  .article_card_description {
    -webkit-line-clamp: 2;
  }

  .article_tag:nth-child(n + 3) {
    display: none;
  }
}
