.acf-block-body .acf-block-fields,
.acf-block-fields:has(> .acf-error-message) .acf-block-fields,
.acf-block-preview {
  border: #666666 solid 3px !important;
}

.blue-border-bottom {
  border-bottom: 2px solid var(--blue);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  font-size: 14px;
  overflow: hidden;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

.breadcrumb-item:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 11px;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAxNiAxMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgNC45QzAgNC41IDAuMiA0LjMgMC42IDQuM0M0LjkgNC4zIDEwLjggNC43IDEzLjcgNC44QzE0LjIgNC44IDE0LjMgNC42IDEzLjcgNC40QzExLjcgMy4zIDEwLjYgMi4xIDEwLjEgMS4zQzEwIDEuMiAxMCAxIDEwIDAuOUMxMCAwLjQgMTAuNCAwIDEwLjggMEMxMS4yIDAgMTEuMSAwIDExLjIgMC4zQzEyLjIgMi4xIDEzLjQgMy43IDE1LjUgNC42QzE1LjkgNC43IDE2IDQuOSAxNiA1LjFDMTYgNS4zIDE1LjkgNS40IDE1LjUgNS42QzEzLjUgNi41IDEyLjMgNy45IDExLjMgOS44QzExLjIgMTAuMSAxMSAxMC4xIDEwLjggMTAuMUMxMC40IDEwLjEgMTAgOS43IDEwIDkuMkMxMCA4LjcgMTAgOC45IDEwLjEgOC43QzEwLjYgNy45IDExLjYgNi44IDEzLjcgNS43QzE0LjIgNS40IDE0LjIgNS4zIDEzLjcgNS4zQzEwLjkgNS4zIDQuOSA1LjcgMC42IDUuOEMwLjIgNS44IDAgNS41IDAgNS4yTDAgNC45WiIgZmlsbD0iIzFEMUQxQiIvPgo8L3N2Zz4K");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 6px;
  flex-shrink: 0;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--blue);
  line-height: var(--spacing-1);
  text-overflow: ellipsis;
  overflow: hidden;
}

.breadcrumbs a:hover {
  text-decoration: underline;
  color: var(--blue);
}

.breadcrumbs .home-link svg {
  width: 27px;
  height: 27px;
  margin: 0;
}

.breadcrumb-item span {
  color: var(--blue);
}

/* Ensure current page item is not a link */
.breadcrumb-item[aria-current="page"] span {
  font-weight: 600;
}

