/**
 * Topics Page Template (Recurring)
 * Hero uses topics-page-hero block styles; this file covers 50/50, top courses, legislation box, related grid.
 */

/* Hero breakout: same as topics-page-hero block */
.topics-page-template-main .topics-page-template-hero {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box;
}

/* Hero desktop: larger H1 (86px), reduce padding-bottom so height and stats bar position stay similar */
@media (min-width: 1024px) {
    .topics-page-template-main .topics-page-hero-title {
        font-size: 86px;
        padding-bottom: 12px;
    }

    .topics-page-template-main .topics-page-hero-content {
        padding-bottom: 100px;
    }
}

/* 50/50 two-column layout */
.topics-template-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .topics-template-two-col {
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
        align-items: start;
    }

    .topics-template-body-content {
        margin-top: 3.5rem;
    }
}

.topics-template-col {
    min-width: 0;
}

/* Left: Top courses */
.topics-template-top-courses-headline {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .topics-template-top-courses-headline {
        font-size: 2rem;
    }
}

.topics-template-featured-courses {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.topics-template-course-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.topics-template-course-card:hover {
    transform: scale(1.02);
}

.topics-template-course-card--large {
    width: 100%;
}

.topics-template-course-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.topics-template-course-thumb {
    background: #f3f4f6;
}

.topics-template-course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topics-template-course-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0.75rem 0 0 0;
    line-height: 1.3;
}

.topics-template-course-card--large .topics-template-course-title {
    font-size: 1.125rem;
    margin-top: 1rem;
}

/* Right: Body content */
.topics-template-description {
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 1.5rem;
}

.topics-template-description p:last-child {
    margin-bottom: 0;
}

.topics-template-legislation-box {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
}

.topics-template-legislation-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.topics-template-legislation-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    list-style: disc;
}

.topics-template-legislation-list li {
    margin-bottom: 0.25rem;
}

.topics-template-legislation-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .topics-template-description,
    .topics-template-description p {
        font-size: 16px;
    }

    .topics-template-legislation-heading {
        font-size: 0.9375rem;
    }

    .topics-template-legislation-list {
        font-size: 0.875rem;
    }
}

@media (max-width: 767px) {
    .topics-template-description,
    .topics-template-description p {
        font-size: 15px;
    }

    .topics-template-legislation-box {
        padding: 1rem 1.25rem;
    }

    .topics-template-legislation-heading {
        font-size: 0.875rem;
    }

    .topics-template-legislation-list {
        font-size: 0.8125rem;
    }
}

@media (max-width: 479px) {
    .topics-template-description,
    .topics-template-description p {
        font-size: 14px;
    }

    .topics-template-legislation-heading {
        font-size: 0.8125rem;
    }

    .topics-template-legislation-list {
        font-size: 0.75rem;
    }
}

/* Other courses in this topic: table (no vertical divisions between cols) */
.topics-template-courses-table-section .topics-template-top-courses-headline {
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .topics-template-courses-table-section .topics-template-top-courses-headline {
        margin-bottom: 2rem;
    }
}

.topics-template-courses-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(90deg, rgba(64, 184, 255, 0.10) 0%, rgba(171, 139, 255, 0.10) 100%);
    border-radius: 8px;
    padding: 30px;
    gap: 15px;
}

#topics-template-courses-table-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topics-template-courses-table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.topics-template-pagination-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.topics-template-pagination-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.topics-template-pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.topics-template-courses-table-header {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr 1fr;
    gap: 60px;
    padding: 0;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    transition: transform 0.3s ease;
}

.topics-template-courses-table-header .topics-template-ct-col,
.topics-template-ct-row .topics-template-ct-col {
    border-left: none;
    border-right: none;
}

/* Two thumbnails side by side in "Try our top courses" (unchanged) */
.topics-template-featured-course-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Table rows: white bg, 8px radius, 60px col gap, 15px row gap (via container gap) */
.topics-template-ct-row {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr 1fr;
    gap: 60px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border-left: none;
    border-right: none;
}

.topics-template-ct-row:hover {
    /* transform: scale(1.02);  */
    box-shadow: 0px 8px 32px 0px rgba(19, 81, 142, 0.12);
}

