@import "mixins";

/* default styles */

.visually-hidden {
  @include element-invisible();
}
.flexbox {
  @include flexbox();
}
a.tabledrag-handle .handle {
  box-sizing: content-box;
}
.hidden,
[hidden="hidden"] {
  display: none !important;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  &:focus {
    outline: none;
  }
}

.limited {
  width: 100%;
  max-width: 1120px;
  margin: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

html {
  font-size: 10px;
  height: 100%;
}

body {
  font-family: "Arial";
  font-weight: normal;
  font-size: 1.6rem;
  line-height: 1.4;
  height: 100%;
  color: var(--gray1);
  &.tabfocus {
    *:focus {
      outline: 2px solid #83bded !important;
    }
    input[type="checkbox"],
    input[type="radio"] {
      &:focus {
        & + label {
          outline: 2px solid #83bded !important;
        }
      }
    }
  }
}

.link-hover {
  transition: background-color 0.5s;
  &:hover {
    background-color: #ccc;
  }
}

.underline-anim {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat !important;
  background-position: left bottom 0.1em;
  background-size: 0 0.1em;
  text-decoration: none;
  -webkit-transition: background-size 0.5s, color 0.5s;
  transition: background-size 0.5s, color 0.5s;
  &:hover {
    color: currentColor;
    animation: underline 0.5s;
    background-size: 100% 0.1em;
    text-decoration: none !important;
    -webkit-transition: color 0.5s;
    transition: color 0.5s;
  }
}


h1, h2, h3, h4, h5, h6 {
  margin-top: 1em;
  margin-bottom: 1rem;
  a {
    @extend .underline-anim;
  }
}
h1 {
  font-size: clamp(3.4rem, 3vw, 4rem);
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 3rem;
}
h2 {
  font-weight: bold;
  font-size: 3.4rem;
}
h3 {
  font-weight: 600;
  font-size: 3rem;
}
h4 {
  font-weight: normal;
  font-size: 2.8rem;
}
h5 {
  font-weight: 600;
  font-size: 2.2rem;
}
h6 {
  font-weight: 600;
  font-size: 2rem;
}
a, a:visited {
  text-decoration: underline;
  color: var(--light-brown);
}
p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

img,
video {
  max-width: 100%;
  height: auto;
}
iframe {
  max-width: 100%;
}

ul, ol {
  padding-left: 3rem;
  margin-left: 3rem;
  display: table;
  li {
    & + li {
      padding-top: 0.3rem;
    }
    ul, ol {
      margin-top: 0.3rem;
      margin-left: 0;
    }
    &::marker {
      color: currentColor;
    }
  }
}

.text-formatted {
  a {
    @extend .link-hover;
    word-break: break-word;
  }
}

.float-shadow {
  position: relative;
  -webkit-transform: translateY(0);
  transform: translateY(0);
  -webkit-transition: transform 0.5s;
  transition: transform 0.5s;
  &:before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 100%;
    left: 5%;
    width: 90%;
    height: 10px;
    opacity: 0;
    background: -webkit-radial-gradient(center, ellipse, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 80%);
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 80%);
    -webkit-transition: opacity 0.5s;
    transition: opacity 0.5s;
  }
  &:hover {
    -webkit-transform: translateY(-5px);
    transform: translateY(-5px);
    &:before {
      opacity: 1;
    }
  }
}

.btn {
  display: inline-block;
  padding: 1.8rem 3rem;
  text-align: center;
  text-decoration: none;
  border-radius: 3rem;
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1em;
  box-shadow: none;
  text-shadow: none;
  border: none;
  background: none;
  transition: background-color 0.5s;
  &:hover {
    cursor: pointer;
    text-decoration: none;
  }
}
.btn-small {
  padding: 1.5rem 2rem;
  font-size: 1.4rem;
}

input[type="submit"],
.form-submit {
  @extend .btn;
}
button {
  &:hover {
    cursor: pointer;
    text-decoration: none;
  }
}