/* Mobile-specific breadcrumb improvements - Pure Flexbox Approach */
@media (max-width: 768px) {
  .breadcrumbs {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .breadcrumb-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 8px;
    padding-bottom: 2px;
  }

  .breadcrumb-list::-webkit-scrollbar {
    display: none;
  }

  .breadcrumb-item {
    flex: 0 0 auto;
    /* Don't shrink by default - let items be their natural size */
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .breadcrumb-item a,
  .breadcrumb-item span {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  /* Keep original SVG arrow separators */
  .breadcrumb-item:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 8px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAxNiAxMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgNC45QzAgNC41IDAuMiA0LjMgMC42IDQuM0M0LjkgNC4zIDEwLjggNC43IDEzLjcgNC44QzE0LjIgNC44IDE0LjMgNC42IDEzLjcgNC40QzExLjcgMy4zIDEwLjYgMi4xIDEwLjEgMS4zQzEwIDEuMiAxMCAxIDEwIDAuOUMxMCAwLjQgMTAuNCAwIDEwLjggMEMxMS4yIDAgMTEuMSAwIDExLjIgMC4zQzEyLjIgMi4xIDEzLjQgMy43IDE1LjUgNC42QzE1LjkgNC43IDE2IDQuOSAxNiA1LjFDMTYgNS4zIDE1LjkgNS40IDE1LjUgNS42QzEzLjUgNi41IDEyLjMgNy45IDExLjMgOS44QzExLjIgMTAuMSAxMSAxMC4xIDEwLjggMTAuMUMxMC40IDEwLjEgMTAgOS43IDEwIDkuMkMxMCA4LjcgMTAgOC45IDEwLjEgOC43QzEwLjYgNy45IDExLjYgNi44IDEzLjcgNS43QzE0LjIgNS40IDE0LjIgNS4zIDEzLjcgNS4zQzEwLjkgNS4zIDQuOSA1LjcgMC42IDUuOEMwLjIgNS44IDAgNS41IDAgNS4yTDAgNC45WiIgZmlsbD0iIzFEMUQxQiIvPgo8L3N2Zz4K");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 4px;
    flex-shrink: 0;
  }

  /* Responsive max-widths to prevent overflow */
  .breadcrumb-item:not(:last-child) a,
  .breadcrumb-item:not(:last-child) span {
    max-width: 35vw;
    /* Middle items get reasonable space */
  }

  .breadcrumb-item:last-child a,
  .breadcrumb-item:last-child span {
    max-width: 50vw;
    /* Current page gets more space */
  }

  /* On very narrow screens, be more restrictive */
  @media (max-width: 600px) {
    .breadcrumb-item:not(:last-child) a,
    .breadcrumb-item:not(:last-child) span {
      max-width: 25vw;
    }

    .breadcrumb-item:last-child a,
    .breadcrumb-item:last-child span {
      max-width: 45vw;
    }
  }

  @media (max-width: 400px) {
    .breadcrumb-item:not(:last-child) a,
    .breadcrumb-item:not(:last-child) span {
      max-width: 20vw;
    }

    .breadcrumb-item:last-child a,
    .breadcrumb-item:last-child span {
      max-width: 40vw;
    }
  }
}

/* Smart responsive breakpoints based on actual screen constraints */
@media (max-width: 480px) {
  /* Only show abbreviated breadcrumbs when there are 4+ items */
  .breadcrumb-list:has(.breadcrumb-item:nth-child(4))
    .breadcrumb-item:not(:first-child):not(:last-child):not(
      :nth-last-child(2)
    ) {
    display: none;
  }

  .breadcrumb-list:has(.breadcrumb-item:nth-child(4))
    .breadcrumb-item:nth-last-child(2) {
    display: flex;
  }

  .breadcrumb-list:has(.breadcrumb-item:nth-child(4))
    .breadcrumb-item:nth-last-child(2)::before {
    content: "…";
    margin-right: 4px;
    color: var(--blue);
    flex-shrink: 0;
  }
}

@media (max-width: 320px) {
  /* Very small screens: Just Home → Current (only when there are 3+ items) */
  .breadcrumb-list:has(.breadcrumb-item:nth-child(3))
    .breadcrumb-item:not(:first-child):not(:last-child) {
    display: none;
  }
}

.klapty-viewer iframe {
  width: 100%;
  aspect-ratio: 16/7;
  border: 0;
  border-radius: 16px;
}

.youtube-viewer iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 16px;
}

.youtube-viewer .error-message {
  color: #ff0000;
  font-weight: bold;
  padding: 20px;
  background-color: #f8f8f8;
  border-radius: 16px;
  text-align: center;
}

/* Accordion CLS prevention */
.accordion-item {
  contain: layout style;
}

.accordion-content {
  will-change: height;
  transition: height 0.3s ease;
}

/* Prevent layout shifts from dynamic content */
.featured-image img,
.puff-link img {
  object-fit: cover;
  width: 100%;
  height: auto;
}

.home .hero-image-video-container {
  /*  max-width: 1920px; */
  /* fullscreen startpage */
  margin: 0 auto 20px;
  width: 100%;
}

.hero-image-video-container {
  /* max-width: 1600px; */
  /* fullscreen startpage */
  /*  aspect-ratio: 16 / 9; */
  margin: 0 auto 20px;
  width: 93.8vw;
  /* Prevent CLS by reserving space */
  min-height: 200px;
  position: relative;
}

.hero-image-video-container.bakgrundsvideo {
  overflow: hidden;
  position: relative;
}

#slider {
  overflow: hidden;
  border-radius: 16px;
}

.home .slider {
  max-width: none;
  /* fullscreen startpage */
}

.home #slider {
  border-radius: 0;
}

.lSSlideWrapper,
.slider li img {
  object-fit: cover;
}

/* startsidan */

.home .intro-text-reveal-section {
  order: -1;
}

