/* Contact ----------------------------------------------------------------
   One markup for both templates. Everything below is skin: which fields are
   rounded, what the ground is, and whether the details sit beside the form or
   stand on their own. Nothing here moves a field or changes what is asked. */

.contact {
    position: relative;
    padding-block: 4rem;
}

.contact__header {
    margin-bottom: 2.5rem;
}

.contact--align-center .contact__header {
    text-align: center;
    max-width: 46rem;
    margin-inline: auto;
}

.contact__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.75;
    margin-bottom: 0.5rem;
}

.contact__title {
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contact__intro > :last-child {
    margin-bottom: 0;
}

/* The form alone is a column with a sensible reading width rather than one
   that runs the width of the page. */
.contact--align-center .contact__body {
    max-width: 46rem;
    margin-inline: auto;
}

/* Beside ------------------------------------------------------------------
   The three reference looks that put details next to the form are this, and
   not three more templates: same form, same fields, a second column. */
.contact--beside .contact__body {
    display: grid;
    gap: 2.5rem;
    max-width: none;
}

@media (min-width: 992px) {
    .contact--beside .contact__body {
        grid-template-columns: 5fr 7fr;
        align-items: center;
    }

    /* Source order puts the details first, so only the other arrangement needs
       saying. Stacked, the form leads either way - it is what the section is
       for, and a visitor on a phone should not scroll past an address to
       reach it. */
    .contact--beside.contact--details-right .contact__body {
        grid-template-columns: 7fr 5fr;
    }

    .contact--beside.contact--details-right .contact__details {
        order: 2;
    }
}

@media (max-width: 991.98px) {
    .contact--beside .contact__details {
        order: 2;
    }

    .contact--beside .contact__form-wrap {
        order: 1;
    }
}

/* Details -----------------------------------------------------------------
   The same three rows however they are drawn. */
.contact__details {
    display: grid;
    gap: 1.25rem;
}

.contact__detail {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "mark label"
        "mark value";
    column-gap: 0.875rem;
    align-items: center;
}

.contact__detail-mark {
    grid-area: mark;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    font-size: 1.125rem;
}

.contact__detail-label {
    grid-area: label;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
}

.contact__detail-value {
    grid-area: value;
    font-weight: 600;

    /* An address is one field and carries its own line breaks. */
    white-space: pre-line;
}

.contact__detail-value a {
    color: inherit;
    text-decoration: none;
}

.contact__detail-value a:hover {
    text-decoration: underline;
}

/* Fields ------------------------------------------------------------------ */
.contact__form .form-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.75;
}

.contact__form .form-control {
    padding-block: 0.8rem;
    padding-inline: 0.9rem;
}

.contact__actions {
    margin-top: 0.5rem;
}

.contact--align-center .contact__actions {
    text-align: center;
}

.contact__submit {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding-inline: 1.75rem;
    padding-block: 0.7rem;
}

.contact__captcha {
    margin-bottom: 1.25rem;
}

.contact--align-center .contact__captcha {
    display: flex;
    justify-content: center;
}

/* Style: rounded ---------------------------------------------------------- */
.contact--style-rounded .contact__form .form-control {
    border-radius: 1.25rem;
}

.contact--style-rounded .contact__submit {
    border-radius: 2rem;
}

/* Style: square ----------------------------------------------------------- */
.contact--style-square .contact__form .form-control,
.contact--style-square .contact__submit {
    border-radius: 0;
}

/* Style: filled ----------------------------------------------------------- */
.contact--style-filled .contact__form .form-control,
.contact--style-filled .contact__submit {
    border-radius: 0;
}

.contact--style-filled .contact__form .form-control {
    background-color: var(--bs-secondary-bg, #f4f5f7);
    border-color: var(--bs-secondary-bg, #f4f5f7);
}

.contact--style-filled .contact__form .form-control:focus {
    background-color: #fff;
    border-color: var(--bs-primary);
}

/* Over a picture ----------------------------------------------------------
   The same backdrop the hero and the card group use, with this component's own
   prefix. */
.contact__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--contact-image);
    background-repeat: no-repeat;
    background-size: cover;
}

.contact--focal-center .contact__backdrop { background-position: center center; }
.contact--focal-top .contact__backdrop { background-position: center top; }
.contact--focal-bottom .contact__backdrop { background-position: center bottom; }