.close-x {
  position: relative;
  text-indent: -300vw;
  width: 4rem;
  height: 4rem;
  display: inline-block;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border: none;
  background: none;
  overflow: hidden;
  z-index: 1;
  &:before,
  &:after {
    content: "";
    width: 36px;
    height: 3px;
    background: #000;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -1px 0 0 -18px;
    transition: transform 0.5s;
  }
  &:before {
    transform: rotate(45deg);
  }
  &:after {
    transform: rotate(-45deg);
  }
  &:hover {
    cursor: pointer;
    &:before {
      transform: rotate(225deg);
    }
    &:after {
      transform: rotate(135deg);
    }
  }
}
.msg-highlighted {
  position: fixed;
  top: 3rem;
  left: -100%;
  right: -100%;
  margin: 0 auto;
  width: calc(100% - 4rem);
  max-width: 60rem;
  max-height: calc(100vh - 4rem);
  border-radius: $radius;
  box-shadow: 0 28px 99px rgba(0,0,0,0.7);
  z-index: 10;
  overflow: auto;
  -webkit-animation: msg-on 0.5s;
  animation: msg-on 0.5s;
  .msg-close {
    display: inline-block;
  }
  &.close {
    margin-top: -100vh;
    visibility: hidden;
    -webkit-transition: all 0.5s;
    transition: all 0.5s;
    * {
      visibility: hidden;
    }
  }
}
.messages {
  margin: 1em 0;
  padding: 2rem 5rem 2rem 2rem;
  color: #fff;
  background-color: green;
  border: none;
  border-radius: $radius;
  position: relative;
  box-shadow: none;
  .msg-close {
    @extend .close-x;
    position: absolute;
    right: 2rem;
    top: 2rem;
    width: 3rem;
    height: 3rem;
    color: currentColor;
    display: none;
    &:before,
    &:after {
      width: 2rem;
      height: 2px;
      margin-left: -1rem;
      background-color: currentColor;
    }
    span {
      @extend .visually-hidden;
    }
  }
}
.messages--warning {
  color: #fff;
  background-color: orange;
}
.messages--error {
  color: #fff;
  background-color: red;
}

.tabs {
  &.primary {
    li {
      a {
        @extend .btn-small;
        background-color: transparent;
        &.is-active {
          @extend .btn-small;
        }
      }
    }
  }
}

.table-wrap {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overflow-y: visible;
}

table {
  border-collapse: collapse;
  tr {
    td, th {
      padding: 1rem;
      text-align: left;
    }
  }
  thead {
    td, th {
      background-color: #666;
      color: #fff;
    }
  }
  tbody {
    tr {
      td {
        background-color: #fff;
        border: none;
        border-bottom: 2px solid #333;
      }
    }
  }
}

.form-input {
  color: #000;
  background-color: #fff;
  font-weight: normal;
  padding: 0 1.5rem;
  height: 5rem;
  width: 100%;
  border: 1px solid #333;
  border-radius: $radius;
  &:focus {
    background-color: #f6f6f6;
    box-shadow: 0 0 4px #333;
  }
}
.form-input-error {
  border-color: red;
}

