// General
//
// This file is meant for general styles and containers
// that apply everywhere throughout the website. Add more
// always repeating elements right below.

// Default structural element
.block {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: $color-white;
  position: relative;
  max-width: $layout-max-width;
  margin: 0 auto;
}

// Default shade on top of blocks
.shade {
  background: $color-shade;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  opacity: .35;
}

// Global link helper
// This is useful in services -type of areas where the whole block is a link
// Remember to define aria-label or screen-reader-text for accessibility
.global-link {
  width: 100%;
  height: 100%;
  z-index: 3;
  position: absolute;
  top: 0;
  left: 0;
}

// Site wrapper
.site {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
}

// Containers
.container {
  margin: 0 auto;
  padding-top: var(--padding-container-vertical);
  padding-bottom: var(--padding-container-vertical);
  padding-left: var(--padding-container-horizontal);
  padding-right: var(--padding-container-horizontal);
  max-width: $grid-base-size;
  margin-left: auto;
  margin-right: auto;
}

// Clear block containers by default
.site-main .container {
  overflow: hidden;
  clear: both;
}

// Meta actions
.entry-footer {
  overflow: hidden;
  clear: both;
  display: flex;
  justify-content: space-between;
}

// Better edit link
.edit-link {
  text-align: left;
  width: 100%;
  display: block;
  clear: both;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 0;
  margin-top: 2rem;
  overflow: hidden;
  transition: all $transition-duration;

  a {
    clear: both;
    text-align: center;
    transition: all $transition-duration;
    display: block;
    padding: 2rem;
    background: $color-background-edit-link;
    color: $color-edit-link;
    border: 2px dashed $color-edit-link;
    margin: 0;
    text-decoration: none;
  }

  a:hover {
    color: $color-edit-link;
    background: #efefef;
  }
}

// Hide/show helpers
.hide-on-desktop {
  @media (min-width: $container-mobile) {
    // Forced to use important here, because makes no sense to write too specific selectors here
    display: none !important;
  }
}

.hide-on-mobile {
  @media (max-width: $container-mobile) {
    // Forced to use important here, because makes no sense to write too specific selectors here
    display: none !important;
  }
}

// Only function of these is to force hide content based on the view
.hide-on-mobile-nav-view {
  @media (max-width: $responsivenav) {
    // Forced to use important here, because makes no sense to write too specific selectors here
    display: none !important;
  }
}

.hide-on-desktop-nav-view {
  @media (min-width: $responsivenav) {
    // Forced to use important here, because makes no sense to write too specific selectors here
    display: none !important;
  }
}

.hide-completely {
  // Forced to use important here, because makes no sense to write too specific selectors here
  display: none !important;
}
