/**
 * Styles for the blocks on the editor and the frontend.
 */

html {
  scroll-padding-top: 8rem;
  scroll-behavior: smooth;
  --wp--preset--spacing--80: 100px;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 8rem;
  }
}

.wp-block-column {
  box-sizing: border-box;
}

/* Header block template styles */

header .wp-block-site-logo {
  opacity: 0.9;
}

header .wp-block-site-logo img {
  height: auto;
  max-width: 100%;
}

body:not(.woocommerce-checkout) header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 99;
  width: 100%;
}

body.woocommerce-checkout header.wp-block-template-part {
  position: relative;
}

@media screen and (min-width: 1281px) {
  body:not(.woocommerce-checkout) header.wp-block-template-part {
    top: -43px;
  }
}


body.home header.wp-block-template-part {
  position: absolute;
  top: 0;
  background-color: transparent;
}

/* body.home header.wp-block-template-part.scroll, */
body:not(.home) header.wp-block-template-part {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
  /* background-color: rgb(36, 36, 36); */
  background-color: rgb(89, 89, 89);
  transition: background-color 0.3s ease;
}

body:not(.home) header.wp-block-template-part::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/otsake-taustalauta-2.jpg');
  background-size: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

header.wp-block-template-part.scroll::before,
body:not(.home) header.wp-block-template-part::before {
  opacity: 0.3;
}

.desktop-header {
  display: none;
}


@media screen and (max-width: 768px) {
  .home-page-banner h1 {
    /* font-size: 3rem !important; */
    line-height: 1.1 !important;
  }

  h2.has-large-font-size,
  .h2.has-large-font-size {
    font-size: 1.6rem !important;
  }

  .wp-block-spacer {
    max-height: 1rem;
  }

  .hide-on-mobile {
    display: none !important;
  }

}

.desktop-header {
  display: none;
}

.mobile-header {
  display: block;
}


@media screen and (min-width: 1281px) {
  .mobile-header {
    display: none;
  }

  .desktop-header {
    display: block;
  }
}

.desktop-header a.wp-block-navigation-item__content {
  padding: 0.2rem 0 0.2rem 0.5rem;
  border-bottom: 2px solid transparent;
}

