@import "reset";


// header
$full-width-paddingX: 20px;

// hero
$hero-padding-top: 80px;
$headline-wrapper-margin-bottom: 40px;
$quickstart-button-padding: 0 50px;
$vendor-strip-height: 88px;
$vendor-strip-font-size: 16px;

@import "size";
@import "documentation";

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

body {
  background-color: var(--bs-body-bg);

  a {
    color: $primary;
  }
}

section {
  position: relative;
  background-color: var(--bs-body-bg);
}

section,
header,
footer {
  .main-section {
    position: relative;
    margin: auto;
  }

  p {
    font-size: 14px;
    font-weight: 400;
  }

  .button {
    display: inline-block;
    border-radius: 6px;
    padding: 6px 20px;
    line-height: 1.3rem;
    color: white;
    background-color: $primary;
    text-decoration: none;
    font-size: 1rem;
    border: 0px;

    &:hover {
      background-color: darken($primary, 10%);
      color: white;
    }
  }

  #cellophane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
  }
}

main {
  .button, .portal-button {
    display: inline-block;
    border-radius: 6px;
    padding: 6px 20px;
    line-height: 1.3rem;
    color: white;
    background-color: $primary;
    text-decoration: none;
    font-size: 1rem;
    border: 0px;

    &:hover {
      background-color: darken($primary, 10%);
      color: white;
    }
  }
}

::selection {
  background: #326ce5;
  color: white;
}

::-moz-selection {
  background: #326ce5;
  color: white;
}

// HERO
.header-hero {
  background-image: url(/images/texture.png);
  background-color: $dark-grey;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 0;
  position: relative;

  &.bot-bar:after {
    display: block;
    margin-bottom: -24px;
    height: 8px;
    width: 100%;
    background-color: transparentize(white, 0.9);
    content: "";
  }

  &.no-sub {
    h5 {
      display: none;
    }

    h1 {
      margin-top: 2.8rem;
      margin-bottom: 20px;
      font-size: 2.2rem;
    }

    @media screen and (min-width: 768px) {
      h1 {
        font-size: 2rem;
      }
    }
  }
}

.td-home .header-hero:after {
  display: none;
}

.header-hero {
  background-color: $dark-grey;

  h5 {
    margin: 20px 0;
    line-height: 28px;
  }
}

#vendorStrip {
  position: relative;

  ul {
    float: left;
  }

  li {
    display: inline-block;
    height: 100%;
  }

  a {
    display: block;
    height: 100%;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
  }

  li + li {
    margin-left: 0;
  }
}

.pi-accordion {
  & > .container:first-child > .item:first-child > .title:first-child {
    padding-left: 0;
    font-size: 1.5em;
    font-weight: 700;
  }

  & > .container:first-child > .item.yah:first-child > .title:first-child {
    margin-left: -20px !important;
  }

  .item {
    overflow: hidden;
  }

  .title {
    color: $dark-grey;
    position: relative;
    padding: 7.5px 10px 7.5px 18px;
    cursor: pointer;
    transition: 0.3s;

    &:hover {
      color: $primary;
    }
  }

  a.item > .title {
    color: black;

    &:hover {
      color: $primary;
    }
  }

  div.item > .title {
    &:before {
      content: "";
      position: absolute;
      top: 12px;
      left: 2px;
      border-style: solid;
      border-width: 5px 0 5px 8px;
      border-color: transparent transparent transparent $primary;
      transform: rotate(0deg);
      transition: 0.3s;
    }
  }

  .wrapper {
    position: relative;
    width: 100%;
    transition: height 0.3s;
  }

  .content {
    padding-left: 20px;
    opacity: 0;
    transition: 0.3s;
  }

  .item.on {
    & > .title:before {
      transform: rotate(90deg);
    }

    & > .wrapper > .content {
      opacity: 1;
    }
  }
}

dt {
  margin-bottom: 8px;
}

dd {
  margin-bottom: 16px;
}

// ocean nodes
$ocean-nodes-padding-Y: 60px;
$ocean-nodes-main-margin-bottom: 60px;
$ocean-nodes-h3-margin-bottom: 30px;

// Home-specific

.header-hero {
  margin-bottom: 0;
  padding-bottom: 1px;

  .main-section {
    padding: 0 10px;
    margin-bottom: 30px;
  }

  #vendorStrip {
    display: none;
  }
}

// OCEAN NODES
#oceanNodes, .td-home .k8s-overview {

  padding-top: $ocean-nodes-padding-Y;
  padding-bottom: $ocean-nodes-padding-Y;

  a {
    color: $primary;
  }

  .main-section {
    margin-bottom: $ocean-nodes-padding-Y;
    min-height: 160px;
  }

  .image-wrapper {
    max-width: 75%;
    margin: 0 auto 20px;
    text-align: center;

    img {
      width: 100%;
      max-width: 160px;
    }
  }

  .main-section:first-child {
    .image-wrapper {
      max-width: 100%;

      img {
        max-width: 491px;
      }
    }
  }

  h3 {
    margin-bottom: $ocean-nodes-h3-margin-bottom;
  }
}

