/* Custom styles for Cornerstone Quality Construction */

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

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

::-webkit-scrollbar-track {
    background: #f5f0e8;
}

::-webkit-scrollbar-thumb {
    background: #2d6a4f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a4d3e;
}

/* Selection color */
::selection {
    background: #2d6a4f;
    color: #f5f0e8;
}

/* Navbar scroll effect */
#navbar.scrolled {
    box-shadow: 0 2px 20px rgba(26, 77, 62, 0.1);
}

/* Mobile menu animations */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* Hamburger animation */
#menu-toggle.active #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle.active #bar2 {
    opacity: 0;
}

#menu-toggle.active #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 6rem;
}

/* Service card hover */
.service-card {
    transform: translateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* Gallery items */
.gallery-item {
    overflow: hidden;
}

.gallery-item img {
    transition: transform 0.7s ease;
}

/* Testimonial cards */
.testimonial-card {
    transform: translateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* Intersection Observer animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Form select arrow */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b6560' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #2d6a4f;
    outline-offset: 2px;
}

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

/* Print styles */
@media print {
    #navbar, #back-to-top, #mobile-menu {
        display: none !important;
    }
    
    body {
        color: #2c2c2c;
        background: white;
    }
}
