/**
 * Course Card shortcode styles
 * Fluid card for 3-column layouts; stacks header on narrow columns.
 */

.course-card {
    --cc-text: #111827;
    --cc-desc: #374151;
    --cc-muted: #6b7280;
    --cc-border: #e5e7eb;
    /* White capsule background for the tier rows. */
    --cc-capsule-bg: #ffffff;
    --cc-accent: #2563eb;
    --cc-font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    box-sizing: border-box;
    container-type: inline-size;
    width: 100%;
    min-width: 0;
    /* Fills its column by default; override per-card with the max_width attr. */
    max-width: none;
    margin: 0;
    padding: 0;
    /* Transparent so the Elementor section/column background & color show through. */
    background: transparent;
    color: inherit;
    font-family: var(--cc-font);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.45;
}

.course-card *,
.course-card *::before,
.course-card *::after {
    box-sizing: border-box;
}

.course-card__header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.course-card__thumb,
.course-card img.course-card__thumb {
    /* Square, sized by --cc-thumb (thumbnail_size attr, default 95.45px).
       !important beats theme/Elementor img{max-width:100%;height:auto} */
    flex: 0 0 var(--cc-thumb, 95.45px);
    width: var(--cc-thumb, 95.45px) !important;
    height: var(--cc-thumb, 95.45px) !important;
    min-width: var(--cc-thumb, 95.45px);
    max-width: var(--cc-thumb, 95.45px) !important;
    object-fit: cover;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

/* Blue accent dot shown in place of a thumbnail (thumbnail="" with no URL). */
.course-card__dot {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--cc-tile-accent, #3b6ff0);
}

.course-card__meta {
    flex: 1;
    min-width: 0;
}

.course-card__title {
    margin: 0 0 2px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-family: var(--cc-font);
    /* Inherits the Elementor section/column text color. */
    color: inherit;
}

.course-card__hours {
    /* Set --cc-range-display: none (via a class) to hide the hours-range line. */
    display: var(--cc-range-display, block);
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 400;
    color: currentColor;
    opacity: 0.75;
}

.course-card__desc {
    margin: 0 0 6px;
    font-size: 15px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    color: inherit;
    opacity: 0.85;
}

/* Add class="cc-no-range" to a card to hide its hours-range line. */
.cc-no-range {
    --cc-range-display: none;
}

.course-card__count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    font-size: 14px;
    font-weight: 500;
    color: currentColor;
    opacity: 0.75;
}

.course-card__count-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: currentColor;
}

/* Tiles laid out in a compact grid so many hour-options fit the same height
   as a category card (mockup: rows of small tiles, not a tall stacked list).
   auto-fill keeps the tiles ~90px wide and wraps to as many columns as the
   column allows — 3 on a ~400px card, fewer on a narrow Elementor column. */
.course-card__tiers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.75rem;
}

.course-card__tier {
    margin: 0;
    padding: 0;
}

/* Compact tile: hours stacked above price, the whole tile links to the cart. */
.course-card__row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    height: 80px;
    padding: 0.375rem;
    background: var(--cc-tile-bg, #fafafb);
    border-radius: 5px;
    /* !important beats Astra/Elementor global `a { box-shadow: none }` on the link tile. */
    box-shadow: 0 6px 10px rgba(60, 60, 90, 0.12) !important;
    text-align: center;
    text-decoration: none;
    color: var(--cc-text);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Hover feedback: lift the tile and deepen its shadow so it feels responsive. */
.course-card__row:hover,
.course-card__row:focus {
    text-decoration: none;
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(60, 60, 90, 0.18) !important;
}

/* Press state: dip back with a slight scale-down on click. */
.course-card__row:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 12px rgba(60, 60, 90, 0.14) !important;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .course-card__row {
        transition: box-shadow 0.18s ease;
    }

    .course-card__row:hover,
    .course-card__row:focus,
    .course-card__row:active {
        transform: none;
    }
}

.course-card__row--static {
    cursor: default;
    pointer-events: none;
}

.course-card__tier-hours {
    font-size: var(--cc-hours-size, 20px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--cc-tile-accent, #3b6ff0);
}

.course-card__price {
    font-size: var(--cc-price-size, 16px);
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    color: var(--cc-muted);
}

/* WooCommerce wc_price wraps in .amount / .woocommerce-Price-amount */
.course-card__price .amount,
.course-card__price .woocommerce-Price-amount {
    font-weight: 600;
    color: inherit;
}

.course-card-admin-notice {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}

/* Wide columns: scale the card up so it reads well when the section is roomy */
@container (min-width: 480px) {
    .course-card__title {
        font-size: 1.25rem;
    }
}

/* Narrow columns: tighter title, keyed to the column width (not the viewport) */
@container (max-width: 300px) {
    .course-card__title {
        font-size: 1rem;
    }
}

/* Very narrow columns: stack thumbnail above the text (image stays 150x150) */
@container (max-width: 240px) {
    .course-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
}
