/* ==========================================================================
   UPCOMING COURSE SCHEDULES  (home page, between Top Categories and Popular
   Courses)

   Built entirely from the tokens already declared in home.css — --hm-gold,
   --hm-brown, --hm-ink, --hm-muted, --hm-cream, the shadow scale, --hm-radius
   and --hm-ease. Nothing new is introduced: the eyebrow, title and description
   are the Top Categories header, the category chip is .hm-course__badge and the
   CTA is .hm-course__btn, both borrowed from courses.css.

   The rows are a real <table> for the dates to stay readable to assistive
   tech; under 992px the same markup restyles into stacked cards, each cell
   labelled from its data-label, so nothing scrolls sideways on a phone.
   ========================================================================== */

.hm-sched {
    position: relative;
    padding: 50px 0;
    overflow: hidden;
}

/* Same slow-rotating premium background as the sections either side */
.hm-sched__bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.hm-sched__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .10;
    filter: blur(60px);
    animation: hm-spin 90s linear infinite;
    will-change: transform;
}

.hm-sched__container {
    position: relative;
    z-index: 1;
}

/* ------------------------------ Header ------------------------------ */
.hm-sched__head {
    text-align: center;
    margin-bottom: 44px;
}

.hm-sched__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.hm-sched__label-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #843D21;
}

.hm-sched__title {
    margin: 0 0 14px;
    font-size: 34px;
    font-weight: 700;
    color: #1E1E1E;
}

