/*
 * Copyright (c) 2025 TechDivision GmbH
 * All rights reserved
 *
 * This product includes proprietary software developed at TechDivision GmbH, Germany
 * For more information see https://www.techdivision.com/
 *
 * To obtain a valid license for using this software please contact us at
 * license@techdivision.com
 */

/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:root {
  /* fonts */
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* special font sizes and line heights */
  --metrics-font-size: 30px;
  --metrics-line-height: 35px;
  --metrics-heading-font-size: 100px;
  --metrics-heading-line-height: 110px;

  /* general */
  --page-width: 1200px;

  /* nav and header sizes */
  --nav-height: 64px;
  --header-height: 128px;
  --header-width: 1440px;

  /* spacing */
  --spacing-xs: 10px;
  --spacing-sm: 20px;
  --spacing-md: 40px;
  --spacing-lg: 60px;

  /* Deprecated spacing values */
  --spacing-quarter: calc(var(--spacing-sm) / 4);

  /* border radius */
  --card-border-radius: 20px;
  --additional-control-height: 0px;
}

@font-face {
  font-family: roboto-fallback;
  size-adjust: 100.06%;
  ascent-override: 95%;
  src: local('Arial');
}

html {
  height: 100%;
}

body {
  font-size: var(--body-font-size-m);
  line-height: var(--body-line-height-m);
  margin: 0;
  font-family: var(--body-font-family);
  color: var(--text-color);
  background-color: var(--background-color);
  display: none;
  hyphens: auto;
  word-wrap: break-word;
  min-height: 100%;
}

body.appear {
  display: flex;
  flex-direction: column;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-semibold);
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
  scroll-margin: calc(var(--nav-height) + 1em);

  &:last-child {
    margin-bottom: 0;
  }
}

h1,
.h1 {
  font-size: var(--heading-font-size-xxl);
  line-height: var(--heading-line-height-xxl);
}

h2,
.h2 {
  font-size: var(--heading-font-size-xl);
  line-height: var(--heading-line-height-xl);
}

h3,
.h3 {
  font-size: var(--heading-font-size-l);
  line-height: var(--heading-line-height-l);
}

h4,
.h4 {
  font-size: var(--heading-font-size-m);
  line-height: var(--heading-line-height-m);
}

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);

  &:last-child {
    margin-bottom: 0;
  }
}

ol li,
ul li {
  &:last-of-type {
    margin-bottom: 0;
  }

}

code,
pre {
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-s);
  line-height: var(--body-line-height-s);
}

code {
  padding: 0.125em;
}

pre {
  overflow: scroll;
}

main pre {
  background-color: var(--light-color);
  padding: 1em;
  border-radius: 0.25em;
  overflow-x: auto;
  white-space: pre;
}

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  display: inline-block;
  min-height: var(--body-line-height-m);
}

a:hover {
  text-decoration: underline;
}

a.button:any-link,
button {
  max-width: 100%;
  font-family: var(--body-font-family);
  display: inline-grid;
  box-sizing: border-box;
  text-decoration: none;
  padding: 8px 15px;
  text-align: center;
  font-style: normal;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  color: var(--button-color);
  background-color: var(--button-background);
  word-wrap: break-word;
  overflow: hidden;
  border-radius: 0;
  border: 2px solid var(--button-border);
  user-select: none;
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;

  &:last-of-type {
    margin-bottom: 0;
  }
}

a.button:hover,
a.button:focus,
button:hover,
button:focus {
  cursor: pointer;
  background-color: var(--button-background-hover);
  color: var(--button-color-hover);
}

[id]:target,
:focus-visible {
  scroll-margin-top: calc(var(--nav-height) + 100px);
}

@media (width >= 900px) {
  [id]:target,
  :focus-visible {
    scroll-margin-top: calc(var(--header-height) + 100px);
  }
}

button:disabled,
button:disabled:hover {
  background-color: var(--color-gray-light);
  cursor: unset;
}

/* buttons */
a.button.no-button,
button.no-button {
  background-color: unset;
  color: var(--link-color);
  padding: 0;
  border: 0 none;
  border-bottom: 2px solid transparent;
  text-transform: none;

  &:hover {
    border-color: var(--link-color);
  }
}

.icon {
  display: inline-block;
  vertical-align: text-top;
  height: 18px;
  width: auto;
  margin-right: 8px;
  user-select: none;
}

.icon img {
  height: 100%;
  width: 100%;
}

