/**
 * Academia – Course Detail Page Styles
 * single-course.php component
 */

/* ============================================================================
   BACK LINK
   ========================================================================= */

.course-back-link {
    margin: 24px 0 20px;
}

.course-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary, #7a7a7a);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.course-back-link a:hover {
    color: var(--secondary-brand, #008fdd);
}

.course-back-link .material-icons-outlined {
    font-size: 16px;
}

/* ============================================================================
   HERO IMAGE AREA
   ========================================================================= */

.course-hero {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0;
}

/* Single full-width image */
.course-hero--single .course-hero__main {
    position: relative;
    width: 100%;
    height: 420px;
}

/* Gallery: 1 large left + 2 small stacked right */
.course-hero--gallery {
    display: grid;
    grid-template-columns: 1fr 0.55fr;
    gap: 8px;
}

.course-hero--gallery .course-hero__main {
    position: relative;
    height: 420px;
}

.course-hero__gallery {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
}

.course-hero__gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.course-hero__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Rounded corners for gallery grid */
.course-hero--gallery .course-hero__main { border-radius: 12px 0 0 12px; }
.course-hero--gallery .course-hero__gallery { border-radius: 0 12px 12px 0; overflow: hidden; }
.course-hero--gallery .course-hero__gallery-item:first-child { border-radius: 0 12px 0 0; }
.course-hero--gallery .course-hero__gallery-item:last-child  { border-radius: 0 0 12px 0; }

/* Shared: main image fills its container */
.course-hero__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay (title + subtitle over main image) */
.course-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 32px 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
    color: #ffffff;
}

.course-hero__badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
}

.course-hero__title {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    line-height: 1.2;
}

.course-hero__subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin: 0;
    line-height: 1.5;
    max-width: 560px;
}

/* ============================================================================
   TAB NAVIGATION
   ========================================================================= */

.course-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color, #d9d9d9);
    margin: 32px 0 0;
}

.course-tabs__tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary, #7a7a7a);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.course-tabs__tab:hover {
    color: var(--secondary-brand, #008fdd);
}

.course-tabs__tab.is-active {
    color: var(--secondary-brand, #008fdd);
    border-bottom-color: var(--secondary-brand, #008fdd);
    font-weight: 600;
}

/* ============================================================================
   TWO-COLUMN LAYOUT
   ========================================================================= */

.course-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
    padding-top: 40px;
    padding-bottom: 80px;
}

/* ── Left column ── */
.course-layout__content {
    min-width: 0; /* prevent overflow in grid */
}

/* ── Tab panels ── */
.course-tab-panel {
    display: none;
    padding-top: 32px;
}

.course-tab-panel.is-active {
    display: block;
}

/* ── Rich text content ── */
.course-rich-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary, #383838);
}

.course-rich-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
}

.course-rich-text p {
    line-height: 1.75;
    margin-bottom: 16px;
    color: var(--text-primary, #383838);
}

.course-rich-text ul,
.course-rich-text ol {
    padding-left: 0;
    list-style: none;
    margin-bottom: 16px;
}

.course-rich-text ul li,
.course-rich-text ol li {
    padding-left: 0;
    line-height: 1.75;
    color: var(--text-primary, #383838);
}

.course-rich-text ul li::before {
    content: '· ';
    color: var(--secondary-brand, #008fdd);
}

/* ============================================================================
   CHARACTERISTICS BAR
   ========================================================================= */

.course-characteristics {
    margin-bottom: 8px;
}

.course-characteristics__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
}

.course-characteristics__bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color, #d9d9d9);
    padding-bottom: 20px;
    margin-bottom: 0;
}

.course-char-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 32px;
    margin-right: 32px;
    border-right: 1px solid var(--border-color, #d9d9d9);
}

.course-char-item:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.course-char-item__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #7a7a7a);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.course-char-item__label .material-icons-outlined {
    font-size: 16px;
    color: var(--text-tertiary, #aeaeae);
}

.course-char-item__value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #383838);
}

/* ============================================================================
   STICKY SIDEBAR CARD
   ========================================================================= */

.course-layout__sidebar {
    position: sticky;
    top: 100px; /* below sticky header */
}

.course-sidebar-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.course-sidebar-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-primary, #383838);
}

/* Pricing */
.course-sidebar-card__pricing {
    margin-bottom: 20px;
}

.course-sidebar-card__discount {
    font-size: 14px;
    font-weight: 600;
    color: var(--success, #70bf00);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.course-sidebar-card__original {
    text-decoration: line-through;
    color: var(--text-secondary, #7a7a7a);
    font-weight: 400;
}

.course-sidebar-card__price {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #383838);
}

.course-sidebar-card__price span {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary, #7a7a7a);
}

/* CTA Buttons */
.course-sidebar-card__cta {
    margin-bottom: 12px;
    border-radius: 8px;
}

.course-sidebar-card__info {
    border-radius: 8px;
    border: 1.5px solid var(--secondary-brand, #008fdd);
    color: var(--secondary-brand, #008fdd);
    background: transparent;
    text-align: center;
    display: block;
    width: 100%;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.course-sidebar-card__info:hover {
    background: var(--secondary-brand, #008fdd);
    color: #ffffff;
}

/* btn-outline utility */
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--secondary-brand, #008fdd);
    color: var(--secondary-brand, #008fdd);
}

.btn-outline:hover {
    background: var(--secondary-brand, #008fdd);
    color: #ffffff;
}

/* ============================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1024px) {
    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-layout__sidebar {
        position: static;
        order: -1; /* move sidebar above content on mobile/tablet */
    }

    .course-sidebar-card {
        max-width: 480px;
    }
}

@media (max-width: 768px) {
    .course-hero--gallery {
        grid-template-columns: 1fr;
    }

    .course-hero__gallery {
        display: none; /* hide side images on mobile, just show main */
    }

    .course-hero--single .course-hero__main,
    .course-hero--gallery .course-hero__main {
        height: 300px;
        border-radius: 12px;
    }

    .course-hero__title {
        font-size: 26px;
    }

    .course-characteristics__bar {
        flex-direction: column;
        gap: 16px;
    }

    .course-char-item {
        border-right: none;
        border-bottom: 1px solid var(--border-color, #d9d9d9);
        padding-right: 0;
        margin-right: 0;
        padding-bottom: 16px;
        margin-bottom: 0;
    }

    .course-char-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .course-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
