/* Maße der Themenkarten aus der angehängten Besuchen-Vorlage. */
html:has(.learning-home) { scrollbar-width: none; }
html:has(.learning-home)::-webkit-scrollbar { display: none; }
.study-topics > .container {
  width: 100%;
  padding-inline: clamp(28px, 4vw, 64px);
}
.study-topics .section-heading,
.study-topics .topic-tools,
.study-topics .search-status {
  max-width: 1180px;
  margin-inline: auto;
}
.study-topics .topics-grid {
  --cards-gap: clamp(20px, 3.2vh, 36px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: calc((min(76vh, 660px) - 2 * var(--cards-gap)) / 3);
  gap: var(--cards-gap);
  width: min(100%, 1180px);
  height: auto;
  margin: 0 auto;
}
.study-topics .topic-card {
  grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr);
  align-items: stretch;
  gap: clamp(10px, 1vw, 16px);
  min-width: 0;
  min-height: 0;
  padding: clamp(10px, 1.2vh, 16px);
  border-radius: clamp(18px, 1.7vw, 26px);
  border: 0;
  color: #000;
}
.study-topics .topic-card-media {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: clamp(10px, 1vw, 15px);
}
.study-topics .topic-card-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.study-topics .topic-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1.1vh, 12px);
  min-width: 0;
  min-height: 0;
  padding: 0;
}
.study-topics .topic-card h3 {
  padding-top: clamp(4px, .7vh, 7px);
  font-size: clamp(16px, min(1.6vw, 3.2vh), 25px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.025em;
  max-height: calc(4.05em + clamp(4px, .7vh, 7px));
  overflow: hidden;
}
.study-topics .topic-card h3 .highlight {
  padding: .04em .18em .07em;
  background: #fff;
}
.study-topics .topic-card-body > p {
  margin: 0;
  font-size: clamp(12px, min(1.08vw, 2.15vh), 16px);
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.study-topics .card-bottom {
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 2px 10px;
  font-size: 11px;
  line-height: 1.4;
}
@media (max-width: 700px) and (orientation: portrait) {
  .study-topics .topics-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: minmax(160px, auto);
    height: auto;
    max-width: 480px;
    gap: 24px;
  }
  .study-topics .topic-card h3 { font-size: 22px; max-height: none; overflow: visible; }
  .study-topics .topic-card-body > p { display: block; font-size: 16px; overflow: visible; }
}
/* Im flachen Handy-Querformat bleiben die Karten lesbar. */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .study-topics .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(180px, auto); }
  .study-topics .topic-card-body > p { display: block; overflow: visible; }
}
