/* ==========================================================================
   MEDSENSE V2 — Base Styles
   Reset, Typography, Grid, Buttons, Utilities
   ========================================================================== */

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-medium);
    line-height: var(--lh-body);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    font-style: italic;
}

a {
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover,
a:focus-visible {
    color: var(--color-tertiary);
}

ul,
ol {
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ── @font-face (lokale Fonts) ── */
@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair/PlayfairDisplay-Regular.woff2') format('woff2'),
         url('../fonts/playfair/PlayfairDisplay-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair/PlayfairDisplay-Medium.woff2') format('woff2'),
         url('../fonts/playfair/PlayfairDisplay-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair/PlayfairDisplay-SemiBold.woff2') format('woff2'),
         url('../fonts/playfair/PlayfairDisplay-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair/PlayfairDisplay-Bold.woff2') format('woff2'),
         url('../fonts/playfair/PlayfairDisplay-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair/PlayfairDisplay-Italic.woff2') format('woff2'),
         url('../fonts/playfair/PlayfairDisplay-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Light.woff2') format('woff2'),
         url('../fonts/roboto/Roboto-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Regular.woff2') format('woff2'),
         url('../fonts/roboto/Roboto-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Medium.woff2') format('woff2'),
         url('../fonts/roboto/Roboto-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Bold.woff2') format('woff2'),
         url('../fonts/roboto/Roboto-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    color: var(--color-black);
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

p {
    margin-bottom: var(--space-sm);
    max-width: 72ch;
}

strong, b { font-weight: var(--fw-bold); }
em, i { font-style: italic; }

/* ── Layout: Container ── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.container--narrow {
    max-width: 900px;
}

.container--wide {
    max-width: 1440px;
}

/* ── Layout: Section ── */
.section {
    padding-block: var(--section-padding);
}

.section--dark {
    background-color: var(--color-extra-dark);
    color: var(--color-light);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
    color: var(--color-white);
}

.section--cream {
    background-color: var(--color-cream);
}

.section--blush {
    background-color: var(--color-blush);
}

/* ── Layout: Grid ── */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 991px) {
    .grid--3,
    .grid--4,
    .grid--6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .grid--2,
    .grid--3,
    .grid--4,
    .grid--6 { grid-template-columns: 1fr; }
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: var(--fs-small);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background-color: transparent;
    color: var(--color-primary);
}

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

.btn--outline:hover,
.btn--outline:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn--dark {
    background-color: var(--color-dark);
    color: var(--color-white);
    border-color: var(--color-dark);
}

.btn--dark:hover,
.btn--dark:focus-visible {
    background-color: transparent;
    color: var(--color-dark);
}

.btn--white {
    background-color: var(--color-white);
    color: var(--color-dark);
    border-color: var(--color-white);
}

.btn--white:hover,
.btn--white:focus-visible {
    background-color: transparent;
    color: var(--color-white);
}

/* ── Utilities ── */
.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;
}

.text-center { text-align: center; }
.text-upper { text-transform: uppercase; letter-spacing: 0.1em; }

/* ==========================================================================
   GLOBAL OVERLINE — Label mit dekorativen Linien links + rechts
   ========================================================================== */
.overline {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-primary);
    font-family: var(--font-body);
}

.overline::before,
.overline::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--color-primary);
    opacity: 0.5;
    flex-shrink: 0;
}

/* ==========================================================================
   GLOBAL BUTTONS — Einheitlicher Hover-Effekt (scaleX Sweep) auf allen Seiten
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 16px 42px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease-out);
    z-index: 0;
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* ── Primary: Dunkler Hintergrund, weisser Text ── */
.btn--primary {
    background: var(--color-dark);
    color: var(--color-white);
    border-color: var(--color-dark);
}

.btn--primary::before {
    background: #000;
}

.btn--primary:hover {
    border-color: #000;
    color: var(--color-white);
}

/* ── Outline: Transparent mit Border ── */
.btn--outline {
    background: transparent;
    color: var(--color-dark);
    border-color: var(--color-dark);
}

.btn--outline::before {
    background: var(--color-dark);
}

.btn--outline:hover {
    color: var(--color-white);
}

/* ── CTA Dark (auf Primary/farbigem Hintergrund) ── */
.btn-cta-dark {
    background: var(--color-dark);
    color: var(--color-white);
    border-color: var(--color-dark);
}

.btn-cta-dark::before {
    background: #000;
}

