﻿/* Works on Chrome/Edge/Safari */
*::-webkit-scrollbar {
    width: 4px;
}

*::-webkit-scrollbar-track {
    background: var(--body-lightest);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--body-lighter);
    border-radius: 20px;
}

*[draggable] {
    cursor: move !important;
}

a[disabled] {
    pointer-events: none;
}

menu {
    margin: 0;
}

/* CMS Form Field Classes */
.cms-form-canvas {
    display: flex;
    flex-wrap: wrap;
}

.cms-form-row {
    display: flex;
    flex-direction: row;
    flex-basis: 100%;
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .cms-form-row {
        flex-wrap: nowrap;
    }
}

/*@media (min-width: 768px) {
    .cms-form-row:has(.cms-form-field:nth-last-child(2)) .cms-form-field {
        flex-basis: 50%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(3)) .cms-form-field {
        flex-basis: 50%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(4)) .cms-form-field {
        flex-basis: 50%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(5)) .cms-form-field {
        flex-basis: 50%;
    }
}


@media (min-width: 992px) {
    .cms-form-row:has(.cms-form-field:nth-last-child(2)) .cms-form-field {
        flex-basis: 50%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(3)) .cms-form-field {
        flex-basis: 33.3333%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(4)) .cms-form-field {
        flex-basis: 25%;
    }

    .cms-form-row:has(.cms-form-field:nth-last-child(5)) .cms-form-field {
        flex-basis: 20%;
    }
}*/

.cms-form-field {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    flex-basis: 100%;
}

.validation-message {
    color: var(--danger);
    width: 100%;
    font-size: 80%;
    font-weight: 400;
}

/* Accordion styles */
.accordion .card-header {
    cursor: pointer;
}

    .accordion .card-header[disabled] {
        cursor: default;
    }

.accordion-content {
    max-height: 500px;
    overflow: auto;
    transition: all 0.3s ease-in-out;
}

    .accordion-content:has(.multiselect-overlay:not([hidden])) {
        overflow: visible;
    }

.accordion-collapse {
    max-height: 0 !important;
    overflow: hidden;
}

.accordion-icon {
    transition: transform ease-in-out 0.20s
}
/* CMS Layout classes */
.cms-canvas {
    display: flex;
}

.cms-layout {
    display: flex;
    flex-grow: 1;
}

.cms-container {
    flex-grow: 1;
    background-clip: padding-box;
    position: relative;
}

.cms-row {
    flex-direction: row;
}

.cms-column {
    flex-direction: column;
}

@media (max-width: 800px) {
    .cms-row {
        flex-direction: column;
    }

    .cms-column {
        width: unset !important;
    }
}

*[data-anchor="true"] {
    scroll-margin-top: 6rem;
}

/* horizontal scroll and carousel support classes */
.hs-wrapper {
    position: relative;
}

.hs-container {
    display: flex;
    overflow-x: auto;
    max-width: 410px;
}

.hs-button-back {
    left: 12px;
}

.hs-button-next {
    right: 12px;
}

@media (min-width:576px) {
    .hs-container {
        max-width: unset;
    }

    .hs-button-back {
        left: 0;
    }

    .hs-button-next {
        right: 0;
    }
}

.hs-container img {
    height: 190px;
}

.hs-container::-webkit-scrollbar {
    display: none;
}

.hs-item {
    z-index: 60;
}

.hs-button {
    position: absolute;
    top: 30%;
    background-color: rgba(255,255,255,0.4);
    border: none;
    color: var(--body);
    border-radius: 0.5rem;
    z-index: 80;
    padding: 1rem;
    box-shadow: 0 4px 12px 0 rgb(0, 0, 0, 0.15);
    transition: all 0.3s ease-in-out;
}

    .hs-button:hover {
        background-color: rgba(255,255,255,0.9);
    }

    .hs-button:focus {
        outline: none;
    }

.icon-button-wrapper .btn-title {
    margin-left: 0.5rem;
    display: block;
}

@media (max-width:576px) {
    .icon-button-wrapper .btn-title {
        margin-left: 0;
        display: none;
    }
}

/* carousel support classes */
.carousel-wrapper {
    position: relative;
    min-height: 340px;
}

