/**
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.8
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 */

html {
    font-size: 100%;
}

body {
    font-size: 1.125rem;
}

img {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.2;
}

body {
    --wp--style--block-gap: var(--margin);
}

ul, ol {
    margin-inline-start: 0;
}

/* --- 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;
    margin-top: 0;
}

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

/* Image captions */
figcaption {
    font-size: .875rem;
    line-height: 1.28;
}

/* Single, figure/figcaption */
body.single figure {
    display: grid;
    gap: 6px;
    margin-block-end: 0;
}

body.single figure.featured img {
    width: 100%;
}

body.single .primary figure figcaption {
    text-align: left;
    color: #666;
    margin: 0;
}

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

/* 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.archive .type-partner .post-thumb > a:before,
li.category-partner figure:before,
li.partner.type-partner.has-post-thumbnail > figure:before {
    content: 'Annons';
    font-size: .9rem;
    position: relative;
    display: block;
    margin: 0.5625rem 0.5625rem -3.375rem 0.5625em !important;
    float: right;
    margin-right: 0.5625rem;
    background-color: white;
    padding: 0 0.5625rem;
    color: #2e2e2e;
}


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



/* 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 {
    background: #CBE1EF;
    padding: 2rem;
}

body.icakuriren .generic-text-wrapper {
    background: #d3e3f4;
}

.generic-text-wrapper :is(h2, h3, h4, h5) {
    font-size: clamp(1.6875rem, 1.3393rem + 1.4286vw, 2.625rem);
}

.generic-text-wrapper .wp-block-column > * + * {
    margin-block-start: 1.25rem;
}

@media (min-width: 768px) {
  .ast-width-md-4 {
    width: 31.333333%;
  }

  .ast-width-md-3 {
    width: 23%;
  }
}

.sticky-mobile{
    top: 0;
}

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

#primary .ast-article-image-container--wide:first-child {
    margin: 0 var(--neg-margin) 0 var(--neg-margin);
}

#banner-container {
    text-align: center;
    max-width: 100%;
    padding: 10px;
}

#banner-container img {
    max-width: 100%;
    margin: auto;
}

.desktop-banner {
    width: 980px;
}

.mobile-banner {
    width: 320px;
}

@media (min-width: 980px) {
    .desktop-banner {
        display: block;
    }
    .mobile-banner {
        display: none;
    }
}

@media (max-width: 979px) {
    .desktop-banner {
        display: none;
    }
    .mobile-banner {
        display: block;
    }
}



/* New styling for header and single article. 2025-03 */
:root {
    --brand-color: red;
    --menu-link-hover-color: red;
    --gap: 30px;
    --gutter: 20px;
}

body {
    background-color: #fff;
}

body.icakuriren {
    --brand-color: #d1213e;
    --menu-link-hover-color: #841527;
}

body.hemmetsjournal {
    --brand-color: #ED1C24;
    --menu-link-hover-color: #ef404d;
}

body.single-post #header {
    margin-block-end: clamp(2.5rem, 1.7857rem + 3.5714vw, 5rem); /* 40-80px */
}

.wrapper {
    max-width: 1360px;
    padding-inline: var(--gutter);
    margin-inline: auto;
}

.repel {
    display: flex;
    justify-content: space-between;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
}

.has-sidebar {
    display: flex;
    flex-wrap: wrap;
}

.sidebar {
    flex-basis: 300px;
    flex-grow: 1;
}

.has-sidebar > :not(.sidebar) {
    flex-basis: 0;
    flex-grow: 999;
    min-width: min(100%, 980px);
}

.gap {
    gap: var(--gap);
}

.items-center {
    align-items: center;
}

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

.stack > * + * {
    margin-block-start: var(--gap);
}

.prose > * + * {
    margin-block-start: 1.36em;
}

.prose > :is(h1, h2, h3, h4, h5) + * {
    margin-block-start: 0.68em;
}

.aspect-ratio-video {
    aspect-ratio: var(--image-ratio);
    object-fit: cover;
    object-position: center;
}

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

.post-excerpt {
    font-size: clamp(1.125rem, 1.0179rem + 0.5357vw, 1.5rem); /* 18-24px */
    line-height: 1.333;
    font-weight: 500;
}

.post-meta {
    display: flex;
    color: #666666;
    column-gap: 20px;
    font-size: 1rem;
    flex-wrap: wrap;
    overflow: hidden;
}

.post-meta > * + * {
    position: relative;
}

.post-meta > * + *:before {
    content: '|';
    position: absolute;
    left: -11px;
}

.post-meta .post-date {
    display: flex;
    column-gap: .75em;
    flex-wrap: wrap;
}

.post-meta .post-date span {
    white-space: nowrap;
}

a {
    text-decoration: underline;
    --underline-opacity: 0.5;
    text-decoration-color: rgba(from currentColor r g b / var(--underline-opacity));
}

a:hover {
    text-decoration: underline;
    --underline-opacity: 1;
}

.post-meta a {
    color: inherit;
}

.post-content {
    font-size: clamp(1.125rem, 1.0893rem + 0.1786vw, 1.25rem);
    line-height: 1.54;
}

.post-content > * {
    max-width: 640px;
    margin-inline: auto;
}

.post-content .dap-ad-format:not(:has([id*="google_ads_iframe"])),
.post-content .dap-ad-format:has(div[id*="google_ads_iframe"]:empty) {
    display: none !important;
}

.post-content > figure.wp-block-image:not(.size-medium),
.post-content > .alignwide {
    max-width: min(100%, 768px) !important;
}

.post-content > .alignfull {
    max-width: none !important;
}

.post-content > figure.wp-block-image:not(.size-medium) img {
    width: 100%;
}

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

.post-content > * + figure.wp-block-image {
    margin-block: 3rem;
}

