/*
Theme Name: Weinberg Mein Tee – Blocksy Child
Theme URI: https://weinbergmeintee.at/
Description: Update-sicheres Blocksy-Child-Theme mit Designsystem für den Tee-Konfigurator und WooCommerce.
Author: Weinberg Mein Tee
Template: blocksy
Version: 1.1.0
Text Domain: weinberg-mein-tee
Requires at least: 6.6
Requires PHP: 7.4
*/

/*
 * DESIGN TOKENS
 * Die WMT-Variablen sind die stabile Schnittstelle für eigene Blöcke,
 * den späteren Teemischer und WooCommerce-Erweiterungen.
 */
:root {
  --wmt-color-forest-900: #6f0f2e;
  --wmt-color-forest-700: #a51545;
  --wmt-color-herb-600: #6f8f72;
  --wmt-color-sage-300: #b9ccb9;
  --wmt-color-sage-100: #e8f0e7;
  --wmt-color-cream-100: #faf7f4;
  --wmt-color-sand-200: #eadfd8;
  --wmt-color-rust-600: #8b2346;
  --wmt-color-ink-900: #333333;
  --wmt-color-ink-600: #696260;
  --wmt-color-white: #fffdfb;
  --wmt-color-rose-200: #f3d9e2;
  --wmt-color-rose-100: #fbecf1;
  --wmt-color-lavender-100: #eee8f5;
  --wmt-color-butter-100: #f8edc8;
  --wmt-color-warning-bg: #fff6df;
  --wmt-color-warning-text: #70491c;
  --wmt-color-danger: #a51545;
  --wmt-color-success: #56745a;

  --wmt-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wmt-font-display: Georgia, "Times New Roman", serif;
  --wmt-text-xs: clamp(.78rem, .75rem + .08vw, .84rem);
  --wmt-text-sm: clamp(.9rem, .86rem + .12vw, .98rem);
  --wmt-text-base: clamp(1rem, .96rem + .14vw, 1.08rem);
  --wmt-text-lg: clamp(1.18rem, 1.06rem + .38vw, 1.42rem);
  --wmt-text-xl: clamp(1.5rem, 1.27rem + .72vw, 2rem);
  --wmt-text-2xl: clamp(2rem, 1.55rem + 1.4vw, 3rem);
  --wmt-text-hero: clamp(2.55rem, 1.75rem + 2.7vw, 4.8rem);

  --wmt-space-1: .25rem;
  --wmt-space-2: .5rem;
  --wmt-space-3: .75rem;
  --wmt-space-4: 1rem;
  --wmt-space-5: 1.5rem;
  --wmt-space-6: 2rem;
  --wmt-space-7: 3rem;
  --wmt-space-8: 4.5rem;
  --wmt-space-9: 6rem;

  --wmt-radius-sm: .35rem;
  --wmt-radius-md: .65rem;
  --wmt-radius-lg: 1rem;
  --wmt-radius-pill: 999px;
  --wmt-border: 1px solid rgba(111, 15, 46, .14);
  --wmt-shadow-sm: 0 8px 24px rgba(111, 15, 46, .07);
  --wmt-shadow-lg: 0 24px 64px rgba(111, 15, 46, .13);
  --wmt-container: 1240px;
  --wmt-reading: 760px;
  --wmt-transition: 180ms ease;

  /* Blocksy-Palette an die WMT-Tokens anbinden. */
  --theme-palette-color-1: var(--wmt-color-forest-700) !important;
  --theme-palette-color-2: var(--wmt-color-herb-600) !important;
  --theme-palette-color-3: var(--wmt-color-ink-600) !important;
  --theme-palette-color-4: var(--wmt-color-ink-900) !important;
  --theme-palette-color-5: var(--wmt-color-rose-200) !important;
  --theme-palette-color-6: var(--wmt-color-sage-100) !important;
  --theme-palette-color-7: var(--wmt-color-cream-100) !important;
  --theme-palette-color-8: var(--wmt-color-white) !important;
  --theme-text-color: var(--wmt-color-ink-900) !important;
  --theme-link-initial-color: var(--wmt-color-forest-700) !important;
  --theme-link-hover-color: var(--wmt-color-forest-900) !important;
  --theme-selection-text-color: var(--wmt-color-white) !important;
  --theme-selection-background-color: var(--wmt-color-forest-700) !important;
  --theme-border-color: rgba(111, 15, 46, .14) !important;
}

