/* ecoTech landing-page shared CSS.
   TYPO3 compatibility principle:
   - Typography belongs to the existing ecotech.de theme.
   - Do NOT set the landing-page font family, base font size, base line height,
     heading sizes/colours or normal link styling here.
   - This file only adds the custom layout: grids, boxes, tables, buttons,
     section backgrounds and responsive behaviour.
   - All selectors are scoped to .ec-page except the custom component classes
     themselves, so the surrounding TYPO3 website remains authoritative.
*/

.ec-page {
  --ec-green: #00aec3;
  --ec-green-dark: #008a9b;
  --ec-green-soft: #eaf9fb;
  --ec-grey-900: #3c3c3b;
  --ec-grey-700: #4e5b66;
  --ec-grey-200: #e2e6e9;
  --ec-grey-100: #f6f7f8;
  --ec-white: #ffffff;

  margin: 0 0 28px 0;
}

.ec-page * {
  box-sizing: border-box;
}


.ec-page .ec-anchor {
  scroll-margin-top: 160px;
}

/* Hero */

.ec-hero {
  background: linear-gradient(135deg, #f9fbfa 0%, #ffffff 55%, var(--ec-green-soft) 100%);
  border: 1px solid var(--ec-grey-200);
  padding: 34px;
  margin-bottom: 28px;
}

.ec-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 28px;
  align-items: center;
}

.ec-hero-text {
  min-width: 0;
}

.ec-hero-grid > .ec-hero-text:only-child {
  grid-column: 1 / -1;
}

.ec-hero-image {
  margin: 0;
  background: #fff;
  border: 1px solid var(--ec-grey-200);
}

.ec-hero-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  background: var(--ec-grey-100);
  padding: 0;
}

.ec-hero-image figcaption,
.ec-image-box figcaption {
  padding: 10px 12px;
  color: var(--ec-grey-700);
  font-size: .82em;
}


/* Image placeholders retained until final TYPO3 images are inserted. */
.ec-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(0,174,195,.18) 0%, rgba(0,174,195,.06) 52%, rgba(60,60,59,.08) 100%);
  color: var(--ec-green-dark);
  text-align: center;
  padding: 22px;
  font-weight: 700;
  font-size: 18px;
}

.ec-image-placeholder span {
  display: block;
}

/* Typography
   All normal h1-h6, p, ul, ol and a typography is inherited from TYPO3.
   Only component-specific labels and spacing are defined here. */

.ec-hero-text > :first-child,
.ec-box > :first-child,
.ec-note > :first-child {
  margin-top: 0;
}

.ec-box > :last-child,
.ec-note > :last-child {
  margin-bottom: 0;
}

.ec-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ec-green-dark);
  font-size: .82em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.ec-eyebrow > span {
  min-width: 0;
}

.ec-area-icon {
  display: block;
  width: 21px !important;
  height: 21px !important;
  max-width: 21px !important;
  flex: 0 0 21px;
  object-fit: contain !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.ec-lead {
  max-width: 940px;
  margin-bottom: 22px;
}

/* .ec-muted intentionally has no colour/font rule: use TYPO3 body typography. */

/* Buttons / actions */

.ec-page .ec-actions {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  text-align: left;
}

.ec-top-actions {
  margin: 0 0 14px 0;
}

.ec-btn {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--ec-green-dark);
  font-weight: 700;
  border-radius: 3px;
}

.ec-btn:hover {
  text-decoration: none;
}

.ec-btn--primary {
  background: var(--ec-green-dark);
  color: #fff !important;
}

.ec-btn--primary:hover {
  background: var(--ec-green);
  border-color: var(--ec-green);
  color: #fff !important;
}

.ec-btn--secondary {
  background: #fff;
  color: var(--ec-green-dark) !important;
}

.ec-btn--secondary:hover {
  background: var(--ec-green-soft);
  color: var(--ec-green-dark) !important;
}

/* Contents / index box */

.ec-contents {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--ec-grey-200);
  background: #fff;
}

