/* ============================================
   VIDEO GALLERY STYLES
   Custom masonry video gallery
   ============================================ */

:root {
    --bg-primary: #22211f;
    --bg-secondary: #2a2928;
    --accent-gold: #ffc600;
    --accent-coral: #ff5454;
    --text-primary: #ffffff;
    --text-muted: #888;
    --gap: 4px;
}

/* Global resets - apply to all pages (safe, doesn't conflict) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styles - only apply to non-index pages to avoid conflicts with style.css */
body:not(.pageType_Index) {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION with reverse section-tag hover effect
   ============================================ */
.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    font-weight: 700;
    font-size: 1rem;
}

.nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 2px 10px;
    position: relative;
    background: transparent;
    transition: background 0.5s ease-out, color 0.3s ease;
    display: inline-block;
    line-height: 1.3;
    z-index: 10;
    transform: translateZ(0); /* Create new stacking context */
    will-change: background-color, color; /* Optimize hover transitions */
    contain: layout style paint; /* Isolate from animation repaints */
}

.nav a:hover {
    color: var(--bg-primary); /* #22211f */
    background: var(--accent-coral); /* Same color as btn-switch */
    animation: mainBlock .3s cubic-bezier(.1, .06, .1, .99) forwards;
}

/* ============================================
   PHOTOS/GO TO TOP BUTTON - sticky like original
   ============================================ */
.btn-switch-container {
    position: absolute;
    right: 1rem;
    z-index: 100;
    padding: 1rem 0.5rem;
    /* Top position will be set by JavaScript to align with section-header */
}

/* When fixed (after scroll threshold), stick to top of viewport */
.btn-switch-container.fixed {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem 0.5rem;
}

/* For screens with max-width container, align button to content area when fixed */
@media (min-width: 1280px) {
    .btn-switch-container.fixed {
        right: calc((100vw - 1280px) / 2);
    }
}

.btn-switch {
    padding: 2px 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: var(--accent-coral);
    color: var(--bg-primary);
    text-decoration: none;
    line-height: 1.3;
    position: relative;
    z-index: 10;
    transform: translateZ(0); /* Create new stacking context */
    transition: background 0.5s ease-out;
    display: inline-block;
    will-change: background-color, color; /* Optimize hover transitions */
    contain: layout style paint; /* Isolate from animation repaints */
}

.btn-switch:hover {
    color: white;
    background: var(--accent-coral) !important;
    animation: mainBlock .3s cubic-bezier(.1, .06, .1, .99) forwards;
}

