/* ==========================================================================
   Rectangle One — course listing (Category / Search / All Courses)
   --------------------------------------------------------------------------
   Restyles the default theme ".course-item" listing into the homepage card
   system: a thumbnail with price + level overlays, an eyebrow category label,
   a meta row and a footer CTA. Also adds a category hero header and a sticky
   filter sidebar. Uses the tokens from r1-theme.css.

   Loaded only on listing pages (see search.blade.php).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Category / search hero header
   -------------------------------------------------------------------------- */
.r1-cat-hero {
    margin-bottom: 2.5rem;
    padding: 2.5rem 0 2.75rem;
    background: linear-gradient(135deg, var(--r1-blue-deep) 0%, var(--r1-panel) 100%);
    color: #fff;
}

.r1-cat-hero-eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--r1-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.r1-cat-hero-title {
    margin: 0 0 0.35rem;
    color: #fff;
    font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
}

.r1-cat-hero-count {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Listing card — matches the homepage .r1h-course-card system
   -------------------------------------------------------------------------- */
.r1-lcard {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--r1-surface);
    border: var(--r1-hairline);
    border-radius: var(--r1-radius-lg);
    box-shadow: var(--r1-shadow-md);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.r1-lcard:hover {
    transform: translateY(-2px);
    box-shadow: var(--r1-shadow-lg);
}

.r1-lcard-thumb {
    position: relative;
    height: 180px;
    background-color: var(--r1-panel);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.r1-lcard-price {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--r1-radius-base);
    background: var(--r1-panel);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.r1-lcard-flag {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--r1-radius-full);
    background: var(--r1-gold);
    color: var(--r1-ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.r1-lcard-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

.r1-lcard-eyebrow {
    color: var(--r1-brown);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.r1-lcard-title {
    margin: 0.375rem 0 0.5rem;
    color: var(--r1-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 26px;
}

.r1-lcard-title a {
    color: inherit;
    text-decoration: none;
}

/* stretched link: whole card is clickable, footer controls stay on top */
.r1-lcard-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.r1-lcard:hover .r1-lcard-title a {
    color: var(--r1-blue-deep);
}

.r1-lcard-desc {
    margin: 0 0 0.75rem;
    color: var(--r1-text-variant);
    font-size: 13px;
    line-height: 1.5;
}

.r1-lcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
    color: var(--r1-text-muted);
    font-size: 12.5px;
}

.r1-lcard-meta i {
    color: var(--r1-gold);
}

.r1-lcard-actions {
    position: relative;
    z-index: 2; /* keep cart button clickable above the stretched link */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: var(--r1-hairline);
}

.r1-lcard-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 1.25rem;
    border-radius: var(--r1-radius-base);
    background: var(--r1-blue);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
}

.r1-lcard:hover .r1-lcard-cta {
    background: var(--r1-blue-deep);
}

.r1-lcard-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--r1-surface);
    border: var(--r1-hairline);
    border-radius: var(--r1-radius-base);
    color: var(--r1-blue);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.r1-lcard-cart:hover {
    background: var(--r1-blue);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Sticky filter sidebar + filter box
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .courses_area .col-lg-4.col-xl-3 > div {
        position: sticky;
        top: 96px;
    }
}

.courses_area .course_category_chose {
    padding: 1.25rem;
    background: var(--r1-surface);
    border: var(--r1-hairline);
    border-radius: var(--r1-radius-lg);
    box-shadow: var(--r1-shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
    .r1-lcard {
        transition: none;
    }

    .r1-lcard:hover {
        transform: none;
    }
}
