/**
 * 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 img {
  height: auto;
  max-width: 100%;
}

header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background-color: var(--wp--preset--color--custom-fortis-paper-white-bg);
}

body.page-template-map header.wp-block-template-part {
  position: fixed;
  background-color: transparent;
}

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);
}

.desktop-header {
  display: none;
}

@media screen and (max-width: 768px) {
  .home-page-banner h1 {
    font-size: 3rem !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;
  }

}


@media screen and (min-width: 1281px) {
  .mobile-header {
    display: none;
  }

  .desktop-header {
    display: block;
  }
}

@media screen and (max-width: 1280px) {
  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: block;
  }
}

.desktop-header a.wp-block-navigation-item__content {
  padding: 0.2rem 0.5rem;
  border-bottom: 2px solid transparent;
}

.desktop-header a.wp-block-navigation-item__content:hover {
  border-bottom: 2px solid var(--wp--preset--color--custom-fortis-orange);
}

.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);
}


/* 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%;
}

/* Scroll-on-mobile progress bar */

.scroll-on-mobile-progress {
  display: none;
  height: 8px;
  background-color: rgba(2, 49, 52, 0.2);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.for-who .scroll-on-mobile-progress {
  background-color: rgba(255, 255, 255, 0.2);
  margin-top: 2rem;
  margin-bottom: 0;
}

.scroll-on-mobile-progress__bar {
  height: 100%;
  width: 0%;
  background-color: rgba(2, 49, 52, 0.8);
  border-radius: 8px;
  transition: width 0.1s ease;
}

.for-who .scroll-on-mobile-progress__bar {
  background-color: var(--wp--preset--color--custom-fortis-orange);
}


@media screen and (max-width: 768px) {

  :root {
    --wp--preset--spacing--80: 3rem !important;
  }

  h2 {
    font-size: 2.2rem !important;
  }

  .fortis-counts {
    font-size: 47px !important;
  }

  .wp-block-button__link {
    padding: 0.5rem 1rem !important;
  }

  .padding-mobile-small {
    padding: 2.2rem 1.3rem !important;
  }

  .has-global-padding {
    --wp--style--root--padding-right: 1.3rem !important;
    --wp--style--root--padding-left: 1.3rem !important;
  }

  .front-top-wrapper h1 {
    font-size: 36px !important;
  }

  .front-top-wrapper .front-top-right {
    padding: 0.75rem !important;
    /* min-height: 100vw !important; */
    aspect-ratio: 9 / 10 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
  }

  .front-top-punchline {
    font-size: 0.85rem !important;
    padding: 0.5rem 0.7rem 0.5rem 0.5rem !important;
  }

  .front-top-punchline img {
    width: 21px;
  }

  .scroll-on-mobile {
    overflow-x: scroll;
    flex-wrap: nowrap !important;
    gap: 0.7rem;
    margin-left: calc(var(--wp--style--root--padding-right) * -1) !important;
    margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
    padding-left: var(--wp--style--root--padding-right) !important;
    padding-right: var(--wp--style--root--padding-right) !important;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  .scroll-on-mobile::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }

  .scroll-on-mobile::after {
    content: '';
    position: sticky;
    right: calc(var(--wp--style--root--padding-right) * -1);
    flex-shrink: 0;
    width: 1.5rem;
    align-self: stretch;
    /* margin-left: -1.5rem; */
    background: linear-gradient(to right, transparent, var(--wp--preset--color--custom-fortis-paper-white-bg));
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .scroll-on-mobile.scroll-end::after {
    opacity: 0;
  }

  .scroll-on-mobile.scroll-end-hidden::after {
    display: none;
  }

  .scroll-on-mobile .wp-block-column {
    flex: 0 0 auto;
    max-width: 60vw;
    opacity: 0;
    transform: translateX(1.5rem);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }

  .scroll-on-mobile .wp-block-column.card-visible {
    opacity: 1;
    transform: translateX(0);
  }

  .scroll-on-mobile.for-who .wp-block-column img {
    aspect-ratio: 16/10 !important;
  }

  .scroll-on-mobile .padding-mobile-small {
    font-size: 0.95em;
    padding: 1.5rem 0.8rem !important;
  }

  .mobile-flex-reverse {
    flex-direction: column-reverse !important;
  }

  .scroll-on-mobile-progress {
    display: block;
  }

  .form-canvas.open .gform-footer {
    padding-bottom: 3rem !important;
  }
}

@media screen and (max-width: 400px) {
  .form-canvas .form-canvas-heading {
    font-size: 22px !important;
  }
}


/* 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: var(--wp--preset--color--custom-fortis-paper-white-bg);
  /* background-color: #fff; */
  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;
  }
}

/* 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;
  }
}

/* Gravity Forms */

.gform_required_legend {
  display: none;
}

.gform-theme--api,
.gform-theme--foundation .gform_fields {
  --gf-form-gap-y: 20px;
}

.gform-footer input[type="submit"] {
  background-color: var(--wp--preset--color--custom-fortis-orange) !important;
  border-radius: 0.5rem !important;
  color: var(--wp--preset--color--custom-fortis-text) !important;
  font-style: normal;
  font-weight: 500;
  padding-top: 13px !important;
  padding-right: 2rem;
  padding-bottom: 13px !important;
  padding-left: 2rem;
}

.gform-footer input[type="submit"]:hover {
  filter: brightness(90%) contrast(1.2);
}

.ginput_container_fileupload input[type="file"] {
  border-radius: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  color: var(--wp--preset--color--custom-fortis-text) !important;
  background-color: var(--wp--preset--color--custom-fortis-paper-white-bg) !important;

  --gf-ctrl-bg-color: var(--wp--preset--color--custom-fortis-paper-white-bg) !important;
}

.gfield input,
.gfield textarea,
.gfield select,
.gform_drop_area.gform-theme-field-control {
  border-radius: 8px !important;
}

.gform-theme--foundation .gform_fields .gfield_label {}

.form-trust-badge {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-style: italic !important;
  line-height: 1.1 !important;
  font-size: 14px !important;
}

.form-trust-badge svg {
  flex: none;
}

.gform-body input,
.gform-body textarea,
.gform-body select {
  --gf-local-outline-color: #023134cc !important;
}

/* 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;
}