/* ACCESSIBILITY: Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
}
.skip-link:focus {
    top: 0;
}

/* ACCESSIBILITY: High contrast focus indicators */
*:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* ACCESSIBILITY: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================
   GLOBAL SETTINGS
   ========================= */

html, body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    text-align: center;
    background: rgb(235, 235, 235);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

/* =========================
   HEADER STYLING - Consistent with main page
   ========================= */

header {
    position: relative;
    background-color: #434343;
    width: 100%;
    height: 90px;
    max-height: 100px;
    text-align: center;
    display: flex;
    z-index: 2000;
}

.header-div {
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    text-align: center;
    justify-content: center;
    width: 100%;
    z-index: 20;
}

.header-div img {
    width: 80px;
    height: 40px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.header-div img:active {
    transform: translateY(-3px);
}

.header-div img:hover {
    transform: translateY(-1px);
}

.header-div a {
    display: block;
}

/* =========================
   NAVIGATION STYLING - SAFARI BLUR FIX APPLIED
   ========================= */

.header-nav {
    position: absolute;
    top: 90px;
    right: 60px;
    width: 230px;
    height: 450px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    text-align: left;
}

.nav-pull {
    position: absolute;
    background-color: rgba(255,255,255,0.5);
    right: 20px;
    width: 140px;
    height: 40px;
    top: 110px;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    /* SAFARI BLUR FIX: Add webkit prefix */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1999;
}

/* SAFARI BLUR FALLBACK: Progressive enhancement */
@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    .nav-pull {
        background-color: rgba(255,255,255,0.8);
    }
}

.nav-pull p {
    top: -5px;
    position: relative;
    width: 80px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

nav ul {
    list-style: none;
    padding-left: 20px;
}

nav ul li {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    padding-bottom: 15px;
    cursor: pointer;
    transition: color 0.3s ease;
    color: #000;
    position: relative;
    padding: 8px 0;
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

nav ul li a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    transition: color 0.3s ease;
}

nav ul li:hover,
nav ul li a:hover {
    color: #0066cc;
    cursor: pointer;
}

nav ul li.active,
nav ul li.active a {
    color: white;
}

.nav-arrow-pull {
    cursor: pointer;
    height: 100%;
    width: 50px;
    position: absolute;
    right: -14px;
    top: 0;
    background-color: #505050;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow-pull img {
    position: absolute;
    top: 16px;
    right: 17px;
    height: 13px;
}

/* =========================
   ENHANCED ACCESSIBILITY MENU STYLING - SAFARI BLUR FIX APPLIED
   ========================= */

/* Enhanced Accessibility Toggle Button */
.accessibility-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 10001;
    background: #434343;
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(67, 67, 67, 0.3);
    transition: all 0.3s ease;
}

.accessibility-toggle:hover,
.accessibility-toggle:focus {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(67, 67, 67, 0.4);
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.accessibility-toggle svg,
.accessibility-toggle img {
    width: 24px;
    height: 24px;
    fill: white;
    filter: brightness(0) invert(1);
}

/* Enhanced Accessibility Menu Overlay - SAFARI BLUR FIX */
.accessibility-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* SAFARI BLUR FIX: Add webkit prefix */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* SAFARI BLUR FALLBACK for accessibility menu */
@supports not ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
    .accessibility-menu {
        background: rgba(0, 0, 0, 0.8);
    }
}