.ec-contents--block {
  margin-bottom: 28px;
}

.ec-hero .ec-contents {
  margin-top: 18px;
  max-width: 520px;
}

.ec-contents-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.ec-contents ul {
  margin: 0;
  padding-left: 18px;
}

.ec-contents li {
  margin-bottom: 4px;
}

.ec-contents li:last-child {
  margin-bottom: 0;
}

/* Grids */

.ec-grid-3,
.ec-grid-2 {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.ec-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.ec-grid-2 > .ec-grid-full,
.ec-grid-3 > .ec-grid-full {
  grid-column: 1 / -1;
}

/* Boxes / cards */

.ec-box {
  background: var(--ec-white);
  border: 1px solid var(--ec-grey-200);
  padding: 22px;
  min-height: 100%;
}

.ec-box--soft {
  background: var(--ec-green-soft);
  border-color: #c9edf2;
}

.ec-box--dark {
  background: var(--ec-green-dark);
  border-color: var(--ec-green-dark);
  color: #fff;
}

.ec-box--dark h2,
.ec-box--dark h3 {
  color: #fff;
}

.ec-box--dark p,
.ec-box--dark li {
  color: #edf7f8;
}

.ec-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ec-green-dark);
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Lists */

.ec-list {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.ec-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 7px;
}

.ec-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ec-green-dark);
  font-weight: 700;
}

.ec-box--dark .ec-list li::before {
  color: #d4f4f7;
}

/* Fix checklist alignment inside floated-image boxes */

.ec-box--float .ec-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.ec-box--float .ec-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-left: 0;
  margin-bottom: 10px;
  position: static;
}

.ec-box--float .ec-list li::before {
  content: "✓";
  position: static;
  flex: 0 0 auto;
  color: var(--ec-green-dark);
  font-weight: 700;
  line-height: 1.4;
}

/* Tables */

.ec-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 28px;
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
  border: 1px solid var(--ec-grey-200);
}

.ec-table th,
.ec-table td {
  border-bottom: 1px solid var(--ec-grey-200);
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}

.ec-table th {
  background: var(--ec-grey-100);
  font-weight: 700;
}

.ec-table--compact th,
.ec-table--compact td {
  padding: 9px 10px;
  font-size: .9em;
}

.ec-table--compact th:not(:first-child),
.ec-table--compact td:not(:first-child) {
  text-align: left;
  white-space: normal;
}

.ec-table--rating th:not(:first-child),
.ec-table--rating td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
}

.ec-table--rating td:not(:first-child) {
  font-weight: 700;
  white-space: nowrap;
}

.ec-table-legend {
  display: grid;
  gap: 6px;
  margin: 10px 0 0 0;
  padding: 10px 12px;
  background: #f5f6f6;
  border: 1px solid #e1e4e5;
  font-size: .9em;
  text-align: center;
}

.ec-table-legend-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.ec-table-legend span {
  white-space: nowrap;
}


/* Notes */

.ec-note {
  border-left: 4px solid var(--ec-green-dark);
  background: var(--ec-green-soft);
  padding: 18px;
  margin-bottom: 28px;
}

/* Image option 1: watermark image behind text */

.ec-box--watermark {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.ec-box--watermark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(
      90deg,
      rgba(234, 249, 251, 0.92) 0%,
      rgba(234, 249, 251, 0.72) 42%,
      rgba(234, 249, 251, 0.18) 100%
    ),
    var(--ec-watermark-image);
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 18px center;
  background-size: cover, 58%;
  opacity: 1;
  z-index: 0;
}

.ec-box--watermark > * {
  position: relative;
  z-index: 1;
  max-width: 72%;
}

/* Image option 2a: image inside a text box as a small grid */

.ec-box-media {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 0.65fr);
  gap: 18px;
  align-items: start;
}

.ec-box-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ec-grey-200);
  background: var(--ec-grey-100);
}

/* Image option 2b: image floats inside the text flow */

.ec-box--float::after {
  content: "";
  display: block;
  clear: both;
}