html {
  scroll-behavior: smooth;
}

body.wmt-child-theme {
  color: var(--wmt-color-ink-900);
  background: var(--wmt-color-cream-100);
  font-family: var(--wmt-font-body);
  font-size: var(--wmt-text-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--wmt-color-white);
  background: var(--wmt-color-forest-700);
}

h1,
h2,
h3,
h4,
h5,
h6,
.entry-title,
.page-title {
  color: var(--wmt-color-forest-900);
  font-family: var(--wmt-font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.025em;
  text-wrap: balance;
}

h1,
.entry-title {
  font-size: var(--wmt-text-2xl);
}

h2 {
  font-size: var(--wmt-text-xl);
}

h3 {
  font-size: var(--wmt-text-lg);
}

p,
li {
  text-wrap: pretty;
}

a {
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

:focus-visible {
  outline: 3px solid var(--wmt-color-forest-700);
  outline-offset: 3px;
}

/* HEADER UND WORTMARKE */
.ct-header {
  --theme-border-color: rgba(111, 15, 46, .1);
  border-top: 5px solid var(--wmt-color-forest-700);
  background: rgba(255, 253, 251, .97);
  box-shadow: 0 1px 0 rgba(111, 15, 46, .09);
  backdrop-filter: blur(12px);
}

.site-logo-container {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--wmt-color-forest-900) !important;
  text-decoration: none;
}

.site-logo-container .default-logo {
  display: none;
}

.site-branding .site-title-container {
  display: none;
}

.site-logo-container::before {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 50% 50% 50% 18%;
  color: var(--wmt-color-white);
  background: var(--wmt-color-forest-700);
  content: "W";
  font-family: var(--wmt-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(111, 15, 46, .18);
  transform: rotate(-8deg);
}

.site-logo-container::after {
  content: "Weinberg Mein Tee";
  font-family: var(--wmt-font-display);
  font-size: clamp(1.02rem, .92rem + .4vw, 1.3rem);
  color: var(--wmt-color-forest-900);
  font-weight: 600;
  letter-spacing: .015em;
  white-space: nowrap;
}

.ct-header-trigger,
.ct-header-search,
.ct-cart-item {
  color: var(--wmt-color-forest-900) !important;
}

[data-id="menu"] > ul > li > a,
.ct-menu-link {
  color: var(--wmt-color-ink-900) !important;
  font-size: .79rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

[data-id="menu"] > ul > li.current-menu-item > a,
[data-id="menu"] > ul > li > a:hover {
  color: var(--wmt-color-forest-700) !important;
}

/* LAYOUT UND FLÄCHEN */
.site-main {
  min-height: 55vh;
}

.ct-trending-block {
  display: none;
}

.ct-container,
.wp-block-group.alignwide {
  width: min(calc(100% - 2rem), var(--wmt-container));
}

.entry-content > :where(p, ul, ol, blockquote):not(.alignwide):not(.alignfull) {
  max-width: var(--wmt-reading);
}

.wmt-section,
.entry-content > .wp-block-group {
  padding-block: clamp(2.7rem, 6vw, var(--wmt-space-9));
}

.wmt-surface,
.has-wmt-cream-background-color {
  background: var(--wmt-color-cream-100);
}

.wmt-surface-rose {
  background: var(--wmt-color-rose-100);
}

.wmt-surface-sage {
  background: var(--wmt-color-sage-100);
}

/* Startseiten-Hero: klare OceanWP-Architektur, eigenständige Weinberg-Bildwelt. */
.home .site-main {
  background: var(--wmt-color-white);
}

.home .entry-content {
  max-width: none;
}

.home .entry-content > .wp-block-group {
  display: flex;
  min-height: clamp(35rem, 62vw, 46rem);
  width: 100%;
  max-width: none !important;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: clamp(4rem, 8vw, 7.5rem) max(1.25rem, calc((100vw - var(--wmt-container)) / 2));
  background:
    linear-gradient(90deg, #fffdfb 0%, rgba(255, 253, 251, .98) 42%, rgba(255, 253, 251, .74) 57%, rgba(255, 253, 251, .08) 76%),
    url("assets/images/wildflower-bouquet.png") no-repeat right 6% center / min(48vw, 40rem) auto,
    var(--wmt-color-white);
  border-bottom: 1px solid rgba(111, 15, 46, .08);
}

.home .entry-content > .wp-block-group > * {
  width: min(100%, 42rem);
  margin-inline: 0;
}

.home .entry-content > .wp-block-group h1 {
  max-width: 10ch;
  margin-block: .5rem 1.25rem;
  color: var(--wmt-color-forest-900);
  font-size: var(--wmt-text-hero);
  line-height: .98;
}

.home .entry-content > .wp-block-group h1::after {
  display: block;
  width: 4.5rem;
  height: 3px;
  margin-top: 1.15rem;
  border-radius: var(--wmt-radius-pill);
  background: linear-gradient(90deg, var(--wmt-color-forest-700), var(--wmt-color-herb-600));
  content: "";
}

.home .entry-content > .wp-block-group .has-large-font-size {
  order: -1;
  margin-bottom: .45rem;
  color: var(--wmt-color-herb-600);
  font-size: var(--wmt-text-sm) !important;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.home .entry-content > .wp-block-group p:not(.has-large-font-size) {
  max-width: 38rem;
  color: var(--wmt-color-ink-600);
  font-size: var(--wmt-text-lg);
}

.home .entry-content::after {
  display: block;
  min-height: clamp(15rem, 34vw, 29rem);
  background:
    linear-gradient(180deg, var(--wmt-color-rose-100) 0%, rgba(251, 236, 241, .18) 56%, #fff 100%),
    url("assets/images/wildflower-meadow.png") no-repeat center bottom / min(72rem, 92vw) auto;
  content: "";
}

.wmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--wmt-space-5);
}

.wmt-card,
.wc-block-grid__product,
ul.products li.product {
  overflow: hidden;
  border: var(--wmt-border);
  border-radius: var(--wmt-radius-lg);
  background: var(--wmt-color-white);
  box-shadow: var(--wmt-shadow-sm);
  transition: transform var(--wmt-transition), box-shadow var(--wmt-transition), border-color var(--wmt-transition);
}

.wmt-card {
  padding: var(--wmt-space-5);
}

.wmt-card:hover,
.wc-block-grid__product:hover,
ul.products li.product:hover {
  border-color: rgba(165, 21, 69, .28);
  box-shadow: var(--wmt-shadow-lg);
  transform: translateY(-3px);
}

/* BUTTONS UND FORMULARE */
:where(button, .button, .wp-element-button, input[type="submit"], .added_to_cart) {
  min-height: 2.85rem;
  border: 1px solid transparent !important;
  border-radius: var(--wmt-radius-pill) !important;
  padding-inline: 1.25rem !important;
  color: var(--wmt-color-white) !important;
  background: var(--wmt-color-forest-700) !important;
  font-family: var(--wmt-font-body);
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: .015em;
  box-shadow: none !important;
  transition: background var(--wmt-transition), transform var(--wmt-transition), box-shadow var(--wmt-transition);
}

:where(button, .button, .wp-element-button, input[type="submit"], .added_to_cart):hover {
  color: var(--wmt-color-white) !important;
  background: var(--wmt-color-forest-900) !important;
  box-shadow: 0 7px 20px rgba(111, 15, 46, .2) !important;
  transform: translateY(-1px);
}

.wmt-button-secondary {
  border-color: var(--wmt-color-forest-700) !important;
  color: var(--wmt-color-forest-700) !important;
  background: transparent !important;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 3rem;
  border: var(--wmt-border) !important;
  border-radius: var(--wmt-radius-md) !important;
  color: var(--wmt-color-ink-900) !important;
  background: var(--wmt-color-white) !important;
  font-family: var(--wmt-font-body);
}

:where(input, select, textarea):focus {
  border-color: var(--wmt-color-forest-700) !important;
  box-shadow: 0 0 0 3px rgba(165, 21, 69, .14) !important;
}

label {
  color: var(--wmt-color-ink-900);
  font-size: var(--wmt-text-sm);
  font-weight: 700;
}

/* TEE-KONFIGURATOR: wiederverwendbare UI-Bausteine */
.wmt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border-radius: var(--wmt-radius-pill);
  padding: .3rem .72rem;
  color: var(--wmt-color-forest-900);
  background: var(--wmt-color-sage-100);
  font-size: var(--wmt-text-xs);
  font-weight: 700;
}

.wmt-component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--wmt-space-4);
  padding: var(--wmt-space-4);
  border-bottom: var(--wmt-border);
}

.wmt-component-row:last-child {
  border-bottom: 0;
}

.wmt-quantity,
.wmt-price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wmt-price {
  color: var(--wmt-color-forest-900);
  font-weight: 750;
}

.wmt-warning,
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  border: 0 !important;
  border-left: 4px solid var(--wmt-color-rust-600) !important;
  border-radius: var(--wmt-radius-md) !important;
  padding: 1rem 1.2rem !important;
  color: var(--wmt-color-warning-text) !important;
  background: var(--wmt-color-warning-bg) !important;
}