// Video thingy
#video {
  position: relative;
  overflow: hidden;

  h2 {
    font-size: 32px;
    line-height: 44px;
    margin-bottom: 20px;
  }

  p {
    margin-bottom: 20px;
  }

  // All #desktopKCButton blocks are left for back compatibility and
  // should be removed later, leaving .desktopKCButton only
  // See https://github.com/kubernetes/website/pull/49167 for details
  #desktopKCButton, .desktopKCButton {
    display: inline-block;
    font-size: 18px;
    background-color: $dark-grey;
    border-radius: 8px;
    color: $white;
    padding: 2px 8px;
    margin: 5px;
  }

  .desktopKCButton:hover{
    background-color: #ffffff;
    color: #326ce5;
    transition: 150ms;
  }

  #desktopShowVideoButton {
    font-size: 1.8rem;
    background-color: white;
    border-radius: 8px;
    color: $secondary;
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  #desktopShowVideoButton:hover {
    color: $primary;
    transition: 150ms;
  }
}

#videoPlayer {
  @include fullScreen;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;

  iframe {
    width: 100%;
    max-height: 100vh;
    aspect-ratio: 16 / 9;
    position: fixed;
    top: 50%;
    left:50%;
    transform: translate(-50%, -50%);
  }

  #closeButton {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 2px solid transparent;
    transition: 0.3s;

    &:before,
    &:after {
      content: "";
      position: absolute;
      top: calc(50% - 1px);
      left: 10%;
      width: 80%;
      height: 2px;
      background-color: white;
    }

    &:before {
      transform: rotate(45deg);
    }

    &:after {
      transform: rotate(-45deg);
    }

    &:hover {
      border-color: white;
    }
  }
}

// KubeWeekly
#kubeweekly {
  visibility: hidden;
  background-color: $light-grey;
  padding-top: 30px;
  padding-bottom: 80px;
  background-size: auto;
  font-size: 24px;
  // font-weight: bold;

  h5 {
    font-size: 20px;
  }
}

.subscribe-button {
  border-radius: 6px;
  padding: 0 20px;
  line-height: 31px;
  color: white;
  background-color: $primary;
  text-decoration: none;
  font-size: 14px;
}

// Features
body.td-home section.features-container {
  padding: 0; // reset
  padding-top: 140px; // make room for logo

  background-color: $light-grey;
  background-image: url(/images/wheel.svg);
  background-position: center 60px;
  background-repeat: no-repeat;
  background-size: 60px;

  padding-bottom: 2em;

  .k8s-features-heading {
    color: $primary;
    text-align: center;
  }

  & > div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: stretch;
    gap: 1.2rem;

    margin-top: 1.8em;

    max-width: clamp(75em, 25cm, 90vw);
    margin-left: auto;
    margin-right: auto;

    background: initial;

    & > .feature-box {
        margin: 0;

        h3 {
          text-align: center;
          line-height: normal;
          font-size: 1.3em;
          margin-bottom: 1rem;
        }

        flex-basis: calc(min(75vw, 12.5cm, 35em));
        flex-shrink: 0;

        border-radius: 0.5em;
        padding: 1em;
        padding-bottom: 1.2em;

        background-color: #daeaf9; // light blue
    }
  }
}

// Talk to us
#talkToUs {
  h3,
  h4 {
    text-align: center;
  }

  h3 {
    margin-bottom: 15px;
  }

  h4 {
    line-height: normal;
    margin-bottom: 50px;

    br {
      display: none;
    }
  }

  #bigSocial {
    overflow: hidden;

    div {
      width: 100%;
      float: left;
      padding: 30px;
      padding-top: 110px;
      background-position: center top;
      background-size: auto;
      background-repeat: no-repeat;
    }

    div:nth-child(1) {
      background-image: url(/images/twitter_icon.png);
    }

    div:nth-child(2) {
      background-image: url(/images/github_icon.png);
    }

    div:nth-child(3) {
      background-image: url(/images/slack_icon.png);
    }

    div:nth-child(4) {
      background-image: url(/images/stackoverflow_icon.png);
    }

    div + div {
      margin-top: 20px;
      margin-left: 0;
    }

    a {
      display: inline-block;
      color: $primary;
      font-size: 24px;
      font-weight: 400;
      text-decoration: none;
      margin-bottom: 15px;
    }

    a,
    p {
      text-align: center;
      width: 100%;
    }
  }
}

.td-home {
  #talkToUs {
    .main-section {
      padding: 30px 0;
    }

    h5 {
      font-size: 20px;
    }
  }

  #caseStudiesWrapper {
    position: relative;
    text-align: center;
    margin-bottom: 30px;

    img {
      padding-bottom: 1rem;
    }

    div {
      position: relative;
      display: inline-block;
      vertical-align: top;
      width: 100%;
      min-height: 230px;
      margin-bottom: 60px;
      padding-right: 1rem;
      background-position: top center;
    }

    p {
      font-size: 20px;
    }

    a {
      position: absolute;
      bottom: -30px;
      left: 50%;
      transform: translateX(-50%);
      color: $primary;
      font-weight: 400;
    }
  }
}

// Header filler size adjustment

.header-hero.filler {
  height: $hero-padding-top;
}

// Docs specific

#editPageButton {
  position: absolute;
  top: 50px;
  right: 25px;
  width: 50px;
  height: 50px;
  line-height: 50px;
  border-radius: 50%;
  white-space: nowrap;
  text-indent: 50px;
  overflow: hidden;
  background: $primary url(/images/icon-pencil.svg) no-repeat;
  background-position: 12px 10px;
  background-size: 29px 29px;
}

.feedback--response__hidden {
  display: none;
}

// GitHub info/edit buttons
#pre-footer {
  margin-top: 2rem;

  .button {
    font-size: 1.1rem;

    &:first-of-type {
      margin-right: 0.75rem;
    }
  }

  .lastedit {
    margin-top: 1rem;
    font-size: 1rem;
  }
}

footer.row {
  margin-left: initial;
  margin-right: initial;
}

