/* ══════════════════════════════════════════════════════════════
   design-system.css — Unified Design System for HU Project

   Replaces Automatic.css (ACSS). Single source of truth for:
   - HTML Drafts (via <link>)
   - WordPress/Bricks (via child theme enqueue)

   Bricks provides: flex layout on section/container/block
   This file provides: tokens, typography, spacing, buttons
   ══════════════════════════════════════════════════════════════ */


/* ── 1. COLOR TOKENS ─────────────────────────────────────────
   Usage in Bricks JSON: { "raw": "var(--primary)" }
   ──────────────────────────────────────────────────────────── */
:root {
  /* Primary (Brand) — rgb(120, 0, 110) */
  --primary:             #78006e;
  --primary-hover:       #8f0083;
  --primary-light:       #ffb3f9;
  --primary-dark:        #800075;
  --primary-ultra-light: #ffe6fd;
  --primary-ultra-dark:  #3d0038;
  --primary-trans-10:    rgba(120, 0, 110, 0.1);
  --primary-trans-20:    rgba(120, 0, 110, 0.2);
  --primary-trans-40:    rgba(120, 0, 110, 0.4);
  --primary-trans-60:    rgba(120, 0, 110, 0.6);
  --primary-trans-80:    rgba(120, 0, 110, 0.8);

  /* Accent (Warm/Gold) — rgb(139, 111, 78) */
  --accent:              #8B6F4E;
  --accent-hover:        #decfc3;
  --accent-light:        #e4d8ce;
  --accent-dark:         #523f2d;
  --accent-ultra-light:  #f5f0eb;
  --accent-trans-10:     rgba(139, 111, 78, 0.1);
  --accent-trans-20:     rgba(139, 111, 78, 0.2);
  --accent-trans-40:     rgba(139, 111, 78, 0.4);

  /* Base (Neutral) — rgb(45, 47, 48) */
  --base:                #2d2f30;
  --base-dark:           #3e4042;
  --base-ultra-dark:     #141516;
  --base-medium:         #71767a;
  --base-light:          #d8d9da;
  --base-ultra-light:    #f2f2f3;
  --base-trans-10:       rgba(45, 47, 48, 0.1);
  --base-trans-20:       rgba(45, 47, 48, 0.2);
  --base-trans-40:       rgba(45, 47, 48, 0.4);
  --base-trans-60:       rgba(45, 47, 48, 0.6);
  --base-trans-80:       rgba(45, 47, 48, 0.8);
  --base-ultra-dark-trans-40: rgba(20, 21, 22, 0.55);
  --base-ultra-dark-trans-60: rgba(20, 21, 22, 0.6);
  --base-ultra-dark-trans-80: rgba(20, 21, 22, 0.8);

  /* Neutral (Alias — ACSS-Kompatibilität, finetunen nach Bedarf) */
  --neutral:             var(--base-medium);  /* #71767a */

  /* Semantic */
  --secondary:           #1c1930;
  --tertiary:            #867A5B;
  --white:               #fff;
  --black:               #000;

  /* Text Colors */
  --text-light:          #f2f2f3;
  --text-dark:           #2d2f30;

  /* White/Black Transparency */
  --white-trans-10:      rgba(255, 255, 255, 0.1);
  --white-trans-20:      rgba(255, 255, 255, 0.2);
  --white-trans-40:      rgba(255, 255, 255, 0.4);
  --white-trans-60:      rgba(255, 255, 255, 0.6);
  --white-trans-80:      rgba(255, 255, 255, 0.8);
  --black-trans-10:      rgba(0, 0, 0, 0.1);
  --black-trans-20:      rgba(0, 0, 0, 0.2);
  --black-trans-40:      rgba(0, 0, 0, 0.4);
  --black-trans-60:      rgba(0, 0, 0, 0.6);
  --black-trans-80:      rgba(0, 0, 0, 0.8);

  /* Body */
  --body-bg:             var(--white);
  --body-color:          var(--base);
}


/* ── 2. TYPOGRAPHY TOKENS ────────────────────────────────────
   Heading scale: 1.333 (Perfect Fourth) from 16px base
   Fluid sizing: clamp(min, preferred, max)
   ──────────────────────────────────────────────────────────── */
