/*******************************
        Global Overrides
*******************************/
@import './mission.less';
@import './observatory.less';
@import './views.less';
@import './search.less';
@import './blocks.less';
@import './print.less';

@subsiteBackgroundGradient: linear-gradient(
  248.86deg,
  @green-1 24.22%,
  @green-2 97.12%
);

[id='page-document'] > .ui.list,
.view-wrapper > .ui.list,
[id='page-document'] > .ui.bulleted.list,
.view-wrapper > .ui.bulleted.list {
  margin-right: auto !important;
  margin-left: auto !important;
}

.ui.ordered.list,
.ui.ordered.list .list,
ol.ui.list,
ol.ui.list ol {
  padding-left: 1.25rem;
}

p.has--clear--both:empty {
  margin-top: 0;
  margin-bottom: 0;
}

.ui.button a {
  color: inherit !important;
}

.tags {
  justify-content: left !important;
  margin-top: 2em;
  gap: 0 0.7em !important;
}

// Fix item image size
#main {
  .ui.items > .item > .image > img {
    width: auto;
  }

  .ui.items > .item > .image + .content {
    padding-left: 1rem;
  }

  .ui.items > .item .ui.middle.aligned.image {
    display: flex;

    img {
      align-self: center;
    }
  }
}

// Add icon for external links
// .content-area #view {
//   a[data-linktype='internal'] {
//     &:before {
//       content: '' !important;
//     }
//   }

//   a[href^="http://"]:not([href*="climate-adapt.eea.europa.eu"]):not(.ui.button):not(:empty),
//     a[href^="https://"]:not([href*="climate-adapt.eea.europa.eu"]):not(.ui.button):not(:empty),
//     a[href^="http://"]:not([href*="cca-p6.devel5cph.eionet.europa.eu"]):not(.ui.button):not(:empty),
//     a[href^="https://"]:not([href*="cca-p6.devel5cph.eionet.europa.eu"]):not(.ui.button):not(:empty)
//     // a[rel='noopener']:not(.ui.button):not(:empty)
//   {
//     &:before {
//       position: relative;
//       top: 0;
//       margin-right: 3px;
//       color: inherit;
//       content: '\ecaf';
//       font-family: remixicon;
//       font-size: 1em;
//     }

//     &:visited {
//       &:before {
//         // fix visited link icon color
//         // doesn't work with color: inherit
//         color: @linkVisitedColor;
//       }
//     }

//     &:active {
//       &:before {
//         // fix active link icon color
//         // doesn't work with color: inherit
//         color: @linkActiveColor;
//       }
//     }
//   }

//   // a[rel='noopener noreferrer']:not(.ui.button):not(:empty),
//   // a[target='_blank']:not(.ui.button):not(:empty) {
//   // }
// }

// General styles

.listing-body-dates:empty {
  margin-bottom: 0;
}

body.subsite {
  .eea.header {
    .logo-wrapper {
      .eea-logo {
        max-width: 254px;
      }
    }

    .subsite-logo {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      transform: none !important;

      .logo {
        img {
          max-width: 320px;
        }
      }

      &:before {
        background-color: transparent !important;
      }
    }
  }
}

#main .main.bar {
  .ui.container {
    .ui.text.menu {
      width: 100%;
    }
  }
}

.header-container {
  display: flex;
  width: 100%;
  align-items: normal !important;
  justify-content: flex-end;
  column-gap: 1em;
}

.header-wrapper {
  display: flex;
  width: 100%;
  flex-direction: column;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  margin-right: auto;
}

// Fix margin in simple item listing
.u-item.listing-item.simple-listing-item .listing-body {
  margin-top: 0;
}

#page-header .styled-group.has--useAsPageHeader--true {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
}

#toolbar .toolbar-content {
  z-index: 4 !important;
}

.ui.message.info {
  padding: 0.5em 1em;
  margin-bottom: 1.5em;
  font-size: 15px;

  .icon {
    font-size: 16px !important;
  }
}

.ui.grid > .row > .column-blocks-wrapper,
.column-blocks-wrapper {
  margin-bottom: 0 !important;
}

@media only screen and (max-width: 768px) {
  .country-flag {
    padding: 0 1.2em;
  }

  .ui.selection.dropdown.countries-dd i.icon {
    font-size: 23px;
  }
}

