/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    padding-top: 100px; /* Space below header */
    background: #F8F1EA; /* Light off-white */
    color: #000000; /* Black */
    width: 100%;
    overflow: visible;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #4A3C31; /* Dark brown/charcoal */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.header-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #F5DEB3; /* Wheat */
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 16px;
}

.nav-link {
    color: #F5DEB3; /* Wheat */
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 16px;
    transition: background 0.3s, color 0.3s;
}

.nav-link:hover {
    background: #D2B48C; /* Tan */
    border-radius: 4px;
    color: #F8F1EA; /* Light off-white */
}

.nav-link.active {
    background: #C4B5A5; /* Light taupe */
    border-radius: 4px;
    color: #F8F1EA;
}

/* Carousel (gallery.php) */
.carousel-container {
    max-width: 100%; /* Full width */
    margin: 0;
    padding-top: 20px; /* Space below header */
    text-align: center;
    scroll-margin-top: 100px; /* Matches body padding */
    position: relative;
}

.carousel {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px); /* Maintain no scroll */
    overflow: visible; /* Allow zoom overflow */
}

.carousel-item {
    width: 100%;
    height: 100%;
    display: flex; /* Center images */
    justify-content: center;
    align-items: center;
    position: relative; /* Contain enlarged image */
}

.carousel-image {
    max-width: 100%;
    max-height: 75vh; /* Fit within carousel */
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    transition: transform 0.3s ease; /* Animate only scale */
    object-fit: contain; /* Preserve aspect ratio */
    transform-origin: center center; /* Scale from center */
    position: relative; /* Ensure clickability */
    z-index: 5; /* Above other elements */
    pointer-events: auto; /* Ensure clicks register */
}

.carousel-image.enlarged {
    max-width: 95vw; /* Near-full width */
    max-height: 95vh; /* Near-full height */
    width: auto;
    height: auto;
    object-fit: contain;
    transform: scale(1.6); /* Grow in place */
    z-index: 100; /* Above header, arrows, footer */
}

.nav-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    transform: translateY(-50%);
    z-index: 9; /* Below image */
}

.nav-arrow {
    background: #F5DEB3; /* Wheat */
    color: #000000; /* Black */
    border: 1px solid #C0C0C0; /* Silver gray */
    padding: 10px 20px;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-arrow:hover {
    background: #D2B48C; /* Tan */
    color: #F8F1EA; /* Light off-white */
}

.nav-arrow:focus {
    outline: 2px solid #D2B48C;
    outline-offset: 2px;
}

.hidden {
    display: none;
}

/* Footer copyright */
.copyright {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.75rem; /* Smaller font size */
    color: #4B5563; /* Gray, matches text-gray-600 */
    text-align: left; /* Align to left edge */
    padding: 10px 0;
    padding-left: 20px; /* Align with container padding */
}

/* Patent subheading (for patents.php) */
.patent-subheading {
    font-size: 0.875rem; /* Equivalent to text-sm */
    font-style: italic;
    color: #4B5563; /* Gray-600 equivalent */
    margin-top: 0.5rem; /* Equivalent to mt-2 */
    text-align: center;
}

/* Index page heading */
.page-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #8B5A2B; /* Dark tan/brown */
    margin: 10px 0 20px 0;
    text-align: center;
    line-height: 1.2; /* Adjusted for two-line heading */
}

/* Index page byline */
.byline {
    font-size: 1rem;
    color: #8B5A2B; /* Dark tan/brown */
    margin-bottom: 20px;
    text-align: center;
}

.byline a {
    color: #8B5A2B; /* Dark tan/brown */
    text-decoration: none;
}

.byline a:hover {
    color: #4A3C31; /* Dark brown/charcoal, darker for contrast */
    text-decoration: underline;
}

/* Index page image */
.index-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    float: left;
    margin: 0 40px 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Index page patent image (for future use) */
.patent-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Index page content */
.index-content {
    overflow: hidden; /* Clearfix for floated image */
    padding: 15px 40px;
    max-height: calc(100vh - 100px); /* Adjusted for body padding */
    overflow-y: auto; /* Scroll within section if needed */
}

.index-content p {
    text-align: justify; /* Align left and right edges for neat appearance */
    margin-bottom: 1rem; /* Space between paragraphs */
}

.index-content ul {
    padding-left: 60px; /* Increased indentation for bullet points */
    margin: 0 0 1rem 0; /* Match paragraph spacing */
    list-style-type: disc; /* Standard bullets */
}

/* Responsive design */
@media (max-width: 1023px) {
    .carousel-container {
        max-width: 100%;
        padding: 0; /* Remove side padding */
        padding-top: 15px; /* Adjusted for mobile */
    }
    .carousel-image {
        max-width: 100%;
        max-height: 70vh; /* Reduced for mobile */
    }
    .carousel-image.enlarged {
        max-width: 90vw; /* Slightly smaller for mobile */
        max-height: 90vh;
        width: auto;
        height: auto;
        object-fit: contain;
        transform: scale(1.4); /* Slightly smaller scale for mobile */
    }
    .nav-arrow {
        padding: 8px 16px;
        font-size: 1.2rem;
    }
    .copyright {
        font-size: 0.7rem; /* Smaller for mobile */
        padding-left: 20px; /* Consistent left alignment */
    }
    .page-heading {
        font-size: 1.25rem;
        margin: 10px 0 15px 0;
    }
    .byline {
        font-size: 0.875rem;
    }
    .index-image {
        max-width: 300px;
        margin: 0 20px 15px 0;
    }
    .patent-image {
        max-width: 90vw;
    }
    .index-content {
        max-height: calc(100vh - 100px);
        padding: 15px 20px;
    }
    .index-content ul {
        padding-left: 50px; /* Slightly less indentation for mobile */
    }
}