/**
 * ============================================================
 * CIU PROGRAM EXPLORER
 * ============================================================
 *
 * Complete front-end stylesheet.
 *
 * Design goals:
 *
 * - Compact academic program cards
 * - Fixed image height
 * - Equal-height cards per row
 * - Short title and description previews
 * - CTA aligned at the bottom
 * - Responsive 3 / 2 / 1 column layout
 * - CIU visual identity using #151369
 *
 * ============================================================
 */


/* ============================================================
   MAIN SECTION
   ============================================================ */

.cpe-program-explorer {

    /*width: 100%;

    padding: 70px 20px;

    background: #ffffff;

    box-sizing: border-box;
	*/
	
	background:#fff;
    border-radius:20px;

    padding:50px;

    box-shadow:0 15px 45px rgba(0,0,0,.08);

    max-width:1200px;

    margin:auto;
	
}


/* ============================================================
   CONTAINER
   ============================================================ */

.cpe-container {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;
	
}


/* ============================================================
   HEADER
   ============================================================ */

.cpe-header {

    max-width: 850px;

    margin: 0 auto 40px;

    text-align: center;
}


.cpe-eyebrow {

    display: inline-block;

    margin-bottom: 10px;

    font-size: 12px;

    line-height: 1.4;

    font-weight: 700;

    letter-spacing: 2px;

    text-transform: uppercase;

    color: #151369;
}


.cpe-title {

    margin: 0 0 15px;

    font-size: clamp(
        34px,
        5vw,
        56px
    );

    line-height: 1.08;

    font-weight: 700;

    color: #151369;
}


.cpe-description {

    max-width: 760px;

    margin: 0 auto;

    font-size: 17px;

    line-height: 1.6;

    color: #5c5c5c;
}


/* ============================================================
   FILTER WRAPPER
   ============================================================ */

.cpe-filter-wrapper {

    padding: 25px;

    margin-bottom: 35px;

    background: #f6f6f9;

    border-radius: 10px;

    box-sizing: border-box;
}


.cpe-filter-grid {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1.5fr;

    gap: 18px;

    align-items: end;
}


/* ============================================================
   FILTER FIELD
   ============================================================ */

.cpe-filter-field {

    display: flex;

    flex-direction: column;

    gap: 7px;

    min-width: 0;
}


.cpe-filter-field label {

    font-size: 12px;

    line-height: 1.4;

    font-weight: 700;

    color: #222222;

    text-transform: uppercase;

    letter-spacing: .5px;
}


/* ============================================================
   SELECT
   ============================================================ */

.cpe-filter {

    width: 100%;

    min-height: 50px;

    padding: 0 15px;

    border: 1px solid #d8d8df;

    border-radius: 6px;

    background: #ffffff;

    font-family: inherit;

    font-size: 14px;

    color: #222222;

    cursor: pointer;

    outline: none;

    box-sizing: border-box;
}


.cpe-filter:focus {

    border-color: #151369;

    box-shadow:
        0 0 0 3px
        rgba(21, 19, 105, .08);
}


/* ============================================================
   SEARCH
   ============================================================ */

.cpe-search-box {

    display: flex;

    width: 100%;

    min-width: 0;
}


.cpe-search-input {

    flex: 1;

    min-width: 0;

    height: 50px;

    padding: 0 15px;

    border: 1px solid #d8d8df;

    border-right: 0;

    border-radius: 6px 0 0 6px;

    background: #ffffff;

    font-family: inherit;

    font-size: 14px;

    color: #222222;

    outline: none;

    box-sizing: border-box;
}


.cpe-search-input:focus {

    border-color: #151369;
}


.cpe-search-button {

    flex: 0 0 auto;

    height: 50px;

    padding: 0 24px;

    border: 0;

    border-radius: 0 6px 6px 0;

    background: #151369;

    color: #ffffff;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease;
}


.cpe-search-button:hover {

    background: #0e0d4d;
}


/* ============================================================
   RESULTS HEADER
   ============================================================ */

.cpe-results-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}


.cpe-results-count {

    font-size: 15px;

    line-height: 1.4;

    font-weight: 700;

    color: #222222;
}


.cpe-reset-button {

    padding: 6px 0;

    border: 0;

    background: transparent;

    color: #151369;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;
}


