/* =========================================================
   STAR — Tools archive (archive-topic.php) — redesign
   Source: demo pages/star-tools/css/style.css
   Breakpoints: 1439px / 1199px / 1023px / 767px (max-width)
   Fonts (galano, mori, recoleta) are loaded by dist/css/app.css.
   ========================================================= */

/* ---------- Scoped base (replaces the demo's global reset) ---------- */
:where(.tl-hero, .tl-topics),
:where(.tl-hero, .tl-topics) *,
:where(.tl-hero, .tl-topics) *::before,
:where(.tl-hero, .tl-topics) *::after {
  box-sizing: border-box;
}

:where(.tl-hero, .tl-topics) :where(h1, h2, p, ul, ol, dl, dd) {
  margin: 0;
}

:where(.tl-hero, .tl-topics) :where(ul, ol) {
  padding: 0;
  list-style: none;
}

:where(.tl-hero, .tl-topics) :where(a) {
  color: inherit;
  text-decoration: none;
}

:where(.tl-hero, .tl-topics) :where(img, svg) {
  display: block;
  max-width: 100%;
}

:where(.tl-hero, .tl-topics) :where(button) {
  font: inherit;
  cursor: pointer;
}

:where(.tl-hero, .tl-topics) :focus-visible {
  outline: 2px solid #6C2975;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  :where(.tl-hero, .tl-topics) *,
  :where(.tl-hero, .tl-topics) *::before,
  :where(.tl-hero, .tl-topics) *::after {
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   BREADCRUMBS
   ========================================================= */
.tl-breadcrumbs {
  position: absolute;
  top: 0;
  left: 5.291vw;
}

.tl-breadcrumbs__list {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 0 0 20px 20px;
  background-color: #F1F1F1;
  font-family: "recoleta", "Fraunces", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: #10477C;
}

.tl-breadcrumbs__list a:hover {
  color: #6C2975;
}

/* =========================================================
   HERO
   ========================================================= */
.tl-hero {
  position: relative;
  padding: 80px 5.291vw 30px;
  background-color: #A9E4DE;
  color: #10477C;
}

.tl-hero__title {
  margin-bottom: 15px;
  font-family: "galano", "Outfit", sans-serif;
  font-size: clamp(32px, 3.3333vw, 48px);
  font-weight: 700;
  line-height: 1.0526;
  letter-spacing: -0.0208em;
}

.tl-hero__copy {
  max-width: 570px;
  margin-bottom: 13px;
  font-size: clamp(13px, 0.9259vw, 15px);
  line-height: 1.7143;
}

.tl-hero__copy p + p {
  margin-top: 1em;
}

/* =========================================================
   TOPICS FEED
   ========================================================= */
.tl-topics {
  padding: 2.6455vw 5.291vw 10.25vw;
  background: linear-gradient(to bottom, #A9E4DE 300px, #F0F1EC 300px);
}

/* ---------- Sticky column labels ---------- */
.tl-column-labels {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 42px;
}

.tl-column-labels__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 27px;
  border-radius: 9999px;
  background-color: #5BC6D0;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  letter-spacing: 0.36px;
  text-transform: uppercase;
  color: #fff;
}

/* ---------- Tooltip ---------- */
.tl-tooltip {
  position: relative;
  display: inline-flex;
  margin-left: 4px;
}

.tl-tooltip__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  transition: background-color 0.2s ease;
}

.tl-tooltip__content {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 20;
  width: 250px;
  max-width: 320px;
  padding: 16px 20px;
  border-radius: 8px;
  background-color: #10477C;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tl-tooltip__content::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  border: 8px solid transparent;
  border-bottom-color: #10477C;
  transform: translateX(-50%);
}

.tl-tooltip:hover .tl-tooltip__trigger,
.tl-tooltip__trigger:focus-visible,
.tl-tooltip.is-open .tl-tooltip__trigger {
  background-color: rgba(255, 255, 255, 0.3);
}

.tl-tooltip:hover .tl-tooltip__content,
.tl-tooltip__trigger:focus-visible + .tl-tooltip__content,
.tl-tooltip.is-open .tl-tooltip__content {
  opacity: 1;
  visibility: visible;
}

.tl-tooltip.is-dismissed .tl-tooltip__content {
  opacity: 0;
  visibility: hidden;
}

/* ---------- Topic list ---------- */
.tl-topic-list {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 2.9167vw, 42px);
}

.tl-topic-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: clamp(20px, 2.5vw, 36px);
  border-radius: 40px;
  background-color: #fff;
}

