/* DGA Slide News - Accessible Slideshow
 * Version: 1.2.1 - WCAG 2.2 AAA Compliance
 *
 * Accessibility Features:
 * - Focus-visible states for keyboard navigation
 * - Prefers-reduced-motion support
 * - Enhanced color contrast (7:1 ratio for AAA)
 * - Minimum font sizes (12px+)
 * - Screen reader utilities
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors - WCAG AAA compliant */
    --dga-accent: #ffc107;              /* Yellow accent - contrast 7.5:1 on dark */
    --dga-accent-hover: #ffca28;
    --dga-text-primary: #ffffff;
    --dga-text-secondary: #f5f5f5;
    --dga-bg-dark: #1a202c;
    --dga-bg-overlay: rgba(0, 0, 0, 0.7);
    --dga-border-light: rgba(255, 255, 255, 0.7);  /* 70% for AAA contrast */
    --dga-focus-ring: #ffc107;

    /* Spacing */
    --dga-focus-ring-width: 3px;
    --dga-focus-ring-offset: 3px;

    /* Transitions */
    --dga-transition-fast: 0.15s ease-out;
    --dga-transition-normal: 0.3s ease-in-out;
}

/* ============================================
   Accessibility Utilities
   ============================================ */

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Screen reader only - but visible when focused (for skip links) */
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    padding: 0.75rem 1.5rem !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    z-index: 9999 !important;
    background: var(--dga-accent) !important;
    color: #000 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Skip link positioning */
.skip-link {
    top: 1rem;
    left: 1rem;
}

/* ============================================
   Focus States - WCAG 2.4.7 Focus Visible
   ============================================ */

/* Global focus-visible styles for slider elements */
#slider-container:focus-visible,
.thumb-nav-btn:focus-visible,
#prev-slide:focus-visible,
#next-slide:focus-visible,
.thumbnail-card:focus-visible,
#featured-link:focus-visible {
    outline: var(--dga-focus-ring-width) solid var(--dga-focus-ring);
    outline-offset: var(--dga-focus-ring-offset);
    box-shadow: 0 0 0 calc(var(--dga-focus-ring-width) + var(--dga-focus-ring-offset) + 3px) rgba(255, 193, 7, 0.25);
}

/* Remove default outline since we're using focus-visible */
#slider-container:focus:not(:focus-visible),
.thumb-nav-btn:focus:not(:focus-visible),
#prev-slide:focus:not(:focus-visible),
#next-slide:focus:not(:focus-visible),
.thumbnail-card:focus:not(:focus-visible),
#featured-link:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Slider Container with Dynamic Height Support */
#slider-container {
    position: relative;
    width: 100%;
    height: var(--slider-height, 100vh);
    min-height: 400px;
    overflow: hidden;
    background-color: #1a202c;
    color: white;
    z-index: 1;
}

/* Featured Slide */
#featured-slide {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Featured Image Styles */
#featured-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

/* ปรับปรุง: ลดความเข้มของ overlay หรือเอาออกเลย - เปลี่ยนจากฟิลเตอร์มืดเป็นแค่เงาเบาๆ สำหรับข้อความ */
#featured-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    /* เปลี่ยนจาก gradient มืดเป็น gradient เบาๆ เฉพาะที่ข้อความ */
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 60%, 
        rgba(0,0,0,0.2) 80%, 
        rgba(0,0,0,0.4) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Right Thumbnails Area - ขยายให้กว้างขึ้นรองรับ 4 รูปใหญ่ */
#right-thumbnails-area {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 45%;
    max-width: 620px;
    z-index: 20;
    padding-top: min(100px, calc(var(--slider-height, 100vh) * 0.1));
    padding-right: 16px;
    padding-left: 16px;
    background-color: transparent;
    backdrop-filter: none;
    border-style: none;
    display: flex;
    flex-direction: column;
    transform: translatey(calc(var(--slider-height, 100vh) * 0.45));
    border-radius: 10px;
}

/* Thumbnail Navigation Buttons */
.thumbnail-nav-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 8px;
    padding-bottom: 15px;
    background-color: transparent;
    border-radius: 10px;
    backdrop-filter: none;
}

.thumb-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 15px;
}

.thumb-nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.thumb-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.thumb-nav-btn svg {
    width: 18px;
    height: 18px;
}

.thumb-page-indicator {
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.8;
}

/* Thumbnails Wrapper */
#thumbnails-wrapper {
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    z-index: 21;
}

