@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/**
  *
    RESET AND BASE STYLES
  *
**/

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a {
  line-height: 25px;
  text-decoration: none;
}

p {
  line-height: 1.7rem;
}

h1 {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 40px;
  margin-block-end: 2em;

  @media screen and (max-width: 1150px) {
    font-size: 1.5em;
  }

  @media screen and (max-width: 520px) {
    font-size: 1.25em;
  }
}

h2 {
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
}

li {
  padding-bottom: 10px;
}

li::marker {
  color: var(--wp--preset--color--red-dark);
}

.web-footer a:hover {
  color: var(--wp--preset--color--red-dark) !important;
}

.category .web-footer,
.archive .web-footer {
  margin-top: 200px;
}

main,
.wp-block-group:not(.has-background),
.wp-block-group.has-background > *:first-child {
  padding: 0 5%;
}

.single-post main {
  padding: 0 5% 120px 5% !important;
}

/* active links */
body.parent-pageid-120 .kb-nav-link-content[href*="/humal/"],
body.category-toovood .kb-nav-link-content[href*="/humal/"],
body.taxonomy-term .kb-nav-link-content[href*="/humal/"],
body.category-uudised .kb-nav-link-content[href*="/uudised"] {
  color: var(--wp--preset--color--dark-blue);
}

/* custom button */
.custom-btn-style a {
  color: #F7F5F2;
  background: var(--wp--preset--color--red-dark);
  padding-top: 10px;
  padding-bottom: 12px;
}

.custom-btn-style a:hover {
  background: var(--wp--preset--color--dark-blue);
}

/* correct english logo height */
.translatepress-en_GB .header img {
  aspect-ratio: initial !important;
}

body.category.translatepress-en_GB .header img,
body.taxonomy-term.translatepress-en_GB .header img {
  aspect-ratio: 2.8 !important;
}

/* Taxonomy title */
.taxonomy-term .wp-block-post-title {
  margin-block-end: 0;
}

.taxonomy-term .taxonomy-label {
  text-align: center;
  margin-block-start: 0.5em;
}

/**
  *
    HEADER
  *
**/
.header {
  position: fixed;
  box-sizing: border-box;
  top: 0;
  width: 100%;
  z-index: 10;
  background-color: #FFF;
  backdrop-filter: blur(6px);
  box-shadow: none;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.header ul.kb-navigation.open {
  display: block !important;
}

.header li {
  padding-bottom: 0 !important;
}

.logged-in .header {
  margin-top: 32px;
}

.menu-container:before {
  font-family: "Font Awesome 5 Pro";
  content: "\f0c9";
  cursor: pointer;
  font-size: 22px;
  position: absolute;
  padding: 0 5px;
  right: 0;
  top: -30px;
  display: none;
  z-index: 99;
}

.menu-open .menu-container:before {
  content: "\f00d";
  font-size: 25px;
  right: 1px;
}

/** sub-menu override **/
.sub-menu {
  border-radius: 15px !important;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.1) 0px 1px 3px -1px !important;
  border: 1px solid #e8e8e8 !important;
}

.sub-menu a {
  color: var(--wp--preset--color--red-dark) !important;
}

.sub-menu a:hover {
  color: var(--wp--preset--color--dark-blue) !important;
}

.current-menu-ancestor .current-menu-item a {
  color: var(--wp--preset--color--dark-blue) !important;
}

main {
  margin-top: 95px;

    @media screen and (max-width: 955px) {
      margin-top: 0;
    }
}

.scrolled {
  background-color: rgba(248, 248, 248, 0.8);
  box-shadow: 0 4px 5px -2px rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 955px) {
  header:has(.header) {
    height: 95px;
  }

  header:has(.header) ul.kb-navigation {
    display: none !important;
    position: absolute !important;
    top: 40px;
    right: -5px;
    background-color: #FFF;
    border-radius: 15px;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.1) 0px 1px 3px -1px;
    border: 1px solid #e8e8e8;
    padding-inline-start: 35px !important;
  }

  header:has(.header) ul li {
    display: block;
  }

  .menu-container:before {
    display: initial;
  }

  .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    clip: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: initial !important;
    box-shadow: initial !important;
    border: initial !important;
  }

  .sub-menu li {
    margin-left: 20px;
  }

  .sub-menu a {
    padding-top: 0 !important;
  }

  /** Kadence override **/
  header .kt-row-column-wrap {
    display: block;
  }

  header .wp-block-kadence-navigation .menu {
    padding: 10px 25px !important;
    margin: initial !important;
  }

}

