/* MVZ Roth — Reusable components: buttons, notices, section headers, content blocks, team cards, legal pages.
   Part of the MVZ Roth theme. Cascade layer: components (order declared in style.css). */
@layer components {
    /* =========================================================================
       BUTTONS
       ========================================================================= */
    .btn {
        display: inline-flex; align-items: center; gap: var(--space-2);
        padding: var(--space-4) var(--space-8);
        border-radius: var(--r-pill);
        font-family: var(--font-body);
        font-size: var(--text-sm); font-weight: 500;
        border: 1px solid transparent;
        cursor: pointer;
        transition: all var(--t-base) var(--ease);
        text-align: center; line-height: 1; letter-spacing: -0.005em;
        position: relative; overflow: hidden;
    }
    .btn-primary { background: var(--ink-deep); color: var(--paper); }
    .btn-primary:hover { background: var(--teal); color: var(--paper); transform: translateY(-2px); box-shadow: var(--shadow); }
    
    .btn-outline {
        background: transparent; color: var(--ink-deep);
        border-color: var(--line-strong);
    }
    .btn-outline:hover { border-color: var(--ink-deep); background: var(--ink-deep); color: var(--paper); transform: translateY(-2px); }
    
    .btn-outline-light {
        background: transparent; color: var(--paper);
        border-color: rgba(255, 255, 255, 0.3);
    }
    .btn-outline-light:hover { border-color: var(--paper); background: var(--paper); color: var(--ink-deep); transform: translateY(-2px); }
    
    .btn-light {
        background: var(--paper); color: var(--ink-deep);
    }
    .btn-light:hover { background: var(--pure-white); transform: translateY(-2px); box-shadow: var(--shadow); }
    
    .btn-ghost {
        background: transparent; color: var(--teal);
        padding: var(--space-3) 0; border: none;
    }
    .btn-ghost:hover { color: var(--ink-deep); }
    .btn-ghost::after {
        content: '→'; transition: transform var(--t-base) var(--ease);
        display: inline-block; margin-left: var(--space-1);
    }
    .btn-ghost:hover::after { transform: translateX(4px); }
    

    /* =========================================================================
       NOTICE BAR (Announcements / Vacation)
       ========================================================================= */
    .notice-bar {
        background: var(--clay-pale);
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        padding: var(--space-5) 0;
    }
    .notice-bar.vacation-notice { background: var(--teal-pale); }
    .notice-inner {
        max-width: var(--container);
        margin: 0 auto;
        padding: 0 var(--gutter);
        display: flex; align-items: flex-start; gap: var(--space-5);
    }
    .notice-icon {
        flex-shrink: 0; width: 36px; height: 36px;
        background: var(--clay); color: var(--paper);
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-family: var(--font-display); font-weight: 600;
        font-size: var(--text-base);
    }
    .vacation-notice .notice-icon { background: var(--teal); }
    .notice-content { flex: 1; padding-top: 6px; }
    .notice-content strong {
        display: block;
        font-family: var(--font-display); font-size: var(--text-lg);
        color: var(--ink-deep); font-weight: 500;
        margin-bottom: var(--space-1); letter-spacing: -0.01em;
    }
    .notice-content p {
        font-size: var(--text-sm); color: var(--ink-soft);
        line-height: 1.6; margin: 0;
    }
    

    /* =========================================================================
       SECTIONS — common
       ========================================================================= */
    section { padding: var(--section-y) 0; }
    .bg-warm { background: var(--paper-warm); }
    .bg-cream { background: var(--paper-cream); }
    .bg-teal { background: var(--teal); color: var(--paper); }
    .bg-ink { background: var(--ink-deep); color: var(--paper); }
    
    .section-label { /* kept for backwards compat */
        display: inline-flex; align-items: center; gap: var(--space-2);
        font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
        color: var(--teal); text-transform: uppercase; letter-spacing: 0.16em;
        margin-bottom: var(--space-4);
    }
    .section-label::before {
        content: ''; width: 24px; height: 1px; background: var(--teal);
    }
    
    .section-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-5);
        max-width: 900px;
        letter-spacing: -0.025em;
    }
    .section-title em { font-style: italic; color: var(--teal); }
    .section-desc {
        font-size: var(--text-lg); color: var(--ink-soft);
        max-width: 660px; line-height: 1.6;
    }
    
    .section-header {
        margin-bottom: var(--space-16);
        display: grid; grid-template-columns: 1fr 1fr;
        gap: var(--space-12); align-items: end;
    }
    .section-header .section-title-group { max-width: 580px; }
    

    /* =========================================================================
       SUBPAGE CONTENT BLOCKS
       ========================================================================= */
    .subpage-content { padding: var(--section-y) 0; }
    .subpage-content .container { max-width: var(--container-narrow); }
    .content-block {
        margin-bottom: var(--space-20);
        padding-bottom: var(--space-20);
        border-bottom: 1px solid var(--line);
        scroll-margin-top: 160px;
    }
    .content-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
    .content-block-header {
        display: flex; align-items: center; gap: var(--space-5);
        margin-bottom: var(--space-8);
    }
    .content-icon {
        width: 56px; height: 56px;
        background: var(--paper-warm);
        border-radius: var(--r);
        display: flex; align-items: center; justify-content: center;
        font-size: 1.5rem; flex-shrink: 0;
        border: 1px solid var(--line);
    }
    .content-block h2 {
        font-size: var(--text-3xl);
        letter-spacing: -0.025em;
    }
    .content-block h2 em { font-style: italic; color: var(--teal); }
    .content-block h3 {
        font-family: var(--font-display);
        font-size: var(--text-xl);
        margin: var(--space-8) 0 var(--space-4);
        color: var(--ink-deep);
        letter-spacing: -0.015em;
    }
    .content-block > p, .content-block > div > p {
        font-size: var(--text-base);
        color: var(--ink-soft);
        line-height: 1.8;
        margin-bottom: var(--space-5);
    }
    .content-block strong { color: var(--ink-deep); font-weight: 500; }
    
    /* Feature grid */
    .feature-grid {
        display: grid; grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3); margin: var(--space-8) 0;
    }
    .feature-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .feature-item {
        background: var(--paper-warm);
        border-radius: var(--r);
        padding: var(--space-5) var(--space-6);
        border: 1px solid var(--line);
        transition: all var(--t-fast) var(--ease);
    }
    .feature-item:hover { border-color: var(--line-teal); transform: translateY(-2px); }
    .feature-item strong {
        display: block; font-family: var(--font-display);
        font-size: var(--text-base); color: var(--ink-deep);
        font-weight: 500; margin-bottom: var(--space-1);
    }
    .feature-item span { font-size: var(--text-sm); color: var(--ink-soft); }
    
    /* Info box */
    .info-box {
        background: var(--paper-warm);
        border-left: 3px solid var(--clay);
        padding: var(--space-6) var(--space-8);
        border-radius: 0 var(--r) var(--r) 0;
        margin: var(--space-8) 0;
        font-size: var(--text-base);
        line-height: 1.7;
        color: var(--ink);
    }
    .info-box strong { color: var(--ink-deep); }
    .info-box--green {
        background: var(--teal-pale);
        border-left-color: var(--teal);
    }
    
    /* Sub-sections */
    .sub-sections {
        display: flex; flex-direction: column;
        gap: var(--space-5); margin: var(--space-8) 0;
    }
    .sub-section {
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        padding: var(--space-8);
        transition: all var(--t-base) var(--ease);
    }
    .sub-section:hover { border-color: var(--line-teal); box-shadow: var(--shadow-sm); }
    .sub-section h3 { margin-top: 0; color: var(--teal); }
    .sub-section p { margin-bottom: 0; }
    
    /* Gutachten list */
    .gutachten-list {
        display: flex; flex-direction: column;
        gap: var(--space-4); margin: var(--space-8) 0;
    }
    .gutachten-item {
        display: flex; align-items: flex-start; gap: var(--space-5);
        background: var(--paper-warm);
        border-radius: var(--r-lg);
        padding: var(--space-6) var(--space-8);
        border: 1px solid var(--line);
        transition: all var(--t-base) var(--ease);
    }
    .gutachten-item:hover { border-color: var(--line-teal); transform: translateY(-2px); }
    .gutachten-item .item-icon {
        flex-shrink: 0; width: 44px; height: 44px;
        background: var(--ink-deep); color: var(--paper);
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 1rem;
    }
    .gutachten-item strong {
        display: block; font-family: var(--font-display);
        font-size: var(--text-lg); color: var(--ink-deep);
        font-weight: 500; letter-spacing: -0.01em;
    }
    
    /* Subpage CTA */
    .subpage-cta {
        background: var(--ink-deep); color: var(--paper);
        padding: var(--space-20) 0;
        position: relative; overflow: hidden;
    }
    .subpage-cta::before {
        content: ''; position: absolute;
        top: -50%; right: -10%; width: 600px; height: 600px;
        background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
        opacity: 0.3; filter: blur(60px);
    }
    .subpage-cta .container { position: relative; z-index: 2; text-align: center; max-width: 720px; }
    .subpage-cta h2 {
        color: var(--paper); font-size: var(--text-3xl);
        margin-bottom: var(--space-4); letter-spacing: -0.025em;
    }
    .subpage-cta h2 em { font-style: italic; color: var(--clay-soft); }
    .subpage-cta p {
        color: rgba(250, 247, 242, 0.75);
        font-size: var(--text-lg); margin-bottom: var(--space-8);
    }
    

    /* =========================================================================
       TEAM PAGE
       ========================================================================= */
    .team-section-header {
        margin-bottom: var(--space-12);
        max-width: 880px;
    }
    .team-section-header .section-title { margin-bottom: var(--space-4); }
    .team-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-6);
        margin-top: var(--space-12);
    }
    .team-card {
        background: var(--paper);
        border-radius: var(--r-lg);
        overflow: hidden;
        transition: all var(--t-base) var(--ease);
        border: 1px solid var(--line);
    }
    .team-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow);
        border-color: var(--line-teal);
    }
    .team-card-photo {
        position: relative;
        width: 100%; aspect-ratio: 3/4;
        overflow: hidden;
        background: var(--paper-warm);
    }
    .team-card-photo img {
        width: 100%; height: 100%;
        object-fit: cover; object-position: top center;
        transition: transform var(--t-slow) var(--ease);
        filter: contrast(0.95) saturate(0.95);
    }
    .team-card:hover .team-card-photo img {
        transform: scale(1.05);
        filter: contrast(1) saturate(1);
    }
    /* No usable portrait: keep the card's proportions and show the initials
       rather than a broken image or a collapsed box. */
    .team-card-photo.is-placeholder {
        display: grid;
        place-items: center;
        background: var(--paper-warm);
        background:
            linear-gradient(150deg,
                color-mix(in oklab, var(--teal) 10%, var(--paper-warm)),
                var(--paper-warm) 70%);
    }
    .team-initials {
        font-family: var(--font-display);
        font-size: clamp(1.75rem, 5vw, 2.75rem);
        font-weight: 400;
        letter-spacing: 0.06em;
        line-height: 1;
        color: var(--ink-mute);
        color: color-mix(in oklab, var(--teal) 45%, transparent);
        user-select: none;
    }
    .team-card.lead .team-initials { font-size: clamp(2.5rem, 7vw, 4rem); }

    /* Customizer preview only — never rendered for visitors. */
    .team-card { position: relative; }
    .team-card-edit {
        position: absolute;
        inset-block-start: 8px;
        inset-inline-end: 8px;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border-radius: 999px;
        background: var(--teal-deep, #062a36);
        color: #fff;
        font-family: var(--font-body, sans-serif);
        font-size: 0.75rem;
        line-height: 1.2;
        text-decoration: none;
        box-shadow: 0 2px 8px rgb(6 42 54 / 0.28);
        opacity: 0;
        transition: opacity var(--t, 0.2s) var(--ease, ease);
    }
    .team-card:hover .team-card-edit,
    .team-card-edit:focus-visible { opacity: 1; }
    .team-card-edit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    @media (prefers-reduced-motion: reduce) {
        .team-card-edit { transition: none; }
    }
    .team-card-info { padding: var(--space-6); }
    .team-card-info h3 {
        font-family: var(--font-display);
        font-size: var(--text-lg);
        color: var(--ink-deep);
        margin-bottom: var(--space-1);
        line-height: 1.2;
        letter-spacing: -0.015em;
    }
    .team-role {
        font-size: var(--text-sm);
        color: var(--teal); font-weight: 500;
    }
    .team-note {
        display: block;
        font-size: var(--text-xs); color: var(--ink-mute);
        font-style: italic; margin-top: var(--space-1);
    }
    .team-card.lead {
        grid-column: span 2;
        display: grid; grid-template-columns: 1fr 1fr;
    }
    .team-card.lead .team-card-photo { aspect-ratio: auto; min-height: 380px; }
    .team-card.lead .team-card-info {
        display: flex; flex-direction: column; justify-content: center;
        padding: var(--space-10);
    }
    .team-card.lead h3 {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-2);
    }
    .team-card.lead .team-role { font-size: var(--text-base); }
    .team-bio {
        font-size: var(--text-sm); color: var(--ink-soft);
        line-height: 1.7; margin-top: var(--space-4);
    }
    
    .team-additional {
        margin-top: var(--space-10);
        padding: var(--space-8);
        background: var(--paper-warm);
        border-radius: var(--r-lg);
        border: 1px solid var(--line);
        font-size: var(--text-sm); color: var(--ink-soft);
        line-height: 1.8;
    }
    .team-additional strong {
        display: block;
        color: var(--ink-deep); font-family: var(--font-display);
        font-size: var(--text-base); font-weight: 500;
        margin-bottom: var(--space-2);
    }
    .gallery-grid {
        display: grid; grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4); margin-top: var(--space-6);
    }
    .gallery-grid img {
        border-radius: var(--r);
        width: 100%; aspect-ratio: 4/3;
        object-fit: cover;
    }
    

    /* =========================================================================
       LEGAL (Datenschutz / Impressum)
       ========================================================================= */
    .legal-content { padding: var(--section-y) 0; }
    .legal-content .container { max-width: var(--container-narrow); }
    .legal-content h2 {
        font-size: var(--text-2xl);
        margin: var(--space-12) 0 var(--space-4);
        padding-top: var(--space-8);
        border-top: 1px solid var(--line);
        letter-spacing: -0.02em;
    }
    .legal-content h2:first-child {
        margin-top: 0; padding-top: 0; border-top: none;
    }
    .legal-content h3 {
        font-size: var(--text-lg);
        margin: var(--space-6) 0 var(--space-3);
    }
    .legal-content p {
        color: var(--ink-soft); line-height: 1.8;
        margin-bottom: var(--space-4);
    }
    .legal-content ul, .legal-content ol {
        margin: var(--space-4) 0; padding-left: var(--space-6);
    }
    .legal-content li {
        color: var(--ink-soft); line-height: 1.7;
        margin-bottom: var(--space-2); list-style: disc;
    }
    .legal-content a {
        color: var(--teal); text-decoration: underline;
        text-underline-offset: 3px;
    }
    

    /* =========================================================================
       RESPONSIVE — components
       ========================================================================= */
    @media (max-width: 980px) {
        .section-header { grid-template-columns: 1fr; gap: var(--space-6); }
        .team-grid { grid-template-columns: repeat(3, 1fr); }
        .team-card.lead { grid-column: span 3; }
    }
    
    @media (max-width: 720px) {
        .team-grid { grid-template-columns: repeat(2, 1fr); }
        .team-card.lead { grid-column: span 2; grid-template-columns: 1fr; }
        .team-card.lead .team-card-photo { min-height: 320px; }
        .feature-grid, .feature-grid.cols-3 { grid-template-columns: 1fr; }
    }
    
    @media (max-width: 480px) {
        .team-grid { grid-template-columns: 1fr; }
        .team-card.lead { grid-column: span 1; }
        .content-block-header { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
    }


/* -------------------------------------------------------------------------
   Markup refinements (v3)
   ---------------------------------------------------------------------- */

/* Buttons now wrap their text in .btn-label and may carry an inline SVG. */
.btn { gap: var(--space-2); }
.btn svg { flex: 0 0 auto; }
.btn-sm {
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-6);
}

