:root {
    /* Transitions */
    --transition-duration-color: 2s;
    --transition-duration: 3s;  /* Matches JavaScript ANIMATION_DURATION (3000ms) */
    --transition-duration-text: 0.2s;

    /* Colors */
    --color-background: white;
    --color-text: black;
    --color-text-overlay: white;
    --color-border: black;
    --color-overlay-background: rgba(0, 0, 0, 0.3);
    --color-text-shadow: rgba(0, 0, 0, 0.8);
    --color-text-hover: #555;
    --color-text-active: #333;
    --color-primary-tan: #b2aca3;
    /* Spacing */
    --slider-padding-top: 0;
    --image-height: 100vh;
    --overlay-top-position: 50vh;
    
    /* Borders */
    --border-width: 1vh;
    --border-radius: 0.25rem;
    
    /* Typography */
    --font-family-base: 'Public Sans', Arial, sans-serif;
    --font-size-overlay: 1.2rem;
    --padding-menu: 0.625rem;
    --padding-overlay-x: 1rem;
    --padding-overlay-y: 1vh;
    
    /* Shadows */
    --text-shadow-offset: 0.125rem;
    --text-shadow-blur: 0.5rem;
    
    /* Menu */
    --menu-height: 5rem;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    line-height: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent any potential scrolling gaps */
}

h2, h3 {
    text-align: center;
}

h2 {
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.8rem;
    color: #333;
}

.menu {
    background-color: var(--color-background);
    color: var(--color-text);
    padding: var(--padding-menu) var(--padding-menu) 0;
    text-align: center;
    transition: background-color var(--transition-duration-color), color var(--transition-duration-text);
    font-size: 0; /* Remove any potential whitespace */
}

.menu h1 {
    font-size: 1.6rem; /* Reset font size for content */
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.03em;
}

.menu-items {
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: baseline; /* Align all items to the text baseline */
    gap: 4rem;
    margin-top: 0.3em;
    position: relative;
}

.menu-item {
    text-decoration: none;
    color: var(--color-text);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: color var(--transition-duration-text), background-color 0.3s;
    position: relative;
    padding: 0.3em 0;
    display: inline-block;
    vertical-align: baseline; /* Ensure consistent alignment */
}

/* Hover effect for menu items */
.menu-item:hover {
    color: var(--color-text-hover);
}

/* Active menu item */
.menu-item.active {
    color: var(--color-text-active);
    font-weight: 900;
}

/* Underline effect for menu items */
.menu-item::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.menu-item:hover::after,
.menu-item.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Dropdown menu */
.dropdown {
    position: relative;
    display: inline-block;
    vertical-align: baseline; /* Align with other menu items */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--color-primary-tan);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 10;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0;
    text-align: center;
    transition: background-color var(--transition-duration-color);
}

/* Dropdown disabled */
/* .dropdown:hover .dropdown-content {
    display: block;
} */

.dropdown-item {
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: block;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.dropdown-item.active {
    color: white;
    font-weight: 700;
    background-color: rgba(255,255,255,0.15);
}

/* Desktop-only dropdown automation */
@media (min-width: 768px) {
    .dropdown-content.show-auto {
        display: block !important;
        animation: fadeInDropdown 0.3s ease-in-out;
    }
    
    @keyframes fadeInDropdown {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }
}

.slider {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color var(--transition-duration-color);
    margin-top: -1px; /* Remove any potential pixel gap */
    cursor: grab;
}
@media (min-width: 769px) {
  .slider .slide-image,
  .slider .slide-image-link img {
    top: -50px;
  }
}


/* ===== NON-DESTRUCTIVE SLIDER ARROWS ===== */

.slider-arrow-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none; /* overlay itself does not block drag */
    z-index: 20;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto; /* buttons ARE clickable */

    background: rgba(0, 0, 0, 0.55);
    color: white;
    border: none;
    border-radius: 50%;

    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    user-select: none;
}

.slider-arrow.left {
    left: 16px;
}

.slider-arrow.right {
    right: 16px;
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}


.slider:active {
    cursor: grabbing;
}

.slide-image {
    height: var(--image-height);
    min-height: 450px;
    width: auto;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: transform var(--transition-duration) ease-in-out;
    z-index: 1;
    will-change: transform;
}

.slide-image-link {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: transform var(--transition-duration) ease-in-out;
    z-index: 1;
    will-change: transform;
    cursor: pointer;
    display: block;
}