input[type="checkbox"],
input[type="radio"] {
  opacity: 0;
  float: left;
  width: 1.6rem;
  height: 1.6rem;
  & ~ label {
    position: relative;
    display: block;
    padding-left: 3rem;
    opacity: 1;
    &:before {
      content: "";
      position: absolute;
      top: 0.15em;
      left: 0;
      display: inline-block;
      width: 1.6rem;
      height: 1.6rem;
      background: #fff;
      border: 2px solid #333;
      border-radius: $radius;
    }
    &:hover {
      cursor: pointer;
    }
  }
  &:checked {
    & ~ label {
      &:before {
        background-image: linear-gradient(#666 0%, #666 100%);
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 1.2rem 1.2rem;
        border-color: #666;
      }
    }
  }
}
input[type="radio"] {
  & ~ label {
    &:before {
      margin-left: 2px;
      margin-top: 2px;
      width: 1.2rem;
      height: 1.2rem;
      background-color: #fff;
      border-color: #fff;
      border-radius: 100%;
      outline: 2px solid #333;
    }
  }
  &:checked {
    & ~ label {
      &:before {
        background-image: none;
        border-color: #fff;
        background-color: #666;
        outline-color: #666;
      }
    }
  }
}
form {
  a {
    @extend .link-hover;
  }
  .form-text,
  .form-number,
  .form-select,
  .form-email,
  .form-tel,
  .form-date,
  .form-time,
  textarea {
    @extend .form-input;
    &.error {
      @extend .form-input-error;
    }
  }
  textarea {
    height: auto;
    padding: 1.5rem;
  }
  label {
    font-weight: 600;
  }
}

ul[class*="pager"] {
  @extend .flexbox;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem 8rem;
  margin: 1em 0;
  line-height: 1;
  font-size: 1.6rem;
  color: #000;
  position: relative;
  li {
    padding: 0;
    margin: 0;
    display: inline-block;
    height: 4rem;
    line-height: 4rem;
    &[class*="active"],
    a {
      display: inline-block;
      height: 4rem;
      width: 4rem;
      color: #fff;
      line-height: 4rem;
      text-align: center;
      padding: 0;
      margin: 0 0.5rem;
      background-color: #666;
      border-radius: 100%;
      text-decoration: none;
      &:hover {
        text-decoration: none;
        color: #fff;
        background-color: #333;
      }
    }
    &[class*="active"] {
      color: #fff;
      background-color: #333;
      a {
        margin: 0;
        color: #fff;
        background-color: #333;
      }
    }
    &[class*="first"],
    &[class*="previous"],
    &[class*="next"],
    &[class*="last"] {
      position: relative;
      width: 4rem;
      margin: 1rem 0;
      text-indent: -200vw;
      a {
        float: left;
        width: 4rem;
        height: 4rem;
        position: relative;
        background: none;
        margin: 0;
        display: inline-block;
        &:before,
        &:after {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          //@extend .icon-arrow-down-blue;
          background-repeat: no-repeat;
          background-size: auto 1.2rem;
          background-position: center center;
        }
        &:hover {
          &:before,
          &:after {
            //@extend .icon-arrow-down;
          }
        }
      }
    }
    &[class*="first"],
    &[class*="previous"] {
      a {
        &:before,
        &:after {
          transform: rotate(90deg);
        }
      }
    }
    &[class*="next"],
    &[class*="last"] {
      a {
        &:before,
        &:after {
          transform: rotate(-90deg);
        }
      }
    }
    &[class*="previous"],
    &[class*="next"] {
      a {
        &:after {
          display: none;
        }
      }
    }
    &[class*="previous"] {
      margin-right: 2rem;
    }
    &[class*="next"] {
      margin-left: 2rem;
    }
    &[class*="first"] {
      a {
        &:before {
          margin-left: -0.5rem;
        }
        &:after {
          margin-left: 0.5rem;
        }
      }
    }
    &[class*="last"] {
      a {
        &:before {
          margin-left: -0.5rem;
        }
        &:after {
          margin-left: 0.5rem;
        }
      }
    }
  }
}

.grid-wrap {
  @extend .flexbox;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-left: -1rem;
  margin-right: -1rem;
}
.grid-2-item {
  width: 50%;
  padding: 1rem;
}
.grid-3-item {
  width: 33.33%;
  padding: 1rem;
}
.grid-3-margin-item {
  @extend .grid-3-item;
  width: calc(33.33% - 2rem);
  margin: 1rem;
}
.grid-4-item {
  width: 25%;
  padding: 1rem;
}

.media--type-image {
  margin-bottom: 1em;
  .field--type-image {
    display: inline-block;
    line-height: 0;
    border: 2rem solid #fff;
    border-radius: $radius;
    box-shadow: 0 0 8px rgba(25,42,86,0.6);
    a {
      display: inline-block;
    }
  }
}
.media--type-video {
  .field--type-file {
    display: inline-block;
    line-height: 0;
    border: 2rem solid #fff;
    border-radius: $radius;
    box-shadow: 0 0 8px rgba(25,42,86,0.6);
  }
}
figure.caption {
  .media {
    margin-bottom: 0;
  }
  figcaption {
    font-size: 1.6rem;
    font-weight: 600;
  }
}
.grid-media-img {
  height: 100%;
  .field--type-image {
    @extend .flexbox;
    align-items: center;
    height: 100%;
  }
}


ul.menu,
ul.links {
  li {
    list-style: none;
  }
}
ul.links {
  margin: 0;
  li {
    padding: 0;
    margin-right: 1rem;
  }
}

.menu--main {
  a {
    color: #fff;
  }
  .back {
    display: none;
  }
}

.footer-macroweb-block {
  display: inline-block;
  text-align: left;
  line-height: 0;
  @extend .float-shadow;
  a {
    display: inline-block;
    width: 16rem;
    height: 3rem;
    text-indent: -500vw;
    overflow: hidden;
    background: url('../images/macroweb.svg') no-repeat center center;
    background-size: 100% auto;
    opacity: 0.5;
  }
}


.region-highlighted {
  .messages {
    @extend .msg-highlighted;
  }
}
.region-header {
  @extend .flexbox;
  background-color: var(--gray1);
  color: #fff;
}
.region-footer {
  background-color: var(--gray2);
  color: var(--text-on-dark);
}

div#sliding-popup {
  background: #666;
  .popup-content {
    @extend .flexbox;
    -webkit-justify-content: space-between;
    -webkit-align-items: center;
    justify-content: space-between;
    align-items: center;
    position: static;
    max-width: 100%;
    padding: 1rem;
    #popup-text,
    #popup-buttons {
      max-width: none;
      margin: 0;
      padding: 1rem;
      color: #fff;
    }
    #popup-text {
      * {
        font-weight: normal;
        font-size: 1.8rem;
        color: #fff;
      }
    }
    #popup-buttons {
      @extend .flexbox;
      button {
        @extend .btn-small;
        white-space: nowrap;
        margin: 0 0.5rem;
        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
}


body {
  &.toolbar-horizontal {
    .messages {
      top: 10rem;
    }
  }
  &:has(.ui-widget-overlay){
    overflow: hidden;
  }
}


/* responsive layout */
@import "responsive";
