/**
 * Kanto Hero Slider Styles
 * 
 * Horizontal row of equal cards with hover effects.
 * Matches qiscans.org design with contained layout.
 * 
 * @package madara-child
 */

/* ==================== Kanto Hero Row Slider ==================== */

.kanto-hero-row-slider {
    position: relative;
    width: 100%;
    background: var(--mc-bg);
    color: var(--mc-text);
    padding: 40px 0;
    margin-bottom: 40px;
    overflow: hidden;
}

/* Container wrapper to match theme */
.kanto-hero-row-slider>.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3.2vw, 24px);
    width: 100%;
}

.kanto-hero-row-container {
    display: flex;
    gap: 16px;
    padding: 20px 0 40px 0;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.kanto-hero-row-container::-webkit-scrollbar {
    display: none;
}

/* Desktop: Show exactly 3 cards */
@media (min-width: 1024px) {
    .kanto-hero-row-container {
        gap: 16px;
    }
}

/* ==================== Card Styles ==================== */

.kanto-hero-card {
    position: relative;
    flex: 0 0 auto;
    width: calc(100% - 32px);
    min-width: calc(100% - 32px);
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--mc-surface);
    cursor: pointer;
    scroll-snap-align: start;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Desktop: Exactly 3 cards visible */
@media (min-width: 1024px) {
    .kanto-hero-card {
        width: calc((100% - 32px) / 3);
        min-width: calc((100% - 32px) / 3);
        max-width: calc((100% - 32px) / 3);
    }
}

/* Tablet: 2 cards */
@media (min-width: 768px) and (max-width: 1023px) {
    .kanto-hero-card {
        width: calc((100% - 16px) / 2);
        min-width: calc((100% - 16px) / 2);
        max-width: calc((100% - 16px) / 2);
    }
}

.kanto-hero-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.kanto-hero-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 450px;
    /* Ensure minimum height */
}

/* Card background image */
.kanto-hero-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    /* Add this to ensure image doesn't overflow */
}

.kanto-hero-card-bg-img {
    width: 100%;
    height: 100%;
    min-height: 450px;
    /* Add this */
    object-fit: cover;
    object-position: center center;
    /* Keep centered */
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Dark overlay gradient */
.kanto-hero-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            rgba(9, 9, 9, 0.92) 0%,
            rgba(82, 81, 81, 0.09) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Card content */
.kanto-hero-card-content {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    padding: 8px;
    color: var(--mc-text);
    pointer-events: none;
}

/* Title */
.kanto-hero-card-title {
    margin: 2px 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #C8C9CA;
    text-align: left;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .kanto-hero-card-title {
        font-size: 16px;
    }
}

.kanto-hero-card-title span {
    display: block;
}

/* Description */
.kanto-hero-card-description {
    margin: 4px 0 8px 0;
    font-size: 12px;
    line-height: 1.5;
    color: #AEAEB1;
    text-align: justify;
    width: 90%;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .kanto-hero-card-description {
        font-size: 14px;
    }
}

/* Meta (rating and chapters) */
.kanto-hero-card-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 4px 0 8px 0;
    width: 90%;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.kanto-hero-card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

@media (min-width: 1024px) {
    .kanto-hero-card-meta-item {
        font-size: 14px;
    }
}

.kanto-hero-card-meta-value {
    font-weight: 400;
    color: #ffffff;
}

.kanto-hero-card-meta-label {
    font-weight: 400;
    color: #9CA3AF;
}

/* Action buttons (hidden by default, slide up on hover) */
.kanto-hero-card-actions {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    height: 0;
    overflow: hidden;
    margin-top: 0;
    transition: height 0.3s ease;
    pointer-events: auto;
    transform: translateY(10px);
    opacity: 0;
}

.kanto-hero-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    flex: 1 1 auto;
    min-width: fit-content;
    pointer-events: auto;
    white-space: nowrap;
    overflow: visible;
}

.kanto-hero-card-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    line-height: 1;
}

.kanto-hero-card-btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.kanto-hero-card-btn-text {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
}

.kanto-hero-card-btn-primary {
    background: linear-gradient(135deg, var(--mc-primary, #ff5033) 0%, var(--mc-cta-end, #ff8a3d) 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.5);
    border: 0;
}

.kanto-hero-card-btn-primary:hover {
    background: linear-gradient(135deg, var(--mc-cta-end, #ff8a3d) 0%, var(--mc-primary, #ff5033) 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.6);
}

.kanto-hero-card-btn-primary:active {
    transform: translateY(0);
}

.kanto-hero-card-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.kanto-hero-card-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.kanto-hero-card-btn-secondary:active {
    transform: translateY(0);
}

/* Ensure buttons always have proper contrast - prevent white mode issues */
.kanto-hero-card-btn-primary,
.kanto-hero-card-btn-primary:hover,
.kanto-hero-card-btn-primary:focus,
.kanto-hero-card-btn-primary:active {
    background: linear-gradient(135deg, #ff5033 0%, #ff8a3d 100%) !important;
    color: #ffffff !important;
}

.kanto-hero-card-btn-secondary,
.kanto-hero-card-btn-secondary:hover,
.kanto-hero-card-btn-secondary:focus,
.kanto-hero-card-btn-secondary:active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.kanto-hero-card-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* ==================== Hover State ==================== */

/* Desktop hover effect */
@media (hover: hover) and (pointer: fine) {
    .kanto-hero-card-group:hover .kanto-hero-card-meta {
        transform: translateY(-16px);
    }

    .kanto-hero-card-group:hover .kanto-hero-card-actions {
        height: auto;
        min-height: 44px;
        opacity: 1;
        transform: translateY(0);
        transition: height 0.3s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    }
}

/* Touch/active state */
.kanto-hero-card-group.is-hovered .kanto-hero-card-meta {
    transform: translateY(-16px);
}

.kanto-hero-card-group.is-hovered .kanto-hero-card-actions {
    height: auto;
    min-height: 44px;
    opacity: 1;
    transform: translateY(0);
    transition: height 0.3s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

/* ==================== Responsive Adjustments ==================== */

/* Mobile */
@media (max-width: 767px) {
    .kanto-hero-row-slider {
        padding: 24px 0;
    }

    .kanto-hero-row-container {
        padding: 12px 0 40px 0;
        gap: 16px;
    }

    .kanto-hero-card {
        height: 430px;
        width: calc(100% - 32px);
        min-width: calc(100% - 32px);
        max-width: calc(100% - 32px);
    }
}

/* ==================== Accessibility ==================== */

.kanto-hero-card:focus {
    outline: 2px solid var(--mc-primary);
    outline-offset: 4px;
}

.kanto-hero-card-btn:focus {
    outline: 2px solid var(--mc-primary);
    outline-offset: 2px;
}

/* ==================== Loading States ==================== */

.kanto-hero-card-bg-img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanto-hero-card-bg-img[loading="lazy"].loaded {
    opacity: 1;
}