/* JC Discovery 1.0.0 */
.jc-discovery {
  --jc-d-bg: #f6f6f4;
  --jc-d-surface: #fff;
  --jc-d-text: #151515;
  --jc-d-muted: #626262;
  --jc-d-line: #d9d9d5;
  --jc-d-soft: #ececea;
  --jc-d-accent: #111;
  min-height: 70vh;
  background: #000;
  color: var(--jc-d-text);
  font-family: inherit;
}

.jc-discovery * {
  box-sizing: border-box;
}

.jc-discovery__shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.jc-discovery__hero {
  padding: 0;
  background: #000;
}

.jc-discovery__hero .jc-discovery__shell {
  padding: clamp(32px, 4.5vw, 58px) clamp(20px, 3vw, 34px) 28px;
  border-bottom: 1px solid var(--jc-d-line);
  background: var(--jc-d-surface);
}

.jc-discovery__eyebrow {
  margin: 0 0 8px;
  color: var(--jc-d-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.jc-discovery h1 {
  margin: 0 0 18px;
  color: var(--jc-d-text);
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
}

.jc-discovery-form {
  position: relative;
}

.jc-discovery__search {
  width: 100%;
}

.jc-discovery__search > label {
  display: block;
  margin-bottom: 9px;
  color: var(--jc-d-text);
  font-size: 14px;
  font-weight: 700;
}

.jc-discovery__search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid #a9a9a3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--jc-d-surface);
}

.jc-discovery__search-row input {
  min-width: 0;
  min-height: 58px;
  padding: 13px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--jc-d-text);
  font: inherit;
  font-size: 17px;
}

.jc-discovery__search-row input::placeholder {
  color: #73736e;
  opacity: 1;
}

.jc-discovery__search-row input:focus {
  outline: 0;
  box-shadow: inset 0 0 0 3px #777;
}

.jc-discovery__search-row button,
.jc-discovery__filters button {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: var(--jc-d-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.jc-discovery__search-row button {
  min-width: 126px;
  padding: 0 22px;
}

.jc-discovery__search-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 9px;
  color: var(--jc-d-muted);
  font-size: 12px;
}

.jc-discovery__clear-query {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--jc-d-text);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.jc-discovery__body {
  padding: 18px clamp(16px, 2.6vw, 30px) 80px;
  background: var(--jc-d-bg);
}

.jc-discovery__filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--jc-d-line);
  border-radius: 10px;
  background: var(--jc-d-surface);
}

.jc-discovery__filters label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--jc-d-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.jc-discovery__filters select {
  width: 100%;
  min-height: 44px;
  padding: 8px 34px 8px 11px;
  border: 1px solid #bdbdb7;
  border-radius: 6px;
  background: var(--jc-d-surface);
  color: var(--jc-d-text);
  font: inherit;
  font-size: 13px;
}

.jc-discovery__filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jc-discovery__filter-actions button {
  padding-inline: 16px;
  border-radius: 6px;
}

.jc-discovery__filter-actions a {
  color: var(--jc-d-text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.jc-discovery__summary {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--jc-d-line);
  background: var(--jc-d-bg);
  color: var(--jc-d-muted);
  font-size: 17px;
  line-height: 1.35;
}

.jc-discovery__summary strong {
  color: var(--jc-d-text);
  font-size: 18px;
  font-weight: 800;
}

.jc-discovery__term {
  color: var(--jc-d-text);
  font-size: 22px;
  font-weight: 820;
  letter-spacing: -.02em;
}

.jc-discovery__results {
  padding-inline: clamp(14px, 2vw, 24px);
  background: var(--jc-d-surface);
}

.jc-discovery-result {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 34px);
  margin: 0;
  padding: 28px 0;
  border-bottom: 1px solid var(--jc-d-line);
}

.jc-discovery-result__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 7px;
  background: var(--jc-d-soft);
}

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

.jc-discovery-result__fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #777771;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -.05em;
}

