/* Gallery custom styles — generated by assistant */
#listing-gallery-listing {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.course-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

@media (max-width: 768px) {
    .course-gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .course-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.course-card {

    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-figure {
    position: relative;
    width: 100%;
    min-height: 140px;
    overflow: hidden;

    /* reset default figure spacing and inline layout gaps */
    margin: 0;
    line-height: 0;

    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Content type banner below image */
.content-type-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    padding: 0.5rem;
    text-align: center;
}

.content-type-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.figure-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.img-overlay {
    position: absolute;
    right: 0.5rem;
    bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    pointer-events: none;
}

.figure-cta {
    pointer-events: auto;
}

.action-btn {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    color: #0b1220;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
}

.card-content {
    padding: 0 0.9rem 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1
}

.card-content header {
    display: block
}

.card-content h3 {
    margin: 0 0 0.125rem 0;
    font-size: 1.05rem;
    line-height: 1.1;
    color: currentColor
}

.subtitle {
    margin: 0;
    color: currentColor;
    opacity: 0.85;
    font-size: 0.92rem;
}

.description {
    color: currentColor;
    opacity: 0.85;
    margin: 0.125rem 0 0.6rem 0;
    font-size: 0.95rem
}

.meta-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    color: currentColor;
    opacity: 0.75;
    font-size: 0.85rem
}

.category-tag {
    background: rgba(14, 165, 233, 0.08);
    color: #0369a1;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem
}

.type-badge {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5
}

/* Exercise cards - distinct orange/amber theme */
.type-exercise .type-badge {
    background: rgba(251, 146, 60, 0.12);
    color: #ea580c;
    font-weight: 600;
}

.type-exercise {
    border: 2px solid rgba(251, 146, 60, 0.2);
}

.type-exercise:hover {
    border-color: rgba(251, 146, 60, 0.4);
}

/* Tech tags section */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

/* Programs text - discrete display */
.programs-text {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.45);
    line-height: 1.4;
}

.card-actions {
    padding: 0.6rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end
}

/* ============================================
   Quarto Listing Controls Enhancements
   ============================================ */

/* Search/Filter input styling */
.quarto-listing-filter {
    margin-bottom: 0.5rem;
}

.quarto-listing-filter input.search {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-left: none;
    border-radius: 0 8px 8px 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quarto-listing-filter .input-group-text {
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: rgba(0, 0, 0, 0.5);
}

.quarto-listing-filter input.search:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.quarto-listing-filter input.search:focus+.input-group-text,
.quarto-listing-filter:focus-within .input-group-text {
    border-color: rgba(14, 165, 233, 0.5);
}

.quarto-listing-filter input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

/* Sort controls styling */
.quarto-listing-sort {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quarto-listing-sort select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.quarto-listing-sort select:hover {
    border-color: rgba(14, 165, 233, 0.4);
}

.quarto-listing-sort select:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.6);
}

/* Category filters styling */
.quarto-listing-category {
    margin-bottom: 1.5rem;
}

.quarto-listing-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.quarto-listing-category .category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    margin: 0.25rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quarto-listing-category .category:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
}

.quarto-listing-category .category.active {
    background: rgba(14, 165, 233, 0.12) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
}

.quarto-listing-category .category .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.quarto-listing-category .category.active .count {
    background: rgba(14, 165, 233, 0.2);
    color: #0369a1;
}

/* Listing header container */
.listing-actions-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.listing-actions-group .quarto-listing-sort {
    margin-bottom: 0;
    flex-shrink: 0;
}

.listing-actions-group .quarto-listing-filter {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 500px;
}

/* No results message */
.quarto-listing-no-matching {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

/* Pagination styling */
.quarto-listing-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.quarto-listing-pagination .page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    background: white;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quarto-listing-pagination .page-link:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.3);
}

.quarto-listing-pagination .page-link.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.5);
    color: #0369a1;
    font-weight: 600;
}

/* Filter sections for programs and content types */
.filter-sections {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.filter-section {
    background: rgba(248, 250, 252, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.filter-half {
    min-width: 0;
}

.filter-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.6rem 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    color: rgba(0, 0, 0, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.25);
    color: #0369a1;
}

.filter-btn.active {
    background: rgba(14, 165, 233, 0.12) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
}

/* Hide Quarto's built-in sort control for this custom listing */
.quarto-listing-sort {
    display: none !important;
}

.filter-btn i {
    font-size: 0.95rem;
}

/* Program filters - distinct color */
.program-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.35rem 0.7rem;
}

.program-filter .program-name {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.55);
    font-weight: 400;
    line-height: 1;
}

.program-filter .program-code {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
}

.program-filter.active {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.program-filter.active .program-code {
    color: #7c3aed !important;
}

.program-filter.active .program-name {
    color: rgba(124, 58, 237, 0.7) !important;
}

.program-filter:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.25);
}

.program-filter:hover .program-code {
    color: #7c3aed;
}

.program-filter:hover .program-name {
    color: rgba(124, 58, 237, 0.6);
}

/* Lecture type filters - distinct color */
.content-type-filter.active {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #16a34a !important;
}

.content-type-filter:hover {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.25);
    color: #16a34a;
}

/* Hide content type buttons from category section (Lecture, Practice, Demo, etc.) */
.quarto-listing-category .category[data-category="TGVjdHVyZQ=="],
.quarto-listing-category .category[data-category="UHJhY3RpY2U="],
.quarto-listing-category .category[data-category="RGVtbw=="],
.quarto-listing-category .category[data-category="RXhlcmNpc2U="],
.quarto-listing-category .category[data-category="Q2hlYXRzaGVldA=="],
.quarto-listing-category .category[data-category="VHV0b3JpYWw="] {
    display: none !important;
}

@media (max-width: 768px) {
    .filter-sections {
        gap: 0.75rem;
    }

    .filter-sections-row {
        grid-template-columns: 1fr;
    }

    .filter-section {
        padding: 0.6rem 0.8rem;
    }

    .filter-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .program-filter .program-name {
        font-size: 0.65rem;
    }

    .program-filter .program-code {
        font-size: 0.85rem;
    }
}
