/* ============================================
   Dr. Michael T. Maccaro — Medical Practice
   Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(140, 29, 29, 0.15);
    color: #340c0c;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #fdf0ee;
}
::-webkit-scrollbar-thumb {
    background: #d4a0a0;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8c1d1d;
}

/* --- Navigation --- */
#site-header {
    background: transparent;
}

#site-header.scrolled {
    background: rgba(254, 248, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(140, 29, 29, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #8c1d1d;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Mobile Menu --- */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-nav-link {
    animation: fadeDown 0.4s ease forwards;
    opacity: 1;
}

.mobile-nav-link {
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu.open .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }

/* Menu lines animation */
.menu-line {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
    width: 24px;
}

body.menu-open .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

body.menu-open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 24px;
}

/* --- Hero --- */
.hero-eyebrow {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero-headline {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero-subtext {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeUp 0.8s ease 0.8s forwards;
}

.hero-image-wrapper {
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

.hero-image-accent {
    opacity: 0;
    animation: fadeIn 0.8s ease 0.8s forwards;
}

.hero-accent-card {
    opacity: 0;
    animation: fadeUp 0.8s ease 1s forwards;
}

.hero-quick-item {
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.hero-quick-item:nth-child(1) { animation-delay: 1s; }
.hero-quick-item:nth-child(2) { animation-delay: 1.1s; }
.hero-quick-item:nth-child(3) { animation-delay: 1.2s; }
.hero-quick-item:nth-child(4) { animation-delay: 1.3s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Buttons --- */
.cta-primary,
.cta-secondary {
    position: relative;
    overflow: hidden;
}

.cta-primary::before,
.cta-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before,
.cta-secondary:hover::before {
    left: 100%;
}

/* --- Section Eyebrow --- */
.section-eyebrow {
    position: relative;
    display: inline-block;
}

.section-eyebrow::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: #d4a0a0;
}

/* --- Section Title --- */
.section-title {
    position: relative;
}

/* --- Service Cards --- */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: #8c1d1d;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover::before {
    height: 100%;
}

.service-link {
    position: relative;
}

.service-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.service-link:hover::after {
    width: 100%;
}

/* --- Images --- */
.about-img-frame {
    overflow: hidden;
    position: relative;
}

.about-img-frame img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-img-frame:hover img {
    transform: scale(1.03);
}

.approach-image-frame img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.approach-image-frame:hover img {
    transform: scale(1.03);
}

.map-frame {
    position: relative;
}

.map-frame img {
    transition: transform 0.6s ease;
}

.map-frame:hover img {
    transform: scale(1.02);
}

/* --- Form --- */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    background: white;
}

.form-input::placeholder {
    color: #c4a0a0;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c1d1d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* --- Back to Top --- */
.back-to-top {
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 29, 29, 0.3);
}

/* --- Scroll Reveal --- */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    .reveal-left {
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    .reveal-right {
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .reveal-up.hidden-reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal-left.hidden-reveal {
        opacity: 0;
        transform: translateX(-30px);
    }
    .reveal-right.hidden-reveal {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* --- Hours Row Hover --- */
.hours-row {
    transition: background-color 0.2s ease;
}

.hours-row:hover {
    background: rgba(140, 29, 29, 0.03);
    border-radius: 4px;
    padding-left: 8px;
    margin-left: -8px;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
    .hero-headline {
        font-size: 3rem;
    }
    
    .hero-accent-card {
        display: none;
    }
}

@media (max-width: 767px) {
    .hero-headline {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    .hero-quick-item {
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .about-image-grid {
        gap: 1rem !important;
    }
}
