/* ============================================================
   DeepYogaWay — 08_wordpress.css
   Bruges i Simple Custom CSS & JS PRO → All Website
   Load order: 8 af 8 — LOADES SIDST (overrider alt andet)
   ============================================================
   Indhold:
   1. Google Fonts backup import
   2. Astra nul-reset (fjern al default padding/margin)
   3. Fjern Astra header og footer wrappers
   4. Admin bar kompensation (top offset for .nav)
   5. Gutenberg block reset
   6. WordPress body klasse fixes
   7. Inline grid override på mobil (repeat(3,1fr) → 1fr)
   8. Mobil billede crop (object-position, aspect-ratio)
   9. Hero mobil (min-height, knapper, subtitle)
   10. Page hero på indersider (mobil top-padding)
   11. Section spacing mobil
   12. Cards mobil (padding, hover, titel)
   13. Nav mobil (hamburger, overlay, scrolled)
   14. Nav farve på scrolled state
   15. Journal kategori-bar sticky top
   16. Article sidebar mobil
   17. Footer mobil
   18. Horisontal scroll prevention
   19. Globale billede regler
   20. Stat-row mobil
   ============================================================ */

/* ── 1. Fonts (backup hvis ikke loadet via main.css) ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── 2. Astra + Gutenberg nul-reset ── */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

/* Gutenberg block wrapper — årsag til hvid linje øverst */
.wp-site-blocks {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}

/* Astra content wrappers — fuld bredde, ingen constraints */
.site,
.site-content,
.ast-container,
.ast-plain-container,
#content,
.primary,
#primary,
.content-area,
.entry-content,
.ast-article-single,
.ast-article-post,
.ast-page-builder-template .hentry,
.hentry,
.page .entry-header,
.post-content,
.ast-separate-container .ast-article-post,
.ast-separate-container #primary,
.ast-full-width-layout .site-content,
.ast-page-builder-template .site-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* WordPress tilføjer automatisk padding-top til body
   svarende til nav-højden — vi styrer dette selv */
body {
  padding-top: 0 !important;
}

/* Fjern Astra's standard top-margin på entry-content */
.entry-content > *:first-child {
  margin-top: 0 !important;
}

/* Fjern evt. wp-block padding */
.wp-block-group,
.wp-block-group__inner-container,
.entry-content .wp-block-html {
  padding: 0 !important;
  margin: 0 !important;
}

