/**
 * Hero Carousel Component
 * 
 * Styles for the hero carousel that displays featured articles
 * in the primary hero section with navigation controls.
 * 
 * Styled with the Capital Chronicle brand kit - minimalist with
 * white background, black text, and subtle gold accents.
 * 
 * Enhanced with Swiper.js integration for touch/swipe support.
 */

/* Hero Carousel Container */
.hero-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Opinion Hero Carousel Container specific styling */
.opinion-hero-carousel-container .hero-pagination .swiper-pagination-bullet-active {
    background-color: var(--color-accent-secondary);
    transform: scale(1.2);
}

/* Swiper Integration */
.hero-carousel-container.swiper {
    /* Preserve existing container styles while working with Swiper */
    height: 100%;
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
}

/* Swiper Wrapper */
.hero-carousel.swiper-wrapper {
    height: 100%;
    box-sizing: border-box;
    transition-property: transform;
}

/* Individual Slides */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* Swiper Slide */
.hero-slide.swiper-slide {
    position: relative;
    height: 100%;
    width: 100%;
    opacity: 1;
    z-index: auto;
    flex-shrink: 0;
}

/* Active Slide */
.hero-slide.active,
.hero-slide.swiper-slide-active {
    opacity: 1;
    z-index: 1;
    transform: translateX(0);
}

/* Keep all the existing hero-primary styling */
.hero-slide .hero-primary {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--color-background-primary);
    border: 1px solid var(--color-border-primary);
    overflow: hidden;
    height: 100%;
}

/* Ensure article content is properly displayed */
.hero-slide .hero-primary-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.hero-slide .typography-hero-h1 {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-primary);
    transition: color 0.2s ease;
    min-height: 2.4em;
}

.hero-slide .typography-article-summary {
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin-top: 8px;
    margin-bottom: 16px;
}

.hero-slide .hero-meta {
    display: flex;
    align-items: center;
    margin-top: auto;
}

/* Navigation Buttons */
.hero-nav-button {
    position: absolute;
    top: 30%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--color-border-light);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}

/* Swiper Navigation Buttons */
.hero-nav-button.swiper-button-prev,
.hero-nav-button.swiper-button-next {
    /* Override Swiper's default styles */
    background-image: none;
    margin-top: 0;
}

/* Override Swiper's default arrow icons */
.hero-nav-button.swiper-button-prev::after,
.hero-nav-button.swiper-button-next::after {
    content: none !important;
}

.hero-nav-button:hover {
    background-color: #fcd00aff;
    opacity: 0.3
}

.hero-nav-button:focus {
    opacity: 1;
    outline: 2px solid var(--color-accent-secondary);
    outline-offset: 2px;
    opacity: 0.3
}

.hero-nav-button.prev-button {
    left: 16px;
}

.hero-nav-button.next-button {
    right: 16px;
}

.hero-nav-button svg,
.hero-nav-button.swiper-button-prev svg,
.hero-nav-button.swiper-button-next svg {
    width: 25x !important;
    height: 25px !important;
    fill: #000000 !important;
}

/* Pagination */
.hero-pagination {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    text-align: center;
    width: auto !important; /* Force width to be auto */
    justify-content: center;
}

/* Swiper Pagination */
.hero-pagination.swiper-pagination {
    width: auto !important; /* Override Swiper's default width */
    bottom: 16px;
    display: flex !important; /* Force flex display */
    justify-content: center !important;
    transform: translateX(-50%) !important; /* Ensure transform is applied */
    left: 50% !important; /* Force center position */
}

.pagination-dot,
.swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    padding: 0;
    margin: 0 4px;
    opacity: 0.5;
    display: inline-block;
}

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

.pagination-dot:hover,
.swiper-pagination-bullet:hover {
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 0.5;
}

/* Fix for Swiper pagination container */
.swiper-horizontal > .swiper-pagination-bullets, 
.swiper-pagination-bullets.swiper-pagination-horizontal {
    width: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Maintain grid structure */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-bottom: 40px;
    margin-top: 24px;
    min-height: 480px;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        min-height: 420px;
    }
    
    .hero-secondary {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .hero-secondary-header {
        grid-column: 1/-1;
    }
        
    .hero-secondary-separator {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-nav-button {
        width: 36px;
        height: 36px;
    }
    
    .hero-nav-button.prev-button {
        left: 8px;
    }
    
    .hero-nav-button.next-button {
        right: 8px;
    }
    
    .pagination-dot {
        width: 8px;
        height: 8px;
    }
    
    .hero-slide .typography-hero-h1 {
        font-size: 28px;
        min-height: 2.4em;
    }
    
    .hero-secondary {
        display: block;
    }
    
    /* Adjust pagination for mobile to avoid covering author credentials */
    .hero-pagination,
    .hero-pagination.swiper-pagination,
    .swiper-horizontal > .swiper-pagination-bullets, 
    .swiper-pagination-bullets.swiper-pagination-horizontal {
        bottom: 6px;
    }
    
    .pagination-dot,
    .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
        opacity: 0.3;
        margin: 0 3px;
    }
    
    .pagination-dot.active,
    .swiper-pagination-bullet-active {
        opacity: 0.4;
    }
}

@media (max-width: 480px) {
    .hero-nav-button {
        width: 32px;
        height: 32px;
    }
    
    .hero-pagination {
        bottom: 4px;
    }
    
    .hero-slide .hero-primary-content {
        padding: 16px;
    }
    
    .hero-section {
        min-height: 380px;
    }
    
    .hero-slide .typography-hero-h1 {
        font-size: 24px;
        min-height: 2.4em;
    }
    
    .hero-slide .typography-article-summary {
        font-size: 15px;
    }
    
    /* Further reduce pagination visibility on small screens */
    .pagination-dot,
    .swiper-pagination-bullet {
        width: 5px;
        height: 5px;
        opacity: 0.25;
        margin: 0 2px;
    }
    
    .pagination-dot.active,
    .swiper-pagination-bullet-active {
        opacity: 0.3;
    }
}

/* Touch indicators for mobile - subtle hint for swipe */
@media (max-width: 768px) {
    .hero-carousel-container::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 16px;
        width: 30px;
        height: 30px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff80'%3E%3Cpath d='M10 6L8.59 7.41L13.17 12L8.59 16.59L10 18L16 12L10 6Z'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        transform: translateY(-50%);
        opacity: 0.4;
        pointer-events: none;
        animation: pulse-hint 2s infinite;
        z-index: 10;
    }
    
    @keyframes pulse-hint {
        0% { opacity: 0.4; transform: translateY(-50%) scale(1); }
        50% { opacity: 0.8; transform: translateY(-50%) scale(1.1); }
        100% { opacity: 0.4; transform: translateY(-50%) scale(1); }
    }
    
    /* Hide the hint after user interaction */
    .hero-carousel-container.swiper-container-touched::after {
        display: none;
    }
} 