.desktop-header a.wp-block-navigation-item__content:hover {
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.desktop-header .has-child a.wp-block-navigation-item__content:hover {
  /* padding: 0.2rem 0 0.2rem 0.5rem; */
  border-bottom: 2px solid transparent;
}

.desktop-header .header-top . a.wp-block-navigation-item__content {
  border-bottom: 1px solid transparent;
}

.desktop-header .header-top a.wp-block-navigation-item__content:hover {
  border-bottom: 1px solid var(--wp--preset--color--custom-light-gray);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.form-canvas-open__button.wp-block-button__link:hover {
  filter: brightness(90%) contrast(1.2);
}

/* Sub menu */

.wp-block-navigation__submenu-container {
  border-radius: 8px;
  overflow: hidden !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: max-content !important;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item.wp-block-navigation-link:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.desktop-header .wp-block-navigation__submenu-container .wp-block-navigation-item__label {
  font-size: 0.9rem;
  font-weight: 700;
}

@media screen and (max-width: 1280px) {
  .wp-block-navigation-item.has-child {
    flex-wrap: wrap;
  }

  .wp-block-navigation .wp-block-navigation__submenu-container {
    position: initial !important;
    flex: 1;
    margin-top: 0.5rem;
    box-shadow: none;
    min-width: 80vw !important;
  }
}




/* Global padding, so content won't touch the fixed button */

@media screen and (min-width: 900px) and (max-width: 1460px) {

  .has-global-padding {
    --wp--style--root--padding-right: 4rem;
    --wp--style--root--padding-left: 4rem;
  }
}

/* accordion */

.wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title {
  /* color: var(--wp--preset--color--custom-fortis-orange); */
  text-decoration: none;
}

/* svg arrow */
.wp-block-accordion-heading .wp-block-accordion-heading__toggle-title::after {
  content: url('/wp-content/themes/fortis-sivu-theme/assets/images/fortis-icon-chevron.svg');
  float: right;
  font-size: 1.5rem;
  line-height: 1rem;
  transition: transform 0.3s ease;
}

.wp-block-accordion-item.is-open>.wp-block-accordion-heading .wp-block-accordion-heading__toggle-title::after {
  transform: rotate(180deg);
}

/* hr */

.wp-block-separator {
  width: 66px;
  border-top: 3px solid;
}

.border-right {
  border-right: 3px solid white;
}


.overflow-hidden {
  overflow: hidden;
}

/* mobile-full-width */

@media screen and (max-width: 1024px) {

  /* .wp-block-group.is-layout-constrained.mobile-full-width,
  figure.wp-block-post-featured-image.mobile-full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  } */
}

/* Responsiveness */

.overflow-hidden {
  overflow: hidden;
}

.full-height-column-with-image .wp-block-image {
  height: 100% !important;
}

.full-height-column-with-image img {
  object-fit: cover;
  object-position: center;
  height: 100%;
}


/* Search canvas and Menu canvas and Form canvas */

.mobile-search-canvas,
.mobile-menu-canvas,
.form-canvas {
  width: 100%;
  position: fixed;
  z-index: 999;
  top: 0;
  right: -100%;
  transition: 0.1s;

}

.form-canvas {
  max-width: 600px;
}

/* Add overlay when canvas is open */
.form-canvas.open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.mobile-search-canvas.open,
.mobile-menu-canvas.open,
.form-canvas.open {
  width: 100%;
  right: 0;
  /* background-color: #fff; */
  /* background-color: #191919; */
  background-color: var(--wp--preset--color--custom-kauhavan-vaaleanharma);
  background-size: cover;
  background-position: center;
  z-index: 999;
  max-height: -webkit-fill-available;
  max-height: 100dvh;
}

.mobile-search-canvas.open,
.mobile-menu-canvas.open {
  overflow-y: scroll;
}

.form-canvas.open>div {
  background-color: var(--wp--preset--color--custom-fortis-paper-white-bg);
  /* background-color: #fff; */
  padding: 2rem;
  height: 100vh;
  max-height: -webkit-fill-available;
  max-height: 100dvh;
}



.form-canvas .gform_wrapper {
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding: 0 1rem 2rem 3px;
}

.mobile-search-canvas .wp-block-column {
  overflow-wrap: normal;
  word-break: normal;
}

/* .mobile-menu-canvas.open .wp-block-site-logo img {
  filter: brightness(200);
} */

body:has(.form-canvas.open) {
  overflow: hidden;
}

/* main */

.entry-content {
  /* padding-bottom: 5rem; */
}

.wp-block-template-part {
  margin-block-start: 0;
}

main:has(.article-card) {
  padding-top: 2rem;
  background-color: #f2f2f2;
}

@media screen and (min-width: 920px) {

  main:has(.article-card) {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media screen and (max-width: 920px) {
  .home-banner-text {
    padding-top: 10rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Language switcher */

@media screen and (min-width: 1281px) {
  .trp-block-container .trp-shortcode-switcher {
    padding: 0;
    background-color: #FFFFFFCC;
  }

  .trp-shortcode-switcher__wrapper {
    line-height: 1;
  }

  .trp-current-language-item__wrapper {
    padding-right: 3px !important;
  }

  .trp-block-container .trp-language-item {
    gap: 4px;
    padding: 2px 5px;
    min-height: none;
  }

  .trp-language-item-name {
    /* color: white !important; */
  }
}




/* footer */

@media screen and (max-width: 920px) {
  .footer-bottom-line {
    margin-bottom: 3rem !important;
  }
}

footer a {
  text-decoration: none;
}

@media screen and (max-width: 600px) {
  footer {
    text-align: center;
  }
}

/* Category card */

.category-card {
  overflow: hidden;
  transform: scale(1);
  transition: transform 0.2s ease;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01); */
}

.category-card a {
  text-decoration: none;
}

.category-card:has(a:hover) {
  transform: scale(1.02);
  /* transition: transform 0.2s ease; */
  /* box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); */
}



/* Scrollbar */

.form-canvas ::-webkit-scrollbar {
  /* width: 8px; */
  /* height: 8px; */
  width: 8px;
}

/* Track */
.form-canvas ::-webkit-scrollbar-track {
  background: #D9D9D9;
  border-radius: 6px;
  box-shadow: inset 0 0 8px 8px #D9D9D9;
  border: 4px solid transparent;
}

/* Handle */
.form-canvas ::-webkit-scrollbar-thumb {
  background: #023134;
  border-radius: 5px;
  box-shadow: inset 0 0 8px 8px #023134;
  border: solid 4px transparent;
}