.topic-hero {
  padding: 48px 24px 32px;
  border-bottom: 4px solid var(--bauhaus-black);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.topic-hero::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bauhaus-red);
  border: 3px solid var(--bauhaus-black);
  border-radius: 50%;
  right: 12%;
  top: 20px;
  opacity: 0.7;
}

.topic-hero h1 {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(1.8rem, 4vw, 3rem);
  text-transform: lowercase;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.topic-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.topic-wrap h2 {
  font-size: 1.35rem;
  margin: 32px 0 12px;
  text-transform: lowercase;
  border-bottom: 3px solid var(--bauhaus-black);
  padding-bottom: 8px;
  display: inline-block;
}

.topic-wrap h3 {
  font-size: 1.05rem;
  margin: 20px 0 8px;
  text-transform: lowercase;
  color: var(--primary);
}

.topic-wrap p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 15px;
}

.topic-wrap ul {
  padding-left: 20px;
  margin: 12px 0 20px;
  color: var(--muted);
}

.topic-wrap li {
  margin-bottom: 8px;
}

.topic-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

.topic-rail {
  border: 4px solid var(--bauhaus-black);
  background: var(--bauhaus-yellow);
  color: var(--bauhaus-black);
  padding: 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: lowercase;
  position: sticky;
  top: 80px;
}

.topic-stat-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.topic-stat-band div {
  border: 3px solid var(--bauhaus-black);
  background: var(--surface);
  padding: 16px;
  text-align: center;
}

.topic-stat-band strong {
  display: block;
  font-size: 20px;
  color: var(--bauhaus-yellow);
}

.topic-stat-band span {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}

.topic-pull {
  border: 4px solid var(--bauhaus-black);
  border-left: 14px solid var(--bauhaus-blue);
  padding: 20px 24px;
  margin: 24px 0;
  background: var(--surface);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.topic-bg-band {
  margin: 28px 0;
  min-height: 160px;
  border: 4px solid var(--bauhaus-black);
  background-size: cover;
  background-position: center;
  max-width: 100%;
}

.topic-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.topic-table th,
.topic-table td {
  border: 2px solid var(--bauhaus-black);
  padding: 10px 12px;
  text-align: left;
  color: var(--muted);
}

.topic-table th {
  background: var(--surface);
  color: var(--text);
  text-transform: lowercase;
}

.layout-ruletti .topic-hero {
  background: var(--surface);
  border-right: 24px solid var(--bauhaus-red);
}

.layout-turva .topic-split {
  grid-template-columns: 200px 1fr;
}

.layout-turva .topic-rail {
  background: var(--bauhaus-blue);
  color: var(--text);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  min-height: 280px;
  text-align: center;
}

.layout-maksut .topic-hero {
  text-align: center;
}

.layout-maksut .topic-wrap {
  max-width: 860px;
}

.layout-mobiili .topic-hero::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  background: var(--bauhaus-yellow);
  border: 3px solid var(--bauhaus-black);
  left: 8%;
  bottom: 16px;
}

@media (max-width: 800px) {
  .topic-split,
  .layout-turva .topic-split,
  .topic-stat-band {
    grid-template-columns: 1fr;
  }

  .layout-turva .topic-rail {
    writing-mode: horizontal-tb;
    transform: none;
    min-height: auto;
  }

  .topic-bg-band {
    max-width: 100%;
    min-height: 140px;
    overflow: hidden;
  }

  .topic-hero {
    overflow: hidden;
  }

  .topic-hero::before,
  .layout-mobiili .topic-hero::after {
    width: 52px;
    height: 52px;
  }

  .decor-wrap {
    max-width: 100%;
    overflow: hidden;
  }

  .decor-img {
    max-width: 100%;
    max-height: 220px;
  }
}

@media (max-width: 400px) {
  .topic-bg-band {
    min-height: 110px;
    max-width: 100%;
  }

  .decor-img {
    max-width: 100%;
    max-height: 160px;
  }

  .topic-hero::before,
  .layout-mobiili .topic-hero::after {
    width: 40px;
    height: 40px;
    right: 12px;
    left: auto;
  }
}
