/*
Theme Name: Kerstin Keller
Theme URI: https://kk-horsemanship.com
Author: NE Design
Description: Block-Theme-Boilerplate für Kerstin Keller. Basis: Brand Style Guide (Midnight Plum, Bloom Pink, Soft Lilac, Mint Glow · Playfair Display + Jost · weiches Licht mit feinem Korn).
Version: 0.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kerstin-keller
Tags: block-theme, full-site-editing, custom-colors, custom-logo, wide-blocks, translation-ready
*/

/* =====================================================================
   0. Tokens (alles was nicht in theme.json passt)
   Farben liegen in theme.json als --wp--preset--color--kk-*
   ===================================================================== */
:root {
  --kk-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='2' stitchTiles='stitch' result='t'/%3E%3CfeColorMatrix in='t' type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='1.6' intercept='-.2'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --kk-noise-opacity: 0.1;
  --kk-glow-blur: 50px;
  --kk-eyebrow-color: var(--wp--preset--color--kk-bloom-deep);
  --kk-link-hover: var(--wp--preset--color--kk-bloom-deep);
  --kk-muted: #6b6478;
}

@media (min-width: 782px) {
  :root {
    --kk-glow-blur: 70px;
  }
}

/* Auf dunklen Flächen ändern sich Akzent-, Link- und Label-Farbe */
:is(
  .has-kk-midnight-plum-background-color,
  .has-kk-shadow-background-color,
  .kk-dark,
  .kk-hero,
  .is-style-kk-glow-bloom,
  .is-style-kk-glow-lilac,
  .is-style-kk-glow-light,
  .is-style-kk-glow-mint,
  .kk-card--featured
) {
  --kk-eyebrow-color: var(--wp--preset--color--kk-bloom-pink);
  --kk-link-hover: var(--wp--preset--color--kk-blush);
  --kk-muted: var(--wp--preset--color--kk-soft-lilac);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Sektionen sitzen bündig übereinander, Abstände regeln die Sektionen selbst */
.wp-site-blocks > * {
  margin-block-start: 0;
}

a:where(:not(.wp-element-button)) {
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:where(:not(.wp-element-button)):hover {
  color: var(--kk-link-hover);
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--wp--preset--color--kk-bloom-pink);
  outline-offset: 3px;
}

/* =====================================================================
   1. Eyebrow, Zitat-Akzent, Label/Wert, Trenner
   ===================================================================== */
.is-style-kk-eyebrow {
  font-family: var(--wp--preset--font-family--kk-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--kk-eyebrow-color);
  text-decoration: underline;
  text-decoration-color: color-mix(
    in srgb,
    var(--kk-eyebrow-color) 50%,
    transparent
  );
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.is-style-kk-quote {
  font-family: var(--wp--preset--font-family--kk-serif);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
}

.is-style-kk-quote em {
  color: var(--wp--preset--color--kk-bloom-pink);
}

.kk-fact {
  margin: 0;
}

.kk-fact__label {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--kk-muted);
}

.kk-fact__value {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.wp-block-separator.is-style-kk-fade {
  height: 1px;
  max-width: none;
  border: 0;
  opacity: 1;
  background: linear-gradient(
    90deg,
    var(--wp--preset--color--kk-bloom-pink),
    transparent 70%
  );
}

.wp-block-separator.is-style-kk-short {
  width: 64px;
  max-width: 64px;
  height: 1px;
  border: 0;
  opacity: 1;
  background: var(--wp--preset--color--kk-bloom-pink);
}

/* =====================================================================
   2. Buttons (Basis = Solid, in theme.json)
   ===================================================================== */
.wp-element-button,
.wp-block-button__link {
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.wp-block-button:not(.is-style-kk-pill):not(.is-style-kk-outline)
  .wp-block-button__link:hover,
.wp-element-button:hover {
  transform: translateY(-2px);
}

.wp-block-button:not(.is-style-kk-pill):not(.is-style-kk-outline)
  .wp-block-button__link:hover {
  box-shadow: 0 10px 24px rgba(250, 110, 174, 0.4);
}

.wp-block-button.is-style-kk-pill .wp-block-button__link {
  background: var(--wp--preset--color--kk-mist);
  color: var(--wp--preset--color--kk-midnight-plum);
  border-radius: 999px;
}

.wp-block-button.is-style-kk-pill .wp-block-button__link:hover {
  background: var(--wp--preset--color--kk-blush);
  color: var(--wp--preset--color--kk-midnight-plum);
  transform: translateY(-2px);
}

.wp-block-button.is-style-kk-outline .wp-block-button__link {
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
}

.wp-block-button.is-style-kk-outline .wp-block-button__link:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
  border-color: currentColor;
  color: inherit;
  transform: translateY(-2px);
}

/* =====================================================================
   3. Glow-Flächen: weiche Lichtkreise + Korn (Rezept aus dem Style Guide)
   Block-Stile für core/group: Glow · Pink / Lilac / Zentrallicht / Mint
   ===================================================================== */
:is(
  .is-style-kk-glow-bloom,
  .is-style-kk-glow-lilac,
  .is-style-kk-glow-light,
  .is-style-kk-glow-mint,
  .kk-card--featured
) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--wp--preset--color--kk-midnight-plum);
  color: var(--wp--preset--color--kk-mist);
}

