
/* ==========================================
   SÖKFORMULÄR
   ========================================== */

.gre-top-searchbox-wrapper {
   position: relative;
   max-width: 30em;
   margin-bottom: var(--env-spacing-medium);
}

.gre-top-searchbox__input {
   box-sizing: border-box;
   width: 100%;
   min-height: 2.5rem;
   padding: 0.5rem 2.5rem 0.5rem 0.75rem;
   border: 1px solid #b3b3b3;
   border-radius: 2px;
   font-size: 1rem;
}

header .gre-top-searchbox__input {
   line-height: normal;
   min-height: calc(2.5rem - 2px) !important;
   padding: 0.625em 2em 0.625em 0.75em;
}

@media (min-width: 768px) {
   .gre-top-searchbox__input {
      min-width: 17.5rem;
   }
}

@media (min-width: 992px) {
   .gre-top-searchbox__input {
      min-width: 20rem;
   }
}

.gre-top-searchbox__button {
   position: absolute;
   right: 0;
   top: 50%;
   transform: translateY(-50%);
   margin: 0;
   padding: 0.5rem 0.75rem;
   border: 1px solid transparent;
   background: transparent;
   line-height: 1.375;
   cursor: pointer;
}

.gre-search-form-hide {
   display: none;
}

.gre-top-searchbox-mobile {
   min-width: 4em;
   padding: 0.5em 0;
   border: none;
   background-color: transparent;
   text-align: center;
   cursor: pointer;
}

.gre-top-searchbox-wrapper.gre-mobile {
   margin: 0 auto;
}

.gre-searchbox-mobile-box {
   display: none;
   padding: 1.5rem 1rem 0;
   background-color: #fff;
}

.gre-searchbox-mobile-box.display {
   display: block;
}


/* ==========================================
   SÖKINFORMATION
   ========================================== */

.gre-search-info {
   margin-bottom: 1em;
}

.gre-search-info-container ul {
   display: inline-block;
   margin: 0;
   padding: 0;
   list-style: none;
}

.gre-search-info-container li {
   display: inline-block;
   font-weight: bold;
}

.gre-search-summary {
   margin-bottom: 0.5em;
}


/* ==========================================
   SÖKTRÄFFAR
   ========================================== */

.gre-search-result {
   width: 100%;
   max-width: 44em;
   box-sizing: border-box;
}

.gre-search-result .gre-search-result__path-text {
   display: block;
   margin-top: 0.5em;
   padding-top: 0.5em;
   border-top: 1px solid #cbcbcb;
}

.sv-search-hit {
   margin-bottom: 2em;
}


/* ==========================================
   TAGGAR
   ========================================== */

.gre-search-tags {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 0.5rem;
   margin: 0;
   padding: 0;
   list-style: none;
}

.gre-search-tags li {
   display: inline-flex;
   align-items: center;
   gap: 0.4rem;
   margin: 0;
   padding: 0.1rem 0.7rem;
   border-radius: 3px;
   background-color: #275468;
   color: #fff;
   font-size: 0.8rem;
   line-height: 1.5;
}

.gre-search-tag-icon {
   display: inline-block;
   flex: 0 0 5px;
   width: 5px;
   height: 5px;
   margin: 0;
   border-radius: 50%;
   background-color: #fff;
}


/* ==========================================
   SÖKTRÄFFSKORT
   ========================================== */

.gre-search-hit-container {
   position: relative;
   box-sizing: border-box;
   width: 100%;
   padding: 1rem;
   border: 1px solid rgb(0 0 0 / 15%);
   border-radius: 3px;
   background: #fdfcfa;
   transition: box-shadow 0.2s ease;
}

.gre-search-hit-container:hover {
   box-shadow: 0 2px 20px rgb(0 0 0 / 20%);
}

.gre-search-hit-container:hover a {
   text-decoration: underline;
}

.gre-search-hit-container a:before {
   content: "";
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   cursor: pointer;
   z-index: 1;
}

.gre-search-hit-container ol > li {
   position: relative;
}

.gre-search-hit-container button {
   position: relative;
   z-index: 2;
}


/* ==========================================
   FILTER
   ========================================== */

.gre-search-facet-desktop-heading {
   display: block;
}

.gre-search-facet-accordion-button {
   display: none;
   width: 100%;
   margin: 0;
   padding: 0;
   border: none;
   border-bottom: 1px solid #808080;
   background-color: #fff;
   text-align: left;
   cursor: pointer;
}

.gre-search-facet-accordion-button[aria-expanded="true"] {
   background-color: #ded8c2;
}

.gre-search-facet-accordion-button:hover {
   background-color: #e4eff4;
}

.gre-search-facet-accordion-button-heading {
   display: flex;
}

.gre-search-facet-accordion-button-text {
   flex-grow: 1;
}

.gre-search-facet-accordion-button-icon {
   margin: 3px 0.5em 0 0.5em;
}

.gre-search-facet-accordion-content {
   /* Styrs av filterfunktionens JavaScript */
}

