/* ==========================================================================
   Components
   Built on tokens.css + base.css. Roles only, no raw values.
   ========================================================================== */

/* ---------- Button ----------
   Three variants, all the same height and vertically centered in a row:
   - .button--primary    filled
   - .button--secondary  outline only
   - .button--text       text link, still aligned with the other buttons
   Colors come from the current color world (data-surface). */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: var(--target-min);
  padding: var(--button-padding-y) var(--button-padding-x);
  border: var(--button-border-width) solid transparent;
  border-radius: var(--radius-small);
  font-family: var(--font-heading);
  font-size: var(--text-body);
  font-weight: var(--weight-heading);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    text-decoration-thickness var(--transition);
}

.button--primary {
  border-color: var(--surface-action-bg);
  background-color: var(--surface-action-bg);
  color: var(--surface-action-text);
}

.button--primary:hover {
  border-color: var(--surface-action-bg-hover);
  background-color: var(--surface-action-bg-hover);
}

.button--secondary {
  border-color: var(--surface-action-bg);
  background-color: transparent;
  color: var(--surface-text);
}

.button--secondary:hover {
  background-color: var(--surface-action-bg);
  color: var(--surface-action-text);
}

/* Same box as the other buttons (height, padding, border) so it sits on the
   same center line – only the visible frame is missing. */
.button--text {
  padding-inline: 0;
  border-inline-width: 0; /* left edge flush with the text above */
  background-color: transparent;
  color: var(--surface-link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.button--text:hover {
  text-decoration-thickness: 2px;
}

/* Full-width option, e.g. inside narrow boxes on mobile */
.button--block {
  width: 100%;
}

/* ---------- Tag ----------
   Small label, not clickable (e.g. "Neu", category on a card).
   Set in the body font, see rules. */

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--tag-padding-y) var(--tag-padding-x);
  border-radius: var(--radius-small);
  background-color: var(--surface-border);
  color: var(--surface-text);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding: 0;
  list-style: none;
}

/* ---------- Bullet list (Aufzählung) ----------
   Points in running text. Default: small square marker.
   .list-bullets--check: check mark (icon set per project in tokens). */

.list-bullets {
  display: grid;
  gap: var(--gap-list-item);
  padding: 0;
  list-style: none;
}

.list-bullets > li {
  position: relative;
  padding-left: calc(var(--icon-size) + var(--space-8));
}

.list-bullets > li::before {
  content: "";
  position: absolute;
  left: calc(var(--icon-size) / 2 - 0.2em);
  top: calc(0.5lh - 0.2em);
  width: 0.4em;
  height: 0.4em;
  background-color: currentcolor;
}

.list-bullets--check > li::before {
  left: 0;
  top: calc(0.5lh - var(--icon-size) / 2);
  width: var(--icon-size);
  height: var(--icon-size);
  mask: var(--icon-check) center / contain no-repeat;
}

/* Numbered list in running text */
.list-numbered {
  display: grid;
  gap: var(--gap-list-item);
  padding-left: calc(var(--icon-size) + var(--space-8));
}

.list-numbered > li::marker {
  font-weight: var(--weight-strong);
}

/* ---------- Item list (Liste) ----------
   Larger entries with number or icon, title and short description,
   e.g. process steps. Use <ol> when the order matters. */

.list-items {
  display: grid;
  gap: var(--gap-list-large);
  padding: 0;
  list-style: none;
  counter-reset: list-item;
}

.list-items > li {
  display: grid;
  grid-template-columns: var(--icon-size-large) minmax(0, 1fr);
  column-gap: var(--space-24);
  align-items: start;
  max-width: none;
  counter-increment: list-item;
}

.list-items__marker {
  display: grid;
  place-items: center;
  width: var(--icon-size-large);
  height: var(--icon-size-large);
  color: var(--surface-text);
}

.list-items__marker svg {
  width: 100%;
  height: 100%;
}

/* Numbered variant: number in a circle, generated automatically */
.list-items--numbered .list-items__marker {
  border: var(--button-border-width) solid var(--surface-action-bg);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
}

.list-items--numbered .list-items__marker::before {
  content: counter(list-item);
}

.list-items__body > * + * {
  margin-top: var(--space-8);
}

.list-items__title {
  font-size: var(--text-h4);

  /* align first line with the center of the marker */
  padding-top: calc((var(--icon-size-large) - 1lh) / 2);
}

/* ==========================================================================
   Box elements – all build on .box (base.css)
   ========================================================================== */

/* Box without frame: same inner layout, no background, border or padding.
   For icon boxes or cards sitting directly on the section color. */
.box--plain {
  padding: 0;
  border: 0;
  background-color: transparent;
}

.box__title {
  font-size: var(--text-h4);
}


/* Push the action to the bottom so actions line up in a row of boxes */
.box__action {
  margin-top: auto;
}