/**
  *
    BLOCK MODIFICATIONS
  *
**/

/* full width block */
.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  position: relative;
}

/* posts padding */
.wp-block-kadence-posts .loop-entry .entry-content-wrap {
  padding: 0;
}

/* Lingid struktuuri lehel */
.wp-block-kadence-iconlist a:hover {
  color: var(--wp--preset--color--dark-blue) !important;
}

/* kadence design library height issue */
.kb-core-section-library {
  max-height: 250px !important;
}

/* accordion header overwrite */
.kt-blocks-accordion-header {
  cursor: pointer;
}

.kt-blocks-accordion-header .kt-blocks-accordion-title {
  color: var(--wp--preset--color--red-dark);
}

/* overwrite accordion link color */
.kt-accordion-panel-inner a {
  color: var(--wp--preset--color--red-dark) !important;
}

.kt-accordion-panel-inner a:hover {
  color: var(--wp--preset--color--dark-blue) !important;
}

/* front page 3 columns */
.three-blocks-front .kt-inside-inner-col {
  @media screen and (max-width: 1205px) {
    min-height: 362px !important;
  }
  @media screen and (max-width: 1025px) {
    min-height: 200px !important;
  }
}

/**
  *
    POSTITUSED
  *
**/

/* Uudised front page */
.wp-block-kadence-posts .loop-entry {
  padding: 20px;
  background-color: #F7F5F2;
  box-shadow: rgba(87, 87, 87, 0.15) 0px 3px 10px;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.wp-block-kadence-posts .loop-entry:hover {
  transform: scale(1.01);
  box-shadow: rgba(87, 87, 87, 0.18) 0px 8px 20px;
}

/* Uudised front page üldpealkiri ja uudiste pealkirjad */
.home .front-uudised {
  margin-block-start: 0 !important;
}

.home .kb-post-list-item h2 {
  @media screen and (max-width: 1025px) {
    font-size: 18px;
  }
}

/* "Ava uudis" nupp avalehel */
.type-post .more-link-wrap {
  padding: 10px 0 20px 0;
}

.type-post .more-link-wrap a {
  color: var(--wp--preset--color--red-dark);
}

.type-post .more-link-wrap a:hover {
  color: var(--wp--preset--color--dark-blue);
}

/* Uudised & Töövood pages */
.postitused-page.uudised .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 2.5rem;
  row-gap: 2.5rem;

    @media screen and (max-width: 1300px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media screen and (max-width: 850px) {
      grid-template-columns: repeat(1, minmax(0, 1fr));
    }
  }

.postitused-page.toovood {
    .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
    row-gap: 2.5rem;

      @media screen and (max-width: 850px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
      }
  }
}

.postitused-page.marksonad {
    .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
    row-gap: 2.5rem;
    margin-top: 45px;

      @media screen and (max-width: 850px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
      }
  }
}

.postitused-page {
  margin-bottom: 80px;
}

.wp-block-post {
  padding: 20px;
  background-color: #F7F5F2;
  box-shadow: rgba(87, 87, 87, 0.15) 0px 3px 10px;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.wp-block-post:hover {
  transform: scale(1.01);
  box-shadow: rgba(87, 87, 87, 0.18) 0px 8px 20px;
}

.wp-block-post-excerpt__excerpt::after {
  content: " […]";
  margin-left: 0.15em;
}

.wp-block-post-excerpt__more-text {
  padding: 20px 0;
}

.wp-block-post-excerpt__more-text a {
  font-weight: bold;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 80%;
  color: var(--wp--preset--color--red-dark);
}

.wp-block-post-excerpt__more-text a:hover {
  color: var(--wp--preset--color--dark-blue);
}

.wp-block-post-date {
  font-size: 80%;
}

.wp-block-query-pagination {
  padding-top: 50px;
}

.wp-block-query-pagination .wp-block-query-pagination-numbers a {
  margin: 0 10px;
}

.toovood-filters {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: 30px;
}

.toovood-filters h4 {
  margin-block-end: 0.6em;
}

.toovood-search-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
}

