/* ============================================
   Clinica Medica Centro Hispano
   Custom Styles — Emerald & Cream Theme
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --color-emerald-950: #071a09;
    --color-emerald-900: #0d3311;
    --color-emerald-800: #1b5e20;
    --color-emerald-700: #2e7d32;
    --color-emerald-600: #388e3c;
    --color-emerald-500: #4caf50;
    --color-emerald-300: #a5d6a7;
    --color-emerald-200: #c8e6c9;
    --color-emerald-100: #dcedce;
    --color-emerald-50: #f0f7f0;
    --color-cream-50: #fefdf8;
    --color-cream-100: #fdf9ee;
    --color-cream-200: #faf0d4;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Lato', system-ui, sans-serif;
}

/* === Base Reset & Foundation === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-cream-50);
}
::-webkit-scrollbar-thumb {
    background: var(--color-emerald-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-emerald-500);
}

/* === Selection === */
::selection {
    background: var(--color-emerald-200);
    color: var(--color-emerald-900);
}

/* === Focus Styles === */
:focus-visible {
    outline: 2px solid var(--color-emerald-500);
    outline-offset: 2px;
}

/* === Image Responsiveness === */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Typography Scale === */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-emerald-900);
}

/* === Link Styles === */
a {
    color: inherit;
    text-decoration: none;
}

/* === Smooth Transition for Interactive Elements === */
button, a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Print Styles === */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* === High Contrast Mode === */
@media (forced-colors: active) {
    .bg-emerald-800 {
        background-color: ButtonText;
    }
    .text-emerald-800 {
        color: ButtonText;
    }
}

/* === Navbar Scroll State === */
#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(27, 94, 32, 0.08);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-emerald-800,
#navbar.scrolled .text-emerald-600 {
    color: var(--color-emerald-800) !important;
}

#navbar.scrolled a:not([class*="bg-emerald"]) {
    color: var(--color-emerald-800) !important;
}

/* === Mobile Menu Animation === */
#mobile-menu {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Service Card Hover Effects === */
.group:hover .group-hover\:bg-emerald-100 {
    background-color: var(--color-emerald-100);
}

/* === Form Input Focus States === */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* === Testimonial Quote Styling === */
.italic {
    font-style: italic;
}

/* === Decorative Divider === */
.w-24.h-px {
    background: linear-gradient(90deg, transparent, var(--color-emerald-300), transparent);
}

/* === Hero Scroll Indicator Pulse === */
@keyframes pulse-down {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(4px);
    }
}

/* === Accessibility: Skip Link === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus {
    position: fixed;
    width: auto;
    height: auto;
    padding: 1rem;
    margin: 1rem;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-emerald-800);
    color: var(--color-cream-50);
    border-radius: 0.5rem;
    z-index: 9999;
}
