:root {
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

/* Ensure no browser default styling for lists */
ul, ol {
    margin: 0;
    padding: 0;
    list-style-position: inside;
}

/* Myriad Pro regular */
@font-face {
    font-family: 'Myriad Pro';
    src: url('https://www.butterflyexpressdesign.com/fonts/myriadpro-regular.woff') format('woff'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-regular.ttf') format('truetype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-regular.otf') format('opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-regular.eot') format('embedded-opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Myriad Pro italic */
@font-face {
    font-family: 'Myriad Pro';
    src: url('https://www.butterflyexpressdesign.com/fonts/myriadpro-italic.woff') format('woff'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-italic.ttf') format('truetype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-italic.otf') format('opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-italic.eot') format('embedded-opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

/* Myriad Pro Bold */
@font-face {
    font-family: 'Myriad Pro';
    src: url('https://www.butterflyexpressdesign.com/fonts/myriadpro-bold.woff') format('woff'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-bold.ttf') format('truetype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-bold.otf') format('opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-bold.eot') format('embedded-opentype'),
url('https://www.butterflyexpressdesign.com/fonts/myriadpro-bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

body {
    font-family: Arial, sans-serif;
    padding: 20px;
    height: 100%;
}

html {
    height: 100%;
}

img {
    -webkit-touch-callout: none;
}

/* Disable Microsoft Edge visual search overlay while preserving tooltip functionality */
img {
    -ms-content-zooming: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* Specifically disable Edge's visual search on gallery images */
.gallery-image,
.gallery-item img,
#lightbox-image {
    -ms-content-zooming: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Disable Edge's visual search feature */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    /* Keep pointer events for tooltips and clicks */
    pointer-events: auto;
    /* Additional properties to prevent Edge visual search */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Alternative approach: Use a pseudo-element to block Edge's visual search overlay */
.gallery-item {
    position: relative;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none; /* Allow clicks to pass through to the image */
    background: transparent;
}

/* Ensure tooltip wrapper maintains proper z-index */
.tooltip-wrapper {
    position: relative;
    z-index: 2;
}

/* Disable browser default tooltips as a fallback */
.gallery-image[title],
.gallery-item img[title],
.tooltip-wrapper img[title] {
    /* Hide any remaining browser tooltips */
    pointer-events: none;
}

.tooltip-wrapper {
    /* But allow pointer events on the wrapper for our custom tooltips */
    pointer-events: auto;
}

/* Custom tooltip styles - restored original styling */
.thumbhover {
    background-color: #CC0000;
    color: white;
    padding: 5px;
    position: absolute;
    z-index: 9999;
    max-width: 50vw;
    height: auto;
    line-height: 36px;
    font-size: 2em;
    font-family: "Myriad Pro";
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive tooltip styling for mobile */
@media screen and (max-width: 500px) {
    .thumbhover {
        line-height: 30px;
        font-size: 1.5em;
    }
}

/* Ensure custom tooltip appears above everything */
#custom-tooltip {
    z-index: 10001;
}

/* Media query to ensure mobile touch functionality is preserved */
@media (pointer: coarse) {
    .gallery-image,
    .gallery-item img {
        /* On touch devices, allow normal touch interactions */
        touch-action: manipulation;
    }
}

/* Gallery container styles - for image galleries */
.gallery-container {
    list-style: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap;
    flex-direction: row; /* Explicitly set to row to ensure horizontal layout */
    justify-content: flex-start; /* Start with left alignment */
    gap: 10px; /* Reduced from 20px to 10px */
    width: 100%; /* Use full width */
    max-width: 100%; /* Use full width */
    margin: 0; /* Default to left alignment */
    position: relative; /* Ensure proper positioning */
    /* Transitions now handled by gallery-flex-centering.js */
    box-sizing: border-box; /* Ensure padding and border are included in width calculation */
    overflow: visible; /* Allow hover effects to extend beyond container */
    text-decoration: none !important;
}

/* Text-based list styles - copied from style.css for text content */
/* These styles apply to regular text lists but NOT to gallery containers */
#contentbox ul:not(.gallery-container) {
    text-decoration: none;
    list-style-type: none;
}

#contentbox ul:not(.gallery-container) li {
    display: inline-block;
    width: 190px;
    height: 45px;
    font-family: 'Myriad Pro';
    font-size: 2em;
    font-style: normal;
    line-height: normal;
    padding: 0;
    margin: 0;
    vertical-align: top;
}

#contentbox ul:not(.gallery-container) li a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: black;
    box-sizing: border-box;
}

#contentbox ul:not(.gallery-container) li a:hover {
    color: #CC0000;
}

/* Classes are now handled by gallery-flex-centering.js with different names */
/* .left-aligned and .centered classes are injected via JavaScript */

/* Media queries for responsive gallery */
@media (max-width: 1600px) {
    .gallery-container {
        max-width: 100%;
        margin: 0 auto; /* Center the container */
    }
}

@media (max-width: 940px) {
    .gallery-container {
        justify-content: flex-start; /* Keep left-justified */
        max-width: 100%;
        margin: 0 auto; /* Center the container */
    }
}

@media (max-width: 768px) {
    .gallery-container {
        gap: 8px; /* Even smaller gap on smaller screens */
        margin: 0 auto; /* Center the container */
    }
    
    /* Keep thumbnails at 200px */
}

@media (max-width: 480px) {
    .gallery-container {
        gap: 6px; /* Minimal gap on mobile */
        margin: 0 auto; /* Center the container */
    }
    
    /* Keep thumbnails at 200px */
}

/* Gallery item styles - for image thumbnails in galleries */
/* These styles apply specifically to gallery items and override any text-based list styles */
.gallery-container .gallery-item,
.gallery-item {
    position: relative;
    display: flex !important; /* Override any inherited display properties */
    justify-content: center;
    width: 200px; /* Full 200px width for thumbnails */
    height: 200px; /* Fixed height to ensure square thumbnails */
    flex-grow: 0;
    flex-shrink: 0;
    opacity: 0; /* Start with opacity 0 */
    transform: translateY(10px); /* Start slightly below final position */
    transition: opacity 0.5s ease, transform 0.5s ease; /* Smooth transition */
    animation: fadeInFallback 1s forwards 2s; /* Fallback animation after 2 seconds */
    /* Override any inherited text-based list styles */
    font-size: initial !important;
    font-family: initial !important;
    line-height: initial !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gallery-item.fade-in, .gallery-item.tooltip-wrapper.fade-in {
    opacity: 1;
    transform: translateY(0);
    animation: none; /* Disable fallback animation when fade-in class is applied */
}

/* Fallback animation to ensure thumbnails become visible */
@keyframes fadeInFallback {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery image styles - for actual images within gallery items */
.gallery-container .gallery-item .gallery-image,
.gallery-item .gallery-image,
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the entire container */
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: auto;
    /* Ensure images don't inherit any text-based styling */
    font-size: initial !important;
    font-family: initial !important;
    line-height: initial !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.no-right-click {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.no-drag {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Hover effect removed to eliminate grow animation */
.gallery-image:hover {
    /* transform: scale(1.05); - Removed to eliminate grow effect */
}

#lightbox-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 1.875s ease-in;
    opacity: 1;
    visibility: visible;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    padding: 0; /* Removed padding to allow elements to be positioned at the true edges */
    overflow: hidden; /* Prevent scrollbars */
}

.lightbox-content {
    width: 99%; /* Increased to use almost all available space */
    height: 99%; /* Increased to use almost all available space */
    display: flex;
    flex-direction: column; /* Default to column layout (caption below) */
    position: relative; /* Establishes a stacking context for its children */
    z-index: 1; /* Give it a base z-index within the lightbox */
    margin: auto;
    align-items: center; /* Center items horizontally */
    gap: 15px; /* Reduced space between image and caption to give more room to caption */
    transition: flex-direction 0.3s ease; /* Smooth transition between layouts */
    padding-top: 20px; /* Reduced padding to give more vertical space */
    overflow: hidden; /* Prevent scrollbars */
    max-width: 100vw; /* Ensure it doesn't exceed viewport width */
    max-height: 100vh; /* Ensure it doesn't exceed viewport height */
}

/* Side caption layout - caption on the side (for large screens only) */
.lightbox.side-caption-layout .lightbox-content,
.lightbox-content.portrait-layout {
    display: grid; /* Use grid for precise control */
    grid-template-columns: 1fr auto; /* Image takes available space, caption sizes to content */
    grid-gap: 60px; /* Minimum 60px gap between image and caption */
    justify-content: center;
    align-items: stretch;
    padding: 0;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
}

/* Bottom caption layout - caption below image */
.lightbox.bottom-caption-layout .lightbox-content,
.lightbox-content.column-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    height: 100vh; /* Full viewport height */
    width: 100vw; /* Full viewport width */
    box-sizing: border-box;
}

/* Side caption box - base styles */
.side-caption-box {
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    padding: 20px;
    border-radius: 8px;
    overflow: hidden; /* Prevent all scrollbars */
    transition: all 0.3s ease; /* Smooth transition for size changes */
    position: relative; /* Essential for z-index */
    z-index: 20; /* Higher than image-container */
    flex-shrink: 0; /* Prevents shrinking */
    box-sizing: border-box;
}

/* Side caption box in side layout - flexible width */
.lightbox.side-caption-layout .side-caption-box {
    width: auto; /* Flexible width based on content */
    min-width: 250px; /* Minimum width for readability */
    max-width: 800px; /* Increased max width to accommodate longer titles */
    height: auto; /* Auto height based on content */
    max-height: none; /* Remove height restriction to prevent scrollbars */
    align-self: center; /* Center vertically */
    margin: 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px; /* Ensure internal padding */
    box-sizing: border-box;
    overflow: hidden; /* Ensure no scrollbars */
}

/* Side caption box in bottom layout */
.lightbox.bottom-caption-layout .side-caption-box {
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: none; /* Remove height restriction to prevent scrollbars */
    align-self: center;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden; /* Ensure no scrollbars */
}

/* Legacy portrait layout support - kept for backwards compatibility */
.portrait-layout .side-caption-box {
    width: 320px;
    max-width: 320px;
    height: 100vh;
    max-height: 100vh;
    position: relative;
    margin: 0;
    z-index: 20;
    justify-self: end;
    align-self: stretch;
    flex-shrink: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.image-container {
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* Essential for z-index */
    z-index: 10; /* Set a specific z-index for the image container */
    width: 100%; /* Full width in column layout */
    height: 100%; /* Full height to maximize image space */
    overflow: hidden; /* Prevent scrollbars */
    transition: all 0.3s ease; /* Smooth transition for size changes */
}

/* Image container in side caption layout - adapts to flexible caption */
.lightbox.side-caption-layout .image-container {
    width: 100%;
    height: 100vh;
    min-width: 0; /* Allow shrinking */
    max-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Image container in bottom caption layout */
.lightbox.bottom-caption-layout .image-container {
    width: 100%;
    height: calc(100vh - 200px); /* Reserve space for caption at bottom */
    max-width: 100vw;
    max-height: calc(100vh - 200px);
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

/* Image container in portrait layout */
.portrait-layout .image-container {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 10px;
    justify-self: start;
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

#lightbox-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto; /* Allow natural width */
    height: auto; /* Allow natural height */
    object-fit: contain;
    transition: all 0.375s ease-in-out;
    opacity: 1;
    visibility: visible;
    box-sizing: border-box;
}

/* Optimize image size for side caption layout */
.lightbox.side-caption-layout #lightbox-image {
    max-width: 100%;
    max-height: 100%;
    /* Image can use full container space minus padding */
}

/* Optimize image size for bottom caption layout */
.lightbox.bottom-caption-layout #lightbox-image {
    max-width: 100%;
    max-height: 100%;
    /* Image can use full container space */
}

.image-container .hidden,
#lightbox-image.hidden {
    opacity: 0;
    visibility: visible; /* Keep visible but transparent */
    transform: translate(-50%, -50%); /* No scale effect, just centered */
}

.title-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align items at the top to handle multi-line title */
    margin: 0 0 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
    width: 100%; /* Ensure full width */
    min-width: 0; /* Allow children to shrink below their content size */
    flex-wrap: wrap; /* Allow wrapping if needed on very small screens */
}

/* Smart title container for side caption layout */
.lightbox.side-caption-layout .title-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    align-items: flex-start;
    gap: 8px 12px; /* Vertical gap 8px, horizontal gap 12px */
    justify-content: flex-start;
}

/* Title takes full width, forcing buttons to next row */
.lightbox.side-caption-layout .image-title {
    flex-basis: 100%; /* Force title to take full width */
    order: 1;
}

/* Title with flexible caption width */
.lightbox.side-caption-layout .image-title {
    white-space: nowrap; /* Try to keep on one line first */
    overflow: visible; /* Show full title */
    text-overflow: unset; /* No ellipsis */
    flex-shrink: 0; /* Don't shrink */
    width: 100%; /* Use full width of caption box */
    word-break: break-word; /* Break words if absolutely necessary */
    /* If title is too long for max-width, it will wrap due to media query below */
}

/* Force wrapping when caption box reaches max-width or on narrow screens */
@media screen and (max-width: 1200px) {
    .lightbox.side-caption-layout .image-title {
        white-space: normal; /* Allow wrapping when space is limited */
        line-height: 1.2; /* Tighter line height for wrapped titles */
    }
}

/* Additional rule to handle very long titles that would exceed max-width */
.lightbox.side-caption-layout .side-caption-box:has(.image-title) {
    /* When title content would exceed max-width, allow wrapping */
    width: fit-content;
    max-width: 800px;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
    .lightbox.side-caption-layout .image-title {
        white-space: normal; /* Always allow wrapping as fallback */
        line-height: 1.2;
    }
}


/* Force wrapping for very long titles to prevent horizontal scrollbars */
.lightbox.side-caption-layout .image-title {
    overflow-wrap: break-word; /* Break long words if necessary */
    word-wrap: break-word; /* Legacy browser support */
    hyphens: auto; /* Add hyphens when breaking words */
    max-width: 100%; /* Never exceed caption box width */
}

/* Override nowrap for extremely long titles that would cause scrollbars */
@media screen and (min-width: 1201px) {
    .lightbox.side-caption-layout .image-title {
        /* Check if title would exceed caption box width and force wrap if so */
        white-space: pre-wrap; /* Preserve spaces but allow wrapping */
    }
}
/* Buttons in side caption layout - try horizontal first */
.lightbox.side-caption-layout .title-container .share-button,
.lightbox.side-caption-layout .title-container .cart-button {
    order: 2; /* Buttons come after title */
    flex-shrink: 0; /* Don't shrink buttons */
    margin: 0; /* Remove default margins - using gap from parent */
}

/* Buttons will naturally be horizontal due to flex layout with gap
   They'll only wrap to separate lines if the caption box is too narrow */

/* Button group container for better organization */
.title-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

/* In side caption layout, try to keep buttons on same line */
.lightbox.side-caption-layout .title-buttons {
    flex-wrap: nowrap;
}

/* Allow button wrapping in bottom caption or narrow screens */
.lightbox.bottom-caption-layout .title-buttons,
.title-buttons {
    flex-wrap: wrap;
}

.image-title {
    color: white;
    margin: 0;
    font-size: 28px; /* Default size for large screens */
    cursor: text !important; /* Force text cursor and override custom cursor */
    position: relative;
    z-index: 25; /* Higher than side-caption-box but lower than buttons */
    text-align: left;
    flex-grow: 1;
    /* Allow wrapping to multiple lines if needed */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word; /* Modern property for better word breaking */
    hyphens: auto; /* Enable hyphenation for very long words */
    /* Ensure there's space for the share button */
    padding-right: 10px;
    /* Smooth transition for font size changes */
    transition: font-size 0.2s ease;
    /* Ensure no scrollbars appear */
    overflow: visible;
}

.share-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer !important;
    height: 32px;
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: background-color 0.2s ease;
    position: relative; /* Essential for z-index */
    z-index: 30; /* Same as cart button for consistency */
    background-color: rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Prevent the button from shrinking */
    align-self: flex-start; /* Align at the top with the title */
}

/* Optimize button spacing in side caption layout */
.lightbox.side-caption-layout .share-button {
    margin-left: 0; /* Remove margin in side layout, use gap from title-container instead */
}

/* Removed conflicting rules - using the new approach above */

.share-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.share-text {
    margin-right: 6px;
    font-size: 14px;
    font-weight: normal;
}

.share-button svg {
    width: 16px;
    height: 16px;
}

.share-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-10px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 20001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-notification.visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.image-caption {
    color: white;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    cursor: text !important; /* Force text cursor and override custom cursor */
    position: relative;
    z-index: 25; /* Higher than side-caption-box but lower than buttons */
    text-align: left;
    /* Ensure proper text wrapping without scrollbars */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    overflow: visible;
}

.closebutton {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    right: 0;
    width: 75px; /* Default size for large screens */
    height: 75px; /* Default size for large screens */
    cursor: pointer !important; /* Force pointer cursor and override custom cursor */
    z-index: 20000; /* Higher than custom cursor */
    background-image: url(/images/closebutton.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
    /* Hide the text content */
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    /* No background color or border */
    background-color: transparent;
    border: none;
    padding: 0;
}

.closebutton:hover {
    background-image: url(/images/closebutton-hover.svg);
}

/* Responsive close button sizes */
@media screen and (max-width: 900px) {
    .closebutton {
        width: 60px;
        height: 60px;
    }
}

@media screen and (max-width: 500px) {
    .closebutton {
        width: 50px;
        height: 50px;
    }
}

@media screen and (max-width: 400px) {
    .closebutton {
        width: 40px;
        height: 40px;
    }
}

/* Menu button styles */
.menubutton {
    width: 75px !important;
    max-width: 100% !important;
    max-height: 100% !important;
    height: 75px !important;
    border: none;
    background-image: url(/images/menubutton.svg);
    z-index: 950;
    position: fixed;
    display: block;
    top: 0;
    right: 0;
}

.menubutton:hover {
    background-image: url(/images/menubutton-hover2.svg);
    cursor: pointer;
}

@media screen and (max-width: 900px) {
    .menubutton,
    .menubutton:hover {
        width: 60px !important;
        height: 60px !important;
    }
}

@media screen and (max-width: 500px) {
    .menubutton,
    .menubutton:hover {
        width: 40px !important;
        height: 40px !important;
    }
}

@media screen and (max-width: 400px) {
    .menubutton,
    .menubutton:hover {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Modal styles */
.modal-layout {
    display: none;
}

.modal-layout--open {
    position: fixed;
    text-align: center;
    display: grid;
    align-items: center;
    padding-left: 1em;
    padding-right: 1em;
    overflow: auto;
    font: 1.125em verdana;
    height: 100vh;
    width: 100%;
    z-index: 1000;
    color: black;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(255,255,255);
    /* Fallback color */
    background-color: rgba(255,255,255,0.95);
    pointer-events: auto;
    transition: opacity 600ms ease-in-out;
}

/* Mobile-specific fix for dynamic viewport height and scrolling issues */
@media only screen and (max-width: 768px) {
    .modal-layout--open {
        /* Use dynamic viewport height with fallbacks */
        height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile */
        height: -webkit-fill-available !important; /* iOS Safari fallback */
        
        /* Remove grid centering that can cause scrolling issues */
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        
        /* Enable proper scrolling */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        
        /* Ensure content doesn't get hidden behind mobile UI elements */
        padding-top: max(1em, env(safe-area-inset-top, 0px)) !important;
        padding-bottom: max(1em, env(safe-area-inset-bottom, 16px)) !important;
        
        /* Hide scrollbar while keeping scroll functionality */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
    .modal-layout--open::-webkit-scrollbar {
        display: none;
    }
    
    /* Ensure modal content can scroll properly and doesn't get cut off */
    .modal-layout--open .modal {
        width: 90% !important;
        max-width: none !important;
        max-height: none !important; /* Remove height constraints */
        margin: auto 0 !important; /* Center vertically within flex container */
        
        /* Add padding to prevent content from being hidden */
        padding: 1.5rem !important;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 16px)) !important;
        
        /* Ensure proper box sizing */
        box-sizing: border-box !important;
        
        /* Allow content to expand as needed */
        min-height: auto !important;
        height: auto !important;
    }
}

.modal {
    height: auto;
}

@media only screen and (min-width: 770px) {
    .modal {
        border-bottom: 5px solid #CC0000;
    }
}

@media only screen and (min-width: 1000px) {
    .menuvertbars {
        border-left: 2px solid #CC0000;
        border-right: 2px solid #CC0000;
    }
}

.modal > *:first-child {
    margin-top: 0px;
}

.modal > *:last-child {
    margin-bottom: 0px;
}

.modal-layout--open a {
    text-decoration: none;
    color: black;
    display: block;
    transition: 0.3s;
}

.modal-layout--open ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: grid;
    font: 1.125em verdana;
}

.modal-layout--open ul li a {
    font-weight: 300;
    display: block;
    color: black;
    text-decoration: none;
}

.modal-layout--open ul li a:hover {
    color: #CC0000;
}

/* Lightbox close button styles */
.lightbox .close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 75px;
    height: 75px;
    z-index: 50; /* Higher than all other lightbox elements */
    cursor: pointer !important;
    background-image: url(/images/closebutton.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border: none;
    padding: 0;
    transition: background-image 0.2s ease;
    /* Hide any text content */
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
}

.lightbox .close-btn:hover {
    background-image: url(/images/closebutton-hover.svg);
}

/* Responsive lightbox close button sizes */
@media screen and (max-width: 900px) {
    .lightbox .close-btn {
        width: 60px;
        height: 60px;
    }
}

@media screen and (max-width: 500px) {
    .lightbox .close-btn {
        width: 40px;
        height: 40px;
    }
}

/* Image counter styles */
.image-counter {
    position: fixed;
    bottom: 0;
    right: 0;
    color: #CC0000;
    font-size: 1.5em; /* Increased by 1.5x and changed to em */
    font-weight: bold;
    background-color: transparent;
    padding: 10px 20px; /* Add some padding for better visibility */
    z-index: 1001;
}

/* This selector is now merged with the earlier .gallery-item definition */

/* Tooltip styles for hover */
/* Additional styles for tooltip */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
}

/* Ensure gallery items that are also tooltip wrappers maintain the correct size and layout */
.gallery-item.tooltip-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px; /* Full 200px width for thumbnails */
    height: 200px; /* Fixed height to ensure square thumbnails */
    flex-grow: 0;
    flex-shrink: 0;
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    opacity: 0; /* Start with opacity 0 */
    transform: translateY(10px); /* Start slightly below final position */
    transition: opacity 0.5s ease, transform 0.5s ease; /* Smooth transition */
    animation: fadeInFallback 1s forwards 2s; /* Fallback animation after 2 seconds */
}

/* Ensure images inside gallery items maintain their size and layout */
.gallery-item.tooltip-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbhover {
    background-color: #CC0000;
    color: white;
    padding: 5px;
    position: absolute;
    z-index: 9999;
    max-width: 50vw;
    height: auto;
    line-height: 36px;
    font-size: 2em;
    font-family: "Myriad Pro";
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media screen and (max-width: 500px) {
    .thumbhover {
        line-height: 30px;
        font-size: 1.5em;
    }
}

/* Content layout styles */
.menuheading {
    color: #CC0000;
    font: 1.125em Verdana;
}

.menuheadingmain {
    color: #CC0000;
    font: 1.625em Verdana;
}

.heading1 {
    font-size: 2em;
    font-family: 'Myriad Pro';
    color: black;
    font-weight: bold;
}

.heading2 {
    font-size: 1em;
    font-family: 'Myriad Pro';
    color: black;
    font-weight: bold;
    padding-bottom: 0.5em;
}

.hspan {
    border-left: 10px solid #CC0000;
}

#contentbox {
    position: absolute;
    display: block;
    left: 0;
    right: 0;
    top: 120px;
    height: auto;
    width: 100%;
    overflow: visible; /* Changed from auto to visible to prevent scrollbar */
    padding: 1em;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

#contentbox .gallery {
    text-align: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

#contentbox p {
    color: black;
    font-size: 1em;
    font-family: Verdana,'Times New Roman', Times, serif;
    margin: 0;
}

#contentbox p a {
    text-decoration: none;
    font: bold 0.9em Arial,'Myriad Pro';
    color: black;
}

#contentbox a:hover {
    color: #CC0000;
    text-decoration: none;
}

#contentbox ul {
    list-style-type: none;
    text-decoration: none;
    text-align:center;
    margin:0;
    padding:0;
}