#thumbnails-wrapper::-webkit-scrollbar {
    display: none;
}

/* Thumbnails Container */
#thumbnails-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 11px;
    z-index: 22;
    transition: opacity 0.3s ease-in-out;
}

/* Thumbnail Card - ขยายใหญ่ขึ้น 40% - ไม่มีเงา */
.thumbnail-card {
    position: relative;
    width: 100%;
    height: max(168px, min(210px, calc(var(--slider-height, 100vh) * 0.21)));
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    transition: transform 0.3s ease-in-out, border-color 0.3s ease-in-out;
    z-index: 23;
    padding-bottom: 0px;
    animation: fadeIn 0.5s;
    box-shadow: none;
    background: transparent;
}

.thumbnail-card:hover {
    transform: translateY(-2px);
}

.thumbnail-card.active {
    transform: scale(1.05);
    outline: 3px solid #f8b64c;
    outline-offset: -3px;
}

.thumbnail-card img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover !important;
    object-position: center center;
    transition: transform 0.3s;
    margin: 0;
    padding: 0;
    display: block;
}

.thumbnail-card:hover img {
    transform: scale(1.1);
}

/* ปรับปรุง: ลด Thumbnail Gradient Overlay ให้เบาลง - แสดงภาพชัดขึ้น */
.thumbnail-card::after {
    content: '';
    position: absolute;
    inset: 0;
    /* gradient เบาๆ เฉพาะที่ข้อความด้านล่าง */
    background: linear-gradient(to top,
        rgba(0,0,0,0.4) 0%,
        transparent 40%
    );
    pointer-events: none;
}

.thumbnail-card.active::after {
    background-color: rgba(248, 182, 76, 0.1);
}

/* Thumbnail Text */
.thumbnail-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px;
    z-index: 2;
    text-align: center;
}

.thumbnail-card-content h3 {
    font-size: 10px;
    font-weight: 500;
    color: #f8b64c;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* เพิ่ม text-shadow เพื่อให้อ่านง่ายโดยไม่ต้องใช้ overlay มืด */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.thumbnail-card-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 20px;
    height: 30px;
    color: #ffffff;
    /* เพิ่ม text-shadow เพื่อให้อ่านง่ายโดยไม่ต้องใช้ overlay มืด */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.thumbnail-card-subtitle {
    font-size: 10px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Bottom Navigation Area */
#bottom-navigation-area {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 15;
    padding: 16px 0;
    background-color: transparent;
    backdrop-filter: blur(5px);
    display: flex;
    width: 16%;
    transform: translatex(calc(var(--slider-height, 100vh) * 1.538)) translatey(calc(var(--slider-height, 100vh) * -0.169));
}

#bottom-navigation-area .items-center {
    justify-content: flex-end;
}

/* Text Content Area - โปร่งใส ไม่มีกรอบ ใช้ text-shadow แทน */
#featured-text-content {
    position: absolute;
    left: 0;
    bottom: max(80px, calc(var(--slider-height, 100vh) * 0.08));
    z-index: 10;
    padding: 1.5rem;
    max-width: 36rem;
    /* โปร่งใส ไม่มีกรอบดำ */
    background: transparent;
    border-radius: 0;
    backdrop-filter: none;
    border: none;
}

/* Title sizing based on slider height */
#featured-title {
    font-size: clamp(1.5rem, calc(var(--slider-height, 100vh) * 0.03), 3rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: #ffffff;
    /* text-shadow เข้มขึ้นเพื่อให้อ่านง่ายบนภาพพื้นหลัง */
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.7);
}

/* Supertitle */
#featured-supertitle {
    font-size: clamp(0.7rem, calc(var(--slider-height, 100vh) * 0.012), 1rem);
    color: #f8b64c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
    /* text-shadow เข้มขึ้นเพื่อให้อ่านง่ายบนภาพพื้นหลัง */
    text-shadow: 1px 1px 6px rgba(0,0,0,0.9), 0 0 15px rgba(0,0,0,0.7);
}

/* Description */
#featured-description {
    font-size: clamp(0.7rem, calc(var(--slider-height, 100vh) * 0.012), 0.875rem);
    color: #f0f0f0;
    margin-bottom: 1rem;
    line-height: 1.625;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* text-shadow เข้มขึ้นเพื่อให้อ่านง่ายบนภาพพื้นหลัง */
    text-shadow: 1px 1px 6px rgba(0,0,0,0.9), 0 0 15px rgba(0,0,0,0.7);
}

