@import url('index/section-decoration.css');

/* !DEV */
/* { */
/* background: rgba(0, 0, 0, 0.4); */
/* } */
/* ! */

:root {
  --common-item-size: clamp(250px, 20vw, 450px);
  --common-image-size: clamp(150px, 18vw, 300px);
}

html {
  scroll-behavior: smooth;
}

form {
  .label:has([required]) .label-text::after {
    content: ' *';
    color: red;
  }

  .asterix {
    color: red;
  }

  .hp {
    display: none !important;
  }
}

/* #region background config */

#index-header {
  width: 100vw;
  position: fixed;
  top: 5px;
  left: 0px;
  z-index: 200;
  border-radius: 0 0 var(--common-br) var(--common-br);
  anchor-name: --index-header;

  .open-nav-btn {
    --background-mix-ratio: 0% !important;
    border-radius: 50px;
    padding: 8px 16px 8px 32px;

    .bar {
      height: 4px;
      width: 30px;
      background: var(--color-dark);
      border-radius: 5px;
      transform-origin: center center;
      transition:
        width 0.3s ease,
        translate 0.3s ease 0.3s,
        rotate 0.3s ease 0s;
    }

    .bar:nth-child(1) {
      width: 20px;
      translate: 0 -8px;
    }

    .bar:nth-child(2) {
      translate: 0 0;
    }

    .bar:nth-child(3) {
      width: 20px;
      translate: 0 8px;
    }
  }
}

body:has(.navigation.open) #index-header {
  .open-nav-btn {
    .bar {
      transition:
        width 0.3s ease,
        translate 0.3s ease 0s,
        rotate 0.3s ease 0.3s;
    }

    .bar:nth-child(1) {
      translate: 0;
      rotate: 45deg;
    }

    .bar:nth-child(2) {
      width: 0;
    }

    .bar:nth-child(3) {
      translate: 0;
      rotate: -45deg;
    }
  }
}

.navigation {
  --open-delay: 1.2s; /* nav link transition + max delay + opacity */
  /* position-anchor: --index-header; */
  /* top: anchor(bottom); */
  /* bottom: 10px; */
  /* right: 0; */
  top: 0px;
  left: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  translate: 100%;
  opacity: 0;
  background: color-mix(in srgb, var(--color-orange-light) 60%, transparent 40%);
  backdrop-filter: blur(8px);
  transition:
    opacity ease 0.2s,
    translate 0s linear var(--open-delay);
  position: fixed;

  .close-dialog {
    top: 10px;
    right: 10px;
  }

  .nav-link-box {
    opacity: 0;
    translate: -30px;
    transition:
      opacity ease 0.4s,
      translate ease 0.4s;
  }

  .nav-link-box:nth-child(2) {
    transition-delay: 0.1s;
  }

  .nav-link-box:nth-child(3) {
    transition-delay: 0.2s;
  }

  .nav-link-box:nth-child(4) {
    transition-delay: 0.3s;
  }

  .nav-link-box:nth-child(5) {
    transition-delay: 0.4s;
  }

  .nav-link-box:nth-child(6) {
    transition-delay: 0.5s;
  }

  .nav-link-box:nth-child(7) {
    transition-delay: 0.6s;
  }

  &:is(.open) {
    opacity: 1;
    translate: 0;
    transition:
      opacity ease 0.2s,
      translate 0s linear 0s;
    /* translate: -10px; */
    /* opacity: 1; */

    .nav-link-box {
      opacity: 1;
      translate: 0;
    }
  }
}

a.button.nav-link {
  --background: var(--color-green-light);
  --background-mix-ratio: 0% !important;
  --border: transparent;
  --border-mix-ratio: 10%;
  padding: 12px 24px;
  backdrop-filter: blur(6px);

  .leaf {
    fill: var(--color-dark);
    opacity: 0;
    transition: ease-in-out 0.2s;
  }

  .leaf-left {
    translate: -8px;
  }

  .leaf-right {
    scale: -1 1;
    translate: 8px;
  }

  &:is(.active) {
    /* transition: none !important; */
    --shadow: none !important;
    --background-mix-ratio: 0%;

    .leaf {
      translate: 0;
      opacity: 1;

      svg {
        fill: var(--color-dark);
      }
    }

    .leaf-right {
      rotate: -25deg;
    }

    .leaf-left {
      rotate: 25deg;
    }
  }
}

