/* PROVIDER PAGES STYLING */
/* ====================== */

/* OPTIMAL PROVIDER ARCHIVE PAGE STYLING */
/* ======================================= */

/* Shadow on all provider cards */
.provider-card {
    box-shadow: var(--wp--preset--shadow--natural);
}

/* Specialty links inherit card text color and have no underline by default */
.provider-card p a {
    color: inherit;
    text-decoration: none;
}

.provider-card p a:hover {
    text-decoration: underline;
}

/* Provider archive page specific styles */
.post-type-archive-providers .provider-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Provider photo styling - centered and enlarged (2x size) */
.post-type-archive-providers .wp-block-post-featured-image {
    align-self: center;
    margin-bottom: var(--wp--preset--spacing--medium);
    width: min(560px, 100%);
    height: auto;
    aspect-ratio: 1;
}

.post-type-archive-providers .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 1;
    border-radius: 12px;
}

/* Provider name styling - centered */
.post-type-archive-providers .wp-block-post-title {
    text-align: center;
    margin-bottom: var(--wp--preset--spacing--small);
}

/* FORCE INLINE SPECIALTIES DISPLAY - High specificity to override theme styles */
body.post-type-archive-providers .provider-card .wp-block-paragraph {
    display: inline;
    text-align: center;
    font-size: 0.875rem;
    color: var(--wp--preset--color--contrast);
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* Add small space between "Specialties:" and the specialty */
body.post-type-archive-providers .provider-card .wp-block-paragraph + .wp-block-paragraph {
    margin-left: 4px;
}

/* Remove any line breaks */
body.post-type-archive-providers .provider-card .wp-block-paragraph br {
    display: none;
}

/* Force all nested elements to be inline */
body.post-type-archive-providers .provider-card .wp-block-paragraph * {
    display: inline;
}

/* Ensure the container centers the inline content */
body.post-type-archive-providers .provider-card .wp-block-group {
    text-align: center;
}

/* Accepting patients status - centered */
.post-type-archive-providers .wp-block-post-meta {
    text-align: center;
    margin-top: var(--wp--preset--spacing--small);
}

/* Responsive adjustments for provider photos - now scales automatically with min() */
@media (max-width: 768px) {
    .post-type-archive-providers .wp-block-post-featured-image {
        width: min(480px, 95vw);
    }

    /* Stack provider cards into a single column on mobile.
       The grid container gets a WP-generated hash class that changes on redeploy,
       so we target the stable structural classes instead. !important beats the
       inline <style> block WordPress injects for the generated class. */
    .post-type-archive-providers .wp-block-group.alignwide.is-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .post-type-archive-providers .wp-block-post-featured-image {
        width: min(400px, 90vw);
    }
}

/* Legacy provider specialties styling (if shortcodes still used) */
.provider-specialties {
    text-align: left;
    font-size: 0.875rem;
    color: #666;
    margin-top: 8px;
}

.provider-specialties strong {
    color: var(--wp--preset--color--primary);
    font-weight: 600;
}

/* Modern H3 provider specialties styling */
.provider-specialties-h3,
.provider-specialties-section .wp-block-heading {
    text-align: left !important;
    font-style: italic !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    opacity: 0.9 !important;
    margin: 0 !important;
}

/* Ensure specialties section container is left-aligned */
.provider-specialties-section {
    text-align: left !important;
}

/* Provider Biography Formatting */
/* Ensure biography paragraphs display with proper spacing and formatting */
.single-providers .wp-block-paragraph:has-text("Dr.") {
    line-height: 1.6;
    margin-bottom: var(--wp--preset--spacing--medium);
    text-align: left;
}

/* Bio content specific styling */
.single-providers [data-key="provider_bio"],
.single-providers .provider-bio-content {
    line-height: 1.6;
    margin-bottom: var(--wp--preset--spacing--medium);
}

/* Ensure bio paragraphs have proper spacing */
.single-providers .provider-bio-content p,
.single-providers [data-key="provider_bio"] p {
    margin-bottom: var(--wp--preset--spacing--medium);
    line-height: 1.6;
    text-align: left;
}

/* Handle WordPress auto-paragraph formatting in Block Bindings */
.single-providers .wp-block-paragraph[style*="provider_bio"] p {
    margin-bottom: var(--wp--preset--spacing--medium);
    line-height: 1.6;
}

/* PERFORMANCE OPTIMIZATIONS - Phase 4 */

/* CSS Performance: Minimize reflows and improve paint efficiency */

/* Use efficient selectors and avoid complex descendant selectors */
:root {
    /* CSS Custom Properties for better performance */
    --provider-photo-size: clamp(280px, 30vw, 400px);
    --provider-grid-gap: clamp(1rem, 4vw, 3rem);
    --animation-duration: 0.3s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-transition: box-shadow var(--animation-duration) var(--animation-easing);
    --transform-transition: transform var(--animation-duration) var(--animation-easing);
}

/* Optimize paint layers and compositing */
.provider-photo,
.wp-block-button__link,
.provider-badge,
.credentials-card,
.contact-section-card {
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden; /* Reduce paint complexity */
}

/* Use transform and opacity for animations (GPU-accelerated) */
.provider-photo {
    transform: translate3d(0, 0, 0); /* Hardware acceleration */
    transition: var(--transform-transition), var(--shadow-transition);
}

/* Efficient grid layouts without expensive calculations */
.provider-main-layout {
    display: grid;
    grid-template-columns: var(--provider-photo-size) 1fr;
    gap: var(--provider-grid-gap);
    contain: layout style; /* CSS Containment for performance */
}

/* Reduce layout thrashing with CSS containment */
.provider-info-section {
    contain: layout style;
    isolation: isolate; /* Create stacking context efficiently */
}

.credentials-card {
    contain: layout style paint;
    transform: translate3d(0, 0, 0);
}

/* Optimize text rendering */
.provider-name-h1,
h2, h3, h4,
.wp-block-heading {
    text-rendering: optimizeSpeed; /* Faster text rendering */
    font-display: swap; /* Optimize font loading */
}

/* Efficient badge layouts */
.badge-group {
    display: flex; /* More efficient than grid for simple cases */
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--small);
    contain: layout;
}

/* Minimize style recalculations */
.provider-badge {
    display: inline-block; /* Avoid inline layout complexity */
    contain: size layout style;
    transform: translate3d(0, 0, 0);
}

/* Optimize button performance */
.wp-block-button__link {
    contain: layout style;
    transform: translate3d(0, 0, 0);
    transition: var(--transform-transition), var(--shadow-transition);
}

/* Performance-optimized media queries */
@media (max-width: 768px) {
    .provider-main-layout {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--large);
    }
}

/* Reduce paint operations on scroll */
.provider-photo img {
    image-rendering: auto; /* Let browser optimize */
    transform: translate3d(0, 0, 0);
}

/* Efficient responsive images */
.provider-photo .wp-block-post-featured-image {
    contain: size layout;
    overflow: hidden;
}

/* Center the featured image figure within the provider-photo container
   so overflow is clipped equally from both sides on mobile.
   left: 50% offsets by half the container width; translateX(-50%) offsets
   back by half the figure's own width — net result: (figureW - containerW) / 2
   on each side. At desktop where both are 400px the net offset is 0px. */
