/* ============================================
   TRAINING & CEP PAGES - Distinct Professional Designs
   Each page has its own visual identity
   ============================================ */

/* ============================================
   TRAINING PAGE - Blue/Indigo Theme
   Certification, Learning, Academic
   ============================================ */
body.training-page {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%, #f8fafc 100%);
    background-size: 400% 400%;
    animation: trainingBgFlow 25s ease infinite;
    overflow-x: hidden;
}

@keyframes trainingBgFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Training Hero - Navy/Blue */
body.training-page .training-hero {
    background: linear-gradient(155deg, #0f172a 0%, #1e293b 40%, #1e3a5f 70%, #0f172a 100%);
}

body.training-page .training-hero::before {
    background: linear-gradient(90deg, 
        transparent 0%, #3b82f6 20%, #60a5fa 50%, #3b82f6 80%, transparent 100%);
}

body.training-page .training-hero::after {
    background: radial-gradient(
        ellipse 80% 60% at 50% 0%,
        rgba(59, 130, 246, 0.12) 0%,
        rgba(59, 130, 246, 0.03) 40%,
        transparent 70%
    );
}

body.training-page .training-hero .training-hero-content::before {
    background-image: 
        linear-gradient(rgba(96, 165, 250, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.04) 1px, transparent 1px);
}

body.training-page .training-hero-accent {
    color: #60a5fa;
}

body.training-page .training-hero-accent::after {
    background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

body.training-page .training-hero-badge {
    border-color: rgba(96, 165, 250, 0.3);
}

/* Training Cards - Certification style: horizontal, formal, ribbon accent */
body.training-page .training-list::before {
    background: repeating-linear-gradient(45deg, transparent, transparent 100px, rgba(59, 130, 246, 0.03) 100px, rgba(59, 130, 246, 0.03) 200px);
}

body.training-page .course {
    border-left-color: #3b82f6;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-left-width: 5px;
}

body.training-page .course::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #60a5fa);
    z-index: 1;
}

body.training-page .course:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(0,0,0,0.08);
}

body.training-page .course:nth-child(even) {
    border-right-color: #3b82f6;
    border-left-width: 1px;
    border-right-width: 5px;
}

body.training-page .course:nth-child(even)::before {
    left: 0;
    right: 0;
}

body.training-page .course-left img {
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

body.training-page .vertical-line {
    background: linear-gradient(180deg, #3b82f6, #93c5fd);
}

body.training-page .course-right h2 {
    color: #1e40af;
    padding-left: 12px;
    border-left: 3px solid #3b82f6;
}

body.training-page .course-right a[href*="Brochure"],
body.training-page .course-right a[style*="color: #1c244b"] {
    color: #1e40af !important;
}

body.training-page .course-right a[href*="Brochure"]:hover,
body.training-page .course-right a[style*="color: #1c244b"]:hover {
    color: #1d4ed8 !important;
}

body.training-page #read-more-btn,
body.training-page #read-more-btn-2 {
    color: #1e40af !important;
}

body.training-page #read-more-btn:hover,
body.training-page #read-more-btn-2:hover {
    color: #1d4ed8 !important;
}

body.training-page .btn.clr {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

body.training-page .btn.clr:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

body.training-page .btn.btn-dark-blue {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.training-page .btn.btn-dark-blue:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

/* ============================================
   CEP PAGE - Teal/Emerald Theme
   Growth, Continuing Education, Development
   ============================================ */
body.cep-page {
    background: linear-gradient(135deg, #fef7f6 0%, #fef2f0 25%, #fce7e5 50%, #fef2f0 75%, #fef7f6 100%);
    background-size: 400% 400%;
    animation: cepBgFlow 22s ease infinite;
    overflow-x: hidden;
}

@keyframes cepBgFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* CEP Hero - Dark Red/Burgundy */
body.cep-page .training-hero {
    background: linear-gradient(155deg, #1a1514 0%, #2c1f1e 30%, #3d2522 60%, #1a1514 100%);
}

body.cep-page .training-hero::before {
    background: linear-gradient(90deg, 
        transparent 0%, var(--brand-primary) 20%, var(--brand-light) 50%, var(--brand-primary) 80%, transparent 100%);
}

body.cep-page .training-hero::after {
    background: radial-gradient(
        ellipse 80% 60% at 50% 0%,
        rgba(180, 74, 63, 0.15) 0%,
        rgba(180, 74, 63, 0.04) 40%,
        transparent 70%
    );
}

body.cep-page .training-hero .training-hero-content::before {
    background-image: 
        linear-gradient(rgba(180, 74, 63, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(180, 74, 63, 0.05) 1px, transparent 1px);
}

body.cep-page .training-hero-accent {
    color: var(--brand-light);
}

body.cep-page .training-hero-accent::after {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-light));
}

body.cep-page .training-hero-badge {
    border-color: rgba(214, 90, 79, 0.35);
}

/* CEP Cards - Workshop style: vertical layout, image banner on top, soft rounded */
body.cep-page .training-list::before {
    background: repeating-linear-gradient(-30deg, transparent, transparent 100px, rgba(180, 74, 63, 0.04) 100px, rgba(180, 74, 63, 0.04) 200px);
}

body.cep-page .course {
    flex-direction: column;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(139, 58, 50, 0.08), 0 0 0 1px rgba(180, 74, 63, 0.08);
}

body.cep-page .course:hover {
    box-shadow: 0 20px 50px rgba(180, 74, 63, 0.15), 0 0 0 1px rgba(180, 74, 63, 0.12);
}

body.cep-page .course:nth-child(even) {
    flex-direction: column;
}

/* CEP: Image as full-width banner on top */
body.cep-page .course-left {
    flex: none;
    max-width: 100%;
    width: 100%;
    min-height: 220px;
    aspect-ratio: 21/9;
}

body.cep-page .course-left img {
    border-radius: 0;
}

body.cep-page .course:hover .course-left img {
    transform: scale(1.03);
}

/* CEP: Horizontal divider instead of vertical line */
body.cep-page .vertical-line {
    width: 100%;
    height: 4px;
    min-height: 4px;
    background: linear-gradient(90deg, transparent, var(--brand-primary), var(--brand-light), transparent);
}

/* CEP: Content area with soft red top border */
body.cep-page .course-right {
    position: relative;
}

body.cep-page .course-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(180, 74, 63, 0.3), transparent);
}

body.cep-page .course-right h2 {
    color: var(--brand-dark);
    border-left: none;
    padding-left: 0;
}


body.cep-page .course-right a[href*="Brochure"],
body.cep-page .course-right a[style*="color: #1c244b"] {
    color: var(--brand-primary) !important;
}

body.cep-page .course-right a[href*="Brochure"]:hover,
body.cep-page .course-right a[style*="color: #1c244b"]:hover {
    color: var(--brand-dark) !important;
}

body.cep-page #read-more-btn,
body.cep-page #read-more-btn-2 {
    color: var(--brand-primary) !important;
}

body.cep-page #read-more-btn:hover,
body.cep-page #read-more-btn-2:hover {
    color: var(--brand-dark) !important;
}

