/*
Theme Name: PEDSupport Portal
Theme URI: https://bdolphin.co.uk
Description: PEDSupport Portal theme based on Total theme child
Author: TechWebUX for Blue Dolphin Ltd
Author URI: https://www.techwebux.com
Template: Total
Version: 1.0
*/

.peds-members-content-items {
    display: grid;
    /*grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));*/
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    grid-template-rows: auto auto 1fr;
    align-items: start;

    .item {
        background: #fff;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;

        display: grid;
        align-content: start;
        grid-template-rows: subgrid;
        grid-row: span 3;
        gap: 1rem;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
        }

        .item-title {
            margin: 0;
            font-size: 1.1rem;
            grid-row: 1;
        }

        .item-image {
            grid-row: 2;
            a {
                display: flex;
                img {
                    width: 100%;
                    height: auto;
                }
            }
        }

        .item-description {
            grid-row: 3;
            font-size: 0.95rem;
            color: #555;
        }
    }
}

/* Registration form */
#pmpro_form_fieldset-company-details .pmpro_form_fields {
    display: flex;
    flex-direction: initial;
    flex-wrap: wrap;
    gap: 20px;
}

/* Organisation Name: Full Width (1 column) */
#organisation_name_div {
    flex: 1 1 100%;
}

/* Other fields: Half Width (2 columns) */
#address_line_1_div,
#address_line_2_div,
#main_telephone_number_div,
#website_div {
    flex: 1 1 calc(50% - 10px);
    min-width: 250px;
}

#city_div,
#postcode_div,
#country_div {
    flex: 1 1 calc(100% / 3 - calc(var(--pmpro--base--spacing--small) / 2 * 3));
    min-width: 250px;
}

/* Ensure labels and inputs stay stacked inside the flex item */
.pmpro_form_field {
    display: flex;
    flex-direction: column;
}

/* Mobile Responsiveness: Force 1 column on small screens */
@media (max-width: 600px) {
    #address_line_1_div,
    #address_line_2_div,
    #city_div,
    #postcode_div,
    #main_telephone_number_div,
    #website_divv {
        flex: 1 1 100% !important;
    }
}

.pmpro-login-form-wrapper {
    max-width: 460px;
    margin-inline: auto;
    height: calc(100vh - var(--wpex-primary-bottom-space));
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    #pmpro_login.pmpro_section,
    .alignfull.wp-block-pmpro-login-form {
        margin: 0;
    }
}

.pmpro-login .pmpro_login_dynamic_title {
    margin-top: 0;
}

.pmpro-login #content:has(.pmpro_lost_password_wrap, .pmpro_reset_password_wrap) .login-form-intro {
    display: none;
}


/* DASHBOARD */
.peds-dash-buttons {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: var(--wpex-block-margin-bottom, var(--wpex-el-margin-bottom));
    
    .wp-block-button {
        display: flex;
        flex: 1 1 calc(100% / 3 - calc(var(--wpex-block-margin-bottom, var(--wpex-el-margin-bottom)) / 2 * 3));
        min-width: 200px;
    }
    
    .wp-block-button__link {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 1.6rem;
        line-height: 1.3;
        padding: 20px 10px;
    
        /* Sub-label */
        br+span,
        br+em,
        small {
            display: block;
            font-size: 1rem;
            font-weight: normal;
            opacity: 0.8;
            margin-top: var(--wpex-block-margin-bottom, var(--wpex-el-margin-bottom));
            font-style: normal;
        }
    }
}

@media (max-width: 600px) {
    .peds-dash-buttons .wp-block-button {
        /* Full width on mobile */
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Reorder membership items single post content (Title, Navigation, Content) */
.wp-singular .site-main:has(.post-pagination-wrap) {
    display: flex;
    flex-direction: column;
    
    /* 1. Title */
    .page-header {
        order: 1;
        margin-block-end: 0;
    }
    
    /* 2. Prev/Next navigation */
    .post-pagination-wrap {
        order: 2;
        margin-block-end: 40px;
        padding-block: 20px;
        border-block-end-width: 1px;
        border-color: var(--wpex-border-main);
    }
    
    /* 3. Content */
    #content-wrap {
        order: 3;
    }
}



/* Gravity Forms */
.gfield_required.gfield_required_text {
    font-style: italic;
}
.gform-theme--framework .gform-field-label--type-inline {
    cursor: pointer;
}
.gform-theme--framework .gchoice:hover .gform-field-label--type-inline {
    /* color: #4c93cb; */
    color: #327397;
}
.gform-theme--foundation .gfield.gf_field_inline {
    display: grid;
    column-gap: var(--gf-form-gap-x);
    grid-template-columns: auto 1fr;
    align-items: center;

    .gfield_label {
        grid-column: 1;
        width: 150px;
        float: inline-start;
        margin-bottom: 0;
    }

    .ginput_container {
        grid-column: 2;
    }
}

.gform-footer input[type="submit"].gform_button:disabled {
    display: initial!important;
    cursor: not-allowed!important;
}

/* Booking form */
.bookly-form .bookly-columnizer .bookly-day,
.bookly-form .bookly-schedule-date,
.bookly-columnizer .bookly-day,
.bookly-columnizer .bookly-hour,
.bookly-progress-tracker>div:first-child .step,
.bookly-progress-tracker>div:last-child .step {
    border-radius: 0;
}

/* Presentations */
.presentation-file {
    overflow: hidden;
    > object {
        aspect-ratio: 1280 / 850; /* 1280 / 920; */
        margin-top: -42px;
        margin-bottom: 0;
        height: auto!important;
    }
    a[id^="wp-block-file--media-"] {
        display: none;
    }
}

/* PEDS Portal CPTs title with anchor */
.page-header-title a {
    color: inherit;
    text-decoration: none;
    &:hover {
        opacity: 0.8;
    }
}

.vcex-toggle__content a {
    color: var(--wpex-blue-alt);
}

/* FAQ */
.wp-block-accordion-item {
    border-block-start: 1px solid var(--wpex-gray-200);
    border-block-end: 1px solid var(--wpex-gray-200);
    + .wp-block-accordion-item {
        border-block-start: none;
    }
    .wp-block-accordion-heading {
        margin: 0;
        font-size: 1em;
        line-height: 1.4;
        .wp-block-accordion-heading__toggle-icon {
            width: 24px;
            height: 24px;
            font-size: 24px;
            font-weight: normal;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            flex-shrink: 0;
            color: var(--wpex-link-color, var(--wpex-accent));
        }
    }
}

#peds-custom-toc,
.peds-custom-toc .gfield_consent_description {
    p {
        margin-block-end: var(--wpex-el-margin-bottom);
    }
    h2, h3 {
        margin: 30px 0 var(--wpex-el-margin-bottom);
        font-weight: var(--wpex-heading-font-weight);
    }
    h2 {
        font-size: var(--wpex-text-2xl);
    }
    h3 {
        font-size: var(--wpex-text-xl);
    }
    ul {
        margin-inline-start: var(--wpex-list-margin-side, 30px);
        list-style-position: var(--wpex-list-style-position, outside);
        list-style-type: disc;
    }
    li ul,
    li ol {
        --wpex-list-margin-bottom: 0;
        --wpex-list-margin-side: var(--wpex-child-list-margin-side, 30px);
    }
    :is(dir, menu, ol, ul) ul {
        list-style-type: circle;
    }
}


.peds-dash-buttons .wpex-icon {
    margin-bottom: 20px;
}