.woocommerce-message {
  border-left-color: var(--wmt-color-success) !important;
  color: var(--wmt-color-forest-900) !important;
  background: var(--wmt-color-sage-100) !important;
}

.wmt-mixture-summary {
  position: sticky;
  top: 2rem;
  padding: var(--wmt-space-5);
  border-radius: var(--wmt-radius-lg);
  color: var(--wmt-color-white);
  background: var(--wmt-color-forest-900);
  box-shadow: var(--wmt-shadow-lg);
}

.wmt-mixture-summary :where(h2, h3, p, a) {
  color: inherit;
}

details.wmt-details {
  border-top: var(--wmt-border);
  padding-block: var(--wmt-space-3);
}

details.wmt-details summary {
  cursor: pointer;
  color: var(--wmt-color-forest-700);
  font-weight: 750;
}

/* WOOCOMMERCE */
.woocommerce .price,
.wc-block-components-product-price {
  color: var(--wmt-color-forest-700) !important;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.woocommerce span.onsale {
  border-radius: var(--wmt-radius-pill);
  color: var(--wmt-color-white);
  background: var(--wmt-color-rust-600);
}

.woocommerce table.shop_table,
.wc-block-cart-items,
.wc-block-components-totals-wrapper {
  border-color: rgba(111, 15, 46, .14) !important;
  border-radius: var(--wmt-radius-md);
}

.woocommerce-checkout-review-order,
.wc-block-checkout__order-notes,
.wc-block-components-sidebar-layout .wc-block-components-sidebar {
  border-radius: var(--wmt-radius-lg);
  background: var(--wmt-color-cream-100);
}

.woocommerce-product-details__short-description {
  color: var(--wmt-color-ink-600);
}

/* FOOTER */
.ct-footer {
  color: var(--wmt-color-sage-100);
  background: var(--wmt-color-forest-900);
}

.ct-footer :where(a, h2, h3, h4) {
  color: var(--wmt-color-white) !important;
}

.ct-footer a:hover {
  color: var(--wmt-color-sand-200) !important;
}

/* RESPONSIVE UND BARRIEREARMUT */
@media (max-width: 767px) {
  :root {
    --wmt-space-8: 3.5rem;
    --wmt-space-9: 4.5rem;
  }

  .site-logo-container::after {
    font-size: 1rem;
  }

  .home .entry-content > .wp-block-group {
    min-height: 46rem;
    justify-content: flex-start;
    padding-top: 4.25rem;
    padding-bottom: 22rem;
    background:
      linear-gradient(180deg, #fffdfb 0%, rgba(255, 253, 251, .98) 48%, rgba(255, 253, 251, .3) 70%, rgba(255, 253, 251, .02) 100%),
      url("assets/images/wildflower-bouquet.png") no-repeat center bottom / min(32rem, 96vw) auto,
      var(--wmt-color-white);
  }

  .home .entry-content > .wp-block-group h1 {
    max-width: 12ch;
  }

  .home .entry-content > .wp-block-group p:not(.has-large-font-size) {
    font-size: var(--wmt-text-base);
  }

  .home .entry-content::after {
    min-height: 18rem;
    background-size: auto, 44rem auto;
  }

  .wmt-component-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .wmt-component-row .wmt-price {
    grid-column: 1 / -1;
  }

  .wmt-mixture-summary {
    position: static;
  }
}

@media (max-width: 420px) {
  .site-logo-container::after {
    content: "Mein Tee";
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