main {
  flex: 1;
  margin-bottom: var(--spacing-md);

  img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
  }

  > .section:not(.section-breadcrumbs),
  > .section > [class*="-wrapper"] {
    margin-bottom: var(--spacing-md);

    &:last-of-type {
      margin-bottom: 0;
    }
  }

  > .section:not(.sidebar):has(+ .section.sidebar:last-child) {
    margin-bottom: 0;
  }

  > .section[class*="background-"] {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
  }

  .section {
    position: relative;
    padding: 0 var(--spacing-xs);
  }

  .section.light,
  .section.highlight {
    background-color: var(--light-color);
  }

  .sidebar-hero,
  .hero {
    img {
      width: 100%;
      height: auto;
      display: block;
    }
  }

  .section-breadcrumbs {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);

    .breadcrumbs,
    .breadcrumbs a {
      min-height: var(--body-line-height-s);
    }
  }

  .default-content-wrapper > * {
    margin-bottom: var(--spacing-sm);

    &:last-child {
      margin-bottom: 0;
    }
  }

  @media (width >= 600px) {
    .section {
      padding: 0 var(--spacing-sm);
    }
  }
}

@media (width >= 900px) {
  .section > div {
    max-width: var(--page-width);
    margin: auto;
  }
}


/* basic text alignment */
[data-align='center'] {
  text-align: center;
}

[data-align='right'] {
  text-align: right;
}

[data-align='justify'] {
  text-align: justify;
}

/* background colors */
.background-light-gray {
  background-color: var(--color-gray-light);
}

.background-dark-gray {
  background-color: var(--color-gray-darker);
}

/* globally hidden */
.hidden {
  display: none !important;
}

.block.library-metadata,
.block.metadata {
  display: none;
}

.block {
  margin-bottom: var(--spacing-sm);

  &:last-of-type {
    margin-bottom: 0;
  }
}

/* manufacturer logo */
h1.has-manufacturer-logo {
  overflow: hidden;

  .manufacturer-logo {
    display: inline-block;
    padding-left: 10px;
    float: right;
  }
}

@media (width >= 900px) {
  body.has-sidebar main {
    display: grid;
    grid-template-columns: 70% 30%;
    margin: 0 auto var(--spacing-md) auto;
    max-width: calc(var(--page-width) + (var(--spacing-sm) * 2)); /* page-width + 2x 32px padding */

    /* section cell left */

    > .section {
      grid-column: 1;

      /* section cell right */

      &.sidebar {
        grid-column: 2;
        grid-row: 1 / span 10000;
        border-left: 1px dashed var(--color-gray-light);
      }

      /* section over both cells */

      &.sidebar-hero {
        grid-column: 1 / 3;
        padding-bottom: 0;
      }
    }
  }

  body.has-sidebar-hero,
  body.has-breadcrumbs {
    main > .section.sidebar {
      grid-row: 2 / span 10000;
    }
  }

  body.has-sidebar-hero.has-breadcrumbs {
    main > .section.sidebar {
      grid-row: 3 / span 10000;
    }
  }
}

/* header */
header {
  height: var(--nav-height);

  @media (width >= 900px) {
    height: var(--header-height);
  }
}

header .nav-logo picture + a,
header .nav-logo picture + br + a {
  display: none;
}

/* chevron */
.has-chevron {
  position: relative;
  font-weight: var(--font-weight-bold);

  &::after {
    position: absolute;
    top: 50%;
    display: inline-block;
    content: '';
    width: 6px;
    height: 6px;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    border-style: solid;
    border-width: 2px 2px 0 0;
    z-index: 0;
    right: 4px;
  }

  &.chevron-left::after {
    border-width: 0 0 2px 2px;
  }

  &.chevron-up::after {
    border-width: 2px 0 0 2px;
  }

  &.chevron-down::after {
    border-width: 0 2px 2px 0;
  }
}

a.has-chevron {
  display: inline-block;
  padding-right: 1em;
}

/* pagination */
.pagination {
  display: flex;
  margin-bottom: var(--spacing-sm);
  user-select: none;

  .size,
  .pages {
    flex: 1;
  }

  .pages {
    text-align: right;

    ol {
      list-style-type: none;
      margin: 0;

      li {
        display: inline-block;
        min-height: 24px;


        &.contains-link a {
          display: block;
          padding: 0 12px;
        }
      }
    }
  }
}

