/* =========================================================
   ALMARA Partner Platform Legal Pages — v2.1
   Fix: e-con-full override + template-widget nesting

   DOM reality (from DevTools):
   .e-con-boxed > .e-con-inner
     .elementor-widget-template
       .elementor-widget-container
         .elementor-template
           .e-con-full.e-flex.e-con.e-parent
             #almara-partner-legal-agb          ← our container ID
               .e-con-inner
                 #almara-partner-legal-agb-content  ← our widget ID
                   .elementor-widget-container
                     h1, h2, p, ul ...

   Strategy v2.1:
   - Width constraint moves to #content-widget > .elementor-widget-container
     (outside e-con-full jurisdiction)
   - Container gets padding only (no width/max-width — e-con-full wins that fight)
   - Typography targets remain on #-content selectors (unchanged, those work)
   - H1 font-size: explicit !important wins over theme 88px
   ========================================================= */

:root {
  --alm-legal-max-width: 820px;
  --alm-legal-gutter: 32px;
  --alm-legal-pad-v: clamp(72px, 8vw, 120px);
}

/* ---------------------------------------------------------
   1. OUTER WRAPPER — kill e-con-boxed padding on template widget
      so our container controls all spacing
   --------------------------------------------------------- */

.elementor-widget-template:has(#almara-partner-legal-impressum),
.elementor-widget-template:has(#almara-partner-legal-datenschutz),
.elementor-widget-template:has(#almara-partner-legal-agb),
.elementor-widget-template:has(#almara-partner-legal-agb-spot),
.elementor-widget-template:has(#almara-partner-legal-agb-lizenz),
.elementor-widget-template:has(#almara-partner-legal-agb-affiliate),
.elementor-widget-template:has(#almara-partner-legal-cookies),
.elementor-widget-template:has(#almara-partner-legal-sicherheit) {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.elementor-widget-template:has(#almara-partner-legal-impressum) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-datenschutz) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-agb) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-agb-spot) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-agb-lizenz) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-agb-affiliate) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-cookies) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-sicherheit) .elementor-widget-container,
.elementor-widget-template:has(#almara-partner-legal-impressum) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-datenschutz) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-agb) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-agb-spot) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-agb-lizenz) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-agb-affiliate) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-cookies) .elementor-template,
.elementor-widget-template:has(#almara-partner-legal-sicherheit) .elementor-template {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------------------------------------------------------
   2. OUR CONTAINER — padding only, no width fight with e-con-full
      e-con-full always wins width; we own vertical spacing
   --------------------------------------------------------- */

#almara-partner-legal-impressum,
#almara-partner-legal-datenschutz,
#almara-partner-legal-agb,
#almara-partner-legal-agb-spot,
#almara-partner-legal-agb-lizenz,
#almara-partner-legal-agb-affiliate,
#almara-partner-legal-cookies,
#almara-partner-legal-sicherheit {
  padding-top: var(--alm-legal-pad-v) !important;
  padding-bottom: var(--alm-legal-pad-v) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#almara-partner-legal-impressum > .e-con-inner,
#almara-partner-legal-datenschutz > .e-con-inner,
#almara-partner-legal-agb > .e-con-inner,
#almara-partner-legal-agb-spot > .e-con-inner,
#almara-partner-legal-agb-lizenz > .e-con-inner,
#almara-partner-legal-agb-affiliate > .e-con-inner,
#almara-partner-legal-cookies > .e-con-inner,
#almara-partner-legal-sicherheit > .e-con-inner {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ---------------------------------------------------------
   3. CONTENT WIDGET — this is where we constrain the column width
      #-content > .elementor-widget-container is outside e-con-full
      and can safely carry max-width + auto margins
   --------------------------------------------------------- */

#almara-partner-legal-impressum-content > .elementor-widget-container,
#almara-partner-legal-datenschutz-content > .elementor-widget-container,
#almara-partner-legal-agb-content > .elementor-widget-container,
#almara-partner-legal-agb-spot-content > .elementor-widget-container,
#almara-partner-legal-agb-lizenz-content > .elementor-widget-container,
#almara-partner-legal-agb-affiliate-content > .elementor-widget-container,
#almara-partner-legal-cookies-content > .elementor-widget-container,
#almara-partner-legal-sicherheit-content > .elementor-widget-container {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: var(--alm-legal-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--alm-legal-gutter) !important;
  padding-right: var(--alm-legal-gutter) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Widget outer wrapper — no extra margin/padding */
#almara-partner-legal-impressum-content,
#almara-partner-legal-datenschutz-content,
#almara-partner-legal-agb-content,
#almara-partner-legal-agb-spot-content,
#almara-partner-legal-agb-lizenz-content,
#almara-partner-legal-agb-affiliate-content,
#almara-partner-legal-cookies-content,
#almara-partner-legal-sicherheit-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ---------------------------------------------------------
   4. TYPOGRAPHY — all inside #-content > .elementor-widget-container
      !important needed throughout to beat theme (88px h1 etc.)
   --------------------------------------------------------- */

/* H1 */
#almara-partner-legal-impressum-content h1,
#almara-partner-legal-datenschutz-content h1,
#almara-partner-legal-agb-content h1,
#almara-partner-legal-agb-spot-content h1,
#almara-partner-legal-agb-lizenz-content h1,
#almara-partner-legal-agb-affiliate-content h1,
#almara-partner-legal-cookies-content h1,
#almara-partner-legal-sicherheit-content h1 {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem) !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
  color: inherit !important;
  margin: 0 0 clamp(32px, 4vw, 52px) 0 !important;
  padding: 0 !important;
  text-wrap: balance;
}

/* H2 */
#almara-partner-legal-impressum-content h2,
#almara-partner-legal-datenschutz-content h2,
#almara-partner-legal-agb-content h2,
#almara-partner-legal-agb-spot-content h2,
#almara-partner-legal-agb-lizenz-content h2,
#almara-partner-legal-agb-affiliate-content h2,
#almara-partner-legal-cookies-content h2,
#almara-partner-legal-sicherheit-content h2 {
  font-family: inherit !important;
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  color: inherit !important;
  margin: clamp(28px, 3.5vw, 42px) 0 clamp(10px, 1vw, 14px) 0 !important;
  padding: 0 !important;
}

/* H3 */
#almara-partner-legal-impressum-content h3,
#almara-partner-legal-datenschutz-content h3,
#almara-partner-legal-agb-content h3,
#almara-partner-legal-agb-spot-content h3,
#almara-partner-legal-agb-lizenz-content h3,
#almara-partner-legal-agb-affiliate-content h3,
#almara-partner-legal-cookies-content h3,
#almara-partner-legal-sicherheit-content h3 {
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: inherit !important;
  margin: clamp(18px, 2vw, 26px) 0 8px 0 !important;
  padding: 0 !important;
}

/* Paragraphs */
#almara-partner-legal-impressum-content p,
#almara-partner-legal-datenschutz-content p,
#almara-partner-legal-agb-content p,
#almara-partner-legal-agb-spot-content p,
#almara-partner-legal-agb-lizenz-content p,
#almara-partner-legal-agb-affiliate-content p,
#almara-partner-legal-cookies-content p,
#almara-partner-legal-sicherheit-content p {
  font-size: 1rem !important;
  line-height: 1.65 !important;
  margin: 0 0 clamp(12px, 1.2vw, 16px) 0 !important;
  padding: 0 !important;
}

#almara-partner-legal-impressum-content p:last-child,
#almara-partner-legal-datenschutz-content p:last-child,
#almara-partner-legal-agb-content p:last-child,
#almara-partner-legal-agb-spot-content p:last-child,
#almara-partner-legal-agb-lizenz-content p:last-child,
#almara-partner-legal-agb-affiliate-content p:last-child,
#almara-partner-legal-cookies-content p:last-child,
#almara-partner-legal-sicherheit-content p:last-child {
  margin-bottom: 0 !important;
}

/* Lists */
#almara-partner-legal-impressum-content ul,
#almara-partner-legal-impressum-content ol,
#almara-partner-legal-datenschutz-content ul,
#almara-partner-legal-datenschutz-content ol,
#almara-partner-legal-agb-content ul,
#almara-partner-legal-agb-content ol,
#almara-partner-legal-agb-spot-content ul,
#almara-partner-legal-agb-spot-content ol,
#almara-partner-legal-agb-lizenz-content ul,
#almara-partner-legal-agb-lizenz-content ol,
#almara-partner-legal-agb-affiliate-content ul,
#almara-partner-legal-agb-affiliate-content ol,
#almara-partner-legal-cookies-content ul,
#almara-partner-legal-cookies-content ol,
#almara-partner-legal-sicherheit-content ul,
#almara-partner-legal-sicherheit-content ol {
  font-size: 1rem !important;
  line-height: 1.65 !important;
  margin: 0 0 clamp(12px, 1.2vw, 16px) 0 !important;
  padding-left: 1.4em !important;
}

#almara-partner-legal-impressum-content li,
#almara-partner-legal-datenschutz-content li,
#almara-partner-legal-agb-content li,
#almara-partner-legal-agb-spot-content li,
#almara-partner-legal-agb-lizenz-content li,
#almara-partner-legal-agb-affiliate-content li,
#almara-partner-legal-cookies-content li,
#almara-partner-legal-sicherheit-content li {
  margin-bottom: 6px !important;
}

/* Strong — definitions in AGB § 2 */
#almara-partner-legal-agb-content strong,
#almara-partner-legal-agb-spot-content strong,
#almara-partner-legal-agb-lizenz-content strong,
#almara-partner-legal-agb-affiliate-content strong {
  font-weight: 600 !important;
}

/* Links */
#almara-partner-legal-impressum-content a,
#almara-partner-legal-datenschutz-content a,
#almara-partner-legal-agb-content a,
#almara-partner-legal-agb-spot-content a,
#almara-partner-legal-agb-lizenz-content a,
#almara-partner-legal-agb-affiliate-content a,
#almara-partner-legal-cookies-content a,
#almara-partner-legal-sicherheit-content a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  text-decoration-thickness: 1px !important;
  word-break: break-word !important;
}

/* =========================================================
   Tablet — ≤1024px
   ========================================================= */

@media (max-width: 1024px) {
  #almara-partner-legal-impressum,
  #almara-partner-legal-datenschutz,
  #almara-partner-legal-agb,
  #almara-partner-legal-agb-spot,
  #almara-partner-legal-agb-lizenz,
  #almara-partner-legal-agb-affiliate,
  #almara-partner-legal-cookies,
  #almara-partner-legal-sicherheit {
    padding-top: clamp(52px, 7vw, 80px) !important;
    padding-bottom: clamp(56px, 7vw, 90px) !important;
  }

  #almara-partner-legal-impressum-content h1,
  #almara-partner-legal-datenschutz-content h1,
  #almara-partner-legal-agb-content h1,
  #almara-partner-legal-agb-spot-content h1,
  #almara-partner-legal-agb-lizenz-content h1,
  #almara-partner-legal-agb-affiliate-content h1,
  #almara-partner-legal-cookies-content h1,
  #almara-partner-legal-sicherheit-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem) !important;
  }
}

