/**
 * Base: reset, typography, buttons, utilities.
 * Becomes assets/css/base.css in the theme (loaded on every page).
 */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--aw-header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--aw-black);
  color: var(--aw-white);
  font-family: var(--aw-font-body);
  font-size: var(--aw-step-0);
  line-height: 1.65;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--aw-font-display);
  font-weight: 600;
  line-height: .88;
  text-transform: uppercase;
  letter-spacing: .005em;
  margin: 0 0 .4em;
  text-wrap: balance;
}

h4, h5, h6 {
  font-family: var(--aw-font-body);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }   /* links stay white, the underline reacts */

:focus-visible {
  outline: 2px solid var(--aw-white);
  outline-offset: 3px;
  border-radius: 2px;
}

.aw-wrap {
  width: min(100% - 2 * var(--aw-gutter), var(--aw-wide));
  margin-inline: auto;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed; z-index: 1000; top: .5rem; left: .5rem;
  width: auto; height: auto; clip: auto;
  padding: .6rem 1rem;
  background: var(--aw-white); color: var(--aw-black);
}

/* Buttons ---------------------------------------------------------------- */
.aw-btn,
.wp-block-button .wp-block-button__link {   /* core button: .wp-block-button raises specificity above WP's own styles */
  --btn-bg: var(--aw-red);
  --btn-fg: var(--aw-white);
  --btn-bd: var(--aw-red);
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 48px;
  padding: .55em 1.5em .45em;
  border: 2px solid var(--btn-bd);
  border-radius: var(--aw-radius-s);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--aw-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color var(--aw-dur) var(--aw-ease-out),
    border-color var(--aw-dur) var(--aw-ease-out),
    color var(--aw-dur) var(--aw-ease-out),
    box-shadow var(--aw-dur) var(--aw-ease-out),
    transform var(--aw-dur-fast) var(--aw-ease-out);
}
:is(.aw-btn, .wp-block-button .wp-block-button__link):hover {
  --btn-bg: var(--aw-red-light);
  --btn-bd: var(--aw-red-light);
  color: var(--btn-fg);
  box-shadow: 0 10px 30px -8px rgb(228 40 40 / .6);
}
:is(.aw-btn, .wp-block-button .wp-block-button__link):active { transform: translateY(1px) scale(.98); }

.aw-btn svg { width: 1em; height: 1em; flex: none; transition: transform var(--aw-dur) var(--aw-ease-out); }
.aw-btn:hover svg { transform: translateX(3px); }

.aw-btn--ghost,
.wp-block-button.is-style-outline > .wp-block-button__link {
  --btn-bg: transparent;
  --btn-bd: rgb(255 255 255 / .5);
}
:is(.aw-btn--ghost, .wp-block-button.is-style-outline > .wp-block-button__link):hover {
  --btn-bg: var(--aw-white);
  --btn-bd: var(--aw-white);
  --btn-fg: var(--aw-black);
  box-shadow: 0 10px 30px -8px rgb(255 255 255 / .35);
}

.aw-btn--small { min-height: 38px; font-size: 1.1rem; padding-inline: 1em; }

/* Button row */
.aw-actions,
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.wp-block-button .wp-block-button__link { width: auto; border-radius: var(--aw-radius-s); }

/* Rating stars + Google label (reviews block, footer badge) */
.aw-stars {
  --rating: 5;
  --size: 22px;
  position: relative;
  display: inline-block;
  width: calc(var(--size) * 5);
  height: var(--size);
  margin-top: .35rem;
  background: rgb(255 255 255 / .18);
  -webkit-mask: var(--star) repeat-x 0 0 / var(--size) var(--size);
  mask: var(--star) repeat-x 0 0 / var(--size) var(--size);
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3 1.7 9.3l7.2-.9z'/%3E%3C/svg%3E");
}
.aw-stars::before {
  content: "";
  position: absolute; inset: 0;
  width: calc(var(--rating) / 5 * 100%);
  background: #fbbc04;
}
.aw-stars--small { --size: 15px; margin: 0; }

.aw-google { display: inline-flex; align-items: center; gap: .45rem; color: var(--aw-mute); font-size: var(--aw-step--1); }
.aw-google svg { width: 18px; height: 18px; }

/* Section rhythm --------------------------------------------------------- */
.aw-section { padding-block: var(--aw-section); }

/* Reveal on scroll (only one orchestrated entrance per section, set via JS) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--aw-dur-slow) var(--aw-ease-out), transform var(--aw-dur-slow) var(--aw-ease-out);
  }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Theme only ------------------------------------------------------------- */
.aw-sentinel { position: absolute; top: 140px; width: 1px; height: 1px; pointer-events: none; }

/* Pages without a hero block (Impressum, AGB …) */
.aw-page-title { padding-block: clamp(3.5rem, 2rem + 4vw, 6rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.aw-page-title h1 { font-size: var(--aw-step-4); }

/* Core blocks inside page content get the reading width; Actionworld blocks run full width */
.aw-content > :is(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, table, hr, .wp-block-buttons, .wp-block-group,
  .wp-block-columns, .wp-block-table, .wp-block-image, .wp-block-embed, .wp-block-quote, .wp-block-separator) {
  width: min(100% - 2 * var(--aw-gutter), var(--aw-content));
  margin-inline: auto;
}
.aw-content > .alignwide { width: min(100% - 2 * var(--aw-gutter), var(--aw-wide)); margin-inline: auto; }
.aw-content > .alignfull { width: 100%; }
.aw-content > :is(h2, h3) { margin-top: 2em; }
.aw-content > :last-child:not([class*="aw-"]) { margin-bottom: var(--aw-section); }
.aw-content :is(p, li, td, dd) > a:not([class]) { text-decoration: underline; }
