/*!
 * ===========================
 * Author: Steve Gotthardt
 * Created: 10/2025
 * ===========================
 */

:root {
  --no-shadow: 0px 0px 2px rgba(0, 0, 0, 0);
  --small-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  --large-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  --transition-time: 250ms;
  
  --small-font-size: 12pt;
  --small-line-height: 1.5;
}

body {
  background: #f6f6f6;
}

#SearchFilter-main-container {
  position: relative;
  padding: 24px 24px 96px;
  @media screen and (min-width: 768px) {
    padding-left: 48px;
    padding-right: 48px;
  }
  @media screen and (min-width: 1376px) {
    padding-left: 0;
    padding-right: 0;
  }
}

#SearchFilter-search-filter-container {
  display: grid;
  grid-template-areas: "type" "region" "area" "search" "btns";
  grid-row-gap: 12px;
  grid-column-gap: 12px;
  margin: 0 auto;
  width: 100%;
  max-width: 1280px;
  @media screen and (min-width: 768px) {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
    grid-template-areas: "search search type region area btns";
    grid-row-gap: 18px;
  }
  .filter-container,
  #SearchFilter-search-bar-container {
    position: relative;
    border-radius: 10px;
    box-shadow: var(--small-shadow);
    background: white;
    height: 54px;
    overflow: hidden;
  }
  .filter-container {
    &#Filter-type-container {
      grid-area: type;
    }
    &#Filter-region-container,
    &#Filter-location-container {
      grid-area: region;
    }
    &#Filter-area-container,
    &#Filter-topic-container {
      grid-area: area;
    }
    label {
      text-transform: uppercase;
      font-size: 10px;
      letter-spacing: 1px;
      color: #999;
      position: relative;
      text-indent: 18px;
      margin: 1px 0 0;
      select {
        position: absolute;
        top: 0;
        margin: 0;
        border: 0;
        background: transparent;
        padding: 16px 16px 0;
        color: #262626;
        height: 54px;
        &:hover {
          cursor: pointer;
        }
      }
    }
  }
  #SearchFilter-search-container {
    grid-area: search;
    position: relative;
    input[type="search"] {
      width: 100% !important;;
      height: 54px;
      padding: 0 16px;
      font: 16px/24px "Roboto", Helvetica, Arial, sans-serif;
      color: #262626;
    }
    button {
      position: absolute;
      width: 54px;
      height: 54px;
      top: 0;
      right: 0;
      background-color: #f6f6f6;
      display: none;
      @media screen and (min-width: 360px) {
        display: inline;
      }
      i {
        width: 20px;
        height: 20px;
        color: #777;
      }
      &:hover {
        background-color: white;
        i {
          color: #0072c6;
        }
      }
    }
    #SearchFilter-search-quick-results {
      position: absolute;
      z-index: 9999;
      background-color: rgba(255, 255, 255, 0.9);
      top: 55px;
      left: 10px;
      width: calc(100% - 20px);
      padding: 12px 24px 12px;
      box-shadow: var(--large-shadow);
      &.hide {
        display: none;
      }
      ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
        li {
          &.hide {
            display: none;
          }
          a {
            font-size: 0.9rem;
            line-height: 1.4;
            font-weight: 600;
            padding: 6px 0;
            display: inline-block;
            width: 100%;
          }
        }
      }
    }
  }  
}
#SearchFilter-msg {  
  .msg.hide {
    display: none;
  }
}

#List-header {
  display: none;
}

ul#SearchFilter-list {
  margin: 0;
  list-style: none;
  li {
    &.hide {
      display: none;
    }
  }
}

/* General */
h1.page-title {
  margin:0 0 .5rem;
}
body main.content {
  padding-bottom:0;
}
.title-block {
  margin-bottom:0 !important;
  z-index:1;
}
@media (min-width: 960px) {
  .title-block__content {
    background:none;
  }
}
footer#footer {
  margin-top:0;
}