.single-providers .provider-photo .wp-block-post-featured-image {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* Critical CSS isolation */
.above-fold {
    contain: layout style paint;
}

.below-fold {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Override theme.json H1 hiding for provider pages - Allow editor control */
html body.single-providers .provider-name-h1.wp-block-post-title,
html body.single-providers .wp-block-post-title,
html body.single-providers main h1,
html body.single-providers h1 {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 0 !important;
    display: block !important;
    /* Allow editor to control font-size, color, and other styling */
}

/* Specific targeting for post title blocks */
html body.single-providers .wp-block-post-title {
    position: static !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Allow editor padding controls to work for all sections */

/* Editor padding controls are now free to work */

/* Allow editor padding controls to work */

/* Responsive image optimization and scaling */

/* Profile photo styling for square display */
.provider-photo .wp-block-post-featured-image img {
    aspect-ratio: 1 !important;
    object-fit: cover;
    object-position: center center;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive image container */
.provider-photo {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image loading optimization */
.provider-photo img {
    /* Note: loading and decoding are HTML attributes, not CSS properties */
    /* They are handled via PHP filters in functions.php */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Image placeholder while loading */
.provider-photo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--wp--preset--color--porcelain-light) 25%, transparent 25%, transparent 75%, var(--wp--preset--color--porcelain-light) 75%), 
                linear-gradient(45deg, var(--wp--preset--color--porcelain-light) 25%, transparent 25%, transparent 75%, var(--wp--preset--color--porcelain-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.provider-photo img:not([src]) + ::before,
.provider-photo img[src=""] + ::before {
    opacity: 1;
}

/* Progressive image enhancement */
.provider-photo img.loading {
    opacity: 0;
    transform: scale(1.05);
}

.provider-photo img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Responsive image sizing for different breakpoints */
@media (max-width: 480px) {
    .provider-photo {
        max-width: 280px;
        margin-inline: auto;
    }
    
    .provider-photo .wp-block-post-featured-image img {
        aspect-ratio: 4/5;
        object-position: center 20%;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .provider-photo {
        max-width: 320px;
        margin-inline: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .provider-photo {
        max-width: 300px;
    }
}

@media (min-width: 1025px) {
    .provider-photo {
        max-width: 400px;
    }

    /* Enable sticky positioning ONLY on single provider pages for better UX */
    .single-providers .provider-photo {
        position: sticky;
        top: var(--wp--preset--spacing--large);
    }

    /* Archive pages: keep static to prevent title overlap */
    .post-type-archive-providers .provider-photo {
        position: static;
    }

    .provider-photo:hover {
        opacity: 0.8;
    }
}

/* High-DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .provider-photo .wp-block-post-featured-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Art direction for different orientations */
@media (orientation: landscape) and (max-width: 1024px) {
    .provider-photo {
        max-width: 240px;
    }
    
    .provider-photo .wp-block-post-featured-image img {
        aspect-ratio: 1/1;
        object-position: center center;
    }
}

/* Print media optimizations */
@media print {
    .provider-photo {
        max-width: 200px;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--wp--preset--color--neutral-light);
    }
    
    .provider-photo .wp-block-post-featured-image img {
        filter: grayscale(100%);
    }
}

/* CRITICAL PATH OPTIMIZATION */

/* Critical path CSS - above the fold content */
.provider-info-section {
    /* Critical content should render immediately */
    content-visibility: visible;
    contain: none; /* Don't contain critical content */
}

.provider-name-h1,
.provider-specialty-badge {
    /* Ensure critical text renders immediately */
    content-visibility: visible;
    font-display: swap; /* Optimize font loading */
}

/* Progressive loading for below-the-fold content */
.below-fold,
.credentials-card,
.contact-section-card {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px; /* Prevent layout shift */
}

/* Ensure critical text renders quickly for LCP */
.provider-name-h1 {
    /* Critical text optimization */
    font-display: swap;
    /* Prevent font-related LCP delays */
    font-synthesis: none;
    /* Optimize text rendering */
    text-rendering: optimizeSpeed;
}

/* ACCESSIBILITY AND DESIGN IMPROVEMENTS */

/* Simple hover/focus effects - opacity only (scoped to provider content, not nav) */
main a:hover,
main a:focus,
main button:hover,
main button:focus,
main .wp-block-button__link:hover,
main .wp-block-button__link:focus,
main .wp-block-button__link:active {
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    transform: none !important;
    text-decoration: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .provider-status-badge,
    .provider-specialty-badge {
        border: 2px solid currentColor;
        font-weight: 700;
    }
}

/* Enhanced touch interactions and mobile patterns */
@media (max-width: 768px) {
    .wp-block-button__link {
        min-height: 48px;
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-large);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* No scale effects */
}

/* Touch-friendly interactive elements */
.provider-badge {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* No active effects */

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

/* RESPONSIVE TYPOGRAPHY */

/* Responsive adjustments with better accessibility */
@media (max-width: 768px) {
    .wp-block-columns {
        flex-direction: column !important;
    }
    
    .provider-photo {
        max-width: 300px;
        margin: 0 auto var(--wp--preset--spacing--large);
        order: -1;
    }
    
    .provider-photo + .wp-block-column {
        text-align: center;
    }
    
    /* Fluid typography improvements */
    .provider-name-h1 {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
        line-height: clamp(1.2, 1.4, 1.3);
        letter-spacing: -0.02em;
    }
    
    /* Enhanced typography scale with fluid sizing */
    h2, .wp-block-heading h2 {
        font-size: clamp(1.5rem, 3vw, 2rem);
        line-height: 1.3;
        letter-spacing: -0.01em;
    }
    
    h3, .wp-block-heading h3 {
        font-size: clamp(1.25rem, 2.5vw, 1.5rem);
        line-height: 1.4;
    }
    
    h4, .wp-block-heading h4 {
        font-size: clamp(1.125rem, 2vw, 1.25rem);
        line-height: 1.4;
    }
    
    /* Improved body text readability */
    p, .wp-block-paragraph {
        line-height: clamp(1.5, 1.6 + 0.2vw, 1.7);
        letter-spacing: 0.01em;
    }
    
    /* Enhanced large text */
    .has-large-font-size {
        line-height: clamp(1.4, 1.5 + 0.1vw, 1.6);
    }
}

/* Mobile-first typography scaling with better readability */
@media (max-width: 480px) {
    .provider-name-h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        line-height: 1.2;
        letter-spacing: -0.01em;
        margin-block-end: var(--wp--preset--spacing--x-small);
    }
    
    h2, .wp-block-heading h2 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
        line-height: 1.3;
        margin-block-end: var(--wp--preset--spacing--small);
    }
    
    h3, .wp-block-heading h3 {
        font-size: clamp(1.125rem, 4vw, 1.375rem);
        line-height: 1.4;
        margin-block-end: var(--wp--preset--spacing--small);
    }
    
    p, .wp-block-paragraph {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        margin-block-end: var(--wp--preset--spacing--medium);
    }
    
    .has-large-font-size {
        font-size: clamp(1.05rem, 4vw, 1.25rem);
        line-height: 1.55;
    }
    
    .has-small-font-size {
        font-size: clamp(0.8rem, 3vw, 0.9rem);
        line-height: 1.5;
    }
}

/* Tablet typography adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .provider-name-h1 {
        font-size: clamp(1.75rem, 4.5vw, 2.25rem);
        line-height: 1.25;
    }
    
    h2, .wp-block-heading h2 {
        font-size: clamp(1.5rem, 3.5vw, 1.875rem);
        line-height: 1.3;
    }
    
    p, .wp-block-paragraph {
        font-size: clamp(1rem, 3vw, 1.125rem);
        line-height: 1.65;
    }
}

/* Desktop typography optimization */
@media (min-width: 1025px) {
    .provider-name-h1 {
        font-size: clamp(2rem, 3vw, 2.75rem);
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    h2, .wp-block-heading h2 {
        font-size: clamp(1.75rem, 2.5vw, 2.25rem);
        line-height: 1.3;
    }
    
    h3, .wp-block-heading h3 {
        font-size: clamp(1.375rem, 2vw, 1.625rem);
        line-height: 1.4;
    }
    
    p, .wp-block-paragraph {
        font-size: clamp(1.1rem, 1.5vw, 1.25rem);
        line-height: 1.7;
        max-width: 65ch;
    }
    
    .has-large-font-size {
        font-size: clamp(1.25rem, 2vw, 1.5rem);
        line-height: 1.6;
        max-width: 60ch;
    }
}

/* MODERN LAYOUTS */

/* Modern layout with CSS Grid and logical properties */
.provider-info-section {
    padding-block: var(--wp--preset--spacing--x-large);
    padding-inline: var(--wp--preset--spacing--medium);
}

/* Enhanced grid layouts for better responsive design */
.wp-block-columns.provider-main-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 2fr;
    gap: var(--wp--preset--spacing--xx-large);
    align-items: start;
}

.credentials-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--wp--preset--spacing--x-large);
    align-items: start;
}

/* Advanced responsive breakpoints with mobile-first approach */

/* Small mobile devices (320px - 480px) */
@media (max-width: 480px) {
    .provider-main-layout {
        grid-template-columns: 1fr !important;
        gap: var(--wp--preset--spacing--medium);
        padding-inline: var(--wp--preset--spacing--small);
    }
    
    .provider-photo {
        justify-self: center;
        max-width: 280px;
        margin-block-end: var(--wp--preset--spacing--medium);
    }
    
    .provider-info-section {
        padding-inline: var(--wp--preset--spacing--small);
        padding-block: var(--wp--preset--spacing--large);
    }
    
    .badge-group {
        justify-content: center;
        gap: var(--wp--preset--spacing--x-small);
    }
    
    .provider-badge {
        font-size: var(--wp--preset--font-size--tiny);
        padding: var(--wp--preset--spacing--x-small) var(--wp--preset--spacing--small);
    }
    
    .credentials-columns {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--medium);
    }
    
    .contact-section-card {
        margin-inline: var(--wp--preset--spacing--small);
        padding-inline: var(--wp--preset--spacing--medium);
    }
}

/* Large mobile devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .provider-main-layout {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--large);
    }
    
    .provider-photo {
        justify-self: center;
        max-width: 320px;
        margin-block-end: var(--wp--preset--spacing--large);
    }
    
    .credentials-columns {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--large);
    }
    
    .badge-group {
        justify-content: center;
    }
}

/* Tablet devices (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .provider-main-layout {
        grid-template-columns: 1fr 1.5fr;
        gap: var(--wp--preset--spacing--x-large);
    }
    
    .provider-photo {
        max-width: 280px;
    }
    
    .credentials-columns {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--x-large);
    }
}

/* Small desktop (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    .provider-main-layout {
        grid-template-columns: minmax(300px, 1fr) 2fr;
        gap: var(--wp--preset--spacing--xx-large);
    }
    
    .credentials-columns {
        grid-template-columns: 1fr 1fr;
        gap: var(--wp--preset--spacing--x-large);
    }
}

/* Large desktop (1201px+) */
@media (min-width: 1201px) {
    .provider-main-layout {
        grid-template-columns: minmax(320px, 1fr) 2.2fr;
        gap: clamp(var(--wp--preset--spacing--xx-large), 4vw, var(--wp--preset--spacing--xxx-large));
    }
    
    .credentials-columns {
        grid-template-columns: 1fr 1fr;
        gap: var(--wp--preset--spacing--xx-large);
    }
    
    .provider-info-section {
        padding-inline: var(--wp--preset--spacing--large);
    }
}

/* MODERN CARD DESIGNS */

/* Modern card design with enhanced visual hierarchy */
.credentials-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
    border: none;
}

.credentials-card::before {
    display: none;
}

.credentials-card:hover {
    box-shadow: none;
    transform: none;
    border-color: transparent;
}

.credentials-card:hover::before {
    display: none;
}

/* Enhanced contact section card */
.contact-section-card {
    background: var(--wp--preset--color--pickled-bluewood);
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    border: none;
}

.contact-section-card::before {
    display: none;
}

.contact-section-card:hover::before {
    display: none;
}

/* PERFORMANCE OPTIMIZED ANIMATIONS */

/* 60fps optimized animations - only animate transform and opacity */
.wp-block-button__link {
    /* Separate transitions for different properties to avoid expensive 'all' */
    transition: transform var(--animation-duration) var(--animation-easing),
                opacity var(--animation-duration) var(--animation-easing),
                box-shadow var(--animation-duration) var(--animation-easing);
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0); /* Force hardware acceleration */
    will-change: transform; /* Only transform will change during animations */
    backface-visibility: hidden; /* Prevent flickering */
}

/* Remove shimmer effect */

/* Simple button effects - already handled by global styles above */

/* Simple badge effects - opacity only */
.provider-badge {
    transition: opacity 0.2s ease;
    cursor: default;
}

.provider-badge:hover {
    opacity: 0.8;
}

/* Optimized animation performance with reduce motion support */
@media (prefers-reduced-motion: reduce) {
    .wp-block-button__link,
    .provider-badge,
    .wp-block-group,
    .provider-photo,
    .credentials-card {
        transition: none;
        transform: none;
        animation: none;
    }
    
    .wp-block-button__link::before {
        display: none; /* Remove shimmer effect */
    }
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* ADVANCED IMAGE LOADING AND OPTIMIZATION */

/* Reduced data preferences */
@media (prefers-reduced-data: reduce) {
    .provider-photo img {
        content-visibility: auto;
        contain-intrinsic-size: 300px 400px;
    }
}

/* Remove focus outlines for images */
.provider-photo:focus-within {
    outline: none;
}

/* Image container for better aspect ratio control */
.responsive-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--wp--preset--color--porcelain-light);
}