.carousel-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    overflow: hidden;
    counter-reset: carousel-item;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory
}

.carousel-item {
    position: relative;
    flex: 0 0 100%;
    counter-increment: carousel-item;
    transition-property: opacity, transform;
    transition-duration: 0.4s, 0.6s;
    transition-timing-function: linear, ease-in-out;
    transition-delay: 0.2s, 0s;
}

.carousel-item-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.carousel-item-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carousel-button {
    position: absolute;
    background-color: rgba(255,255,255,0.4);
    border: none;
    color: var(--body);
    border-radius: 0.5rem;
    z-index: 80;
    padding: 1rem;
    box-shadow: 0 4px 12px 0 rgb(0, 0, 0, 0.15);
    transition: all 0.3s ease-in-out;
}

    .carousel-button:hover {
        background-color: rgba(255,255,255,0.9);
    }

    .carousel-button:focus {
        outline: none;
    }

.carousel-button-back {
    top: 50%;
    transform: translate(0, -50%);
    left: 12px;
}

.carousel-button-next {
    top: 50%;
    right: 12px;
    transform: translate(0, -50%);
}

.carousel-button-down {
    bottom: 12px;
    left: 50%;
    transform: translate(-50%, 0);
}

.camera-video-area {
    position: relative;
    /*overflow: hidden;*/
    width: 90%;
    max-width: 640px;
    height: 480px;
    display: inline-block;
}

@media (max-width: 576px) {
    .camera-video-area {
        width: 100%;
        height: 380px;
    }
}

/* Camera Classes */
.camera-stream {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    border: none;
    backdrop-filter: saturate(200%) blur(30px);
    background-color: rgb(255,255,255, 0.5);
    box-shadow: 0 4px 12px 0 rgb(0, 0, 0, 0.15);
}

.camera-selector {
    position: relative;
    margin-top: 1em;
    margin-left: 5%;
    width: 90%;
}

.camera-video-area button {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 1em;
}

.camera-grab {
    left: 0;
}

.camera-stop-hidden {
    background-color: transparent;
    color: transparent;
}

.square {
    width: 50%;
    height: 50%;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.65);
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