.jc-discovery-result.is-page .jc-discovery-result__fallback {
  background: #e2e2de;
  color: #4d4d49;
}

.jc-discovery-result__taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--jc-d-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.jc-discovery-result h2 {
  margin: 0;
  color: var(--jc-d-text);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 780;
  letter-spacing: -.025em;
  line-height: 1.18;
}

.jc-discovery-result h2 a {
  color: inherit;
  text-decoration: none;
}

.jc-discovery-result h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.jc-discovery-result p {
  max-width: 72ch;
  margin: 12px 0 0;
  color: var(--jc-d-muted);
  font-size: 15px;
  line-height: 1.62;
}

.jc-discovery-result mark {
  padding: 0 .08em;
  border-radius: 2px;
  background: #fff0ae;
  color: #191919;
}

.jc-discovery-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 15px;
  color: var(--jc-d-muted);
  font-size: 12px;
}

.jc-discovery__pagination {
  padding: 30px 0 4px;
}

.jc-discovery__pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jc-discovery__pagination a,
.jc-discovery__pagination span {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--jc-d-line);
  border-radius: 5px;
  background: var(--jc-d-surface);
  color: var(--jc-d-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.jc-discovery__pagination .current {
  border-color: var(--jc-d-accent);
  background: var(--jc-d-accent);
  color: #fff;
}

.jc-discovery__pagination .prev,
.jc-discovery__pagination .next {
  min-width: auto;
  padding-inline: 20px;
}

.jc-discovery__empty {
  margin-top: 28px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--jc-d-line);
  background: var(--jc-d-surface);
  text-align: center;
}

.jc-discovery__empty h2 {
  margin: 0 0 12px;
  color: var(--jc-d-text);
  font-size: clamp(25px, 3vw, 36px);
}

.jc-discovery__empty p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--jc-d-muted);
  line-height: 1.65;
}

.jc-discovery__empty-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-top: 22px;
}

.jc-discovery__empty-links a {
  color: var(--jc-d-text);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.jc-discovery :is(a, button, input, select):focus-visible,
.jc-discovery-suggestions a:focus-visible {
  outline: 3px solid #4676b8;
  outline-offset: 3px;
}

.jc-discovery-suggestions {
  position: absolute;
  z-index: 10020;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: min(430px, 65vh);
  overflow-y: auto;
  border: 1px solid #c8c8c3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
  color: #161616;
}

.jc-native-search-form .jc-discovery-suggestions {
  top: calc(100% + 8px);
  min-width: min(430px, 92vw);
}

.jc-discovery-suggestions[hidden] {
  display: none !important;
}

.jc-discovery-suggestions__status {
  margin: 0;
  padding: 13px 15px;
  color: #5f5f5a;
  font-size: 12px;
}

.jc-discovery-suggestions a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 15px;
  border-top: 1px solid #e6e6e2;
  color: #191919;
  text-decoration: none;
}

.jc-discovery-suggestions a:first-child {
  border-top: 0;
}

.jc-discovery-suggestions a:hover,
.jc-discovery-suggestions a.is-active {
  background: #f0f0ed;
}