/* Z-index management for smooth transitions on portrait/mobile viewports */
/* Ensures current image stays above incoming image during animation */
/* Must target both .slide-image elements and their .slide-image-link wrappers */
.slide-image.current-animating,
.slide-image-link:has(.current-animating) {
    z-index: 2; /* Current image stays on top during transition */
}

.slide-image.incoming-animating,
.slide-image-link:has(.incoming-animating) {
    z-index: 1; /* Incoming image slides underneath */
}

.slide-image.initial {
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--transition-duration);
}

.slide-image.current {
    opacity: 1;
}

/* Drag preview styling */
.slide-image.drag-preview {
    z-index: 0; /* Below current image */
    pointer-events: none;
}

/* Prevent text selection during drag */
.slider.dragging {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Ensure smooth spring-back animation */
.slide-image,
.slide-image-link {
    transition: transform var(--transition-duration) ease-in-out, opacity var(--transition-duration-text);
}

.slide-image.no-transition,
.slide-image-link.no-transition {
    transition: none !important;
}

.image-name-overlay {
    position: absolute;
    top: 2vh;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text);
    font-weight: 500;
    font-size: var(--font-size-overlay);
    text-transform: uppercase;
    opacity: 0;
    transition: opacity var(--transition-duration-text), color var(--transition-duration-text);
    z-index: 4; /* Updated from 2 - must stay above images during animation */
    pointer-events: none; /* Container doesn't block clicks */
    margin: 0 auto;
    width: 90%;
    max-width: 800px;
    white-space: nowrap;
    text-align: center;
}

/* Text overlay styles - per slide configuration */
/* Simple text styles without backgrounds */
.image-name-overlay.style-black {
    color: black;
}

.image-name-overlay.style-black .image-link {
    color: black;
}

.image-name-overlay.style-white {
    color: white;
}

.image-name-overlay.style-white .image-link {
    color: white;
}

/* Background button styles for improved legibility on busy images */
.image-name-overlay.style-white-bg {
    color: black;
    background: rgba(255, 255, 255, 0.9);
    padding: var(--padding-overlay-y) var(--padding-overlay-x);
    border-radius: var(--border-radius);
    backdrop-filter: blur(4px);
    display: inline-block;
    width: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-name-overlay.style-white-bg .image-link {
    color: black;
}

.image-name-overlay.style-white-bg:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.image-name-overlay.style-black-bg {
    color: white;
    background: rgba(50, 50, 50, 0.75);
    padding: var(--padding-overlay-y) var(--padding-overlay-x);
    border-radius: var(--border-radius);
    backdrop-filter: blur(4px);
    display: inline-block;
    width: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-name-overlay.style-black-bg .image-link {
    color: white;
}

.image-name-overlay.style-black-bg:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Legacy support - keep existing white-text class for backwards compatibility */
.image-name-overlay.white-text {
    color: white !important;
}

.image-name-overlay.white-text .image-link {
    color: white !important;
}

.image-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    pointer-events: auto; /* Enable clickability */
    display: inline-block;
}


.image-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.image-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.image-name-overlay.visible {
    opacity: 1;
}

.image-name-overlay.fade {
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.fade {
    animation: fadeInOut 2s ease-in-out;
}

.dot-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(4px);
    cursor: default;
}

.dots-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    padding: 0;
}

.dot:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background: white;
}

/* Play/pause button */
.play-pause-button {
    width: 16px;
    height: 16px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.play-pause-button:hover {
    transform: scale(1.2);
    opacity: 1;
}

.play-pause-button svg {
    display: block;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dot {
        width: 6px;
        height: 6px;
    }

    .dot-indicators {
        gap: 12px;
        padding: 6px 16px;
    }

    .dots-container {
        gap: 10px;
    }

    .play-pause-button {
        width: 14px;
        height: 14px;
    }

    .play-pause-button svg {
        width: 10px;
        height: 10px;
    }
}

/* Height-based adjustments for very short viewports */
/* Keep menu and overlay adjustments, but maintain full image height */
@media screen and (max-height: 740px) {
    :root {
        --menu-height: 4rem;   /* Slightly reduce menu height */
    }

    .image-name-overlay {
        top: 1vh;  /* Reduce top spacing */
    }

    .dot-indicators {
        bottom: 10px;  /* Fixed bottom position */
    }
}

/* For even smaller heights */
@media screen and (max-height: 600px) {
    .menu h1 {
        font-size: 1.2rem;
    }

    .menu-items {
        margin-top: 0.2em;
    }
}

/* Contact form styles */
.contact-page {
    background-color: #f9f9f9;
    min-height: calc(100vh - var(--menu-height));
    padding-top: 3rem;
}

.contact-intro {
    max-width: 600px;
    margin: 0 auto 2rem;
    text-align: center;
    line-height: 1.6;
}

.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-family: var(--font-family-base);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--color-text);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-check-input {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
}