.home .logotype-menu {
  display: none;
}

.home .logotype-menu.visible {
  display: block;
}

.home .home-logo.hide {
  display: none;
  position: fixed;
  top: 65px;
}

.home-logo:hover {
  opacity: 0.5;
}

.home-logo {
  display: flex;
  justify-content: space-between;
  position: absolute;
  bottom: 0;

  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 150;
  width: 90px;
  text-align: center;
  margin: 0 auto;
  margin-bottom: -22px;
  transition: all 0.3s ease;
}

#animation-container .main {
  width: min-content;
  height: auto;
}

.home .home-hero-logo-holder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 20px;
  left: 50%;
  height: 80%;
  transform: translateX(-50%);
  z-index: 120;
  width: auto;
  filter: brightness(0) invert(1) sepia(0) saturate(0) brightness(1.5);
}

@media (max-width: 767px) {
  .home .home-hero-logo-holder {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    height: 60vh;
    top: 15vh;
    z-index: 120;
    width: 100%;
    filter: brightness(0) invert(1) sepia(0) saturate(0) brightness(1.5);
  }
}

.home .menu-huvudmeny-left-container li.english::before {
  filter: brightness(0) invert(1) sepia(0) saturate(0) brightness(1.5);
}

.home .mobile-menu-trigger,
.home .mobile-menu .search a {
  filter: brightness(0) invert(1) sepia(0) saturate(0) brightness(1.5);
}

.home-logo img {
  filter: brightness(0) invert(1) sepia(0) saturate(0) brightness(1.5);
  opacity: 1;
  width: 100%;
  height: auto;
}

.home .slider li {
  overflow: hidden;
  border-radius: 0 !important;
}

.home .lSSlideWrapper,
.home .slider li img {
  object-fit: cover;
  width: 100%;
  /* fullscreen startpage */
}

.home .hero-image-video-container {
  margin: -70px auto 0;
  position: relative;
  margin-bottom: var(--spacing-2);
}

.home .mobile-menu {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7));
}

.home .item li::before {
  content: "";
  z-index: 10;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0) 20%
  );
}

.home .lSPager {
  display: none;
}

/* startsidan */

.slider .item {
  margin-bottom: 0 !important;
}

@media (max-width: 767px) {
  .lSPager {
    display: none;
  }

  .home .lSSlideWrapper,
  .home .slider li img,
  .lSSlideWrapper,
  .slider li img {
    object-fit: cover;
    aspect-ratio: 3 / 5;
  }

  .home .gallery-text .bildtext-rubrik {
    font-size: 55px;
  }

  .home .gallery-text p {
    font-size: 16px;
  }
}

/* Theme toggle button styles */
.theme-toggle {
  background: var(--blue);
  border: none;
  cursor: pointer;
  padding: 0.5em;
  border-radius: 50%;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
}

.theme-toggle:focus {
  outline: 2px solid var(--red, #e57368);
  outline-offset: 2px;
}

/* SVG icon sizing */
.theme-toggle__classic {
  width: 2em;
  height: 2em;
  display: block;
}

/* Main sun/moon circle */
.theme-toggle__classic #mainCircle {
  fill: white;
  transition: fill 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animate the cutout position */
.theme-toggle__classic #moonCutout {
  transition: cx 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    cy 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sun rays */
.theme-toggle__classic g {
  stroke: #fff;
  stroke-width: 1.5;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode: fade rays, keep main circle white, dark button background */

body.dark-mode .theme-toggle__classic g {
  opacity: 0.3;
}

body.dark-mode .theme-toggle__classic #moonBg {
  fill: white;
}

body.dark-mode .theme-toggle__classic #mainCircle {
  fill: var(--blue);
  transition: fill 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure SVG is always visible and centered */
.theme-toggle__classic circle,
.theme-toggle__classic g {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---Text Reveal Styles---- */
/* ------------------------- */

/* text  starts as invisible */
.reveal-word-inner {
  color: rgba(7, 17, 59, 0.502);
  filter: opacity(0.05);
  transition: color 0.6s ease, filter 0.8s ease;
}

.reveal-word-inner.revealed {
  color: var(--blue) !important;
}