.topics-template-ct-row:hover .topics-template-ct-course-title {
    text-decoration: underline;
}

.topics-template-ct-row--empty {
    pointer-events: none;
    color: #6b7280;
}

.topics-template-ct-col {
    font-size: 0.9375rem;
    color: #64707D;
    line-height: 1.5;
}

.topics-template-ct-col--course {
    font-weight: 600;
    color: #111827;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Industries col: outer span is grid cell; inner pill wraps text only (like NEW tag) */
.topics-template-ct-industries-pill {
    display: inline-block;
    color: #7429E5;
    background-color: #F0E5FF;
    padding: 3px 9px;
    border-radius: 8px;
}

/* Jurisdiction pills: same style as industries, different colors; 0.5rem gap between items */
.topics-template-ct-jurisdiction-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.topics-template-ct-jurisdiction-pill {
    display: inline-block;
    color: #007DE2;
    background-color: #D4EFFF;
    padding: 3px 9px;
    border-radius: 8px;
}

.topics-template-ct-course-title {
    display: block;
}

/* Activity name • duration and Features column: 12px, 600, 15px line-height, #828F9B */
.topics-template-ct-course-meta,
.topics-template-ct-col--meta,
.topics-template-ct-col--meta .topics-template-feature-item {
    font-size: 12px;
    font-weight: 600;
    line-height: 15px;
    color: #828F9B;
}

.topics-template-ct-course-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.topics-template-ct-course-meta-new {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    background-color: #7429E5;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 15px;
    text-transform: uppercase;
}

.topics-template-feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.topics-template-feature-item .topics-template-feature-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-right: 4px;
    /* Tint icon to #B27FFF (img doesn't use color; use filter) */
    filter: invert(73%) sepia(49%) saturate(2500%) hue-rotate(228deg) brightness(1.05);
}

.topics-template-feature-item .topics-template-feature-icon:last-child {
    margin-right: 0;
}

.topics-template-feature-item .topics-template-feature-label {
    flex: 1;
}

.topics-template-feature-item:last-child {
    margin-bottom: 0;
}

.topics-template-feature-item--drama-scenarios {
    white-space: nowrap;
}

@media (max-width: 767px) {
    .topics-template-courses-table {
        overflow-x: auto;
        padding: 20px;
    }

    .topics-template-courses-table-header {
        display: none;
    }

    .topics-template-ct-row {
        padding: 0.75rem 1rem;
        gap: 15px;
        display: flex;
        flex-direction: column;
    }

    .topics-template-ct-industries-pill,
    .topics-template-ct-jurisdiction-pill {
        font-size: 12px;
    }

    .topics-template-ct-jurisdiction-wrap {
        gap: 10px;
    }
}

/* Hero on mobile: show right side of background image */
/* @media (max-width: 767px) {
    .topics-page-template-main .topics-page-hero-bg img {
        object-position: right center;
    }
} */

.topics-template-related-section .topic-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.topics-template-related-section .topic-card:hover {
    transform: scale(1.05);
}

.topics-template-related-section .topic-card .relative.aspect-\[16\/9\] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stats bar: bisects hero and body, full width up to max-w-content; ~2/3 overlaps hero on desktop */
@media (max-width: 575px) {
    .topics-template-stats-bar-wrap {
        padding-left: 0 !important;
        padding-right: 0 !important; 
    }
}

.topics-template-stats-bar-wrap {
    margin-top: -55px;
    position: relative;
    z-index: 15;
}

@media (min-width: 768px) {
    .topics-template-stats-bar-wrap {
        margin-top: -75px;
    }
}

@media (min-width: 1200px) {
    .topics-template-stats-bar-wrap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

.topics-template-stats-bar {
    display: grid;
    grid-template-columns: 4fr 6fr;
    align-items: center;
    gap: 1rem;
    border-radius: 16px;
    border: 1px solid #C6C8F3;
    background: #FFF;
    box-shadow: 0 -3px 13px 0 rgba(114, 152, 255, 0.38);
    padding: 24px 0;
}

.topics-template-stats-bar-blurb {
    min-width: 0;
    margin: 0;
    font-size: 16px;
    line-height: 140%;
    padding-left: 36px;
    padding-right: 24px;
}

@media (min-width: 1024px) {
    .topics-template-stats-bar-blurb {
        font-size: 20px;
    }
}

.topics-template-stats-bar-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    min-width: 0;
    padding-left: 36px;
    padding-right: 36px;
}

