/*
Theme Name: Bytemark Styleguide
Theme URI: http://styleguide.bytemark.co.uk
Author: Bytemark
Author URI: http://bytemark.co.uk/
Description: The wordpress compliant theme that matches the Bytemark styleguide
Version: 1.0
*/

/* # Image Classes */
.alignleft {
  float: left;
  margin: 0 1em 1.5em 0;
}
.aligncenter {
  display: block;
  margin: 0 auto 1.5em auto;
}
.alignright {
  float: right;
  margin: 0 0 1.5em 1em;
}
.alignnone {
  float: none;
  display: block;
  margin: 0 0 1.5em 0;
}
.size-full {
  width: 100%;
  height: auto;
  margin: 0 0 1.5em 0;
}
p .alignleft {
  float: left;
  margin: 5px 1em 1.5em 0;
}
p .aligncenter {
  display: block;
  margin: 5px auto 1.5em auto;
}
p .alignright {
  float: right;
  margin: 5px 0 1.5em 1em;
}
p .alignnone {
  float: none;
  display: block;
  margin: 5px 0 1.5em 0;
}
p .size-full {
  width: 100%;
  height: auto;
  margin: 5px 0 1.5em 0;
}

/* Caption fix, because Wordpress */
.wp-caption {
  background: #f2f2f2;
  border-radius: 3px;
  display: inline-block;
  padding: 7px;
  width: auto !important;
}

.wp-caption .wp-caption-text {
  color: #777;
  font-size: 1rem;
  font-style: italic;
  text-align: right;
  margin: 7px 7px 0;
}

.wp-caption p {
  margin: 0;
  padding: 0;
}

/*
 * Sets the order of the article at mobile sizes
 * Too specific to be in the styleguide
 */

@media screen and (min-width: 620px) {
  .article-content {
    order: 1;
  }
}

/*
 * Sorts out some spacing issues the grid gives us on the article
 */

.article {
  margin-top: 2em;
}

.article-header h1 {
  margin-top: 0;
  padding-top: 0;
}

/*
 * Pull images out of the content at the desktop screen size
 */

@media screen and (min-width: 620px) {
  p .alignleft {
    margin-left: -20%;
  }

  p .alignright {
    margin-right: -20%;
  }
}

/*
 * Pulls nested comments in a bit to give them more room
 */

#comments .media .media {
  margin: 30px 0 0 -40px;
}

/*
 * Sorts out some responsive issues with the post meta
 * 1. Fixes a safari bug
 */

.post-meta > .grid__item{
  flex-basis: auto; /* [1] */
  width: auto;
}

.post-meta p {
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 620px) {
  .article > .grid {
    flex-direction: column-reverse;
  }
}

/*
 * This gives each button a new line without causing the underline / hit box to
 * stretch to the end of the line.
 */
.social-buttons a {
  display: inline-block;
  margin-left: 1em;
}

@media screen and (min-width: 620px) {
  .social-buttons a {
    display: table;
    margin-left: 0;
  }
}

/*
 * Removes the execess padding on the search bar
 */

.sidebar {
  padding-left: 0;
  padding-right: 0;
}

/*
 * Fixes padding issues with embedded cards
 */

@media screen and (max-width: 1080px) {
  .card .page-inner {
    padding: 0;
  }
}

@media screen and (max-width: 620px) {
  .card .page-inner {
    padding: 0 14px;
  }
}

/*
 * Crazy maths to fix double padding issues with cards
 *
 * p: Calculated padding
 * b: Breakpoint (1080px)
 * c: Card padding (28px)
 *
 * p = (100% - b - 2c) / 2
 */

@media screen and (min-width: 1080px) and (max-width: 1136px) {
  .card .page-inner {
    padding:  0 calc((100% - 1024px) / 2);
  }
}

/*
 * Hides the author bio at smaller screen sizes
 */

@media screen and (max-width: 620px) {
  .article .author-bio {
    display: none;
  }
}

/*
 * Sorts out spacing issues on the author bio
 */

@media screen and (max-width: 460px) {
  .author-bio {
    padding-bottom: 0;
    padding-top: 2em;
    text-align: center;
  }
}

.author-bio .media {
  justify-content: center;
}

.author-bio .media__img {
  margin-bottom: 0;
}