.ec-text-float-img {
  float: left;
  width: 34%;
  max-width: 220px;
  min-width: 140px;
  margin: 0 20px 12px 0;
  border: 1px solid var(--ec-grey-200);
  background: var(--ec-grey-100);
}

/* Image option 3: image-only replacement box */

.ec-image-box {
  margin: 0;
  background: #f5f6f6;
  border: 1px solid #e1e4e5;
  min-height: 100%;
  overflow: hidden;
}

.ec-image-box img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  background: #fff;
  padding: 10px;
  margin-inline: auto;
}

.ec-image-box figcaption {
  background: #fff;
}

/* Image boxes inside product cards */

.ec-box > .ec-image-box {
  min-height: 0;
  margin: -22px -22px 18px -22px;
  max-width: none !important;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.ec-box > .ec-image-box img,
.ec-box > .ec-image-box .ec-image-placeholder {
  min-height: 0;
  height: auto;
  aspect-ratio: 4 / 3;
}

.ec-box > .ec-image-box img {
  object-fit: contain;
  object-position: center;
  background: #fff;
  padding: 10px;
}

/* Product/subgroup images: fixed 4:3 frame.
   The IMG element fills the frame and object-fit centres the actual image content.
   !important is intentional here because TYPO3 image rules can otherwise override
   width, height, margin or display and shift smaller source images to the left. */
.ec-box > .ec-image-box .ec-subgroup-image-link {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  aspect-ratio: 4 / 3;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
}

.ec-box > .ec-image-box .ec-subgroup-image-link img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  transition: transform .18s ease, opacity .18s ease;
}

.ec-box > .ec-image-box .ec-subgroup-image-link:hover img {
  transform: scale(1.015);
  opacity: .94;
}

.ec-box > .ec-image-box figcaption {
  border-top: 1px solid var(--ec-grey-200);
}

.ec-box > .ec-image-box + h2,
.ec-box > .ec-image-box + h3 {
  margin-top: 0;
}

.ec-box > .ec-table-wrap:last-child {
  margin-bottom: 0;
}

/* Topic thumbnails */

.ec-topic-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}

.ec-topic-card-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ec-topic-thumb {
  flex: 0 0 152px;
  width: 152px;
  margin: 0;
}

.ec-topic-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  background: var(--ec-grey-100);
}



.ec-topic-thumb .ec-image-placeholder {
  width: 100%;
  min-height: 108px;
  max-height: 108px;
  border-radius: 10px;
  font-size: 12px;
  padding: 8px;
}

.ec-topic-card:hover h3 {
  color: var(--ec-green-dark);
}

/* Mobile overflow safety */

.ec-page,
.ec-hero,
.ec-box,
.ec-note,
.ec-contents,
.ec-table-wrap,
.ec-image-box {
  max-width: 100%;
}

.ec-grid-2 > *,
.ec-grid-3 > *,
.ec-hero-grid > *,
.ec-box-media > * {
  min-width: 0;
}