.cpe-reset-button:hover {

    text-decoration: underline;
}


/* ============================================================
   PROGRAM GRID
   ============================================================ */

.cpe-results {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 24px;

    align-items: stretch;

    position: relative;
}


/*
 * Every direct child of the results grid should stretch
 * to the same height as the tallest card in that row.
 */

.cpe-results > * {

    min-width: 0;
}


/* ============================================================
   LOADING STATE
   ============================================================ */

.cpe-results.is-loading {

    opacity: .45;

    pointer-events: none;
}


/* ============================================================
   PROGRAM CARD
   ============================================================ */

.cpe-program-card {

    display: flex;

    flex-direction: column;

    width: 100%;

    height: 100%;

    min-height: 0;

    overflow: hidden;

    border: 1px solid #e1e4ea;

    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 5px 20px
        rgba(0, 0, 0, .05);

    box-sizing: border-box;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}


.cpe-program-card:hover {

    transform: translateY(-3px);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, .09);
}


/* ============================================================
   PROGRAM IMAGE
   ============================================================ */

/*
 * Fixed image height keeps all cards visually consistent.
 *
 * 150px gives the card the appearance of a normal
 * website image card instead of a large feature card.
 */

.cpe-program-image {

    width: 100%;

    height: 150px;

    min-height: 150px;

    overflow: hidden;

    background: #eeeeee;
}


.cpe-program-image img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    object-position: center;

    transition:
        transform .35s ease;
}


.cpe-program-card:hover
.cpe-program-image img {

    transform: scale(1.03);
}


/* ============================================================
   CARD CONTENT
   ============================================================ */

.cpe-program-content {

    display: flex;

    flex-direction: column;

    flex: 1;

    min-height: 0;

    padding: 20px;

    box-sizing: border-box;
}


/* ============================================================
   DEGREE LEVEL
   ============================================================ */

.cpe-program-degree {

    display: inline-block;

    align-self: flex-start;

    width: fit-content;

    max-width: 100%;

    margin-bottom: 9px;

    padding: 5px 9px;

    border-radius: 4px;

    background: #e8d9a8;

    color: #151369;

    font-size: 11px;

    line-height: 1.2;

    font-weight: 700;

    letter-spacing: .4px;

    text-transform: uppercase;

    box-sizing: border-box;
}


/* ============================================================
   PROGRAM TITLE
   ============================================================ */

.cpe-program-title {

    margin: 0 0 10px;

    font-size: 20px;

    line-height: 1.3;

    font-weight: 700;

    color: #202020;

    /*
     * Limit title to two lines.
     *
     * This prevents a long program name from making one
     * card significantly taller than the others.
     */

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;
}


.cpe-program-title a {

    color: inherit;

    text-decoration: none;
}


.cpe-program-title a:hover {

    color: #151369;
}


/* ============================================================
   AREA OF INTEREST
   ============================================================ */

.cpe-program-area {

    display: inline-block;

    width: fit-content;

    max-width: 100%;

    margin-bottom: 10px;

    padding: 5px 9px;

    border: 1px solid #e1e4ea;

    border-radius: 5px;

    background: #ffffff;

    color: #666666;

    font-size: 11px;

    line-height: 1.3;

    font-weight: 600;

    box-sizing: border-box;
}


/* ============================================================
   DESCRIPTION / EXCERPT
   ============================================================ */

.cpe-program-excerpt {

    margin: 0 0 16px;

    font-size: 14px;

    line-height: 1.55;

    color: #626262;

    /*
     * CRITICAL:
     *
     * WordPress may return a very long program description.
     *
     * Limit it to three lines so a single long description
     * cannot create an extremely tall card.
     */

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 3;

    overflow: hidden;
}


/*
 * Prevent paragraphs inside the excerpt from creating
 * additional spacing that can affect card height.
 */

.cpe-program-excerpt p {

    margin: 0;
}


/* ============================================================
   PROGRAM LINK / CTA
   ============================================================ */

.cpe-program-link {

    display: inline-flex;

    align-items: center;

    justify-content: flex-start;

    gap: 7px;

    width: fit-content;

    margin-top: auto;

    color: #151369;

    font-size: 13px;

    line-height: 1.4;

    font-weight: 700;

    text-decoration: none;
}


