/*
Theme Name: Tutor Elearning - Overseas
Author: Reuel
Description: Custom theme for Overseas Frontiers
Template: tutor-elearning
Version: 0.7.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.2
Text Domain: tutor-elearning-overseas
*/

/*
 * Text and navigation link styles.
 * Necessary until the following issue is resolved in Gutenberg:
 * https://github.com/WordPress/gutenberg/issues/27075
 */

body {
    /* font-family: "Lato", sans-serif; */
}

.cta__free-consultation a {
    margin: 0;
}

/* Fix min-height for search input on header */
form.wp-block-search input {
    min-height: 40px;
}

header nav .wp-block-navigation-item a:hover {
    color: var(--wp--preset--color--secaccent) !important;
}

.woocommerce-breadcrumb {
    text-align: left;
}

.woocommerce .wp-block-woocommerce-product-collection,
.woocommerce-cart .wp-block-post-content,
.wp-block-woocommerce-checkout.alignwide.wc-block-checkout {
    max-width: 100% !important;
}

li.wc-block-product,
li.wc-block-grid__product {
    border: unset;
}

.wp-block-table td,
.wp-block-table th {
    border: unset;
    padding: unset;
}

/* === Sidebar Overrides === */

.sidebar-box {
    background: transparent !important;
    border-radius: 0;
    overflow: visible;
    animation: none !important;
}

.sidebar-box .has-shadow-dark {
    background: var(--wp--preset--color--background, #fff);
    border: 1px solid rgba(36, 59, 99, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    transform: none !important;
    padding: 1.5rem;
}

.sidebar-box .has-shadow-dark:hover {
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08) !important;
    transform: unset !important;
}

.sidebar-box .has-shadow-dark>.wp-block-group,
.sidebar-box .has-shadow-dark .wp-block-group {
    border: none !important;
    padding: 0 !important;
}

.sidebar-box .wp-block-heading {
    border: none;
    padding: 0;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.sidebar-box .wp-block-heading+* {
    margin-top: 0;
}

.sidebar-box .wp-block-social-links {
    justify-content: flex-start;
    gap: 12px;
}

.sidebar-box .wp-block-social-links .wp-social-link {
    margin: 0;
}

/* === Course Card Styles === */

.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.2s ease;
}

.course-card:hover {
    transform: scale(1.025);
}

.course-card__read-more {
    display: block;
    margin-left: auto;
    flex-shrink: 0;
}

.course-card__university,
.wpcbr-brands .wpcbr-brand {
    display: flex;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.course-card__university-logo,
.wpcbr-brands .wpcbr-brand .wpcbr-brand-image img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin-right: 8px;
    background: #e7ecf7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #2b4a8c;
    font-weight: bold;
}

.course-card__university-name,
.wpcbr-brands .wpcbr-brand .wpcbr-brand-name a {
    font-size: 0.85rem;
    color: #5a6a86;
    font-weight: 500;
}

.course-card__image img {
    object-fit: cover;
    object-position: center;
    height: inherit;
    width: auto;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    width: 100%;
}

.course-card__image .wc-block-components-product-sale-badge {
    font-size: 0.85rem;
    padding: 5px 10px;
    background: rgba(255, 217, 101, 0.85);
    color: #fff;
    font-weight: bold;
    border: 2px solid #ffcb00;
    width: 100%;
    margin: 10px 0;
    right: -38%;
    transform: rotate(45deg);
    text-shadow: 0px 0px 5px #000;
}

.wc-block-components-product-sale-badge>* {
    color: unset !important;
    background-color: unset !important;
}

.course-card__badge {
    position: absolute;
    top: 12px;
    left: 0;
    background: #2b4a8c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 90%;
}

.course-card__badge a {
    color: #fff;
    text-decoration: none;
}

.course-card__image-wrapper {
    flex-shrink: 0;
    position: relative;
    height: 200px;
    overflow: hidden;
}

.course-card__content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px 15px;
}

.course-card__title,
.course-card__title a {
    font-size: 1.1rem;
    font-weight: 700;
    color: #243b63;
    line-height: 1.1;
}

.course-card__header {
    margin-bottom: 12px;
}


