/* Tailwind Configuration and Custom Styles */

:root {
    --primary: #308ce8;
    --background-light: #f6f7f8;
    --background-dark: #111921;
    --grad-blue: rgba(48,140,232,0.18);
    --grad-gold: rgba(255,198,58,0.12);
    --grad-green: rgba(34,197,94,0.12);
}

/* Use Clash Grotesk site-wide */
html, body {
    font-family: 'Clash Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

/* Clamp weights to the available Clash Grotesk range (200–700) */
.font-black,
.font-extrabold {
    font-weight: 700;
}

/* Material Symbols Font Configuration */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1f6bc2;
}

.dark::-webkit-scrollbar-track {
    background: var(--background-dark);
}

/* Animation for Details Element */
details[open] summary ~ * {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects for Service Cards */
.hover\:shadow-elevated:hover {
    transform: translateY(-4px);
}

    /* Typography tokens and accessible color tokens */
    :root {
        --base-font-size: 16px;
        --font-sans: 'Clash Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
        --text-color: #0e141b; /* main text on light background */
        --muted-color: #374151; /* secondary text (good contrast) */
        --subtle-color: #6b7280; /* tertiary text */
    }

    html { font-size: var(--base-font-size); }

    /* Move the page base background to html so the decorative overlay can sit above it */
    html {
        background-color: var(--background-light);
    }

    body {
        font-family: var(--font-sans);
        color: var(--text-color);
        background-color: transparent !important;
    }

/* Decorative gradient background (subtle overlay across all pages) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 8% 18%, var(--grad-gold) 0%, rgba(255,198,58,0) 36%),
                      radial-gradient(circle at 86% 78%, var(--grad-green) 0%, rgba(34,197,94,0) 34%),
                      linear-gradient(120deg, rgba(48,140,232,0.44), rgba(48,140,232,0.16));
    background-blend-mode: overlay, screen, normal;
    background-size: 140% 140%, 160% 160%, 200% 200%;
    background-position: 0% 0%, 100% 100%, 50% 50%;
    opacity: 0.14;
    transition: opacity 300ms ease, filter 300ms ease;
    animation: gradientShift 40s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50% { background-position: 30% 10%, 70% 90%, 40% 60%; }
    100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
}

html.dark {
    background-color: var(--background-dark);
}

html.dark body::before {
    opacity: 0.06;
    filter: saturate(0.6) brightness(0.6) contrast(0.9);
}

/* Make sure main layout content sits above the gradient overlay */
.layout-container { position: relative; z-index: 1; }

/* Subtle hero card used on homepage to keep text readable above gradient */
.hero-card {
    background: rgba(255,255,255,0.72);
    border-radius: 0.75rem;
    box-shadow: 0 8px 28px rgba(12,15,20,0.06);
    border: 1px solid rgba(15,23,42,0.04);
}

.dark .hero-card {
    background: rgba(17,25,33,0.48);
    border-color: rgba(255,255,255,0.04);
}

    /* Heading scale (consistent across pages) */
    h1 { font-size: 2.25rem; line-height: 1.08; }
    h2 { font-size: 1.5rem; line-height: 1.15; }
    h3 { font-size: 1.125rem; line-height: 1.2; }

    /* Improve contrast for commonly-used Tailwind gray classes to ensure accessibility */
    .text-gray-600 { color: var(--muted-color) !important; }
    .text-gray-500 { color: var(--subtle-color) !important; }
    .text-gray-400 { color: #9ca3af !important; }

    /* Dark mode tokens */
    .dark {
        --text-color: #e5e7eb; /* gray-200 */
        --muted-color: #9ca3af; /* lighter secondary */
        --subtle-color: #6b7280;
    }

    .dark body {
        color: var(--text-color);
    }

    /* Ensure links are high contrast */
    a, a:visited {
        color: var(--primary);
    }

    /* Primary CTA link color override */
    a.cta-primary,
    a.cta-primary:visited {
        color: #ffffff !important;
    }

    /* Header / Navbar contrast: dark on light, light on dark */
    :root {
        --nav-text: #0e141b; /* dark text for nav on light backgrounds */
        --nav-text-hover: var(--primary);
    }

    .dark {
        --nav-text: #e5e7eb; /* light nav text for dark backgrounds */
    }

    header nav a,
    header .nav-link {
        color: var(--nav-text) !important;
    }

    header nav a:hover,
    header .nav-link:hover {
        color: var(--nav-text-hover) !important;
    }

    /* Ensure small text uses readable size */
    p, li, label, input, select, textarea, button {
        font-size: 1rem; /* 16px */
    }
button {
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* Link Animations */
a {
    transition: color 0.3s ease;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Section Spacing */
section {
    transition: background-color 0.3s ease;
}

.slideshow-slides { position: relative; overflow: hidden; background-color: #000; width: 100%; aspect-ratio: 16 / 9; min-height: 85vh; }
.slideshow-slide { position: absolute; inset: 0; opacity: 0; transform: scale(1.02); transition: opacity 600ms ease, transform 600ms ease; display:flex; align-items:center; justify-content:center; }
.slideshow-slide.active { opacity: 1; transform: scale(1); position: relative; }
.slideshow-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; background-color: #000; }

/* Stronger rule to ensure images fill their parent box across breakpoints */
.slideshow-slide > img,
.slideshow-slide img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}
.slideshow-prev, .slideshow-next { z-index: 30; border: none; }
.slideshow-indicators { z-index: 40; display: flex; justify-content: center; gap: 0.5rem; padding: 0.5rem; }
.slideshow-indicators button { width: 10px; height: 10px; border-radius: 9999px; background: rgba(255,255,255,0.7); border: none; padding: 0; }
.slideshow-indicators button.active { background: var(--primary); }
.slideshow-loading { padding: 1rem; }

@media (min-width: 768px) {
    .slideshow-slides { min-height: 85vh; }
}

@media (min-width: 1200px) {
    .slideshow-slides { min-height: 95vh; }
}

@media (max-width: 767px) {
    /* On mobile screens make the slideshow fill remaining viewport below header */
    .slideshow-slides { min-height: calc(100vh - 96px); height: auto; aspect-ratio: auto; }

/* Mobile: ensure slideshow images fill the slideshow width (no letterboxing) */
@media (max-width: 767px) {
    /* Force a fixed, smaller height for the slideshow container on phones */
    .slideshow-slides { min-height: 35vh !important; height: 35vh !important; max-height: 35vh !important; aspect-ratio: auto; }
    /* Fill the container and crop as needed so the box height is stable */
    .slideshow-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
}
    .hero-text { padding-left: 1rem; padding-right: 1rem; }
}

/* Dark transparent overlay placed over slides to improve text legibility */
.slideshow-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.38); z-index: 20; pointer-events: none; }

/* Ensure slides render beneath overlay */
.slideshow-slide { z-index: 10; }

/* Ensure loading text appears above slides but below overlay-text */
.slideshow-loading { z-index: 15; }

/* Dark Mode Specific Styles */
.dark {
    color-scheme: dark;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    header,
    footer {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Footer Styles - ensure dark mode background displays properly */
footer {
    width: 100%;
    background-color: #1f2937;
}

html.dark footer {
    background-color: #111921 !important;
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Theme Toggle and Mobile Menu Button Interactions */
#themeToggle {
    cursor: pointer;
    transition: all 0.2s ease;
}

#themeToggle:hover {
    background-color: rgba(48, 140, 232, 0.1);
    color: var(--primary);
}

.light #themeToggle:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

#mobileMenuToggle {
    cursor: pointer;
    transition: all 0.2s ease;
}

#mobileMenuToggle:hover {
    background-color: rgba(48, 140, 232, 0.1);
    color: var(--primary);
}

.light #mobileMenuToggle:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* Ensure the header Book 'Appointment link shows white text by default */

/* Ensure the header 'Book Appointment' link/button shows white text by default */
header a[href$="appointment.html"],
header a[href$="/appointment.html"] {
    color: #ffffff !important;
}

/* Hero text background: a dark translucent rectangle placed between slides and text */
.hero-text-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.48);
    border-radius: 0.5rem;
    z-index: 30; /* sits above slides (z-10..20) but below hero text (z-40) */
    pointer-events: none;
}