.responsive-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.3s ease-in-out;
}

/* MEMORY OPTIMIZATION AND EFFICIENT DOM MANAGEMENT */

/* Optimize memory usage with efficient CSS patterns */
.memory-optimized {
    /* Minimize DOM complexity */
    contain: strict; /* Full containment for memory isolation */
    content-visibility: auto;
    contain-intrinsic-size: 300px 200px;
}

/* Efficient pseudo-element usage to reduce DOM nodes */
.pseudo-optimized::before,
.pseudo-optimized::after {
    /* Reduce memory by using pseudo-elements instead of extra DOM nodes */
    content: '';
    position: absolute;
    /* Use CSS containment to isolate memory usage */
    contain: layout style paint;
}

/* Optimize large content areas */
.large-content-area {
    /* Use content-visibility for memory efficiency */
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Efficient badge rendering to reduce memory */
.badge-optimized {
    /* Use efficient display properties */
    display: inline-flex; /* More efficient than inline-block for complex layouts */
    align-items: center;
    justify-content: center;
    /* Minimize reflows */
    contain: size layout;
    /* Optimize for memory */
    will-change: auto; /* Only set will-change when actively animating */
}

/* Memory-efficient image handling */
.image-memory-optimized {
    /* Optimize image memory usage */
    object-fit: cover;
    object-position: center;
    /* Use CSS containment to isolate image rendering */
    contain: size layout style;
    /* Prevent memory leaks from large images */
    max-width: 100%;
    height: auto;
}

/* Efficient grid layouts for memory */
.grid-memory-optimized {
    display: grid;
    /* Use efficient grid properties that don't cause memory overhead */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--wp--preset--spacing--medium);
    /* Isolate grid computation */
    contain: layout;
}

/* Optimize for scroll performance and memory */
.scroll-optimized {
    /* Use efficient scrolling properties */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Contain scrolling calculations */
    contain: layout style;
}

/* Memory-efficient animations */
.animation-memory-optimized {
    /* Only animate GPU-accelerated properties */
    transition: transform var(--animation-duration) var(--animation-easing),
                opacity var(--animation-duration) var(--animation-easing);
    /* Prepare GPU layer efficiently */
    transform: translateZ(0);
    /* Don't set will-change unless actively animating */
    will-change: auto;
}

/* Optimize for reduced memory usage on mobile */
@media (max-width: 768px) {
    .mobile-memory-optimized {
        /* Reduce complexity on mobile devices */
        contain: layout style;
        /* Simplify rendering */
        box-shadow: none;
        border-radius: 8px; /* Simpler border radius */
    }
    
    /* Reduce animation complexity on mobile */
    .mobile-animation-reduced {
        transition: transform 0.2s ease-out; /* Simpler transitions */
        will-change: auto;
    }
}

/* Memory-efficient utility classes */
.contain-layout { contain: layout; }
.contain-style { contain: style; }
.contain-paint { contain: paint; }
.contain-size { contain: size; }
.contain-strict { contain: strict; }

/* Efficient visibility management */
.visibility-optimized {
    content-visibility: auto;
    contain-intrinsic-size: 0 200px;
}

/* Optimize for memory-constrained devices */
@media (max-memory: 1GB) {
    /* Reduce complexity for low-memory devices */
    .memory-constrained {
        box-shadow: none;
        border-radius: 4px;
        backdrop-filter: none;
        filter: none;
    }
    
    .memory-constrained .provider-badge {
        background: var(--wp--preset--color--porcelain-light);
        border: 1px solid var(--wp--preset--color--porcelain);
    }
    
    .memory-constrained .wp-block-button__link::before {
        display: none; /* Remove shimmer effect */
    }
}

/* Removed duplicate sticky override - now handled in main media query at line 380 */

/* Efficient resource cleanup */
.cleanup-optimized {
    /* Ensure resources are properly managed */
    contain: strict;
    isolation: isolate;
}

/* DOM efficiency patterns */
.dom-efficient {
    /* Minimize DOM complexity */
    contain: layout style paint;
    /* Optimize rendering */
    transform: translateZ(0);
    /* Efficient positioning */
    position: relative;
}

/* CORE WEB VITALS OPTIMIZATION */

/* LCP (Largest Contentful Paint) Optimization */

/* Optimize the provider photo as potential LCP element */
.provider-photo img {
    /* Critical for LCP - load immediately */
    loading: eager;
    decoding: async;
    /* Square aspect ratio for provider photos */
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    /* Optimize for fast rendering */
    image-rendering: auto;
}

/* FID (First Input Delay) Optimization */

/* Optimize interactive elements for fast response */
.wp-block-button__link {
    /* Ensure fast interaction response */
    touch-action: manipulation;
    /* Minimize input delay */
    user-select: none;
    /* Optimize for touch devices */
    -webkit-tap-highlight-color: transparent;
}

/* Minimize JavaScript blocking with CSS */
.interaction-optimized {
    /* Reduce complexity of interactive elements */
    contain: layout style;
    /* Fast interaction response */
    transition: transform 0.1s ease-out; /* Shorter for responsiveness */
}

/* CLS (Cumulative Layout Shift) Prevention */

