/* --- 1. 2026 Elegant Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* --- 2. Dynamic Theme Variables (Dark/Light Mode) --- */
[data-bs-theme="dark"] {
    --bg-main: #050a15;       
    --bg-panel: rgba(10, 17, 36, 0.7); 
    --bg-card: rgba(255, 255, 255, 0.03);
    --accent-gold: #d4af37;   
    --accent-hover: #f1c40f;
    --text-main: #f8f9fa;     
    --text-muted: #8892a0;
    --border-color: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="light"] {
    --bg-main: #f4f6f9;       
    --bg-panel: rgba(255, 255, 255, 0.8); 
    --bg-card: #ffffff;
    --accent-gold: #b38b22;   
    --accent-hover: #8e6d17;
    --text-main: #2c3e50;     
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* --- 3. Base Fluid Styling --- */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .display-3, .display-5 {
    font-family: 'Playfair Display', serif;
    color: var(--text-main);
}

/* Aggressively override Bootstrap's hardcoded text/bg classes for theme swapping */
.text-light, .text-dark { color: var(--text-main) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-dark, .bg-light, .bg-white { background-color: var(--bg-panel) !important; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-bottom: 1px solid var(--border-color); }
.text-warning { color: var(--accent-gold) !important; }
.border-secondary { border-color: var(--border-color) !important; }

/* --- 4. Navigation & Header --- */
.navbar {
    border-bottom: 2px solid var(--accent-gold);
}
.navbar-nav .nav-link {
    font-family: "Playfair Display", "Georgia", serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 10px 18px;
    transition: all 0.3s ease;
    border-radius: 30px; /* Modern pill hover effect */
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--accent-gold) !important;
    background-color: var(--bg-card);
}

/* --- 5. Beautiful Rounded Corners & Glass Cards --- */
.card, .scroll-item img, .img-fluid, .gallery-item-inner {
    border-radius: 20px !important; /* 2026 Organic curves */
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

.card:hover, .scroll-item:hover img {
    transform: translateY(-8px);
    box-shadow: var(--glass-shadow);
}

/* --- 6. Sticky & Scrollable Sidebar --- */
.sidebar-wrapper {
    position: sticky;
    top: 100px; /* Sticks below the header */
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) transparent;
}
.sidebar-wrapper::-webkit-scrollbar { width: 4px; }
.sidebar-wrapper::-webkit-scrollbar-thumb { background-color: var(--accent-gold); border-radius: 10px; }

.sidebar-menu { list-style: none; padding: 0; border-right: 1px solid var(--border-color); }
.sidebar-menu a {
    display: block;
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 12px 0 0 12px;
    transition: all 0.3s;
}
.sidebar-menu li.active a, .sidebar-menu a:hover {
    color: var(--accent-gold);
    background: var(--bg-card);
    border-right: 3px solid var(--accent-gold);
}

/* --- 7. Floating Action Button (Theme Toggle) --- */
.theme-toggle-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #fff;
    border: none;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle-fab:hover { transform: scale(1.1) rotate(15deg); }

/* --- 8. JavaScript Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Keep Horizontal Carousels Functional & Uniform --- */
.carousel-container { 
    position: relative; 
    display: flex; 
    align-items: center; 
    width: 100%;
}

.scroll-wrapper { 
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory;
    gap: 20px; 
    padding: 10px 0 20px 0; 
    scrollbar-width: none; 
    width: 100%;
}

.scroll-wrapper::-webkit-scrollbar { 
    display: none; 
}

.scroll-item { 
    flex: 0 0 calc(25% - 15px); /* Shows 4 items per view perfectly */
    max-width: calc(25% - 15px); /* Forces the container to not stretch */
    scroll-snap-align: start; 
    display: flex;
    flex-direction: column;
}

/* This is the magic class that fixes the broken image sizes */
.scroll-item img {
    width: 100% !important;
    height: 250px !important; /* Forces uniform height */
    object-fit: cover !important; /* Crops the image perfectly without squishing it */
    border-radius: 20px;
    display: block;
}

.scroll-item h6 {
    margin-top: 15px;
    font-weight: 500;
    line-height: 1.4;
}

/* --- Fixed Carousel Buttons --- */
.carousel-btn { 
    background: var(--bg-panel); 
    backdrop-filter: blur(10px); 
    border: 1px solid var(--border-color); 
    color: var(--text-main); 
    border-radius: 50%; 
    width: 45px; 
    height: 45px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    position: absolute; 
    z-index: 10; 
    top: 40%; /* Centers vertically relative to the image */
    transform: translateY(-50%);
    transition: all 0.3s; 
}

.carousel-btn:hover { 
    border-color: var(--accent-gold); 
    color: var(--accent-gold); 
    transform: translateY(-50%) scale(1.1); 
}

.carousel-btn.prev { left: -20px; }
.carousel-btn.next { right: -20px; }

/* --- Mobile Responsiveness for Carousels --- */
@media (max-width: 992px) {
    .scroll-item { 
        flex: 0 0 calc(50% - 10px); 
        max-width: calc(50% - 10px); 
    }
}

@media (max-width: 576px) {
    .scroll-item { 
        flex: 0 0 calc(85% - 10px); 
        max-width: calc(85% - 10px); 
    }
    .carousel-btn {
        display: none; /* Hide buttons on mobile so users just swipe */
    }
}
/* --- Header Social Links --- */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    border-radius: 50%;
    margin-left: 5px;
    font-size: 0.8rem;
    transition: all 0.3s;
    text-decoration: none;
}
.social-links a:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* --- Floating Actions (Back to Top + Theme Toggle) --- */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
}
.floating-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}
.floating-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #fff;
}
.floating-btn.show {
    opacity: 1;
    visibility: visible;
}
#theme-toggle-fab {
    opacity: 1; /* Theme toggle is always visible */
    visibility: visible;
}