/* Focus/hover parity with the block editor's Button block, which is styled
   from theme.json — the two must not diverge visually. */
.btn:focus-visible { outline-offset: 3px; }

/* About badges are a list now. */
.about-badges { list-style: none; padding: 0; }
.about-badges li { display: flex; }

/* Section headings may contain an italic accent fragment. */
.section-title em { font-style: italic; color: var(--teal); }


/* -------------------------------------------------------------------------
   Subpage content — semantic markup adjustments (v3)
   ---------------------------------------------------------------------- */

/* Icon containers are inline elements now (a <span> around an SVG), not divs
   with an emoji inside. */
.content-icon,
.item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    flex: 0 0 auto;
}
.content-icon svg { width: 24px; height: 24px; }
.item-icon svg { width: 20px; height: 20px; }

/* Definition/enumeration lists that used to be stacks of divs. */
.gutachten-list { list-style: none; padding: 0; margin: 0; }
.gutachten-item { align-items: flex-start; }

.item-desc {
    margin: 4px 0 0;
    font-size: var(--text-sm);
    color: var(--ink-mute);
}
.item-note {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--ink-mute);
}
.item-list {
    margin: var(--space-3) 0 0;
    padding-inline-start: 1.25rem;
    list-style: disc;
    font-size: var(--text-sm);
    color: var(--ink-soft);
}
.item-list li { margin-bottom: 0.3rem; }