#contentbox ul li {
    display:inline;
    line-height: normal;
    
}
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 36px;
    width: 100%;
    z-index: 900;
    display: flex;
    justify-content: flex-start;
    align-content: flex-start;
    color: black;
    background-color: white;
}

.topbartext {
    display: block;
    padding-left: 3px;
    font-family: 'Myriad Pro';
    color: black;
    font-size: 2em;
    text-align: left;
    line-height: 36px;
}

#footer {
    position: fixed;
    left: 0;
    bottom: 0;
    height: auto;
    background-color: white;
    color: #CC0000;
    width: 100%;
    z-index: 900;
    text-align: center;
    font-size: 0.6em;
    font-family: Verdana,'Times New Roman', Times, serif;
    margin: 0;
}

#titlebar {
    position: fixed;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start; /* Ensure content starts from the left */
    top: 36px;
    left: 0px;
    height: 84px;
    line-height: 30px;
    width: 100%;
    z-index: 900;
    text-align: left; /* Changed from bottom-left to left */
    padding-left: 1em;
    padding-bottom: 5px;
    font-style: bold;
    background-color: white;
    overflow: hidden; /* Prevent any overflow issues */
}

/* Ensure the title content stays at the bottom of the titlebar */
#titlebar .heading1 {
    align-self: flex-end; /* Keep the heading aligned to the bottom */
    width: 100%; /* Take full width for proper text wrapping */
    word-wrap: break-word; /* Allow long words to break */
    overflow-wrap: break-word; /* Modern property for word breaking */
    hyphens: auto; /* Add hyphenation for better text flow */
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
}