.accessibility-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Menu Container */
.accessibility-menu-container {
    width: calc(100vw - 40px);
    max-width: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    overflow: visible;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.accessibility-menu.active .accessibility-menu-container {
    transform: scale(1);
    opacity: 1;
}

/* Enhanced Close Button */
.accessibility-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
    font-size: 24px;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-menu-close:hover,
.accessibility-menu-close:focus {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Enhanced Content Styling */
.accessibility-menu-content {
    padding: 80px 30px 30px;
}

.accessibility-menu h2 {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 2em;
    margin: 0 0 30px;
    text-align: center;
    color: #434343;
    font-weight: 600;
}

/* Enhanced Controls Section */
.accessibility-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.control-group:hover {
    background: #e9ecef;
    border-color: #cbd6e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-group label {
    flex: 1;
    color: #434343;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

/* Enhanced Button Styling */
.accessibility-btn {
    background: #434343;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-btn:hover:not(:disabled),
.accessibility-btn:focus {
    background: #555;
    transform: translateY(-1px);
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.accessibility-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Gallery Controls Section */
.gallery-controls-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 0;
    margin-bottom: 20px;
}

.gallery-controls-section h3 {
    margin: 0 0 15px 0;
    color: #434343;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.gallery-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-control-btn {
    background: #434343;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 14px;
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
    flex: 1;
}

.gallery-control-btn:hover,
.gallery-control-btn:focus {
    background: #555;
    transform: translateY(-1px);
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.gallery-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Info Section */
.accessibility-info {
    background: transparent;
    color: #666;
    padding: 20px 0;
    border-radius: 0;
    text-align: center;
    margin-top: 20px;
}

.accessibility-info p {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    letter-spacing: 0;
}

.accessibility-info strong {
    font-weight: 600;
}

/* ACCESSIBILITY: Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ACCESSIBILITY: Live region for dynamic announcements */
.live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =========================
   MAIN GALLERY STYLING
   ========================= */

.gallery-main {
    padding-top: 90px;
    padding-bottom: 60px;
    min-height: calc(100vh + 500px);
    position: relative;
    background: rgb(235, 235, 235);
}

.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

/* =========================
   FLASH OVERLAY STYLES - Consistent with main page
   ========================= */

.gallery-flash-overlay {
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 999;
    opacity: 1;
    pointer-events: none;
    display: block;
}

/* =========================
   LOADING OVERLAY STYLING
   ========================= */

.gallery-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================
   GALLERY HEADER
   ========================= */

.gallery-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 60px;
}

.gallery-title {
    font-family: "Source Code Pro", monospace;
    font-optical-sizing: auto;
    font-weight: 795;
    font-style: normal;
    font-size: 4em;
    margin: 0 0 20px 0;
    color: #434343;
}

.gallery-subtitle {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 20px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* =========================
   GALLERY GRID - MOBILE FIRST
   ========================= */

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 60px;
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    transition: transform 0.1s ease;
    border-radius: 4px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: url('../images/info-gradient.png') no-repeat center bottom;
    background-size: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 40px);
}

.gallery-item:hover .gallery-item-title {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   LOAD MORE BUTTON
   ========================= */

.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    background: #434343;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.load-more-btn:hover:not(:disabled) {
    background: #555;
    transform: translateY(-2px);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.load-more-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
    filter: brightness(0) invert(1);
}

.load-more-btn:hover:not(:disabled) .load-more-arrow {
    transform: translateX(3px);
}

.load-more-btn.hidden {
    display: none;
}

/* =========================
   GALLERY OVERLAY STYLING - SAFARI BLUR FIX APPLIED
   ========================= */

.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    /* SAFARI BLUR FIX: Add webkit prefix */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* SAFARI BLUR FALLBACK for gallery overlay */
@supports not ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
    .gallery-overlay {
        background: rgba(255, 255, 255, 0.95);
    }
}

.gallery-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-overlay-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   GALLERY CLOSE BUTTON
   ========================= */

.gallery-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(160, 160, 160, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    color: white;
}

.gallery-close-btn:hover:not(:disabled) {
    background: rgba(160, 160, 160, 0.9);
    transform: scale(1.1);
}

.gallery-close-btn svg {
    width: 20px;
    height: 20px;
}

/* =========================
   GALLERY NAVIGATION BUTTONS - ENHANCED WITH AUTO-FADE
   ========================= */

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(160, 160, 160, 0.7);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
}

.gallery-nav-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.gallery-nav-btn:hover:not(:disabled) {
    background: rgba(160, 160, 160, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.auto-hidden {
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.gallery-nav-btn.auto-hidden:hover {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery-nav-prev {
    left: -80px;
}

.gallery-nav-next {
    right: -80px;
}

.gallery-nav-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.gallery-nav-prev img {
    transform: rotate(180deg);
}

.gallery-nav-btn:hover img {
    transform: rotate(180deg) scale(1.1);
}

.gallery-nav-next:hover img {
    transform: scale(1.1);
}

/* =========================
   GALLERY IMAGE CONTAINER
   ========================= */

.gallery-image-container {
    text-align: center;
    max-width: 100%;
    max-height: 100%;
}

.gallery-overlay-image {
    max-width: 80vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.gallery-image-info {
    text-align: left;
    max-width: 80vw;
    margin: 0 auto;
}

.gallery-image-title {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #434343;
    margin: 0 0 8px 0;
}

.gallery-image-caption {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: #505050;
    font-size: 12px;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* =========================
   GALLERY LINKS STYLING - CONSISTENT WITH MAIN PAGE
   ========================= */

.gallery-image-links {
    margin-top: 12px;
}

.gallery-image-links.hidden {
    display: none;
}

.gallery-image-links a {
    position: relative;
    display: block;
    padding-left: 20px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    color: #f5b11a;
    text-decoration: none;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 12px;
    line-height: 1.4;
}

.gallery-image-links a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url('../images/arrow-4.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.gallery-image-links a:hover::before {
    transform: translateY(-50%) translateX(0) translateZ(0) translate(0, -2px) !important;
}

.gallery-image-links a:hover {
    color: #ffcc33;
}

/* =========================
   CONTACT FORM STYLING - SAFARI BLUR FIX APPLIED
   ========================= */

.contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    /* SAFARI BLUR FIX: Add webkit prefix */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* SAFARI BLUR FALLBACK for contact overlay */
@supports not ((-webkit-backdrop-filter: blur(5px)) or (backdrop-filter: blur(5px))) {
    .contact-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}

.contact-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contact Trigger Button - Always visible on gallery page */
.contact-trigger {
    position: fixed;
    bottom: 140px;
    right: 30px;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.contact-trigger.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.contact-btn {
    background: #434343;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.contact-btn:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.contact-btn:active {
    transform: translateY(0);
}

.contact-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.contact-btn:hover .contact-arrow {
    transform: translateX(3px);
}

/* =========================
   FOOTER STYLING - Consistent with main page
   ========================= */

footer {
    height: 420px;
    width: 100%;
    background-color: #434343;
    padding: 40px 20px;
    box-sizing: border-box;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: space-between;
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex: 1;
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 30px;
}

.footer-logo-section {
    text-align: center;
}

.footer-logo-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.footer-logo-link:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

.footer-logo {
    width: 60px;
    height: 30px;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.footer-logo-link:hover .footer-logo {
    filter: brightness(0) invert(0.8);
}

.sitemap-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.sitemap-list li {
    margin: 0;
}

.sitemap-list a {
    color: #cccccc;
    text-decoration: none;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 14px;
    transition: color 0.3s ease;
}

.sitemap-list a:hover {
    color: white;
    text-decoration: underline;
}

.social-section {
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    display: block;
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

.social-icon {
    width: 100%;
    height: 100%;
    filter: invert(1);
    transition: filter 0.3s ease;
}

.social-link:hover .social-icon {
    filter: invert(0.8);
}

/* =========================
   MOBILE TOUCH FEEDBACK - Consistent with main page
   ========================= */

@media (hover: none) and (pointer: coarse) {
    nav ul li:active,
    nav ul li a:active {
        color: #0066cc;
        background-color: rgba(0, 102, 204, 0.1);
    }

    .gallery-item:active img {
        transform: scale(1.02);
        filter: brightness(0.9);
    }

    .gallery-item-overlay {
        opacity: 0.7;
    }

    .gallery-item-title {
        opacity: 1;
        transform: translateY(0);
    }

    .gallery-nav-prev,
    .gallery-nav-next {
        display: none !important;
    }

    .gallery-overlay::after {
        content: 'Swipe left or right to navigate';
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        font-size: 12px;
        color: rgba(67, 67, 67, 0.6);
        background: rgba(255, 255, 255, 0.8);
        padding: 8px 16px;
        border-radius: 20px;
        /* SAFARI BLUR FIX for mobile hint */
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        opacity: 0;
        animation: swipeHintFade 4s ease-in-out 1s;
    }

    @keyframes swipeHintFade {
        0%, 90% { opacity: 0; }
        20%, 70% { opacity: 1; }
        100% { opacity: 0; }
    }

    .load-more-btn:active {
        background-color: #555;
        transform: scale(0.98);
    }
}

/* Enhanced touch targets for mobile */
@media screen and (max-width: 768px) {
    .accessibility-toggle {
        bottom: 70px;
        right: 15px;
        width: 48px;
        height: 48px;
    }
    .accessibility-toggle svg,
    .accessibility-toggle img {
        width: 20px;
        height: 20px;
    }
    .accessibility-menu-container {
        width: calc(100vw - 20px);
        border-radius: 15px;
    }
    .accessibility-menu-content {
        padding: 80px 20px 20px;
    }
    .accessibility-menu h2 {
        font-size: 1.6em;
        margin-bottom: 25px;
    }
    .control-group {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .control-group label {
        font-size: 15px;
    }
    .gallery-controls {
        flex-direction: column;
        gap: 8px;
    }
    .gallery-control-btn {
        flex: none;
        width: 100%;
    }

    nav ul li {
        padding: 8px 0;
        min-height: 30px;
        display: flex;
        align-items: center;
    }

    .gallery-overlay {
        padding: 15px;
    }
    
    .gallery-overlay-image {
        max-width: 85vw;
        max-height: 65vh;
        margin: 0 auto 15px auto;
        border-radius: 6px;
    }
    
    .gallery-image-info {
        max-width: 85vw;
        padding: 0 15px;
        margin: 0 auto;
    }
    
    .gallery-image-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .gallery-image-caption {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .gallery-image-links a {
        padding-left: 16px;
        font-size: 11px;
        line-height: 1.4;
        max-width: 100%;
        padding-right: 5px;
        margin-bottom: 5px;
    }
    
    .gallery-image-links a::before {
        width: 9px;
        height: 9px;
    }

    .load-more-btn {
        padding: 14px 20px;
        min-height: 48px;
    }

    .gallery-header {
        margin-bottom: 40px;
        padding-top: 40px;
    }

    .gallery-title {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .gallery-subtitle {
        font-size: 18px;
    }

    .gallery-close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    .gallery-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .contact-trigger {
        bottom: 130px;
        right: 20px;
    }

    .contact-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Additional safety for very small screens */
@media screen and (max-width: 480px) {
    .gallery-overlay {
        padding: 10px;
    }
    
    .gallery-overlay-image {
        max-width: 80vw;
        border-radius: 4px;
    }
    
    .gallery-image-info {
        max-width: 80vw;
        padding: 0 10px;
    }

    .gallery-title {
        font-size: 2.5em;
    }

    .gallery-subtitle {
        font-size: 16px;
    }
}

/* =========================
   DESKTOP RESPONSIVE STYLING - Consistent with main page
   ========================= */

@media screen and (min-width: 800px) {
    .gallery-container {
        padding: 0 20px;
    }

    .gallery-header {
        margin-bottom: 80px;
        padding-top: 80px;
    }

    .gallery-title {
        font-size: 5.5em;
        margin-bottom: 25px;
    }

    .gallery-subtitle {
        font-size: 24px;
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
        margin-bottom: 80px;
    }

    .gallery-item-title {
        font-size: 20px;
        bottom: 25px;
        left: 25px;
    }

    .gallery-overlay-image {
        max-width: 70vw;
        max-height: 75vh;
    }

    .gallery-image-info {
        max-width: 70vw;
    }

    .gallery-image-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .gallery-image-caption {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .gallery-image-links a {
        font-size: 14px;
        padding-left: 22px;
        margin-bottom: 8px;
    }
    
    .gallery-image-links a::before {
        width: 13px;
        height: 13px;
    }

    .gallery-nav-btn {
        width: 60px;
        height: 60px;
    }

    .gallery-nav-btn img {
        width: 24px;
        height: 24px;
    }

    .gallery-nav-prev {
        left: -100px;
    }

    .gallery-nav-next {
        right: -100px;
    }

    .gallery-close-btn {
        width: 50px;
        height: 50px;
        top: 30px;
        right: 30px;
    }

    .gallery-close-btn svg {
        width: 24px;
        height: 24px;
    }

    /* Desktop navigation hover effects */
    nav ul li {
        padding: 10px 0;
        transition: all 0.3s ease;
    }
    
    nav ul li:hover {
        color: #0066cc;
        transform: translateX(5px);
    }
    
    nav ul li:active {
        transform: translateX(3px);
    }

    /* Desktop footer layout */
    .footer-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 40px;
        padding: 0 40px;
    }

    .sitemap-section {
        flex: 1;
        text-align: left;
    }

    .sitemap-list {
        justify-content: flex-start;
        gap: 20px;
    }

    .sitemap-list a {
        font-size: 16px;
    }

    .social-section {
        flex: 1;
        text-align: right;
    }

    .social-icons {
        justify-content: flex-end;
        gap: 25px;
    }

    .social-link {
        width: 36px;
        height: 36px;
    }

    .footer-logo {
        width: 70px;
        height: 35px;
    }

    .footer-bottom {
        padding-bottom: 40px;
    }

    /* Desktop enhancements */
    .accessibility-menu-container {
        border-radius: 20px;
        max-height: 75vh;
    }
    .gallery-controls {
        justify-content: center;
    }
    .gallery-control-btn {
        flex: none;
        min-width: 100px;
    }
}

/* =========================
   LOADING STATES
   ========================= */

.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* High contrast mode styles */
.high-contrast {
    --bg-color: #000;
    --text-color: #fff;
    --accent-color: #ff0;
    --border-color: #fff;
}

.high-contrast * {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

.high-contrast a,
.high-contrast button {
    color: var(--accent-color) !important;
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    .accessibility-menu,
    .accessibility-menu-container,
    .accessibility-btn,
    .gallery-control-btn,
    .control-group,
    .gallery-item,
    .gallery-overlay {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .control-group {
        border-width: 3px;
    }
    
    .accessibility-btn,
    .gallery-control-btn {
        border: 2px solid currentColor;
    }
}