/* Academy courses page — search band, editorial course rows, calendar aside */

.th-ac {
    --ac-primary: #9c0a0d;
    --ac-primary-dark: #7d070b;
    --ac-ink: #141a26;
    --ac-text: #18233b;
    --ac-muted: #6b7280;
    --ac-border: #ece9e4;
    --ac-bg: #f7f5f2;
    padding-bottom: 90px;
}

/* Search band */
.th-ac-search-wrap {
    position: relative;
    z-index: 3;
    margin-top: -46px;
}

.th-ac-search {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.85fr) auto;
    align-items: stretch;
    padding: 10px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.14);
}

.th-ac-search__field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 12px 20px;
    border-inline-end: 1px solid #efedea;
}

.th-ac-search__field label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0aa;
}

.th-ac-search__field input,
.th-ac-search__field select {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ac-text);
    font-size: 15px;
    line-height: 1.4;
    outline: none;
}

.th-ac-search__field input::placeholder {
    color: #b3b8c1;
}

.th-ac-search__field select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%239c0a0d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding-inline-end: 18px;
}

[dir="rtl"] .th-ac-search__field select {
    background-position: left 2px center;
}

.th-ac-search__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px;
    padding: 0 30px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #b3131a, var(--ac-primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.25s ease;
}

.th-ac-search__submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.th-ac-search__reset {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: var(--ac-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.th-ac-search__reset:hover {
    color: var(--ac-primary-dark);
    text-decoration: none;
}

/* Layout */
.th-ac-main {
    padding-top: 54px;
}

.th-ac-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 40px;
    align-items: start;
}

/* Results header */
.th-ac-results__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.th-ac-results__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--ac-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.th-ac-results__title {
    margin: 0;
    color: var(--ac-ink);
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 700;
    line-height: 1.2;
}

.th-ac-results__count {
    margin: 0;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--ac-bg);
    color: var(--ac-muted);
    font-size: 14px;
    white-space: nowrap;
}

.th-ac-results__count strong {
    color: var(--ac-ink);
    font-weight: 700;
}

/* Course rows */
.th-ac-card {
    display: flex;
    margin-bottom: 22px;
    border: 1px solid var(--ac-border);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.th-ac-card:hover {
    border-color: #f0d9db;
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
    transform: translateY(-3px);
}

.th-ac-card__media {
    position: relative;
    flex: 0 0 340px;
    height: 280px;
    background: #f4f2ef;
    overflow: hidden;
}

.th-ac-card__media > a {
    position: absolute;
    inset: 0;
    display: block;
}

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

.th-ac-card:hover .th-ac-card__media img {
    transform: scale(1.04);
}

.th-ac-card__type {
    align-self: flex-start;
    padding: 6px 13px;
    border-radius: 999px;
    background: #fcf4f5;
    color: var(--ac-primary);
    font-size: 12px;
    font-weight: 700;
}

.th-ac-card__date {
    position: absolute;
    inset-block-end: 16px;
    inset-inline-start: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 8px;
    background: var(--ac-primary);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.th-ac-card__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-width: 0;
    padding: 28px 30px;
}

.th-ac-card__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.th-ac-card__title a {
    color: var(--ac-ink);
    text-decoration: none;
}

.th-ac-card__title a:hover {
    color: var(--ac-primary);
}

.th-ac-card__desc {
    margin: 0;
    color: var(--ac-muted);
    font-size: 15px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.th-ac-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1efec;
}

.th-ac-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ac-primary);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: gap 0.25s ease, color 0.25s ease;
}

.th-ac-card__cta:hover {
    gap: 12px;
    color: var(--ac-primary-dark);
    text-decoration: none;
}

.th-ac-card__org {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ac-muted);
    font-size: 13.5px;
}

.th-ac-card__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b3131a, var(--ac-primary-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* Calendar aside */
.th-ac-aside {
    position: sticky;
    top: 120px;
}

.th-ac-cal {
    border: 1px solid var(--ac-border);
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.06);
}

