/* Skip Navigation Link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 10002;
    font-size: 1em;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

.skip-link:focus-visible {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Lightbox Overlay */
#lightbox-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

#lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

#lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 3em;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

#lightbox-close:hover,
#lightbox-close:focus-visible {
    color: #ccc;
}

#lightbox-close:focus-visible,
#lightbox-prev:focus-visible,
#lightbox-next:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 4px;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3em;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: none;
    border: none;
    padding: 20px;
    font-family: inherit;
    transition: color 0.2s ease;
}

#lightbox-prev {
    left: 10px;
}

#lightbox-next {
    right: 10px;
}

#lightbox-prev:hover,
#lightbox-next:hover,
#lightbox-prev:focus-visible,
#lightbox-next:focus-visible {
    color: #ccc;
}

/* Zoomable image hover effect */
img[data-full] {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

img[data-full]:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

img[data-full]:focus-visible {
    outline: 3px solid #555;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .skip-link,
    #lightbox-overlay,
    #lightbox-prev,
    #lightbox-next,
    img[data-full],
    .language-selector a {
        transition: none;
    }
}

/* Print Styles */
@media print {
    #lightbox-overlay,
    #countdown,
    .template-selector {
        display: none !important;
    }

    .location iframe {
        display: none;
    }

    /* Show link URLs after link text */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }

    header {
        background-image: none !important;
        color: #333 !important;
    }

    footer {
        background-color: #fff !important;
        color: #333 !important;
    }

    body {
        color: #000;
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }

    img[data-full] {
        break-inside: avoid;
    }

    section {
        break-inside: avoid;
    }
}