/* ==========================================================================
   TRAININGS GRID & FILTERS SECTION
   ========================================================================== */
.trainings-hero {
    & h1 {
        font-size: 2.5em;
        max-width: 800px;
        text-align: center;
        margin: 0 auto;
    }
}

.sahco-trainings-wrapper {
    width: 100%;
}

/* Filters & Search Header Bar (Triple Nested: Light Grey, White, Dark Grey) */
.sahco-trainings-filters-outer {
    background: #eaeaea;
    border-radius: 42px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.sahco-trainings-filters-inner {
    background: #ffffff;
    border-radius: 32px;
    padding: 1rem;
    width: 100%;
}

.sahco-trainings-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
    gap: 1.5rem;
    background: transparent;
    padding: 0.5rem;
    width: 100%;
}

.sahco-filters-left {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
}

@media (max-width: 1024px) {
    .sahco-trainings-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sahco-filters-left {
        grid-template-columns: 1fr;
    }
}

.sahco-filter-group {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: none;
    color: var(--e-global-color-primary, #111827);
}

.sahco-filter-group label {
    font-family: 'GillSansC', "Gill Sans", sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: -0.0156em;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
    color: var(--e-global-color-primary, #111827);
}

.sahco-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.sahco-input-wrapper input,
.sahco-input-wrapper select {
    width: 100%;
    border: none;
    background: #f3f4f6;
    padding: 12px 35px 12px 20px;
    font-family: "Gill Sans", sans-serif;
    font-size: 16px;
    color: #111827;
    outline: none;
    border-radius: 18px;
    cursor: pointer;
    min-height: 54px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: box-shadow 0.3s;
    letter-spacing: -0.035em;
}

.sahco-input-wrapper input:focus,
.sahco-input-wrapper select:focus {
    box-shadow: 0 0 0 2px var(--e-global-color-accent, #00C7C0);
}

.sahco-input-wrapper .search-icon,
.sahco-input-wrapper .select-icon {
    position: absolute;
    right: 15px;
    pointer-events: none;
    color: #6b7280;
}

/* Next Course Highlight Panel */
.sahco-next-course-highlight {
    background: #686868;
    color: #ffffff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    min-width: 320px;
    flex-shrink: 0;
    border-radius: 24px;
    border-left: none;
    gap: 1.5rem;
}

.sahco-next-course-highlight .highlight-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.sahco-next-course-highlight .highlight-image {
    width: 100%;
    max-width: 200px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    align-self: center;
}

.sahco-next-course-highlight .highlight-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.sahco-next-course-highlight .highlight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sahco-next-course-highlight .highlight-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.sahco-next-course-highlight .highlight-label {
    font-family: "Gill Sans", sans-serif;
    font-size: 0.7em;
    font-weight: 500;
    letter-spacing: -0.0156em;
    margin-bottom: 0.25rem;
}

.sahco-next-course-highlight .highlight-title {
    font-family: "Gill Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    letter-spacing: -0.0326em;
    color: #ffffff;
    max-width: fit-content;
}

.sahco-next-course-highlight .highlight-meta-row {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.sahco-next-course-highlight .meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: "Gill Sans", sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
}

span.meta-item.location-meta {
    display: none;
}

.sahco-next-course-highlight .meta-icon {
    flex-shrink: 0;
}

.sahco-next-course-highlight .highlight-date-box {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sahco-next-course-highlight .expected-label {
    font-family: "Gill Sans", sans-serif;
    font-size: 0.7em;
    font-weight: 500;
    letter-spacing: -0.0156em;
}

.sahco-next-course-highlight .expected-date {
    font-family: "Gill Sans", sans-serif;
    font-weight: 400;
    letter-spacing: -0.035em;
}

/* Trainings Grid */
.sahco-trainings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Card Styling */
.sahco-training-card {
    position: relative;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border-radius: 24px;
    overflow: hidden;
    opacity: 0;
}

/* Badges Row (Status & Date) */
.card-badges-row {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.125rem;
    margin-bottom: 0.25rem;
    max-width: fit-content;
    place-items: start;
}

.card-status-badge,
.card-date-badge {
    display: inline-flex;
    align-items: center;
    place-content: center;
    background: transparent;
    color: #686868;
    padding: 0;
    font-family: "Gill Sans", sans-serif;
    font-size: 0.75rem;
    border-radius: 100vmax;
    text-transform: uppercase;
    letter-spacing: -0.0156em;
}

.card-status-badge {
    font-weight: 600;
}

.card-status-badge .status-icon {
    margin-right: 0.35rem;
    flex-shrink: 0;
}

.card-date-badge {
    font-weight: 400;
}

/* Specific status colors (only text color, no background) */
.card-status-badge.status-open {
    color: var(--e-global-color-accent, #00C7C0);
}

.card-status-badge.status-full {
    color: #991b1b;
}

.card-status-badge.status-completed {
    color: #166534;
}

/* Card Content Area */
.sahco-training-card .card-body {
    padding: 1.5rem;
    /* Space below date banner */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Card Metadata (Location & Duration) */
.sahco-training-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
    font-family: 'GillSansC', "Gill Sans", sans-serif;
}

.sahco-training-card .card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sahco-training-card .meta-location {
    display: none !important;
}

.sahco-training-card .card-meta svg {
    color: #9ca3af;
}

.sahco-training-card .card-title {
    font-family: "Gill Sans", sans-serif;
    font-size: 1.25em;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3.9em;
    letter-spacing: -0.0326em;
}

.sahco-training-card .card-title a {
    color: var(--e-global-color-primary, #111827);
    text-decoration: none;
    transition: color 0.2s;
}





.sahco-training-card .card-excerpt {
    font-family: 'GillSansLightC', "Gill Sans Light", sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #4b5563;
    flex-grow: 1;
    letter-spacing: -0.035em;
    text-wrap: initial;
}

/* Tags List */
.sahco-training-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.sahco-training-card .tag-pill {
    font-family: 'GillSansC', "Gill Sans", sans-serif;
    font-size: 0.75rem;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 0.25rem 0.6rem;
    border-radius: 100vmax;
    text-transform: uppercase;
}

/* Card Image Area */
.sahco-training-card .card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    margin-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.sahco-training-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-button-wrapper {
    display: flex;
}

.sahco-training-card .card-button-wrapper .elementor-button {
    font-size: 0.75em;
}

/* Responsiveness */
@media (max-width: 991px) {
    .sahco-trainings-filters {
        flex-direction: column;
    }

    .sahco-filter-group {
        border-right: none;
        border-bottom: 1px solid #eef2f6;
    }

    .sahco-next-course-highlight {
        border-left: none;
        min-width: 100%;
    }
}

/* No Results Message */
.sahco-no-results {
    width: 100%;
    text-align: center;
    border-radius: 24px;
}

.sahco-no-results p {
    font-family: "Gill Sans", sans-serif;
    font-size: 1.15rem;
    color: #6b7280;
    margin: 0;
}

/* Results Count */
.sahco-results-count {
    margin-top: 1rem;
    margin-bottom: 2rem;
    font-family: 'GillSansC', "Gill Sans", sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
    letter-spacing: -0.0156em;
}


/* Pagination Controls */
.sahco-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    width: 100%;
}

/* Fix pagination layout and arrows direction in Arabic / RTL */
html[lang^="ar"] .sahco-pagination,
body.rtl .sahco-pagination,
html[dir="rtl"] .sahco-pagination {
    direction: ltr !important;
    flex-direction: row !important;
}

html[lang^="ar"] .sahco-pagination button svg,
body.rtl .sahco-pagination button svg,
html[dir="rtl"] .sahco-pagination button svg {
    transform: none !important;
}

html[lang^="ar"] .sahco-pagination .sahco-pagination-pages,
body.rtl .sahco-pagination .sahco-pagination-pages,
html[dir="rtl"] .sahco-pagination .sahco-pagination-pages {
    direction: ltr !important;
    flex-direction: row !important;
}

.sahco-pagination .sahco-pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sahco-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    padding: 0;
    font-family: "Gill Sans", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
}

.sahco-pagination button:hover:not(:disabled):not(.active) {
    background: #e5e7eb;
    color: #111827;
}

.sahco-pagination button.active {
    background: #686868;
    color: #ffffff;
    cursor: default;
}

.sahco-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sahco-pagination svg {
    pointer-events: none;
}

.sahco-pagination .sahco-pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
    min-height: 44px;
    min-width: 24px;
    user-select: none;
}