/* Tables should scroll sideways if needed, not break words */
.ec-table,
.ec-table th,
.ec-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* Prevent rating table headings and values from wrapping */
.ec-table--rating thead th,
.ec-table--rating th:not(:first-child),
.ec-table--rating td:not(:first-child) {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
 

 


/* Responsive behaviour */

@media (max-width: 900px) {
  .ec-hero-grid,
  .ec-grid-3,
  .ec-grid-2 {
    grid-template-columns: 1fr;
  }

  .ec-hero {
    padding: 24px;
  }

  .ec-page .ec-actions {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 760px) {

  .ec-grid-2 > .ec-grid-full,
  .ec-grid-3 > .ec-grid-full {
    grid-column: auto;
  }

  .ec-table {
    min-width: 680px;
  }

  .ec-table--compact {
    min-width: 560px;
  }
}

@media (max-width: 700px) {
  .ec-box-media {
    grid-template-columns: 1fr;
  }

  .ec-box--watermark::before {
    background-image:
      linear-gradient(
        rgba(234, 249, 251, 0.86),
        rgba(234, 249, 251, 0.86)
      ),
      var(--ec-watermark-image);
    background-position: center, center;
    background-size: cover, cover;
  }

  .ec-box--watermark > * {
    max-width: none;
  }

  .ec-text-float-img {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 16px 0;
  }
}

@media (max-width: 640px) {
  .ec-page .ec-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ec-page .ec-btn {
    width: 100%;
    text-align: center;
  }

  .ec-contents {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .ec-topic-card {
    gap: 12px;
  }

  .ec-topic-thumb {
    flex-basis: 112px;
    width: 112px;
  }
}

/* Product-list handoff */
.ec-products-intro {
  padding-top: 2px;
  margin-bottom: 12px !important;
}

/* ============================================================
   Section rhythm + clear FAQ/application differentiation
   ============================================================ */

/* Use the top-level content sections as the source of vertical rhythm.
   Previously spacing depended on whether the last child happened to be
   a grid, table or standalone box, which caused inconsistent gaps. */
.ec-page > section,
.ec-page > .ec-grid-2,
.ec-page > .ec-grid-3,
.ec-page > .ec-note,
.ec-page > .ec-contents {
  margin-bottom: 32px;
}

.ec-page > :last-child {
  margin-bottom: 0;
}

/* Do not add an extra internal bottom gap when a grid/table is the final
   element inside a section; the section itself now owns that spacing. */
.ec-page > section > .ec-grid-2:last-child,
.ec-page > section > .ec-grid-3:last-child,
.ec-page > section > .ec-table-wrap:last-child,
.ec-page > section > .ec-note:last-child {
  margin-bottom: 0;
}

/* FAQ = neutral information block */
.ec-page #faq {
  background: #f5f6f6;
  border: 1px solid #e1e4e5;
  padding: 20px 24px;
}

/* Related applications = navigation / inspiration block */
.ec-page #anwendungen {
  background: #eef8f8;
  border: 1px solid #d7ecee;
  padding: 20px 24px;
}

.ec-page #faq > h2,
.ec-page #anwendungen > h2 {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe3e4;
}

.ec-page #anwendungen > h2 {
  border-bottom-color: #cfe6e8;
}

/* FAQ and application lists stay simple, but each entry is clearly defined.
   A slim left marker plus a stronger divider separates the rows without
   turning them back into cards. */
.ec-faq-list li,
.ec-application-list li {
  position: relative;
  padding: 10px 0 11px 16px;
  margin: 0;
  border-bottom: 1px solid #cfd5d9;
}

.ec-application-list li {
  border-bottom-color: #c7e0e2;
}

.ec-faq-list li::before,
.ec-application-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
}

.ec-faq-list li::before {
  background: #aeb8be;
}

.ec-application-list li::before {
  background: var(--ec-green);
}

.ec-faq-list li:first-child,
.ec-application-list li:first-child {
  padding-top: 7px;
}

.ec-faq-list li:first-child::before,
.ec-application-list li:first-child::before {
  top: 7px;
}

.ec-faq-list li:last-child,
.ec-application-list li:last-child {
  padding-bottom: 7px;
  border-bottom: 0;
}

.ec-faq-list li:last-child::before,
.ec-application-list li:last-child::before {
  bottom: 7px;
}

.ec-faq-list strong,
.ec-application-list strong {
  display: block;
  margin-bottom: 1px;
  line-height: inherit;
}

.ec-faq-list p {
  margin: 0;
}

.ec-application-list a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.ec-application-list a::after {
  content: " →";
}

@media (max-width: 640px) {
  .ec-page > section,
  .ec-page > .ec-grid-2,
  .ec-page > .ec-grid-3,
  .ec-page > .ec-note,
  .ec-page > .ec-contents {
    margin-bottom: 26px;
  }

  .ec-page #faq,
  .ec-page #anwendungen {
    padding: 16px 16px;
  }
}


@media (max-width: 760px) {
  .ec-area-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    flex-basis: 18px;
  }
}
