/*
Theme Name: Arztpraxis
Description: Moderne Single-Page Website fuer eine Hausarztpraxis – mobile-first, vanilla JS
Version: 2.1.0
Author: Arztpraxis Team
Text Domain: arztpraxis
License: MIT
*/

/* =========================================================
   0.  CUSTOM PROPERTIES
   ========================================================= */
:root {
    /* colours — derived from Visitenkarte */
    --c-primary:       #183c64;          /* Visitenkarte Hauptblau           */
    --c-primary-light: #5080a0;          /* Visitenkarte helles Blau         */
    --c-accent:        #a8cc28;          /* Visitenkarte Blattgruen          */
    --c-accent-light:  #bcd850;          /* Visitenkarte Gruen hell          */
    --c-dark:          #0e1f34;          /* Noch dunkler als Hauptblau       */
    --c-text:          #2a3040;          /* Dunkelblau-Grau fuer Fliesstext  */
    --c-text-light:    #506888;          /* Visitenkarte Mittelblau-Grau     */
    --c-bg:            #f8f8f8;          /* Visitenkarte Hintergrund         */
    --c-white:         #ffffff;
    --c-border:        #dce4ec;

    /* hero gradient — Visitenkarten-Blautöne */
    --c-hero-1: #183c64;
    --c-hero-2: #2d4470;
    --c-hero-3: #1b5068;
    --c-hero-4: #5080a0;

    /* typography */
    --f-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --f-serif: Georgia, 'Times New Roman', serif;

    /* spacing */
    --s-section: 5rem;
    --s-gap:     2rem;
    --max-w:     1100px;
    --radius:    12px;

    /* transitions */
    --ease: cubic-bezier(.4, 0, .2, 1);
}

/* =========================================================
   1.  RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--f-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-primary); text-decoration: none; }

ul { list-style: none; }

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =========================================================
   2.  HEADER / NAVIGATION
   ========================================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: .85rem 0;
    transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
}

/* scrolled state – added by JS */
.site-header.scrolled {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 12px rgba(0,0,0,.06);
    padding: .55rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--c-white);
    transition: color .4s var(--ease);
}
.site-header.scrolled .site-brand { color: var(--c-primary); }
.site-brand a { color: inherit; }

/* custom-logo in header */
.site-brand .custom-logo-link { display: flex; align-items: center; }
.site-brand .custom-logo {
    max-height: 36px;
    width: auto;
    transition: filter .4s var(--ease);
}
/* invert logo on hero (white), normal when scrolled */
.site-header:not(.scrolled) .site-brand .custom-logo {
    filter: brightness(0) invert(1);
}

/* --- hamburger --- */
.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 110;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--c-white);
    transition: transform .35s var(--ease), opacity .25s var(--ease), background .4s var(--ease);
}
.site-header.scrolled .nav-toggle span { background: var(--c-primary); }

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* when menu is open, always white lines */
.nav-toggle.active span { background: var(--c-white); }

/* --- nav overlay (mobile) --- */
.main-nav {
    position: fixed;
    inset: 0;
    background: rgba(14,31,52,.95);          /* --c-dark with alpha */
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.main-nav.open { opacity: 1; visibility: visible; }

.main-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}
.main-nav a {
    color: var(--c-white);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: .02em;
    position: relative;
    padding: .15rem 0;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--c-accent-light);
    transition: width .3s var(--ease);
}
.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }

/* =========================================================
   3.  HERO
   ========================================================= */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.25rem 4rem;
    color: var(--c-white);
    background: linear-gradient(-45deg,
        var(--c-hero-1), var(--c-hero-2),
        var(--c-hero-3), var(--c-hero-4));
    background-size: 300% 300%;
    animation: gradientShift 18s ease infinite;
    overflow: hidden;
}

@keyframes gradientShift {
    0%   { background-position:   0%  50%; }
    50%  { background-position: 100%  50%; }
    100% { background-position:   0%  50%; }
}

/* subtle floating circles */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: .07;
    background: var(--c-white);
    pointer-events: none;
}
.hero::before { width: 420px; height: 420px; top: -120px; right: -100px; }
.hero::after  { width: 300px; height: 300px; bottom: -80px; left: -60px; }