@media (max-width: 768px) {
    .btn-switch {
        font-size: 0.95rem;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .btn-switch {
        font-size: 0.85rem;
        padding: 2px 6px;
    }
}

/* ============================================
   FILTER BAR (shown when filtering)
   ============================================ */
.filter-bar {
    padding: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative; /* Ensure it respects padding */
}

.filter-bar .section-tag {
    font-size: 1.1rem;
}

/* Mobile styles for filter-bar - match section-header */
@media (max-width: 768px) {
    .filter-bar {
        font-size: 0.95rem; /* Match section-header font-size on mobile */
        gap: 4px; /* Match section-header gap on mobile */
        padding: 0.75rem 1rem; /* Match section-header padding (0.75rem vertical) for proper alignment */
        padding-right: 100px; /* Reserve space for btn-switch-container */
    }
    
    .filter-bar .section-tag {
        font-size: 0.95rem;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        font-size: 0.85rem; /* Match section-header font-size on very small screens */
        gap: 3px; /* Match section-header gap on very small screens */
        padding: 0.75rem 0.75rem; /* Match section-header padding on very small screens for proper alignment */
        padding-right: 90px; /* Reserve space for btn-switch-container on small screens */
    }
    
    .filter-bar .section-tag {
        font-size: 0.85rem;
        padding: 2px 6px;
    }
}

.filter-bar .reset-tag {
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.filter-bar .reset-tag:hover {
    color: var(--text-primary);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    padding: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Group first label and button together to prevent breaking between them */
.section-header .label:first-of-type::after {
    content: '\200B'; /* Zero-width space to allow breaking only after button */
    white-space: normal;
}

.section-header .label {
    color: var(--text-primary);
}

/* Prevent first label from breaking before button on mobile */
/* Use a wrapper technique: make first label and button act as a unit */
@media (max-width: 768px) {
    /* Keep first label text from breaking */
    .section-header .label:first-of-type {
        white-space: nowrap;
    }
    
    /* Prevent button from breaking away from first label */
    .section-header .label:first-of-type + .section-tag {
        flex-shrink: 0; /* Don't shrink the button */
    }
    
    /* Reduce gap between first label and button to keep them closer */
    .section-header .label:first-of-type + .section-tag {
        margin-left: -2px; /* Slightly reduce visual gap */
    }
}

/* On very small screens, still try to keep them together */
@media (max-width: 480px) {
    .section-header .label:first-of-type {
        white-space: nowrap;
    }
    
    .section-header .label:first-of-type + .section-tag {
        flex-shrink: 0;
        margin-left: -2px;
    }
}

.section-tag {
    padding: 2px 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: var(--accent-gold);
    color: var(--bg-primary);
    line-height: 1.3;
    transition: background 0.5s ease-out;
    position: relative;
    z-index: 10;
    transform: translateZ(0); /* Create new stacking context */
    will-change: background-color, color; /* Optimize hover transitions */
    contain: layout style paint; /* Isolate from animation repaints */
}

.section-tag:hover {
    color: white;
    background-color: transparent;
    animation: mainBlock .3s cubic-bezier(.1, .06, .1, .99) forwards;
}

@keyframes mainBlock {
    0% {
        transform: scaleX(1) scaleY(1);
    }
    100% {
        transform: scaleX(.9) scaleY(.9);
    }
}

.section-tag.active {
    background: transparent;
    color: var(--text-primary);
}

/* Video sections */
.video-section {
    transition: opacity 0.3s ease;
}

/* ============================================
   SHOWREEL SECTION
   ============================================ */
.showreel-section {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.showreel-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.showreel-bg {
    position: absolute;
    top: 0;
    left: -30%;
    width: 160%;
    height: 100%;
    background-color: var(--bg-primary);
    opacity: 0.8;
    background-size: 8px 8px;
    background-image: repeating-linear-gradient(45deg, var(--accent-gold) 0, var(--accent-gold) 0.8px, var(--bg-primary) 0, var(--bg-primary) 99%);
    z-index: 0;
}

.wistia_responsive_wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ============================================
   MASONRY CONTAINER
   ============================================ */
.masonry-container {
    display: flex;
    gap: var(--gap);
    padding: 1rem var(--gap) 1rem;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0; /* Allow flex items to shrink below content size */
    width: 0; /* Force equal width distribution */
}

/* ============================================
   GALLERY ITEM (unified for photos and videos)
   ============================================ */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(315deg, #111 0%, #445 90%);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.4s ease forwards;
    width: 100%; /* Ensure items fill their column */
    box-sizing: border-box; /* Include padding/border in width calculation */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Placeholder while loading */
.gallery-item.loading {
    aspect-ratio: 16 / 9;
    min-height: 150px;
}

.gallery-item.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(315deg, #111 0%, #445 90%);
    animation: shimmer 1.5s infinite;
    background-size: 200% 100%;
}

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

.gallery-item.loading .play-icon,
.gallery-item.loading .info-overlay,
.gallery-item.loading .overlay {
    display: none;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease, opacity 0.3s ease;
}

.gallery-item.loading img,
.gallery-item.loading video {
    opacity: 0;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
    filter: grayscale(100%);
}

/* Photo overlay (used on photos page) */
.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 12px 12px;
    background: linear-gradient(transparent, rgba(34, 33, 31, 0.9));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.overlay .title {
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.overlay .tags {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

/* Play Button Overlay (for videos) */
.gallery-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .play-icon {
    opacity: 1;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 18px solid var(--text-primary);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

/* Info Overlay (for videos) */
.gallery-item .info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.gallery-item:hover .info-overlay {
    transform: translateY(0);
}

.info-overlay .title {
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 700;
    line-height: 1.3;
}

.info-overlay .description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   GIF GALLERY (now uses masonry layout)
   ============================================ */
/* GIFs now use .gallery-item class and masonry-container */
/* No special styling needed - they inherit from gallery-item */

/* ============================================
   LIGHTBOX (unified for photos and videos)
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000 !important; /* Ensure it's above everything including contact modal */
    pointer-events: none; /* Don't block clicks when not active */
}

.lightbox.active {
    display: flex;
    pointer-events: auto; /* Allow clicks when active */
    z-index: 10000 !important; /* Ensure it's above everything when active */
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    pointer-events: none; /* Allow clicks to pass through to nav buttons */
}

.lightbox-content img {
    pointer-events: auto; /* But allow clicks on the image itself */
}



/* Video lightbox content (iframe) */
.lightbox-content iframe {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    border: none;
    background: #000;
    pointer-events: auto;
}

/* Video.js player styling - sized to match video dimensions */
.lightbox-content .video-js {
    max-width: 1200px;
    max-height: 80vh;
    pointer-events: auto;
    position: relative;
    margin: 0 auto;
}

/* Override video.js fluid mode - we set explicit dimensions */
.lightbox-content .video-js.vjs-fluid {
    padding-top: 0 !important;
}

/* Video.js player container - fill the container exactly */
.lightbox-content .video-js .vjs-tech {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    pointer-events: auto;
}

/* Ensure video element fills container exactly */
.lightbox-content .video-js video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block !important;
}


/* Photo lightbox content (img) */
.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-loading {
    position: absolute;
    color: var(--accent-gold);
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 10001 !important; /* Above lightbox */
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

.lightbox-close:hover {
    color: var(--accent-coral);
    transform: scale(1.1);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    z-index: 10001 !important; /* Above lightbox */
    pointer-events: auto !important;
}

.lightbox-nav:hover {
    color: var(--accent-gold);
    opacity: 1;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-info {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 80%;
    z-index: 10001; /* Above lightbox content */
    pointer-events: none; /* Don't block clicks */
}

.lightbox-info .title {
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: 700;
}

.lightbox-info .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.lightbox-info .counter {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ============================================
   CONTACT MODAL
   ============================================ */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
}

/* When lightbox is active, lower contact modal z-index */
.lightbox.active ~ .contact-modal,
body:has(.lightbox.active) .contact-modal {
    z-index: 999 !important;
    pointer-events: none !important;
}

.contact-modal.active {
    display: flex;
    opacity: 1;
}

.contact-modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    position: relative;
    border: 1px solid var(--accent-gold);
    margin: auto;
    border-radius: 8px;
}

.contact-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.contact-modal-close:hover {
    color: var(--accent-coral);
    opacity: 1;
}

.contact-modal h2 {
    color: var(--accent-gold);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: center;
}

/* Social Icons */
.contact-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.contact-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.contact-social-link:hover {
    color: var(--accent-gold);
    transform: translateY(-2px);
    opacity: 1;
}

.contact-social-link svg {
    width: 32px;
    height: 32px;
}

.contact-social-link svg {
    width: 32px;
    height: 32px;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: var(--bg-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.25rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-submit:hover {
    background: var(--accent-coral);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    display: none;
}

.form-message.success {
    background: rgba(255, 198, 0, 0.15);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    display: block;
}

.form-message.error {
    background: rgba(255, 84, 84, 0.15);
    color: var(--accent-coral);
    border: 1px solid var(--accent-coral);
    display: block;
}

/* Phone Display */
.contact-phone {
    text-align: center;
    margin-bottom: 1.5rem;
}

.contact-phone-label {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.contact-phone-value {
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.contact-phone-value:hover {
    color: var(--accent-gold);
}

/* Toggle Buttons */
.contact-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.toggle-button {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.625rem 1.25rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-button:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* Form Container - Hidden by default */
.contact-form-container {
    display: none;
}

.contact-form-container.active {
    display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
}

.footer .copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer .social {
    display: flex;
    gap: 15px;
}

.footer .social a {
    color: var(--text-primary);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer .social a:hover {
    color: var(--accent-gold);
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    width: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .section-tag {
        font-size: 0.95rem;
        padding: 2px 8px;
    }

    .section-header {
        font-size: 0.9rem; /* Smaller font to fit more content */
        padding: 0.75rem 1rem; /* Reduced vertical padding to save space */
        /* Reduce gap to fit more content on one line before wrapping */
        gap: 3px; /* Further reduced gap to keep elements closer */
        /* Allow wrapping to prevent overlap with btn-switch-container */
        flex-wrap: wrap;
    }
    
    /* Prevent section-tags from shrinking to avoid text cropping, but allow wrapping */
    .section-header .section-tag {
        flex-shrink: 0 !important; /* Don't allow section-tags to shrink */
        white-space: nowrap !important; /* Prevent text wrapping inside tags */
        min-width: fit-content; /* Allow tags to be their natural width */
        /* Tags can wrap to new lines when needed */
    }
    
    /* Allow labels to shrink slightly if needed, but not tags */
    .section-header > *:not(.section-tag) {
        flex-shrink: 1;
        min-width: 0; /* Allow text truncation if absolutely necessary */
    }
    
    /* Keep first label and button together - make them less likely to break */
    .section-header .label:first-of-type {
        flex-shrink: 0; /* Don't shrink the first label */
    }
    
    .section-header .label:first-of-type + .section-tag {
        flex-shrink: 0; /* Don't shrink the button */
        margin-left: 1px; /* Minimal gap */
    }

    /* Apply padding-right to photos page section-header (has id="filter-container") */
    .section-header#filter-container {
        padding-right: 90px; /* Further reduced padding to allow more content on one line */
        min-height: 2.5rem; /* Ensure enough height for wrapping */
    }

    /* Apply padding-right to videos page section-headers (inside .video-section) */
    .video-section .section-header {
        padding-right: 90px; /* Further reduced padding to allow more content on one line */
        min-height: 2.5rem; /* Ensure enough height for wrapping */
    }

    .btn-switch-container {
        right: 0.5rem; /* Slightly closer to edge on mobile */
        padding: 0.75rem 0.5rem; /* Match section-header vertical padding (0.75rem) for proper alignment */
    }

    .showreel-bg {
        display: none;
    }
}

@media (max-width: 480px) {
    .section-tag {
        font-size: 0.85rem;
        padding: 2px 6px;
    }

    .section-header {
        font-size: 0.8rem; /* Even smaller font to fit more content */
        padding: 0.75rem 0.75rem; /* Reduced padding on very small screens */
        /* Further reduce gap on very small screens to fit more on one line */
        gap: 2px; /* Minimal gap */
        /* Still try to keep on one line, but allow wrapping if absolutely necessary */
        flex-wrap: wrap;
    }
    
    /* On very small screens, allow items to shrink more */
    .section-header > * {
        flex-shrink: 1;
    }
    
    /* Keep first label and button together on very small screens */
    .section-header .label:first-of-type {
        flex-shrink: 0;
        white-space: nowrap; /* Prevent text from breaking inside */
    }
    
    .section-header .label:first-of-type + .section-tag {
        flex-shrink: 0;
        margin-left: 1px;
        white-space: nowrap; /* Prevent button text from breaking */
        padding: 2px 5px; /* Slightly smaller padding for button */
    }

    /* Apply padding-right to videos page section-headers (inside .video-section) */
    .video-section .section-header {
        padding-right: 20px; /* Reduced padding on very small screens */
    }

    .btn-switch-container {
        right: 0.25rem; /* Even closer on very small screens */
    }
}

/* Protect intro section from footer changes on index page */
body.pageType_Index .intro {
    isolation: isolate; /* Create new stacking context */
    position: relative; /* Ensure it has its own positioning context */
    z-index: 1; /* Keep it above footer */
    /* Preserve viewport-based height calculation */
    height: 80vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.pageType_Index #intro_Karolis {
    position: absolute !important; /* Preserve absolute positioning */
    /* All positioning properties are handled by style.css/index.css */
}

body.pageType_Index .container_videos_photos {
    /* Preserve container positioning */
    position: relative;
}

/* Footer mobile styles - only apply to non-index pages */
@media (max-width: 768px) {
    /* Override style.css footer on mobile for photos/videos pages */
    body:not(.pageType_Index) .footer {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        max-width: none !important;
        line-height: normal !important;
        margin-top: 60px;
        padding: 40px 20px;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }
    
    body:not(.pageType_Index) .footer .copyright {
        float: none !important;
        margin-left: 0 !important;
        margin: 0 !important;
    }
    
    body:not(.pageType_Index) .footer .social {
        float: none !important;
        margin-inline-end: 0 !important;
        margin: 0 !important;
    }
}

/* Additional protection for intro at small screen sizes */
@media (max-width: 481px) {
    body.pageType_Index .intro {
        height: 80vh !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        isolation: isolate !important;
        position: relative !important;
    }
    
    body.pageType_Index #intro_Karolis {
        position: absolute !important;
    }
    
    body.pageType_Index .container_videos_photos {
        position: relative !important;
    }
}

@media (max-width: 480px) {
    /* Footer on very small screens - only for photos/videos pages */
    body:not(.pageType_Index) .footer {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        max-width: none !important;
        line-height: normal !important;
        flex-direction: column !important; /* Normal column order: copyright first, then social (NOT column-reverse) */
        gap: 20px;
        text-align: center;
        margin-top: 60px !important;
        padding: 40px 20px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    body:not(.pageType_Index) .footer .copyright {
        float: none !important;
        margin-left: 0 !important;
        margin: 0 !important;
        order: 1; /* Ensure copyright appears first */
    }
    
    body:not(.pageType_Index) .footer .social {
        float: none !important;
        margin-inline-end: 0 !important;
        margin: 0 !important;
        order: 2; /* Ensure social appears second (below copyright) */
        justify-content: center; /* Center the social icons horizontally */
        display: flex;
        align-items: center;
    }
    
    /* Make social icons smaller on mobile */
    body:not(.pageType_Index) .footer .social a {
        font-size: 1.2rem !important; /* Smaller than desktop 1.5rem */
    }
}