/* Prevent layout shifts with stable dimensions */
.layout-stable {
    /* Fixed aspect ratios prevent shifts */
    aspect-ratio: 3/4;
    width: 100%;
    /* Reserve space to prevent shifts */
    min-height: 300px;
}

/* Stable grid layout to prevent shifts */
.provider-main-layout {
    /* Stable grid prevents layout shifts */
    grid-template-columns: minmax(280px, 400px) 1fr;
    grid-template-rows: min-content;
    gap: var(--provider-grid-gap);
    /* Prevent content jumping */
    align-items: start;
}

/* Font loading optimization for CLS */
@font-face {
    font-family: 'system-fallback';
    font-display: swap; /* Prevent invisible text during font load */
    src: local('Arial'), local('Helvetica'), local('sans-serif');
    size-adjust: 100%; /* Match fallback size to web font */
}

/* Image placeholder to prevent CLS */
.provider-photo::before {
    content: '';
    display: block;
    /* Maintain aspect ratio to prevent shift */
    aspect-ratio: 3/4;
    background: var(--wp--preset--color--porcelain-light);
    /* Ensure placeholder takes correct space */
    width: 100%;
    min-height: 300px;
}

/* Stable badge dimensions */
.provider-badge {
    /* Prevent badge size changes causing shifts */
    min-width: 120px;
    min-height: 32px;
    /* Stable padding */
    padding: var(--wp--preset--spacing--x-small) var(--wp--preset--spacing--small);
    /* Prevent text reflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stable button dimensions — scoped to provider content area, not nav buttons */
.provider-card .wp-block-button__link,
main .wp-block-button__link:not(.nav-cta-btn .wp-block-button__link) {
    /* Prevent button size changes */
    min-width: 140px;
    min-height: 48px;
    /* Stable layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive breakpoints that minimize CLS */
@media (max-width: 768px) {
    .provider-main-layout {
        /* Stable mobile layout */
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: var(--wp--preset--spacing--large);
    }
    
    .provider-photo {
        /* Stable mobile image size */
        max-width: 300px;
        margin-inline: auto;
    }
}

/* Optimize for Web Vitals scoring */
.web-vitals-optimized {
    /* Comprehensive optimization */
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 300px 400px;
    /* Fast interactions */
    touch-action: manipulation;
    /* Stable dimensions */
    aspect-ratio: attr(width) / attr(height);
}

/* Critical resource optimization */
.critical-resource {
    /* High priority loading */
    loading: eager;
    fetchpriority: high;
    /* Immediate rendering */
    content-visibility: visible;
    contain: none;
}

/* Progressive enhancement for better scores */
@supports (content-visibility: auto) {
    .enhanced-performance {
        content-visibility: auto;
        contain-intrinsic-size: 0 300px;
    }
}

/* Minimize render-blocking CSS */
.non-critical-styles {
    /* Defer non-critical visual enhancements */
    content-visibility: auto;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.non-critical-styles.loaded {
    opacity: 1;
}

/* Performance monitoring helpers */
.performance-marker {
    /* Add performance markers for monitoring */
    position: relative;
}

.performance-marker::before {
    content: attr(data-performance-id);
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* NAVIGATION DROPDOWN STYLING */

/* Provider navigation dropdown styling */
.main-navigation .menu-item-has-children > .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--wp--preset--color--white);
    border-radius: 8px;
    box-shadow: var(--wp--preset--shadow--elevated);
    border: 1px solid var(--wp--preset--color--porcelain);
    min-width: 220px;
    z-index: 1000;
    padding: var(--wp--preset--spacing--small) 0;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.main-navigation .menu-item-has-children:hover > .sub-menu,
.main-navigation .menu-item-has-children:focus-within > .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.main-navigation .sub-menu .menu-item {
    display: block;
    margin: 0;
}

.main-navigation .sub-menu a {
    display: block;
    padding: var(--wp--preset--spacing--small) var(--wp--preset--spacing--medium);
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
}

.main-navigation .sub-menu a:hover,
.main-navigation .sub-menu a:focus {
    background: var(--wp--preset--color--porcelain-light);
    border-left-color: var(--wp--preset--color--mountain-meadow);
    color: var(--wp--preset--color--primary-dark);
    transform: translateX(3px);
}

/* Provider archive link styling */
.main-navigation .sub-menu a[href*="providers"]:first-child {
    font-weight: 600;
    color: var(--wp--preset--color--mountain-meadow);
    border-bottom: 1px solid var(--wp--preset--color--porcelain);
    margin-bottom: var(--wp--preset--spacing--x-small);
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
    .main-navigation .menu-item-has-children > .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        box-shadow: none;
        border: none;
        background: var(--wp--preset--color--porcelain-light);
        border-radius: 0;
        margin-top: var(--wp--preset--spacing--small);
        padding: var(--wp--preset--spacing--small);
    }
    
    .main-navigation .sub-menu a {
        padding: var(--wp--preset--spacing--x-small) var(--wp--preset--spacing--small);
        border-radius: 4px;
        margin-bottom: var(--wp--preset--spacing--x-small);
    }
    
    .main-navigation .sub-menu a:hover {
        background: var(--wp--preset--color--white);
        transform: none;
    }
}

/* Accessibility improvements for navigation */
.main-navigation [aria-expanded="true"] + .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.main-navigation .menu-item-has-children > a::after {
    content: '▼';
    font-size: 0.7rem;
    margin-left: var(--wp--preset--spacing--x-small);
    transition: transform 0.3s ease-in-out;
}

.main-navigation .menu-item-has-children:hover > a::after,
.main-navigation .menu-item-has-children[aria-expanded="true"] > a::after {
    transform: rotate(180deg);
}

/* ENHANCED MOBILE TOUCH INTERACTIONS */

/* Improved scrolling and touch behavior */
.wp-block-group {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
}

/* Enhanced focus indicators for touch devices */
@media (max-width: 768px) {
    *:focus {
        outline: none;
    }
    
    /* Larger touch targets for links and interactive elements */
    a, button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
}

/* Swipe gesture support for image containers */
.provider-photo {
    touch-action: pan-y;
    position: relative;
    overflow: hidden;
}

/* Momentum scrolling for content areas */
.wp-block-group,
.provider-info-section {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Pull-to-refresh prevention */
body {
    overscroll-behavior-y: auto;
}

/* Improved mobile navigation spacing */
@media (max-width: 768px) {
    .wp-block-buttons {
        gap: var(--wp--preset--spacing--medium);
        flex-direction: column;
        align-items: stretch;
    }
    
    .wp-block-button {
        width: 100%;
    }
    
    .wp-block-button__link {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Responsive button grouping */
@media (max-width: 480px) {
    .wp-block-buttons {
        padding-inline: var(--wp--preset--spacing--small);
    }
    
    .wp-block-button__link {
        font-size: var(--wp--preset--font-size--medium);
        padding-block: var(--wp--preset--spacing--large);
    }
}

/* ENHANCED ACCESSIBILITY */

/* Improved badge accessibility */
.provider-badge {
    position: relative;
}

.provider-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    transition: box-shadow 0.2s ease-in-out;
}

.provider-badge:focus-within::before {
    box-shadow: none;
}

/* Text contrast and readability enhancements */
@media (prefers-contrast: high) {
    p, .wp-block-paragraph {
        font-weight: 500;
        color: var(--wp--preset--color--neutral-darkest);
    }
    
    .has-large-font-size {
        font-weight: 500;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .provider-name-h1,
    h2, h3, h4,
    p {
        animation: none;
        transition: none;
    }
}

/* Dynamic text sizing for different orientations */
@media (orientation: landscape) and (max-height: 600px) {
    .provider-name-h1 {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }
    
    h2, .wp-block-heading h2 {
        font-size: clamp(1.125rem, 3vw, 1.5rem);
    }
    
    p, .wp-block-paragraph {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
        line-height: 1.5;
    }
}

/* MODERN DESIGN ENHANCEMENTS */

/* Modern spacing system with logical properties */
.section-spacing {
    margin-block: var(--wp--preset--spacing--x-large);
    padding-block: var(--wp--preset--spacing--large);
    padding-inline: var(--wp--preset--spacing--medium);
}

.content-spacing {
    margin-block-end: var(--wp--preset--spacing--medium);
}

/* Modern container queries support (where available) */
@container (max-width: 600px) {
    .provider-badge {
        font-size: var(--wp--preset--font-size--tiny);
        padding-inline: var(--wp--preset--spacing--x-small);
    }
}

/* Improved color contrast for better readability */
.provider-status-text {
    color: var(--wp--preset--color--neutral-darkest);
    font-weight: 600;
}

/* Loading state for buttons */
.wp-block-button__link.loading {
    pointer-events: none;
    opacity: 0.7;
}

.wp-block-button__link.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: button-loading 1s linear infinite;
}

@keyframes button-loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth image loading states */
.provider-photo img {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 1; /* Ensure images are visible by default */
    transform: scale(1);
}

.provider-photo img.loading {
    opacity: 0;
    transform: scale(1.05);
}

.provider-photo img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Performance-optimized micro-interactions - DISABLED to fix scroll issues */
.wp-block-group {
    /* Disable transform animations that cause scroll issues */
    transition: none !important;
    will-change: auto !important;
    transform: none !important;
}

/* Explicitly prevent hover effects on main content areas that could interfere with navigation */
main.wp-block-group:hover,
.site-header .wp-block-group:hover,
.wp-block-group[role="main"]:hover {
    transform: none !important;
}

/* DISABLE ALL SCROLL-BASED ANIMATIONS TO FIX PROVIDERS PAGE ISSUE */
/* Remove any animations that could cause images to move during scroll */
.provider-card,
.provider-photo,
.wp-block-post-template .wp-block-post,
.archive-providers .wp-block-post {
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
    animation: none !important;
}

.provider-card:hover,
.provider-photo:hover {
    transform: none !important;
}

/* FIX PROVIDER ARCHIVE PAGE IMAGES - SQUARE FORMAT */
/* Force containers to be square - need to override inline styles from WordPress */
body.post-type-archive-providers .wp-block-post-featured-image[style*="aspect-ratio"],
body.post-type-archive-providers .provider-photo[style*="aspect-ratio"],
body.post-type-archive-providers .wp-block-post-featured-image,
body.post-type-archive-providers .provider-photo {
    aspect-ratio: 1 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

/* Ensure provider photos are square on archive page */
body.post-type-archive-providers .wp-block-post img,
body.post-type-archive-providers .wp-block-post-featured-image img,
body.post-type-archive-providers .provider-photo img {
    aspect-ratio: 1 !important;
    object-fit: cover !important;
    object-position: center center !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
}

/* Clean provider name styling for archive page */
body.post-type-archive-providers .wp-block-post h2,
body.post-type-archive-providers .wp-block-post h3,
body.post-type-archive-providers .wp-block-post-title {
    position: relative !important;
    z-index: 10 !important;
    background: transparent !important;
    padding: 0 !important;
    margin-top: var(--wp--preset--spacing--medium) !important;
    text-align: center !important;
}

/* Enhanced provider card styling for archive page */
body.post-type-archive-providers .provider-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid var(--wp--preset--color--porcelain) !important;
}

body.post-type-archive-providers .provider-card:hover {
    opacity: 0.9;
}

/* Provider photo container in archive */
body.post-type-archive-providers .provider-photo {
    margin-bottom: var(--wp--preset--spacing--medium) !important;
    box-shadow: var(--wp--preset--shadow--natural) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Photo effects handled by parent card hover */

/* Ensure proper spacing on archive page */
body.post-type-archive-providers .wp-block-post-meta {
    margin-top: var(--wp--preset--spacing--small) !important;
    text-align: center !important;
}

/* DISABLE OLD NAVIGATION STYLES THAT CONFLICT WITH BLOCK NAVIGATION */
/* These styles were designed for classic menus but interfere with block navigation */

/* Only target legacy navigation if it exists, don't interfere with block navigation */
.main-navigation.legacy-nav .menu-item-has-children > .sub-menu {
    display: none !important;
}

.main-navigation.legacy-nav .menu-item-has-children:hover > .sub-menu,
.main-navigation.legacy-nav .menu-item-has-children:focus-within > .sub-menu {
    display: none !important;
}

/* Ensure block navigation works properly */
.wp-block-navigation-submenu .wp-block-navigation__submenu-container {
    /* Override any conflicting styles from above */
    display: block !important;
    position: absolute !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.wp-block-navigation-submenu:hover .wp-block-navigation__submenu-container {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Remove focus-within enhancements */
.provider-info-section:focus-within,
.credentials-card:focus-within {
    box-shadow: none;
}

/* Fix paragraph breaks in provider bio content */
.single-providers .provider-bio p,
.single-providers [data-key="provider_bio"] p,
.single-providers .wp-block-paragraph {
    margin-bottom: var(--wp--preset--spacing--medium) !important;
    line-height: 1.6 !important;
    white-space: pre-line !important; /* Preserve line breaks from content */
}

/* Ensure line breaks are preserved in meta content */
.single-providers [data-key="provider_bio"] {
    white-space: pre-line !important;
}

/* Provider biography shortcode styling */
.single-providers .wp-block-shortcode p {
    font-size: var(--wp--preset--font-size--large) !important;
    line-height: 1.6 !important;
    color: var(--wp--preset--color--neutral-dark) !important;
    margin-bottom: var(--wp--preset--spacing--medium) !important;
    text-align: left !important;
}

/* Ensure proper paragraph spacing in shortcode output */
.single-providers .wp-block-shortcode {
    margin-bottom: var(--wp--preset--spacing--medium) !important;
}

/* Style the wpautop generated paragraphs */
.single-providers .wp-block-shortcode p:last-child {
    margin-bottom: 0 !important;
}

/* Bio text specific styling - More specific selectors for paragraph breaks */
.single-providers .below-fold .wp-block-paragraph,
.single-providers .wp-block-group .wp-block-paragraph {
    margin-bottom: var(--wp--preset--spacing--medium) !important;
    line-height: 1.6 !important;
    white-space: pre-line !important;
}

/* Post content area - ensure proper paragraph spacing */
.single-providers .wp-block-post-content p {
    margin-bottom: var(--wp--preset--spacing--medium) !important;
    line-height: 1.6 !important;
    white-space: pre-line !important;
}

/* Ultra-clean provider header styling */
.single-providers .provider-name-h1 {
    font-family: 'Lato', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    color: var(--wp--preset--color--pickled-bluewood) !important;
    margin-bottom: 0 !important;
}

/* Clean provider specialties styling */
.single-providers .provider-specialties-section {
    margin-bottom: var(--wp--preset--spacing--small) !important;
}

.single-providers .provider-specialties-section .wp-block-shortcode,
.single-providers .provider-specialties-section .wp-block-heading,
.single-providers .provider-specialties-h3 {
    font-size: var(--wp--preset--font-size--large) !important;
    color: var(--wp--preset--color--neutral-dark) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    font-style: italic !important;
    opacity: 0.9 !important;
    text-align: left !important;
}

/* Clean status text styling */
.single-providers .provider-status-text {
    font-size: var(--wp--preset--font-size--small) !important;
    color: var(--wp--preset--color--mountain-meadow) !important;
    font-weight: 500 !important;
    margin: var(--wp--preset--spacing--x-small) 0 var(--wp--preset--spacing--large) 0 !important;
    text-align: left !important;
}

/* Clean provider header spacing and layout */
.single-providers .provider-info-section {
    padding-top: var(--wp--preset--spacing--x-large) !important;
    padding-bottom: var(--wp--preset--spacing--x-large) !important;
}

.single-providers .provider-main-layout .wp-block-column:nth-child(2) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding-left: var(--wp--preset--spacing--medium) !important;
}

/* Clean responsive styling */
@media (max-width: 768px) {
    .single-providers .provider-specialties-section .wp-block-shortcode {
        font-size: var(--wp--preset--font-size--medium) !important;
        text-align: left !important;
    }
    
    .single-providers .provider-name-h1 {
        text-align: center !important;
        font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    }
    
    .single-providers .provider-status-text {
        text-align: left !important;
    }
    
    .single-providers .provider-main-layout .wp-block-column:nth-child(2) {
        text-align: center !important;
        padding-left: 0 !important;
        margin-top: var(--wp--preset--spacing--medium) !important;
    }
    
    /* Left-align specialty and status within centered column */
    .single-providers .provider-specialties-section,
    .single-providers .provider-status-text {
        text-align: left !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: fit-content !important;
    }
}

/* Desktop refinements */
@media (min-width: 769px) {
    .single-providers .provider-name-h1 {
        font-size: clamp(2rem, 4vw, 2.75rem) !important;
    }
    
    .single-providers .provider-specialties-section .wp-block-shortcode {
        margin-bottom: var(--wp--preset--spacing--small) !important;
    }
}

/* Remove shine effect - keeping simple */

.single-providers .provider-specialty-badge:hover {
    opacity: 0.8;
}

/* Specialty badge container styling */
.single-providers .badge-group {
    margin-bottom: var(--wp--preset--spacing--x-large) !important;
    align-items: flex-start !important;
    width: 100% !important;
}

/* Make specialty box full width on mobile */
@media (max-width: 768px) {
    .single-providers .provider-specialty-badge {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: var(--wp--preset--spacing--large) !important;
        padding: var(--wp--preset--spacing--large) !important;
        font-size: var(--wp--preset--font-size--medium) !important;
        min-height: 70px !important;
    }
}

/* WebP Image Display Fixes */
/* Ensure WebP images display correctly across browsers */
img[src$=".webp"] {
    image-rendering: auto !important;
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Fix WebP loading issues */
.wp-block-post-featured-image img,
.provider-photo img,
.wp-block-image img {
    object-fit: cover !important;
    object-position: center !important;
    image-rendering: auto !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
}

/* WebP fallback support */
@supports not (image-rendering: crisp-edges) {
    .provider-photo img[src$=".webp"] {
        image-rendering: auto !important;
        -webkit-backface-visibility: hidden !important;
    }
}

/* Ensure images load properly on different devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img[src$=".webp"] {
        image-rendering: auto !important;
    }
}

/* HOMEPAGE CAROUSEL STYLES */

/* Hero carousel container */
.hero-carousel-container {
    position: relative !important;
    overflow: hidden !important;
}

/* Carousel slides container */
.carousel-slides {
    position: relative !important;
    width: 100% !important;
    height: 500px !important;
}

/* Individual carousel slides */
.carousel-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out !important;
    z-index: 1 !important;
}

/* Active slide */
.carousel-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2 !important;
}

/* Carousel navigation */
.carousel-navigation {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--wp--preset--spacing--medium) !important;
}

/* Navigation buttons */
.carousel-nav .wp-block-button__link {
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 8px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
}

.carousel-nav .wp-block-button__link:hover {
    opacity: 0.8;
}

/* Carousel indicators */
.carousel-indicators {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.indicator {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    border: 2px solid var(--wp--preset--color--white) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    opacity: 0.6 !important;
}

.indicator.active {
    background: var(--wp--preset--color--white) !important;
    opacity: 1 !important;
}

.indicator:hover {
    opacity: 0.8 !important;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    .carousel-slides {
        height: 400px !important;
    }
    
    .carousel-slide {
        height: 400px !important;
    }
    
    .carousel-navigation {
        bottom: 15px !important;
        gap: var(--wp--preset--spacing--small) !important;
    }
    
    .carousel-nav .wp-block-button__link {
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 16px !important;
    }
    
    .indicator {
        width: 10px !important;
        height: 10px !important;
    }
}

@media (max-width: 480px) {
    .carousel-slides {
        height: 350px !important;
    }
    
    .carousel-slide {
        height: 350px !important;
    }
    
    .carousel-navigation {
        gap: var(--wp--preset--spacing--x-small) !important;
    }
    
    .carousel-nav .wp-block-button__link {
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 14px !important;
    }
    
    .indicator {
        width: 8px !important;
        height: 8px !important;
    }
}

/* Responsive adjustments for provider grid */
@media (max-width: 768px) {
    .wp-block-query .wp-block-post-template {
        grid-template-columns: 1fr !important;
        gap: var(--wp--preset--spacing--medium) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wp-block-query .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--wp--preset--spacing--large) !important;
    }
}

/* ENHANCED DESIGN ELEMENTS */

/* Modern section dividers */
.section-divider {
    position: relative;
    margin-block: var(--wp--preset--spacing--x-large);
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--wp--preset--color--mountain-meadow), var(--wp--preset--color--zest));
    border-radius: 2px;
}

/* Enhanced provider photo styling */
.provider-photo-enhanced {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--wp--preset--shadow--natural);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.provider-photo-enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 70%, var(--wp--preset--color--mountain-meadow-lightest) 100%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.provider-photo-enhanced:hover {
    opacity: 0.8;
}

/* Modern badge grouping */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--small);
    align-items: center;
}