.section-gap { margin-top: var(--space-16); }
.section-gap-sm { margin-top: var(--space-8); }
.subpage-content--flush { padding-bottom: 0; }

/* Call-to-action strips are always centred; the templates no longer say so
   inline. */
.subpage-cta .container { text-align: center; }

/* Callout boxes now carry an optional icon. */
.info-box { display: flex; gap: var(--space-4); align-items: flex-start; }
.info-box-icon { color: var(--clay); flex: 0 0 auto; }
.info-box-icon svg { width: 20px; height: 20px; }
.info-box--warning {
    border-inline-start: 3px solid var(--alert);
    background: var(--alert-soft);
}
.info-box--warning .info-box-icon { color: var(--alert); }
.info-box--info {
    border-inline-start: 3px solid var(--teal);
    background: var(--teal-pale);
}
.info-box--info .info-box-icon { color: var(--teal); }
.info-box p:last-child { margin-bottom: 0; }

/* Post summaries and pagination. */
.content-summary .summary-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}
.entry-meta {
    font-size: var(--text-sm);
    color: var(--ink-mute);
    margin-bottom: var(--space-4);
}
.entry-thumbnail {
    border-radius: var(--r-lg);
    margin-bottom: var(--space-8);
}
.summary-more { margin-top: var(--space-4); }