.post-tags a {
    --color: #E7E0D9;
    font-size: 0.8em;
    display: inline-block;
    background-color: var(--color);
    padding: 0.1em 0.5em;
    color: currentColor;
    text-decoration: none;
    border-radius: 999em;
    text-transform: lowercase;
}

.post-tags a:hover {
    background-color: hsl(from var(--color) h s calc(l - 5));
}

.read-also {
    font-size: 1.25rem;
    margin-block: clamp(50px, 5vw, 80px);
}

#header {
    padding: 20px 0;
    border-block-end: 1px solid #ccc;
    margin-block-end: 20px;
    position: relative;
}

#header .site-logo {
    width: 140px;
    min-width: 140px;
}

#header .menu {
    font-size: 1.06rem;
}

#header .menu a {
    color: #000;
    white-space: nowrap;
}

#header a {
    text-decoration: none;
}

#header .menu a > .ast-icon.icon-arrow {
    display: none;
}

#header .menu a:hover {
    color: var(--menu-link-hover-color);
}

.menu-link {
    padding: 0.5em 0.8em;
}

#header .menu-item-has-children {
    position: relative;
}

#header .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0px 4px 10px -2px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 9999;
    width: min(240px, 90vw);
}

#header .menu-item-has-children:hover .sub-menu {
    display: block;
}

#header .sub-menu a {
    display: block;
    padding: 0.45rem 0.625rem;
    line-height: 1.6em;
}

#header .subscribe-link {
    font-size: 1.06rem;
    padding: 0.5rem 1.25rem;
    background-color: var(--brand-color);
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
    line-height: 1.7;
}

.toggle-search-box {
    background: transparent;
    border: 0;
    color: #000;
    padding: 0.5rem 0;
}

.toggle-search-box:hover {
    background: transparent;
    color: #000;
}

.toggle-search-box svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
}

#header .toggle-menu {
    display: none;
    background: transparent;
    border: 0;
    padding-inline: 1rem;
    margin-inline-end: -1rem;
    z-index: 999;
    position: relative;
}

#header .toggle-menu svg {
    width: 18px;
    height: 12px;
}

.articles-block-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    margin-block: 0;
    flex-direction: row;
}

.articles-block-wrapper + * {
    margin-block-start: 30px;
}

.articles-block-wrapper.left {
    flex-direction: row-reverse;
}

.articles-block-wrapper > * {
    padding: 0;
}

.articles-block-wrapper .article {
    display: flex;
    flex-direction: column;
    margin: 0;
    line-height: 1;
}

.articles-block-wrapper .article > * + * {
    margin-block-start: 0.5rem;
}

.articles-block-wrapper .article-content {
    margin-inline: 0;
    margin-block-end: 0;
}

.articles-block-wrapper .article .article-image {
    width: 100%;
    height: auto;
    max-width: none;
}

.articles-block-wrapper .article .article-image img {
    aspect-ratio: var(--image-ratio);
    max-height: none;
}

.articles-block-wrapper .big-article {
    flex-basis: 0;
    flex-grow: 999;
    min-width: 65%;
}

.articles-block-wrapper .big-article .article {
    position: sticky;
    top: var(--gap);
}

.articles-block-wrapper .article .article-title {
    display: block;
    margin-block-start: 0.25rem;
}

.articles-block-wrapper .small-articles {
    min-width: 0;
    flex-basis: 300px;
    flex-grow: 1;
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
    place-content: flex-start;
}

.articles-block-wrapper .small-articles .article {
    flex-basis: 240px;
    flex-grow: 1;
}

.articles-block-wrapper .small-articles .article-title {
    font-size: 1.125rem;
}

.articles-block-wrapper .article-category a {
    font-size: 0.875rem;
}

@media (max-width: 960px) {
    #header .subscribe-link,
    #header .toggle-search-box,
    #header .menu {
        display: none;
    }

    #header .toggle-menu {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }
    
    .menu-open #header .menu {
        display: block;
    }

    .close-icon {
        position: relative;
        width: 18px;
        height: 12px;
        display: none;
    }

    .menu-open .close-icon {
        display: block;
    }

    .menu-open .menu-icon {
        display: none;
    }

    .close-icon:before,
    .close-icon:after {
        content: '';
        display: block;
        height: 2px;
        background-color: #000;
        width: 18px;
        position: absolute;
        top: calc(50% - 1px);
        left: calc(50% - 9px);
        transform-origin: center;
    }

    .close-icon:before {
        transform: rotate(-45deg);
    }

    .close-icon:after {
        transform: rotate(45deg);
    }

    #header .menu {
        background-color: #fff;
        z-index: 999;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: calc(100vh - 100%);
        overflow: auto;
        z-index: 999;
    }

    #header .sub-menu .menu-link {
        width: 100%;
        display: block;
    }

    #header .sub-menu {
        position: static;
        width: 100%;
        padding-inline-start: 1rem;
        box-shadow: none;
    }

    #header .menu-item {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .menu-link .ast-icon {
        display: none;
    }

    #header .ast-menu-toggle {
        display: flex;
        flex-grow: 1;
        justify-content: flex-end;
    }

    #header .menu-item.menu-item-has-children.sub-menu-open > .sub-menu {
        display: block;
    }
}

.ast-footer-copyright img {
    width: 150px;
}

dl.recipe-meta {
    display: flex;
    gap: 1.5rem;
    margin-block: 2rem;
    white-space: nowrap;
    flex-wrap: wrap;
}

.recipe-meta__wrapper {
    display: flex;
    gap: 0.5rem;
}

dl.recipe-meta dd {
    margin: 0;
}

.recipe-meta__item {
    display: flex;
    gap: 1em;
}

.recipe-meta__portions .recipe-meta__item {
    flex-direction: column;
    gap: 0;
}