/*Path of this file: D:\Flipthinks\wp-content\themes\fliptheme\learndash\course-grid\learndash-overrides.css*/

/* ---------- Course-card category buttons ---------- */
/* Categories row + "See all" sit on ONE line: a nowrap flex line that
   centres its content and clips anything past the edge. */
.course-categories {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    color: #666;
    margin-top: 0.8em;
}

.course-category-link-button {
    border: solid 1px #ddd;
    border-radius: 3px;
    background: none;
    transition: 0.3s ease-in-out;
    margin: 3px 3px 0 3px;
    padding: 0;
}

.course-category-link-button:hover .course-category-link {
    color: #fff;
}

.course-category-link {
    font-size: 0.85em;
    color: #666;
    margin: 0;
    display: block;
    height: 100%;
    width: 100%;
    padding: 2px 6px 3px 6px;
}

.ld-course-grid-category-separator {
    font-size: 0.7rem;
    vertical-align: text-top;
    font-weight: 600;
}

/* The row shrinks (flex:0 1 auto + min-width:0) and clips on the right;
   a right-edge fade mask softens the cut where "See all" takes over.
   "See all" never shrinks, so it stays pinned on the same single line. */
.course-categories .ft-categories-row {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    overflow: hidden;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-height: 2.1em;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.course-categories .ft-categories-row .course-category-link-button {
    flex: 0 0 auto;
}
.course-categories .ft-see-all-wrap {
    display: inline-flex;
    align-items: center;
    margin: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}
.ft-see-all-link,
a.ft-see-all-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.2s ease;
}
.ft-see-all-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* ---------- Grid Modal ---------- */
/* Default to display:none so the modal HTML doesn't flash on page load
   before CSS applies. JS toggles inline display + the --open class. */
.ft-grid-modal {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    display: none;
}
.ft-grid-modal--open {
    display: flex;
}

.ft-grid-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0;
    transition: opacity .22s ease;
}
.ft-grid-modal--open .ft-grid-modal__overlay { opacity: 1; }

/* Quick fade-in-up for the content panel. The JS forces a reflow between
   setting display:flex and adding the --open class so the transition has
   a "from" state to animate from. */
.ft-grid-modal__content {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden; /* clip the inner scrollbar at the rounded corner */
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .22s ease, transform .22s ease;
}
.ft-grid-modal--open .ft-grid-modal__content {
    opacity: 1;
    transform: translateY(0);
}
@media only screen and (min-width: 1201px) {
    .ft-grid-modal__content { max-width: 1080px; }
}

.ft-grid-modal__header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ft-grid-modal__title {
    margin: 0;
    font-size: 1.4em;
    color: #333;
}

.ft-grid-modal__close {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #666;
    transition: color 0.2s ease;
}
.ft-grid-modal__close:hover { color: #000; }
.ft-grid-modal__close svg { width: 24px; height: 24px; fill: currentColor; }

/* Outer list: pure scroll container, no padding. Scrollbar sits here, and
   the parent .ft-grid-modal__content has overflow:hidden so the scrollbar
   is cleanly clipped at the rounded corner. */
.ft-grid-modal__list {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
/* Inner list: padding + layout. The grid/flex lives here so the cards
   themselves never touch the scrollbar. */
.ft-grid-modal__list-inner {
    padding: 20px;
}
.ft-grid-modal__list-inner.ft-grid-modal__list--categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.ft-grid-modal-trigger {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.2s ease;
}
.ft-grid-modal-trigger:hover {
    color: #005a87;
    text-decoration: underline;
}

@media only screen and (max-width: 820px) {
    .ft-grid-modal__content { width: 95%; max-height: 90vh; }
    .ft-grid-modal__list-inner { padding: 16px; }
}

/* Stretch course-grid items vertically so caption + button align */
body .ld-course-list-items .ld_course_grid .thumbnail.course,
body .ld-course-list-items .ld_course_grid .thumbnail .caption {
    display: flex;
    flex-direction: column;
    height: 100%;
}
body .ld-course-list-items .ld_course_grid .thumbnail .caption {
    justify-content: space-between;
}

.ld-course-list-items .ld_course_grid .thumbnail.course:hover {
    box-shadow: 0 0 7px #00000035;
}
.ld-course-list-items .ld_course_grid .thumbnail.course img {
    border-radius: 5px 5px 0 0;
}
.ld-course-list-items .ld_course_grid .entry-title {
    text-align: center;
    font-size: 1.1em;
    line-height: 2.5ex;
    height: 5ex;
    overflow: hidden;
}

/* LearnDash ribbon */
.ld-course-list-items .ld_course_grid .thumbnail.course .ribbon:before { display: none; }
.ld-course-list-items .ld_course_grid .thumbnail.course .ribbon {
    left: 10px !important;
    border-radius: 3px;
    box-shadow: none;
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
    font-size: 16px !important;
    padding: 3px 15px !important;
}

/* Primary button */
.ld-course-list-items .ld_course_grid .thumbnail.course a.btn-primary {
    background: #000;
    padding: 10px 0;
    font-size: 0.9em;
    margin-top: 15px;
    transition: 0.4s ease-out;
}
.ld-course-list-items .ld_course_grid .thumbnail.course a.btn-primary:hover {
    color: #00bfff;
}

/* Reveal the "Last activity on …" / "X/Y Steps" line that the core
   course-grid stylesheet (legacy-v1/style.css) hides with display:none. */
.ld-course-list-items .ld_course_grid .ld-progress-steps {
    display: block;
}