.badge-group .provider-badge {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Content hierarchy improvements */
.content-section {
    position: relative;
    padding-block: var(--wp--preset--spacing--x-large);
}

.content-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--wp--preset--color--porcelain) 20%, var(--wp--preset--color--porcelain) 80%, transparent 100%);
}

/* Floating action buttons */
.floating-action {
    position: fixed;
    bottom: var(--wp--preset--spacing--large);
    right: var(--wp--preset--spacing--large);
    z-index: 1000;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wp--preset--color--zest);
    color: var(--wp--preset--color--white);
    box-shadow: var(--wp--preset--shadow--elevated);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.floating-action:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .floating-action {
        bottom: var(--wp--preset--spacing--medium);
        right: var(--wp--preset--spacing--medium);
        width: 56px;
        height: 56px;
    }
}

/* Removed duplicate sticky override - now handled in main media query at line 380 */

/* ADAPTIVE LAYOUTS FOR DIFFERENT SCREEN SIZES */

/* Portrait mobile layout optimizations */
@media (orientation: portrait) and (max-width: 768px) {
    .provider-main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: var(--wp--preset--spacing--large);
    }
    
    .provider-photo {
        grid-row: 1;
        justify-self: center;
        margin-block-end: var(--wp--preset--spacing--medium);
    }
    
    .provider-info-content {
        grid-row: 2;
        text-align: center;
    }
    
    .badge-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .contact-section-card {
        padding-block: var(--wp--preset--spacing--x-large);
        text-align: center;
    }
}