.tl-topic-row__domain {
  padding: clamp(5px, 1.3889vw, 20px);
}

.tl-topic-row__icon {
  display: block;
  width: 70px;
  height: 70px;
  color: #ED4A38;
}

.tl-topic-row__icon svg,
.tl-topic-row__icon img {
  width: 100%;
  height: 100%;
}

.tl-topic-row__icon svg :is(path, circle, rect, ellipse, polygon):not([fill="none"]) {
  fill: currentColor;
}

.tl-topic-row__title {
  font-family: "mori", serif;  
  font-size: clamp(21.6px, 2.2619vw, 34.2px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: #000;
}

.tl-topic-row__title a:hover {
  text-decoration: underline;
}

.tl-topic-row__description {
  margin-top: 7px;
  font-size: var(--font-size--6, 18px);
  line-height: 24px;
  color: #7A7A7A;
}

.tl-topic-row__link {
  display: inline-flex;
  margin-top: 38px;
  color: #6C2975;
}

.tl-topic-row__link svg {
  width: 42px;
  height: 42px;
}

.tl-topic-row__col {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  padding: clamp(20px, 2.2487vw, 34px);
  border-radius: 20px;
  background-color: rgba(91, 198, 208, 0.1);
}

.tl-topic-row__col dt {
  align-self: start;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #5BC6D0;
}

.tl-topic-row__col dd {
  font-size: var(--font-size--6);
  font-weight: 700;
  line-height: 1.4;
  color: #000;
}

/* =========================================================
   RESPONSIVE — max-width 1439px
   ========================================================= */
@media (max-width: 1439px) {
  .tl-topic-row {
    gap: 16px;
  }

  .tl-column-labels {
    gap: 8px;
  }

  .tl-column-labels__item {
    padding: 14px 24px;
  }
}

/* =========================================================
   RESPONSIVE — max-width 1199px
   ========================================================= */
@media (max-width: 1199px) {
  .tl-hero {
    padding-top: 72px;
  }

  .tl-topic-row {
    border-radius: 32px;
  }

  .tl-topic-row__icon {
    width: 60px;
    height: 60px;
  }

  .tl-topic-row__link {
    margin-top: 28px;
  }

  .tl-topic-row__link svg {
    width: 36px;
    height: 36px;
  }
}

/* =========================================================
   RESPONSIVE — max-width 1023px
   (labels move into each card; domain spans two rows)
   ========================================================= */
@media (max-width: 1023px) {
  .tl-breadcrumbs {
    left: 40px;
  }

  .tl-hero {
    padding: 72px 40px 32px;
  }

  .tl-topics {
    padding: 24px 40px 80px;
    background: linear-gradient(to bottom, #A9E4DE 200px, #F0F1EC 200px);
  }

  .tl-column-labels {
    display: none;
  }

  .tl-topic-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
  }

  .tl-topic-row__domain {
    grid-row: 1 / 3;
  }

  .tl-topic-row__col {
    grid-template-rows: auto auto;
    gap: 12px;
  }
}

/* =========================================================
   RESPONSIVE — max-width 767px
   ========================================================= */
@media (max-width: 767px) {
  .tl-breadcrumbs {
    left: 20px;
  }

  .tl-breadcrumbs__list {
    padding: 8px 14px;
    font-size: 14px;
  }

  .tl-hero {
    padding: 64px 20px 28px;
  }

  .tl-hero__title {
    margin-bottom: 14px;
    line-height: 1.1;
  }

  .tl-topics {
    padding: 8px 20px 64px;
  }

  .tl-topic-row {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 12px;
    padding: 20px 16px 16px;
    border-radius: 28px;
  }

  .tl-topic-row__domain {
    grid-row: auto;
    padding: 4px 4px 8px;
  }

  .tl-topic-row__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
  }

  .tl-topic-row__title {
    font-size: 22px;
  }

  .tl-topic-row__description {
    font-size: 15px;
    line-height: 22px;
  }

  .tl-topic-row__link {
    margin-top: 18px;
  }

  .tl-topic-row__col {
    padding: 18px 16px;
    border-radius: 16px;
  }
}

/* =========================================================
   LOGGED-IN: keep the sticky column labels below the WP admin bar
   (32px tall above 782px, 46px at 782px and below, not fixed at 600px and below)
   ========================================================= */
.admin-bar .tl-column-labels {
  top: calc(10px + 32px);
}

@media (max-width: 782px) {
  .admin-bar .tl-column-labels {
    top: calc(10px + 46px);
  }
}

@media (max-width: 600px) {
  .admin-bar .tl-column-labels {
    top: 10px;
  }
}