.course-card__price>div>span,
.course-card__price>div:has(del) {
    background: #e7ecf7;
    color: #2b4a8c;
    display: block;
    text-align: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.course-card__price del {
    display: inline-block;
    width: 100%;
    color: #4a5568;
    opacity: .5;
    font-weight: initial;
}

.course-card__price ins {
    color: #e6318b;
    font-weight: bolder;
}

.course-card__price ins bdi {
    font-size: 1.25rem;
}

/* === CSS Hackery: Transform the table without changing HTML === */

.wp-block-woocommerce-product-specifications table {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    border: none;
    border-collapse: separate;
    border-spacing: 8px;
    /* margin: -4px; */
}

.wp-block-woocommerce-product-specifications tbody {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.wp-block-product-specifications-item {
    display: flex;
    flex-direction: column;
    background: #f8faff;
    border-radius: 6px;
    padding: 3px 6px;
    border: 1px solid #e7ecf7;
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    max-width: 50%;
    box-sizing: border-box;
    min-height: 42px;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.wp-block-product-specifications-item:hover {
    background: #f0f4ff;
}

.wp-block-product-specifications-item__label,
.wp-block-product-specifications-item__value {
    display: block;
    padding: 0;
    text-align: left;
    border: none;
    width: 100%;
}

.wp-block-product-specifications-item__label {
    font-size: 0.6rem;
    font-weight: normal;
    color: #5a6a86;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.wp-block-product-specifications-item__value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2a3e5c;
    line-height: 1.2;
}

.wp-block-product-specifications-item__value p {
    margin: 0;
}

.wp-block-product-specifications-item__value a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.wp-block-product-specifications-item__value a:hover {
    color: #2b4a8c;
    text-decoration: underline;
}

.course-card__description {
    font-size: 0.8rem;
    color: #4a5568;
    line-height: 1.2;
}

.wp-block-woocommerce-product-summary {
    flex-grow: 1;
}

.course-card__link {
    display: inline-flex;
    align-items: center;
    color: #2b4a8c;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.course-card__link:hover {
    color: #1a2d5e;
}

.course-card__link::after {
    content: "→";
    margin-left: 5px;
    transition: transform 0.2s;
}

.course-card__link:hover::after {
    transform: translateX(3px);
}

/**
* Adjusts for single-product template
*/

body.single-product .woocommerce .woocommerce-breadcrumb {
    margin-bottom: 0;
    padding: 15px 25px;
}

body.single-product .wpcbr-brands .wpcbr-brand {
    border: unset;
    border-radius: unset;
    padding: unset;
}

body.single-product .wpcbr-brands .wpcbr-brand .wpcbr-brand-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin: initial;
    box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.1);
}

body.single-product .wp-block-product-specifications-item {
    /* flex: 1 1 calc(25% - 8px); */
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    body.single-product .wp-block-product-specifications-item {
        flex: 1 1 calc(50% - 8px);
        max-width: 50%;
    }
}

@media (max-width: 480px) {
    body.single-product .wp-block-product-specifications-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

@media screen and (max-width: 1300px) {
    body.single-product .woocommerce h1.alignwide {
        margin-left: unset !important;
    }
}

/** === Institution Page styles === **/

.institution__logo img {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
}

.institution__wide-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    margin: unset !important;
    z-index: initial;
}

.institution__wide-banner+* {
    position: relative;
    z-index: 1;
}

.institution__wide-banner img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: inherit;
    object-fit: cover;
    max-height: 100%;
}


/** === Default Page styles === **/

/* Adjust fullwidth featured image banner */

body.page.page-template-default .page__featured-image {
    position: initial;
}

body.page.page-template-default .page__featured-image figure {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    width: 100%;
    height: inherit;
    margin: unset !important;
    z-index: initial;
}

body.page.page-template-default .page__featured-image figure img {
    width: 100%;
    height: inherit;
    object-fit: cover;
    object-position: center;
    max-height: 100%;
    filter: blur(1px) contrast(110%) brightness(80%);
}

body.page.page-template-default .page__featured-image~* {
    z-index: 1;
}

/** === Other changes === **/

/* Hide frontend prices for now */
body.single-product section aside {
    display: none;
    visibility: hidden;
}

.course-card__price {
    display: none;
    visibility: hidden;
}

.wp-block-woocommerce-product-filter-price {
    display: none;
    visibility: hidden;
}
