/**
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.9
License:
License URI:
Text Domain: she-theme
Template: astra
*/
/* --- 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;
}

/* Heading link color */
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 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: var(--margin) 0 var(--margin) 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: 1em;
    background: #000;
    color: #fff;
}

body.single figure figcaption p:empty {
    display: none;
}

@media (max-width: 921px) {
    body.single figure figcaption {
        padding-left: var(--margin)
    }
}

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

/* Secondary - sticky widget group */
#secondary .wp-block-group.sticky {
    height: 1400px; /* Fallback */
    height: 200vh;
    position: relative;
}

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

/* --- 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);
    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 */
body.single article.category-partner div.post-thumb > figure:before,
li.category-partner 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;
}

/* --- 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);
}