.topics-template-stats-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    height: 4rem;
    gap: 4px;
    padding-left: 36px;
    padding-right: 36px;
    border-left: 1px solid #BBC2C9;
}

/* .topics-template-stats-bar-item:first-child {
    padding-left: 0;
} */

.topics-template-stats-bar-num {
    font-weight: 700;
    line-height: 125%;
}

.topics-template-stats-bar-num--large {
    font-size: 24px;
}

.topics-template-stats-bar-num--small {
    font-size: 16px;
}

.topics-template-stats-bar-label {
    font-size: 12px;
    color: #828F9B;
    font-weight: 500;
    line-height: 125%;
    white-space: nowrap;
}

.topics-template-stats-bar-industries-num {
    cursor: pointer;
    text-decoration: none;
}

/* Tooltip for industries count (same pattern as jurisdiction in table) */
.topics-template-stats-bar .more-tooltip {
    position: relative;
}

.topics-template-stats-bar .more-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.topics-template-stats-bar .more-tooltip:hover::after {
    opacity: 1;
}

.topics-template-stats-bar-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 2px;
}

.topics-template-stats-bar-star--filled {
    color: #7C3AED;
}

.topics-template-stats-bar-star--outline {
    color: #C4B5FD;
}

.topics-template-stats-bar-star,
.topics-template-stats-bar-stars .topics-template-stats-bar-star,
.topics-template-stats-bar-stars svg {
    width: 12px;
    height: 12px;
}

/* Partial 5th star: fill from left by --star-fill (e.g. 70% for 4.7) */
.topics-template-stats-bar-star-partial {
    display: inline-block;
    position: relative;
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.topics-template-stats-bar-star-partial .topics-template-stats-bar-star--outline {
    display: block;
    position: relative;
    z-index: 0;
}

.topics-template-stats-bar-star-partial-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--star-fill, 0%);
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.topics-template-stats-bar-star-partial-fill .topics-template-stats-bar-star--filled {
    position: absolute;
    left: 0;
    top: 0;
}

/* At max content width (~1240px), add back left/right padding on the stats bar */
@media (min-width: 1240px) {
    .topics-template-stats-bar {
        padding: 24px 36px;
    }

    .topics-template-stats-bar-blurb {
        padding-left: 0;
        padding-right: 0;
    }

    .topics-template-stats-bar-stats {
        padding-left: 0;
        padding-right: 0;
    }
}

.topics-template-stats-bar-learners-icon {
    display: inline-flex;
    color: #0D9488;
    margin-bottom: 2px;
}

.topics-template-stats-bar-learners-icon svg {
    display: block;
}

/* Stats bar mobile: hide blurb, keep stats in a row, smaller; first item no border when blurb hidden */
@media (max-width: 767px) {
    .topics-template-stats-bar-blurb {
        display: none;
    }

    .topics-template-stats-bar {
        grid-template-columns: 1fr;
        padding: 12px 16px;
    }

    .topics-template-stats-bar-stats {
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .topics-template-stats-bar-item {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topics-template-stats-bar-item:first-child {
        border-left: none;
        padding-left: 0;
        padding-right: 16px;
    }

    .topics-template-stats-bar-num--large {
        font-size: 18px;
    }

    .topics-template-stats-bar-num--small {
        font-size: 14px;
    }

    .topics-template-stats-bar-label {
        font-size: 11px;
    }

    /* .topics-template-stats-bar-stars svg,
    .topics-template-stats-bar-star {
        width: 14px;
        height: 14px;
    }

    .topics-template-stats-bar-star-partial {
        width: 14px;
        height: 14px;
    } */

    .topics-template-stats-bar-learners-icon svg {
        width: 20px;
        height: 20px;
    }
}