.jc-discovery-suggestions__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.jc-discovery-suggestions__type {
  color: #666660;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .jc-discovery__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jc-discovery__filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .jc-discovery__shell {
    width: min(100% - 28px, 1120px);
  }

  .jc-discovery__hero {
    padding: 0;
  }

  .jc-discovery__hero .jc-discovery__shell {
    padding: 30px 16px 22px;
  }

  .jc-discovery__body {
    padding: 14px 12px 64px;
  }

  .jc-discovery__search-row {
    grid-template-columns: 1fr;
    overflow: visible;
    border: 0;
    background: transparent;
    gap: 8px;
  }

  .jc-discovery__search-row input {
    min-height: 52px;
    border: 1px solid #a9a9a3;
    border-radius: 8px;
    background: var(--jc-d-surface);
  }

  .jc-discovery__search-row button {
    min-height: 48px;
    border-radius: 7px;
  }

  .jc-discovery__search-help {
    align-items: flex-start;
  }

  .jc-discovery__filters {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .jc-discovery__filter-actions {
    grid-column: auto;
    justify-content: space-between;
  }

  .jc-discovery-result {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 15px;
    padding: 21px 0;
  }

  .jc-discovery__summary {
    padding: 21px 0 14px;
    font-size: 16px;
  }

  .jc-discovery__summary strong {
    font-size: 17px;
  }

  .jc-discovery__term {
    font-size: 20px;
  }

  .jc-discovery__results {
    padding-inline: 12px;
  }

  .jc-discovery__pagination .page-numbers {
    gap: 6px;
  }

  .jc-discovery__pagination .prev,
  .jc-discovery__pagination .next {
    padding-inline: 16px;
  }

  .jc-discovery-result h2 {
    font-size: 19px;
  }

  .jc-discovery-result p {
    display: none;
  }

  .jc-discovery-result__taxonomy {
    font-size: 9px;
  }

  .jc-discovery-result__meta {
    margin-top: 10px;
    font-size: 10px;
  }
}

@media (max-width: 374px) {
  .jc-discovery-result {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .jc-discovery-result h2 {
    font-size: 17px;
  }

  .jc-discovery__pagination a,
  .jc-discovery__pagination span {
    min-width: 38px;
    min-height: 38px;
    padding-inline: 9px;
  }

  .jc-discovery__pagination .prev,
  .jc-discovery__pagination .next {
    padding-inline: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  .jc-discovery {
    --jc-d-bg: #111214;
    --jc-d-surface: #191a1d;
    --jc-d-text: #f2f2f0;
    --jc-d-muted: #b5b5af;
    --jc-d-line: #383a3f;
    --jc-d-soft: #25272b;
    --jc-d-accent: #f1f1ee;
  }

  .jc-discovery__search-row button,
  .jc-discovery__filters button,
  .jc-discovery__pagination .current {
    color: #111;
  }

  .jc-discovery-result.is-page .jc-discovery-result__fallback {
    background: #292b2f;
    color: #d1d1cc;
  }

  .jc-discovery__term {
    color: #fff;
  }
}

body.jc-dark-mode .jc-discovery,
body[data-theme="dark"] .jc-discovery {
  --jc-d-bg: #111214;
  --jc-d-surface: #191a1d;
  --jc-d-text: #f2f2f0;
  --jc-d-muted: #b5b5af;
  --jc-d-line: #383a3f;
  --jc-d-soft: #25272b;
  --jc-d-accent: #f1f1ee;
}

body.jc-dark-mode .jc-discovery__term,
body[data-theme="dark"] .jc-discovery__term {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .jc-discovery *,
  .jc-discovery-suggestions * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}


/* JC DISCOVERY R2 - SEARCH BACKGROUND
 * Escopo exclusivo da pagina de pesquisa.
 * Preserva header, footer e componentes globais.
 */

/* Fundo externo da area de pesquisa. */
body.search.jc-discovery-page #main-content.jc-discovery {
    background: #000 !important;
}

/* Fundo externo do hero. */
body.search.jc-discovery-page #main-content.jc-discovery
.jc-discovery__hero {
    background: #000 !important;
}

/* Hero integralmente preto no modo escuro do sistema. */
@media (prefers-color-scheme: dark) {
    body.search.jc-discovery-page #main-content.jc-discovery
    .jc-discovery__hero > .jc-discovery__shell {
        background: #000 !important;
    }
}

/* Hero integralmente preto no modo escuro do JC. */
body.search.jc-discovery-page.jc-dark-mode
#main-content.jc-discovery
.jc-discovery__hero > .jc-discovery__shell,

body.search.jc-discovery-page[data-theme="dark"]
#main-content.jc-discovery
.jc-discovery__hero > .jc-discovery__shell {
    background: #000 !important;
}

/* END JC DISCOVERY R2 - SEARCH BACKGROUND */

