// -----------------------------------------------------------
// 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:not(.block-footer) {
  @include background-cover();
  background-color: #fff;
  position: relative;
  min-height: 100px;
  max-width: $layout-max-width;
  margin: 0 auto;
}

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

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

// Containers
.container {
  margin: 0 auto;
  padding-top: $padding-container-y-medium;
  padding-bottom: $padding-container-y-medium;
  padding-left: $padding-container-x-medium;
  padding-right: $padding-container-x-medium;
  max-width: $grid-base-size;
  margin-left: auto;
  margin-right: auto;

  // More reasonable paddings on mid-sized screens
  @media (max-width: $grid-base-size + 150px) {
    padding-left: $padding-container-x-small;
    padding-right: $padding-container-x-small;
  }

  // Please note: You should really define these globals separately per project
  // For every project by dividing 1.2 will not cut it
  @media (max-width: $container-ipad) {
    padding-top: $padding-container-y-small;
    padding-bottom: $padding-container-y-small;
  }
}

// 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: #fafafa;
    color: #999;
    border: 2px dashed #999;
    margin: 0;
    text-decoration: none;
  }

  a:hover {
    color: #999;
    background: #efefef;
  }
}

// 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
a.global-link {
  width: 100%;
  height: 100%;
  z-index: 3;
  position: absolute;
  top: 0;
  left: 0;
}

// Error 404 title
.block.block-error-404 {
  .container {
    @media (min-width: $container-mobile) {
      padding-top: 10%;
      padding-bottom: 10%;
    }
  }

  h1 {
    @include responsive-font(42px, 200px);
    margin-bottom: 2rem;
  }
}

// Hide/show helpers
.hide-on-desktop {
  @media (min-width: $container-mobile) {
    display: none;
  }
}

.hide-on-mobile {
  @media (max-width: $container-mobile) {
    display: none;
  }
}