.form-check-label {
    font-weight: normal;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    background-color: var(--color-text);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-family-base);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: var(--border-radius);
    flex: 1;
}

.btn:hover {
    background-color: var(--color-text-hover);
}

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

.btn-secondary {
    background-color: #aaa;
}

.form-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.form-status.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.form-status.error {
    background-color: #ffebee;
    color: #c62828;
}

@media (max-width: 768px) {
    .contact-form {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Page content container */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}


.content {
    max-width: 90vw;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
}


.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.video-thumbnail-container {
    position: relative;
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.play-button:before {
    content: '';
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid white;
    margin-left: 4px; /* Slight adjustment for visual centering */
}

.video-card:hover .play-button {
    background-color: rgba(0, 0, 0, 0.9);
}

.video-content {
    padding: 1.25rem;
    background-color: white;
}

.video-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.video-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
}

.video-link {
    display: inline-block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
    transition: opacity 0.2s ease;
}

.video-link:hover {
    opacity: 0.7;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

.back-link:hover {
    opacity: 0.8;
}

/* ===== FOOTER STYLES ===== */

.site-footer {
    background-color: var(--color-primary-tan);
    color: white;
    padding: 2rem 1rem;
    margin-top: 4rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

.footer-link:hover {
    opacity: 0.7;
}

.footer-link.active {
    font-weight: 700;
}

.footer-link.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: white;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    line-height: 1.6;
}

.footer-copyright,
.footer-credit {
    margin: 0;
    color: white;
}
.footer-credit a {
  color: white;
}


.footer-external-link {
    color: white;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.footer-external-link:hover {
    opacity: 0.7;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .site-footer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
        font-size: 0.85rem;
    }

    .footer-nav {
        gap: 1.5rem;
    }

    .footer-content {
        gap: 1rem;
    }
}

/* Modal styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.modal-content {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}



.modal-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    max-width: 100%;
}
.modal-content {
  max-height: 100vh;
}


/* Mobile landscape: prevent height collapse */
.modal-video-container {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 24px);
  aspect-ratio: 16 / 9;
  overflow: visible;
}

.modal-video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}


.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

/* ===== IMAGE CARD STYLES ===== */

.drawings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.image-card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.image-card img {
    max-width: 100%;
    height: 300px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: opacity 0.3s ease;
}

.image-card:hover img {
    opacity: 0.9;
}

/* ===== IMAGE MODAL STYLES ===== */

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.image-modal .modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 15px; /* Position close button on right for images */
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .drawings-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 98%;
    }

    .image-modal {
        padding: 10px;
    }

    .image-modal .modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
}

/* ===== VISUAL STUDIES PAGE STYLES ===== */

/* Override menu background for Visual Studies page only */
.studies-grid ~ * .menu,
body:has(.studies-grid) .menu {
    background-color: white !important;
    color: #333 !important;
}

body:has(.studies-grid) .menu-item {
    color: #333 !important;
}

/* Enable scrolling for Visual Studies page */
body:has(.studies-grid) {
    overflow: auto !important;
    overflow-x: hidden !important;
}

.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: stretch; /* Changed from 'start' to make cards fill row height */
    grid-auto-rows: 1fr; /* Makes all rows the same height */
}

.study-card {
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Changed from 'fit-content' to fill grid cell */
    display: flex; /* Add flexbox for internal layout control */
    flex-direction: column; /* Stack image and content vertically */
}

.study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.study-image-container {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    flex-shrink: 0; /* Prevent image container from shrinking */
}

.study-image {
    height: 200px;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.study-card:hover .study-image {
    transform: scale(1.05);
}

.study-content {
    padding: 1.25rem;
    background-color: white;
    flex: 1; /* Allow content to grow and fill available space */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute content evenly */
}

.study-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #333;
}

.study-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
    flex: 1; /* Allow description to take available space */
    min-height: 3em; /* Ensure minimum space for short descriptions */
}