/* ---------- Card ----------
   Content box: optional image, tag, title, text, action.
   .card--link makes the whole card clickable via the title link. */

.card--link {
  position: relative;
  transition: border-color var(--transition);
}

.card--link .card__link {
  color: inherit;
  text-decoration: none;
}

.card--link .card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card--link:hover {
  border-color: var(--surface-border-strong);
}

.card--link:hover .card__link {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.card--link:has(.card__link:focus-visible) {
  outline: var(--focus-width) solid var(--surface-focus);
  outline-offset: var(--focus-offset);
}

.card--link .card__link:focus-visible {
  outline: none;
}

/* ---------- Icon box ----------
   Icon (drawn per project, inline SVG with currentColor), title, text. */

.iconbox__icon {
  width: var(--icon-size-large);
  height: var(--icon-size-large);
  color: var(--surface-text);
}

.iconbox__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------- Image box ----------
   Image is the main content, short title and text below. */

.imagebox__media {
  aspect-ratio: 4 / 3;
}

.imagebox__media img,
.imagebox__media > * {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Testimonial (Kundenstimme) ----------
   <figure> with <blockquote> and <figcaption>. */

.testimonial blockquote {
  font-size: var(--text-lead);
  line-height: var(--leading-body);
}


.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-top: auto;
  padding-top: var(--space-8);
}

.testimonial__photo {
  flex: none;
  width: var(--icon-size-large);
  height: var(--icon-size-large);
  border-radius: var(--radius-full);
  object-fit: cover;
  overflow: hidden;
}

.testimonial__name {
  display: block;
  font-weight: var(--weight-strong);
}

.testimonial__role {
  display: block;
  font-size: var(--text-small);
  color: var(--surface-text-muted);
}

/* ==========================================================================
   Batch 2
   ========================================================================== */

/* ---------- Icons from tokens (check / cross) ----------
   Decorative; pair with visually hidden text where they carry meaning. */

.icon-check,
.icon-cross {
  display: inline-block;
  flex: none;
  width: var(--icon-size);
  height: var(--icon-size);
  background-color: currentcolor;
  vertical-align: middle;
}

.icon-check {
  mask: var(--icon-check) center / contain no-repeat;
}

.icon-cross {
  color: var(--surface-text-muted);
  mask: var(--icon-cross) center / contain no-repeat;
}

/* Cross list – for the "before" side of a comparison */
.list-bullets--cross > li::before {
  left: 0;
  top: calc(0.5lh - var(--icon-size) / 2);
  width: var(--icon-size);
  height: var(--icon-size);
  background-color: var(--surface-text-muted);
  mask: var(--icon-cross) center / contain no-repeat;
}

/* Highlighted box (recommended package, "after" side) */

/* Second pixel of the frame via box-shadow, so content and buttons stay
   exactly in line with neighbouring boxes. */
.box--highlight {
  border-color: var(--surface-action-bg);
  box-shadow: 0 0 0 1px var(--surface-action-bg);
}

/* ---------- FAQ ----------
   Native <details>/<summary>: works without JavaScript, keyboard accessible.
   Add the same name="…" to all <details> to allow only one open item. */

.faq {
  border-top: var(--border-width) solid var(--surface-border);
}

.faq__item {
  border-bottom: var(--border-width) solid var(--surface-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
  min-height: var(--target-min);
  padding-block: var(--space-24);
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "";
  flex: none;
  width: var(--icon-size);
  height: var(--icon-size);
  background-color: currentcolor;
  mask: var(--icon-plus) center / contain no-repeat;
  transition: transform var(--transition);
}

.faq__item[open] > .faq__question::after {
  transform: rotate(45deg);
}

.faq__question:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.faq__answer {
  padding-bottom: var(--space-24);

  /* keep answer clear of the icon column */
  padding-right: calc(var(--icon-size) + var(--space-24));
}

/* ---------- Table ----------
   Wrap in .table-scroll so wide tables scroll sideways on small screens
   instead of breaking the page. The wrapper gets tabindex="0", role="region"
   and an aria-label so keyboard users can scroll it too. */

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

.table caption {
  margin-bottom: var(--space-16);
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--weight-heading);
  text-align: left;
}

.table th,
.table td {
  padding: var(--space-16) var(--space-24) var(--space-16) 0;
  border-bottom: var(--border-width) solid var(--surface-border);
  text-align: left;
  vertical-align: top;
}


.table thead th {
  border-bottom: var(--button-border-width) solid var(--surface-text);
  font-weight: var(--weight-strong);
  vertical-align: bottom;
}

.table tbody th {
  font-weight: var(--weight-strong);
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

/* Numbers and prices line up on the right */
.table .is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Keep short values on one line (times, dates, prices) */
.table .is-nowrap {
  white-space: nowrap;
}

/* Centered columns, e.g. check / cross in a feature table */
.table .is-center {
  text-align: center;
}

/* ---------- Comparison: before / after ---------- */

.compare-pair {
  display: grid;
  gap: var(--gap-grid);
  align-items: stretch;
}

@media (width >= 48em) {
  .compare-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Comparison: packages / prices ---------- */

.package__price {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
}

.package__price-note {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-body);
  color: var(--surface-text-muted);
}

/* ---------- Text + image section ----------
   Layout comes from .split (base.css). Extra option here:
   data-ratio="media-wide" gives the image 7 of 12 columns. */

@media (width >= 48em) {
  .split[data-ratio="media-wide"] {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .split[data-ratio="media-wide"][data-image="start"] {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

/* ---------- Call to action ----------
   A section with its own color world:
   <section class="section section--inset cta" data-surface="accent">
   Default: centered, narrow. .cta--split: text left, actions right. */

.cta .content {
  text-align: center;
}


.cta .actions {
  justify-content: center;
}

@media (width >= 48em) {
  .cta--split .cta__inner {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    gap: var(--space-64);
  }

  .cta--split .content {
    text-align: left;
  }

  .cta--split .content > * {
    margin-inline: 0;
  }

  .cta--split .actions {
    justify-content: flex-end;
  }
}

.cta--split .actions {
  margin-top: var(--gap-text-action);
}

@media (width >= 48em) {
  .cta--split .actions {
    margin-top: 0;
  }
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form > * + * {
  margin-top: var(--space-24);
}

.form__row {
  display: grid;
  gap: var(--space-24) var(--gap-grid);
}

@media (width >= 40em) {
  .form__row {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.field label,
.fieldset legend {
  font-weight: var(--weight-strong);
}

.field__required {
  font-size: var(--text-small);
  font-weight: var(--weight-body);
  color: var(--surface-text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--target-min);
  padding: var(--space-12) var(--space-16);
  border: var(--button-border-width) solid var(--surface-border-strong);
  border-radius: var(--radius-small);
  background-color: var(--surface-box-bg);
  color: var(--surface-text);
  line-height: var(--leading-body);
}

.field textarea {
  resize: vertical;
}

.field :is(input, select, textarea):hover {
  border-color: var(--surface-text);
}

.field :is(input, select, textarea):focus-visible {
  outline: var(--focus-width) solid var(--surface-focus);
  outline-offset: var(--focus-offset);
}

.field [aria-invalid="true"] {
  border-color: var(--color-error);
}

.field__hint {
  font-size: var(--text-small);
  color: var(--surface-text-muted);
}

/* Error text: color AND wording (never color alone) */
.field__error {
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
  color: var(--color-error);
}

/* Single checkbox with its label next to it (e.g. privacy consent) */
.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-8) var(--space-12);
  align-items: start;
}

.field--check input[type="checkbox"] {
  width: 1.25rem;
  min-height: 0;
  height: 1.25rem;
  margin-block-start: 0.15em;
  padding: 0;
  accent-color: var(--surface-text);
}

.field--check label {
  font-size: var(--text-small);
  font-weight: var(--weight-body);
}

.field--check .field__error {
  grid-column: 2;
}

/* Group of fields with a shared label, e.g. wish dates */
.fieldset {
  margin-inline: 0;
  padding: var(--padding-box);
  border: var(--border-width) solid var(--surface-border);
  border-radius: var(--radius-medium);
}

.fieldset legend {
  padding-inline: var(--space-8);
}

.fieldset > * + * {
  margin-top: var(--space-24);
}


/* Spam trap: off screen for people, still in the form for bots */
.field--trap {
  position: absolute;
  left: -100vw;
}

/* Messages after sending: color AND heading (never color alone) */
.notice {
  padding: var(--padding-box);
  border: var(--button-border-width) solid currentcolor;
  border-radius: var(--radius-medium);
  background-color: var(--surface-box-bg);
}

.notice > * + * {
  margin-top: var(--space-16);
}

.fieldset > legend + * {
  margin-top: 0;
}

.notice h2 {
  font-size: var(--text-h4);
}

.notice ul {
  padding-left: var(--space-24);
}

.notice--error {
  color: var(--color-error);
  margin-bottom: var(--space-32);
}

.notice--error a {
  color: inherit;
}

.notice--success {
  color: var(--color-success);
}

/* Spacing inside specific components (kept last: more specific than the generic rules above) */
.testimonial blockquote > * + * {
  margin-top: var(--space-16);
}

.cta .content > * {
  margin-inline: auto;
}

/* Title and the text right below it belong together: smaller gap.
   Works for direct box children (flex gap) and for titles inside .content
   (e.g. image box figcaption). */
.box > .box__title + * {
  margin-top: calc(var(--gap-box-title-text) - var(--gap-box-inner));
}

.box .content > .box__title + * {
  margin-top: var(--gap-box-title-text);
}
