.thematic-dictionary {
  --thematic-ink: var(--teber-color-text-strong);
  --thematic-muted: var(--teber-color-text-muted);
  --thematic-paper: var(--teber-color-surface);
  --thematic-line: var(--teber-color-border);
  --thematic-accent: var(--teber-color-primary);
  --thematic-accent-strong: var(--teber-color-primary-strong);
  --thematic-warm: var(--teber-color-accent);
  --thematic-wash: var(--teber-color-primary-soft);
  width: min(100%, 74rem);
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1.25rem) 0 clamp(2.25rem, 5vw, 4rem);
  color: var(--thematic-ink);
}

.thematic-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(1.4rem, 3vw, 2.25rem);
  border: 1px solid var(--thematic-line);
  border-radius: 1.1rem;
  background: var(--thematic-wash);
}

.thematic-hero--atlas {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(17rem, 0.75fr);
  gap: 2rem;
  align-items: end;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.thematic-hero--atlas::before,
.thematic-hero--atlas::after {
  position: absolute;
  content: "";
  border: 1px solid color-mix(in srgb, var(--thematic-accent) 20%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.thematic-hero--atlas::before {
  width: 13rem;
  height: 13rem;
  top: -8.5rem;
  right: 8%;
}

.thematic-hero--atlas::after {
  width: 8rem;
  height: 8rem;
  right: -4.5rem;
  bottom: -4.5rem;
}

.thematic-hero__copy,
.thematic-search {
  position: relative;
  z-index: 1;
}

.thematic-hero__mark {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--thematic-warm);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.thematic-hero__title {
  max-width: 18ch;
  margin: 0;
  color: var(--thematic-ink);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.thematic-hero__description {
  max-width: 46rem;
  margin-top: 1rem;
  color: var(--thematic-muted);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  line-height: 1.65;
}

.thematic-hero__description > :last-child {
  margin-bottom: 0;
}

.thematic-search {
  display: flex;
  align-items: center;
  min-height: 3rem;
  border: 1px solid color-mix(in srgb, var(--thematic-line) 82%, var(--thematic-accent));
  border-radius: 999px;
  background: var(--thematic-paper);
  box-shadow: var(--teber-shadow-sm);
}

.thematic-search:focus-within {
  border-color: color-mix(in srgb, var(--thematic-accent) 65%, var(--thematic-line));
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--thematic-accent) 15%, transparent);
}

.thematic-search__icon {
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 1.05rem;
  border: 1.8px solid var(--thematic-muted);
  border-radius: 50%;
}

.thematic-search__icon::after {
  display: block;
  width: 0.4rem;
  height: 1.8px;
  margin: 0.68rem 0 0 0.62rem;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
  background: var(--thematic-muted);
}

.thematic-search__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.72rem 1rem 0.72rem 0.85rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--thematic-ink);
}

.thematic-search__input::-webkit-search-cancel-button {
  cursor: pointer;
}

.thematic-topic-sections,
.thematic-entry-sections {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
}

.thematic-group__title {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 0.9rem;
  color: var(--thematic-ink);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.thematic-group__title::after {
  flex: 1 1 auto;
  height: 1px;
  content: "";
  background: var(--thematic-line);
}

.thematic-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr));
  gap: clamp(0.8rem, 2vw, 1.15rem);
}

.thematic-topic {
  display: grid;
  position: relative;
  min-height: 12.5rem;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--thematic-line) 85%, transparent);
  border-radius: 0.9rem;
  background: linear-gradient(145deg, var(--teber-color-primary), var(--teber-color-primary-strong));
  box-shadow: var(--teber-shadow-sm);
  color: var(--teber-color-on-primary);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.thematic-topic:nth-child(4n + 2) {
  background: linear-gradient(145deg, var(--teber-color-accent), var(--teber-color-accent-strong));
}

.thematic-topic:nth-child(4n + 3) {
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--teber-color-primary) 72%, var(--teber-color-accent)),
    color-mix(in srgb, var(--teber-color-primary-strong) 78%, var(--teber-color-accent-strong)));
}

.thematic-topic:nth-child(4n + 4) {
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--teber-color-primary) 48%, var(--teber-color-accent)),
    color-mix(in srgb, var(--teber-color-primary-strong) 55%, var(--teber-color-accent-strong)));
}

.thematic-topic:hover,
.thematic-topic:focus-visible {
  transform: translateY(-0.2rem);
  border-color: color-mix(in srgb, var(--thematic-accent) 45%, var(--thematic-line));
  box-shadow: var(--teber-shadow-lg);
  color: var(--teber-color-on-primary);
  text-decoration: none;
}

.thematic-topic:focus-visible {
  outline: 0.2rem solid color-mix(in srgb, var(--thematic-accent) 30%, transparent);
  outline-offset: 0.16rem;
}

.thematic-topic__image,
.thematic-topic__monogram,
.thematic-topic__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.thematic-topic__image {
  z-index: -3;
  object-fit: cover;
  transition: transform 350ms ease;
}

.thematic-topic:hover .thematic-topic__image {
  transform: scale(1.035);
}

.thematic-topic__monogram {
  display: flex;
  z-index: -2;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--teber-color-on-primary) 18%, transparent);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 9rem;
  font-weight: 800;
  line-height: 1;
}

.thematic-topic__monogram[hidden] {
  display: none;
}

.thematic-topic__shade {
  z-index: -1;
  background: linear-gradient(180deg, transparent 22%, var(--teber-image-overlay-strong) 100%);
}

.thematic-topic__name {
  align-self: end;
  min-width: 0;
  padding: 1.15rem 3rem 1.05rem 1.15rem;
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 750;
  line-height: 1.08;
  text-wrap: balance;
}