.hero-text { position: relative; z-index: 40; }

/* Slightly reduce heading sizes on very small screens to avoid overflow */
.hero-text h1 { margin: 0; }
.hero-text h2 { margin: 0; }

/* Mobile navigation menu styles */
/* Mobile navigation menu styles */
.mobile-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 96px; /* matches header height (top-24) */
    z-index: 9999 !important; /* ensure it sits above header and decorative overlay */
}
.mobile-nav.open {
    display: block;
    z-index: 9999 !important;
}
.mobile-nav .mobile-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}
.mobile-nav a {
    display: block;
    padding: 1rem 1.125rem;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(15,23,42,0.06);
    color: inherit;
    text-decoration: none;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.06); }

.dark .mobile-nav a { border-color: rgba(255,255,255,0.06); }

@media (min-width: 768px) {
    .mobile-nav { display: none !important; }
}

/* Fix mobile stacking: keep slideshow beneath mobile menu and reduce hero height on small screens */
@media (max-width: 767px) {
    .mobile-nav { top: 72px; }
    .mobile-nav, .mobile-nav.open { z-index: 9999 !important; }
    .slideshow-slides { z-index: 0 !important; min-height: 35vh !important; }
    .hero-card { padding-left: 1rem; padding-right: 1rem; }

    /* Make mobile 'Book Appointment' link visually prominent across all pages */
    .mobile-nav .mobile-links a[href$="appointment.html"],
    .mobile-nav .mobile-links a[href$="/appointment.html"] {
        display: block;
        padding: 1rem 1.125rem;
        margin: 0.5rem 0;
        border-radius: 0.5rem;
        background-color: var(--primary) !important;
        color: #ffffff !important;
        text-align: center;
        font-weight: 600;
        box-shadow: 0 6px 18px rgba(48,140,232,0.12);
        border: 1px solid rgba(29,78,216,0.12);
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* About section: ensure dark text in light mode and white text in dark mode */
#about,
#about h2,
#about h3,
#about p,
#about a,
#about span,
#about .material-symbols-outlined {
    color: #0e141b; /* dark text for light mode */
}

.dark #about,
.dark #about h2,
.dark #about h3,
.dark #about p,
.dark #about a,
.dark #about span,
.dark #about .material-symbols-outlined {
    color: #ffffff; /* white text for dark mode */
}