#toovood-search {
  -webkit-appearance: none;
  appearance: none;

  height: 40px;
  width: 100%;
  padding: 0 40px 0 40px; /* space for icons */
  font-size: 16px;
  color: #3b3a3a;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#toovood-search::-webkit-search-decoration,
#toovood-search::-webkit-search-cancel-button,
#toovood-search::-webkit-search-results-button,
#toovood-search::-webkit-search-results-decoration {
  display: none;
}

#toovood-result-count {
  padding-bottom: 30px;
}

/* Firefox */
#toovood-search[type="search"] {
  appearance: textfield;
}

.toovood-search-wrap::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0.8;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.65' y1='16.65' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.search-clear::before {
  content: "×";
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
}

.search-clear:hover::before {
  color: #111827;
}

#toovood-search:not(:placeholder-shown) + .search-clear {
  opacity: 1;
  pointer-events: auto;
}


.toovood-filter {
  /* Remove default styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 40px;
  min-width: 280px;
  padding: 0 40px 0 16px;
  font-size: 16px;
  color: #3b3a3a;
  margin: 0 10px 15px 0;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.1s ease;
}

.toovood-filter:hover {
  box-shadow: 0 0 0 2px rgba(192, 195, 199, 0.2);
}

.toovood-filter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

/**
  *
    ERROR PAGES
  *
**/
.error-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--wp--preset--color--beige);
}
.logged-in .error-wrapper {
  height: calc(100vh - 32px);
}
.error-container {
  background-color: var(--wp--preset--color--dark-blue);
  padding: 70px;
  border-radius: 10px;
  min-width: 500px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.error-container p {
  margin-bottom: 50px;
  color: var(--wp--preset--color--beige);
  font-size: 18px;
}
.error-code {
  font-size: 10rem;
  color: var(--wp--preset--color--beige);
  margin-bottom: 20px;
  animation: bounce 1s infinite alternate;
}
.error-text {
  font-size: 2rem;
  color: var(--wp--preset--color--beige);
  margin-bottom: 20px;
}
.error-button {
  padding: 10px 20px;
  background-color: var(--wp--preset--color--red-dark);
  color: var(--wp--preset--color--beige);
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}
.error-button:hover {
  background-color: var(--wp--preset--color--light-blue);
  color: #122030;
}
/* Falling images base style */
.fall {
  position: absolute;
  top: -150px;
  pointer-events: none;
  z-index: 1;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Individual variations */
.f1 {
  left: 10%;
  width: 80px;
  animation-duration: 18s;
  animation-delay: 0s;
}
.f2 {
  left: 30%;
  width: 120px;
  animation-duration: 25s;
  animation-delay: 6s;
}
.f3 {
  left: 55%;
  width: 60px;
  animation-duration: 20s;
  animation-delay: 6s;
}
.f4 {
  left: 75%;
  width: 140px;
  animation-duration: 15s;
  animation-delay: 0s;
}
.f5 {
  left: 90%;
  width: 70px;
  animation-duration: 22s;
  animation-delay: 8s;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-20px);
  }
}
@media screen and (max-width: 980px) {
  .error-code {
    font-size: 5rem;
  }
  .error-text {
    font-size: 1.5rem;
  }
  .error-container p {
    font-size: 16px;
  } 
}
@media screen and (max-width: 680px) {
  .error-container {
    padding: 50px;
  }
}
@media screen and (max-width: 380px) {
  .error-container {
    padding: 40px 15px;
  }
  .error-code {
    font-size: 3rem;
  }
  .error-text {
    font-size: 1.25rem;
  }
}
/* Falling + rotating animation */
@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
  }
}