/**
Theme Name: Story House Egmont Theme
Author: Story House Egmont
Author URI: https://storyhouseegmont.se
Description: This theme requires Advanced Custom Fields PRO.
Version: 1.2.3
License:
License URI:
Text Domain: she-theme
Template: astra
*/

/**
Astra palette color numbers. Var number in (x)
--ast-global-color-0 - Color 1 = Theme color
--ast-global-color-1 - Color 2 = Link hover
--ast-global-color-2 - Color 3 = Headline
--ast-global-color-3 - Color 4 = Body text
--ast-global-color-4 - Color 5 = Site background
--ast-global-color-5 - Color 6 = Content Background
--ast-global-color-6 - Color 7 = Link color
--ast-global-color-7 - Color 8 = Extra theme color 1
--ast-global-color-8 - Color 9 = Extra theme color 2
*/

/* --- VARIABLES --- */

  :root { --margin: 20px; }
  :root { --half-margin: 10px; }
  :root { --neg-margin: -20px; }
  :root { --image-ratio: 16 / 9 }

  /* Override WP */
  body { --wp--style--block-gap: var(--margin); }

/* --- HELPERS --- */
  /* Standard padding */
  .standard-padding { padding: var(--margin)!important; }

  /* Hide in mobile (standard breakpoint) */
  @media (min-width: 545px) {
    .mobile-hidden {
      display: none!important;
    }
  }

/* --- GENERAL --- */

  /* Body */
  body {
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
  }

  ul[role="list"] {
    list-style: none;
    margin: 0;
    padding: 0;
}

  /* Heading link color */
  h1 a,
  h2 a,
  h3 a,
  h4 a,
  h5 a,
  h6 a,
  .ast-single-post .entry-content a {
    color: black;
    text-decoration: none;
  }

  /* No post image heading margin */
  .entry-header.ast-no-thumbnail {
    margin-top: 4em;
  }

  /* Header */
  .ast-builder-grid-row.ast-grid-center-col-layout {
    grid-template-columns: 120px auto 215px;
    grid-column-gap: 0;
  }

  /* Primary, secondary desktop */
  #primary {
    background-color: white;
    padding-top: 0!important;
  }

  /* Astra container padding */
  .ast-container {
    padding-left: var(--margin)!important;
    padding-right: var(--margin)!important;
  }

  #primary {
    margin: 0!important;
    padding: 0!important;
  }

  body.single #primary {
    padding: 0!important;
  }

  @media (min-width: 922px) {
    body.ast-right-sidebar #primary { width: calc(100% - 321px); }
    #primary {
      padding: 0 var(--margin)!important;
      border-right: 0!important;
    }
    body.single #primary {
      padding: 0 var(--margin)!important;
    }
    #secondary {
      margin: 0!important;
      padding-left: var(--margin)!important;
      width: 321px;
      line-height: 1;
    }
  }

  /* Single post thumbs */
  body.single .post-thumb {
    margin: 0 var(--neg-margin) 0 var(--neg-margin);
  }

  body.single .post-thumb img {
    width: 100%;
    object-fit: cover;
  }

  /* Image captions */
  figcaption {
    font-size: .8em;
    margin-bottom: 1.6em;
  }

  /* Single, figure/figcaption */
  body.single figure {
    margin: 0 0 1em;
  }

  body.single figure figcaption {
    margin:0!important;
    text-align: left;
    padding: .4em .6em;
    background: var(--ast-global-color-4);
  }
  @media (max-width:921px) {
    body.single figure figcaption {
      padding-left: var(--margin)
    }
  }

  /* Entry title heading */
  .ast-single-post .entry-title {
    font-size: 2rem;
  }

  /* Remove borders in archive/search */
  body.archive article, body.search article { border: none!important; }


  /* Secondary - sticky widget group */
  .sidebar-main {
    height: 100%;
  }

  #secondary .wp-block-group.sticky {
    height: 100%;
    position: relative;
    max-height: 100%;
  }

  #secondary .wp-block-group.sticky > div:last-child {
    position: sticky;
    top: 0;
  }

  /* Inline images */
  .wp-block-image.alignleft { margin-right: 1em; }