.sv-search-facet {
   margin-bottom: 2em;
}

.sv-search-facet-name {
   margin: 0 0 0.75rem 0 !important;
}

.sv-search-facet-item {
   margin-bottom: 0.5em;
}

.gre-search-facet-icon {
   margin: 0 0.5em 4px 0;
   font-size: 130%;
   vertical-align: bottom;
}


/* ==========================================
   FILTERSIDA - SÖKTRÄFFARNAS LAYOUT
   ========================================== */

/* Grundlayout för bild och text */

.gre-search-hit-content,
.gre-search-hit-content.env-d--flex {
   display: flex;
   flex-direction: row;
   align-items: flex-start;
   gap: 1rem;
   width: 100%;
   min-width: 0;
   margin-top: 1rem;
   box-sizing: border-box;
}

/* Textkolumn */

.gre-search-hit-text,
.gre-search-hit-text.env-flex-length--3 {
   flex: 1 1 0%;
   min-width: 0;
   width: auto;
}

/* Förhindra att långa ord orsakar overflow */

.gre-search-hit-text p,
.gre-search-hit-text span {
   overflow-wrap: break-word;
}

/* Äldre bildklass */

.gre-search-hit-image {
   flex-shrink: 0;
   margin: 0;
}

.gre-search-hit-image img {
   display: block;
   max-width: 100%;
   height: auto;
}


/* ==========================================
   BILD - DESKTOP
   ========================================== */

.gre-search-hit-wide-image,
.gre-search-hit-wide-image.env-flex-length--1 {
   position: relative;
   display: block;
   flex: 0 0 175px;
   width: 175px;
   min-width: 0;
   height: 175px;
   margin: 0;
   padding: 0;
   overflow: hidden;
   border-radius: 4px;
   box-sizing: border-box;
}

/* Bilden fyller sin container */

.gre-search-hit-wide-image img {
   display: block;
   position: static;
   width: 100%;
   height: 100%;
   max-width: none;
   margin: 0;
   padding: 0;
   transform: none;
   object-fit: cover;
   object-position: center;
}


/* ==========================================
   SURFPLATTA OCH MOBIL
   Under 768px
   ========================================== */

@media screen and (max-width: 767px) {

   /* Byt från horisontell till vertikal layout */

   .gre-search-hit-content,
   .gre-search-hit-content.env-d--flex {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch;
      gap: 1rem;
      width: 100%;
      min-width: 0;
   }

   /* Bilden ska ligga överst och fylla bredden */

   .gre-search-hit-wide-image,
   .gre-search-hit-wide-image.env-flex-length--1 {
      position: relative;
      display: block;
      flex: none !important;
      width: 100% !important;
      max-width: 100%;
      min-width: 0 !important;
      height: auto !important;
      aspect-ratio: 16 / 9;
      margin: 0;
      overflow: hidden;
      border-radius: 4px;
   }

   /* Beskär bilden proportionerligt */

   .gre-search-hit-wide-image img {
      position: absolute;
      inset: 0;
      display: block;
      width: 100% !important;
      height: 100% !important;
      max-width: none;
      margin: 0;
      transform: none !important;
      object-fit: cover;
      object-position: center;
   }

   /* Text under bilden, full bredd */

   .gre-search-hit-text,
   .gre-search-hit-text.env-flex-length--3 {
      display: block;
      flex: none !important;
      width: 100% !important;
      max-width: 100%;
      min-width: 0;
      margin: 0;
      padding: 0;
   }

   /* Äldre bildklass */

   .gre-search-hit-image {
      width: 100%;
      margin: 0;
   }

   .gre-search-hit-image img {
      display: block;
      width: 100%;
      height: auto;
   }

   /* Taggar ska kunna radbrytas */

   .gre-search-tags {
      flex-wrap: wrap;
   }
}


/* ==========================================
   MINDRE MOBILER
   Under 576px
   ========================================== */

@media screen and (max-width: 575px) {

   /* Visa filter som dragspel */

   .gre-search-facet-desktop-heading {
      display: none;
   }

   .gre-search-facet-accordion-button {
      display: block;
   }

   /* Säkerställ att korten håller sig inom skärmen */

   .gre-search-result {
      width: 100%;
      max-width: 100%;
   }

   .gre-search-hit-container {
      width: 100%;
      max-width: 100%;
      padding: 1rem;
   }

   /* Fullbreddsbilder */

   .gre-search-hit-wide-image,
   .gre-search-hit-wide-image.env-flex-length--1 {
      width: 100% !important;
      aspect-ratio: 16 / 9;
   }

   /* Texten ska inte tryckas ihop */

   .gre-search-hit-text,
   .gre-search-hit-text.env-flex-length--3 {
      width: 100% !important;
      min-width: 0;
   }

   .gre-search-info-container {
      margin-bottom: 0.75rem;
   }

   .gre-search-summary {
      margin-bottom: 0.75rem;
   }
}