body.cep-page .btn.clr {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
}

body.cep-page .btn.clr:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary));
}

body.cep-page .btn.btn-dark-blue {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

body.cep-page .btn.btn-dark-blue:hover {
    background: linear-gradient(135deg, #3d3d3d 0%, #2c2c2c 100%);
}

/* ============================================
   SHARED - Hero & Card Structure
   ============================================ */
.training-hero {
    padding: 120px 24px 100px;
    position: relative;
    overflow: hidden;
}

.training-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1;
}

.training-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.training-hero .training-hero-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background-size: 48px 48px;
    pointer-events: none;
    z-index: -1;
}

.training-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    animation: trainingHeroFadeIn 0.8s ease-out forwards;
}

@keyframes trainingHeroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.training-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 6px;
    margin-bottom: 28px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.training-hero-content h1 {
    font-size: clamp(42px, 6.5vw, 60px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.training-hero-accent {
    position: relative;
    display: inline-block;
}

.training-hero-accent::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px;
    opacity: 0.7;
}

.training-hero-subtitle {
    font-size: clamp(17px, 2.2vw, 20px);
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.75;
    font-weight: 400;
}

/* Jump to course */
.course-jump-nav {
    position: sticky;
    top: 88px;
    z-index: 40;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 24px 0;
    box-sizing: border-box;
}

.course-jump-nav--single {
    position: relative;
    top: auto;
    justify-content: flex-end;
    padding: 0 0 20px;
    margin: 0 0 8px;
    max-width: none;
}

.course-jump-nav__picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    min-width: 0;
}

.course-jump-nav--single .course-jump-nav__picker {
    margin-left: auto;
}

.course-jump-nav__label {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1c244b;
    white-space: nowrap;
}

