/* =========================================================================
   MVZ Roth — Global Styles overrides
   -------------------------------------------------------------------------
   THIS FILE IS DELIBERATELY UNLAYERED. It is the only one in the theme that
   is, and it is enqueued last.

   Why it has to exist: WordPress emits theme.json's Global Styles as ordinary,
   unlayered CSS — `h1, h2, h3, h4, h5, h6 { color: … }`,
   `:where(a:not(.wp-element-button)) { color: … }` and so on. Unlayered rules
   beat every layered rule no matter how specific, so the moment the rest of the
   theme moved into `@layer`, those element rules started repainting the site's
   own chrome: footer headings turned near-black on a near-black background, and
   the primary call-to-action turned teal on near-black.

   That trade-off is worth keeping. Layering is what lets block content authored
   in the editor look in the front end exactly as it looked in the editor. This
   file is the small, explicit list of places where the theme's own furniture
   must win instead — mostly inverted surfaces, where an inherited dark colour is
   a contrast failure rather than a cosmetic difference.

   Rule of thumb: if you are tempted to add something here, first check whether
   it belongs in theme.json instead. Only chrome the editor never renders
   belongs in this file.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */
.btn,
a.btn { text-decoration: none; }

.btn-primary,
a.btn-primary,
.btn-primary:hover,
a.btn-primary:hover { color: var(--paper); }

.btn-outline,
a.btn-outline { color: var(--ink-deep); }
.btn-outline:hover,
a.btn-outline:hover { color: var(--paper); }

.btn-light,
a.btn-light,
.btn-light:hover,
a.btn-light:hover { color: var(--teal-deep); }

.btn-outline-light,
a.btn-outline-light { color: var(--paper); }

.btn-ghost,
a.btn-ghost { color: var(--teal); }

/* -------------------------------------------------------------------------
   Inverted surfaces — dark backgrounds where an inherited ink colour would be
   unreadable rather than merely wrong.
   ---------------------------------------------------------------------- */

/* Footer */
.site-footer .footer-col-title {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
    opacity: 0.75;
    margin-bottom: var(--space-5);
}
.site-footer a:not(.btn) { color: rgba(250, 247, 242, 0.72); }
.site-footer a:not(.btn):hover { color: var(--clay-soft); }
.site-footer p { color: rgba(250, 247, 242, 0.72); }
.site-footer :is(h1, h2, h3, h4, h5, h6) { color: var(--paper); }
.site-footer .footer-widget a:not(.btn) { color: rgba(250, 247, 242, 0.72); }

/* Featured (dark) service tile */
.service-tile.tile-feat,
.service-tile.tile-feat h3,
.service-tile.tile-feat .arrow-link { color: var(--paper); }
.service-tile.tile-feat p { color: rgba(250, 247, 242, 0.78); }

/* Emergency band — a LIGHT surface (alert-soft). Restated here only because
   theme.json's heading colour would otherwise override the deliberate
   type hierarchy inside the cards, not because it is inverted. */
.emergency-section .emergency-header h2 { color: var(--ink-deep); }
.emergency-section .emergency-box h3 {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.emergency-section .emergency-desc,
.emergency-section .emergency-label { color: var(--ink-soft); }
.emergency-section a.emergency-number,
.emergency-section a.emergency-number:hover { color: var(--alert); }

/* First-appointment card — inverted. */
.info-card :is(h1, h2, h3, h4, h5, h6) { color: var(--paper); }
.info-card :is(p, li) { color: rgba(250, 247, 242, 0.82); }
.info-card a:not(.btn) { color: var(--clay-soft); }

/* Floating statistic on the about image */
.about-stat-float,
.about-stat-float .stat-num,
.about-stat-float .stat-label { color: var(--paper); }

/* Subpage call-to-action strip — inverted. */
.subpage-cta :is(h1, h2, h3) { color: var(--paper); }
.subpage-cta h2 em { color: var(--clay-soft); }
.subpage-cta p { color: rgba(250, 247, 242, 0.82); }

/* Cookie banner — inverted. */
.cookie-banner :is(p, h2, h3) { color: var(--paper); }
.cookie-banner a:not(.btn):not([class*="btn-"]) { color: var(--paper); }

/* Scroll-to-top control */
.scroll-top { color: var(--paper); }

/* -------------------------------------------------------------------------
   Chrome headings that are not document headings in the editorial sense
   ---------------------------------------------------------------------- */

/* The mobile panel's group labels are headings for screen-reader navigation,
   but they must read as small kickers, not as display type. */
.mobile-nav h2.sub-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--teal);
    opacity: 0.75;
}

/* The hero headline is larger than the document-wide h1 preset. */
.hero-title { font-size: var(--text-mega); }

/* Section headings keep the editorial scale the layout was designed around. */
.section-title { font-size: var(--text-3xl); }
.team-section-header .section-title { font-size: var(--text-3xl); }
.map-consent h2 { font-size: var(--text-2xl); color: var(--ink-deep); }