/* --- Load More Animation --- */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
/* --- 2026 Elegant Lightbox Popup --- */
.us-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10500; /* Ensure it floats above Bootstrap navs */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.us-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.us-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Dark background overlay */
    backdrop-filter: blur(8px);
}

.us-lightbox-content {
    position: relative;
    z-index: 10501;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff; /* White border matching your screenshot */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
}

.us-lightbox-content img {
    max-width: 100%;
    max-height: calc(85vh - 70px);
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.us-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--bg-panel);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10502;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.us-lightbox-close:hover {
    background: var(--accent-gold);
    color: #fff;
    border-color: var(--accent-gold);
    transform: scale(1.1);
}

.us-lightbox-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    color: #333; /* Dark text for the white background */
}

.us-lightbox-controls button {
    background: #666;
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.us-lightbox-controls button:hover {
    background: var(--accent-gold);
}

.dropdown-item {
        font-family: "Playfair Display", "Georgia", serif;
        text-align: center;
        border: none;
        background: transparent;
    }

#us-lightbox-counter {
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-sans, 'Outfit', sans-serif);
}

/* --- Dual Logo Theme Switching --- */
[data-bs-theme="dark"] .logo-light { display: none !important; }
[data-bs-theme="dark"] .logo-dark { display: inline-block !important; }

[data-bs-theme="light"] .logo-dark { display: none !important; }
[data-bs-theme="light"] .logo-light { display: inline-block !important; }

/* --- Elegant Responsive Centering (Mobile/Tablet) --- */
@media (max-width: 991.98px) {
    /* Center the Top Header Elements */
    .top-header .row { text-align: center; }
    .top-header .contact-info { 
        display: flex; 
        flex-direction: column; 
        align-items: center !important; 
        margin-top: 15px;
    }
    .top-header .d-flex { 
        justify-content: center !important; 
        text-align: center;
    }
    
    /* Center the Hamburger Menu */
    .navbar .container-fluid {
        justify-content: center !important;
    }
    .navbar-toggler {
        margin: 10px auto;
        padding: 8px 20px;
        border-radius: 30px;
    }
    
    /* Center the Navigation Links */
    .navbar-collapse {
        text-align: center;
    }
    .navbar-nav .dropdown-menu {
        font-family: "Playfair Display", "Georgia", serif;
        text-align: center;
        border: none;
        background: transparent;
    }
    
    .l2{font-family: "Playfair Display", "Georgia", serif;}
}

/* --- Mobile Offcanvas Sidebar Adjustments --- */
.custom-mobile-sidebar {
    background-color: var(--bg-main) !important;
    transition: transform 0.3s ease-in-out;
}

/* Ensure the background stays transparent on Desktop */
@media (min-width: 768px) {
    .custom-mobile-sidebar {
        background-color: transparent !important;
    }
}

/* Fix spacing and borders for the mobile menu */
@media (max-width: 767.98px) {
    .custom-mobile-sidebar .sidebar-wrapper {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .custom-mobile-sidebar .sidebar-menu {
        border-right: none !important;
    }
    
    .custom-mobile-sidebar .sidebar-menu a {
        padding: 15px 20px;
        border-radius: 12px;
        margin-bottom: 5px;
    }
}
/* --- Sticky Mobile Toggle Button --- */
.sticky-mobile-btn {
    position: sticky;
    top: 20px; /* Space from the top of the screen */
    z-index: 1040; /* Keeps it above the grid items */
    border: 2px solid rgba(255,255,255,0.2);
}
/* ========================================== */
/* MOBILE RESPONSIVE CAROUSELS & SLIDESHOWS   */
/* ========================================== */

@media (max-width: 768px) {
    /* Make the custom horizontal scroll items full width on mobile */
    .scroll-wrapper .scroll-item {
        width: 100%;
        min-width: 100%; /* Forces each item to take exactly one full screen width */
        padding-right: 15px; /* Adds a tiny gap between slides */
    }

    /* Override the inline HTML styles for the images */
    .scroll-wrapper .scroll-item img {
        width: 100% !important;
        height: 250px !important; /* Slightly taller for mobile to look impactful */
        object-fit: cover !important;
    }

    /* If you are using the Bootstrap Grid Carousel (Projects/Quarries) */
    .carousel-inner .row > div {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Hide the Next/Prev buttons on mobile since users will swipe with their fingers */
    .carousel-btn {
        display: none !important;
    }
}