.th-ac-cal__head {
    padding: 22px 24px 20px;
    background: linear-gradient(150deg, #1b2438 0%, #141a26 100%);
}

.th-ac-cal__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.th-ac-cal__month {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.th-ac-cal__body {
    padding: 14px 16px 4px;
}

.th-ac-cal__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 14px 16px 18px;
    padding: 13px 16px;
    border-radius: 12px;
    background: #fcf4f5;
    color: var(--ac-primary);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}

.th-ac-cal__cta:hover {
    background: var(--ac-primary);
    color: #fff;
    text-decoration: none;
}

/* FullCalendar overrides */
.th-ac-cal .fc-toolbar.fc-header-toolbar {
    display: none;
}

.th-ac-cal .fc-scroller.fc-day-grid-container {
    overflow: visible !important;
    height: auto !important;
}

.th-ac-cal .fc-day-header {
    padding: 8px 0 !important;
    border: 0;
    background: transparent;
    color: #9aa0aa;
    font-size: 11px;
    font-weight: 600;
}

.th-ac-cal .fc-basic-view .fc-body .fc-row {
    height: 38px;
    min-height: 0;
    border-color: #f3f1ee;
}

.th-ac-cal .fc-unthemed td,
.th-ac-cal .fc-unthemed th {
    border-color: #f3f1ee;
}

.th-ac-cal .fc-basic-view .fc-day-top .fc-day-number {
    float: none;
    display: block;
    padding: 5px 0 0;
    text-align: center;
    color: #3c4250;
    font-size: 12px;
}

.th-ac-cal .fc-unthemed td.fc-today {
    background: var(--ac-primary);
}

.th-ac-cal .fc-unthemed td.fc-today .fc-day-number {
    color: #fff;
    font-weight: 700;
}

.th-ac-cal .fc-day:hover {
    background: #faf8f5;
}

.th-ac-cal .fc-unthemed td.fc-today:hover {
    background: var(--ac-primary);
}

.th-ac-cal .fc-day-grid-event {
    width: 7px;
    height: 7px;
    margin: 1px auto 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ac-primary);
}

.th-ac-cal .fc-event-container {
    position: static;
}

.th-ac-cal .fc-content-skeleton tbody tr:nth-child(n) .fc-day-grid-event {
    position: static;
}

/* Empty state */
.th-ac-empty {
    padding: 64px 28px;
    border: 1px dashed #ddd7cf;
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.th-ac-empty i {
    display: block;
    margin-bottom: 16px;
    color: #d9b3b6;
    font-size: 38px;
}

.th-ac-empty h3 {
    margin: 0 0 8px;
    color: var(--ac-ink);
    font-size: 20px;
    font-weight: 700;
}

.th-ac-empty p {
    margin: 0;
    color: var(--ac-muted);
    font-size: 14.5px;
}

.th-ac-empty__reset {
    display: inline-block;
    margin-top: 18px;
    padding: 11px 24px;
    border-radius: 999px;
    background: var(--ac-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.th-ac-empty__reset:hover {
    background: var(--ac-primary-dark);
    color: #fff;
    text-decoration: none;
}

/* Pagination */
.th-ac-pagination {
    display: flex;
    justify-content: center;
    margin-top: 38px;
}

.th-ac-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.th-ac-pagination .page-link {
    min-width: 42px;
    border: 1px solid var(--ac-border);
    border-radius: 10px;
    color: var(--ac-ink);
    text-align: center;
}

.th-ac-pagination .active .page-link {
    border-color: var(--ac-primary);
    background: var(--ac-primary);
    color: #fff;
}

/* RTL details */
[dir="rtl"] .th-ac-results__eyebrow,
[dir="rtl"] .th-ac-cal__eyebrow,
[dir="rtl"] .th-ac-search__field label {
    letter-spacing: 0;
}

/* Responsive */
@media (max-width: 1399.98px) {
    .th-ac-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 32px;
    }
}

@media (max-width: 1199.98px) {
    .th-ac-search {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.9fr) auto;
    }

    .th-ac-search__field {
        padding: 11px 16px;
    }

    .th-ac-card__media {
        flex-basis: 300px;
        height: 260px;
    }
}

@media (max-width: 991.98px) {
    .th-ac-search-wrap {
        margin-top: 22px;
    }

    .th-ac-layout {
        grid-template-columns: 1fr;
    }

    .th-ac-aside {
        position: static;
    }

    .th-ac-search {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .th-ac-search__field--wide {
        grid-column: 1 / -1;
    }

    .th-ac-search__submit {
        grid-column: 1 / -1;
        min-height: 52px;
    }

    .th-ac-card__media {
        flex-basis: 270px;
        height: 240px;
    }

    .th-ac-card__body {
        padding: 24px;
    }
}

@media (max-width: 767.98px) {
    .th-ac-search-wrap {
        margin-top: 16px;
    }

    .th-ac-search {
        grid-template-columns: 1fr;
        padding: 8px;
        border-radius: 16px;
    }

    .th-ac-search__field {
        border-inline-end: 0;
        border-bottom: 1px solid #efedea;
        padding: 12px 14px;
    }

    .th-ac-search__submit {
        margin: 6px 4px 2px;
        min-height: 50px;
    }

    .th-ac-main {
        padding-top: 40px;
    }

    .th-ac-results__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .th-ac-card {
        flex-direction: column;
    }

    .th-ac-card__media {
        flex-basis: auto;
        width: 100%;
        aspect-ratio: 4 / 3;
        height: auto;
    }

    .th-ac-card__body {
        padding: 22px 20px;
    }

    .th-ac-card__title {
        font-size: 20px;
    }

    .th-ac-card__foot {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .th-ac-search__submit span {
        font-size: 14px;
    }

    .th-ac-card__date {
        inset-block-end: 12px;
        inset-inline-start: 12px;
    }
}
