/* --- Blockquotes --- */

.richtext blockquote,
.container blockquote {
    border-left: 6px solid #FF0630;
    margin: 2rem 0;
    padding: 2.5rem 2rem 2.5rem 3rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0 12px 12px 0;
    position: relative;
    line-height: 1.6;
    font-style: italic;
    color: var(--pico-contrast);
    overflow: visible;
    display: flow-root;
}

.richtext blockquote::before,
.container blockquote::before {
    content: "\f10d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-block;
    vertical-align: top;
    font-size: 1.5rem;
    color: #FF0630;
    opacity: 0.15;
    font-style: normal;
    margin-right: 1rem;
    margin-top: -0.25rem;
}

[data-theme="dark"] .richtext blockquote {
    background: rgba(255, 255, 255, 0.05);
}

.quote-centering-wrapper {
    display: flow-root;
    position: relative;
    margin-top: 7.75rem;
    margin-bottom: 2rem;
}

.quote-author-overlap {
    position: absolute;
    top: -6.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.quote-author-overlap img {
    width: 12.5rem;
    min-width: 12.5rem;
    max-width: none !important;
    height: 12.5rem;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.15);
    display: block;
    border: none;
    opacity: 1 !important;
}

.quote-text-content p {
    font-style: italic;
}

.quote-block-container blockquote {
    margin: 0 1rem;
    text-align: left;
    display: flow-root;
}

.quote-block-container blockquote.has-profile-overlap {
    padding-top: 6.875rem;
}

/* When 'Show Author Image' is unchecked, remove the top margin reserved
   for the author circle overlap and any residual blockquote padding-top. */
.quote-centering-wrapper.no-author-image {
    margin-top: 0;
}

@media (max-width: 768px) {
    .quote-block-container {
        margin-left: 0;
        margin-right: 0;
    }

    .quote-block-container blockquote {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .quote-author-overlap img {
        width: 7.25rem;
        min-width: 7.25rem;
        height: 7.25rem;
    }

    .quote-author-overlap {
        top: -3.625rem;
    }

    .quote-centering-wrapper {
        margin-top: 5rem;
    }

    .quote-block-container blockquote.has-profile-overlap {
        padding-top: 4.25rem;
    }

    .quote-centering-wrapper.no-author-image {
        margin-top: 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .quote-author-overlap img {
        width: 9.375rem;
        min-width: 9.375rem;
        height: 9.375rem;
    }

    .quote-author-overlap {
        top: -4.6875rem;
    }

    .quote-centering-wrapper {
        margin-top: 6.1875rem;
    }

    .quote-block-container blockquote.has-profile-overlap {
        padding-top: 5.3125rem;
    }

    .quote-centering-wrapper.no-author-image {
        margin-top: 0;
    }
}

.quote-block-container blockquote::before {
    display: inline-block;
    margin-bottom: 1.5rem;
    margin-left: 0;
}

.quote-block-container blockquote cite {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #373c44;
    font-weight: 700;
    font-style: normal;
}

/* --- Code Blocks --- */

.container code {
    display: block;
    background: #f8f9fa;
    border-left: 35px solid #e9ecef;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #495057;
    word-break: break-all;
    white-space: pre-wrap;
    border-radius: 4px;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02);
}

.container code::before {
    content: "1";
    position: absolute;
    left: -25px;
    top: 1.5rem;
    color: #adb5bd;
    font-size: 0.8rem;
}

[data-theme="dark"] .container code {
    background: #212529;
    border-left-color: #343a40;
    color: #e9ecef;
}

.content-block-wrapper,
.glass-card-wrapper {
    display: flow-root;
    margin: 1.5rem 0;
}

/* Clear default Pico close button backgrounds and pseudo-elements */
dialog.pico [aria-label="Close"]::before,
dialog.pico [aria-label="Close"]::after,
dialog.pico .close::before,
dialog.pico .close::after {
    display: none !important;
    content: none !important;
}
dialog.pico [aria-label="Close"],
dialog.pico .close {
    background-image: none !important;
    background: none !important;
}

#contact-modal {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    max-width: 800px;
    width: 90%;
    overflow: hidden !important;
    padding: 0;
}

#contact-modal article {
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 0;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#contact-modal article::-webkit-scrollbar {
    display: none;
}

#contact-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#contact-modal header {
    background-color: transparent;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem 0 1.5rem;
}

#contact-modal header h3 {
    margin: 0;
}

#contact-modal .close {
    margin-bottom: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
    color: #FF0630;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
}