.study-link {
    display: inline-block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
    margin-top: auto; /* Push link to bottom of container */
}

.study-link:hover {
    opacity: 0.7;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .study-content {
        padding: 1rem;
    }

    .study-title {
        font-size: 1rem;
    }

    .study-description {
        font-size: 0.85rem;
    }
}

/* ====================
   CV Page Styles
   ==================== */

.cv-content h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.cv-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}

.cv-content h5 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.cv-content ul {
    list-style-type: disc;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.cv-content li {
    margin-bottom: 0.3rem;
}

.cv-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cv-table th,
.cv-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cv-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    border-bottom: 2px solid #333;
}

.cv-table td:first-child {
    width: 120px;
    font-weight: 500;
}

.contact-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #333;
    text-align: center;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .cv-table {
        font-size: 0.9rem;
    }

    .cv-table th,
    .cv-table td {
        padding: 0.5rem;
    }

    .cv-table td:first-child {
        width: 80px;
    }
}

/* ====================
   Page-Specific Menu Overrides
   ==================== */

/* Override menu background for content pages (CV, tower, mechanical),
   video cards pages, drawings page, and contact page */
body:has(.content) .menu,
body:has(.videos-grid) .menu,
body:has(.drawings-grid) .menu,
body:has(.contact-form) .menu {
    background-color: white !important;
    color: #333 !important;
}

body:has(.content) .menu-item,
body:has(.videos-grid) .menu-item,
body:has(.drawings-grid) .menu-item,
body:has(.contact-form) .menu-item {
    color: #333 !important;
}

/* Enable scrolling for content pages */
body:has(.content),
body:has(.videos-grid),
body:has(.drawings-grid),
body:has(.contact-form) {
    overflow: auto !important;
    overflow-x: hidden !important;
}

/* ====================
   Content Page Styles (CV, Tower, Mechanical)
   ==================== */

/* .content styles already defined above at line 695 */

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
}

.gallery-item {
    width: 80vw;
    max-width: 100%;
    margin: 0 auto 2rem;
}

.item-wrapper {
    position: relative;
    margin-bottom: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: auto;
    display: block;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

@media (max-width: 768px) {
    /* .content padding already defined in media query at line 1102 */

    .gallery-item {
        width: 90vw;
    }
}

@media (min-width: 1600px) {
    .gallery-item {
        width: 70vw;
    }
}

/* ====================
   Contact Page Specific Styles
   ==================== */

.cv-link-container {
    text-align: center;
    margin-bottom: 2rem;
}

.cv-link-container p {
    line-height: 1.5;
}

.cv-link {
    display: inline-block;
    background-color: #21926A;
    color: white;
    padding: 0.75rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.cv-link:hover {
    background-color: #1a7555;
}

/* === Home slider mobile final layout === */
@media (max-width: 768px) {

  .slider {
    height: 65vh;
    max-height: 65vh;
    overflow: hidden;
  }

  .slider .slide-image,
  .slider .slide-image-link img {
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.85);
    transform-origin: top center;
    object-fit: contain;
    object-position: center center;
  }

}
@keyframes slider-pan {
  0%   { transform: var(--pan-start); }
  8%   { transform: var(--pan-mid-start); }
  92%  { transform: var(--pan-mid-end); }
  100% { transform: var(--pan-end); }
}
@media (max-width: 900px) {
  .slider-arrow {
    top: 85%;
    transform: translateY(-50%);
  }
}
#clickHintOverlay {
  display: block;
  margin-top: 0.35rem;      /* below title */
  font-size: 0.95em;        /* slightly smaller than title */
  color: white;             
  opacity: 0;
  z-index: 4;
  text-transform: none;
  letter-spacing: 0.02em;
  pointer-events: none;
}

@media (max-width: 768px) {
  .image-name-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #clickHintOverlay {
    order: 2;              /* force BELOW title */
    margin-top: 2.0rem;
  }

  .image-name-overlay > *:not(#clickHintOverlay) {
    order: 1;              /* title first */
  }
}

.image-name-overlay.visible {
  opacity: 1 !important;
}
.slider {
  position: relative;
}

.image-name-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  will-change: transform;
}
#imageNameOverlay {
  opacity: 0;
  visibility: hidden;
}

#imageNameOverlay.visible {
  opacity: 1 !important;
  visibility: visible !important;
}