/* =========================================================
   Mobile — ≤640px
   ========================================================= */

@media (max-width: 640px) {
  :root {
    --alm-legal-gutter: 20px;
  }

  #almara-partner-legal-impressum,
  #almara-partner-legal-datenschutz,
  #almara-partner-legal-agb,
  #almara-partner-legal-agb-spot,
  #almara-partner-legal-agb-lizenz,
  #almara-partner-legal-agb-affiliate,
  #almara-partner-legal-cookies,
  #almara-partner-legal-sicherheit {
    padding-top: 48px !important;
    padding-bottom: 64px !important;
  }

  #almara-partner-legal-impressum-content h1,
  #almara-partner-legal-datenschutz-content h1,
  #almara-partner-legal-agb-content h1,
  #almara-partner-legal-agb-spot-content h1,
  #almara-partner-legal-agb-lizenz-content h1,
  #almara-partner-legal-agb-affiliate-content h1,
  #almara-partner-legal-cookies-content h1,
  #almara-partner-legal-sicherheit-content h1 {
    font-size: 2.1rem !important;
    margin-bottom: 22px !important;
  }

  #almara-partner-legal-impressum-content h2,
  #almara-partner-legal-datenschutz-content h2,
  #almara-partner-legal-agb-content h2,
  #almara-partner-legal-agb-spot-content h2,
  #almara-partner-legal-agb-lizenz-content h2,
  #almara-partner-legal-agb-affiliate-content h2,
  #almara-partner-legal-cookies-content h2,
  #almara-partner-legal-sicherheit-content h2 {
    font-size: 1.0625rem !important;
    margin-top: 24px !important;
  }
}