:is(
  .is-style-kk-glow-bloom,
  .is-style-kk-glow-lilac,
  .is-style-kk-glow-light,
  .is-style-kk-glow-mint,
  .kk-card--featured
)::before {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: -1;
  filter: blur(var(--kk-glow-blur));
  opacity: var(--kk-glow-opacity, 1);
  pointer-events: none;
}

:is(
  .is-style-kk-glow-bloom,
  .is-style-kk-glow-lilac,
  .is-style-kk-glow-light,
  .is-style-kk-glow-mint,
  .kk-card--featured
)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--kk-noise);
  background-size: 220px 220px;
  opacity: var(--kk-noise-opacity);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.is-style-kk-glow-bloom::before,
.kk-card--featured::before {
  background:
    radial-gradient(
      circle at 72% 40%,
      #fa6eae 0%,
      rgba(250, 110, 174, 0.55) 22%,
      transparent 55%
    ),
    radial-gradient(
      circle at 34% 58%,
      rgba(143, 227, 201, 0.4) 0%,
      transparent 34%
    ),
    radial-gradient(
      circle at 30% 65%,
      #dcccf2 0%,
      rgba(220, 204, 242, 0.35) 20%,
      transparent 50%
    ),
    radial-gradient(circle at 50% 15%, #0a0316 0%, transparent 60%);
}

.is-style-kk-glow-light::before {
  background:
    radial-gradient(
      circle at 20% 30%,
      #f8f6fb 0%,
      rgba(248, 246, 251, 0.6) 18%,
      transparent 48%
    ),
    radial-gradient(
      circle at 78% 75%,
      #fa6eae 0%,
      rgba(250, 110, 174, 0.5) 24%,
      transparent 55%
    );
}

.is-style-kk-glow-lilac::before {
  background:
    radial-gradient(
      circle at 50% 45%,
      #dcccf2 0%,
      rgba(220, 204, 242, 0.5) 20%,
      transparent 50%
    ),
    radial-gradient(
      circle at 85% 20%,
      #fa6eae 0%,
      rgba(250, 110, 174, 0.4) 18%,
      transparent 50%
    );
}

.is-style-kk-glow-mint::before {
  background:
    radial-gradient(
      circle at 60% 35%,
      #8fe3c9 0%,
      rgba(143, 227, 201, 0.5) 22%,
      transparent 55%
    ),
    radial-gradient(
      circle at 20% 75%,
      #fa6eae 0%,
      rgba(250, 110, 174, 0.3) 18%,
      transparent 48%
    );
}

/* =====================================================================
   4. Hero mit bewegtem Licht „hinter Glas“
   Reines CSS. Aufbau: .kk-hero > .kk-hero__lights (3 Lichter + Glas + Korn)
   ===================================================================== */
.kk-hero {
  --kk-size: 120vw;
  --kk-x: 24vw;
  --kk-y: 9vh;
  --kk-blur: 40px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(100svh, 62rem);
  background:
    radial-gradient(
      ellipse at 50% 0%,
      var(--wp--preset--color--kk-shadow) 0%,
      transparent 62%
    ),
    var(--wp--preset--color--kk-midnight-plum);
  color: var(--wp--preset--color--kk-mist);
  text-align: center;
}

@media (min-width: 782px) {
  .kk-hero {
    --kk-size: min(72vw, 60rem);
    --kk-x: 27vw;
    --kk-y: 11vh;
    --kk-blur: 70px;
    text-align: left;
  }
}

.kk-hero > * {
  margin-block: 0;
}

.kk-hero__lights {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.kk-light {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--kk-size);
  height: var(--kk-size);
  border-radius: 50%;
  filter: blur(var(--kk-blur));
  will-change: transform, opacity;
}

.kk-light--bloom {
  background: radial-gradient(
    circle,
    #fa6eae 0%,
    rgba(250, 110, 174, 0.55) 28%,
    transparent 62%
  );
  transform: translate(calc(-50% + var(--kk-x)), calc(-50% - var(--kk-y)));
  animation: kk-drift 38s ease-in-out infinite;
}

.kk-light--lilac {
  width: calc(var(--kk-size) * 0.85);
  height: calc(var(--kk-size) * 0.85);
  background: radial-gradient(
    circle,
    #dcccf2 0%,
    rgba(220, 204, 242, 0.38) 26%,
    transparent 60%
  );
  transform: translate(calc(-50% - var(--kk-x)), calc(-50% + var(--kk-y)));
  animation: kk-drift 38s ease-in-out -19s infinite;
  opacity: 0.8;
}

.kk-light--mint {
  width: calc(var(--kk-size) * 0.4);
  height: calc(var(--kk-size) * 0.4);
  background: radial-gradient(
    circle,
    rgba(143, 227, 201, 0.55) 0%,
    rgba(143, 227, 201, 0.15) 40%,
    transparent 65%
  );
  transform: translate(
    calc(-50% - var(--kk-x) * 0.3),
    calc(-50% + var(--kk-y) * 1.5)
  );
  animation: kk-mint 52s ease-in-out infinite alternate;
}

/* Das Licht wandert: rechts → taucht ab → links wieder auf → taucht ab → rechts */
@keyframes kk-drift {
  0%,
  100% {
    transform: translate(calc(-50% + var(--kk-x)), calc(-50% - var(--kk-y)))
      scale(1);
    opacity: 1;
  }
  28% {
    transform: translate(
        calc(-50% + var(--kk-x) * 1.1),
        calc(-50% + var(--kk-y) * 1.3)
      )
      scale(0.85);
    opacity: 0.6;
  }
  42% {
    transform: translate(-50%, calc(-50% + var(--kk-y) * 2.6)) scale(0.55);
    opacity: 0.06;
  }
  58% {
    transform: translate(
        calc(-50% - var(--kk-x) * 1.1),
        calc(-50% + var(--kk-y) * 0.6)
      )
      scale(0.85);
    opacity: 0.7;
  }
  74% {
    transform: translate(
        calc(-50% - var(--kk-x)),
        calc(-50% - var(--kk-y) * 0.8)
      )
      scale(1);
    opacity: 1;
  }
  90% {
    transform: translate(-50%, calc(-50% - var(--kk-y) * 2.4)) scale(0.6);
    opacity: 0.08;
  }
}

@keyframes kk-mint {
  from {
    transform: translate(
        calc(-50% - var(--kk-x) * 0.5),
        calc(-50% + var(--kk-y) * 1.6)
      )
      scale(0.9);
    opacity: 0.25;
  }
  to {
    transform: translate(
        calc(-50% + var(--kk-x) * 0.6),
        calc(-50% + var(--kk-y) * 0.9)
      )
      scale(1.15);
    opacity: 0.55;
  }
}

/* Glasscheibe: feiner Schimmer + Korn über den Lichtern */
.kk-hero__lights::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.03) 100%
  );
}