#contact-modal .close:hover {
    opacity: 1;
    color: var(--pico-primary-hover);
}

#contact-modal footer {
    padding-top: 1rem;
}

#qc-enquiry-capture .grid {
    grid-row-gap: 0;
}

#contact-modal legend {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: bold;
}

#contact-modal fieldset {
    font-size: 0.8rem;
    margin-top: var(--pico-spacing);
}

#contact-modal label[for="privacy_policy"] {
    font-size: 0.8rem;
}

#contact-modal label[for="marketing_opt_in"] {
    font-size: 0.8rem;
}

#contact-modal input#firstname,
#contact-modal input#lastname,
#contact-modal input#email,
#contact-modal input#phone,
#contact-modal textarea#message {
    margin-bottom: 0.1rem;
}

.pico #qc-enquiry-capture label:has([type=checkbox], [type=radio]) {
    margin-bottom: 0.2rem;
}

.form-success {
    text-align: center;
    padding: 2rem;
}

.form-success .success-rocket {
    font-size: 3rem;
}

.form-error {
    color: #fff;
    margin: 1rem;
    padding: 1rem;
    font-size: 0.8rem;
    text-align: center;
    background-color: rgba(184, 4, 67, 1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#contact-modal label[for="firstname"] span,
#contact-modal label[for="lastname"] span,
#contact-modal label[for="email"] span,
#contact-modal label[for="phone"] span,
#contact-modal label[for="message"] span {
    display: none;
}

.recaptcha-disclaimer {
    font-size: 0.7rem;
    color: #666;
    margin-top: 1rem;
    text-align: center;
}

@media (max-width: 766px) {

    #contact-modal article,
    #newsletter-modal article {
        width: calc(100% - 6px) !important;
        max-width: calc(100% - 6px) !important;
        margin-left: 3px !important;
        margin-right: 3px !important;
    }

    #contact-modal article {
        padding: 1.5rem 1.2rem;
    }

    #contact-modal input,
    #contact-modal textarea {
        margin-top: 0;
        margin-bottom: 0;
    }

    #contact-modal label[for="privacy_policy"] {
        font-size: 0.7rem;
    }

    #contact-modal label[for="marketing_opt_in"] {
        font-size: 0.7rem;
    }

    #contact-modal fieldset {
        margin-top: 1rem;
        margin-bottom: 0.2rem;
    }

    #contact-modal fieldset div.grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    #contact-modal fieldset label {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .recaptcha-disclaimer {
        margin-top: 0.5rem;
        margin-bottom: 0;
        font-size: 0.65rem;
        line-height: 1.2;
    }

}

/* --- NEWSLETTER MODAL --- */

#newsletter-modal {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    max-width: 800px;
    width: 90%;
    overflow: hidden !important;
    padding: 0;
}

#newsletter-modal article {
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 0;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#newsletter-modal article::-webkit-scrollbar {
    display: none;
}

#newsletter-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#newsletter-modal header {
    background-color: transparent;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem 0 1.5rem;
}

#newsletter-modal header h3 {
    margin: 0;
}

#newsletter-modal .close {
    margin-bottom: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
    color: #FF0630;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
}

#newsletter-modal .close:hover {
    opacity: 1;
    color: var(--pico-primary-hover);
}

#newsletter-modal footer {
    padding-top: 1rem;
}

#qc-newsletter-capture .grid {
    grid-row-gap: 0;
}

#newsletter-modal legend {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: bold;
}

#newsletter-modal fieldset {
    font-size: 0.8rem;
    margin-top: var(--pico-spacing);
}

#newsletter-modal label[for="newsletter_privacy_policy"] {
    font-size: 0.8rem;
}

#newsletter-modal label[for="newsletter_marketing_opt_in"] {
    font-size: 0.8rem;
}

#newsletter-modal input#newsletter_firstname,
#newsletter-modal input#newsletter_lastname,
#newsletter-modal input#newsletter_email,
#newsletter-modal input#newsletter_phone {
    margin-bottom: 0.1rem;
}

#newsletter-modal label[for="newsletter_firstname"] span,
#newsletter-modal label[for="newsletter_lastname"] span,
#newsletter-modal label[for="newsletter_email"] span,
#newsletter-modal label[for="newsletter_phone"] span {
    display: none;
}

