/* CSS Variables for theming */
:root {
    --text-color: currentColor;
    --bg-color: transparent;
    --shadow-color: hsla(0, 0%, var(--l, 0%), 0.2);
    --hover-glow: hsla(60, 100%, var(--l, 70%), 0.4);
    
    /* Try Super.site variables first, then system preference fallback */
    --caption-color: var(--super-text-muted, #999);
    --ui-color: var(--super-text-muted, #666);
    --accent-color: var(--super-accent, rgba(255, 255, 180, 0.4));
}

@media (prefers-color-scheme: light) {
    :root {
        --caption-color: var(--super-text-muted, #555);
        --ui-color: var(--super-text-muted, #888);
        --accent-color: var(--super-accent, rgba(180, 150, 50, 0.6));
    }
}

/* Base styles */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto Condensed', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
}

body.embedded {
    overflow: hidden;
    width: 100%;
    height: 100vh;
}

.container {
    max-width: 100%;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: flex-start;
    padding-top: 0; /* Align to top */
}

.swiper {
    width: 100%;
    height: 100vh; /* Full height, aligned to top */
    display: flex;
    align-items: flex-start;
}

.swiper-slide {
    height: 100%; 
    transition: transform 0.1s;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center slides vertically within swiper */
    align-items: center;
    overflow: hidden;
    padding-top: 0;
}

.slide-content {
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center;
    padding: 20px;
}

/* Media elements */
.swiper-slide img,
.swiper-slide video {
    max-height: 90vh; /* Account for caption space */
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Pagination styles */
.swiper-pagination {
    position: fixed !important; 
    bottom: 10px !important; 
    z-index: 10;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
}

.swiper-pagination-bullet {
    background: var(--ui-color);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
    display: inline-block;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--accent-color);
    transform: scale(1.2);
}

.swiper-pagination-bullet:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Add styles for the active/center slide */
.swiper-slide-active {
    transform: scale(1.2);
    z-index: 2;
}

/* Adjust adjacent slides */
.swiper-slide-prev,
.swiper-slide-next {
    transform: scale(0.7);
    opacity: 0.2;
}



/* Update caption styles */
.slide-caption {
    position: relative;
    bottom: -10px;
    text-align: center;
    color: var(--caption-color);
    font-size: 16px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 300;
    letter-spacing: 0.02em;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
    word-break: break-word;
}

.caption-text {
    display: inline-block;
    max-width: 100%;
}

.tag-link {
    display: inline-block;
}

.tag-link a {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
    transition: all 0.2s ease;
}

.tag-link a:hover {
    opacity: 0.6;
    text-decoration: none;
    border-bottom: none;
}

/* Update link styles */
.swiper-slide a {
    position: relative;
    display: inline-block;
    width: fit-content;
}

.swiper-slide a:hover {
    cursor: pointer;
}

/* Add styles for clickable captions */
.slide-caption a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    max-width: 100%;
}

.slide-caption a:hover {
    border-bottom-color: inherit;
    text-decoration: underline;
    border-bottom: none;
}



/* Loading styles */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    background: var(--bg-color); /* Add background */
    pointer-events: none; /* Prevent interaction */
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--ui-color);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

.loader-text {
    color: var(--ui-color);
    margin-top: 10px;
    font-family: 'Roboto Condensed', sans-serif;
}

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

/* Hide loader when content is loaded */
.loader.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

/* Loading progress bar */
.loading-progress-container {
    width: 200px;
    margin-top: 20px;
}

.loading-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Video fallback styles */
.video-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 2px dashed var(--ui-color);
}

.video-placeholder {
    text-align: center;
    color: var(--ui-color);
}

.video-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.video-download {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--accent-color);
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.video-download:hover {
    background: var(--accent-color);
    filter: brightness(1.2);
}

/* Improved slide placeholder */
.slide-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--ui-color);
    font-family: 'Roboto Condensed', sans-serif;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ui-color);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.swiper-slide img,
.swiper-slide video {
    max-height: 80vh; /* Reduced from 90vh to account for top space */
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-top: 0; /* Ensure no extra margin */
}

.swiper-slide a:hover img,
.swiper-slide a:hover video {
    transform: scale(1.02); /* Subtle zoom on hover */
    /* Combine both shadows */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-color); /* Base shadow + glow effect */
}


/* Add a small icon to indicate clickable images */
.swiper-slide a {
    position: relative;
}

.swiper-slide a::after {
    content: '↗';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px 8px;
    border-radius: 0 8px 0 8px;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.swiper-slide a:hover::after {
    opacity: 1;
    background: var(--accent-color);
}

/* Add this new rule to hide the arrow on caption links */
.slide-caption a::after {
    display: none;  /* This will hide the arrow on caption links */
}

.error-message {
    color: var(--ui-color);
    text-align: center;
    padding: 20px;
}


@media (hover: none) {
    .swiper-pagination {
        bottom: 20px !important;
    }
    
    .swiper-pagination-bullet {
        width: 12px;
        height: 12px;
        margin: 0 6px;
    }

    .slide-caption {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container {
        padding-top: 0; /* Align to top on mobile */
    }
    
    .swiper {
        height: 100vh; /* Full height on mobile */
    }
    
    .swiper-slide {
        padding-top: 0; /* Align to top on mobile */
    }
    
    .swiper-pagination {
        bottom: 25px !important;
        padding: 0 20px;
    }
    
    .swiper-pagination-bullet {
        width: 14px;
        height: 14px;
        margin: 0 4px;
    }
    
    .slide-caption {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .loading-progress-container {
        width: 150px;
    }
}