.kk-hero__lights::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--kk-noise);
  background-size: 220px 220px;
  opacity: 0.13;
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  .kk-light {
    animation: none;
  }
}

.kk-hero__inner {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}

.kk-hero__quote {
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

.kk-hero__title {
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
}

.kk-hero__sub {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--kk-soft-lilac);
}

.kk-hero .wp-block-buttons {
  justify-content: center;
  margin-top: 2.25rem;
}

.kk-hero .kk-facts {
  justify-content: center;
  margin-top: 3.5rem;
}

.kk-side-label {
  display: none;
}

@media (min-width: 782px) {
  .kk-hero__quote {
    margin: 0 0 2.5rem;
  }

  .kk-hero .wp-block-buttons,
  .kk-hero .kk-facts {
    justify-content: flex-start;
  }

  .kk-side-label {
    display: block;
    position: absolute;
    top: 50%;
    right: 1.75rem;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--wp--preset--color--kk-soft-lilac);
  }
}

/* =====================================================================
   5. Header
   ===================================================================== */
.kk-site-header {
  position: relative;
  z-index: 20;
  background: var(--wp--preset--color--kk-midnight-plum);
  color: var(--wp--preset--color--kk-mist);
  --kk-link-hover: var(--wp--preset--color--kk-blush);
}