/* --- WP QUERY --- */

  /* Featured */
  .wp-block-query.featured {
    margin: 0 var(--neg-margin) var(--margin);
  }
  .wp-block-query.featured a { width: 100%; }
  .wp-block-query.featured img {
    width: 100%;
    object-fit: cover;
    aspect-ratio: var(--image-ratio)!important;
  }

  .wp-block-query.featured .wp-block-post-template li {
    position: relative;
  }
  .wp-block-query.featured .wp-block-group {
    position: absolute;
    width: 100%;
    bottom: 0;
    background: rgba(0,0,0,.3);
    color: white!important;
    padding: var(--margin);
  }

  .wp-block-query.featured .wp-block-group h2 {
    margin: 0;
  }

  .wp-block-query.featured .wp-block-group h2 a {
    color: white;
  }

  .wp-block-group.featured p { margin-top: .5em; }

  @media (max-width:599px) {
    .wp-block-group.featured p { display: none; }
    .wp-block-group.featured h2 { margin-bottom: 0; }
  }

  /* WP Block query */

  .wp-block-group {
    padding: 0;
    position: relative;
  }
    /* Image */
    .wp-block-query .wp-block-post-featured-image a {
      width: 100%;
    }
    .wp-block-query .wp-block-post-featured-image img {
      object-fit: cover;
        aspect-ratio: var(--image-ratio);
    }

    /* Kategori */
    .wp-block-query .wp-block-post-template .wp-block-post-terms a {
      position: absolute;
      bottom: 10px;
      left: 10px;
      display: block;
      padding: 2px 6px 0;
      background: var(--wp--preset--color--ast-global-color-0); /* Astra primary color */
      font-weight: 700;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: white;
    }

    /* Rub */
    .wp-block-query .wp-block-post-template h2 {
      margin: .5em 0 .3em;
    }

    .wp-block-query ul {
      margin: 0;
    }

    .wp-block-query p.read-more {
      display: none;
    }

/*---  ARCHIVE/SEARCH PAGES --- */

  /* Archive title/description */
  .ast-archive-description {
    margin: 0!important;
    padding: var(--margin)!important;
    text-align: center;
  }

  /* Archive image sizes */
  .ast-row .post-thumb-img-content.post-thumb img {
    aspect-ratio: var(--image-ratio);
    object-fit: cover;
  }

  .ast-post-format-.blog-layout-1 {
    padding: 0!important;
  }

  @media (min-width: 768px) {
    body.archive .ast-row,
    body.search .ast-row {
      column-gap: var(--margin);
      row-gap: var(--margin);
    }
    body.archive .ast-width-md-6,
    body.search .ast-width-md-6,
    body.archive .ast-col-md-6,
    body.search .ast-col-md-6 {
      width: calc( 50% - var(--half-margin));
    }
  }

/* --- PARTNER/NATIVE --- */

/* Ad merkers for partner category */
li.category-partner > figure:before,
li.partner.type-partner.has-post-thumbnail > figure:before {
  content: 'Annons';
  font-size: .8em;
  position: relative;
  display: block;
  margin: 0.5em 0.5em -3em 0.5em !important;
  float: right;
  margin-right: 0.5em;
  background-color: white;
  padding: 0 0.5em;
  color: #4B4F58;
}

/* --- ADS --- */

  /* Header */
  .header-widget-area .widget {
    margin: 0 0 1.5em 0;
  }

  /* Placements */
  .ad iframe,
  .ad > div {
    display: block!important;
    margin: 0 auto!important;
  }

  .ad.panorama {
    width: 980px;
    margin: 0 auto;
  }

  /* Ad marker */
  .admarker,
  [class$="-adlabel"] {
    font-size: .6em;
    height: 20px;
    text-transform: uppercase;
    line-height: 2em;
    text-align: center;
  }

  /* Incosecvent hyphen (see above) */
  .no-ad-marker{
    display: none !important;
  }