.hm-sched__desc {
    max-width: 620px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.8;
    color: var(--hm-muted, #6D6357);
}

/* ---------------------------- The panel ----------------------------
   overflow-x:auto rather than hidden: seven columns on a narrow desktop
   window used to be clipped by the panel, taking the Apply button with them.
   The columns below are sized to fit a normal viewport, so the scrollbar is a
   safety net that almost never appears — and when it does, the action column
   is reachable instead of cut off. */
.hm-sched__panel {
    border-radius: calc(var(--hm-radius, 18px) + 6px);
    background: var(--hm-white, #fff);
    box-shadow: var(--hm-shadow-md, 0 14px 40px rgba(42, 29, 20, .12));
    border: 1px solid rgba(42, 29, 20, .06);

    /* overflow-y must be stated: a box with one axis scrollable computes the
       other from `visible` to `auto`, which put a vertical scrollbar down the
       side of the panel. The table only ever overflows sideways. */
    overflow-x: auto;
    overflow-y: hidden;
}

.hm-sched__table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

/* Header row — #843D21, the same brown as the site header bar (navbar.css) */
.hm-sched__table thead th {
    padding: 17px 16px;
    background: #843D21;
    color: rgba(255, 255, 255, .94);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.hm-sched__table tbody td {
    padding: 18px 16px;
    vertical-align: middle;
    border-top: 1px solid rgba(42, 29, 20, .07);
    font-size: 14px;
    color: var(--hm-ink, #23180F);
}

/* The two date columns and Duration hold a fixed-width label each, so pinning
   them keeps the Course column the one that flexes — the row stays aligned
   down the table however long a course name runs.

   Scoped to --wide (the seven-column table on the home page and /schedules);
   the --compact one on a course-details page has no Course or Category column,
   so these positions would land on the wrong cells. */
.hm-sched__table--wide th:nth-child(3),
.hm-sched__table--wide th:nth-child(4) { width: 132px; }
.hm-sched__table--wide th:nth-child(5) { width: 118px; }
.hm-sched__table--wide th:nth-child(6) { width: 104px; }

/* Compact — one course's own batches: Start · End · Duration · Fee · Apply.
   The four facts are sized, so the action column takes the slack and the Apply
   buttons line up down the right edge. */
.hm-sched__table--compact th:nth-child(1),
.hm-sched__table--compact th:nth-child(2) { width: 168px; }
.hm-sched__table--compact th:nth-child(3) { width: 150px; }
.hm-sched__table--compact th:nth-child(4) { width: 140px; }

/* Hover: a wash of the page cream and a hairline of gold down the left edge.
   The row itself never moves — only the CTA lifts. */
.hm-sched__row {
    transition: background .25s var(--hm-ease, cubic-bezier(.22, .7, .2, 1));
}

.hm-sched__row:hover {
    background: var(--hm-cream, #FCF8F1);
}

.hm-sched__row td:first-child {
    box-shadow: inset 3px 0 0 transparent;
    transition: box-shadow .25s var(--hm-ease, cubic-bezier(.22, .7, .2, 1));
}

.hm-sched__row:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--hm-gold, #E9A320);
}

.hm-sched__row:hover .hm-sched__btn {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 30px rgba(233, 163, 32, .42);
}

/* ---------------------------- Course cell ---------------------------- */
.hm-sched__course {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
}

.hm-sched__thumb {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--hm-cream, #FCF8F1);
    border: 1px solid rgba(42, 29, 20, .07);
}

.hm-sched__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-sched__course-name {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--hm-ink, #23180F);
    line-height: 1.4;
}

/* ---------------------------- Category chip ----------------------------
   .hm-course__badge is an inline element on a card, where it always fits on
   one line. In a narrow table column its text wraps, and an inline box breaks
   its background into a staircase across the lines — so here it becomes a
   single flex box that wraps its text inside one rounded shape, on a lighter
   wash of the same yellow so it reads as a quiet label rather than a
   highlighter pen. */
.hm-sched__table .hm-course__badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 12px;
    background: #FFF9E0;
    border: 1px solid rgba(233, 163, 32, .28);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

/* ------------------------ Date / duration cells ------------------------ */
.hm-sched__stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hm-sched__stack-main {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hm-ink, #23180F);
    white-space: nowrap;
}

.hm-sched__stack-main i {
    font-size: .8rem;
    color: var(--hm-gold-dark, #C6851A);
}

.hm-sched__stack-sub {
    padding-left: 20px;
    font-size: 12px;
    color: var(--hm-muted, #6D6357);
}

/* Daily timing, only rendered when the batch has one. Sits with the day name
   under the date, aligned to it, and stays quieter than the date itself. */
.hm-sched__stack-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--hm-muted, #6D6357);
    white-space: nowrap;
}

.hm-sched__stack-time i {
    font-size: .72rem;
    color: var(--hm-gold-dark, #C6851A);
}

.hm-sched__none {
    color: var(--hm-muted, #6D6357);
}

/* -------------------------------- Fee -------------------------------- */
.hm-sched__fee {
    font-size: 15.5px;
    font-weight: 700;
    color: #843D21;
    white-space: nowrap;
}

/* "Contact for Fee" is a sentence, not a price — it drops the price weight and
   wraps onto two lines rather than widening the column for everyone. */
.hm-sched__fee--ask {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hm-muted, #6D6357);
    white-space: normal;
}

/* ------------------------------- Action -------------------------------
   The eye and Apply sit on one line, pinned to the right edge of the panel and
   vertically centred against the row however tall the course cell grows. */
.hm-sched__action {
    width: 1%;
    white-space: nowrap;
}

.hm-sched__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Ghost icon button — the site's brown on cream, matching the eyebrow links */
.hm-sched__eye {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--hm-cream, #FCF8F1);
    border: 1px solid rgba(132, 61, 33, .18);
    color: #843D21;
    font-size: .95rem;
    text-decoration: none;
    transition:
        transform .25s var(--hm-ease, cubic-bezier(.22, .7, .2, 1)),
        background .25s ease,
        border-color .25s ease;
}

.hm-sched__eye:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: rgba(132, 61, 33, .42);
    color: #843D21;
}

.hm-sched__eye:focus-visible {
    outline: 3px solid rgba(132, 61, 33, .45);
    outline-offset: 3px;
}

/* .hm-course__btn is a full-width card footer button; inside a table cell it
   sits inline and keeps its own gradient, radius, arrow and hover. */
.hm-sched__btn {
    display: inline-flex;
    width: auto;
    margin-top: 0;
    padding: 9px 16px;
    gap: 8px;
    border: 0;
    font-size: 13.5px;
    white-space: nowrap;
}

.hm-sched__btn i {
    font-size: .75rem;
}

.hm-sched__btn:focus-visible {
    outline: 3px solid rgba(233, 163, 32, .55);
    outline-offset: 3px;
}

/* -------------------------------- Foot -------------------------------- */
.hm-sched__foot {
    margin-top: 34px;
    text-align: center;
}

.hm-sched__foot .hm-btn--primary {
    height: 56px;
}

/* ============================== RESPONSIVE ============================== */

/* Tablet / small desktop — the same table, tightened up */
@media (max-width: 1199.98px) {
    .hm-sched__table thead th { padding: 15px 12px; }
    .hm-sched__table tbody td { padding: 16px 12px; font-size: 13.5px; }
    .hm-sched__table th:nth-child(3),
    .hm-sched__table th:nth-child(4) { width: 122px; }
    .hm-sched__table th:nth-child(5) { width: 108px; }
    .hm-sched__course { min-width: 170px; gap: 10px; }
    .hm-sched__thumb { width: 42px; height: 42px; border-radius: 11px; }
    .hm-sched__course-name { font-size: 14px; }
    .hm-sched__stack-main { font-size: 13px; }
    .hm-sched__actions { gap: 6px; }
    .hm-sched__eye { width: 36px; height: 36px; }
    .hm-sched__btn { padding: 9px 14px; font-size: 12.5px; }
}

/* Phone / small tablet — one stacked card per batch. No sideways scrolling:
   the table elements go to blocks and each cell carries its own label. */
@media (max-width: 991.98px) {
    .hm-sched { padding: 40px 0; }
    .hm-sched__title { font-size: 26px; }

    .hm-sched__panel {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .hm-sched__table,
    .hm-sched__table tbody,
    .hm-sched__table tr,
    .hm-sched__table td {
        display: block;
        width: 100%;
    }

    /* The header row only makes sense beside columns. */
    .hm-sched__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .hm-sched__row {
        margin-bottom: 18px;
        padding: 20px;
        border-radius: var(--hm-radius, 18px);
        background: var(--hm-white, #fff);
        border: 1px solid rgba(42, 29, 20, .07);
        box-shadow: var(--hm-shadow-sm, 0 6px 18px rgba(42, 29, 20, .08));
    }

    .hm-sched__row:hover { background: var(--hm-white, #fff); }
    .hm-sched__row:hover td:first-child { box-shadow: none; }

    .hm-sched__table tbody td {
        padding: 0;
        border-top: 0;
    }

    /* The label the hidden header row used to carry. */
    .hm-sched__table tbody td[data-label]:not(.hm-sched__course)::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--hm-muted, #6D6357);
    }

    /* The cell rule above turns every td into a block; the course cell keeps its
       icon beside the name, so it is named specifically enough to win. */
    .hm-sched__table td.hm-sched__course {
        display: flex;
        min-width: 0;
        padding-bottom: 14px;
        margin-bottom: 14px;
        border-bottom: 1px solid rgba(42, 29, 20, .07);
    }

    /* Category sits right under the course name, then the facts pair up. */
    .hm-sched__table tbody td[data-label="Category"] { margin-bottom: 16px; }

    .hm-sched__table tbody td[data-label="Start Date"],
    .hm-sched__table tbody td[data-label="End Date"],
    .hm-sched__table tbody td[data-label="Duration"],
    .hm-sched__table tbody td[data-label="Fee"] {
        display: inline-block;
        width: 50%;
        margin-bottom: 16px;
        vertical-align: top;
    }

    .hm-sched__table td.hm-sched__action {
        width: auto;
    }

    /* Comfortable tap targets: Apply takes the width the course-card CTA would,
       with the eye kept square beside it. */
    .hm-sched__actions {
        justify-content: flex-start;
        gap: 12px;
    }

    .hm-sched__eye {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .hm-sched__btn {
        display: flex;
        flex: 1;
        justify-content: space-between;
        padding: 14px 22px;
        font-size: 15px;
    }

    .hm-sched__foot { margin-top: 6px; }
}

@media (max-width: 575.98px) {
    .hm-sched__title { font-size: 23px; }
    .hm-sched__desc { font-size: 14px; }
    .hm-sched__row { padding: 18px; }
    .hm-sched__thumb { width: 44px; height: 44px; }
}

/* Users who ask for less motion keep the section, without the spin. The reveal
   itself is already handled by the [data-io] observer in home.css. */
@media (prefers-reduced-motion: reduce) {
    .hm-sched__bg img { animation: none; }
    .hm-sched__row,
    .hm-sched__row td:first-child,
    .hm-sched__btn { transition: none; }
}

/* ==========================================================================
   /schedules — the full listing

   Same table, without the home section's rotating backdrop or centred header:
   the page already has the courses-page banner above it, so the section is
   just the panel plus a count.
   ========================================================================== */
.hm-sched--page {
    padding: 0 0 20px;
    overflow: visible;
}

/* The courses page's toolbar, reused above the table. Its own rules live in
   courses.css; only the spacing below it belongs to this page. */
.hm-sched__bar {
    margin-bottom: 18px;
}

/* The month dropdown uses an icon-font glyph where the category one uses an
   image, so it needs the sizing .hm-crs-cat__ico gives that <img>. */
.hm-crs-cat__btn i.hm-crs-cat__ico {
    width: auto;
    height: auto;
    font-size: .9rem;
    opacity: .75;
}

.hm-sched__noresults {
    margin: 0;
    padding: 44px 24px;
    text-align: center;
    border-radius: calc(var(--hm-radius, 18px) + 6px);
    background: var(--hm-white, #fff);
    border: 1px solid rgba(42, 29, 20, .07);
    box-shadow: var(--hm-shadow-sm, 0 6px 18px rgba(42, 29, 20, .08));
    font-size: 15px;
    line-height: 1.8;
    color: var(--hm-muted, #6D6357);
}

.hm-sched__noresults[hidden],
.hm-sched__panel[hidden] {
    display: none;
}

.hm-sched__empty {
    padding: 64px 24px;
    text-align: center;
    border-radius: calc(var(--hm-radius, 18px) + 6px);
    background: var(--hm-white, #fff);
    border: 1px solid rgba(42, 29, 20, .07);
    box-shadow: var(--hm-shadow-sm, 0 6px 18px rgba(42, 29, 20, .08));
}

.hm-sched__empty i {
    font-size: 2rem;
    color: var(--hm-gold, #E9A320);
}

.hm-sched__empty h2 {
    margin: 18px 0 10px;
    font-size: 22px;
    font-weight: 700;
    color: #1E1E1E;
}

.hm-sched__empty p {
    max-width: 460px;
    margin: 0 auto 24px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--hm-muted, #6D6357);
}

.hm-sched__empty .hm-btn--primary {
    height: 56px;
}

@media (max-width: 991.98px) {
    .hm-sched--page { padding: 0 0 10px; }
    .hm-sched__empty { padding: 44px 20px; }
}