/* Auf der Startseite liegt der Header transparent über dem Hero */
.home .kk-site-header,
.front-page .kk-site-header {
  position: absolute;
  inset: 0 0 auto 0;
  background: transparent;
}

.kk-site-header a {
  text-decoration: none;
}

.kk-header__cta {
  display: none;
}

@media (min-width: 782px) {
  .kk-header__cta {
    display: block;
  }
}

.kk-site-header .wp-block-navigation__responsive-container.is-menu-open {
  padding: 1.5rem var(--wp--preset--spacing--kk-gutter);
}

/* =====================================================================
   6. Karten, Foto, Newsletter-Formular, Footer
   ===================================================================== */
.is-style-kk-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--wp--preset--spacing--kk-l);
  background: #fff;
  border: 1px solid rgba(20, 5, 44, 0.08);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 5, 44, 0.06);
}

.is-style-kk-card > * {
  margin-block: 0;
}

.is-style-kk-card > * + * {
  margin-block-start: 1rem;
}

.is-style-kk-card > .wp-block-buttons {
  margin-top: auto;
  padding-top: 1.75rem;
}

.is-style-kk-card.kk-card--featured {
  background-color: var(--wp--preset--color--kk-midnight-plum);
  border-color: transparent;
}

.is-style-kk-photo {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.is-style-kk-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.is-style-kk-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--kk-noise);
  background-size: 220px 220px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.is-style-kk-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--kk-midnight-plum),
    var(--wp--preset--color--kk-bloom-pink)
  );
  mix-blend-mode: multiply;
  opacity: 0.3;
  pointer-events: none;
}

/* Formular-Platzhalter (später durch Fluent Form ersetzen) + Fluent-Forms-Grundstil */
.kk-form,
.kk-form-wrap .fluent_form_1,
.kk-form-wrap .frm-fluent-form {
  display: grid;
  gap: 1rem;
}

.kk-form-wrap
  :is(input[type="email"], input[type="text"], .ff-el-form-control) {
  width: 100%;
  padding: 0.95rem 1.1rem;
  font: inherit;
  color: var(--wp--preset--color--kk-mist);
  background: rgba(248, 246, 251, 0.08);
  border: 1px solid rgba(220, 204, 242, 0.4);
  border-radius: 3px;
}

.kk-form-wrap ::placeholder {
  color: var(--wp--preset--color--kk-soft-lilac);
  opacity: 0.8;
}

.kk-form-wrap :is(input, .ff-el-form-control):focus {
  border-color: var(--wp--preset--color--kk-bloom-pink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 110, 174, 0.3);
}

.kk-form__consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--wp--preset--color--kk-soft-lilac);
}

.kk-form__consent input {
  margin-top: 0.2rem;
  accent-color: var(--wp--preset--color--kk-bloom-pink);
}

.kk-form button {
  justify-self: start;
  border: 0;
}

.kk-footer {
  --kk-glow-opacity: 0.4;
  background-color: var(--wp--preset--color--kk-shadow);
}

.kk-footer .wp-block-navigation {
  --kk-link-hover: var(--wp--preset--color--kk-blush);
}

.kk-footer a {
  text-decoration: none;
}

.kk-footer__bottom {
  border-top: 1px solid rgba(220, 204, 242, 0.18);
}

/* =====================================================================
   7. Formulare im Inhalt, Zitate, Tabellen: ruhige Defaults
   ===================================================================== */
.wp-block-post-content :where(input, textarea, select) {
  font: inherit;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(20, 5, 44, 0.25);
  border-radius: 3px;
  background: #fff;
  color: inherit;
}

/* =====================================================================
   8. Testimonials
   ===================================================================== */
.kk-testimonial::before {
  content: "\201C"; /* “ – klassisches Zitatzeichen, sitzt oben in der Zeile */
  display: block;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  font-family: var(--wp--preset--font-family--kk-serif);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--wp--preset--color--kk-bloom-pink);
}

.kk-testimonial__text {
  flex-grow: 1;
  padding-bottom: 1.5rem;
}

.is-style-kk-card > .kk-testimonial__author {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(20, 5, 44, 0.1);
}

.kk-testimonial__author > * {
  margin: 0;
}

.kk-testimonial__name {
  font-weight: 600;
}