/* ENTERPRISE */

  /* No clearing in articles */
  .entry-content > h1,
  .entry-content > h2,
  .entry-content > h3,
  .entry-content > h4,
  .entry-content > h5 {
    clear: none;
  }

  /* Enterprise sidebar info */
  .generic-text-wrapper.right {
    float: right;
    background: #ffffd9;
    width: 200px;
    max-width: 50%;
    padding: var(--margin) var(--margin) 0;
    margin: 0 0 var(--margin) var(--margin);
  }

  .single .astra-advanced-hook-46832  {
    font-size: 22px;
    font-weight: bold;
  }

  .single .entry-meta {
    display: none !important;
  }

  .wp-block-query .wp-caption-text {
    display: none !important;
  }
  .wp-block-query .wp-block-post-template .wp-block-post-terms a {
    bottom: 35px;
  }

  article.partner {
    margin: 0 var(--neg-margin) 0.1em var(--neg-margin);
    padding: 0 20px 20px 20px;
  }


/* STREAMLINE ADS */

.sticky-mobile {
	top: 30px;
}

/* wpforms */
.wpforms-container input.wpforms-field-medium,
.wpforms-container select.wpforms-field-medium {
  max-width: none;
}

.bold-text {
  font-weight: bold;
}

.entry-content p {
    margin-block-end: 0;
}

.entry-content > * + :not(.dap-ad-format) {
    margin-block-start: 1lh;
}

.wp-block-columns:has(> .wp-block-column.sticky) {
  align-items: flex-start !important;
  flex-wrap: wrap !important;
}

.wp-block-columns:has(> .wp-block-column.sticky) > .wp-block-column:not(.sticky) {
  min-width: 50%;
}

.sticky {
  position: sticky;
  top: 0;
}

/* BLURB */
.blurb {
    position: relative;
    container-type: inline-size;
}

.blurb__link:before {
    content: '';
    position: absolute;
    inset: 0;
}

.blurb__inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blurb__image {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #eee;
}

.blurb__image img {
    height: 100%;
    width: 100%;
    transition: transform .2s ease-in-out;
}

.blurb:has(.blurb__link:hover) .blurb__image img {
    transform: scale(1.01);
}

.blurb__content {
    display: grid;
    gap: 0.625rem;
}

.blurb__content > * {
    margin: 0;
}

.blurb__date {
  line-height: 1;
}

.blurb .blurb__content .blurb__heading {
    font-size: 32px;
    font-family: 'Catamaran', sans-serif;
    color: red;
}

.blurb .blurb__heading .blurb__link {
  color: inherit;
}

.blurb .blurb__content .blurb__label {
  position: absolute;
  top: calc(9 / 16 * 100cqi - 10px);
  left: 10px;
  transform: translateY(-100%);
  background-color: #ed1c24;
  padding: 2px 6px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  z-index: 2;
  transition: none;
}

/* EGMONT POST LIST / BLURB */
.egmont-post-list.list-hero {
    margin-inline: var(--neg-margin);
}

.egmont-post-list ul {
  --gap: 1rem;
  --max-columns: 1;
  --min-width: 240px;
  --w: max(var(--min-width), calc(100% * (1 / (var(--max-columns) + 1))));

  display: grid;
  column-gap: var(--gap);
  row-gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--w), 100%), 1fr));
}

.egmont-post-list + .egmont-post-list {
  margin-block-start: 2rem;
}

.egmont-post-list.list-two-col ul {
  --max-columns: 2;
}

.egmont-post-list.list-three-col ul {
  --max-columns: 3;
}

.egmont-post-list.list-three-col .blurb__heading {
  font-size: 26px;
}

.list-hero .blurb {
    padding-bottom: calc(9 / 16 * 100%);
    min-height: 420px;
}

.list-hero .blurb__inner {
    position: absolute;
    inset: 0;
    justify-content: flex-end;
}

.list-hero .blurb__image {
    position: absolute;
    width: 100%;
    height: 100%;
    aspect-ratio: inherit;
}

.list-hero .blurb__content {
    z-index: 1;
    width: 100%; 
    background-color: rgba(0, 0, 0, .4);
    padding: calc(var(--margin) * 1.5) var(--margin);
    color: #fff;
}

.list-hero .blurb__date {
  display: none;
}

.list-hero .blurb .blurb__heading a {
  color: #fff;
}

.list-hero .blurb__label,
.list-three-col .blurb__excerpt {
  display: none;
}

@media (max-width: 600px) {
  .list-hero .blurb__excerpt {
    display: none;
  }
}

.ast-separate-container .ast-archive-description, 
.ast-separate-container .ast-author-box {
  background-color: #fff;
}