/* CONTACT FORM
   ==========================================================================

   com_contact's markup styled in the template's own language: Montserrat,
   the green (#3e943b) used for headings, and the black .black_btn for the
   submit. Loaded only by the contact form layout override, so it costs
   nothing on the rest of the site.

   Scoped to .com-contact__form, not .contact-form: the menu item's alias is
   "contact-form", so Joomla puts that on <body> and anything scoped to it
   would style every input on the page.

   Structure com_contact gives us, per field:
     .control-group > .control-label > label.required > span.star
                    > .controls      > input.form-control | textarea         */

.contact-form__intro {
    margin-bottom: 2rem;
}

.contact-form__intro h2 {
    margin-bottom: 0.6rem;
}

.contact-form__note {
    font-size: 0.8rem;
    color: #6b6b6b;
    margin-bottom: 1.25rem;
}

/* Name and e-mail on the left, the message alongside them on the right,
   the way the old form read. One column once there is no room for two. */
.contact-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
    align-items: start;
}

@media (max-width: 760px) {
    .contact-form__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.com-contact__form .control-group {
    margin-bottom: 1.1rem;
}

.com-contact__form .control-label label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
    color: #16181d;
}

/* Joomla marks a required field with .star; the old form used a red asterisk. */
.com-contact__form .control-label .star,
.com-contact__form .control-label .red {
    color: #d0021b;
}

.com-contact__form input[type="text"],
.com-contact__form input[type="email"],
.com-contact__form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: #16181d;
    background: #fff;
    border: 1px solid #cfcfcf;
    border-radius: 3px;
}

.com-contact__form input[type="text"]:focus,
.com-contact__form input[type="email"]:focus,
.com-contact__form textarea:focus {
    border-color: #3e943b;
    outline: 2px solid rgba(62, 148, 59, 0.35);
    outline-offset: 1px;
}

.com-contact__form input::placeholder,
.com-contact__form textarea::placeholder {
    color: #9aa0a6;
}

.com-contact__form textarea {
    min-height: 11.5rem;
    resize: vertical;
}

/* The message field fills its column, however tall the left one grows. */
.contact-form__message .controls,
.contact-form__message textarea {
    height: 100%;
}

.contact-form__copy {
    margin: 0.5rem 0 1.25rem;
}

.contact-form__copy label {
    font-weight: 400;
}

.contact-form__captcha,
.contact-form__submit {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Matches a.black_btn in template.css, which is an anchor rule and so does
   not reach a <button>. */
.com-contact__form button[type="submit"] {
    min-width: 18rem;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    background: #000;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.com-contact__form button[type="submit"]:hover,
.com-contact__form button[type="submit"]:focus-visible {
    background: #3e943b;
}

/* Joomla's validation puts .invalid on a field that failed. */
.com-contact__form .invalid {
    border-color: #d0021b !important;
}

.com-contact__form .form-control-feedback {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #d0021b;
}