iframe {
  border: none;
}

.label-file-widget-input {
  font-weight: bold;
}

.image-download-btn {
  display: inline-block;
  max-width: max-content;
  padding: 7px 23px;
  border: 2px solid #007eb1;
  border-radius: 10px;
  margin-top: 10px;
  color: #007eb1;
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
}

.block.metadata,
.block.metadata-section {
  .inline.field .wide.column {
    .date-time-widget-wrapper {
      .ui.input {
        width: auto;
        vertical-align: middle;

        input {
          height: 60px;
          padding: 0.75em 0;
          border-width: 0 0 0.0625rem 0;
          border-radius: 0;

          font-size: 1em;
        }
      }
    }
  }
}

#footer {
  .theme-sites {
    padding: 3rem 0;
  }

  .footer-header {
    margin-bottom: 1.5em;
  }
}

#mega-menu {
  .ui.list.has--4--columns {
    a.item {
      break-inside: avoid-column;
    }
  }
}

// language dropdown
.top.bar {
  .ui.container {
    .wrapper.language-list {
      display: grid;
      /* display: flex; */
      /* flex-direction: column; */
      margin: 0.25rem 0;
      gap: 0.25rem;
      grid-auto-flow: column;
      grid-auto-rows: auto;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      grid-template-rows: repeat(10, auto);
      white-space: pre-wrap;

      .menu {
        position: absolute;
        z-index: 11;
        top: 100%;
        display: none;
        width: fit-content;
        min-width: -moz-max-content;
        min-width: max-content;

        max-width: 100%;
        padding: 0;
        border: 1px solid #e6e7e8;
        border-radius: 0;
        margin: 0;
        background: #fff;
        box-shadow: 0 2px 3px 0 #e6e7e8;
        cursor: auto;
        font-size: 1em;
        outline: none;
        text-align: left;
        text-shadow: none;
        transition: opacity 0.1s ease;
        will-change: transform, opacity;
      }

      .item {
        min-width: 10em;
        padding-left: 0.8em;
      }
    }
  }
}

#language-switcher .menu .wrapper .item {
  justify-content: flex-start !important;
  font-weight: 400;
}

@media (max-width: 768px) {
  .top.bar .ui.dropdown .wrapper {
    display: flex;
    flex-direction: column;
  }
}
// end language dropdown

#image-upload-widget-image {
  text-align: left;

  .field-file-name {
    padding: 10px 0 !important;
    gap: 0.5em;
    text-align: left;
  }

  .dropzone-text {
    margin: 0 !important;
  }

  .image-upload-widget .toolbar-wrapper {
    text-align: center;
  }

  img {
    margin-top: 0.5em;
  }

  .image-upload-widget-toolbar {
    position: relative;
    top: 0;
    right: 0;

    button.ui.button {
      box-shadow: none;
      outline: none;
    }

    button.ui.button:hover {
      background-color: #edf1f2 !important;
      outline: none;
    }
  }

  .toolbar-inner {
    display: flex;
    width: fit-content !important;
    height: 40px;
    padding: 4px;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.975);
    box-shadow:
      0 0 8px rgba(0, 0, 0, 0.1),
      0 2px 4px rgba(0, 0, 0, 0.05);

    .ui.icon.button {
      padding: 4px;
      border-radius: 1px;
      margin-left: 4px;
      color: @brown !important;

      &:hover {
        background-color: #edf1f2 !important;
      }
    }
  }

  .help {
    text-align: left;
  }

  .field-file-name-wrapper {
    display: flex;
    align-items: center;
    gap: 1em;
  }

  img {
    width: 100%;
    max-width: 200px !important;
  }

  .toolbar-wrapper {
    justify-self: flex-start;
  }
}

div.image-upload-widget {
  .help {
    text-align: left;
  }

  .image-upload-widget-image {
    max-width: 200px !important;
  }

  .image-upload-widget-toolbar {
    position: absolute;
    top: 5px;
    right: 5px;
  }
}

#field-relevant_eu_policies {
  .react-select__menu {
    .ReactVirtualized__Grid {
      width: 100% !important;
    }

    .ReactVirtualized__Grid__innerScrollContainer {
      max-width: none !important;
    }
  }
}