/* Footer column headings must not inherit the h2 display size. */
.footer-col-title { line-height: 1.4; }

/* -------------------------------------------------------------------------
   Contrast corrections
   ---------------------------------------------------------------------- */

/* The brand alert red is a background colour, not a text colour: at 4.08:1 on
   white it misses AA for the small "*" that marks a required field. This darker
   shade of the same hue clears 6.5:1 while still reading as the same red. */
.required-mark,
.field-error,
.form-feedback.error { color: #9c3520; }

/* Main location card — inverted. */
.location-card.main-loc :is(h1, h2, h3, h4, h5, h6) { color: var(--paper); }
.location-card.main-loc,
.location-card.main-loc .location-detail { color: rgba(250, 247, 242, 0.82); }
.location-card.main-loc a:not(.btn) { color: rgba(250, 247, 242, 0.9); }
.location-card.main-loc a:not(.btn):hover { color: var(--clay-soft); }
.location-card.main-loc .loc-icon { color: var(--clay-soft); }
.location-card:not(.main-loc) a:not(.btn) { color: var(--teal); }

/* The skip link sits on a near-black chip. Global Styles would otherwise paint
   it teal — invisible against that chip at the exact moment it appears, which
   is the one moment it has to be readable (WCAG 2.4.1 + 1.4.3). */
.skip-link,
.skip-link:focus,
.skip-link:hover { color: var(--paper); }

/* -------------------------------------------------------------------------
   Link distinction in running text (WCAG 1.4.1)
   -------------------------------------------------------------------------
   theme.json turns the global link underline off on purpose — it was painting
   navigation, buttons and card links as well, which read as broken. The
   underline belongs wherever a link sits *inside a sentence*, because there
   colour alone is not enough to tell it apart from the words around it (teal on
   ink-soft is 1.31:1, well under the 3:1 the criterion asks for).

   blocks.css covers links inside block content, so the editor shows them the
   same way. This block covers the theme's own prose: consent text, field hints,
   callouts, legal pages and the no-JS fallbacks.
   ---------------------------------------------------------------------- */
.form-consent a,
.field-hint a,
.form-noscript a,
.info-box a,
.content-none a,
.legal-content :is(p, li, dd, td) a,
.content-block :is(p, li, dd, td, blockquote) a:not(.btn),
.entry-content :is(p, li, dd, td, blockquote) a:not(.btn),
.subpage-content :is(p, li, dd) a:not(.btn),
.item-desc a,
.team-bio a {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.form-consent a:hover,
.info-box a:hover,
.content-block :is(p, li) a:not(.btn):hover,
.entry-content :is(p, li) a:not(.btn):hover {
    text-decoration-thickness: 2px;
}

/* -------------------------------------------------------------------------
   Footer widget area
   -------------------------------------------------------------------------
   Widget titles are real headings, so Global Styles renders them at display
   size — an "Archive" widget shouted louder than the practice's own name. They
   are labels for a list of links, and should read like the column headings
   beside them.
   ---------------------------------------------------------------------- */
/* Block-based widgets (WordPress 5.8+) ignore `before_title` from
   register_sidebar() and render their own <h2 class="wp-block-heading">, so the
   rule has to match any heading inside the widget area, not just the class the
   theme asked for. */
.site-footer .footer-widget-title,
.site-footer .footer-widget :is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
    opacity: 0.75;
    margin-bottom: var(--space-4);
}
.site-footer .footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-10);
}
.site-footer .footer-widget :is(ul, ol) {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer .footer-widget li { margin-bottom: var(--space-2); }
.site-footer .footer-widget :is(li, p) {
    font-size: var(--text-sm);
    color: rgba(250, 247, 242, 0.72);
}

/* -------------------------------------------------------------------------
   Footer bottom row
   -------------------------------------------------------------------------
   The scroll-to-top control is fixed to the bottom-right corner and was sitting
   on top of the Impressum / Datenschutz links — the two links a German site is
   legally required to keep reachable.
   ---------------------------------------------------------------------- */
@media (min-width: 721px) {
    .footer-bottom { padding-inline-end: 72px; }
}

/* Once the footer is on screen there is no content left below, so the control
   steps aside rather than covering it. */
.site-footer { scroll-margin-bottom: 0; }

/* -------------------------------------------------------------------------
   Team edit shortcut (Customizer preview only)
   -------------------------------------------------------------------------
   theme.json's `elements.link` colour is unlayered Global Styles, so it beats
   anything in components.css no matter how the layers are ordered. The pill
   sits on a dark petrol background and needs white text to stay legible, so
   the rule lives here, in the one deliberately unlayered file.
   ---------------------------------------------------------------------- */
.subpage-content .team-card a.team-card-edit,
.subpage-content .team-card a.team-card-edit:hover,
.subpage-content .team-card a.team-card-edit:focus,
.subpage-content .team-card a.team-card-edit:visited {
    color: #fff;
    text-decoration: none;
    text-decoration-line: none;
    text-underline-offset: 0;
}
.team-card .team-card-edit {
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-card .team-card-edit:hover { background: #0d4a5c; }

/* =========================================================================
   PRESS FEEDBACK AND TOUCH TARGETS
   -------------------------------------------------------------------------
   Two gaps this closes, both of which only show up on a phone.

   1. Nothing in the theme had an `:active` state. Every affordance was a
      hover — which does not exist on touch. Tapping a button produced no
      acknowledgement at all until the next page painted, so on a slow
      connection the site felt broken and people tapped twice. Feedback
      belongs on pointer-down, not on release.

   2. Several targets were well under the 44px that a fingertip needs. The
      worst were the ones that matter most to a practice: the phone and
      e-mail links in the location cards measured 16px tall, the mobile menu
      items 37px, and the consent checkbox 18px.

   The inline links are enlarged with a pseudo-element rather than padding,
   so the hit area grows without moving a single pixel of the layout.
   ====================================================================== */

/* ---- 1. Press feedback ---------------------------------------------- */
:is(.btn, .wp-element-button, button, [role="button"]):active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

:is(.nav-menu a, .mobile-menu a, .footer-widget a, .loc-phone, .loc-email, .team-card a):active {
    opacity: 0.6;
    transition: opacity 80ms ease-out;
}

/* A press is a state change, not a journey — keep it even when motion is
   reduced, but drop the movement and keep only the fade. */
@media (prefers-reduced-motion: reduce) {
    :is(.btn, .wp-element-button, button, [role="button"]):active {
        transform: none;
        opacity: 0.7;
    }
}

/* ---- 2. Touch targets ------------------------------------------------ */
@media (pointer: coarse) {
    /*
     * Stacked links get real height, not a pseudo-element hit area. Expanding
     * a 16px link to 44px with a pseudo-element would make neighbouring links
     * in the same column overlap, and a mis-tap on a phone number is worse
     * than a small one. Lists that run horizontally can safely grow outwards,
     * so those keep the invisible hit area and the layout stays put.
     */
    .loc-phone,
    .loc-email,
    .footer-col a,
    .mobile-menu a,
    .nav-menu a,
    .legal-nav a {
        display: flex;
        align-items: center;
        min-block-size: 44px;
    }

    /* Horizontal rows: grow the hit area, leave the layout alone. */
    .footer-bottom a,
    .breadcrumb a {
        position: relative;
    }
    .footer-bottom a::after,
    .breadcrumb a::after {
        content: '';
        position: absolute;
        inset-inline: -8px;
        inset-block: calc((44px - 100%) / -2);
        min-block-size: 44px;
    }

    /* Buttons and form controls. */
    .btn,
    .wp-element-button,
    button[type="submit"] {
        min-block-size: 44px;
    }

    .mvz-form :is(input, select, textarea) {
        min-block-size: 44px;
    }

    /* Checkboxes and radios, including the DSGVO consent box. */
    .mvz-form input[type="checkbox"],
    .mvz-form input[type="radio"] {
        inline-size: 1.5rem;
        block-size: 1.5rem;
        min-block-size: 0;
        accent-color: var(--teal, #0d4a5c);
    }

    /*
     * The control that opens the menu measured 25px wide: its `width` lived in
     * a desktop-only media query, and as a flex item with the default
     * `flex-shrink: 1` it collapsed to the width of its three bars.
     */
    .hamburger {
        flex: 0 0 auto;
        inline-size: 44px;
        min-inline-size: 44px;
        block-size: 44px;
    }

    /* The logo is the route home from every page. */
    .logo {
        display: inline-flex;
        align-items: center;
        min-block-size: 44px;
    }
}

/* =========================================================================
   TRANSLUCENCY AND CONTRAST PREFERENCES
   -------------------------------------------------------------------------
   The header, the off-canvas menu and the overlay are translucent
   `backdrop-filter` layers. Two accessibility settings ask for something
   different, and neither was honoured: one wants the frosting solid, the
   other wants a defined edge. Both are cheap to answer.
   ====================================================================== */
@media (prefers-reduced-transparency: reduce) {
    .site-header,
    .mobile-menu,
    .menu-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--paper, #faf7f2);
    }
    .menu-overlay { background: rgb(6 42 54 / 0.92); }
}

@media (prefers-contrast: more) {
    .site-header,
    .mobile-menu {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--paper, #faf7f2);
        border-block-end: 2px solid var(--ink-deep, #0a1518);
    }
    :is(.btn, .wp-element-button) {
        border: 2px solid currentColor;
    }
    :focus-visible {
        outline-width: 3px;
    }
}