:root {
  /* Font Families */
  --heading-font-family: "Playfair Display", Georgia, serif;
  --text-font-family:    "Manrope", system-ui, sans-serif;

  /* Heading Sizes (fluid) */
  --h1: clamp(1.944rem, 1.617vw + 1.58rem, 2.961rem);   /* ~31px → ~47px */
  --h2: clamp(1.62rem, 0.956vw + 1.405rem, 2.221rem);    /* ~26px → ~36px */
  --h3: clamp(1.35rem, 0.503vw + 1.237rem, 1.666rem);     /* ~22px → ~27px */
  --h4: clamp(1.125rem, 0.199vw + 1.08rem, 1.25rem);      /* ~18px → ~20px */
  --h5: clamp(0.813rem, 0.199vw + 0.768rem, 0.938rem);    /* ~13px → ~15px */
  --h6: clamp(0.703rem, 0vw + 0.703rem, 0.75rem);         /* ~11px → ~12px */

  /* Heading Style */
  --heading-font-weight:  400;
  --heading-line-height:  calc(4px + 2ex);
  --heading-letter-spacing: -0.01em;

  /* Body/Text */
  --text-base:       1rem;        /* 16px */
  --text-font-weight: 400;
  --text-line-height: 1.65;

  /* Text Size Scale */
  --text-xs: 0.75rem;    /* 12px */
  --text-s:  0.8125rem;  /* 13px */
  --text-m:  1rem;       /* 16px — body default */
  --text-l:  1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
}


/* ── 3. SPACING TOKENS ───────────────────────────────────────
   Scale: 1.5 from ~24px base, fluid with clamp()
   Usage: gap, padding, margin values in Bricks JSON
   ──────────────────────────────────────────────────────────── */
:root {
  /* Content Spacing (for gaps between elements) */
  --space-xs:  clamp(0.844rem, -0.017vw + 0.848rem, 0.833rem);  /* ~13px */
  --space-s:   clamp(1.125rem, 0.198vw + 1.081rem, 1.25rem);     /* ~18px → 20px */
  --space-m:   clamp(1.5rem, 0.596vw + 1.366rem, 1.875rem);       /* ~24px → 30px */
  --space-l:   clamp(2rem, 1.293vw + 1.709rem, 2.813rem);         /* ~32px → 45px */
  --space-xl:  clamp(2.665rem, 2.471vw + 2.109rem, 4.219rem);     /* ~43px → 67px */
  --space-xxl: clamp(3.553rem, 4.414vw + 2.56rem, 6.328rem);      /* ~57px → 101px */

  /* Section Spacing (for section padding-block) */
  --section-space-xs: clamp(1.688rem, 1.291vw + 1.398rem, 2.5rem);
  --section-space-s:  clamp(2.251rem, 2.385vw + 1.714rem, 3.75rem);
  --section-space-m:  clamp(3rem, 4.175vw + 2.061rem, 5.625rem);
  --section-space-l:  clamp(4rem, 7.059vw + 2.411rem, 8.438rem);
  --section-space-xl: clamp(5.331rem, 11.651vw + 2.709rem, 12.656rem);

  /* Default Section Padding */
  --section-padding-block: var(--section-space-m);

  /* Gutter (page edge padding) */
  --gutter: clamp(1.25rem, 3.976vw + 0.355rem, 3.75rem);  /* ~20px → 60px */
}


/* ── 4. LAYOUT TOKENS ────────────────────────────────────────
   Content width, gaps for containers and grids
   ──────────────────────────────────────────────────────────── */
:root {
  --content-width:      85.375rem;  /* 1366px */
  --content-width-safe: min(var(--content-width), calc(100% - var(--gutter) * 2));

  --content-gap:   var(--space-m);   /* gap inside blocks */
  --container-gap: var(--space-xl);  /* gap inside containers */
  --grid-gap:      var(--space-m);   /* gap in grids */
}


/* ── 5. BUTTON TOKENS ────────────────────────────────────────
   Button defaults — applied via [class*="btn--"] selector
   ──────────────────────────────────────────────────────────── */
:root {
  --btn-font-size:       var(--text-s);
  --btn-font-weight:     600;
  --btn-line-height:     1;
  --btn-padding-block:   0.75em;
  --btn-padding-inline:  1.5em;
  --btn-border-width:    1px;
  --btn-border-style:    solid;
  --btn-border-radius:   5px;
  --btn-text-transform:  none;
  --btn-letter-spacing:  0.02em;
  --btn-transition:      background 0.3s ease-in-out,
                         color 0.3s ease-in-out,
                         border-color 0.3s ease-in-out;
}


/* ── 6. MISC TOKENS ──────────────────────────────────────────── */
:root {
  --radius:              5px;
  --transition-duration: 0.3s;
  --transition-timing:   ease-in-out;
  --transition:          all var(--transition-duration) var(--transition-timing);
}