.pagination,
.navigation.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* WCAG 2.5.5 — a 44px target, not a bare number. */
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--pure-white);
    color: var(--ink-soft);
    font-size: var(--text-sm);
}
.pagination .page-numbers.current {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--paper);
}
.pagination .page-numbers:hover { border-color: var(--teal); color: var(--teal); }
.pagination .page-numbers.current:hover { color: var(--paper); }

.post-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--line);
}
.post-navigation .nav-label {
    display: block;
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: var(--space-1);
}

/* Empty states. */
.content-none-lede { font-size: var(--text-lg); margin-bottom: var(--space-6); }
.content-none-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-6);
    list-style: none;
    padding: 0;
}
.content-none-links a { text-decoration: underline; text-underline-offset: 2px; }

/* Search form. */
.search-form { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.search-field {
    flex: 1 1 220px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--pure-white);
    color: var(--ink);
}

/* Field hints inside forms. */
.field-hint {
    font-size: var(--text-sm);
    color: var(--ink-mute);
    margin: 0;
}
.form-noscript {
    margin-top: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--alert);
    border-radius: var(--r-sm);
}

/* Team cards. */
.team-grid { list-style: none; padding: 0; }


/* -------------------------------------------------------------------------
   Flex/grid shrink fix (WCAG 1.4.10)
   -------------------------------------------------------------------------
   A flex or grid item defaults to `min-width: auto`, which refuses to shrink
   below its longest word. With German headings — "Kooperationspartner",
   "Elektroenzephalogramm" — that pushed text past the viewport at 320px and the
   overflow was clipped, losing content. Resetting min-width lets the box shrink
   so wrapping and hyphenation can do their job.
   ---------------------------------------------------------------------- */