@media (max-width: 766px) {

    #newsletter-modal article {
        padding: 1.5rem 1.2rem;
    }

    #newsletter-modal input,
    #newsletter-modal textarea {
        margin-top: 0;
        margin-bottom: 0;
    }

    #newsletter-modal label[for="newsletter_privacy_policy"] {
        font-size: 0.7rem;
    }

    #newsletter-modal label[for="newsletter_marketing_opt_in"] {
        font-size: 0.7rem;
    }

    #newsletter-modal fieldset {
        margin-top: 1rem;
        margin-bottom: 0.2rem;
    }

    #newsletter-modal fieldset div.grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    #newsletter-modal fieldset label {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
}

/* --- IMAGE MODAL SPECIFIC STYLES --- */

/* === IMAGE MODAL ===
   Pico CSS sets dialog > article { max-width: 510px } at ≥576px viewport.
   We must explicitly override this on the article, not just the dialog, and
   use fixed viewport-relative widths (not fit-content) so the modal is
   always LARGER than the constrained on-page image. */

#image-modal {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    /* Pico sets min-width/min-height: 100% on dialog — unset both */
    min-width: unset !important;
    min-height: unset !important;
    /* Explicit 90vw so the dialog is clearly larger than any page image */
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 92vh !important;
    padding: 0 !important;
    /* visible so the article's border-radius shows and nothing is clipped */
    overflow: visible !important;
    border-radius: 0 !important;
}

#image-modal article {
    background-color: rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    margin: 0 !important;
    /* CRITICAL: must be on the article, not just the dialog, to beat Pico */
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 92vh !important;
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex !important;
    flex-direction: column !important;
    /* Allows the close button to be absolutely positioned within the card */
    position: relative !important;
}

#image-modal::-webkit-scrollbar,
#image-modal article::-webkit-scrollbar {
    display: none;
}

#image-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#image-modal header {
    /* Lifted out of normal flex flow so it never pushes the image down
       or risks being clipped by the article's overflow:hidden + border-radius.
       Positioned safely inside the 8px corner radius (0.75rem ≈ 12px). */
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 10;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
}

#image-modal .close {
    margin: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
    color: #FF0630;
    text-decoration: none;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    background: transparent;
    border: none !important;
}

#image-modal .close:hover {
    opacity: 1;
    color: var(--pico-primary-hover);
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#image-modal .close:active,
#image-modal .close:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
}

/* Flex child containing figure/image.
   min-height:0 is essential in a flex-column container — without it the
   child cannot shrink below its intrinsic height and max-height is ignored.
   padding-top reserves space so the image never starts behind the
   absolutely-positioned close button. */
.image-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 2.5rem top = close button height (~1.5rem) + comfortable gap */
    padding: 2.5rem 1.25rem 1rem 1.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.image-modal-body figure.standalone-image,
.image-modal-body figure.content-image,
.image-modal-body figure {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    /* Figure is taller than the image constraint so the figcaption below
       the image has room to render. Body padding (3.5rem) + breathing (2.5rem) */
    max-height: calc(92vh - 6rem) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
}

.image-modal-body figure img,
.image-modal-body img {
    width: 100% !important;
    height: auto !important;
    /* Match figure constraint so the image doesn't overflow its flex parent */
    max-height: calc(92vh - 9rem) !important;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    padding: 0 !important;
    margin: 0 !important;
}

.image-modal-body figcaption,
.image-modal-body .image-caption {
    margin-top: 0.6rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--pico-color);
    background: transparent !important;
    padding: 0 0 0.4rem 0 !important;
    font-size: 0.9rem;
    font-style: italic;
}



figure.standalone-image img,
figure.content-image img,
.richtext-image,
figure img,
.callout-card-media.media-image img {
    cursor: zoom-in;
}

figure.standalone-image img:hover,
figure.content-image img:hover,
.richtext-image:hover,
figure img:hover,
.callout-card-media.media-image img:hover {
    opacity: 0.95;
    transition: opacity 0.2s ease-in-out;
}

.grecaptcha-badge {
    visibility: hidden !important;
}

/* --- Wagtail Native Form Builder (.pico-form-wrapper) --- */

.pico-form-wrapper form,
.pico-form-wrapper.native-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
}

.pico label:has([type=checkbox], [type=radio]) {
    margin-bottom: 0;
}