.camera-stream-scan-overlay {
    width: 40%;
    height: 1%;
    border-top: 2px solid rgba(255, 255, 255, 0.65);
    position: absolute;
    transform: translate(-50%, -50%);
    transition: height 2s;
    top: 30%;
    left: 50%;
    animation-duration: 3s;
    animation-name: lineup;
    animation-direction: alternate;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes lineup {
    100% {
        top: 70%;
    }
}

.badge-list-primary {
    .badge {
        color: var(--body);
        background-color: var(--primary-lighter);
        border: 1px solid var(--primary);
        margin-right: 0.4rem;
    }
}

.badge-list-secondary {
    .badge {
        color: var(--body);
        background-color: var(--secondary-lighter);
        border: 1px solid var(--secondary);
        margin-right: 0.4rem;
    }
}

.badge-list-body {
    .badge {
        color: var(--body);
        background-color: var(--body-lighter);
        border: 1px solid var(--body);
        margin-right: 0.4rem;
    }
}

.badge-list-info {
    .badge {
        color: var(--body);
        background-color: var(--info-lighter);
        border: 1px solid var(--info);
        margin-right: 0.4rem;
    }
}

.badge-list-highlight {
    .badge {
        color: var(--highlight);
        background-color: var(--highlight-lighter);
        border: 1px solid var(--highlight);
        margin-right: 0.4rem;
    }
}

.badge-list-success {
    .badge {
        color: var(--success);
        background-color: var(--success-lighter);
        border: 1px solid var(--success);
        margin-right: 0.4rem;
    }
}

.badge-list-danger {
    .badge {
        color: var(--danger);
        background-color: var(--danger-lighter);
        border: 1px solid var(--danger);
        margin-right: 0.4rem;
    }
}

.badge-list-warning {
    .badge {
        color: var(--warning);
        background-color: var(--warning-lighter);
        border: 1px solid var(--warning);
        margin-right: 0.4rem;
    }
}

.search-result-wrapper {
    padding-top: 1rem;
    padding-bottom: 1rem;

    .card {
        box-shadow: 0 4px 12px 0 rgb(0, 0, 0, 0.15);
        transition: box-shadow 0.25s ease-in-out;

        .card-header {
            background-color: var(--primary);
            color: white;
            font-weight: 600;
        }

        .card-body img {
            width: 40%;
            object-position: center;
            object-fit: cover;
            margin-right: 1.2rem;
        }

        .card-footer {
            text-align: right;
        }
    }

    .card:hover {
        box-shadow: 2px 6px 12px 0 rgb(0, 0, 0, 0.25);
    }
}

/* Image Gallery block rendering - shared so it applies both to the published site and to
   the CMS Page canvas preview of a placed (not currently open) Gallery block, which renders
   the block's raw HTMLContent the same way any other block does. */
.image-gallery-content,
.image-gallery-group {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.image-gallery-content {
    margin-bottom: 1rem;
}

.image-gallery-item {
    overflow: hidden;
}

    .image-gallery-item img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ig-col-1 { grid-column: span 1; }
.ig-col-2 { grid-column: span 2; }
.ig-col-3 { grid-column: span 3; }
.ig-col-4 { grid-column: span 4; }
.ig-col-5 { grid-column: span 5; }
.ig-col-6 { grid-column: span 6; }
.ig-col-7 { grid-column: span 7; }
.ig-col-8 { grid-column: span 8; }
.ig-col-9 { grid-column: span 9; }
.ig-col-10 { grid-column: span 10; }
.ig-col-11 { grid-column: span 11; }
.ig-col-12 { grid-column: span 12; }

@media (max-width: 768px) {
    .image-gallery-content > *,
    .image-gallery-group > * {
        grid-column: span 12 !important;
    }
}
/* ---------- form controls ---------- */

/* The signature field. The ink is the canvas's colour, so a site can restyle it with color. */
.signature-pad {
    display: block;
    width: 100%;
    height: 12rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: transparent;
    color: #212529;
    cursor: crosshair;
    /* the pointer draws instead of scrolling the page */
    touch-action: none;
}

/* The number slider: the browser's range input, with the value above the handle and the ends
   labelled below. --range-fraction is where the handle sits, from 0 to 1. */
.range-slider {
    --range-thumb: 1.25rem;
    position: relative;
    width: 100%;
    padding-top: 2rem;
}

.range-slider-input {
    display: block;
    width: 100%;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.range-slider-value {
    position: absolute;
    top: 0;
    left: calc(var(--range-thumb) / 2 + var(--range-fraction) * (100% - var(--range-thumb)));
    transform: translateX(-50%);
    min-width: 2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    background-color: var(--primary);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
}

.range-slider-unset .range-slider-value {
    background-color: #6c757d;
}

/* untouched, the handle is shown faded so it doesn't look like an answer */
.range-slider-unset .range-slider-input {
    opacity: 0.6;
}

.range-slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* read only, as in a form's preview: the signature and value show, but can't be changed */
.signature-pad-readonly {
    pointer-events: none;
    cursor: default;
}

.range-slider-input:disabled {
    cursor: default;
}

/* ---------- charts ---------- */

/* The colours series take when a page doesn't give them one, in order. The first four are the tenant
   theme's own colours, falling back to fixed ones when the theme doesn't set them; a theme can also
   override any of them. */
:root {
    --chart-color-1: var(--primary, #a16ee5);
    --chart-color-2: var(--secondary, #f7ce69);
    --chart-color-3: var(--info, #55a5c2);
    --chart-color-4: var(--highlight, #7ddf1e);
    --chart-color-5: #ff6ea6;
    --chart-color-6: #7953ac;
    --chart-color-7: #b99b4f;
    --chart-color-8: #407c92;
    --chart-color-9: #5ea716;
    --chart-color-10: #b91c52;
    --chart-text-color: #495057;
    --chart-grid-color: #e9ecef;
    --chart-axis-color: #adb5bd;
    /* the light and dark text for labels on a bar or slice, the theme's own where it sets them;
       chartSize.js picks whichever contrasts more with the colour underneath */
    --chart-inside-label-light: var(--light, #fff);
    --chart-inside-label-dark: var(--dark, #212529);
    --chart-tooltip-background: rgba(33, 37, 41, 0.92);
    --chart-tooltip-color: #fff;
}

.bar-chart {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* the drawing takes whatever height the chart's title and legend leave */
.chart-area {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.bar-chart svg {
    display: block;
    overflow: visible;
}

.bar-chart-grid {
    stroke: var(--chart-grid-color);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.bar-chart-axis {
    stroke: var(--chart-axis-color);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.bar-chart-tick,
.bar-chart-category {
    fill: var(--chart-text-color);
    font-size: 12px;
}

.bar-chart-title {
    fill: var(--chart-text-color);
    font-size: 13px;
    font-weight: 600;
}

.bar-chart-value {
    fill: var(--chart-text-color);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.bar-chart-value-inside {
    fill: var(--chart-inside-label-light);
}

.bar-chart-bar {
    transition: opacity 0.15s;
}

    .bar-chart-bar:hover {
        opacity: 0.85;
    }

.bar-chart-clickable .bar-chart-bar {
    cursor: pointer;
}

/* bars grow in from zero when they appear, which includes a series being shown from the legend */
.bar-chart-animate .bar-chart-bar {
    transform-box: fill-box;
    animation: bar-chart-grow-y 0.6s ease-out both;
}

.bar-chart-animate .bar-chart-grow-up {
    transform-origin: bottom;
}

.bar-chart-animate .bar-chart-grow-down {
    transform-origin: top;
}

.bar-chart-animate .bar-chart-grow-right,
.bar-chart-animate .bar-chart-grow-left {
    animation-name: bar-chart-grow-x;
}

.bar-chart-animate .bar-chart-grow-right {
    transform-origin: left;
}

.bar-chart-animate .bar-chart-grow-left {
    transform-origin: right;
}

.bar-chart-animate .bar-chart-value {
    animation: chart-fade-in 0.6s ease-out both;
}

@keyframes bar-chart-grow-y {
    from {
        transform: scaleY(0);
    }
}

@keyframes bar-chart-grow-x {
    from {
        transform: scaleX(0);
    }
}

@keyframes chart-fade-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bar-chart-animate .bar-chart-bar,
    .bar-chart-animate .bar-chart-value {
        animation: none;
    }
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
    margin: 0.25rem 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

    .chart-legend button {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.125rem 0.25rem;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        cursor: pointer;
    }

        /* a hidden series stays in the legend, struck through, so it can be shown again */
        .chart-legend button[aria-pressed="false"] {
            opacity: 0.45;
            text-decoration: line-through;
        }

.chart-swatch {
    display: inline-block;
    flex: none;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.25rem;
    border-radius: 2px;
    vertical-align: -0.05em;
}

.chart-tooltip {
    position: absolute;
    z-index: 10;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--chart-tooltip-background);
    color: var(--chart-tooltip-color);
    font-size: 0.8125rem;
    line-height: 1.35;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.chart-tooltip-heading {
    font-weight: 600;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

/* the data table, for screen readers only */
.chart-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pie-chart {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.pie-chart svg {
    display: block;
    overflow: visible;
}

.pie-chart-slice {
    stroke: var(--chart-slice-border, #fff);
    stroke-width: 1;
    transition: opacity 0.15s;
}

    .pie-chart-slice:hover {
        opacity: 0.85;
    }

.pie-chart-clickable .pie-chart-slice {
    cursor: pointer;
}

.pie-chart-connector {
    fill: none;
    stroke-width: 1;
}

.pie-chart-label {
    fill: var(--chart-text-color);
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.pie-chart-label-inside {
    fill: var(--chart-inside-label-light);
}

/* the pie grows out from its middle, and the labels fade in after it */
.pie-chart-animate .pie-chart-slices {
    animation: pie-chart-grow 0.6s ease-out both;
}

.pie-chart-animate .pie-chart-label,
.pie-chart-animate .pie-chart-connector {
    animation: chart-fade-in 0.4s 0.4s ease-out both;
}

@keyframes pie-chart-grow {
    from {
        transform: scale(0.6) rotate(-30deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pie-chart-animate .pie-chart-slices,
    .pie-chart-animate .pie-chart-label,
    .pie-chart-animate .pie-chart-connector {
        animation: none;
    }
}

.chart-title {
    margin: 0.25rem 0;
    font-family: var(--font-family-headings, inherit);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}