.course-jump-nav__select {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 520px;
    appearance: none;
    -webkit-appearance: none;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1c244b;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231c244b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    border: 1px solid rgba(28, 36, 75, 0.22);
    border-radius: 8px;
    padding: 12px 40px 12px 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.course-jump-nav--single .course-jump-nav__select {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 360px;
}

.course-jump-nav__select:hover,
.course-jump-nav__select:focus {
    outline: none;
    border-color: rgba(28, 36, 75, 0.45);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

body.training-page .course-jump-nav__select:focus {
    border-color: #3b82f6;
}

body.cep-page .course-jump-nav__select:focus {
    border-color: #b45309;
}

.training-back-link {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1c244b;
    text-decoration: none;
    white-space: nowrap;
}

.training-back-link:hover {
    color: brown;
    text-decoration: underline;
}

/* Training List */
.training-list {
    padding: 80px 24px 100px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
}

.training-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.course {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 60px;
    scroll-margin-top: 140px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    /* Clip media/corners only; text must not be clipped — inner content uses min-width:0 + overflow-wrap */
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border: 2px solid transparent;
    border-left: 4px solid;
    position: relative;
    z-index: 1;
}

/* Legacy class from older jump-filter JS — never hide courses */
.course.is-filtered-out {
    display: flex;
}

.course:hover {
    transform: translateY(-6px);
}

.course:nth-child(even) {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 4px solid;
}

.course-left {
    flex: 0 0 38%;
    max-width: 38%;
    min-width: 0;
    min-height: 320px;
    overflow: hidden;
}

.course-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.course:hover .course-left img {
    transform: scale(1.05);
}

.vertical-line {
    width: 4px;
    min-height: 100%;
    flex-shrink: 0;
}

.course:nth-child(even) .vertical-line {
    order: -1;
}

.course-right {
    flex: 1;
    min-width: 0;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.course-right h1 {
    font-size: clamp(22px, 2.8vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.course-right h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-right p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.course-right ul {
    margin: 8px 0 16px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.course-right ul li {
    margin-bottom: 6px;
}

.course-right a[href*="Brochure"],
.course-right a[style*="color: #1c244b"] {
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.course-right a[href*="Brochure"]:hover,
.course-right a[style*="color: #1c244b"]:hover {
    text-decoration: underline;
}

#read-more-btn,
#read-more-btn-2 {
    font-weight: 600;
    transition: color 0.2s ease;
}

/* Buttons */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Register Now venue dropdown (CEP course pages) */
.btn-group--register {
    justify-content: flex-start;
    align-items: center;
}
.btn-group--register .register-dropdown {
    position: relative;
    display: inline-block;
    width: auto;
    max-width: 100%;
}
.btn-group--register .register-dropdown-toggle {
    width: auto !important;
    max-width: 100%;
}
.register-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.register-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    z-index: 300;
    width: max-content;
    min-width: 100%;
    max-width: min(280px, calc(100vw - 24px));
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.register-dropdown.is-open .register-dropdown-menu {
    display: block;
}
.register-dropdown-menu li {
    margin: 0;
    padding: 0;
}
.register-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #1c244b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.register-dropdown-item:hover {
    background: #f0f4ff;
}
body.cep-page .course:has(.register-dropdown.is-open) {
    overflow: visible;
    z-index: 100;
    transform: none !important;
}
body.cep-page .course:has(.register-dropdown.is-open):hover {
    transform: none !important;
}
body.cep-page .course-right:has(.register-dropdown.is-open) {
    overflow: visible;
}
body.cep-page .training-list:has(.register-dropdown.is-open) {
    overflow: visible;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.btn.clr {
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn.clr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn.btn-dark-blue {
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.btn.btn-dark-blue:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    /* Training: switch to column, keep ribbon */
    body.training-page .course,
    body.training-page .course:nth-child(even) {
        flex-direction: column;
        border-left: 5px solid #3b82f6 !important;
        border-right: none !important;
    }

    body.training-page .course-left {
        flex: none;
        max-width: 100%;
        min-height: 280px;
        aspect-ratio: 16/10;
    }

    body.training-page .course-left img {
        border-radius: 8px 8px 0 0;
    }

    body.training-page .vertical-line {
        width: 100%;
        height: 4px;
        min-height: 4px;
        background: linear-gradient(90deg, #3b82f6, #93c5fd);
    }

    /* CEP: already column, adjust image height */
    body.cep-page .course-left {
        min-height: 200px;
        aspect-ratio: 21/8;
    }

    body.cep-page .vertical-line {
        width: 100%;
        height: 4px;
        min-height: 4px;
        background: linear-gradient(90deg, transparent, var(--brand-primary), var(--brand-light), transparent);
    }

    .course-right {
        padding: 32px 28px;
    }

    /* Stack action buttons full-width once course cards are single column (avoids clipped buttons on narrow tablets) */
    .btn-group:not(.btn-group--register) {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group:not(.btn-group--register) .btn {
        width: 100%;
        max-width: 100%;
    }

    .btn-group--register {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .training-hero {
        padding: 100px 20px 80px;
    }

    .course-jump-nav {
        top: 72px;
        padding: 14px 16px 0;
        gap: 8px;
    }

    .course-jump-nav--single {
        top: auto;
        padding: 0 0 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .course-jump-nav__picker {
        margin-left: 0;
        width: 100%;
    }

    .course-jump-nav__select,
    .course-jump-nav--single .course-jump-nav__select {
        max-width: none;
        width: 100%;
        font-size: 14px;
        padding: 11px 36px 11px 12px;
    }

    .training-list {
        padding: 50px 16px 80px;
        overflow-x: hidden;
    }

    .course {
        margin-bottom: 40px;
    }

    .course-right {
        padding: 28px 20px;
    }

    .course-right h1 {
        font-size: 20px;
    }

    .course-right p,
    .course-right ul {
        font-size: 14px;
    }

    .btn-group:not(.btn-group--register) {
        flex-direction: column;
        margin-top: 20px;
        width: 100%;
    }

    .btn-group:not(.btn-group--register) .btn {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .btn-group--register {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .course-left {
        min-height: 220px;
    }
}