/* CTA Button */
#featured-link {
    display: inline-block;
    background-color: #f8b64c;
    color: #111827;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: clamp(0.7rem, calc(var(--slider-height, 100vh) * 0.012), 1rem);
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#featured-link:hover {
    background-color: rgba(248, 182, 76, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Navigation Buttons */
#prev-slide,
#next-slide,
#pause-autoplay {
    padding: 0.5rem;
    border-radius: 9999px;
    transition: background-color 0.3s;
    width: 40px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    cursor: pointer;
}

/* Pause button specific styles */
#pause-autoplay[aria-pressed="true"] {
    background-color: var(--dga-accent, #ffc107);
    color: #000;
}

#prev-slide:hover,
#next-slide:hover,
#pause-autoplay:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

#pause-autoplay[aria-pressed="true"]:hover {
    background-color: var(--dga-accent-hover, #ffca28);
}

#prev-slide:active,
#next-slide:active,
#pause-autoplay:active {
    background-color: rgba(0, 0, 0, 0.8);
}

#prev-slide:disabled,
#next-slide:disabled,
#pause-autoplay:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#prev-slide svg,
#next-slide svg,
#pause-autoplay svg {
    width: 24px;
    height: 24px;
}

/* Focus visible for pause button */
#pause-autoplay:focus-visible {
    outline: var(--dga-focus-ring-width) solid var(--dga-focus-ring);
    outline-offset: var(--dga-focus-ring-offset);
    box-shadow: 0 0 0 calc(var(--dga-focus-ring-width) + var(--dga-focus-ring-offset) + 3px) rgba(255, 193, 7, 0.25);
}

/* Progress Bar */
#progress-bar {
    height: 100%;
    background-color: #f8b64c;
    transition: width 0.5s ease-in-out;
}

.progress-indicator {
    background-color: #f8b64c;
}

/* Slide Counter */
#slide-counter {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    min-width: 30px;
}

/* Loading State */
.dga-slide-loading {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(31, 41, 55, 0.95) 100%);
    backdrop-filter: blur(12px);
    gap: 1.5rem;
}

/* Loading Spinner */
.dga-slide-loading::before {
    content: '';
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--dga-accent, #ffc107);
    border-radius: 50%;
    animation: dga-spin 1s linear infinite;
}

@keyframes dga-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.dga-slide-loading .dga-error-message {
    background: transparent;
    color: var(--dga-text-primary, #ffffff);
    font-size: 1rem;
    font-weight: 500;
    padding: 0;
    letter-spacing: 0.05em;
    animation: dga-pulse 1.5s ease-in-out infinite;
}

@keyframes dga-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading dots animation */
.dga-slide-loading .dga-error-message::after {
    content: '';
    animation: dga-dots 1.5s steps(4, end) infinite;
}

@keyframes dga-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Error Message (when error occurs) */
.dga-error-message {
    background-color: rgba(255, 255, 255, 0.95);
    color: #991b1b;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    padding: 1.25rem 2rem;
    max-width: 85%;
    position: relative;
    z-index: 101;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Error state - different styling */
.dga-slide-loading.error::before {
    display: none;
}

.dga-slide-loading.error .dga-error-message {
    background-color: rgba(254, 242, 242, 0.95);
    color: #991b1b;
    animation: none;
}

.dga-slide-loading.error .dga-error-message::after {
    display: none;
}

/* Hide default slick controls */
.slick-prev,
.slick-next {
    display: none !important;
}

/* Base styles */
.dga-slider, .dga-slider * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Discover button */
.discover-button {
    text-decoration: none;
    color: white !important;
    font-weight: 600;
    transition: opacity 0.3s;
}

.discover-button:hover {
    opacity: 0.9;
}

.discover-button .icon {
    background-color: #f8b64c;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-between .items-end .items-center {
    margin-bottom: 10px;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.mr-4 {
    margin-right: 1rem;
}

.h-1 {
    height: 0.25rem;
}

.bg-gray-700 {
    background-color: rgba(55, 65, 81, 0.5);
}

.rounded-full {
    border-radius: 9999px;
}

.w-32 {
    width: 8rem;
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 40px;
}

.nav-button {
    width: 40px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 8px;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Progress Container */
.progress-container {
    display: flex;
    align-items: center;
    flex: 1;
}

.progress-bar {
    flex-grow: 1;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    position: relative;
    margin-right: 16px;
}

.standard-bottom-nav {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 40;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

/* Media Queries with Dynamic Height Considerations */
@media (min-width: 640px) {
    #featured-text-content {
        padding: 2rem;
    }
    
    #featured-supertitle {
        margin-bottom: 0.5rem;
    }
    
    #featured-title {
        margin-bottom: 1rem;
    }
    
    #featured-description {
        margin-bottom: 1.5rem;
        -webkit-line-clamp: 3;
    }
    
    #featured-link {
        padding: 0.75rem 1.5rem;
    }
}