.content-block-header > *,
.gutachten-item > *,
.feature-item > *,
.location-detail > *,
.info-box > *,
.section-title-group > *,
.team-card-info > *,
.hours-row > * {
    min-width: 0;
    /*
     * `anywhere`, not `break-word`. Both break a too-long word visually, but
     * only `anywhere` also reduces the element's min-content contribution —
     * which is what flex and grid use when deciding how far an item may shrink.
     * With `break-word` the box still claimed the width of the longest word and
     * overflowed its container regardless.
     */
    overflow-wrap: anywhere;
}
.content-block-header,
.gutachten-item,
.location-detail,
.info-box { flex-wrap: wrap; }


/* -------------------------------------------------------------------------
   Team page (v3.1) — semantic lists
   ---------------------------------------------------------------------- */
.team-grid { list-style: none; padding: 0; margin: 0; }
.team-card { margin: 0; }

.gallery-grid { list-style: none; padding: 0; }
.gallery-grid li { display: flex; margin: 0; }
.gallery-grid li img { width: 100%; height: 100%; object-fit: cover; }

/* The intro is prose, so its paragraphs need rhythm between them. */
.team-intro-text > * + * { margin-block-start: var(--space-5); }

.team-additional p { margin: 0; }
.team-additional p + p { margin-block-start: var(--space-2); }

}
