/*!
 * Strobist Korea - Home Page Styles
 * page-home.php 전용 스타일
 *
 * 구성:
 * - 히어로 슬라이더 (큐레이션 최신 4개, 페이드 전환, 자동 3초)
 * - 카드 그리드 (담론 최신 3개)
 * - 반응형 (태블릿 2열, 모바일 1열)
 */

/* ============================================================
 * 레이아웃
 * ============================================================ */
.sk-home-main {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 60px;
    box-sizing: border-box;
}

/* ============================================================
 * 히어로 슬라이더
 * ============================================================ */
.sk-hero-slider {
    position: relative;
    margin: 30px 0 60px;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f5f5f5;
}

@supports not (aspect-ratio: 3 / 2) {
    .sk-hero-slider {
        height: 0;
        padding-bottom: 66.67%;
    }
}

.sk-slides-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* 개별 슬라이드 (페이드 전환) */
.sk-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0s linear 0.8s;
    pointer-events: none;
}

.sk-slide.sk-slide--active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0s linear 0s;
    pointer-events: auto;
    z-index: 1;
}

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

.sk-slide-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
}

.sk-slide-image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.sk-slide-empty-text {
    color: #999;
    font-size: 14px;
}

/* 슬라이드 캡션 (검정 박스) */
.sk-slide-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 14px 28px;
    background: #1a1a1a;
    color: #fff;
    max-width: 60%;
    box-sizing: border-box;
    z-index: 2;
}

.sk-slide-category {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #d4d4d4;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin: 0 0 4px;
}

.sk-slide-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 화살표 네비게이션 */
.sk-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(26, 26, 26, 0.7);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease;
    padding: 0 0 4px 0;
    border-radius: 0;
}

.sk-slider-nav:hover {
    background: rgba(26, 26, 26, 0.95);
}

.sk-slider-nav:focus {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.sk-slider-prev {
    left: 0;
}

.sk-slider-next {
    right: 0;
}

/* 호버 시 화살표 표시 */
.sk-hero-slider:hover .sk-slider-nav,
.sk-hero-slider:focus-within .sk-slider-nav {
    opacity: 1;
}

/* 단일 슬라이드 (글 1개일 때) */
.sk-hero-slider.sk-single-slide .sk-slide {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 빈 상태 (글 0개일 때) */
.sk-hero-slider.sk-hero--empty {
    aspect-ratio: auto;
    padding: 80px 20px;
    text-align: center;
    color: #999;
    background: #fafafa;
    border: 1px dashed #ddd;
}

.sk-hero-slider.sk-hero--empty p {
    margin: 0;
}

/* ============================================================
 * 카드 그리드 (최신 담론)
 * ============================================================ */
.sk-cards {
    margin: 0 0 40px;
}

.sk-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.sk-card {
    border-top: 2px solid #1a1a1a;
    padding-top: 20px;
}

.sk-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.sk-card-link:hover {
    opacity: 0.7;
}

.sk-card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 16px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sk-card-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
 * 반응형
 * ============================================================ */

/* 태블릿: 카드 2열 */
@media (max-width: 900px) {
    .sk-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .sk-slide-caption {
        max-width: 80%;
        padding: 12px 22px;
    }

    .sk-slide-title {
        font-size: 18px;
    }

    /* 모바일/태블릿에서는 화살표 항상 표시 */
    .sk-slider-nav {
        opacity: 0.85;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* 모바일: 1열 */
@media (max-width: 600px) {
    .sk-home-main {
        padding: 0 16px 40px;
    }

    .sk-hero-slider {
        margin: 20px 0 40px;
        aspect-ratio: auto;
    }

    .sk-slides-wrap {
        position: relative;
        height: auto;
    }

    .sk-slide {
        position: absolute;
        inset: 0;
    }

    .sk-slide--active {
        position: relative;
    }

    .sk-slide-link {
        display: block;
    }

    .sk-slide-image {
        aspect-ratio: 3 / 2;
        height: auto;
    }

    .sk-slide-caption {
        position: static;
        max-width: 100%;
        padding: 12px 18px;
    }

    .sk-slide-title {
        font-size: 17px;
    }

    .sk-cards-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .sk-card-title {
        font-size: 17px;
    }
}
