/* ============================================================
   ycbk-topics — curated topics browser.
   All classes prefixed .ycbk-topics__ to prevent Avada/Thrive
   CSS collisions.
   ============================================================ */

#ycbk-topics-root,
#ycbk-topics-root * {
  box-sizing: border-box;
}

#ycbk-topics-root {
  font-family: 'Open Sans', Arial, sans-serif;
  color: #222;
  line-height: 1.6;
  background: #fff;
}

/* --- Hero --- */
/* Selectors prefixed with #ycbk-topics-root outrank Avada's content
   styles (e.g. .fusion-content h1, .fusion-text p) without using !important. */
#ycbk-topics-root .ycbk-topics__hero {
  background: #0a5d91;
  color: #fff;
  text-align: center;
  padding: 12px 24px;
  border-bottom: 3px solid #f5a623;
}

#ycbk-topics-root .ycbk-topics__subtitle {
  font-size: 14px;
  max-width: 640px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.45;
  text-align: center;
  color: #fff;
}

/* --- Filter bar --- */
.ycbk-topics__filter-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ycbk-topics__filter {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  color: #222;
  background: #fff;
}

.ycbk-topics__filter:focus-visible {
  border-color: #0a5d91;
  outline: 2px solid #0a5d91;
  outline-offset: 2px;
}

.ycbk-topics__filter-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 8px;
  display: flex;
  align-items: center;
  font-family: inherit;
}

.ycbk-topics__filter-clear:hover {
  color: #0a5d91;
}

.ycbk-topics__filter-clear:focus-visible {
  outline: 2px solid #0a5d91;
  outline-offset: 2px;
  border-radius: 4px;
}

.ycbk-topics__filter-clear svg {
  width: 16px;
  height: 16px;
}

/* --- Count label --- */
.ycbk-topics__count {
  text-align: center;
  color: #777;
  font-size: 13px;
  padding: 12px 24px 4px;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Topic list --- */
.ycbk-topics__list {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ycbk-topics__topic {
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s;
}

.ycbk-topics__topic:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.ycbk-topics__topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: 12px;
  color: #222;
}

.ycbk-topics__topic-header:hover {
  background: #f5f7f9;
}

.ycbk-topics__topic-header:focus-visible {
  outline: 2px solid #0a5d91;
  outline-offset: -2px;
}

.ycbk-topics__topic-name {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.ycbk-topics__topic-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ycbk-topics__topic-badge {
  background: #0a5d91;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ycbk-topics__topic-arrow {
  color: #999;
  transition: transform 0.2s;
  width: 12px;
  height: 12px;
}

.ycbk-topics__topic--open .ycbk-topics__topic-arrow {
  transform: rotate(90deg);
}

/* --- Episode list --- */
.ycbk-topics__episodes {
  list-style: none;
  padding: 0 16px 12px;
  margin: 0;
  border-top: 1px solid #f0f0f0;
}

.ycbk-topics__episodes li {
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ycbk-topics__episodes li:last-child {
  border-bottom: none;
}

.ycbk-topics__ep-num {
  color: #999;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 40px;
}

.ycbk-topics__episodes a {
  color: #0a5d91;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
}

.ycbk-topics__episodes a:hover {
  text-decoration: underline;
  color: #f5a623;
}

.ycbk-topics__episodes a:focus-visible {
  outline: 2px solid #0a5d91;
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Empty state --- */
.ycbk-topics__empty {
  text-align: center;
  color: #777;
  padding: 40px 0;
  font-size: 15px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  #ycbk-topics-root .ycbk-topics__hero { padding: 10px 16px; }
  .ycbk-topics__filter-wrap { padding: 16px 16px 0; }
  .ycbk-topics__list { padding: 8px 16px 40px; }
  .ycbk-topics__topic-header { padding: 10px 12px; }
  .ycbk-topics__topic-name { font-size: 13px; }
  .ycbk-topics__episodes { padding: 0 12px 10px; }
}
