/*
 * TYPO3 topic page alignment for the former static template unterseite-01.html.
 * This file only adapts TYPO3/fluid_styled_content wrappers to the existing
 * local template classes. It does not redefine the global header/footer/icon styles.
 */

/* Intro: TYPO3 wraps the headline/text in .content-area and .frame; the original
   template used .topic-page-intro.text-center with direct h1/h2/p children. */
.topic-page-intro-section {
  padding: 42px 0 0 0;
}

.topic-page-intro {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.topic-page-intro .content-area,
.topic-page-intro .frame,
.topic-page-intro header {
  margin: 0;
  padding: 0;
}

.topic-page-intro .frame > *:last-child,
.topic-page-scroll-button-content .frame > *:last-child,
.topic-page-category-section .content-area .frame > *:last-child,
.topic-page-info-bar .frame > *:last-child,
.topic-page-article .frame > *:last-child {
  margin-bottom: 0;
}

/* Scroll teaser/button: in the static template this was .topic-page-jump inside
   the intro section. In TYPO3 it is a dedicated editable content area. */
.topic-page-scroll-button-section {
  padding: 42px 0 40px 0;
  background: #fff;
  color: #000;
}

.topic-page-scroll-button-content,
.topic-page-scroll-button-content .content-area {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}

.topic-page-scroll-button-content .frame {
  margin: 0;
  padding: 0;
}

.topic-page-scroll-button-content p {
  margin: 0 0 20px 0;
  font-size: clamp(1.2rem, 1.55vw, 1.65rem);
  line-height: 1.08;
  font-weight: 600;
}

.topic-page-scroll-button-content .frame-layout-112 p {
  margin: 0;
}

/* Category/product tile intro: the original template used .product-overview-intro.
   The TYPO3 version keeps this text editable in a normal content area. */
.topic-page-category-section .content-area {
  margin: 0 0 58px 0;
  text-align: center;
}

.topic-page-category-section .content-area .frame,
.topic-page-category-section .content-area header {
  margin: 0;
  padding: 0;
}

.topic-page-category-section .content-area h1,
.topic-page-category-section .content-area h2 {
  margin: 0 0 6px 0;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-page-category-section .content-area p {
  margin: 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.15;
  font-weight: 600;
}

/* Info strip: the original had one h2.topic-page-info-bar. TYPO3 renders an
   editable area inside the yellow bar, so normalize nested headings/frames. */
.topic-page-info-strip-section {
  padding: 0;
  background: #fff;
  color: #000;
  scroll-margin-top: 164px;
}

.topic-page-info-strip-section .topic-page-info-bar {
  margin: 0 0 34px 0;
  padding: 6px 18px;
  background: #fdc815;
  color: #000;
  text-align: center;
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  line-height: 1.1;
  font-weight: 600;
}

.topic-page-info-strip-section .topic-page-info-bar .content-area,
.topic-page-info-strip-section .topic-page-info-bar .frame,
.topic-page-info-strip-section .topic-page-info-bar header {
  margin: 0;
  padding: 0;
}

.topic-page-info-strip-section .topic-page-info-bar h1,
.topic-page-info-strip-section .topic-page-info-bar h2,
.topic-page-info-strip-section .topic-page-info-bar h3,
.topic-page-info-strip-section .topic-page-info-bar p {
  margin: 0;
  padding: 0;
  font: inherit;
  line-height: inherit;
  color: inherit;
}

/* Article body: match the static .topic-page-article despite TYPO3 frame wrappers. */
.topic-page-info-section {
  padding: 0 0 34px 0;
  background: #fff;
  color: #000;
}

.topic-page-article,
.topic-page-article .content-area {
  max-width: 880px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.28;
  font-weight: 500;
}

.topic-page-article .frame,
.topic-page-article header {
  margin: 0;
  padding: 0;
}

.topic-page-article h2,
.topic-page-article h3,
.topic-page-article h4 {
  margin: 0 0 8px 0;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  line-height: 1.08;
  font-weight: 600;
}

.topic-page-article h4,
.topic-page-article h3 + h4,
.topic-page-article p + h2,
.topic-page-article p + h3,
.topic-page-article p + h4,
.topic-page-article ul + h2,
.topic-page-article ul + h3,
.topic-page-article ul + h4 {
  margin-top: 18px;
}

.topic-page-article p {
  margin: 0 0 12px 0;
}

.topic-page-article ul {
  margin: 0 0 14px 1.2em;
  padding: 0;
}

/* Keep the dynamic square tiles, but normalize TYPO3-specific image output. */
.topic-page-product-tile-grid {
  align-items: stretch;
}

.topic-page-product-tile {
  aspect-ratio: 1 / 1;
}

.topic-page-product-tile-image,
.topic-page-product-tile-img {
  display: block;
}

.topic-page-product-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Contrast modes for the split TYPO3 sections. */
body.theme-mono-light .topic-page-scroll-button-section,
body.theme-mono-light .topic-page-info-strip-section,
body.theme-mono-light .topic-page-info-section {
  background: #fff !important;
  color: #000 !important;
}

body.theme-mono-light .topic-page-info-strip-section .topic-page-info-bar {
  background: #fff !important;
  color: #000 !important;
  border: 1px solid #000 !important;
}

body.theme-mono-dark .topic-page-scroll-button-section,
body.theme-mono-dark .topic-page-info-strip-section,
body.theme-mono-dark .topic-page-info-section {
  background: #000 !important;
  color: #fff !important;
}

body.theme-mono-dark .topic-page-info-strip-section .topic-page-info-bar {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

@media (max-width: 767.98px) {
  .topic-page-intro-section {
    padding-top: 30px;
  }

  .topic-page-intro h2 {
    font-size: 1.5rem;
  }

  .topic-page-scroll-button-section {
    padding-top: 34px;
  }

  .topic-page-category-section {
    padding-bottom: 44px;
  }

  .topic-page-info-strip-section .topic-page-info-bar {
    margin-bottom: 28px;
  }

  .topic-page-article,
  .topic-page-article .content-area {
    font-size: 0.98rem;
  }
}