/* ── Single post / article Astra reset ── */
/* Fjern Astra's egne single post styles der konflikter */
.single-post .site-content,
.single-post #primary,
.single-post .content-area,
.single-post .ast-container,
.single-post .ast-separate-container,
.single-post .ast-plain-container,
.ast-single-post .entry-content,
.ast-article-single .entry-content,
body.single .entry-content,
body.single .ast-article-post {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* Fjern Astra featured image wrapper på single posts */
.single-post .post-thumbnail,
.single-post .ast-post-thumbnail-wrap,
.ast-single-post .post-thumbnail {
  display: none !important;  /* vi viser featured image via single.php template */
}

/* Fjern Astra article title på single posts */
.single-post .entry-header,
.single-post .ast-article-post > .entry-header,
body.single .page-header,
body.single .entry-title {
  display: none !important;  /* vi viser titel via single.php */
}

/* Fjern Astra entry-meta (date, author, categories under title) */
.single-post .entry-meta,
.ast-article-single .entry-meta,
body.single .ast-post-meta {
  display: none !important;
}

/* Fjern Astra content padding på single */
body.single .ast-article-post,
body.single .ast-single-post .entry-content {
  padding: 0 !important;
}

/* Related posts fra Astra — skjul (vi viser egne) */
.ast-related-posts-section,
.related-posts-title {
  display: none !important;
}

/* Astra footer af single post */
.single-post .entry-footer,
.ast-article-single .entry-footer {
  display: none !important;
}

/* ── Category archive reset ── */
/* Stil category archive sider som normale sider */
body.category .ast-container,
body.category #primary,
body.category .site-content {
  padding: 0 !important;
  max-width: none !important;
}

/* ── Fluent Forms i sidebar — ingen ekstra margin ── */
.sidebar-block .ff-el-group {
  margin-bottom: 0.75rem !important;
}

.sidebar-block .fluent-form-wrap {
  margin: 0 !important;
}

/* ── 3. Fjern Astra header og footer wrappers ── */
/* (vi bruger vores eget .nav og .footer via Custom Layouts) */
.site-header,
#masthead,
.ast-header-wrap,
.main-header-bar,
.ast-above-header-bar,
.ast-below-header-bar {
  display: none !important;
}

.site-footer,
#colophon,
.ast-footer-overlay,
.footer-widget-area,
.ast-footer-widget-area,
.ast-above-footer,
.ast-below-footer,
.ast-below-footer-bar {
  padding: 0 !important;
  margin: 0 !important;
}

/* Skjul Astra's copyright bar */
.ast-footer-copyright {
  display: none !important;
}

/* Fjern scroll-to-top knap */
.ast-scroll-to-top {
  display: none !important;
}

/* ── 4. Admin bar kompensation ── */
body.admin-bar .nav {
  top: 32px !important;
}

body.admin-bar .journal-categories {
  top: calc(64px + 32px) !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar .nav {
    top: 46px !important;
  }

  body.admin-bar .journal-categories {
    top: calc(60px + 46px) !important;
  }
}

/* ── 5. Gutenberg block reset ── */
/* Fjern standard Gutenberg block padding */
.wp-block-group,
.wp-block-cover,
.entry-content .wp-block-group__inner-container {
  padding: 0 !important;
}

/* Fjern blå/grå Gutenberg focus-ring */
.wp-block-html:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* ── 6. WordPress body klasse fixes ── */
.wp-singular .site-content,
.singular .site-content,
.page .site-content,
.home .site-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* ── 7. Inline grid override på mobil ── */
/* Disse grids er skrevet inline i HTML og kan ikke styles
   uden !important — de kollapser til 1 kolonne på mobil */
@media (max-width: 768px) {

  /* 3-kolonne grids */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"],
  [style*="repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* 2-kolonne grids (værdier/about grid) */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Pillar expanded rows */
  [style*="grid-template-columns:120px 1fr"] {
    grid-template-columns: 60px 1fr !important;
  }
}

/* Tablet — 3-kolonne → 2-kolonne */
@media (min-width: 769px) and (max-width: 1024px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── 8. Mobil billede crop ── */
@media (max-width: 768px) {

  .hero__media img {
    object-position: center center !important;
  }

  .content-grid__image img,
  .group-section__image img,
  .for-section__image img,
  .about-section__image img {
    aspect-ratio: 4 / 5 !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  .featured-card__image img {
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    min-height: auto !important;
    max-height: none !important;
  }

  .article-hero-image img {
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center center !important;
  }
}

/* ── 9. Hero mobil ── */
@media (max-width: 768px) {

  .hero {
    min-height: 90svh !important;
    align-items: flex-end !important;
  }

  .hero__content {
    padding-bottom: 3.5rem !important;
    padding-inline: 1.25rem !important;
  }

  .hero__title {
    font-size: clamp(2.4rem, 10vw, 3.2rem) !important;
  }

  .hero__subtitle br {
    display: none !important;
  }

  .hero__subtitle {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  .hero__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .hero__actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .hero__scroll {
    display: none !important;
  }
}

/* ── 10. Page hero på indersider (mobil) ── */
@media (max-width: 768px) {

  .page-hero,
  .journal-hero,
  .article-header {
    padding-top: calc(5rem + 60px) !important;
    padding-bottom: 2.5rem !important;
  }

  .page-hero__inner {
    max-width: 100% !important;
  }

  .page-hero h1,
  .page-hero .display-lg {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
  }
}

/* ── 11. Section spacing mobil ── */
@media (max-width: 768px) {

  .section {
    padding-block: 3.5rem !important;
  }

  .section--sm {
    padding-block: 2.5rem !important;
  }

  .pullquote-section {
    padding-block: 3rem !important;
  }

  .container {
    padding-inline: 1.25rem !important;
  }
}

/* ── 12. Cards mobil ── */
@media (max-width: 768px) {

  /* Fjern hover-løft på touch */
  .card:hover,
  .info-card:hover,
  .featured-card:hover {
    transform: none !important;
  }

  .card:hover .card__image img {
    transform: none !important;
  }

  /* Card body padding */
  .card__body {
    padding: 1.25rem !important;
  }

  /* Card titel størrelse */
  .card__title {
    font-size: 1.3rem !important;
  }

  /* Card footer — stack lodret */
  .card__footer {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  /* Info card padding */
  .info-card {
    padding: 1.75rem !important;
  }

  .info-card__title {
    font-size: 1.35rem !important;
  }

  /* Featured card */
  .featured-card__body {
    padding: 1.75rem !important;
  }

  .featured-card__title {
    font-size: 1.4rem !important;
  }

  /* Session steps */
  .session-step {
    padding: 1.25rem !important;
    gap: 1rem !important;
  }

  .session-step__num {
    font-size: 2rem !important;
    min-width: 40px !important;
  }

  /* Pillars */
  .pillar {
    padding: 1.75rem 1.25rem !important;
  }

  .pillar__number {
    font-size: 2rem !important;
  }
}

/* ── 13. Nav mobil ── */
/* Al nav-styling styres fra 02_header.css.
   08_wordpress.css tilføjer KUN padding-korrektioner
   der ikke konflikter med header-states. */
@media (max-width: 768px) {

  /* Padding-korrektion — ingen background-override her */
  .nav__inner {
    padding-inline: 1.25rem !important;
  }
}

/* ── 14. Nav farve — FJERNET ── */
/* Disse regler er flyttet til 02_header.css.
   Ingen nav-farver sættes her — undgår konflikter. */

/* ── 15. Journal kategori-bar sticky ── */
.journal-categories {
  top: 60px !important;
}

/* ── 16. Article sidebar mobil ── */
@media (max-width: 1024px) {
  .article-sidebar {
    position: static !important;
    order: 2 !important;
  }

  .article-layout {
    grid-template-columns: 1fr !important;
  }

  .article-content {
    max-width: 100% !important;
  }
}

/* ── 17. Footer mobil ── */
@media (max-width: 768px) {

  .footer__grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .footer__bottom {
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center !important;
  }

  .newsletter {
    flex-direction: column !important;
    max-width: 100% !important;
  }

  .newsletter__input {
    border-right: 1px solid rgba(244,239,231,0.2) !important;
    border-bottom: none !important;
  }
}

/* ── 18. Horisontal scroll prevention ── */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* ── 19. Globale billede regler ── */
.hero__media img,
.content-grid__image img,
.group-section__image img,
.for-section__image img,
.about-section__image img,
.card__image img,
.featured-card__image img,
.article-hero-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ── 20. Stat-row tablet ── */
@media (max-width: 768px) {
  .stat-row {
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
  }

  .stat__value {
    font-size: 2rem !important;
  }
}

/* ══════════════════════════════════════════════════════════
   JOURNAL + ARTICLE LAYOUT FIXES
   ══════════════════════════════════════════════════════════ */

/* ── Fix 1: Ingen link-understregninger nogen steder ── */
a,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
}

/* Specifikt på journal cards og article links */
.card a,
.card a:visited,
.card a:hover,
.featured-card,
.featured-card:visited,
.featured-card:hover,
.article-content a { /* artikellinks MÅ gerne have subtil underline */
  text-decoration: none;
}

/* Article content links: underline ok, men ikke browser-blå */
.article-content a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  color: var(--clay) !important;
}

.article-content a:hover {
  opacity: 0.75 !important;
}

/* ── Fix 2: Astra ast-container SKAL være full width ── */
.ast-container,
.ast-plain-container,
#content .ast-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ── Fix 3: Category filter — wrap på mobil ── */
@media (max-width: 768px) {
  .journal-categories .category-bar {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    padding: 0.75rem 1rem !important;
    gap: 0.4rem !important;
    justify-content: flex-start;
  }

  .category-tag {
    font-size: 0.62rem !important;
    padding: 0.38rem 0.7rem !important;
    white-space: nowrap;
  }
}

/* ── Fix 4: Article layout — stabil på laptop ── */
/* Container på single post: full width, ingen padding */
body.single .ast-container,
body.single #content,
body.single #primary,
body.single .content-area {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

/* Article header og hero: centrer til max-width */
.article-header .container,
.article-hero-image {
  max-width: 100% !important;
}

/* Article body container: stram max-width */
.article-body > .container {
  max-width: 1160px !important;
  padding-inline: 2rem !important;
}

/* Article layout grid: eksplicit max-width og bredde */
.article-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 260px !important;
  gap: 3rem !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Laptop: smallere sidebar */
@media (min-width: 1025px) and (max-width: 1366px) {
  .article-body > .container {
    padding-inline: 1.5rem !important;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 240px !important;
    gap: 2.5rem !important;
  }
}

/* Tablet og under: 1 kolonne */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr !important;
    max-width: 760px !important;
    margin-inline: auto !important;
  }

  .article-sidebar {
    position: static !important;
  }

  .article-body > .container {
    max-width: 800px !important;
    padding-inline: 1.25rem !important;
  }
}

/* ── Fix 5: Related articles — aldrig smalle kolonner ── */
.related-section .container {
  max-width: 1160px !important;
  padding-inline: 2rem !important;
}

.related-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.5rem !important;
}

@media (max-width: 1200px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr !important;
  }

  .related-section .container {
    padding-inline: 1.25rem !important;
  }
}

/* ── Fix 6: Featured card — stabil på laptop ── */
.featured-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  max-width: 1160px !important;
  margin-inline: auto !important;
}

.featured-card__image {
  min-height: 340px !important;
  overflow: hidden;
}

.featured-card__image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr !important;
  }

  .featured-card__image {
    min-height: 240px !important;
    max-height: 300px !important;
  }
}

/* ── Fix 7: Journal grid kontrolleret ── */
.journal-featured .container,
.journal-grid-section .container {
  max-width: 1160px !important;
  padding-inline: 2rem !important;
}

@media (max-width: 768px) {
  .journal-featured .container,
  .journal-grid-section .container {
    padding-inline: 1.25rem !important;
  }
}

/* ── Fix 8: Astra entry-header og entry-content fjernes ── */
/* Vores single.php template styrer layout — Astra må ikke tilføje */
body.single .entry-header,
body.single .ast-single-post .entry-header,
body.single .post-thumbnail,
body.single .ast-post-thumbnail-wrap,
body.single .entry-footer,
body.single .ast-article-post > .entry-header {
  display: none !important;
}

/* entry-content wrapper må ikke have padding/margin */
body.single .entry-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}