@media (min-width: 641px) {
    #right-thumbnails-area {
        height: min(24vh, calc(var(--slider-height, 100vh) * 0.24)) !important;
        padding-bottom: 0px;
        padding-top: 0px;
    }
}

@media (min-width: 768px) {
    #featured-text-content {
        padding: 3rem;
    }
    
    #thumbnails-container .thumbnail-card h3 {
        font-size: 16px;
        color: #ffffff;
        margin-bottom: 7px;
    }
    
    #thumbnails-container .thumbnail-card .thumbnail-card-content {
        padding-top: 0px;
        padding-bottom: 0px;
    }
}

@media (min-width: 769px) {
    #right-thumbnails-area {
        max-width: 700px;
    }
    
    .dga-carousel-navigation .dga-carousel-next svg {
        height: 77px;
    }
    
    .dga-carousel-controls .dga-carousel-dots .dga-carousel-dot {
        width: 15px;
        height: 15px;
    }
}

@media (min-width: 1024px) {
    #featured-text-content {
        padding: 4rem;
        max-width: 42rem;
    }
}

/* Responsive adjustments for different heights */
@media (max-width: 1280px) {
    .thumbnails-container {
        max-width: 700px;
    }
}

@media (max-width: 1024px) {
    .thumbnails-container {
        max-width: 460px;
    }
    
    .progress-container {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    #slider-container {
        min-height: 300px;
    }

    #right-thumbnails-area {
        width: 50%;
        position: fixed;
        bottom: min(100px, calc(var(--slider-height, 100vh) * 0.1));
        top: auto;
        left: auto;
        right: 20px;
        height: min(200px, calc(var(--slider-height, 100vh) * 0.2));
        max-width: 480px;
        padding: 10px;
        transform: none;
        flex-direction: column;
    }

    .thumbnail-nav-buttons {
        margin-bottom: 15px;
    }

    #thumbnails-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
    }

    #thumbnails-container {
        grid-template-columns: repeat(4, 120px);
        grid-template-rows: 1fr;
        gap: 10px;
    }

    .thumbnail-card {
        height: min(140px, calc(var(--slider-height, 100vh) * 0.14));
    }

    .thumbnails-container {
        max-width: 480px;
    }

    .progress-container {
        max-width: 100px;
    }

    .slide-counter {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    #right-thumbnails-area {
        display: none;
    }

    #bottom-navigation-area {
        position: absolute;
        bottom: 10px;
        right: 10px;
        z-index: 15;
        padding: 16px 0;
        background-color: transparent;
        backdrop-filter: none;
        display: flex;
        width: auto;
        transform: none;
    }

    #right-thumbnails-area {
        position: fixed;
        bottom: min(60px, calc(var(--slider-height, 100vh) * 0.06));
        top: auto;
        left: 10px;
        right: 10px;
        width: auto;
        height: min(160px, calc(var(--slider-height, 100vh) * 0.16));
        max-width: none;
        padding: 8px;
        transform: none;
        flex-direction: row;
    }

    .thumbnail-nav-buttons {
        flex-direction: column;
        margin-right: 8px;
        margin-bottom: 12px;
        padding: 4px;
    }

    .thumb-nav-btn {
        width: 28px;
        height: 28px;
        margin: 2px 0;
    }

    .thumb-page-indicator {
        font-size: 11px;
        margin: 4px 0;
    }

    #thumbnails-container {
        grid-template-columns: repeat(4, 110px);
        gap: 8px;
    }

    .thumbnail-card {
        height: min(120px, calc(var(--slider-height, 100vh) * 0.12));
    }

    .thumbnail-card-content h3 {
        font-size: 10px;
    }

    .thumbnail-card-title {
        font-size: 11px;
        padding-bottom: 10px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .thumbnails-container {
        max-width: 200px;
    }
    
    .progress-container {
        display: none;
    }
}

/* Touch optimization */
.thumbnail-card {
    -webkit-tap-highlight-color: transparent;
}

#thumbnails-container {
    -webkit-overflow-scrolling: touch;
}