/* ══════════════════════════════════════════════════════════════
   ELEMENT DEFAULTS
   These replicate what ACSS applied via tag selectors.
   Bricks already sets flex layout on section/container/block.
   ══════════════════════════════════════════════════════════════ */


/* ── 6b. BRICKS ELEMENT OVERRIDES ────────────────────────────── */
.brxe-code { width: auto; }  /* Bricks default is 100% — breaks inline SVG icons in flex layouts */

/* Slider nested — reset to flex defaults (Bricks forces center) */
.brxe-slider-nested .splide__slide {
  align-items: stretch;
  display: flex;
  justify-content: flex-start;
  position: relative;
}

/* ── 6c. DETAIL SIDEBAR NAV (raw HTML in code element) ───────── */
.hu-detail__sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--base-light);
  border-radius: 8px;
  padding: 8px 0;
  background: var(--white);
}

.hu-detail__spy-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--base-medium);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1.4;
}

.hu-detail__spy-link:hover {
  color: var(--primary);
  background: var(--base-ultra-light);
}

.hu-detail__spy-link.is-active {
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: 17px;
}

.hu-detail__spy-number {
  font-size: 12px;
  font-style: italic;
  color: var(--base-medium);
  min-width: 18px;
}

.hu-detail__sidebar-cta {
  padding: 16px 20px 8px;
  border-top: 1px solid var(--base-light);
  margin-top: 8px;
}

.hu-detail__sidebar-btn {
  display: block;
  text-align: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.hu-detail__sidebar-btn:hover {
  background: var(--primary-hover);
}

/* ── 7. BODY ─────────────────────────────────────────────────── */
html { font-size: 100%; }  /* Override Bricks/Themer --base-font:10 → 1rem = 16px */

body {
  font-family: var(--text-font-family);
  font-size: var(--text-base);
  font-weight: var(--text-font-weight);
  line-height: var(--text-line-height);
  color: var(--body-color);
  background-color: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ── 8. HEADINGS ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font-family);
  font-weight: var(--heading-font-weight);
  line-height: var(--heading-line-height);
  letter-spacing: var(--heading-letter-spacing);
  margin: 0;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); }
h5 { font-size: var(--h5); }
h6 { font-size: var(--h6); }


/* ── 9. TEXT ELEMENTS ────────────────────────────────────────── */
p, li, dd, dt, blockquote {
  margin: 0;
}

a:where(:not([class*="btn--"])) {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-duration) var(--transition-timing);
}

@media (hover: hover) and (pointer: fine) {
  a:where(:not([class*="btn--"])):hover {
    color: var(--primary-hover);
  }
}

/* Heading links inherit */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  font-weight: inherit;
  text-decoration: inherit;
  color: currentcolor;
}


/* ── 10. IMAGES ──────────────────────────────────────────────── */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Bricks image elements — fill their container (like ACSS did) */
.brxe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ── 11. SECTIONS (padding) ──────────────────────────────────── */
/* In Bricks, .brxe-section already has flex-direction: column; align-items: center.
   We only add the spacing that ACSS used to provide. */
.brxe-section {
  padding-block: var(--section-padding-block);
  padding-inline: var(--gutter);
}


/* ── 12. CONTAINERS (max-width) ──────────────────────────────── */
/* Bricks sets .brxe-container width: 1100px. We override to match our content-width. */
.brxe-container {
  width: var(--content-width-safe);
  max-width: 100%;
  gap: var(--container-gap);
}

/* Full-width component sections: override brxe-container width for components
   whose internal root is a container in the DB but should span full width. */
.brxe-container.cta__section,
.brxe-container.trust-bar__section {
  width: 100%;
}

/* CTA component — Bricks Global Classes don't emit these settings reliably */
.cta__overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: var(--base-ultra-dark-trans-80);
}

.cta__heading {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-light);
  text-align: center;
}

.cta__text {
  font-size: 17px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .cta__heading { font-size: 32px; }
}


/* ── 13. BLOCKS (gap) ────────────────────────────────────────── */
.brxe-block {
  gap: var(--content-gap);
}


/* ── 14. BUTTONS ─────────────────────────────────────────────── */
/* Bricks native button default — ensures .brxe-button gets proper sizing
   and primary colors even without a btn--* variant class.
   Existing pages use ACSS Global Class IDs (acss_import_btn--*) which no
   longer provide CSS. This rule makes all Bricks buttons look correct
   immediately. Variant overrides via btn--* or Global Class settings. */