/* Filter and Search */
#SearchFilter-main-container {
  position: relative;
  padding: 0;
  margin: 0;
}

#SearchFilter-search-container,
#SearchFilter-filter-container,
#SearchFilter-list-container {
  width:100%;
}
#SearchFilter-filter-container .accordion .filter-header.accordion__label{
  margin:0; 
  padding:18px 0;
}
#SearchFilter-search-container-bg {
  background:rgba(0,0,0,.1);
  padding:12px 0;
}
#SearchFilter-search-container {
  display:grid;
  grid-template-columns: 1fr 60px 60px 1fr;
  grid-template-areas:"searchbar searchbar searchbar searchbar searchbar" ". filterbtn resetbtn .";
  grid-gap:12px;
  margin:0 auto;
  padding:0 24px;
  width:100%;
  position:relative;
  @media screen and (min-width: 768px) {
    grid-template-columns: 60px 1fr 60px 60px 60px;
    grid-template-areas:"filterbtn searchbar gridbtn listbtn resetbtn";
    grid-gap:0;
    padding-left:48px;
    padding-right:48px;
  }
  @media screen and (min-width: 1376px) {
    padding-left:0;
    padding-right:0;
    max-width:1280px;
  }
  #SearchFilter-search-bar-container {
    grid-area: searchbar;
    position:relative;
    border-radius:10px;
    overflow:hidden;
    @media screen and (min-width: 768px) {
      margin:0 12px;
    }
    input[type="search"] {
      height: 60px;
      padding: 0 24px;
      font-weight:600;
      width:calc(100% - 48px);
      background:white;
      &::placeholder {
        font-weight:400;
        @media screen and (max-width: 360px) {
          color:transparent;
        }
      }
    }
    button {
      position: absolute;
      top: 0;
      right: 0;
      display: inline;
    } 
  }
  #SearchFilter-search-quick-results {
    position: absolute;
    z-index: 9999;
    background: linear-gradient(to bottom, #f6f6f6 0%,#ffffff 10px,#ffffff 100%);
    top: 60px;
    left:34px;
    right:auto;
    padding: 12px 24px 12px;
    max-height:400px;
    overflow-y: auto;
    @media screen and (min-width: 768px) {
      left: 60px;
    }
    &.hide {
      display: none;
    }
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      li {
        &.hide {
          display: none;
        }
        a {
          font-size: 0.9rem;
          line-height: 1.4;
          font-weight: 600;
          padding: 6px 0;
          display: inline-block;
          width: 100%;
        }
      }
    }
  }
  .search-bar-button {
    display:flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin: 0;
    background-color: white;
    color: #00447c;
    border-radius:10px;
    &:hover, &.active {
      background-color: #00447c;
      color: white;
    }
    &#Btn-Grid,
    &#Btn-List {
      display:none;
      @media screen and (min-width: 768px) {
        display:block;
      }
    }
    &#Btn-Filter {
      grid-area:filterbtn;      
    }
    &#Btn-Grid {
      grid-area:gridbtn;
      @media screen and (min-width: 768px) {
        border-radius:10px 0 0 10px;
      }      
    }
    &#Btn-List {
      grid-area:listbtn;
      @media screen and (min-width: 768px) {
        border-radius:0;
      }
    }
    &#Btn-Reset {
      grid-area:resetbtn;
      @media screen and (min-width: 768px) {
        border-radius:0 10px 10px 0;
      }
    }
    i {
      pointer-events: none;
    }    
  }
}
#SearchFilter-filter-btn-container {
  margin:36px 0;  
  display:grid;
  justify-content: center;
  @media screen and (min-width:768px) {
    margin-top:18px;
    grid-template-columns: auto 1fr;
    grid-column-gap: 24px;
  }
  ul#SearchFilter-filter-btns li button {
    font-size:var(--small-font-size);
    line-height:var(--small-line-height);
    margin:0 0 6px;
  }
  ul#SearchFilter-filter-btns {
    margin:0;
    padding:0;
    list-style:none;
    font-size:0;
    text-align:center;
    @media screen and (min-width:768px) {
      margin:0;
      text-align:start;
    }
    li {
      display:inline-block;
      button {  
        margin-right:6px;
        &.hide {
          display:none;
        }
        i {
          margin:0 0 0 9px;
          opacity:.5;
          pointer-events: none;
        }
      }
    } 
  }
}