.hero-inner { position: relative; z-index: 1; max-width: 680px; }

.hero-badge {
    display: inline-block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .35rem 1rem;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50px;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp .8s var(--ease) .3s forwards;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: .6rem;
    opacity: 0;
    animation: fadeUp .8s var(--ease) .5s forwards;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 400;
    opacity: .85;
    margin-bottom: .3rem;
    opacity: 0;
    animation: fadeUp .8s var(--ease) .7s forwards;
}

.hero-spec {
    font-size: .95rem;
    opacity: .6;
    letter-spacing: .03em;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeUp .8s var(--ease) .9s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeUp .8s var(--ease) 1.1s forwards;
}

.hero-cta a {
    display: inline-block;
    padding: .8rem 2rem;
    border: 2px solid var(--c-white);
    border-radius: 50px;
    color: var(--c-white);
    font-weight: 600;
    font-size: .95rem;
    transition: background .3s var(--ease), color .3s var(--ease);
}
.hero-cta a:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-dark);
}

/* scroll indicator */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeUp .8s var(--ease) 1.6s forwards, bounce 2.5s ease-in-out 2.4s infinite;
}
.scroll-hint span {
    display: block;
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255,255,255,.4);
    border-radius: 14px;
    position: relative;
}
.scroll-hint span::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    background: rgba(255,255,255,.6);
    border-radius: 2px;
    animation: scrollDot 2s ease-in-out infinite;
}
@keyframes scrollDot {
    0%, 100% { opacity: 1; transform: translateY(0); }
    60%      { opacity: 0; transform: translateY(12px); }
}
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* =========================================================
   4.  SECTIONS (GENERIC)
   ========================================================= */
.section {
    padding: var(--s-section) 0;
}
.section--alt {
    background: var(--c-white);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}
.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: .6rem;
}
.section-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--c-primary);
    line-height: 1.2;
}
.section-divider {
    width: 50px;
    height: 3px;
    background: var(--c-accent);
    border: none;
    border-radius: 3px;
    margin: 1rem auto 0;
}

/* =========================================================
   5.  ABOUT SECTION
   ========================================================= */
.about-grid {
    display: grid;
    gap: var(--s-gap);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--c-text);
}
.about-text p:last-child { margin-bottom: 0; }

.about-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.value-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.value-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(24,60,100,.08);
}
.value-icon {
    font-size: 1.6rem;
    margin-bottom: .4rem;
}
.value-card h3 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--c-primary);
}

/* =========================================================
   6.  SERVICES SECTION
   ========================================================= */
.services-grid {
    display: grid;
    gap: var(--s-gap);
}

.service-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--c-accent), var(--c-primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease);
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(24,60,100,.1);
}

.service-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: .5rem;
}
.service-card p {
    font-size: .92rem;
    color: var(--c-text-light);
    line-height: 1.65;
}

/* =========================================================
   7.  TEAM SECTION
   ========================================================= */

/* -- Group titles (Ärzteteam / Praxisteam) -- */
.team-group-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary-light);
    letter-spacing: .04em;
    margin-bottom: 1.8rem;
}
.team-group-title--mfa {
    margin-top: 3rem;
}

/* -- Grid layouts -- */
.team-grid {
    display: grid;
    gap: var(--s-gap);
    justify-items: center;
    margin-bottom: 1rem;
}
.team-grid--arzt {
    /* Doctors: single column, centred, max-width cards */
    grid-template-columns: 1fr;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}
.team-grid--mfa {
    grid-template-columns: 1fr;
}

/* -- Team card (shared) -- */
.team-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

/* -- Avatar (initials circle) -- */
.team-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    margin: 0 auto 1.2rem;
    display: grid;
    place-items: center;
    color: var(--c-white);
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 30px rgba(24,60,100,.15);
}
.team-avatar--sm {
    width: 90px;
    height: 90px;
    font-size: 1.8rem;
}