.pico .form-fieldset label:has([type=checkbox], [type=radio]) {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {

    .pico-form-wrapper form,
    .pico-form-wrapper.native-form {
        grid-template-columns: 1fr;
    }
}

.pico-form-wrapper .field-wrapper:has(textarea),
.pico-form-wrapper .field-wrapper:has(input[type="checkbox"]),
.pico-form-wrapper .field-wrapper:has(input[type="radio"]),
.pico-form-wrapper button[type="submit"] {
    grid-column: 1 / -1;
}

.pico-form-wrapper small.help-text {
    display: block;
    margin-top: -1rem;
    margin-bottom: 1rem;
    color: var(--pico-muted-color);
}

#qc-newsletter-capture label {
    margin-bottom: 0.2rem;
}

/* --- STREAMFORMS OVERRIDES (Pico CSS Grid Integration) --- */

.pico-form-wrapper .field-wrapper {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
}

.pico-form-wrapper .field-wrapper.half-width {
    grid-column: span 1;
}

.pico-form-wrapper p {
    grid-column: 1 / -1;
}

.pico-form-wrapper input:not([type="checkbox"]):not([type="radio"]),
.pico-form-wrapper select,
.pico-form-wrapper textarea {
    margin-bottom: 0.25rem;
    width: 100%;
    scroll-margin-top: 150px;
}

.pico-form-wrapper .field-wrapper .help-text {
    font-size: 0.65rem;
    color: var(--pico-muted-color);
    margin-top: 0.25rem;
}

/* --- Wagtail Native & HubSpot Form Message Alerts --- */

.pico .pico-form-wrapper .alert,
.pico .alert,
.pico-form-wrapper .alert,
.alert {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
    padding: var(--pico-block-spacing-vertical, 1.5rem) var(--pico-block-spacing-horizontal, 1.5rem);
    border-radius: var(--pico-border-radius, 8px);
    margin-top: 1rem;
    margin-bottom: var(--pico-spacing, 1.5rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 0.5rem;
}

.pico .alert h3,
.alert h3 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.pico .alert p,
.alert p {
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.5;
}

.pico .alert-success,
.alert-success {
    background-color: #ffffff;
    border: 1px solid rgba(39, 174, 96, 0.4);
    border-left: 5px solid #27ae60;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pico .alert-success h3,
.alert-success h3 {
    color: #1c164e;
}

.pico .alert-success p,
.alert-success p {
    color: #373c44;
    font-weight: 500;
}

.pico-form-wrapper.native-form fieldset.form-fieldset {
    border: 1px solid var(--pico-muted-border-color);
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: var(--pico-spacing);
    border-radius: var(--pico-border-radius);
    background-color: transparent;
}

.pico-form-wrapper.native-form fieldset.form-fieldset legend {
    background-color: var(--pico-background-color);
    padding: 0 0.5rem;
    margin-left: -0.5rem;
    width: auto;
    margin-bottom: 0;

    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--pico-color);
}

.pico-form-wrapper.native-form fieldset.form-fieldset .fieldset-content {
    margin-top: 0.5rem;
}

.pico-form-wrapper.native-form .field-wrapper>label>input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-top: 0;
}

.pico .alert-danger,
.alert-danger {
    background-color: #ffffff;
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-left: 5px solid #e74c3c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pico .alert-danger h3,
.alert-danger h3 {
    color: #c0392b;
}

.pico .alert-danger p,
.alert-danger p {
    color: #c0392b;
    font-weight: 500;
}

@media (max-width: 576px) {
    .pico-form-wrapper form {
        grid-template-columns: 1fr;
    }

}

/* --- HubSpot field-level validation errors --- */

/* Red border + subtle tint on the invalid input itself.
   Uses the pico selector class (per project rules) and !important to beat
   Pico's CSS custom-property-based border on form elements. */
.pico .field-wrapper.field-has-error input,
.pico .field-wrapper.field-has-error select,
.pico .field-wrapper.field-has-error textarea {
    border-color: rgba(231, 76, 60, 0.7) !important;
    background-color: rgba(231, 76, 60, 0.04) !important;
    animation: field-shake 0.4s ease;
}

/* Brief horizontal shake draws attention without jarring the user */
@keyframes field-shake {
    0%,  100% { transform: translateX(0); }
    20%        { transform: translateX(-6px); }
    40%        { transform: translateX(6px); }
    60%        { transform: translateX(-4px); }
    80%        { transform: translateX(4px); }
}

/* Inline helper note rendered below the invalid field */
.field-error-message {
    display: block;
    margin-top: 0.4rem;
    padding: 0.45rem 0.75rem;
    background-color: rgba(231, 76, 60, 0.07);
    border-left: 3px solid rgba(231, 76, 60, 0.55);
    border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
    color: #c0392b;
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.4;
}