.btn-cta-dark:hover {
    border-color: #000;
    color: var(--color-white);
}

/* ── CTA Dark Outline ── */
.btn-cta-dark-outline {
    background: transparent;
    color: var(--color-dark);
    border-color: var(--color-dark);
}

.btn-cta-dark-outline::before {
    background: var(--color-dark);
}

.btn-cta-dark-outline:hover {
    color: var(--color-white);
}

/* ── Outline: Dark border auf hellem Hintergrund (Startseite-Kompatibel) ── */
.btn-outline {
    background: transparent;
    color: var(--color-extra-dark, var(--color-dark));
    border-color: var(--color-extra-dark, var(--color-dark));
}

.btn-outline::before {
    background: var(--color-extra-dark, var(--color-dark));
}

.btn-outline:hover {
    color: #fff;
}

/* ── Primary Filled: Brand-Farbe ── */
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary::before {
    background: var(--color-tertiary);
}

.btn-primary:hover {
    border-color: var(--color-tertiary);
}

/* ── Gold outline (for dark backgrounds) ── */
.btn-gold {
    background: transparent;
    color: var(--color-primary-light, #e0b5ad);
    border-color: var(--color-primary);
}

.btn-gold::before {
    background: var(--color-primary);
}

.btn-gold:hover {
    color: var(--color-dark);
}

/* ── Ghost outline (for dark backgrounds) ── */
.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost::before {
    background: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── White outline (for dark backgrounds) ── */
.btn-white {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-white::before {
    background: #fff;
}

.btn-white:hover {
    color: var(--color-dark);
}

/* ==========================================================================
   GLOBAL SCROLL ARROWS — Animierte Chevron-Pfeile im Hero
   ========================================================================== */
.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.hero-scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
    transform: rotate(45deg);
    animation: scrollArrow 2s ease-in-out infinite;
}

.hero-scroll-arrow:nth-child(2) {
    margin-top: -10px;
    animation-delay: 0.15s;
    animation-name: scrollArrow2;
}

.hero-scroll-arrow:nth-child(3) {
    margin-top: -10px;
    animation-delay: 0.3s;
    animation-name: scrollArrow3;
}

@keyframes scrollArrow {
    0%   { opacity: 0; transform: rotate(45deg) translate(-6px, -6px); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: rotate(45deg) translate(6px, 6px); }
}

@keyframes scrollArrow2 {
    0%   { opacity: 0; transform: rotate(45deg) translate(-6px, -6px); }
    50%  { opacity: 0.5; }
    100% { opacity: 0; transform: rotate(45deg) translate(6px, 6px); }
}

@keyframes scrollArrow3 {
    0%   { opacity: 0; transform: rotate(45deg) translate(-6px, -6px); }
    50%  { opacity: 0.3; }
    100% { opacity: 0; transform: rotate(45deg) translate(6px, 6px); }
}

/* Auf hellen Hintergründen: dunkle Pfeile */
.hero-scroll--dark .hero-scroll-arrow {
    border-right-color: rgba(58, 42, 32, 0.3);
    border-bottom-color: rgba(58, 42, 32, 0.3);
}

/* ==========================================================================
   GLOBAL CTA FINAL — Wiederverwendbare CTA-Section (template-parts/sections/cta)
   ========================================================================== */
.cta-final {
    padding: 12rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--color-primary);
}

.cta-final .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 3rem;
}

.cta-final::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    animation: ctaPulse 6s ease-in-out infinite;
}

.cta-final::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    animation: ctaPulse 6s ease-in-out infinite 2s;
}

.cta-final-circle-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    animation: ctaPulse 6s ease-in-out infinite 4s;
}

@keyframes ctaPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
    50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 0.4; }
}

.cta-final-inner {
    position: relative;
    z-index: 1;
}

.cta-final h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.cta-final h2 em {
    font-style: italic;
    color: #fff;
}

.cta-final p {
    color: #fff;
    font-size: 0.95rem;
    max-width: 380px;
    margin: 0 auto 3rem;
    line-height: 1.9;
}

.cta-final-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .cta-final-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1.5rem;
    }

    .cta-final-buttons .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .cta-final h2 {
        font-size: clamp(1.85rem, 8vw, 2.3rem);
        letter-spacing: -0.02em;
        line-height: 1.15;
        margin-bottom: 1.25rem;
    }

    .cta-final p {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 2.25rem;
    }
}

/* ── Reduced Motion ── */
@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;
    }
}
