/* Shared topic/keyword control: filter on the left, read state on the right. */
.homepageTopicControls {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto 36px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #f2f4f7;
  color: #626974;
  font: 400 20px/1.4 'Jost', sans-serif;
}

.homepageTopic {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 8px 0 16px;
  border-right: 1px solid #dbe3eb;
}

.homepageTopicLabel {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #343d49;
}

.homepageTopicName { position: relative; min-width: 0; max-width: 22ch; }
.homepageTopicLabel:focus-visible { outline: 2px solid #087bbe; outline-offset: 3px; }
.homepageTopicFull {
  display: none;
  position: absolute;
  z-index: 10;
  top: calc(100% + 12px);
  left: 0;
  width: max-content;
  max-width: min(28rem, calc(100vw - 64px));
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #343d49;
  box-shadow: 0 4px 20px #25364b26;
  overflow-wrap: anywhere;
}
.homepageTopicName.isExpanded .homepageTopicFull,
.homepageTopicName:focus-within .homepageTopicFull { display: block; }
@media (hover: hover) {
  .homepageTopicName:hover .homepageTopicFull { display: block; }
}

#homepageTopicClear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  min-height: 40px;
  border-radius: 7px;
  color: #626974;
  text-decoration: none;
  font: inherit;
  font-size: 24px;
}

#homepageTopicClear:hover { color: #087bbe; background: white; }
#homepageTopicClear:focus-visible { outline: 2px solid #087bbe; outline-offset: 2px; }

.homepageTopicControls .homepageTabs {
  margin: 0;
  padding: 0 0 0 4px;
  max-width: none;
  flex-shrink: 0;
  font: inherit;
}

@media (max-width: 520px) {
  .homepageTopicControls { font-size: 16px; }
  .homepageTopic { padding: 0 4px 0 8px; gap: 0; }
  .homepageTopicControls .homepageTabs a { padding: 8px 10px; }
  .homepageFilterLong { flex-direction: column; }
  .homepageFilterLong .homepageTopic {
    align-self: stretch;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid #dbe3eb;
  }
  .homepageFilterLong .homepageTopicName { max-width: min(24ch, calc(100vw - 96px)); }
  .homepageFilterLong .homepageTabs { padding: 4px 0 0; }
}