/* Landscape mobile layout optimizations */
@media (orientation: landscape) and (max-width: 1024px) and (max-height: 600px) {
    .provider-main-layout {
        grid-template-columns: minmax(200px, 1fr) 2fr;
        gap: var(--wp--preset--spacing--large);
        align-items: start;
    }
    
    .provider-photo {
        max-width: 220px;
        justify-self: start;
    }
    
    .provider-info-section {
        padding-block: var(--wp--preset--spacing--medium);
    }
    
    .credentials-columns {
        grid-template-columns: 1fr 1fr;
        gap: var(--wp--preset--spacing--medium);
    }
    
    /* Compact spacing for landscape */
    .content-section {
        padding-block: var(--wp--preset--spacing--large);
    }
    
    .contact-section-card {
        padding-block: var(--wp--preset--spacing--large);
    }
}

/* Tablet adaptive layouts */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Portrait tablet */
    @media (orientation: portrait) {
        .provider-main-layout {
            grid-template-columns: 1fr;
            gap: var(--wp--preset--spacing--x-large);
            text-align: center;
        }
        
        .provider-photo {
            justify-self: center;
            max-width: 350px;
        }
        
        .credentials-columns {
            grid-template-columns: 1fr;
            gap: var(--wp--preset--spacing--x-large);
        }
    }
    
    /* Landscape tablet */
    @media (orientation: landscape) {
        .provider-main-layout {
            grid-template-columns: 1fr 1.8fr;
            gap: var(--wp--preset--spacing--xx-large);
        }
        
        .credentials-columns {
            grid-template-columns: 1fr 1fr;
            gap: var(--wp--preset--spacing--x-large);
        }
    }
}

/* Desktop adaptive layouts */
@media (min-width: 1025px) {
    .provider-main-layout {
        grid-template-columns: minmax(300px, 1fr) 2.2fr;
        gap: clamp(var(--wp--preset--spacing--xx-large), 4vw, var(--wp--preset--spacing--xxx-large));
        align-items: start;
    }

    .provider-photo {
        max-width: 400px;
    }

    /* Sticky positioning handled in earlier media query (line 380) - no duplication needed */

    .credentials-columns {
        grid-template-columns: 1fr 1fr;
        gap: var(--wp--preset--spacing--xx-large);
    }
}

/* Ultra-wide screen adaptations */
@media (min-width: 1400px) {
    .provider-main-layout {
        grid-template-columns: minmax(350px, 1fr) 2.5fr;
        gap: var(--wp--preset--spacing--xxx-large);
    }
    
    .provider-info-section {
        max-width: 1200px;
        margin-inline: auto;
    }
    
    .credentials-columns {
        grid-template-columns: 1fr 1fr;
        gap: var(--wp--preset--spacing--xxx-large);
    }
}

/* Adaptive spacing for different viewport heights */
@media (max-height: 600px) {
    .provider-info-section,
    .content-section {
        padding-block: var(--wp--preset--spacing--medium);
    }
    
    .contact-section-card {
        padding-block: var(--wp--preset--spacing--large);
    }
}

@media (min-height: 800px) {
    .provider-info-section {
        padding-block: var(--wp--preset--spacing--xx-large);
    }
    
    .content-section {
        padding-block: var(--wp--preset--spacing--x-large);
    }
}

/* Flexible container sizing */
.adaptive-container {
    width: min(100% - var(--wp--preset--spacing--medium), 1200px);
    margin-inline: auto;
}

@media (min-width: 1200px) {
    .adaptive-container {
        width: min(100% - var(--wp--preset--spacing--x-large), 1400px);
    }
}