/* Additional responsive adjustments for titlebar on smaller screens */
@media screen and (max-width: 575px) {
    #titlebar {
        /* Ensure consistent positioning even when cart icon is below menu button */
        padding-right: 1em; /* Add right padding to prevent overlap with cart area */
    }
    
    #titlebar .heading1 {
        /* Ensure proper text wrapping on very small screens */
        line-height: 1.2; /* Slightly tighter line height for better spacing */
        max-width: calc(100% - 2em); /* Account for left and right padding */
    }
}

/* Responsive image display classes */
.imgh {
    display: none;
}

@media only screen and (min-width: 900px) {
    .xxl {
        display: block;
    }
}

@media only screen and (min-width: 700px) {
    .xl {
        display: block;
    }
}

@media only screen and (min-width: 500px) {
    .lg {
        display: block;
    }
}

@media only screen and (min-width: 300px) {
    .md {
        display: block;
    }
}

@media only screen and (min-width: 100px) {
    .sm {
        display: block;
    }
}

/* Default body cursor */
body {
    cursor: default;
}



/* Media queries for responsive design */
@media screen and (max-width: 900px) {
    
    /* Force bottom caption layout on smaller screens */
    .lightbox.side-caption-layout .lightbox-content {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    .lightbox.side-caption-layout .side-caption-box {
        width: 100% !important;
        max-width: 800px !important;
        height: auto !important;
        max-height: 180px !important;
        border-radius: 8px !important;
    }
    
    .lightbox.side-caption-layout .image-container {
        width: 100% !important;
        height: calc(100vh - 200px) !important;
        max-width: 100vw !important;
    }
    
    /* Legacy portrait layout adjustments */
    .portrait-layout .side-caption-box {
        width: 90%;
        max-width: 280px;
        justify-self: center;
        margin: 0 auto;
    }
    
    .portrait-layout .image-container {
        width: 60%;
    }
}

/* Responsive adjustments for very large screens */
@media screen and (min-width: 1800px) {
    .image-title {
        font-size: 32px;
    }
    
    .image-caption {
        font-size: 18px;
    }
}

/* Responsive adjustments for portrait layout */
@media screen and (max-width: 1200px) {
    /* Switch to a single column grid */
    .lightbox-content.portrait-layout {
        display: grid;
        grid-template-columns: 95%; /* Increased from 85% to 95% to use more space */
        grid-template-rows: 65% 30%; /* Two rows: 65% for image, 30% for caption */
        grid-gap: 5%;
        justify-content: center;
        align-content: center;
        height: 100%;
        padding: 0;
    }
    
    /* Adjust title size for medium screens */
    .image-title {
        font-size: 24px;
    }
    
    /* Adjust caption box for column layout */
    .portrait-layout .side-caption-box {
        width: 90%; /* Take up 90% of its grid cell */
        max-width: 90%; /* Limit max width */
        max-height: 100%; /* Allow full height within its grid cell */
        justify-self: center; /* Center horizontally */
        align-self: start; /* Align to top of grid cell */
        padding: 15px;
        overflow: hidden; /* Prevent scrollbars */
        margin: 0 auto; /* Center horizontally */
    }
    
    /* Adjust image container for column layout */
    .portrait-layout .image-container {
        justify-self: center; /* Center horizontally */
        align-self: end; /* Align to bottom of grid cell */
        height: 100%; /* Full height within its grid cell */
        width: 100%; /* Use full width of its container */
    }
    
    /* Ensure lightbox image uses maximum available space */
    .portrait-layout #lightbox-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

/* Further adjustments for smaller screens */
@media screen and (max-width: 600px) {
    .lightbox-content.portrait-layout {
        grid-template-columns: 95%; /* Wider single column */
        grid-template-rows: 55% 40%; /* Adjust row heights */
    }
    
    /* Ensure lightbox fits in very narrow screens */
    .lightbox, .lightbox-content, .image-container {
        width: 100vw;
        max-width: 100vw;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* Adjust lightbox image for very narrow screens */
    #lightbox-image {
        max-width: 98vw;
        max-height: 80vh;
    }
    
    .image-title {
        font-size: 18px;
    }
    
    .image-caption {
        font-size: 14px;
    }
}

@media screen and (max-width: 500px) {
    :root {
        --cursor-size: 50px;
        --cursor-hover-size: 60px;
    }
    
    .image-title {
        font-size: 16px;
        /* Allow natural wrapping */
        line-height: 1.3;
    }
    
    .image-caption {
        font-size: 14px;
    }
    
    .share-text {
        font-size: 12px;
    }
    
    .share-button {
        padding: 3px 8px;
        height: 28px;
    }
    
    .share-button svg {
        width: 14px;
        height: 14px;
    }
    
    .title-container {
        margin-bottom: 10px;
        padding-bottom: 5px;
    }
}

.lightbox-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 1;
}

.lightbox-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 1;
}

