/* =========================
   Baumvolk – Terms Template
   File: assets/css/bv-terms.css
   Nutzt globale Variablen aus bv-global.css
   ========================= */

.bv-terms-header,
.bv-terms-content {
  box-sizing: border-box;
}

/* Page header */
.bv-terms-header {
  background: var(--bv-wrapper-bg);
  padding: clamp(32px, 6vw, 72px) var(--bv-page-spacing) clamp(8px, 2vw, 16px);
  text-align: center;
}

.bv-terms-header h1 {
  margin: 0 0 8px 0;
  color: var(--bv-heading-color);
  font-size: var(--bv-font-size-3xl);
  line-height: var(--bv-line-height-tight);
  font-weight: var(--bv-font-weight-bold);
  letter-spacing: var(--bv-letter-spacing-tight);
  text-shadow: 0 0 24px var(--bv-accent-soft);
}

.bv-terms-date {
  margin: 0 auto;
  color: var(--bv-text-soft);
  font-size: var(--bv-font-size-base);
  line-height: var(--bv-line-height-base);
  font-weight: var(--bv-font-weight-normal);
  opacity: 0.9;
}

/* Content card */
.bv-terms-content {
  --bv-terms-address-indent: 24px;

  max-width: min(860px, var(--bv-page-max-width));
  margin: clamp(18px, 3vw, 36px) auto 64px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--bv-card-soft);
  color: var(--bv-text-primary);
  border: 1px solid var(--bv-border-soft);
  border-radius: var(--bv-radius-lg);
  box-shadow: var(--bv-shadow-elevated);
  font-size: var(--bv-font-size-base);
  line-height: var(--bv-line-height-base);
}

/* Sections */
.bv-terms-section {
  position: relative;
  padding: 20px 0 14px;
  border-top: 1px solid var(--bv-border-soft);
}

.bv-terms-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.bv-terms-section h2 {
  margin: 0 0 14px;
  color: var(--bv-heading-color);
  font-size: var(--bv-font-size-xl);
  line-height: var(--bv-line-height-tight);
  font-weight: var(--bv-font-weight-bold);
  letter-spacing: var(--bv-letter-spacing-tight);
}

/* Main terms text */
.bv-terms-text {
  color: var(--bv-text-primary);
  opacity: 0.95;
  font-size: var(--bv-font-size-base);
  line-height: var(--bv-line-height-relaxed);
  font-weight: var(--bv-font-weight-normal);
}

.bv-terms-text p {
  margin: 0 0 10px;
}

.bv-terms-text p + p {
  margin-top: 10px;
}

.bv-terms-text .bv-legal-address,
.bv-terms-subsection-content .bv-legal-address {
  display: block;
  margin-top: 24px;
  margin-left: var(--bv-terms-address-indent);
}

/* =========================
   Subsections: a), b), c) ...
   ========================= */

.bv-terms-subsection {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  margin: 0 0 16px;
}

.bv-terms-subsection:last-child {
  margin-bottom: 0;
}

.bv-terms-subsection-label {
  display: block;
  color: var(--bv-heading-color);
  font-weight: var(--bv-font-weight-bold);
  line-height: var(--bv-line-height-relaxed);
}

.bv-terms-subsection-content {
  min-width: 0;
}

.bv-terms-subsection-content > :first-child {
  margin-top: 0;
}

.bv-terms-subsection-content > :last-child {
  margin-bottom: 0;
}

.bv-terms-subsection-content p {
  margin: 0 0 10px;
}

.bv-terms-subsection-content p + p {
  margin-top: 10px;
}

.bv-terms-subsection-content a,
.bv-terms-subsection-content a:hover,
.bv-terms-subsection-content a:focus,
.bv-terms-subsection-content a:active,
.bv-terms-subsection-content a:visited {
  color: var(--bv-accent) !important;
  background: none !important;
  border-bottom: none !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.bv-terms-subsection-content a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Lists */
.bv-terms-text ul,
.bv-terms-text ol {
  margin: 10px 0 14px 1.25em;
  padding: 0;
}

.bv-terms-text li {
  margin: 6px 0;
}

.bv-terms-text li::marker {
  color: var(--bv-accent);
}

/* Links */
.bv-terms-text a {
  color: var(--bv-accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--bv-accent-border-soft);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.bv-terms-text a:hover,
.bv-terms-text a:focus {
  color: var(--bv-accent-bright);
  border-bottom-color: var(--bv-accent-border-strong);
  outline: none;
  background: var(--bv-accent-soft);
}

/* Code */
.bv-terms-text code {
  background: var(--bv-code-bg);
  color: var(--bv-text-primary);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--bv-code-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--bv-font-size-sm);
  line-height: var(--bv-line-height-base);
}

/* Section divider */
.bv-terms-section::after {
  content: "";
  display: block;
  height: 1px;
  margin: 20px 0 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--bv-border-soft),
    transparent
  );
}

.bv-terms-section:last-child::after {
  display: none;
}

.baumvolk-container.bv-terms-header,
.baumvolk-container.bv-terms-content {
  background-clip: padding-box;
}

/* Focus */
.bv-terms-content :where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--bv-accent);
  outline-offset: 2px;
  border-radius: var(--bv-radius-xs);
}

/* Selection */
::selection {
  background: var(--bv-accent);
  color: var(--bv-selection-text);
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 680px) {
  .bv-terms-content {
    --bv-terms-address-indent: 18px;

    margin-left: auto;
    margin-right: auto;
    padding: 20px;
  }

  .bv-terms-header h1 {
    font-size: var(--bv-font-size-2xl);
  }

  .bv-terms-section h2 {
    font-size: var(--bv-font-size-lg);
  }

  .bv-terms-text,
  .bv-terms-date {
    font-size: var(--bv-font-size-base);
  }

  .bv-terms-subsection {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    margin-bottom: 14px;
  }
}

/* Very small screens */
@media (max-width: 420px) {
  .bv-terms-content {
    padding: 18px 16px;
  }

  .bv-terms-subsection {
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 6px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================
   Print
   ========================= */

@media print {
  body {
    background: var(--bv-print-bg) !important;
    color: var(--bv-print-text) !important;
  }

  .bv-terms-header {
    background: var(--bv-print-bg) !important;
    padding: 0 0 8px 0;
    text-align: left;
    border-bottom: 1px solid var(--bv-print-border);
  }

  .bv-terms-header h1 {
    color: var(--bv-print-text) !important;
    text-shadow: none !important;
  }

  .bv-terms-date {
    color: #444 !important;
  }

  .bv-terms-content {
    box-shadow: none !important;
    border: 0 !important;
    padding: 0;
    margin: 12px 0 0 0;
    max-width: 100%;
    background: var(--bv-print-bg) !important;
    color: var(--bv-print-text) !important;
  }

  .bv-terms-section {
    page-break-inside: avoid;
    break-inside: avoid;
    border-top-color: var(--bv-print-border);
  }

  .bv-terms-section h2,
  .bv-terms-text,
  .bv-terms-text code,
  .bv-terms-subsection-label {
    color: var(--bv-print-text) !important;
  }

  .bv-terms-subsection {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .bv-terms-section::after {
    background: linear-gradient(
      90deg,
      transparent,
      var(--bv-print-border),
      transparent
    );
  }

  .bv-terms-text code {
    background: #f5f5f5 !important;
    border-color: var(--bv-print-border) !important;
  }

  .bv-terms-text a {
    color: var(--bv-print-text) !important;
    border: 0 !important;
    background: none !important;
  }
}