.cpe-program-link:hover {

    color: #0e0d4d;

    text-decoration: underline;
}


.cpe-arrow {

    font-size: 17px;

    line-height: 1;

    transition:
        transform .2s ease;
}


.cpe-program-link:hover
.cpe-arrow {

    transform: translateX(4px);
}


/* ============================================================
   LOAD MORE
   ============================================================ */

.cpe-load-more-wrapper {

    display: flex;

    justify-content: center;

    margin-top: 40px;
}


.cpe-load-more-button {
	display: flex;            
	align-items: center;   /* Vertically centers the text */
    justify-content: center; /* Horizontally centers the text */
	
    padding: 12px 28px;

    border: 2px solid #151369;

    border-radius: 5px;

    background: #ffffff;

    color: #151369;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}


.cpe-load-more-button:hover {

    background: #151369;

    color: #ffffff;
}


.cpe-load-more-button:disabled {

    opacity: .5;

    cursor: wait;
}


/* ============================================================
   LOADING
   ============================================================ */

.cpe-loading {

    grid-column: 1 / -1;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    min-height: 140px;

    color: #666666;
}


.cpe-spinner {

    width: 20px;

    height: 20px;

    border: 3px solid #dddddd;

    border-top-color: #151369;

    border-radius: 50%;

    animation:
        cpe-spin .8s linear infinite;
}


@keyframes cpe-spin {

    from {

        transform: rotate(0deg);

    }

    to {

        transform: rotate(360deg);

    }

}


/* ============================================================
   NO RESULTS
   ============================================================ */

.cpe-no-results {

    grid-column: 1 / -1;

    padding: 60px 20px;

    text-align: center;

    border: 1px dashed #d8d8df;

    border-radius: 10px;

    background: #fafafa;

    box-sizing: border-box;
}


.cpe-no-results-icon {

    margin-bottom: 12px;

    font-size: 28px;

    color: #151369;
}


.cpe-no-results h3 {

    margin: 0 0 8px;

    font-size: 22px;

    line-height: 1.3;

    color: #222222;
}


.cpe-no-results p {

    margin: 0;

    font-size: 14px;

    color: #777777;
}


/* ============================================================
   ERROR
   ============================================================ */

.cpe-error {

    grid-column: 1 / -1;

    padding: 45px 20px;

    text-align: center;

    background: #fafafa;

    border-radius: 10px;

    box-sizing: border-box;
}


.cpe-error h3 {

    margin: 0 0 8px;

    color: #222222;
}


.cpe-error p {

    margin: 0;

    color: #777777;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 900px) {

    .cpe-filter-grid {

        grid-template-columns:
            1fr
            1fr;
    }


    .cpe-search-field {

        grid-column: 1 / -1;
    }


    .cpe-results {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .cpe-program-explorer {

        padding: 55px 15px;
    }


    .cpe-header {

        margin-bottom: 30px;
    }


    .cpe-title {

        font-size: 34px;
    }


    .cpe-description {

        font-size: 15px;

        line-height: 1.55;
    }


    .cpe-filter-wrapper {

        padding: 18px;
    }


    .cpe-filter-grid {

        grid-template-columns: 1fr;
    }


    .cpe-search-field {

        grid-column: auto;
    }


    .cpe-search-box {

        flex-direction: column;

        gap: 8px;
    }


    .cpe-search-input {

        height: 48px;

        border-right: 1px solid #d8d8df;

        border-radius: 6px;
    }


    .cpe-search-button {

        width: 100%;

        height: 48px;

        border-radius: 6px;
    }


    .cpe-results-header {

        align-items: flex-start;

        flex-direction: column;

        gap: 8px;
    }


    .cpe-results {

        grid-template-columns: 1fr;

        gap: 20px;
    }


    .cpe-program-image {

        height: 160px;

        min-height: 160px;
    }


    .cpe-program-content {

        padding: 18px;
    }


    .cpe-program-title {

        font-size: 19px;
    }


    .cpe-program-excerpt {

        font-size: 14px;

        -webkit-line-clamp: 3;
    }

}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 400px) {

    .cpe-program-image {

        height: 145px;

        min-height: 145px;
    }


    .cpe-program-content {

        padding: 16px;
    }


    .cpe-program-title {

        font-size: 18px;
    }

}