/* Custom cursor CSS removed */

/* Mobile Touch Enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Hide tooltips on touch devices */
    .thumbhover {
        display: none !important;
    }
    
    /* Improve touch targets for mobile */
    .gallery-item {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Improve lightbox touch interaction */
    .lightbox {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        touch-action: pan-y; /* Allow vertical scrolling but prevent horizontal */
    }
    
    .lightbox-content {
        touch-action: manipulation; /* Enable fast tapping */
    }
    
    /* Prevent text selection during swipe */
    .image-container,
    .lightbox-image {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        touch-action: manipulation;
    }
}

/* Visual feedback for touch devices */
@media (max-width: 768px) {
    /* Add subtle visual hint for swipe navigation */
    .lightbox::before {
        content: "← Swipe to navigate →";
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.7);
        font-size: 14px;
        z-index: 1000;
        pointer-events: none;
        opacity: 0;
        animation: fadeInOut 3s ease-in-out;
        animation-delay: 1s;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        50% { opacity: 1; }
    }
}

/* Default cursor behavior restored - no custom cursor overrides needed */

/* Landscape Orientation Warning for Mobile Devices */
.landscape-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.landscape-warning-content {
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.landscape-warning h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #fff;
}

.landscape-warning p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
    color: #ddd;
}

.rotate-icon {
    font-size: 48px;
    margin: 20px 0;
    animation: rotate-pulse 2s infinite;
}

