/* =========================================
   Single Lesson Detail Page
   ========================================= */
.lesson-detail {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #eee;
}


/* =========================================
   Single: Lesson Detail
   ========================================= */
.lesson-page-wrapper {
    max-width: 1200px;
    margin: 40px auto 80px;
    padding: 0 20px;
}

.lesson-breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 28px;
}

.lesson-breadcrumb a {
    color: #888;
    text-decoration: none;
}

.lesson-breadcrumb a:hover {
    color: var(--primary);
}

.lesson-page-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.lesson-main {
    min-width: 0;
    overflow: hidden;
}

.lesson-header {
    margin-bottom: 24px;
}

.lesson-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.lesson-category-tag {
    display: inline-block;
    background: #e8f4fc;
    color: #5599bb;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.lesson-category-tag.lesson-archive-tag--major {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.lesson-category-tag:not(.lesson-archive-tag--major) {
    background: rgba(63, 142, 237, 0.12);
    color: var(--primary);
    border: 1px solid rgba(63, 142, 237, 0.25);
}

.lesson-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: #222;
    line-height: 1.4;
    margin: 0;
}

.lesson-catchcopy {
    margin: 10px 0 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.7;
    color: #5b677a;
}

.lesson-gallery-container {
    margin-bottom: 32px;
    width: 100%;
    overflow: hidden;
}

.lesson-gallery {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.lesson-gallery .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-gallery .swiper-slide img {
    display: block;
    max-width: 100%;
    height: auto;
}

.lesson-gallery .swiper-button-next,
.lesson-gallery .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.lesson-gallery .swiper-button-next:after,
.lesson-gallery .swiper-button-prev:after {
    font-size: 18px;
}

.lesson-gallery .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
}

.lesson-gallery .swiper-pagination-bullet-active {
    opacity: 1;
    background: #97CCE8;
}

.lesson-thumbs {
    margin-top: 10px;
}

.lesson-thumbs .swiper-slide {
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s;
    border-radius: 6px;
    overflow: hidden;
    width: 76px !important;
    height: 52px;
}

.lesson-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    outline: 2px solid #97CCE8;
}

.lesson-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-section {
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e8f0f5;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lesson-section h2 {
    font-size: 1.05rem;
    font-weight: bold;
    color: #333;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f4fc;
    display: flex;
    align-items: center;
    gap: 7px;
}

.lesson-section h2 i {
    color: #97CCE8;
}

.lesson-section-body {
    line-height: 1.9;
    color: #555;
}

.lesson-materials {
    background: #f7fbff;
    border: 1px solid #dbe9f5;
}

.pdf-link-list {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
}

.pdf-link-list li + li {
    margin-top: 10px;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 12px 14px;
    border: 1px solid #f3c4bf;
    border-radius: 12px;
    background: #fff5f3;
    color: #b42318;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(180, 35, 24, 0.08);
}

.pdf-link i {
    font-size: 1.85rem;
    flex-shrink: 0;
}

.pdf-link:hover {
    background: #feeceb;
    border-color: #e79b92;
    color: #912018;
}

.lesson-application-materials p strong {
    display: inline-block;
    margin-top: 10px;
    color: #7c2d12;
}

.lesson-detail-sidebar {
    position: sticky;
    top: 24px;
}

.lesson-sidebar-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.lesson-sidebar-card-body {
    padding: 24px;
}

.lesson-meta-list {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f6f7f8;
    border-radius: 8px;
}

.lesson-meta-icon {
    color: #97CCE8;
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.lesson-meta-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}

.lesson-meta-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: #222;
}

.lesson-booking-btn {
    display: block;
    width: 100%;
    background: var(--accent);
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 10px;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.lesson-booking-btn:hover {
    opacity: 0.85;
    color: #fff;
}

/* 分類・番号ラベル（メインエリア） */
.lesson-number-label {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 0.8em;
}

/* 分類・番号バッジ（サイドバー） */
.lesson-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0.8em;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    text-align: center;
}
.lesson-number-badge span {
    background: transparent;
    padding: 0;
    border-radius: 0;
}
.lesson-news-badge {
    font-size: 1em;
    color: #666;
}