/* -- Avatar photo -- */
.team-avatar-img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.2rem;
    box-shadow: 0 8px 30px rgba(24,60,100,.15);
}
.team-avatar-img--sm {
    width: 90px;
    height: 90px;
}

/* -- Card typography -- */
.team-card h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--c-primary);
    margin-bottom: .2rem;
}
.team-card--mfa h4 {
    font-size: 1.05rem;
}
.team-role {
    color: var(--c-accent);
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .6rem;
}
.team-bio {
    color: var(--c-text-light);
    font-size: .92rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* =========================================================
   8.  CONTACT / HOURS SECTION
   ========================================================= */
.contact-grid {
    display: grid;
    gap: var(--s-gap);
}

.contact-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
}
.contact-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--c-accent);
    color: var(--c-white);
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
}
.hours-table tr { border-bottom: 1px solid var(--c-border); }
.hours-table tr:last-child { border-bottom: none; }
.hours-table td {
    padding: .55rem 0;
    font-size: .92rem;
}
.hours-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--c-primary);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0;
    font-size: .95rem;
    color: var(--c-text);
    transition: color .25s var(--ease);
}
.contact-link:hover { color: var(--c-accent); }
.contact-link-label {
    font-weight: 600;
    min-width: 3.5rem;
}

/* -- Embedded map -- */
.contact-map {
    margin-top: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.contact-map iframe {
    display: block;
    width: 100%;
    min-height: 200px;
}
.contact-map-link {
    display: block;
    text-align: center;
    padding: .5rem;
    font-size: .8rem;
    color: var(--c-primary-light);
    transition: color .25s var(--ease);
}
.contact-map-link:hover {
    color: var(--c-accent);
}

/* =========================================================
   9.  FOOTER
   ========================================================= */
.site-footer {
    background: var(--c-dark);
    color: rgba(255,255,255,.55);
    padding: 2.5rem 0;
    font-size: .85rem;
    text-align: center;
}
.site-footer a {
    color: rgba(255,255,255,.75);
    transition: color .25s var(--ease);
}
.site-footer a:hover { color: var(--c-accent-light); }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: .6rem;
}
.footer-copy { opacity: .6; }

/* =========================================================
   10.  REVEAL ANIMATIONS  (driven by JS)
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }
.reveal[data-delay="5"] { transition-delay: .5s; }

/* =========================================================
   11.  PAGE TEMPLATE (Impressum / Datenschutz)
   ========================================================= */
.page-content {
    padding: 8rem 0 var(--s-section);
}
.page-content h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--c-primary);
    margin-bottom: 1.5rem;
}
.page-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-primary);
    margin: 2rem 0 .75rem;
}
.page-content p {
    margin-bottom: 1rem;
    color: var(--c-text);
}

/* =========================================================
   12.  KEYFRAME HELPERS
   ========================================================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   13.  ACCESSIBILITY
   ========================================================= */
.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;
}

:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 3px;
}

/* =========================================================
   14.  MEDIA QUERIES  (mobile-first → tablet → desktop)
   ========================================================= */

/* --- tablet (640px) --- */
@media (min-width: 40em) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .team-grid--mfa {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- desktop (960px) --- */
@media (min-width: 60em) {
    :root {
        --s-section: 6.5rem;
    }

    /* desktop nav */
    .nav-toggle { display: none; }

    .main-nav {
        position: static;
        background: none;
        backdrop-filter: none;
        opacity: 1;
        visibility: visible;
    }
    .main-nav ul {
        flex-direction: row;
        gap: 2rem;
    }
    .main-nav a {
        font-size: .9rem;
        color: var(--c-white);
        transition: color .4s var(--ease);
    }
    .site-header.scrolled .main-nav a {
        color: var(--c-text);
    }
    .site-header.scrolled .main-nav a:hover,
    .site-header.scrolled .main-nav a.active {
        color: var(--c-primary);
    }

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

    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .team-grid--mfa {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================================
   15.  PRINT
   ========================================================= */
@media print {
    .site-header, .site-footer, .scroll-hint, .nav-toggle { display: none; }
    .hero { min-height: auto; padding: 2rem; print-color-adjust: exact; }
    .section { padding: 1.5rem 0; }
}
