/*
Theme Name: Astra Child (Responsive)
Theme URI: https://example.com/astra-child
Description: A child theme for Astra – refaktorerad till mobil-först med tydliga media queries.
Author: Your Name
Author URI: https://example.com
Template: astra
Version: 1.1.0
Text Domain: astra-child
*/

/* =============================
   0) Bas – mobil först
   ============================= */

/* Generellt */
.entry-content .wp-audio-shortcode,
.entry-content .wp-embedded-audio,
.entry-content .wp-embedded-video,
.entry-content .wp-video,
.entry-content p { margin-bottom: 1rem; }

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 { margin-top: 0; }

.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content { padding: 0 32px 0 0; }
.entry-content .wp-block-media-text .wp-block-media-text__content { padding: 0 16px; }

.ast-icon.icon-search.icon-custom svg { width: 25px; height: 25px; }

.yes-js.js_active .ast-plain-container.ast-single-post #primary { margin-top: 0 !important; }

.home .wp-block-cover.alignfull { margin-top: -80px; }

.menu-item-heading span.menu-text { height: 14px; display: block; }
span.woocommerce-Price-currencySymbol { text-transform: none; }

.current_page_parent > a,
.current-menu-item > a { color: var(--ast-global-color-1) !important; }

.ast-advanced-headers .ast-primary-header .main-header-menu > .menu-item > .menu-link:hover,
.ast-advanced-headers .ast-primary-header .main-header-menu > .menu-item:hover > .menu-link { color: var(--ast-global-color-1) !important; }

/* Bara på toppnivå */
.main-header-menu > .current_page_parent > a:before,
.main-header-menu > .current-menu-item > a:before {
  animation: fadeIn .3s ease-in-out;
  background: var(--ast-global-color-1);
  bottom: 0; content: ""; height: 4px; left: .8em; position: absolute; right: .8em;
}