#SearchFilter-filter-container {  
  font-size: var(--small-font-size);
  line-height: var(--small-line-height);
  @media screen and (min-width: 960px) {
    width:100%; 
    margin:0;
  }
  .filter-main-header,
  .accordion {
    padding:0 24px;
    @media screen and (min-width:960px) {
      padding:0 36px;
    }
  }
  .filter-main-header {
    @media screen and (min-width:768px) {
      font-size:40px;
      margin-bottom:36px;
    }
  }
  .accordion {
    margin:0;
    border-top:1px solid #ededed;
    &:last-of-type {
      border-bottom:1px solid #ededed;
    }
    .filter-header.accordion__label,
    .accordion__content {
      border:none;      
    }
    .filter-header.accordion__label {
      font-size:18px;
      font-weight:600;
      position: relative;
      background:none;
      color:#262626;      
    }
    .accordion__content {
      padding:0;
      margin:0;
      &.is-active {
        padding-bottom:24px;
      }
      label {
        font-size:16px;
        font-weight:400;
        color:#262626;
        margin:3px 0;
        padding:3px 0;
        transition:none;
        display:flex;
        border-radius:10px;
        align-items:start;
        gap:9px;
        &::before {
          content:"\f0c8";
          font-size:16pt;
          font-family: "Font Awesome 6 Pro";
          line-height:1;
          color:#444;
        }
        &:hover, &:focus {
          cursor:pointer;
        }
        &.is-selected {
          font-weight:600;
          &::before {
            content:"\f14a";
            color:#E27508;
          }
        }
        input[type=checkbox] {
          display:none;
        }
      }
      input[type=date] {
        background:#f6f6f6;
        padding:12px;
        border-radius:50px;
      }
      &#date-pane {
        label {
          display:inherit;
          &::before {
            content:"";
          }
        }
        input[type=date] {
          margin-top:5px;
          width:100%;
        }
      }      
    }
  }
  & + button {
    margin:30px 0 0;
  }
}
#SearchFilter-msg,
#SearchFilter-no-results-msg {
  padding:3px 0 0;
  margin-bottom:24px;
  font-weight:600;
  text-align:center;
  @media screen and (min-width:768px) {
    margin-bottom:0;
    text-align:start;
  }
  &:empty {
    display:none;
  }  
}
#SearchFilter-no-results-msg {
  color:#994411;
}

.popover-container {
  #SearchFilter-Popover { 
    border-top:5px solid #E27508;
    box-shadow: 9px 9px 18px rgba(0, 0, 0, 0.25);
    width: 100%;
    height:100%;
    padding:24px 0;
    max-width: 350px;
    max-height: 100vh;
    background: white;
    color: #262626;
    top: 0;
    left: 0;
    transition: var(--transition-time) transform ease-out, var(--transition-time) display allow-discrete,
      var(--transition-time) overlay allow-discrete !important;
    opacity: 1;
    transform: translateX(-400px) translateY(0);
    @media screen and (min-width: 960px) {
      padding:36px 0;
      max-width: 440px;
    } 
    &:popover-open {
    opacity: 1;
    transform: translateX(0) translateY(0);
    @starting-style {
      opacity: 1;
      transform: translateX(-400px) translateY(0);
    }
    .filter-panel-button-container {
      display:flex;
      flex-direction: column;
      justify-content: center;
      gap:9px;
      margin:48px 24px 0;
      @media screen and (min-width: 960px) {
        flex-direction: row-reverse;
      } 
    }
  }
}