@layer components, helpers;

/** Inhaltselemente */
@layer components {
  .gridbox {
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: flex-start !important;
    
    .gridbox-item {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin: 0;
      padding: 1rem 1rem 1rem 6rem;
      border-right: 1px solid var(--color-smoke);

      &:last-child {
        border-right: none;
      }

      @media (max-width: 1200px) {
        padding: 1rem;
      }

      svg,
      .icon {
        color: var(--color-primary);
      }

      h4 {
        /* margin: 0.25rem 0;
        font-size: 1rem; */
        text-transform: uppercase;
        letter-spacing: 0.02em;
      }

      p {
        margin: 0;
        color: var(--color-muted);
        font-size: 0.9rem;
      }

      .content {
        color: var(--color-text);
      }
    }
  }

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

  .box {
    width: 100%;
    font-weight: 400;

    @media (max-width: 767px) {
      align-self: center;
      justify-self: center;
    }

    h4 {
    }
    p {
      margin: 0;
    }
    svg {
      color: var(--color-primary);
    }
  }

  .page-index {
    .avatars, .percentage, .average {
      .box {
        max-width: 300px;
        max-height: 212px;

        @media (max-width: 767px) {
          max-width: unset;
          max-height: unset;
        }
      }
    }
    .avatars .box {
      justify-self: center;

      h4 {
        color: var(--color-primary);
      }
      img {
        padding: 10px;
        max-height: 100px;
      }
    }
    .percentage, .average {
      .box {
        align-self: end;
        justify-self: end;
      }
    }

    .percentage {
      @media (min-width: 1660px) {
        translate: 60px 0;
      }
    }
  }

  .title1, .title2 {
    align-self: self-start;
    margin-bottom: 0;
    
    strong {
      font-size: clamp(1.2rem, 2vw, 1.6rem);
      color: var(--color-primary);
      margin-bottom: 0;
    }
  }
  .wolfgang, .kaya {
    padding: 0 !important;
    align-self: stretch;

    img {
      aspect-ratio: 10/10;
      object-fit: cover;
      object-position: top;
    }
    .content {
      align-content: center;
      padding: 1rem;

      h4 {
        font-size: 2.1rem;
        line-height: 1;
      }
      p.role {
        font-size: 1.5rem;
        color: var(--color-primary);
      }
    }
  }

  .box.weg, .box.idee, .box.heute {
    align-self: stretch;
  }

  .address {
    li {
      display: flex;
      align-items: center;
      margin-bottom: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--color-smoke);
    }
  }

  /** ANCHOR Footer */
  footer {
    background: var(--color-bg);
    color: var(--color-text);

    .container {
      max-width: var(--max-width);
      margin: 0 auto;
    }

    a {
      color: var(--color-muted);
      text-decoration: none;

      &:hover {
        color: var(--color-text);
      }
    }

    /** ANCHOR Partner Slider */
    .partner-band {
      background: var(--color-text);
      color: var(--color-bg);
      padding: 1.5rem var(--gap);

      .partner-slider {
        display: flex;
        align-items: center;
        gap: 2rem;
        max-width: var(--max-width);
        margin-inline: auto;

        /* Fixbereich (links): Eyebrow + Titel */
        .partner-fixed {
          flex: 0 0 auto;
          min-width: 170px;

          .partner-eyebrow {
            color: var(--color-primary);
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            margin: 0;
          }

          .partner-title {
            font-size: 1.1rem;
            margin: 0;
          }
        }

        /* Sichtfenster (Mitte): schneidet überstehende Logos ab */
        .partner-viewport {
          flex: 1 1 auto;
          overflow: hidden;

          .partner-track {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            list-style: none;
            transition: transform 0.4s ease;
            will-change: transform;

            .partner-logo {
              flex: 0 0 auto;
              display: flex;
              align-items: center;
              gap: 1rem;

              img {
                max-width: 170px;
              }

              .divider {
                width: 2px;
                height: 50px;
                background-color: var(--color-muted);
              }

              &:last-child .divider {
                display: none;
              }
            }
          }
        }

        /* Controls (rechts): Prev/Next-Buttons */
        .partner-controls {
          flex: 0 0 auto;
          display: flex;
          gap: 0.5rem;

          .slider-btn {
            display: grid;
            place-items: center;
            margin: 0;
            padding: 0;
            width: 42px;
            height: 42px;
            border: none;
            border-radius: 50%;
            background: var(--color-primary);
            color: var(--color-bg);
            cursor: pointer;

            &:hover {
              opacity: 0.9;
            }

            &:disabled {
              opacity: 0.35;
              cursor: default;
            }
          }
        }

        /* Schmal: Band umbrechen, Fixbereich volle Breite */
        @media (max-width: 900px) {
          flex-wrap: wrap;
          justify-content: center;
          text-align: center;

          .partner-fixed {
            flex-basis: 100%;
          }
        }
      }
    }
  }
}

/** Helperklassen */
@layer helpers {
  .smokybox {
    padding: 1rem;
    background-color: var(--color-smoke);
    border-left: 3px solid rgba(255,255,255,0.4);
    border-top: 2px solid rgba(255,255,255,0.25);
    border-right: 2px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
  }

  .divider {
    width: 2px;
    height: 50px;
    background-color: var(--color-muted);
  }

  /* Große Kennzahl (z. B. 800+, 570, 98%) */
  .size-lg {
    font-size: clamp(3rem, 4vw, 3rem);
    font-weight: 300;
    line-height: clamp(3rem, 4vw, 3rem);

    span {
      font-size: 0.5em;
    }
  }

  .stretch {
    align-self: stretch;
  }
}