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

/* Custom Tailwind Colors */
:root {
    --color-primary-blue: #21229d; /* Updated primary blue */
    --color-accent-green: #13BF01;
}

/* Extend Tailwind CSS with custom colors */
@tailwind base;
@tailwind components;
@tailwind utilities;

.bg-primary-blue {
    background-color: var(--color-primary-blue);
}

.text-primary-blue {
    color: var(--color-primary-blue);
}

.border-primary-blue {
    border-color: var(--color-primary-blue);
}

.bg-accent-green {
    background-color: var(--color-accent-green);
}

.text-accent-green {
    color: var(--color-accent-green);
}

.border-accent-green {
    border-color: var(--color-accent-green);
}

/* Custom Fonts */
body {
    font-family: "Playfair Display", serif; /* Changed body font to Playfair Display for a serif style */
}
/* Font for the hero heading and section titles, matching the logo's serif style with Trajan Pro 3 Regular */
.font-trajan-pro-3 {
    font-family: "trajan-pro-3", serif;
    font-weight: 400; /* Changed to Regular weight (400) */
    font-style: normal;
}

/* Styles for the image modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Reduced opacity for better background visibility */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8); /* Initial state for scale-in animation */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
        transform: scale(1); /* Final state for scale-in animation */
    }

/* Styles for the modal content (image container) */
.modal-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem; /* Add some padding around the image within the modal */
}

/* Styles for the image inside the modal */
.modal-image {
    max-width: 90vw; /* Max width relative to viewport width */
    max-height: 90vh; /* Max height relative to viewport height */
    object-fit: contain; /* Ensures the whole image is visible without cropping */
    border-radius: 0.5rem; /* rounded-lg */
    transition: opacity 0.3s ease; /* Transition for image fade in/out */
}

/* New CSS for blurring the background when modal is active */
body.modal-active > *:not(.modal-overlay) {
    filter: blur(5px); /* Apply blur effect */
    pointer-events: none; /* Disable interaction with blurred background */
    transition: filter 0.3s ease;
}

/* Styles for modal navigation buttons */
.modal-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s ease;
    z-index: 101; /* Ensure buttons are above image */
}

    .modal-nav-button:hover {
        background-color: rgba(0, 0, 0, 0.7);
    }

    .modal-nav-button.left {
        left: 1rem;
    }

    .modal-nav-button.right {
        right: 1rem;
    }

/* Styles for modal close button */
.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s ease;
    z-index: 101;
}

    .modal-close-button:hover {
        background-color: rgba(0, 0, 0, 0.7);
    }

/* Masonry-like grid for gallery (Desktop/Tablet) */
.gallery-grid {
    column-count: 3; /* Default for larger screens */
    column-gap: 1rem; /* Gap between columns */
}

.gallery-item {
    break-inside: avoid; /* Prevent items from breaking across columns */
    margin-bottom: 1rem; /* Gap between items in the same column */
    width: 100%; /* Ensure item takes full width of its column */
}

.gallery-item img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below image */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* shadow-md */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item img:hover {
    transform: scale(1.02); /* Slightly less scale than before to accommodate expansion */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Tailwind shadow-lg */
}

/* Responsive adjustments for masonry columns */
@media (max-width: 1024px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 1; /* Single column on smaller screens */
    }
}

/* Mobile Carousel Styles */
/* Outer container for the carousel, defines the visible window */
.mobile-carousel-container {
    display: flex;
    overflow-x: scroll; /* Enable horizontal scrolling */
    justify-content: flex-start; /* Aligns images to the start of the container */
    align-items: center;
    width: 100%; /* Takes full width of its parent (.container) */
    padding: 0 1rem; /* Padding for the arrows not to be on the very edge */
    box-sizing: border-box; /* Include padding in width calculation */
    cursor: grab; /* Cursor for dragging */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
    /* Hide scrollbar for mobile carousel */
    .mobile-carousel-container::-webkit-scrollbar {
        display: none;
    }

.mobile-carousel-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Inner container that holds all images and will be transformed for scrolling */
.mobile-inner-carousel {
    display: flex;
    width: fit-content; /* Allows content to dictate its width */
}

/* Individual mobile gallery image styling */
.mobile-gallery-image {
    width: 60vw; /* Show 1-2 images on small screens, adjust as needed */
    height: auto; /* Changed from fixed height to auto */
    object-fit: contain; /* Changed from cover to contain to ensure full image is visible */
    object-position: center; /* Changed to center for better general display */
    border-radius: 0.5rem; /* Rounded corners */
    cursor: pointer;
    border: 3px solid transparent; /* Default transparent border */
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* Added box-shadow to transition */
    margin: 0.4rem; /* Gap between images (0.4rem on each side) */
    flex-shrink: 0; /* Prevents images from shrinking */
}
    /* Hover effect for mobile gallery images */
    .mobile-gallery-image:hover {
        transform: scale(1.05);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Tailwind shadow-lg equivalent */
    }

/* Positioning and styling for mobile carousel navigation arrows */
.mobile-carousel-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.mobile-carousel-nav-button.left {
    left: 0;
}

.mobile-carousel-nav-button.right {
    right: 0;
}

    /* Disabled state for mobile carousel navigation buttons */
    .mobile-carousel-nav-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }


/* Mobile menu specific styles for animation */
#mobile-menu-container {
    /* Initial state for sliding animation */
    max-height: 0; /* Hidden state */
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out; /* Smooth transition */
    opacity: 0; /* Start hidden */
}

    #mobile-menu-container.open {
        max-height: 500px; /* Arbitrary large enough height to show all content */
        opacity: 1;
        transition: max-height 0.3s ease-in, opacity 0.3s ease-in; /* Smooth transition */
    }

/* Styles for the Scroll-to-Top FAB */
#scrollTopFab {
    position: fixed;
    bottom: 1rem; /* Adjusted for better mobile visibility */
    right: 1rem; /* Adjusted for better mobile visibility */
    background-color: rgba(0, 0, 0, 0.5); /* Changed to rgba(0, 0, 0, 0.5) */
    color: white;
    width: 2.5rem; /* Equal width and height for a circle */
    height: 2.5rem; /* Equal width and height for a circle */
    border-radius: 50%; /* Makes it a perfect circle */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.5rem; /* Icon size */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08); /* Tailwind shadow-md */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    opacity: 0; /* Initially hidden */
    visibility: hidden;
    z-index: 999; /* Higher z-index to ensure visibility */
    transform: scale(0.9); /* Slightly scaled down when hidden */
}

    #scrollTopFab.show {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }

    #scrollTopFab:hover {
        transform: scale(1.1); /* Slightly enlarge on hover */
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1); /* Larger shadow on hover */
    }

/* Styles for expandable service cards */
.service-card {
    background-color: white;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* shadow-md */
    padding: 1.5rem; /* p-6 */
    display: flex;
    flex-direction: column; /* Stack icon/title and content vertically */
    cursor: pointer;
    overflow: hidden; /* Hide overflow content initially */
    transition: all 0.3s ease-out; /* Smooth transition for all properties */
    will-change: transform, box-shadow, height; /* Optimize for these changes */
    align-self: flex-start; /* Re-added to prevent stretching to sibling height */
    min-height: 80px; /* Changed min-height to 80px */
    justify-content: center; /* Changed to center to vertically center content within the card */
}

.service-card-header {
    display: flex;
    align-items: center;
    gap: 1rem; /* Replaced space-x-4 with gap-4 for modern flexbox spacing */
    padding-bottom: 0.5rem; /* Add some padding below the header */
    justify-content: center; /* Added for centering icon and title */
    /* Removed flex-wrap: wrap; from here */
}

    /* New rule to ensure h3 text wraps within its allocated space */
    .service-card-header h3 {
        flex-grow: 1; /* Allows h3 to take up available space */
        flex-shrink: 1; /* Allows h3 to shrink if needed */
        min-width: 0; /* Essential for flex items to shrink below their content size */
    }

.service-card-content {
    max-height: 0; /* Initially hidden */
    opacity: 0; /* Initially transparent */
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, padding 0.5s ease-out; /* Smooth transition for content */
    padding-top: 0; /* No padding when collapsed */
}

.service-card.expanded .service-card-content {
    /* max-height is now set directly by JavaScript based on scrollHeight */
    opacity: 1;
    padding-top: 1rem; /* Add padding when expanded */
}

.service-card:hover {
    transform: scale(1.02); /* Slightly less scale than before to accommodate expansion */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Tailwind shadow-lg */
}

/* NEW: Scroll margin for fixed header */
section[id^="gallery-"],
section#favorites,
section#contact-gallery {
    scroll-margin-top: 6rem; /* Adjust this value based on your header's height. 6rem is approximately 96px. */
}