.contact--overlay-none { --contact-scrim: 0; }
.contact--overlay-light { --contact-scrim: 0.25; }
.contact--overlay-medium { --contact-scrim: 0.45; }
.contact--overlay-dark { --contact-scrim: 0.7; }

.contact__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, var(--contact-scrim, 0));
}

.contact--scrim-gradient .contact__backdrop::after {
    background-color: transparent;
    background-image: linear-gradient(to top,
        rgba(0, 0, 0, var(--contact-scrim, 0)) 0%,
        rgba(0, 0, 0, calc(var(--contact-scrim, 0) * 0.55)) 45%,
        rgba(0, 0, 0, 0) 100%);
}

/* Everything the section holds goes above the picture. */
.contact--has-bg > .contact__header,
.contact--has-bg > .contact__body {
    position: relative;
    z-index: 1;
}

.contact--has-bg.contact--text-light { color: #fff; }
.contact--has-bg.contact--text-dark { color: var(--bs-body-color); }

/* On a full bleed page the picture runs to the edges while the words stay in
   the site's band. The backdrop has to be exempted from that clamp by name -
   see the card group, where the same wildcard caught the same thing. */
.page-full .contact > * {
    max-width: var(--cms-band);
    margin-inline: auto;
    padding-inline: 0.75rem;
}

.page-full .contact > .contact__backdrop {
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

/* Style: onImage ----------------------------------------------------------
   Fields outlined in white with nothing behind them, so the photograph carries
   on through the form. */
.contact--style-onImage .contact__form .form-control {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    border-radius: 0;
}

.contact--style-onImage .contact__form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact--style-onImage .contact__form .form-control:focus {
    background-color: transparent;
    border-color: #fff;
    color: #fff;
    box-shadow: none;
}

.contact--style-onImage .contact__submit {
    border-radius: 0;
    width: 100%;
}

/* Style: dark -------------------------------------------------------------
   The same picture, but the form keeps a faint ground of its own so it reads
   as a panel next to the details rather than floating on the photograph. */
.contact--style-dark .contact__form .form-control {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 0;
}

.contact--style-dark .contact__form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.contact--style-dark .contact__form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: none;
}

.contact--style-dark .contact__submit {
    border-radius: 0;
}

/* Over a picture, the details go light too, and their marks stop being solid
   circles competing with the photograph. */
.contact--has-bg.contact--text-light .contact__detail-mark {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.contact--has-bg.contact--text-light .contact__detail-label {
    opacity: 0.8;
}

/* Details templates -------------------------------------------------------
   Both draw the same rows across the page rather than down it. */
.contact--details .contact__details {
    grid-template-columns: repeat(var(--contact-cols, 3), 1fr);
    gap: 0;
}

.contact--cols-2 { --contact-cols: 2; }
.contact--cols-3 { --contact-cols: 3; }
.contact--cols-4 { --contact-cols: 4; }

@media (max-width: 991.98px) {
    .contact--details .contact__details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .contact--details .contact__details {
        grid-template-columns: 1fr;
    }
}

/* A tile stacks its three parts and centres them, which is a different
   arrangement from the row used beside a form. */
.contact--details .contact__detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 3rem 1.25rem;
}

/* Style: tiles ------------------------------------------------------------
   A full width row in alternating shades of the theme colour, white on top.
   The alternation is by position, so it holds however many details there
   are. */
.contact--style-tiles {
    padding-block: 0;
}

.contact--style-tiles .contact__header {
    padding-block: 4rem 0;
}

.contact--style-tiles .contact__detail {
    background-color: var(--bs-primary);
    color: #fff;
}

.contact--style-tiles .contact__detail:nth-child(even) {
    /* Darker by the same amount whatever the theme colour is, rather than a
       second colour that would have to be picked per theme. */
    background-image: linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18));
}

.contact--style-tiles .contact__detail-mark {
    background-color: transparent;
    font-size: 2.25rem;
    width: auto;
    height: auto;
}

.contact--style-tiles .contact__detail-label {
    opacity: 0.8;
}

/* Style: panels -----------------------------------------------------------
   The quieter one: outlined boxes on the page's own ground, sharing their
   borders so the row reads as one block. */
.contact--style-panels .contact__detail {
    border: 1px solid var(--bs-border-color);
    margin-left: -1px;
    margin-top: -1px;
}

.contact--style-panels .contact__detail-mark {
    background-color: transparent;
    color: var(--bs-primary);
    font-size: 2rem;
    width: auto;
    height: auto;
}