/* placeholder */
.placeholder {
  pointer-events: none;
  cursor: default;
  user-select: none;

  *:not(:has(*)) {
    /* important is okay as we want to override everything */
    color: transparent !important;
    background-color: var(--dark-color) !important;
    position: relative;
    display: inline-block;
    overflow: hidden;

    &::after {
      content: '';
      display: block;
      position: absolute;
      top: 0;
      width: 100%;
      height: 100%;
      transform: translateX(-100px);
      background: linear-gradient(90deg, transparent, rgb(255 255 255 / 20%), transparent);
      animation: loading 0.8s infinite;
    }
  }
}

/* element positions */
.section.images-inline-right .default-content-wrapper p:first-child picture,
.section.images-inline-left .default-content-wrapper p:first-child picture {
  display: block;
  margin-bottom: var(--spacing-xs);
  text-align: center;
}

@media (width >= 900px) {
  /* section side by side */
  .section.side-by-side {
    max-width: var(--page-width);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin: 0 auto;

    &.gallery-container {
      grid-template-columns: minmax(0, max-content) minmax(50%, 1fr);
    }
  }

  .section.side-by-side > div {
    margin: 0;
  }

  /* sections with inline images */
  .section.images-inline-left,
  .section.images-inline-right {
    .default-content-wrapper {
      overflow: hidden;
    }
  }

  .section.images-inline-left {
    .default-content-wrapper {
      p:first-child {
        float: left;
        margin: 0 var(--spacing-xs) 0 0;
      }
    }
  }

  .section.images-inline-right {
    .default-content-wrapper {
      p:first-child {
        float: right;
        margin: 0 0 0 var(--spacing-xs);
      }
    }
  }

  .section.location {
    max-width: var(--page-width);
    display: grid;
    grid-template-columns: 2fr 5fr;
    column-gap: var(--spacing-sm);
    margin: 0 auto;
  }

  .section.location > div {
    align-self: start;
    margin: 0;
  }

  .section.location > div > p:first-child {
    margin-top: 0;
  }
}

@keyframes loading {
  100% {
    transform: translateX(100%);
  }
}

.publish-date {
  color: var(--color-gray);
}

/* video hacks */
.video-embed-container {
  &.video-embed-container-16-9 {
    left: 0;
    width: 100%;
    height: 0;
    position: relative;
    padding-bottom: 56.25%;
  }

  &.video-embed-container-9-16 {
    left: 0;
    width: 100%;
    height: 0;
    position: relative;
    padding-bottom: 177.77%;
  }

  iframe {
    border: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    position: absolute;
  }
}

@media (width >= 900px) {
  .two-column,
  .three-column,
  .four-column,
  .five-column {
    max-width: var(--page-width);
    margin: 0 auto;
    display: grid;
    gap: var(--spacing-xs);

    > div:not(.library-metadata-wrapper) {
      width: 100%;
    }
  }

  .two-column {
    grid-template-columns: repeat(2, 1fr);
  }

  .three-column {
    grid-template-columns: repeat(3, 1fr);
  }

  .four-column {
    grid-template-columns: repeat(4, 1fr);
  }

  .five-column {
    grid-template-columns: repeat(5, 1fr);
  }
}

.video-controls {
  position: absolute;
  inset: 0;
  z-index: 2;

  @media (width >= 1200px) {
    bottom: 20px;
  }

  button {
    background-color: rgb(20 20 20 / 70%);
    border: 1px solid var(--color-white);
    border-radius: 50%;
    cursor: pointer;
    width: 48px;
    height: 48px;
    color: var(--color-white);
    display: flex; /* Use flexbox for centering icon */
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: calc(20px + var(--additional-control-height, 0));
    left: 20px;

    &::before {
      content: '❚❚'; /* Pause icon */
      font-size: 16px;
      line-height: 1; /* Adjust line-height for centering */
      display: inline-block;
      font-family: sans-serif;
      transform: translateX(1px);
    }

    &.paused::before {
      content: '▶'; /* Play icon */
      transform: translateX(2px);
    }

    @media (width >= 1200px) {
      bottom: 0;
    }
  }
}


.hide-desktop-controls .video-controls {
  display: block;

  @media (width >= 900px) {
    display: none;
  }
}


.hide-mobile-controls .video-controls {
  display: none;

  @media (width >= 900px) {
    display: block;
  }
}

.hide-desktop-controls.hide-mobile-controls .video-controls {
  display: none;
}