.brxe-button.bricks-button {
  font-family: var(--text-font-family);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  padding-block: var(--btn-padding-block);
  padding-inline: var(--btn-padding-inline);
  border-width: var(--btn-border-width);
  border-style: var(--btn-border-style);
  border-radius: var(--btn-border-radius);
  text-transform: var(--btn-text-transform);
  letter-spacing: var(--btn-letter-spacing);
  text-decoration: none;
  cursor: pointer;
  transition: var(--btn-transition);
  /* Default to primary filled — uses custom props so btn--* variants override */
  background: var(--btn-background, var(--primary));
  color: var(--btn-text-color, var(--white));
  border-color: var(--btn-border-color, var(--primary));
}

@media (hover: hover) and (pointer: fine) {
  .brxe-button.bricks-button:hover {
    background: var(--btn-background-hover, var(--primary-hover));
    color: var(--btn-text-color-hover, var(--white));
    border-color: var(--btn-border-color-hover, var(--primary-hover));
  }
}

[class*="btn--"]:where(:not(.btn--none)) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: var(--btn-background);
  color: var(--btn-text-color);
  padding-block: var(--btn-padding-block);
  padding-inline: var(--btn-padding-inline);
  font-family: var(--text-font-family);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  text-transform: var(--btn-text-transform);
  letter-spacing: var(--btn-letter-spacing);
  border-width: var(--btn-border-width);
  border-style: var(--btn-border-style);
  border-radius: var(--btn-border-radius);
  border-color: var(--btn-border-color);
  text-decoration: none;
  cursor: pointer;
  transition: var(--btn-transition);
}

@media (hover: hover) and (pointer: fine) {
  [class*="btn--"]:where(:not(.btn--none)):hover {
    background: var(--btn-background-hover);
    color: var(--btn-text-color-hover);
    border-color: var(--btn-border-color-hover);
  }
}

/* ── Button Color Variants ─── */

/* Primary (filled) */
.btn--primary {
  --btn-background:       var(--primary);
  --btn-background-hover: var(--primary-hover);
  --btn-text-color:       var(--white);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--primary);
  --btn-border-color-hover: var(--primary-hover);
}

/* Primary Outline */
.btn--primary.btn--outline,
.btn--outline {
  --btn-background:       transparent;
  --btn-background-hover: var(--primary);
  --btn-text-color:       var(--primary);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--primary);
  --btn-border-color-hover: var(--primary);
}

/* Dark (filled) */
.btn--dark {
  --btn-background:       var(--base);
  --btn-background-hover: var(--base-dark);
  --btn-text-color:       var(--white);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--base);
  --btn-border-color-hover: var(--base-dark);
}

/* Light (filled) */
.btn--light {
  --btn-background:       var(--base-ultra-light);
  --btn-background-hover: var(--base-light);
  --btn-text-color:       var(--base);
  --btn-text-color-hover:  var(--base);
  --btn-border-color:      var(--base-ultra-light);
  --btn-border-color-hover: var(--base-light);
}

/* Solid (alias for primary — backwards compat with existing JSON) */
.btn--solid {
  --btn-background:       var(--primary);
  --btn-background-hover: var(--primary-hover);
  --btn-text-color:       var(--white);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--primary);
  --btn-border-color-hover: var(--primary-hover);
}

/* Primary Light */
.btn--primary-light {
  --btn-background:       var(--primary-ultra-light);
  --btn-background-hover: var(--primary-light);
  --btn-text-color:       var(--primary);
  --btn-text-color-hover:  var(--primary-dark);
  --btn-border-color:      var(--primary-ultra-light);
  --btn-border-color-hover: var(--primary-light);
}

/* Secondary (filled) */
.btn--secondary {
  --btn-background:       var(--accent);
  --btn-background-hover: var(--accent-hover);
  --btn-text-color:       var(--white);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--accent);
  --btn-border-color-hover: var(--accent-hover);
}

/* Secondary Outline */
.btn--secondary.btn--outline {
  --btn-background:       transparent;
  --btn-background-hover: var(--accent);
  --btn-text-color:       var(--accent);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--accent);
  --btn-border-color-hover: var(--accent);
}

/* Dark Outline */
.btn--dark.btn--outline {
  --btn-background:       transparent;
  --btn-background-hover: var(--base);
  --btn-text-color:       var(--base);
  --btn-text-color-hover:  var(--white);
  --btn-border-color:      var(--base);
  --btn-border-color-hover: var(--base);
}
