/**
 * MG QuickCal Event List
 *
 * Layout helpers only. Colors are inherited from QuickCal/Booked and from the
 * site's own CSS snippets.
 */

.mg-quickcal-event-list .mg-qcel-hidden-nav {
    display: none !important;
}

.mg-quickcal-event-list .mg-qcel-header {
    margin: 0 0 0.75rem;
}

.mg-quickcal-event-list .mg-qcel-header h2,
.mg-quickcal-event-list .booked-appt-list-header h2 {
    font-size: 1rem;
    line-height: 1.3;
}

.mg-quickcal-event-list .mg-qcel-date-group {
    margin: 0 0 1rem;
}

.mg-quickcal-event-list .mg-qcel-date-heading {
    display: block;
    margin: 0;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    background: rgba(0, 0, 0, 0.04);
    color: inherit;
}

/*
 * Desktop/tablet layout
 *
 * QuickCal's native list view uses floats and fixed heights in some cases.
 * That breaks once Location and Infotext add extra lines. The shortcode rows
 * are therefore made content-driven and flex-based on all viewport sizes.
 */
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title.timeslot-count-hidden {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1.5rem !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 1.1rem 1.25rem !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-time,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title .timeslot-time,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title.timeslot-count-hidden .timeslot-time {
    display: block !important;
    visibility: visible !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    font-size: inherit;
    line-height: inherit;
    text-align: left !important;
}

body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title .timeslot-people,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title.timeslot-count-hidden .timeslot-people {
    display: flex !important;
    visibility: visible !important;
    float: none !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    margin: 0 0 0 auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    font-size: inherit;
    line-height: inherit;
    text-align: right !important;
}

body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.new-appt,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.button,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0.65em 1.05em !important;
    font-size: 0.95em;
    line-height: 1.2;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* Hide the mobile-only title/time inside the button on desktop and custom mobile layout. */
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.new-appt .timeslot-mobile-title,
body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.new-appt .button-timeslot {
    display: none !important;
}

body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.new-appt .button-text {
    display: inline !important;
    visibility: visible !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: nowrap !important;
}

.mg-quickcal-event-list .timeslot:last-child {
    margin-bottom: 0;
}

/* Event title. */
.mg-quickcal-event-list .timeslot .timeslot-title {
    display: block !important;
    margin: 0 0 0.45rem !important;
    font-size: 1em;
    line-height: 1.25;
    font-weight: 700;
    text-align: left !important;
    white-space: normal !important;
}

/* Optional public Location / Web-Adresse line below the event title. */
.mg-quickcal-event-list .timeslot .timeslot-location {
    display: block !important;
    margin: 0 0 0.55rem !important;
    font-size: 0.95em;
    line-height: 1.35;
    font-weight: 400;
    color: inherit;
    opacity: 0.82;
    text-align: left !important;
    white-space: normal !important;
}

.mg-quickcal-event-list .timeslot .timeslot-location a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    overflow-wrap: anywhere;
}

/* Infotext line below Location / Web-Adresse. */
.mg-quickcal-event-list .timeslot .timeslot-info {
    display: block !important;
    margin: 0.45rem 0 0.75rem !important;
    max-width: 760px;
    font-size: 0.95em;
    line-height: 1.5;
    font-weight: 400;
    color: inherit;
    opacity: 0.82;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.mg-quickcal-event-list .timeslot .timeslot-info a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    overflow-wrap: anywhere;
}

.mg-quickcal-event-list .timeslot .timeslot-range,
.mg-quickcal-event-list .timeslot .spots-available {
    display: block !important;
    margin-top: 0.35rem !important;
    font-size: 0.95em;
    line-height: 1.35;
    text-align: left !important;
    white-space: normal !important;
}

/*
 * Mobile layout
 * Keep information outside the green booking button. The button stays a button.
 */
@media screen and (max-width: 720px) {
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title.timeslot-count-hidden {
        gap: 0.95rem !important;
        padding: 1rem 1.25rem !important;
    }

    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-info {
        max-width: 100% !important;
    }
}

/* On very narrow screens the button moves below the text. */
@media screen and (max-width: 480px) {
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot.has-title.timeslot-count-hidden {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-time {
        width: 100% !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }

    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
        flex: 0 0 auto !important;
    }

    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.new-appt,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people button.button,
    body .booked-calendar-wrap.booked-list-view.mg-quickcal-event-list .booked-appt-list .timeslot .timeslot-people .button {
        width: auto !important;
        max-width: 100% !important;
    }
}

/* Compatibility fix: BoldThemes / Bold Builder frontend editor toggle. */
body #bt_bb_fe_preview_toggler.bt_bb_fe_preview_toggler {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 2147483647 !important;
}

body #bt_bb_fe_preview_toggler.bt_bb_fe_preview_toggler::before,
body #bt_bb_fe_preview_toggler.bt_bb_fe_preview_toggler::after {
    visibility: visible !important;
    opacity: 1 !important;
}