/* Rubriker på singelsidor */
.single-references .entry-title { font-size: 32px; color: #006454; margin-bottom: 2rem; text-align: center; }
.single-knowledgebase header.entry-header:not(.related-entry-header) .entry-title { font-size: 32px; }
.single-knowledgebase .entry-header h2 { font-size: 18px; text-transform: uppercase; }

/* Innehållstyper */
.single-references .entry-content p { margin-bottom: 1rem; }
.single-references .entry-content > p:first-of-type { font-size: 1.15em; font-weight: 300; line-height: 1.53; }

/* Alignwide/alignfull – MOBIL BAS: fullbredd och utan centrerings-trick */
.single-references .alignwide,
.single-knowledgebase .alignwide { left: 0; transform: none; width: 100%; position: relative; }

/* Arkivsektioner */
.hh-reference-archive-wrapper,
.hh-knowledgebase-archive-wrapper { padding: 48px 0; }

/* Kort – mobil: 1 kolumn */
.hh-reference-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.hh-reference-item figure { margin-bottom: 1.5em; overflow: hidden; }
.hh-reference-item h2 { font-size: 1.1rem; line-height: 1.1; margin-bottom: .5em; text-transform: uppercase; }
.hh-reference-item h2 a { color: #000; }
.hh-reference-item h2 a:hover { text-decoration: underline; color: #000; }
.hh-reference-item p { margin-bottom: 1rem; line-height: 1.7; font-size: 1rem; }

/* Knowledgebase – mobil: 1 kolumn */
.hh-knowledgebase-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.hh-knowledgebase-item figure { margin-bottom: 1.5em; overflow: hidden; }
.hh-knowledgebase-item h2 { font-size: 1.1rem; line-height: 1.1; margin-bottom: .5em; text-transform: uppercase; }
.hh-knowledgebase-item h2 a { color: #000; }
.hh-knowledgebase-item h2 a:hover { text-decoration: underline; color: #000; }
.hh-knowledgebase-item p { margin-bottom: 1rem; line-height: 1.7; font-size: 1rem; }

/* KB featured image */
.kb-featured-image { margin-bottom: 48px; }

/* Astra block widths i smal container – mobil bas */
.ast-narrow-container .entry-content[data-ast-blocks-layout] > .alignwide {
  max-width: 100% !important; width: 100%; left: 0; transform: none; position: relative;
}
.ast-narrow-container .entry-content[data-ast-blocks-layout] > .alignfull {
  position: relative; left: 0; transform: none; width: 100vw;
}

/* Gallerier */
.textilier .spectra-image-gallery__layout--grid-col-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Dokument-accordion */
.documents-accordion h3 { font-size: 20px; }
.documents-accordion button { border-bottom: 2px solid #006454; padding: 18px 0; box-shadow: none; }
.documents-accordion .is-open { border-bottom: 2px solid #006454; }
.documents-accordion button:hover,
.documents-accordion button:focus { background-color: transparent; border-color: #006454; }
.documents-accordion .is-open h3 { font-size: 24px; }
.documents-accordion .is-open button { border-bottom-color: transparent; }
.documents-accordion .accordion-content__wrapper { margin-bottom: 40px; padding-right: 24px; }
.wp-block-accordion-item-is-layout-flow { margin-block-start: 0; }

/* WooCommerce */
.woocommerce-js div.product form.cart table.variations { border: none !important; }

/* Footer textstorlek */
.site-primary-footer-wrap .textwidget,
.site-primary-footer-wrap .widget_nav_menu { font-size: 13px; }

/* H2-klass bas – justeras uppåt på desktop via MQ */
.entry-content h2.green-h2 { font-size: 28px; color: #006454; }

.site-primary-footer-wrap[data-section="section-primary-footer-builder"].ast-footer-row-mobile-stack .site-footer-section { margin-bottom: 2rem;  }

/* Återställ ordningen för alla sektioner (1–5) */
.site-footer-primary-section-1 { order: 2; }
.site-footer-primary-section-2 { order: 3; }
.site-footer-primary-section-3 { order: 1; margin-bottom: 3rem !important; } /* 👈 loggan först */
.site-footer-primary-section-4 { order: 4; }
.site-footer-primary-section-5 { order: 5; }

.single-references .site-content #primary { padding: 30px 0; }

/* Mobil & surfplatta – full bredd (utan centrerings-trick) */
@media (max-width: 1024px) {
  .single-references .alignfull,
  .single-knowledgebase .alignfull {
    left: 0;
    transform: none;
    width: unset;
  }
}


/* =============================
   1) ≥ 600px (37.5rem)
   ============================= */
@media (min-width: 37.5rem) {
  .hh-reference-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .hh-knowledgebase-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .documents-accordion .accordion-content__wrapper { margin-bottom: 48px; padding-right: 32px; }
  .textilier .spectra-image-gallery__layout--grid-col-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* =============================
   2) ≥ 768px (48rem)
   ============================= */
@media (min-width: 48rem) {
  .single-references .entry-title,
  .single-knowledgebase header.entry-header:not(.related-entry-header) .entry-title { font-size: 36px; }
  .single-knowledgebase .entry-header h2 { font-size: 19px; }
  .kb-featured-image { margin-bottom: 64px; }

  .single-references .site-content #primary { padding: 40px 0; }
}

/* =============================
   3) ≥ 1024px (64rem)
   ============================= */
@media (min-width: 64rem) {
  /* Återställ desktop-liknande mellanläge */
  .entry-content h2.green-h2 { font-size: 42px; }

  /* Alignwide/alignfull centreras och ges fasta maxbredder i detta spann */
  .single-references .alignwide,
  .single-knowledgebase .alignwide {
    position: relative; left: 50%; transform: translateX(-50%); max-width: 1000px; width: 100%;
  }
  .single-references .alignfull,
  .single-knowledgebase .alignfull {
    position: relative; left: 50%; transform: translateX(-50%); max-width: 1200px; width: 100%;
  }

  .hh-reference-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .hh-knowledgebase-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

  .documents-accordion h3 { font-size: 22px; }
  .documents-accordion .is-open h3 { font-size: 28px; }
  .documents-accordion .accordion-content__wrapper { margin-bottom: 60px; padding-right: 48px; }

  .entry-content .wp-block-media-text .wp-block-media-text__content { padding: 0 0 0 32px; }

  .site-primary-footer-wrap[data-section="section-primary-footer-builder"].ast-footer-row-mobile-stack .site-footer-section { margin-bottom:0;  }
  /* Återställ ordning */
  .site-footer-primary-section-1 { order: 1; }
  .site-footer-primary-section-2 { order: 2; }
  .site-footer-primary-section-3 { order: 3; margin-bottom: 0 !important}
  .site-footer-primary-section-4 { order: 4; }
  .site-footer-primary-section-5 { order: 5; }

  .site-primary-footer-wrap .wp-block-heading:after,
  .site-primary-footer-wrap .widget-title:after { width: 100%;}

  
}

/* =============================
   4) ≥ 1280px (80rem)
   ============================= */
@media (min-width: 80rem) {
  /* Mappa till dina ursprungliga 1920px-intentioner */
  .single-references .alignwide,
  .single-knowledgebase .alignwide {
    position: relative; left: 50%; transform: translateX(-50%); width: 1000px; max-width: 1000px;
  }
  .single-references .alignfull,
  .single-knowledgebase .alignfull {
    position: relative; left: 50%; transform: translateX(-50%); width: 1400px; max-width: 1400px;
  }

  .single-references .entry-title { font-size: 42px; }
  .single-knowledgebase header.entry-header:not(.related-entry-header) .entry-title { font-size: 42px; }

  .hh-knowledgebase-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  
  .single-references .site-content #primary { padding: 80px 0; }
}

/* =============================
   5) ≥ 1536px (96rem) – stor desktop
   ============================= */
@media (min-width: 96rem) {
  .hh-reference-archive-wrapper,
  .hh-knowledgebase-archive-wrapper { padding: 80px 0; }

  /*.single-references.ast-narrow-container #primary,
   .single-knowledgebase.ast-narrow-container #primary { padding-top: 80px; padding-bottom: 80px; } */

  .textilier .spectra-image-gallery__layout--grid-col-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