/* Grid auto-fit for badges */
.badge-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--wp--preset--spacing--small);
    justify-items: center;
}

@media (max-width: 480px) {
    .badge-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: var(--wp--preset--spacing--x-small);
    }
}

/* Removed all duplicate sticky overrides - consolidated into single rule at line 380 */

/* ==========================================================================
   Patient Reviews Section Styling
   ========================================================================== */

/* Reviews section container */
.patient-reviews-section {
    position: relative;
    content-visibility: auto;
}

/* Hide reviews section if no content is generated */
.patient-reviews-section:has(.provider-reviews-display:empty) {
    display: none;
}

/* Reviews widget container styling */
.reviews-widget-container {
    box-shadow: 0 2px 8px rgba(44, 95, 95, 0.08);
    transition: box-shadow 0.3s ease;
}

.reviews-widget-container:hover {
    box-shadow: 0 4px 16px rgba(44, 95, 95, 0.12);
}

/* TrustIndex widget customization */
.reviews-widget-container .trustindex-widget,
.reviews-widget-container [class*="trustindex"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Review items styling */
.reviews-widget-container .trustindex-widget .review-item,
.reviews-widget-container [class*="review-"] {
    background: var(--wp--preset--color--white) !important;
    border: 1px solid var(--wp--preset--color--porcelain) !important;
    border-radius: 8px !important;
    padding: var(--wp--preset--spacing--medium) !important;
    margin-bottom: var(--wp--preset--spacing--small) !important;
    box-shadow: none !important;
}

/* Review text styling */
.reviews-widget-container .trustindex-widget .review-text,
.reviews-widget-container [class*="review-text"] {
    font-size: var(--wp--preset--font-size--medium) !important;
    line-height: 1.6 !important;
    color: var(--wp--preset--color--neutral-dark) !important;
    font-family: inherit !important;
    margin-bottom: var(--wp--preset--spacing--small) !important;
}

/* Reviewer name styling */
.reviews-widget-container .trustindex-widget .reviewer-name,
.reviews-widget-container [class*="reviewer-name"] {
    font-size: var(--wp--preset--font-size--small) !important;
    font-weight: 600 !important;
    color: var(--wp--preset--color--pickled-bluewood) !important;
    font-family: inherit !important;
}

/* Star ratings styling */
.reviews-widget-container .trustindex-widget .stars,
.reviews-widget-container [class*="star"] {
    color: var(--wp--preset--color--zest) !important;
    font-size: 1rem !important;
}

/* Navigation styling */
.reviews-widget-container .trustindex-widget .navigation,
.reviews-widget-container [class*="navigation"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: var(--wp--preset--spacing--small) !important;
    margin-top: var(--wp--preset--spacing--medium) !important;
}

.reviews-widget-container .trustindex-widget .nav-button,
.reviews-widget-container [class*="nav-"] button {
    background: var(--wp--preset--color--mountain-meadow) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
}

.reviews-widget-container .trustindex-widget .nav-button:hover,
.reviews-widget-container [class*="nav-"] button:hover {
    background: var(--wp--preset--color--pickled-bluewood) !important;
    transform: scale(1.05) !important;
}

/* Pagination dots styling */
.reviews-widget-container .trustindex-widget .pagination-dots,
.reviews-widget-container [class*="pagination"] {
    display: flex !important;
    justify-content: center !important;
    gap: var(--wp--preset--spacing--x-small) !important;
    margin-top: var(--wp--preset--spacing--small) !important;
}

.reviews-widget-container .trustindex-widget .pagination-dot,
.reviews-widget-container [class*="dot"] {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: var(--wp--preset--color--porcelain) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.reviews-widget-container .trustindex-widget .pagination-dot.active,
.reviews-widget-container [class*="dot"].active {
    background: var(--wp--preset--color--mountain-meadow) !important;
    transform: scale(1.2) !important;
}

/* Google branding styling */
.reviews-widget-container .trustindex-widget .google-logo,
.reviews-widget-container [class*="google"] {
    filter: none !important;
    opacity: 0.8 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .reviews-widget-container {
        margin-left: calc(var(--wp--preset--spacing--medium) * -1);
        margin-right: calc(var(--wp--preset--spacing--medium) * -1);
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    .reviews-widget-container .trustindex-widget .review-item {
        padding: var(--wp--preset--spacing--small) !important;
        margin-bottom: var(--wp--preset--spacing--x-small) !important;
    }
    
    .reviews-widget-container .trustindex-widget .review-text {
        font-size: var(--wp--preset--font-size--small) !important;
    }
    
    .reviews-widget-container .trustindex-widget .nav-button {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Loading state styling */
.reviews-widget-container .provider-reviews-display:empty::after {
    content: "No reviews available for this provider.";
    display: block;
    text-align: center;
    padding: var(--wp--preset--spacing--large);
    color: var(--wp--preset--color--neutral-light);
    font-style: italic;
}

/* Focus states for accessibility */
.reviews-widget-container .trustindex-widget button:focus,
.reviews-widget-container [class*="nav-"] button:focus,
.reviews-widget-container [class*="dot"]:focus {
    outline: 2px solid var(--wp--preset--color--mountain-meadow) !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .reviews-widget-container .trustindex-widget .review-item {
        border-color: var(--wp--preset--color--neutral-dark) !important;
        border-width: 2px !important;
    }
    
    .reviews-widget-container .trustindex-widget .nav-button {
        border: 2px solid var(--wp--preset--color--neutral-dark) !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .reviews-widget-container .trustindex-widget .nav-button,
    .reviews-widget-container .trustindex-widget .pagination-dot,
    .reviews-widget-container {
        transition: none !important;
    }
}

/* ==========================================================================
   MOBILE FOOTER AND WIDGET RESPONSIVE STYLING
   ========================================================================== */

/* Mobile Footer Styles */
@media (max-width: 768px) {
  /* Reduce footer padding on mobile */
  .site-footer {
    padding: 2rem 1rem !important;
  }

  /* Stack footer navigation vertically on mobile */
  .site-footer .wp-block-group[style*="flexWrap"],
  .site-footer .wp-block-navigation,
  .site-footer nav {
    flex-direction: column !important;
    gap: 1.5rem !important;
    align-items: center !important;
  }

  /* Ensure footer elements stack properly */
  .site-footer .wp-block-columns {
    flex-direction: column !important;
  }
}

/* Mobile Review Widget Responsive Styling */
@media (max-width: 768px) {
  /* Reduce review widget padding on mobile */
  .reviews-widget-container {
    padding: 0.75rem !important;
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Ensure TrustIndex widget is responsive */
  .reviews-widget-container iframe,
  .reviews-widget-container > div,
  .reviews-widget-container [class*="trustindex"] {
    max-width: 100% !important;
    overflow-x: hidden;
  }
}

/* Mobile Provider Single Page Layout */
@media (max-width: 768px) {
  /* Stack provider layout vertically on mobile */
  .provider-main-layout.wp-block-columns {
    flex-direction: column !important;
  }

  .provider-main-layout .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  /* Stack credentials columns vertically on mobile */
  .credentials-columns.wp-block-columns {
    flex-direction: column !important;
  }

  .credentials-columns .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  /* Stack CTA buttons vertically on mobile */
  .wp-block-buttons {
    flex-direction: column !important;
  }

  .wp-block-button {
    width: 100%;
  }

  .wp-block-button__link {
    width: 100%;
    justify-content: center;
  }
}

/* Center text in mobile hamburger menu overlay */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    box-sizing: border-box !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Override submenu item left padding (needs higher specificity than parent theme's 5-class selector) */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container .wp-block-navigation-item {
    padding-left: 0 !important;
}

/* Collapse the hidden "Our Providers" parent to eliminate extra gap spacing */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child {
    display: contents !important;
    border: none !important;
}

/* Cancel the 12px flex gap above and below the promoted submenu container */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container {
    margin-top: -12px !important;
    margin-bottom: -12px !important;
}

/* ====================================================================== */
/* mma/locations-contact-summary block                                    */
/* Renders at the top of the providers archive, just under the intro      */
/* paragraph. Single-mode = phone line + secondary fax line below.        */
/* Multiple-mode = <dl> with one row per location. Phone is a tap-to-call */
/* tel link in mountain-meadow accent; fax is plain text and visually     */
/* secondary (smaller, neutral) since it's not a useful tap target on     */
/* mobile.                                                                */
/* ====================================================================== */
.mma-locations-contact-summary {
    text-align: center;
    margin: 1.25rem auto 0.5rem;
    color: var(--wp--preset--color--neutral-dark, #4a5568);
}

/* Shrink the single-mode block to the width of its longest line (the phone
   line) and center that block within the surrounding container. The inner
   text-align: center is intentional - see the inline comment below. */
.mma-locations-contact-summary--single {
    line-height: 1.4;
    width: fit-content;
    max-width: 100%;
    /* Was text-align: left so "Fax:" stacked under "Call either office:"
       at the same x. With width: fit-content the box is sized to the
       longer phone line, so the shorter fax line then floated against
       the box's left edge - which read as a left-of-center offset
       relative to the centered page heading and subtitle above. Center
       the inner text instead so the fax line sits visually below the
       phone line at the same axis the rest of the section centers on. */
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.mma-locations-contact-summary__phone-line {
    margin: 0;
    font-size: 1.125rem;
}

/* Bring the fax line up to phone-line visual weight so the two read as
   one paired contact block. Same font size, same dark gray (inherits
   from the parent .mma-locations-contact-summary), more breathing room
   above. The label stays at weight 500 (a label) and the number bumps
   to weight 600 (matching the phone link's weight) so the two numbers
   are equally readable. Center alignment is inherited from --single so
   the fax line centers visually below the phone line. */
.mma-locations-contact-summary__fax-line {
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
}

.mma-locations-contact-summary__phone {
    color: var(--wp--preset--color--mountain-meadow, #2c8a5b);
    font-weight: 600;
    text-decoration: none;
}

/* Labels (.__fax-label) stay at weight 500 — recognizably a label.
   The fax number itself (.__fax-number) bumps to 600 so it matches
   the phone link's weight. Both inherit color from the parent so they
   render in the same neutral-dark gray as the phone-line copy. */
.mma-locations-contact-summary__fax-label {
    font-weight: 500;
}

.mma-locations-contact-summary__fax-number {
    font-weight: 600;
}

/* List mode — <dl> with row per location */
.mma-locations-contact-summary--multiple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.mma-locations-contact-summary__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.75rem;
    font-size: 1rem;
}

.mma-locations-contact-summary__location {
    margin: 0;
    font-weight: 600;
    color: var(--wp--preset--color--pickled-bluewood, #2b3a55);
}

.mma-locations-contact-summary__location a {
    color: inherit;
    text-decoration: none;
}

.mma-locations-contact-summary__location a:hover {
    text-decoration: underline;
}

.mma-locations-contact-summary__data {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
}

/* ====================================================================== */
/* mma/per-provider-schedule block (cards)                                */
/* Slimmed to "Office name — Days · Hours" only. Phone/fax moved to       */
/* the locations-contact-summary block above the cards grid.              */
/* ====================================================================== */
.mma-per-provider-schedule {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
}

.mma-per-provider-schedule__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mma-per-provider-schedule__item {
    margin: 0;
    /* Flex layout so the indicator dot sits vertically centered with the
       text. vertical-align: middle on an inline-block measures from
       baseline + half-x-height, which leaves a small dot reading high
       relative to the line; flex align-items: center is what optical
       alignment actually wants. flex-wrap so the schedule clause can
       drop to a second line on narrow viewports without orphaning. */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.mma-per-provider-schedule__link {
    color: var(--wp--preset--color--pickled-bluewood, #2b3a55);
    font-weight: 500;
    text-decoration: none;
}

.mma-per-provider-schedule__link:hover {
    text-decoration: underline;
}

.mma-per-provider-schedule__schedule {
    color: var(--wp--preset--color--mountain-meadow, #2c8a5b);
}

/* "Currently at this office today" indicator. Default state is a hollow
   light-gray dot. When the provider's days list includes today (in the
   site timezone — Monroe, MI / Eastern), the row gets the --today
   modifier and the dot fills mountain-meadow green with a soft halo so
   it reads clearly at-a-glance. A companion JS file reapplies the
   --today class client-side after load so the indicator stays accurate
   even when a full-page cache serves stale HTML across day boundaries. */
.mma-per-provider-schedule__indicator {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    border: 1px solid var(--wp--preset--color--neutral-light, #c4c9d2);
    background: transparent;
    margin-right: 0.4rem;
    flex-shrink: 0;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.mma-per-provider-schedule__item--today .mma-per-provider-schedule__indicator {
    background: var(--wp--preset--color--mountain-meadow, #2c8a5b);
    border-color: var(--wp--preset--color--mountain-meadow, #2c8a5b);
    box-shadow: 0 0 0 2px rgba(44, 138, 91, 0.18);
}

/* Hide the editor-only empty state from logged-out visitors. Defensive —
   the renderer already returns '' for non-editors, but if a future caching
   layer ever serves the editor variant, this stops it being visible. */
.mma-per-provider-schedule--empty {
    display: none;
}
.logged-in.user-can-edit-posts .mma-per-provider-schedule--empty {
    display: block;
}

/* ====================================================================== */
/* Per-provider-schedule: per-location contact lines (single provider     */
/* template only). The contact wrapper is a two-column CSS grid so the    */
/* "Phone:" / "Fax:" labels share a right-aligned column and the values   */
/* (tel: link, fax number) share a left-aligned column. justify-content:  */
/* center centers the whole label+value pair as a single block under the  */
/* address row above. width:100% rides the parent <li>'s flex-wrap so the */
/* grid drops onto its own line beneath the indicator/link/schedule top   */
/* row. The inner <p> wrappers (kept in markup so screen readers still    */
/* hear "phone-line" / "fax-line" as paragraphs) become display:contents  */
/* so their label+value children flatten into the grid as direct cells.   */
/* ====================================================================== */
.mma-per-provider-schedule__contact {
    width: 100%;
    margin-top: 0.35rem;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: baseline;
    column-gap: 0.4em;
    row-gap: 0.1rem;
    line-height: 1.45;
    font-size: 0.95rem;
    color: var(--wp--preset--color--neutral-dark, #4a5568);
}

/* Promote each <p> wrapper out of layout so its <span>/<a> children land
   as direct grid items of .mma-per-provider-schedule__contact. The <p>
   tag itself stays in the DOM/a11y tree so each phone or fax pair is
   still announced as a paragraph. */
.mma-per-provider-schedule__contact .mma-locations-contact-summary__phone-line,
.mma-per-provider-schedule__contact .mma-locations-contact-summary__fax-line {
    display: contents;
}

.mma-per-provider-schedule__contact .mma-locations-contact-summary__phone-label,
.mma-per-provider-schedule__contact .mma-locations-contact-summary__fax-label {
    text-align: right;
    font-weight: 500;
}

.mma-per-provider-schedule__contact .mma-locations-contact-summary__phone {
    text-align: left;
    /* Don't stretch the <a> to fill the value column so click target hugs
       the digits — also keeps the focus ring tight to the visible text. */
    justify-self: start;
    color: var(--wp--preset--color--mountain-meadow, #2c8a5b);
    font-weight: 600;
    text-decoration: none;
}

.mma-per-provider-schedule__contact .mma-locations-contact-summary__fax-number {
    text-align: left;
    justify-self: start;
    font-weight: 600;
}

/* Larger gap between consecutive office rows than between the schedule
   line and its own phone/fax — visually pairs the contact lines with
   the location above them (Gestalt proximity). Applied to every item
   except the first so the list's outer margin is owned by the parent. */
.mma-per-provider-schedule__list .mma-per-provider-schedule__item + .mma-per-provider-schedule__item {
    margin-top: 1.25rem;
}

/* ====================================================================== */
/* Equal-height provider cards                                            */
/*                                                                        */
/* The wp:query post-template grid stretches each <li> to row height, but */
/* the inner .provider-card group sits at the top of its <li>, leaving    */
/* whitespace below shorter cards. Make the whole chain                   */
/* (<li> -> .provider-card -> inner .wp-block-group) a flex column so the */
/* card fills the <li>, the inner group fills the card, and the schedule  */
/* (last child) pins to the bottom via margin-top:auto. Result: the photo */
/* + name + specialty stay at the top; the schedule line is bottom-       */
/* aligned regardless of how many location rows the schedule emits.       */
/* ====================================================================== */
/* Scoped to LIs that actually contain a .provider-card so this rule
   does not bleed into unrelated wp-block-post-template grids on the
   same page (the footer locations grid is the affected one). */
.wp-block-post-template > li.wp-block-post:has(> .provider-card) {
    display: flex;
}

.wp-block-post-template > li.wp-block-post > .provider-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* The inner constrained group inside .provider-card holds the title +
   specialty + schedule. Make it a flex column too so margin-top:auto on
   the schedule has a flex parent to push against. */
.provider-card > .wp-block-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

/* Push the schedule to the bottom of the inner group (and therefore the
   bottom of the card), absorbing any extra vertical space above. */
.provider-card .mma-per-provider-schedule {
    margin-top: auto;
}
