/* Single Post CSS */

/* acf short editor class */
/* Short editor */
.acf-field.short-editor .wp-editor-container {
  max-height: 200px!important;
}

.single-post-hero-top {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.single-post-hero-top>img {
  width: 100%;
  height: auto;
  display: block;
}

.single-post .et-l--body .et_pb_section {
  padding: 5px 0 !important;
  margin-top: -32px;
}

/* Sidebar */
.additional-articles {
  padding-top: 2.5rem;
  margin-bottom: -2.5rem;
  font-size: 1.2rem;
}

.single-post-hero {
  z-index: 1;
  text-align: center;
}

.single-post-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
  color: #333;
}

.single-post-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

/* Wrapper for all predefined blocks */
.predefined-block {
  padding: 1.2rem;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

/* === RESOURCES === */
.resources-layout {
  text-align: center;
}

.resources-layout h2 {
  margin-bottom: 1rem;
}

/* === RICHTEXT === */
.richtext-layout {
  padding: 1rem 0;
}

/* === CONTINUATION TEXT BLOCK === */
.post-richtext {
  background: inherit;
  border-left: none !important;
  border-radius: 0 !important;
  padding: 1.5em 1em;
  box-sizing: border-box;
  margin: 2em 0;
}

/* === ERROR === */
.acf-section-error {
  background: #fee;
  border: 1px solid #c00;
  padding: 1rem;
  color: #a00;
  font-weight: bold;
  border-radius: 5px;
}

/* === MOBILE & Tablet OVERRIDES === */
@media screen and (max-width: 1024px) {
  .rrx-sidebar {
    display: none !important;
  }
}

/* === IMG–TEXT (desktop-first) === */
/* === IMG–TEXT (flex; ACF widths; mirrored L/R on mobile; vertical centering) ===
   Vars set inline on .image-text-layout from PHP:
     --img-col, --img-col-ph, --gap, --txt, --fs, --fs-ph
*/
.single-post-sections .predefined-block.section-img-text .image-text-layout {
  display: flex;
  align-items: center;
  /* vertical centering of the two columns */
  gap: var(--gap, 0);
  height: 100%;
  /* fill the block height set in PHP */
  color: var(--txt, inherit) !important;
}

/* image right mirrors order */
.single-post-sections .predefined-block.section-img-text .image-text-layout.layout-reversed {
  flex-direction: row-reverse;
}

/* image column */
.single-post-sections .predefined-block.section-img-text .image-text-layout .image-column {
  flex: 0 0 var(--img-col, 50%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* anchor to outer edge */
  min-width: 0;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout.layout-reversed .image-column {
  justify-content: flex-end;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .image-column img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* text column */
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* vertical centering inside text column */
  align-items: flex-start;
  /* keep left edge */
  line-height: 1.45;
  font-size: var(--fs, inherit) !important;
  color: var(--txt, inherit) !important;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column>*:first-child {
  margin-top: 0 !important;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column>*:last-child {
  margin-bottom: 0 !important;
}

/* force ACF color on common text */
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h1,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h2,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h3,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h4,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h5,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column h6,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column p,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column ul,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column ol,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column li,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column a,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column span,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column strong,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column em,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column blockquote,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column figure,
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column figcaption {
  color: var(--txt, inherit) !important;
}

/* ===== mobile ===== */
@media (max-width: 768px) {
  .single-post-sections .predefined-block.section-img-text .image-text-layout {
    gap: var(--gap, 1rem);
  }

  .single-post-sections .predefined-block.section-img-text .image-text-layout .image-column {
    flex-basis: var(--img-col-ph, 40%);
  }

  .single-post-sections .predefined-block.section-img-text .image-text-layout .text-column {
    line-height: 1.6;
    text-align: left;
    font-size: var(--fs-ph, var(--fs, inherit)) !important;
  }
}

/* ===========================================================
   Utilities for authoring (IMG–TEXT)
   =========================================================== */
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .center-text {
  text-align: center;
  width: 100%;
  /* ensures centering spans the full column */
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column [class^="fs-"],
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column [class*=" fs-"] {
  font-size: calc(var(--fs, 1rem) * var(--fs-mult, 1)) !important;
  line-height: 1.15;
}

@media (max-width: 768px) {

  .single-post-sections .predefined-block.section-img-text .image-text-layout .text-column [class^="fs-"],
  .single-post-sections .predefined-block.section-img-text .image-text-layout .text-column [class*=" fs-"] {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * var(--fs-mult, 1)) !important;
  }
}

/* multipliers */
.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-90 {
  --fs-mult: .90;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-100 {
  --fs-mult: 1;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-110 {
  --fs-mult: 1.10;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-120 {
  --fs-mult: 1.20;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-140 {
  --fs-mult: 1.40;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-160 {
  --fs-mult: 1.60;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-180 {
  --fs-mult: 1.80;
}

.single-post-sections .predefined-block.section-img-text .image-text-layout .text-column .fs-200 {
  --fs-mult: 2.00;
}

/* ===== WISDOM: universal (desktop first) ===== */
.predefined-block.section-wisdom .wisdom-content {
  display: grid;
  grid-template-columns: var(--logo-col, clamp(110px, 12vw, 180px)) 1fr;
  gap: var(--gap, 30px);
}

.predefined-block.section-wisdom .wisdom-logo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.predefined-block.section-wisdom .wisdom-logo {
  max-width: 90%;
  height: auto;
}

.predefined-block.section-wisdom .wisdom-body {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 14px);
}

/* Heading sizing (desktop) driven by ACF --fs + optional class multipliers */
.predefined-block.section-wisdom .wisdom-heading {
  margin: 0;
  font-weight: 800;
  line-height: 1.05;
  font-size: calc(var(--fs, 1rem) * var(--fs-hd-mult, 1)) !important;
}

/* ===== WISDOM: mobile layout (works for override and regular) ===== */
@media (max-width: 768px) {
  .predefined-block.section-wisdom .wisdom-layout {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .predefined-block.section-wisdom .wisdom-content {
    display: grid;
    grid-template-columns: var(--logo-col, clamp(90px, 22vw, 140px)) 1fr !important;
    grid-template-areas:
      "logo heading"
      "text text";
    align-items: start;
    gap: var(--gap-ph, 10px) !important;
    column-gap: var(--gap-ph, 10px) !important;
    row-gap: var(--gap-ph, 10px) !important;
  }

  /* flatten so children (heading/text) become grid items */
  .predefined-block.section-wisdom .wisdom-body {
    display: contents !important;
  }

  .predefined-block.section-wisdom .wisdom-logo-wrap {
    grid-area: logo;
    justify-self: start;
    align-self: start;
  }

  /* Primary rule when the heading has the expected class */
  .predefined-block.section-wisdom .wisdom-heading {
    grid-area: heading;
    margin: 0;
    font-weight: 800;
    line-height: 1.15;
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * var(--fs-hm-mult, var(--fs-hd-mult, 1))) !important;
    max-width: 100%;
  }

  /* Fallback: if author missed the class, treat the first h1–h6 in the body as the heading */
  .predefined-block.section-wisdom .wisdom-body> :is(h1, h2, h3, h4, h5, h6):not(.wisdom-heading) {
    grid-area: heading;
    margin: 0;
    font-weight: 800;
    line-height: 1.15;
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * var(--fs-hm-mult, var(--fs-hd-mult, 1))) !important;
    max-width: 100%;
  }

  /* Text block spans both columns */
  .predefined-block.section-wisdom .wisdom-text {
    grid-area: text;
    margin: 0;
    max-width: none;
    line-height: 1.6;
  }

  /* Fallback: if content came in as raw tags (no .wisdom-text wrapper), put everything
     that is NOT the heading into the text area so it spans both columns */
  .predefined-block.section-wisdom .wisdom-body> :not(:is(h1, h2, h3, h4, h5, h6)) {
    grid-area: text;
  }

  /* Optional: smaller logo on tight screens */
  .predefined-block.section-wisdom .wisdom-logo {
    width: 60px;
    height: auto;
    display: block;
  }
}

/* Optional heading multipliers */
.predefined-block.section-wisdom .wisdom-heading.fs-d-90 {
  --fs-hd-mult: .90;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-100 {
  --fs-hd-mult: 1;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-120 {
  --fs-hd-mult: 1.20;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-140 {
  --fs-hd-mult: 1.40;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-160 {
  --fs-hd-mult: 1.60;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-180 {
  --fs-hd-mult: 1.80;
}

.predefined-block.section-wisdom .wisdom-heading.fs-d-200 {
  --fs-hd-mult: 2.00;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-90 {
  --fs-hm-mult: .90;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-100 {
  --fs-hm-mult: 1;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-120 {
  --fs-hm-mult: 1.20;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-140 {
  --fs-hm-mult: 1.40;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-160 {
  --fs-hm-mult: 1.60;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-180 {
  --fs-hm-mult: 1.80;
}

.predefined-block.section-wisdom .wisdom-heading.fs-m-200 {
  --fs-hm-mult: 2.00;
}

/* ===========================================================
   APPS — Consolidated (kept at the bottom for easy updates)
   =========================================================== */

/* Base layout */
.apps-layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.apps-layout .apps-headline {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.apps-layout .apps-logos {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.apps-layout .app-logo {
  height: auto;
  max-width: 100%;
  display: inline-block;
  max-height: 60px;
}

/* Single-post Apps form */
.single-post-sections .rrx-apps-text {
  text-align: center;
  margin: 0 0 1rem;
}

.single-post-sections .info-card-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.single-post-sections .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.single-post-sections .info-card-form input[type="email"] {
  padding: 14px 16px;
  font-size: 1.05rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
  width: 460px;
  max-width: 92vw;
  box-sizing: border-box;
}

.single-post-sections .info-card-form .info-card-submit {
  margin-top: 6px;
}

/* Phone overrides (Apps) */
@media (max-width: 768px) {
  .single-post-sections .info-card-form input[type="email"] {
    font-size: 1rem;
    width: 100%;
  }

  .predefined-block.section-apps {
    height: auto !important;
    border-radius: 8px;
    overflow: hidden;
    padding: 1.2rem!important;
  }

  .predefined-block.section-apps .apps-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 8px 0 14px !important;
    /* tight inner padding */
  }

  .predefined-block.section-apps .apps-headline {
    width: 100%;
    max-width: none;
    margin: 4px 0 12px !important;
    /* reduced spacing */
    line-height: 1.15;
    font-weight: 800;
    font-size: clamp(24px, 7vw, 34px);
  }

  .predefined-block.section-apps .apps-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px !important;
    /* consistent compact gap */
    margin: 0 !important;
  }

  .predefined-block.section-apps .apps-logos .app-logo {
    width: clamp(160px, 72vw, 300px) !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

/* ===== Universal helpers (scoped to single post sections) ===== */
.single-post .single-post-sections .u-center-text {
  text-align: center !important;
}

/* Desktop multipliers — scale base var(--fs); default 1rem if unset */
.single-post .single-post-sections .u-fs-90 {
  font-size: calc(var(--fs, 1rem) * .90) !important;
}

.single-post .single-post-sections .u-fs-100 {
  font-size: calc(var(--fs, 1rem) * 1.00) !important;
}

.single-post .single-post-sections .u-fs-110 {
  font-size: calc(var(--fs, 1rem) * 1.10) !important;
}

.single-post .single-post-sections .u-fs-120 {
  font-size: calc(var(--fs, 1rem) * 1.20) !important;
}

.single-post .single-post-sections .u-fs-140 {
  font-size: calc(var(--fs, 1rem) * 1.40) !important;
}

.single-post .single-post-sections .u-fs-160 {
  font-size: calc(var(--fs, 1rem) * 1.60) !important;
}

.single-post .single-post-sections .u-fs-180 {
  font-size: calc(var(--fs, 1rem) * 1.80) !important;
}

.single-post .single-post-sections .u-fs-200 {
  font-size: calc(var(--fs, 1rem) * 2.00) !important;
}

/* Phone multipliers — scale var(--fs-ph), fallback to var(--fs) then 1rem */
@media (max-width: 768px) {
  .single-post .single-post-sections .u-fs-m-90 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * .90) !important;
  }

  .single-post .single-post-sections .u-fs-m-100 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.00) !important;
  }

  .single-post .single-post-sections .u-fs-m-110 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.10) !important;
  }

  .single-post .single-post-sections .u-fs-m-120 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.20) !important;
  }

  .single-post .single-post-sections .u-fs-m-140 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.40) !important;
  }

  .single-post .single-post-sections .u-fs-m-160 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.60) !important;
  }

  .single-post .single-post-sections .u-fs-m-180 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 1.80) !important;
  }

  .single-post .single-post-sections .u-fs-m-200 {
    font-size: calc(var(--fs-ph, var(--fs, 1rem)) * 2.00) !important;
  }
}