@media (hover: hover) {
  a.button.nav-link:not(.active):hover {
    --background-mix-color: var(--background);

    .leaf {
      translate: 0;
      opacity: 1;
    }

    .leaf-right {
      rotate: -25deg;
    }

    .leaf-left {
      rotate: 25deg;
    }
  }
}

/* default */
.image {
  width: var(--common-image-size);
  border-radius: var(--common-br);
}

.main-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  max-width: 1500px;
  width: calc(100vw - 40px); /* include mobile fullwidth padding */
  gap: 10px;
  margin: 0 auto;
  /* margin: 75px auto 0; */
  padding-top: 100px;
}

.auto-list {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: start;
  gap: 30px;

  /* .auto-list-item { */
  /* } */
}

.openable {
  --max-height: 100vh;
  --transition: 0.4s;
  max-height: 0;
  padding: 0px !important;
  overflow: hidden;
  transition: max-height var(--transition) ease;

  &:is(.open) {
    max-height: var(--max-height);
    transition: max-height var(--transition) ease;
  }
}

.review-banner {
  --br: 0;
  margin-top: 50px;

  .review-item {
    width: var(--common-item-size);
  }
}

.home-main-section {
  padding: 0 !important;
  max-width: none !important;
  width: 100vw !important;
  height: 100vh !important;

  .home-carousel {
    overflow: hidden;
  }

  .slide-element {
    .slide-image {
      .image {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    .slide-message {
      max-width: calc(100% - 20px);
      top: 50%;
      left: 100px;
      translate: 0% -50%;
      padding: 10px 25px;
      /* border-radius: 50px; */
      font-size: 1.8rem;
      box-shadow: none;
    }
  }
}

@media (max-width: 750px) {
  .slide-element .slide-message {
    left: 10px !important;
    font-size: 1.2rem !important;
  }
}

/* setup animation transition */

.slide-element {
  --transition: 1s;
  --half-transition: calc(var(--transition) * 0.5);
  --message-transition: calc(var(--transition) * 0.75);

  .slide-image {
    opacity: 0;
    transition: opacity var(--transition) ease;
  }

  .slide-message {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transition: opacity var(--transition) ease-in;
    animation: hide var(--message-transition) ease-in forwards;
  }
}

.slide-element:is(.active) {
  .slide-image {
    opacity: 1;
  }

  .slide-message {
    opacity: 1;
    animation: reveal var(--message-transition) ease-out var(--half-transition) forwards;
    transition: opacity var(--half-transition) ease-out;
  }
}

@keyframes reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes hide {
  from {
    clip-path: inset(0 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 100%);
  }
}

/* Main section responsive */
/*  */

.about-me-main-section {
  --image-width: var(--common-item-size);

  .about-me-wrapper {
    container-type: inline-size;
    container-name: about-me-wrapper;
    max-width: 1200px;
    margin: 0 auto;
  }

  .title {
    position: absolute;
    position-anchor: --about-image-anchor;
    z-index: 2;
    left: anchor(right);
    top: anchor(top);
    translate: -50% 10px;
  }

  .content {
    line-height: 1.8;
  }

  .image {
    position: relative;
    width: var(--image-width);
    border-radius: 50%;
    top: 50%;
    padding: 10px;
  }
}

.glyphe {
  --size: calc(100px + 2%);
  width: var(--size);
  height: var(--size);
}

.glyphe-about-me {
  fill: #ff002b;
}

.glyphe-ener-level {
  fill: #ffffff;
}

@container about-me-wrapper (min-width: 500px) {
  .image {
    anchor-name: --about-image-anchor; /*! used also in section-decoration.css*/
    float: left;
    shape-outside: circle(50%);
    --gap-x: 30px;
    --gap-y: 15px;
    margin-right: var(--gap-x);
    right: calc(var(--gap-x) * 0.5);
    margin-bottom: var(--gap-y);
    bottom: calc(var(--gap-y) * 0.5);
  }

  .content {
    margin: calc(var(--image-width) * 0.2) 0 0 15px;
  }
}

@container about-me-wrapper (max-width: 400px) {
  .title {
    position: static !important;
    position-anchor: none !important;
    translate: none !important;
    margin: 0 auto 20px auto;
  }
}

/* #region energy-cut */
.energy-cut-main-section {
  /* --ener-level-width: var(--common-image-size); */
  /* --ener-level-gap: calc(30px + 4vw); */

  .energy-cut-title {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 1.2rem;
    text-align: center;
    white-space: nowrap;
    gap: 10%;
    padding: 0 10%;

    &::after,
    &::before {
      content: '';
      display: block;
      width: 100%;
      height: 1px;
      border-radius: 2px;
      background: var(--color-dark);
    }
  }

  .ener-level-wrapper {
    gap: calc(30px + 2%);

    .ener-level {
      width: var(--common-item-size);
      position: relative;

      .title {
        margin-bottom: 20px;
        /* translate: -50% 30px; */
      }

      .image {
        border-radius: 50%;
      }

      .subtitle {
        line-height: 1.8;
      }

      .bar {
        position: absolute;
      }
    }
  }
}

.ener-level-glyphe-wrapper {
  max-width: 1200px;
}

.service-item {
  --image-width: var(--common-image-size);
  width: var(--common-item-size);

  .image {
    width: var(--image-width);
    border-radius: var(--common-br);
  }

  .service-item-price {
    width: var(--image-width);
  }

  .price-label {
    border-bottom: solid 1px var(--color-dark);
  }
}

.training-main-section {
  .content {
    line-height: 1.8;
    max-width: 800px;
  }

  .open-training-contact {
    float: bottom;
  }

  .image {
    width: clamp(300px, 45vw, 1200px);
  }
}

.training-contact {
  --max-height: 1200px;
  --transition: 0.8s;
  max-width: 1000px;

  textarea {
    resize: none;
  }
}

/* #region news */

#list-news-root {
  width: 100%;
  max-width: 1000px;
  min-width: 100%;
  max-height: 75vh;
  padding: 20px;
}

.news-item {
  .news-item-date {
    font-size: 0.8rem;
    font-style: italic;
  }
}

#dialog-news {
  .image {
    width: clamp(300px, 35%, 600px);
    height: auto;
    margin-bottom: 10px;
  }

  .yt-player-wrapper {
    margin: 10px auto 0 auto;
  }
}

/* #region contact */

/* .contact-box-glass .box { */
/* --background-mix-ratio: 40%; */
/* } */

#contact {
  align-items: start;

  .contact-column-handler {
    width: clamp(300px, 40%, 600px);
    max-width: 100%;
    /* max-width: 600px; */
  }
}

@media (max-width: 750px) {
  #contact {
    align-items: center;
  }
}

#flower-of-life-sticky-container {
  width: 100%;
  position: sticky;
  top: 30px;
  /* margin-left: auto; */
  z-index: -1;

  .flower-of-life {
    position: absolute;
    width: 850px;
    right: 0;
    top: 30px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    /* translate: -100% 30px; */
  }
}

/* #flower-of-life { */
/* position: sticky; */
/* top: 50px; */
/* z-index: -1; */
/* max-width: 100%; */
/* max-height: 100%; */
/* aspect-ratio: 1 / 1; */
/* width: 100%; */
/* height: 100%; */
/* } */

.contact-main-section {
  min-height: 75vh !important;
}

.contact-label {
  font-weight: 800;
}

:is(.phone-button-wrapper, .phone-display-wrapper) {
  --max-height: 70px;
}
