/* ===== Custom Styles for Healthcare Stat of Lin ===== */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background: rgba(186, 48, 57, 0.4);
    color: #f5d5d5;
}

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #d4a843, transparent);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
    width: 60%;
    left: 20%;
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===== Mobile Menu ===== */
.mobile-nav-link {
    display: block;
}

/* ===== Cards hover glow ===== */
.group:hover .group-hover\:border-gold-500\/40 {
    border-color: rgba(212, 168, 67, 0.4);
}

/* ===== Button focus states ===== */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d4a843;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Smooth image loading ===== */
img {
    image-rendering: auto;
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0e0e11;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #7a222b, #460f14);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #b03039, #7a222b);
}

/* ===== Map filter override for light mode preference ===== */
@media (prefers-color-scheme: light) {
    .map-dark {
        filter: grayscale(0.5) invert(0.85) contrast(1.0) brightness(0.8) !important;
    }
}

/* ===== Responsive adjustments ===== */
@media (max-width: 640px) {
    .font-display {
        line-height: 1.15;
    }
}

/* ===== Print styles ===== */
@media print {
    #navbar, .reveal {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: #7a222b;
    }
}