@keyframes rotate-pulse {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.1); }
}

/* Show warning only on mobile devices in landscape mode */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .landscape-warning.show {
        display: flex !important;
    }
    
    /* Hide main content when warning is shown */
    body.landscape-warning-active {
        overflow: hidden;
    }
    
    body.landscape-warning-active > *:not(.landscape-warning) {
        display: none !important;
    }
}

/* Responsive heading1 size for smaller screens */
@media screen and (max-width: 1080px) {
    .heading1 {
        font-size: 1.5em;
    }
}

/* Custom responsive layout - switch to single column at 1360px */
@media (max-width: 85em) {
    .col-5_custom-12,
    .col-7_custom-12 {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
}

/* Hide loading messages initially to prevent flash */
#main-footer,
#menu {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Show content after it's loaded */
#main-footer.loaded,
#menu.loaded {
    opacity: 1;
}

/* Year Toggle Sections */
.year-section {
    margin-bottom: 10px;
}

.year-toggle {
    cursor: pointer;
    margin: 10px 0;
    padding: 5px;
    background: white;
    border-radius: 3px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.year-toggle:hover {
    background: #f5f5f5;
}

.year-toggle.expanded {
    background: #CC0000;
    color: white;
}

.year-toggle.expanded:hover {
    background: #AA0000;
}

.year-toggle span {
    color: #CC0000;
    transition: color 0.3s ease;
}

.year-toggle.expanded span {
    color: white;
}

.year-list {
    display: none;
    margin-top: 5px;
}

