/* Contact page only. Loaded after main.css, which holds the shared blocks
   (hero, site header, site nav, button, contact form, contact links, footer links…).

   Contents
   1. Contact header
   2. Contact page
   3. Radio card
*/


/* ==========================================================================
   Contact header
   ========================================================================== */

/* Mixed with .site-header: on the light frame of this page, dark logo and dark links.
   Once main.js pins it on its dark bar (site-header--fixed), it looks like on the other pages */

/* Light logos (.site-header__logo) hidden on the light frame, dark one hidden on the dark bar.
   The mobile menu's dark logo isn't needed on the light frame either: the one shown is already dark */
.contact-header:not(.site-header--fixed) .site-header__logo,
.contact-header:not(.site-header--fixed) .site-header__menu-logo,
.site-header--fixed .contact-header__logo {
    display: none;
}

/* Current page: outlined, through Bootstrap's .btn variables so hover and click keep the same look */
.contact-header__current {
    --bs-btn-color: var(--color-background-dark);
    --bs-btn-border-width: 2px;
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-color: var(--color-background-dark);
    --bs-btn-hover-border-color: var(--color-primary);
    --bs-btn-active-color: var(--color-background-dark);
    --bs-btn-active-border-color: var(--color-primary);
}

/* Below lg the link sits in the white mobile menu: outlined like the current page in the nav (.site-nav__link--active) */
@media (max-width: 991.98px) {
    .contact-header__current {
        --bs-btn-border-width: 1px;
        --bs-btn-border-color: var(--color-main);
        --bs-btn-hover-color: var(--color-main);
        --bs-btn-hover-border-color: var(--color-main);
        --bs-btn-active-color: var(--color-main);
        --bs-btn-active-border-color: var(--color-main);

        margin: 4px -17px;
        padding: 8px 17px;
    }
}

/* From lg only: below it the links and the contact link sit in the white mobile menu */
@media (min-width: 992px) {
    .site-header--fixed .contact-header__current {
        --bs-btn-color: var(--color-white);
        --bs-btn-hover-color: var(--color-white);
        --bs-btn-active-color: var(--color-white);
    }

    .contact-header__current-icon {
        background-color: var(--color-primary);
    }

    .contact-header:not(.site-header--fixed) .contact-header__nav-link {
        color: var(--color-background-dark);
    }

    .contact-header:not(.site-header--fixed) .contact-header__nav-link:hover {
        color: var(--color-main);
    }
}


/* ==========================================================================
   Contact page
   ========================================================================== */

/* Mixed with .hero__frame: light grey instead of the photo, and the whole page (footer included) inside the frame.
   The bottom margin is the gutter .hero leaves out, so the frame fills the screen exactly */
.contact-page {
    margin-bottom: var(--page-gutter);
    padding-bottom: 10px;
    background-color: var(--color-background-light);
    background-image: none;
    border-radius: var(--radius-large);
}

/* Intro on the left, form on the right, centred in the frame as in the design.
   The top padding keeps the title clear of the logo when the page is taller than the screen */
.contact-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 430fr) minmax(0, 660fr);
    gap: 30px;
    max-width: 1120px;
    margin: 0 auto;
    padding-top: 40px;
}

.contact-page__title {
    margin-bottom: 54px;
    font-size: var(--font-size-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--color-main);
    text-shadow: 0 0 30px var(--color-white);
}

.contact-page__description {
    max-width: 315px;
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-bold);
    color: var(--color-main);
}

/* Bootstrap draws <hr> as a faded 1px line */
.contact-page__divider {
    max-width: 315px;
    margin: 54px 0;
    border-top: 2px solid var(--color-primary-pale);
    opacity: 1;
}

.contact-page__support {
    max-width: 360px;
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.contact-page__phone {
    display: block;
    margin-top: 26px;
    font-size: 36px;
    font-weight: var(--font-weight-black);
    text-decoration: none;
    white-space: nowrap;
    color: var(--color-primary);
}

.contact-page__phone:hover {
    text-decoration: underline;
}

/* The radio cards start a little lower than the title, as in the design */
.contact-page__form {
    margin-top: 12px;
}

.contact-page__services {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 30px;
    margin-bottom: 24px;
}

.contact-page__fields {
    --bs-gutter-x: 30px;
}

/* Mixed with .contact-form__field: smaller than Bootstrap's field, as in the design.
   No vertical padding: the fixed height centres the text */
.contact-page__field {
    height: 35px;
    padding: 0 12px;
    font-size: var(--font-size-label);
    border-color: var(--color-secondary);
}

.contact-page__select {
    cursor: pointer;
}

/* "Je ne sais pas encore" in light blue, as in the design. A chosen country takes the normal text colour */
.contact-page__select:has(option[value=""]:checked) {
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.contact-page__message {
    height: 205px;
    padding: 8px 12px;
}

@media (max-width: 991.98px) {
    .contact-page__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .contact-page__title {
        margin-bottom: 24px;
    }

    .contact-page__divider {
        margin: 30px 0;
    }

    .contact-page__form {
        margin-top: 0;
    }
}

@media (max-width: 575.98px) {
    .contact-page__title {
        font-size: var(--font-size-heading-mobile);
    }

    .contact-page__description,
    .contact-page__support {
        font-size: var(--font-size-body-small);
    }

    .contact-page__phone {
        margin-top: 12px;
        font-size: 26px;
    }

    .contact-page__services {
        gap: 12px;
    }
}


/* ==========================================================================
   Radio card
   ========================================================================== */

/* A <label> around its radio, so the whole card is clickable */
.radio-card {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    height: 51px;
    padding: 0 22px 0 12px;

    font-family: var(--font-body);
    font-size: var(--font-size-body-small);
    font-weight: var(--font-weight-bold);
    color: var(--color-main);

    background-color: var(--color-white);
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-small);

    cursor: pointer;
}

/* 2px pale border when chosen. The inset shadow adds the second pixel, so the content doesn't move */
.radio-card:has(.radio-card__input:checked) {
    border-color: var(--color-primary-pale);
    box-shadow: inset 0 0 0 1px var(--color-primary-pale);
}

/* The radio has no outline of its own (below): the card shows the keyboard focus */
.radio-card:has(.radio-card__input:focus-visible) {
    outline: 2px solid var(--color-main);
    outline-offset: 2px;
}

/* The design's radio drawings, in place of the browser's */
.radio-card__input {
    flex-shrink: 0;
    width: 25px;
    height: 25px;
    margin: 0;
    background-image: url('../media/icon-radio.svg');
    appearance: none;
    outline: none;
    cursor: pointer;
}

.radio-card__input:checked {
    background-image: url('../media/icon-radio-checked.svg');
}
