/* UBS Deutschland — Base Typography, Grid & Interactive Primitives */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-page);
  overflow-x: clip;
  max-width: 100%;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* High-contrast Swiss accessible focus outline */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* Skip Links */
.skip-links {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 2000;
  display: flex;
  gap: 8px;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  background: var(--text-primary);
  color: var(--text-inverted);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 2000;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--page-gutter) * 2);
  padding-inline: var(--page-gutter);
  margin-inline: auto;
}

/* Typography Hierarchy */
h1, .h1 {
  margin: 0 0 1rem;
  font-weight: 300;
  font-size: clamp(2rem, 3.1vw, 2.875rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h2, .h2 {
  margin: 0 0 1rem;
  font-weight: 300;
  font-size: clamp(1.625rem, 2.35vw, 2.1875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h3, .h3 {
  margin: 0 0 0.65rem;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.4vw, 1.375rem);
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.lead-text {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.muted-text {
  color: var(--text-secondary);
}

/* UBS signature short red bar under major section H2 */
.heading-red-bar {
  position: relative;
  padding-bottom: 0.9rem;
  margin-bottom: 1.25rem;
}

.heading-red-bar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  background-color: var(--brand-red);
}

/* Buttons & Links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.35rem;
  border-radius: 0;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-red);
  color: var(--text-inverted);
}

.btn-primary:hover {
  background-color: var(--brand-red-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--text-primary);
  color: var(--text-inverted);
}

.btn-outline-light {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-outline-light:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-surface);
}

.btn-chevron {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-chevron .chevron-icon {
  color: var(--brand-red);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.btn-chevron:hover {
  color: var(--brand-red);
}

.btn-chevron:hover .chevron-icon {
  transform: translateX(3px);
}

.btn-chevron-down:hover .chevron-icon {
  transform: translateY(3px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden {
  display: none !important;
}

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