.lesson-inquiry-btn {
    display: block;
    width: 100%;
    background: #fff;
    color: #555;
    text-align: center;
    font-weight: bold;
    padding: 11px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.88rem;
    border: 2px solid #e0e0e0;
    transition: background 0.2s;
    box-sizing: border-box;
}

.lesson-inquiry-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.lesson-related {
    margin-top: 52px;
}

.lesson-related__header {
    margin-bottom: 18px;
}

.lesson-related__header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
}

.lesson-related__header p {
    margin: 0;
    color: #475569;
    font-size: 0.98rem;
    font-weight: 600;
}

.lesson-related__list {
    display: grid;
    gap: 12px;
}

.lesson-related-card {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    overflow: hidden;
}

.lesson-related-card__link {
    display: flex;
    gap: 14px;
    align-items: stretch;
    padding: 14px;
    color: inherit;
    text-decoration: none;
}

.lesson-related-card__thumb {
    flex: 0 0 120px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f5f9;
}

.lesson-related-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-related-card__body {
    flex: 1;
    min-width: 0;
}

.lesson-related-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.lesson-related-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
}

.lesson-related-card__desc {
    margin: 8px 0 0;
    color: #5b677a;
    font-size: 0.88rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-related-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
    .lesson-related-card__link {
        flex-direction: column;
    }

    .lesson-related-card__thumb {
        flex-basis: auto;
        height: 180px;
    }
}

/* 本文内の申込みボタン */
.lesson-apply-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.lesson-apply-buttons .lesson-booking-btn,
.lesson-apply-buttons .lesson-inquiry-btn {
    flex: 1;
    max-width: 250px;
}

/* 形式サマリー（_raw_形式がない場合のフォールバック） */
.lesson-format-summary {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-format-summary li {
    padding: 4px 0;
}

.lesson-merchandise-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 0.92rem;
}

@media (max-width: 600px) {
    .lesson-apply-buttons {
        flex-direction: column;
    }

    .lesson-apply-buttons .lesson-booking-btn,
    .lesson-apply-buttons .lesson-inquiry-btn {
        max-width: 100%;
    }
}

.lesson-sidebar-footer {
    background: #f9f7f2;
    padding: 10px 24px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.72rem;
    color: #aaa;
}

.lesson-mentor-item {
    margin-bottom: 12px;
}

.mentor-affiliation {
    color: #666;
    margin-left: 8px;
}

.mentor-note {
    font-size: 0.85rem;
    color: #888;
    margin: 4px 0 0;
}

.lesson-mentor-item a,
.mentor-affiliation a,
.mentor-note a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lesson-back-btn {
    margin-top: 36px;
}

@media (max-width: 900px) {
    .lesson-page-grid {
        grid-template-columns: 1fr;
    }

    .lesson-detail-sidebar {
        position: static;
        margin-bottom: 5%;
    }
}

/* ===== SP用 下部固定 CTA ===== */
.lesson-sp-sticky-cta {
    display: none;
}

@media (max-width: 900px) {
    .lesson-sp-sticky-cta {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 70px;
        width: 230px;
        margin: auto;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: no-repeat;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        z-index: 50;
    }

    .lesson-sp-sticky-cta__btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        background: var(--accent);
        color: #fff;
        font-weight: bold;
        font-size: 1rem;
        text-align: center;
        text-decoration: none;
        border-radius: 12px;
        box-sizing: border-box;
        transition: opacity 0.2s;
    }

    .lesson-sp-sticky-cta__btn:hover,
    .lesson-sp-sticky-cta__btn:focus {
        opacity: 0.9;
        color: #fff;
    }

    /* 固定CTA分の余白をフッターまでに確保 */
    .single-lesson {
        padding-bottom: 88px;
    }
}

/* SPボトムナビ(.sp-bottom-nav: 60px)と重ならないように CTA を上にずらす */
@media (max-width: 768px) {
    .lesson-sp-sticky-cta {
        bottom: 70px;
    }

    .single-lesson {
        padding-bottom: 148px;
    }
}

@media (max-width: 600px) {
    .lesson-title {
        font-size: 1.35rem;
    }

    .lesson-gallery .swiper-button-next,
    .lesson-gallery .swiper-button-prev {
        width: 34px;
        height: 34px;
    }

    .lesson-gallery .swiper-button-next:after,
    .lesson-gallery .swiper-button-prev:after {
        font-size: 15px;
    }
}