.thematic-topic__arrow {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  opacity: 0.72;
  font-size: 1.05rem;
  transition: transform 180ms ease, opacity 180ms ease;
}

.thematic-topic:hover .thematic-topic__arrow,
.thematic-topic:focus-visible .thematic-topic__arrow {
  transform: translate(0.12rem, -0.12rem);
  opacity: 1;
}

.thematic-hero--topic {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr);
  min-height: 15rem;
}

.thematic-hero--topic .thematic-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.25rem);
}

.thematic-hero--topic .thematic-hero__title {
  font-size: clamp(2.35rem, 5vw, 4rem);
}

.thematic-hero__visual {
  display: grid;
  position: relative;
  place-items: center;
  min-height: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--thematic-accent), var(--thematic-accent-strong));
}

.thematic-hero__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thematic-hero__visual.has-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(125deg, var(--teber-image-overlay-soft), var(--teber-image-overlay-strong));
}

.thematic-hero__initial {
  position: relative;
  z-index: 1;
  color: color-mix(in srgb, var(--teber-color-on-primary) 68%, transparent);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(5rem, 11vw, 8.5rem);
  font-weight: 750;
  line-height: 1;
}

.thematic-hero__visual.has-image .thematic-hero__initial {
  opacity: 0;
}

.thematic-hero__rule {
  width: 2.5rem;
  height: 0.2rem;
  margin-bottom: 1rem;
  border-radius: 99px;
  background: var(--thematic-warm);
}

.thematic-topic-tools {
  display: grid;
  grid-template-columns: minmax(16rem, 25rem) minmax(0, 1fr);
  gap: 1rem 1.5rem;
  align-items: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--thematic-line);
}

.thematic-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.thematic-alphabet:empty {
  display: none;
}

.thematic-alphabet__letter {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--thematic-line);
  border-radius: 999px;
  background: var(--thematic-paper);
  color: var(--thematic-ink);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
}

.thematic-alphabet__letter:hover,
.thematic-alphabet__letter:focus-visible,
.thematic-alphabet__letter.is-active {
  border-color: var(--thematic-accent);
  background: var(--thematic-accent);
  color: var(--teber-color-on-primary);
}

.thematic-entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.thematic-group--entries .thematic-entry-list {
  padding-top: 0.1rem;
}

.thematic-entry {
  min-width: 0;
}

.thematic-entry__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "visual visual"
    "body arrow";
  gap: 0;
  align-items: center;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--thematic-line);
  border-radius: 0.85rem;
  background: var(--thematic-paper);
  box-shadow: var(--teber-shadow-sm);
  color: var(--thematic-ink);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.thematic-entry__link:hover,
.thematic-entry__link:focus-visible {
  transform: translateY(-0.18rem);
  border-color: color-mix(in srgb, var(--thematic-accent) 48%, var(--thematic-line));
  outline: 0;
  box-shadow: var(--teber-shadow-md);
  color: var(--thematic-accent-strong);
  text-decoration: none;
}

.thematic-entry__visual {
  display: grid;
  grid-area: visual;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--thematic-accent) 12%, var(--thematic-paper));
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--thematic-line) 72%, transparent);
}

.thematic-entry__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thematic-entry__initial {
  color: var(--thematic-accent-strong);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 750;
}

.thematic-entry__initial[hidden] {
  display: none;
}

.thematic-entry__body {
  display: block;
  grid-area: body;
  min-width: 0;
  padding: 0.85rem 0.25rem 0.9rem 0.9rem;
}

.thematic-entry__name {
  display: block;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.thematic-entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.thematic-entry__tag {
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: color-mix(in srgb, var(--thematic-warm) 12%, var(--thematic-paper));
  color: color-mix(in srgb, var(--thematic-warm) 75%, var(--thematic-ink));
  font-size: 0.7rem;
  font-weight: 650;
}

.thematic-entry__arrow {
  grid-area: arrow;
  padding: 0.85rem 0.9rem 0.9rem 0.5rem;
  color: var(--thematic-muted);
  transition: transform 150ms ease, color 150ms ease;
}

.thematic-entry__link:hover .thematic-entry__arrow,
.thematic-entry__link:focus-visible .thematic-entry__arrow {
  transform: translateX(0.18rem);
  color: var(--thematic-accent);
}

.thematic-empty {
  margin: 1.5rem 0 0;
  padding: 2rem;
  border: 1px dashed var(--thematic-line);
  border-radius: 0.8rem;
  color: var(--thematic-muted);
  text-align: center;
}

.thematic-empty[hidden],
[data-thematic-entry][hidden],
[data-thematic-group][hidden] {
  display: none !important;
}

@media (max-width: 767.98px) {
  .thematic-hero--atlas {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .thematic-hero--topic {
    grid-template-columns: 6.75rem minmax(0, 1fr);
    min-height: 11rem;
  }

  .thematic-topic-tools {
    grid-template-columns: 1fr;
  }

  .thematic-alphabet {
    justify-content: flex-start;
  }
}

@media (max-width: 479.98px) {
  .thematic-hero--topic {
    grid-template-columns: 1fr;
  }

  .thematic-hero__visual {
    min-height: 7.5rem;
  }

  .thematic-hero__visual.has-image {
    min-height: 10rem;
  }

  .thematic-topic {
    min-height: 10.75rem;
  }

  .thematic-entry-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thematic-entry__body {
    padding: 0.7rem 0.15rem 0.75rem 0.7rem;
  }

  .thematic-entry__arrow {
    padding: 0.7rem 0.7rem 0.75rem 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thematic-topic,
  .thematic-topic__image,
  .thematic-topic__arrow,
  .thematic-entry__link,
  .thematic-entry__arrow {
    transition: none;
  }
}
