/**
 * Contact page styles.
 *
 * Mobile-first: a single-column stack on small screens (NAP details, hours,
 * then the map) that becomes a two-column details/hours grid on tablets and
 * up. The embedded map uses a fluid aspect-ratio wrapper so it scales with the
 * viewport without overflowing.
 */

.contact-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.contact-page__title {
    margin-bottom: 0.5rem;
}

.contact-page__content,
.contact-page__lead {
    color: #444;
    margin-bottom: 1rem;
}

.contact-page__lead {
    max-width: 60ch;
}

/* Single column by default (mobile-first). */
.contact-page__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-card {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.5rem 1.5rem;
}

.contact-card__heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

/* NAP details ----------------------------------------------------------- */
.contact-details__name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.contact-details__address {
    font-style: normal;
    color: #444;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.contact-details__phone,
.contact-details__email {
    margin: 0 0 0.5rem;
}

.contact-details__label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.contact-details__phone a,
.contact-details__email a {
    color: #2c6fb3;
    text-decoration: none;
}

.contact-details__phone a:hover,
.contact-details__phone a:focus,
.contact-details__email a:hover,
.contact-details__email a:focus {
    text-decoration: underline;
}

.contact-details__actions {
    margin: 1.25rem 0 0;
}

/* Buttons --------------------------------------------------------------- */
.contact-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #2c6fb3;
    border: 2px solid #2c6fb3;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
}

.contact-button:hover,
.contact-button:focus {
    background: #225a92;
    border-color: #225a92;
}

.contact-button--secondary {
    color: #2c6fb3;
    background: transparent;
}

.contact-button--secondary:hover,
.contact-button--secondary:focus {
    color: #fff;
    background: #2c6fb3;
}

/* Hours table ----------------------------------------------------------- */
.contact-hours {
    width: 100%;
    border-collapse: collapse;
}

.contact-hours__row {
    border-bottom: 1px solid #eee;
}

.contact-hours__row:last-child {
    border-bottom: none;
}

.contact-hours__day,
.contact-hours__time {
    padding: 0.6rem 0;
    text-align: left;
    vertical-align: top;
}

.contact-hours__day {
    font-weight: 600;
}

.contact-hours__time {
    text-align: right;
    color: #444;
    white-space: nowrap;
}

.contact-hours__row.is-closed .contact-hours__time {
    color: #c0392b;
    font-weight: 600;
}

/* Map ------------------------------------------------------------------- */
.contact-page__map {
    margin-top: 2rem;
}

.contact-map {
    position: relative;
    width: 100%;
    /* 4:3 fluid aspect ratio with a fallback for older browsers. */
    padding-bottom: 75%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e2e2e2;
    background: #f3f3f3;
}

@supports (aspect-ratio: 4 / 3) {
    .contact-map {
        height: auto;
        padding-bottom: 0;
        aspect-ratio: 4 / 3;
    }
}

.contact-map__frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.contact-page__map-link {
    margin-top: 1rem;
}

/* Tablet and up: two-column details/hours layout and a wider map. */
@media (min-width: 768px) {
    .contact-page {
        padding-top: 2.5rem;
    }

    .contact-page__grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-map {
        padding-bottom: 50%;
    }

    @supports (aspect-ratio: 16 / 9) {
        .contact-map {
            padding-bottom: 0;
            aspect-ratio: 16 / 9;
        }
    }
}

/* Desktop: cap the map height so it doesn't dominate large screens. */
@media (min-width: 1024px) {
    .contact-map {
        max-height: 480px;
    }
}

/* Contact form --------------------------------------------------------- */
.contact-page__form-section {
    margin-top: 2.5rem;
    max-width: 640px;
}

.contact-form {
    margin-top: 1rem;
}

.contact-form__field {
    margin: 0 0 1.25rem;
}

.contact-form__field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.contact-form__field .required {
    color: #c0392b;
}

.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: #222;
    background: #fff;
    border: 1px solid #c4c4c4;
    border-radius: 4px;
    box-sizing: border-box;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: #2c6fb3;
    box-shadow: 0 0 0 2px rgba(44, 111, 179, 0.2);
}

.contact-form__field textarea {
    resize: vertical;
    min-height: 8rem;
}

.contact-form__field input[aria-invalid="true"],
.contact-form__field textarea[aria-invalid="true"] {
    border-color: #c0392b;
}

.contact-form__error {
    display: block;
    margin-top: 0.35rem;
    color: #c0392b;
    font-size: 0.9rem;
}

.contact-form__success {
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    color: #1e6b2f;
    background: #eaf7ee;
    border: 1px solid #b6e0c1;
    border-radius: 4px;
}

.contact-form__error-summary {
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    color: #8a1f1f;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.contact-form__submit {
    margin: 0;
}

.contact-form__submit .contact-button {
    border: none;
    font-family: inherit;
}

/* Honeypot: visually and assistively hidden, but still submitted. */
.contact-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
