/*
 * Core Hero – frontend styling.
 *
 * Ziel:
 * - Hero-Styling lebt vollständig im Plugin
 * - Farben, Typografie, Radius und Breiten kommen aus Theme-Tokens
 * - auf Mobile bewusst ausgeblendet
 */

.core-hero,
.core-hero * {
  box-sizing: border-box;
}

.core-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: block;
  inline-size: 100vw;
  max-inline-size: 100vw;
  margin-inline: calc(50% - 50vw);
  --core-hero-min-height: 200px;
  --core-hero-max-height: 500px;
  --core-hero-ratio-height: calc(100vw * 4.5 / 16);
  height: clamp(var(--core-hero-min-height), var(--core-hero-ratio-height), var(--core-hero-max-height));
  min-height: var(--core-hero-min-height);
  max-height: var(--core-hero-max-height);
  background: var(--surface-bg, #fcfbf8);
  color: var(--text-color, #233234);
  border-bottom: 1px solid var(--line-color, rgba(35, 50, 52, 0.12));
}

/*
 * Hero-only Seitenrand-Lichtverlauf außerhalb der 1360px-Shell.
 * Der Verlauf ist ausschließlich im Hero sichtbar und läuft zur Content-Grenze transparent aus.
 */
@media (min-width: 1361px) {
  .core-hero .c-hero__slides::before,
  .core-hero .c-hero__slides::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc((100vw - 1360px) / 2);
    pointer-events: none;
    z-index: 3;
  }

  .core-hero .c-hero__slides::before {
    left: 0;
    background:
      radial-gradient(
        circle at left 22%,
        color-mix(in srgb, var(--color-accent-1, var(--cv2-color-light-highlight, #62b8ae)) 24%, transparent),
        transparent 58%
      ),
      linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-button-top, var(--brand-color, var(--cv2-color-light-brand, #2f8b84))) 28%, transparent) 0%,
        transparent 100%
      );
  }

  .core-hero .c-hero__slides::after {
    right: 0;
    background:
      radial-gradient(
        circle at right 22%,
        color-mix(in srgb, var(--color-accent-1, var(--cv2-color-light-highlight, #62b8ae)) 24%, transparent),
        transparent 58%
      ),
      linear-gradient(
        270deg,
        color-mix(in srgb, var(--color-button-top, var(--brand-color, var(--cv2-color-light-brand, #2f8b84))) 28%, transparent) 0%,
        transparent 100%
      );
  }
}

.core-hero .c-hero__slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.core-hero .c-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.035);
  transition: opacity 1.05s ease, transform 7.2s ease;
}

.core-hero .c-hero__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.core-hero::before,
.core-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.core-hero::before {
  z-index: 1;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.24), transparent 28%),
    linear-gradient(90deg,
      rgba(243,243,239,.96) 0%,
      rgba(252,251,248,.92) 26%,
      rgba(252,251,248,.72) 44%,
      rgba(252,251,248,.34) 62%,
      rgba(252,251,248,.10) 78%,
      rgba(252,251,248,0) 100%);
}

html[data-theme="dark"] .core-hero::before {
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(90deg,
      rgba(19,27,29,.94) 0%,
      rgba(19,27,29,.90) 28%,
      rgba(19,27,29,.72) 46%,
      rgba(19,27,29,.38) 62%,
      rgba(19,27,29,.12) 78%,
      rgba(19,27,29,0) 100%);
}

.core-hero::after {
  z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 28%, rgba(0,0,0,.08) 100%);
  mix-blend-mode: soft-light;
}

.core-hero .c-hero__inner {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 2rem), var(--layout-shell, 1360px));
  margin: 0 auto;
  min-height: var(--core-hero-min-height);
  height: 100%;
  max-height: var(--core-hero-max-height);
  display: flex;
  align-items: center;
}

.core-hero .c-hero__copy {
  width: min(100%, 44rem);
  padding: clamp(2.2rem, 4vw, 3.6rem) 0;
  color: var(--text-color, #233234);
}

.core-hero .c-hero__kicker {
  margin: 0 0 1rem;
  color: var(--brand-color, #2f8b84);
  font-family: var(--font-ui, var(--font-body, sans-serif));
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.35;
  text-transform: uppercase;
}

.core-hero .c-hero__copy .wp-block-heading,
.core-hero .c-hero__copy h1,
.core-hero .c-hero__copy h2 {
  margin: 0 0 1.1rem;
  color: var(--text-color, #233234);
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(2.55rem, 5vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
  max-width: 21ch;
}

.core-hero .c-hero__copy > p {
  margin: 0;
  max-width: 34rem;
  color: color-mix(in srgb, var(--text-color, #233234) 82%, transparent);
  font-family: var(--font-body, sans-serif);
  font-size: clamp(1.04rem, 1.4vw, 1.22rem);
  line-height: 1.78;
}

.core-hero .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.65rem;
}

.core-hero .wp-block-button {
  margin: 0;
}

.core-hero .wp-block-button__link,
.core-hero .wp-element-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.125rem;
  padding: .9rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill, 999px);
  background: var(--brand-color, #2f8b84);
  color: var(--button-text, #ffffff);
  box-shadow: var(--shadow-soft, 0 18px 42px rgba(10, 24, 26, 0.10));
  font: 600 .96rem/1 var(--font-ui, var(--font-body, sans-serif));
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}


.core-hero .core-hero__button--secondary .wp-block-button__link {
  background: color-mix(in srgb, var(--color-surface-strong, #fcfbf8) 82%, transparent);
  color: var(--brand-color, #2f8b84);
  border-color: color-mix(in srgb, var(--brand-color, #2f8b84) 34%, transparent);
  box-shadow: 0 14px 32px rgba(10, 24, 26, 0.08);
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .core-hero .core-hero__button--secondary .wp-block-button__link {
  background: color-mix(in srgb, var(--color-surface-strong, #1d2b2f) 68%, transparent);
  color: var(--brand-color, #7abeb6);
  border-color: color-mix(in srgb, var(--brand-color, #7abeb6) 42%, transparent);
}

.core-hero .wp-block-button__link:hover,
.core-hero .wp-block-button__link:focus-visible,
.core-hero .wp-element-button:hover,
.core-hero .wp-element-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong, 0 22px 56px rgba(10, 24, 26, 0.18));
  filter: saturate(1.02);
}

.core-hero .wp-block-button__link:focus-visible,
.core-hero .wp-element-button:focus-visible {
  outline: 3px solid var(--accent-color, #ccb58f);
  outline-offset: 3px;
}

html[data-theme="dark"] .core-hero {
  color: var(--text-color, #edf2f1);
}

html[data-theme="dark"] .core-hero .c-hero__kicker {
  color: var(--brand-color, #7abeb6);
}

html[data-theme="dark"] .core-hero .c-hero__copy .wp-block-heading,
html[data-theme="dark"] .core-hero .c-hero__copy h1,
html[data-theme="dark"] .core-hero .c-hero__copy h2,
html[data-theme="dark"] .core-hero .c-hero__copy > p {
  color: var(--text-color, #edf2f1);
}

@media (prefers-reduced-motion: reduce) {
  .core-hero .c-hero__slide {
    transition: none;
    transform: none;
  }

  .core-hero .wp-block-button__link,
  .core-hero .wp-element-button {
    transition: none;
  }
}

@media (max-width: 860px) {
  .core-hero {
    display: none !important;
  }
}

/* Digital-Kanzlei Textanimation
 * Freie Typografie im rechten Hero-Bereich, ohne Card, Counter oder Slider-UI.
 */
.core-hero.core-hero--has-digital .c-hero__inner {
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.core-hero.core-hero--has-digital .c-hero__copy {
  flex: 0 1 38rem;
}

.core-hero .c-hero__digital,
.core-hero .core-hero-digital {
  position: relative;
  flex: 0 0 min(48vw, 50rem);
  min-height: clamp(14rem, 23vw, 22rem);
  padding: 0;
  margin-left: auto;
  overflow: visible;
  pointer-events: none;
  transform: translateY(50px);
  --core-hero-digital-question-color: #ffffff;
  --core-hero-digital-answer-color: var(--kanzlei-gruen, var(--brand-color, var(--kanzlei-green, #24443d)));
  --core-hero-digital-question-shadow:
    0 2px 0 rgba(0, 0, 0, .75),
    0 8px 22px rgba(0, 0, 0, .45),
    0 0 2px rgba(0, 0, 0, .95);
  --core-hero-digital-answer-shadow: var(--core-hero-digital-question-shadow);
  --core-hero-digital-line-indent: 4.5ch;
}

html[data-theme="dark"] .core-hero .c-hero__digital,
html[data-theme="dark"] .core-hero .core-hero-digital {
  --core-hero-digital-question-color: #ffffff;
  --core-hero-digital-answer-color: var(--kanzlei-gruen, var(--brand-color, var(--kanzlei-green, #24443d)));
}

html[data-theme="light"] .core-hero .c-hero__digital,
html[data-theme="light"] .core-hero .core-hero-digital,
html:not([data-theme]) .core-hero .c-hero__digital,
html:not([data-theme]) .core-hero .core-hero-digital {
  --core-hero-digital-question-color: #ffffff;
  --core-hero-digital-answer-color: var(--kanzlei-gruen, var(--brand-color, var(--kanzlei-green, #24443d)));
}

.core-hero .c-hero__digital-question,
.core-hero .core-hero-digital__question {
  max-width: min(50rem, 100%);
  margin: 0;
  color: var(--core-hero-digital-question-color);
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(31.5px, 3.15vw, 58.5px);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
  opacity: 0;
  filter: blur(.16rem);
  transform: translateX(120px);
  transition:
    opacity 1200ms ease,
    transform 1200ms cubic-bezier(.22, 1, .36, 1),
    filter 1200ms ease;
  text-shadow: var(--core-hero-digital-question-shadow);
  padding-left: var(--core-hero-digital-line-indent);
  text-indent: calc(var(--core-hero-digital-line-indent) * -1);
}

.core-hero .c-hero__digital-question.is-visible,
.core-hero .core-hero-digital__question.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

.core-hero .c-hero__digital-question.is-leaving,
.core-hero .core-hero-digital__question.is-leaving {
  opacity: 0;
  filter: blur(.16rem);
  transform: translateX(-44px);
  transition:
    opacity 1000ms ease,
    transform 1000ms cubic-bezier(.22, 1, .36, 1),
    filter 1000ms ease;
}

.core-hero .c-hero__digital-stage,
.core-hero .core-hero-digital__answers {
  position: relative;
  min-height: clamp(3.5rem, 7vw, 6.5rem);
  margin-top: clamp(1rem, 1.5vw, 1.35rem);
  margin-left: 44px;
  overflow: visible;
}

.core-hero .c-hero__digital-answer,
.core-hero .core-hero-digital__answer {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: max-content;
  max-width: none;
  margin: 0;
  color: var(--core-hero-digital-answer-color);
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(33px, 3.75vw, 69px);
  line-height: 1;
  letter-spacing: -.04em;
  white-space: nowrap;
  opacity: 0;
  filter: blur(.18rem);
  transform: translateX(-120px);
  transition:
    opacity 1200ms ease,
    transform 1200ms cubic-bezier(.22, 1, .36, 1),
    filter 1200ms ease;
  text-shadow: var(--core-hero-digital-answer-shadow);
  padding-left: var(--core-hero-digital-line-indent);
  text-indent: calc(var(--core-hero-digital-line-indent) * -1);
}

.core-hero .c-hero__digital-answer.is-active,
.core-hero .core-hero-digital__answer.is-active {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

.core-hero .c-hero__digital-answer.is-leaving,
.core-hero .core-hero-digital__answer.is-leaving {
  opacity: 0;
  filter: blur(.18rem);
  transform: translateX(54px);
  transition:
    opacity 900ms ease,
    transform 900ms cubic-bezier(.22, 1, .36, 1),
    filter 900ms ease;
}

@media (max-width: 1240px) {
  .core-hero .c-hero__digital,
  .core-hero .core-hero-digital {
    flex-basis: min(46vw, 40rem);
  }

  .core-hero .c-hero__digital-question,
  .core-hero .core-hero-digital__question {
    font-size: clamp(25.5px, 3vw, 43.5px);
  }

  .core-hero .c-hero__digital-answer,
  .core-hero .core-hero-digital__answer {
    font-size: clamp(28.5px, 3.45vw, 51px);
  }
}

@media (max-width: 1120px) {
  .core-hero.core-hero--has-digital .c-hero__copy .wp-block-heading,
  .core-hero.core-hero--has-digital .c-hero__copy h1,
  .core-hero.core-hero--has-digital .c-hero__copy h2 {
    font-size: clamp(2.25rem, 4.4vw, 3.15rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .core-hero .c-hero__digital,
  .core-hero .core-hero-digital {
    transform: translateY(50px);
  }

  .core-hero .c-hero__digital-question,
  .core-hero .core-hero-digital__question,
  .core-hero .c-hero__digital-answer,
  .core-hero .core-hero-digital__answer {
    animation: none;
    transition: none;
    transform: none;
    filter: none;
  }

  .core-hero .c-hero__digital-question.is-visible,
  .core-hero .core-hero-digital__question.is-visible,
  .core-hero .c-hero__digital-answer.is-active,
  .core-hero .core-hero-digital__answer.is-active {
    opacity: 1;
  }
}
