/**
 * TNF Category page — Learndirect-inspired layout
 */
body.tnf-category-page,
.tnf-category-page {
    --tnf-cat-navy: #1f2b40;
    --tnf-cat-blue: #003366;
    --tnf-cat-accent: #660afb;
    --tnf-cat-body: #4a5568;
    --tnf-cat-border: #e2e8f0;
    --tnf-cat-bg: #f8fafc;
    font-family: var(--fontFamily2, "Inter", sans-serif);
    color: var(--tnf-cat-body);
}

/* —— Hero —— */
.tnf-category-page .tnf-cat-hero {
    position: relative;
    min-height: clamp(20rem, 38vw, 26rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.tnf-category-page .tnf-cat-hero__bg {
    position: absolute;
    inset: 0;
    background-color: #0a4d68;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1.02);
}

.tnf-category-page .tnf-cat-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0, 119, 153, 0.62) 0%,
        rgba(0, 90, 130, 0.68) 50%,
        rgba(0, 70, 110, 0.72) 100%
    );
}

.tnf-category-page .tnf-cat-hero > .container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(16rem, 32vw, 22rem);
    padding: clamp(3rem, 6vw, 4.5rem) 1rem;
}

.tnf-category-page .tnf-cat-hero__content {
    max-width: 52rem;
    margin: 0 auto;
    text-align: center;
}

.tnf-category-page .tnf-cat-hero__content h1 {
    font-family: var(--fontFamily1, "Plus Jakarta Sans", sans-serif);
    font-size: clamp(1.625rem, 3.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    margin: 0 0 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.45);
}

.tnf-category-page .tnf-cat-hero__subtitle {
    font-size: clamp(0.9375rem, 1.4vw, 1.125rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 auto;
    max-width: 40rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.35);
}

.tnf-category-page .tnf-cat-hero__bar {
    position: relative;
    z-index: 2;
    background: #003d5c;
    padding: 0.875rem 0;
    margin-top: auto;
}

.tnf-category-page .tnf-cat-hero__bar p {
    margin: 0;
    text-align: center;
    color: #fff;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 600;
}

.tnf-category-page .tnf-cat-hero__bar strong {
    color: #7dd3fc;
    font-weight: 700;
}

/* —— Intro —— */
.tnf-category-page .tnf-cat-intro {
    padding: clamp(2rem, 4vw, 3rem) 0;
    background: #fff;
    border-bottom: 1px solid var(--tnf-cat-border);
}

.tnf-category-page .tnf-cat-intro__text {
    max-width: 56rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--tnf-cat-body);
}

.tnf-category-page .tnf-cat-intro__text p:last-child {
    margin-bottom: 0;
}

/* —— Course grid —— */
.tnf-category-page .tnf-cat-courses {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    background: var(--tnf-cat-bg);
}

.tnf-category-page .tnf-cat-grid__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tnf-category-page .tnf-cat-grid__count {
    margin: 0;
    font-weight: 600;
    color: var(--tnf-cat-navy);
}

.tnf-category-page .tnf-cat-grid__select {
    min-width: 10rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--tnf-cat-border);
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
    color: var(--tnf-cat-navy);
}

/* —— Course card —— */
.tnf-category-page .tnf-cat-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--tnf-cat-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(31, 43, 64, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tnf-category-page .tnf-cat-card:hover {
    box-shadow: 0 12px 32px rgba(31, 43, 64, 0.1);
    transform: translateY(-2px);
}

.tnf-category-page .tnf-cat-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e2e8f0;
}

.tnf-category-page .tnf-cat-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.tnf-category-page .tnf-cat-card:hover .tnf-cat-card__media img {
    transform: scale(1.03);
}

.tnf-category-page .tnf-cat-card__sale {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.35rem 0.75rem;
    background: var(--tnf-cat-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%);
}

.tnf-category-page .tnf-cat-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem 1.25rem 1rem;
}

.tnf-category-page .tnf-cat-card__title {
    font-family: var(--fontFamily1, "Plus Jakarta Sans", sans-serif);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.75rem;
}

.tnf-category-page .tnf-cat-card__title a {
    color: var(--tnf-cat-navy);
    text-decoration: none;
}

.tnf-category-page .tnf-cat-card__title a:hover {
    color: var(--tnf-cat-accent);
}

.tnf-category-page .tnf-cat-card__desc {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--tnf-cat-body);
    margin: 0 0 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tnf-category-page .tnf-cat-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tnf-cat-border);
    margin-top: auto;
}

.tnf-category-page .tnf-cat-card__btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--tnf-cat-navy);
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.tnf-category-page .tnf-cat-card__btn:hover {
    background: var(--tnf-cat-accent);
    color: #fff !important;
}

.tnf-category-page .tnf-cat-card__price {
    text-align: right;
}

.tnf-category-page .tnf-cat-card__price-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.tnf-category-page .tnf-cat-card__price-value {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--tnf-cat-navy);
}

/* —— Pagination —— */
.tnf-category-page .tnf-cat-pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.tnf-category-page .tnf-cat-pagination .pagination {
    gap: 0.25rem;
    margin: 0;
}

.tnf-category-page .tnf-cat-pagination .page-link {
    color: var(--tnf-cat-navy);
    border-color: var(--tnf-cat-border);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.tnf-category-page .tnf-cat-pagination .page-item.active .page-link {
    background: var(--tnf-cat-navy);
    border-color: var(--tnf-cat-navy);
}

/* —— FAQ —— */
.tnf-category-page .tnf-cat-faq {
    padding: clamp(3rem, 6vw, 5rem) 0;
    background: #fff;
}

.tnf-category-page .tnf-cat-faq__title {
    font-family: var(--fontFamily1, "Plus Jakarta Sans", sans-serif);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--tnf-cat-navy);
    margin-bottom: 2rem;
    text-align: center;
}

.tnf-category-page .tnf-cat-faq__list {
    max-width: 48rem;
    margin: 0 auto;
}

.tnf-category-page .tnf-cat-faq__item {
    border-bottom: 1px solid var(--tnf-cat-border);
}

.tnf-category-page .tnf-cat-faq__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 0;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--fontFamily1, "Plus Jakarta Sans", sans-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tnf-cat-navy);
    cursor: pointer;
}

.tnf-category-page .tnf-cat-faq__question::after {
    content: "+";
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--tnf-cat-accent);
    transition: transform 0.2s ease;
}

.tnf-category-page .tnf-cat-faq__question[aria-expanded="true"]::after {
    content: "−";
}

.tnf-category-page .tnf-cat-faq__answer {
    padding: 0 0 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--tnf-cat-body);
}

.tnf-category-page .tnf-cat-faq__answer p:last-child {
    margin-bottom: 0;
}

/* —— Partners —— */
.tnf-category-page .tnf-cat-partners {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    background: #fff;
    border-top: 1px solid var(--tnf-cat-border);
}

@media (max-width: 767.98px) {
    .tnf-category-page .tnf-cat-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .tnf-category-page .tnf-cat-card__price {
        text-align: left;
    }
}