/* Special handling for very small heights */
@media (max-height: 500px) {
    #slider-container {
        min-height: 400px;
    }

    #featured-text-content {
        bottom: 60px;
        padding: 1rem;
    }

    #featured-title {
        font-size: 1.5rem;
    }

    #featured-description {
        -webkit-line-clamp: 1;
    }

    #right-thumbnails-area {
        padding-top: 50px;
        transform: translatey(200px);
    }
}

/* ============================================
   WCAG 2.2.2 - Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations and transitions */
    .dga-slider,
    .dga-slider *,
    #slider-container,
    #slider-container * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Static loading indicator for reduced motion */
    .dga-slide-loading::before {
        animation: none !important;
        border-color: var(--dga-accent, #ffc107);
    }

    .dga-slide-loading .dga-error-message {
        animation: none !important;
    }

    .dga-slide-loading .dga-error-message::after {
        content: '...' !important;
        animation: none !important;
    }

    /* Keep focus indicators visible */
    .thumb-nav-btn:focus-visible,
    #prev-slide:focus-visible,
    #next-slide:focus-visible,
    .thumbnail-card:focus-visible,
    #featured-link:focus-visible {
        transition: none !important;
    }

    /* Static states for hover effects */
    .thumbnail-card:hover {
        transform: none !important;
    }

    .thumbnail-card:hover img {
        transform: none !important;
    }

    #featured-link:hover {
        transform: none !important;
    }

    /* Immediate opacity changes */
    #featured-image,
    #featured-text-content {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   WCAG 1.4.6 - Enhanced Color Contrast (AAA 7:1)
   ============================================ */

/* Update button borders for better contrast */
.thumb-nav-btn {
    border: 2px solid var(--dga-border-light, rgba(255, 255, 255, 0.7));
}

.nav-button {
    border: 2px solid var(--dga-border-light, rgba(255, 255, 255, 0.7));
}

/* Update page indicator for full contrast */
.thumb-page-indicator {
    color: var(--dga-text-primary, #ffffff);
    opacity: 1; /* Remove opacity reduction */
    font-weight: 600;
}

/* Update yellow accent colors for AAA compliance */
.thumbnail-card.active {
    border-color: var(--dga-accent, #ffc107);
}

.thumbnail-card-content h3 {
    color: var(--dga-accent, #ffc107);
}

#featured-supertitle {
    color: var(--dga-accent, #ffc107);
}

#featured-link {
    background-color: var(--dga-accent, #ffc107);
    color: #000000; /* Black text on yellow for contrast */
}

#featured-link:hover,
#featured-link:focus {
    background-color: var(--dga-accent-hover, #ffca28);
}

/* Progress bar with better visibility */
#progress-bar {
    background-color: var(--dga-accent, #ffc107);
}

/* ============================================
   WCAG 1.4.12 - Minimum Font Size (12px+)
   ============================================ */

/* Ensure minimum font sizes for readability */
.thumbnail-card-content h3 {
    font-size: 12px; /* Increased from 10px */
}

.thumbnail-card-title {
    font-size: 13px; /* Increased from 12px */
}

.thumbnail-card-subtitle {
    font-size: 12px; /* Increased from 10px */
}

.thumb-page-indicator {
    font-size: 13px; /* Increased from 12px */
}

/* Mobile font size adjustments - maintain minimum */
@media (max-width: 640px) {
    .thumbnail-card-content h3 {
        font-size: 12px; /* Maintain minimum */
    }

    .thumbnail-card-title {
        font-size: 12px; /* Maintain minimum */
    }

    .thumb-page-indicator {
        font-size: 12px; /* Maintain minimum */
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (forced-colors: active) {
    .thumbnail-card.active {
        outline: 3px solid CanvasText;
    }

    .thumb-nav-btn:focus-visible,
    #prev-slide:focus-visible,
    #next-slide:focus-visible,
    .thumbnail-card:focus-visible,
    #featured-link:focus-visible {
        outline: 3px solid Highlight !important;
        outline-offset: 2px;
    }

    #progress-bar {
        background-color: Highlight;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #slider-container {
        height: auto !important;
        min-height: auto !important;
    }

    #right-thumbnails-area,
    #bottom-navigation-area,
    .thumbnail-nav-buttons,
    #loading-overlay {
        display: none !important;
    }

    #featured-text-content {
        position: static;
        background: none;
        color: #000;
    }

    #featured-title,
    #featured-description {
        color: #000;
        text-shadow: none;
    }
}