/* ==========================================================================
   PROGIAL website
   1. Fonts   2. Base   3. Page layout   4. Header and banner   5. Home page
   6. Contact form   7. Footer   8. Buttons   9. Click & Collect   10. Legal notice
   11. Responsive   12. Animations
   ========================================================================== */

/* ---------- 1. Fonts ---------- */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/Poppins-Regular.woff2") format("woff2");
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/Poppins-Medium.woff2") format("woff2");
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/Poppins-SemiBold.woff2") format("woff2");
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/Poppins-Bold.woff2") format("woff2");
}

/* ---------- 2. Base ---------- */

:root {
    --green: #95c11f;            /* brand green: decoration only (borders, icons) */
    --green-text: #5a7800;       /* green of texts, links and buttons on a light background (5.1:1 with white) */
    --green-on-dark: #96bd0d;    /* brand green on the dark footer (4.9:1) */
    --blue-bob: #2f6aa8;         /* BOB blue for texts on a light background (5.6:1) */
    --blue-bob-on-dark: #8bbbec; /* BOB blue on the dark footer (5.4:1) */
    --text: #3e3d40;
    --footer-bg: #3d3d3f;
    --band-bg: #eef3dc;
    --gap: 20px;
}

* {
    margin: 0;
    padding: 0;
}

::selection {
    background: var(--green-text);
    color: #fff;
}

html {
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
}

p {
    text-align: justify;
}

a {
    text-decoration: none;
    color: var(--green-text);
    font-weight: 600;
}

img {
    height: auto;
}

.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

h2 {
    font-weight: bold;
    color: var(--green-text);
    margin-bottom: 1em;
}

h3 {
    margin-bottom: 0.5em;
}

li {
    list-style: none;
}

/* Visible for screen readers only (labels of the form, hidden part of a title) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard focus */
:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 2px;
}

header :focus-visible,
footer :focus-visible,
.block_hover:focus-visible {
    outline-color: #fff;
}

.block_hover:focus-visible {
    outline-offset: -8px;
}

/* Link colours */
.link-green {
    color: var(--green-on-dark);
}

.link-bob {
    color: var(--blue-bob);
}

footer .link-bob {
    color: var(--blue-bob-on-dark);
}

/* ---------- 3. Page layout ----------
   The page is a stack of blocks. The grid has 12 columns (+ a 0 px one that makes full-width blocks reach the right edge)
   and every direct child takes the whole width, unless it asks for fewer columns. Blocks are placed in the order of the
   HTML: no row number to maintain. */

.container {
    display: grid;
    grid-template-columns: repeat(12, 1fr) 0;
    gap: var(--gap);
    max-width: 2000px;
    overflow: hidden;
}

:where(.container) > * {
    grid-column: 1 / -1;
}

/* ---------- 4. Header and banner ---------- */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2em;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
}

/* Pages other than the home page: the header has its own background */
header.header--solid {
    background: var(--text);
}

header.header_fixed {
    background-color: rgba(61, 61, 61, 0.8);
    height: auto;
    justify-content: space-around;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 10;
    animation: menu 0.5s ease-in-out;
    padding: 0.5em;
}

header.header--solid.header_fixed {
    background: var(--text);
}

.header_fixed .logo {
    width: 5%;
}

.logo {
    width: 15%;
    max-width: 25em;
    min-width: 12em;
}

nav {
    margin-left: -2em;
}

nav a {
    padding-left: 2em;
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    font-size: 1.25em;
    display: inline-block;
}

nav a::after {
    content: '';
    display: block;
    height: 3px;
    width: 0;
    background: transparent;
    transition: width 0.5s ease, background-color 0.5s ease;
}

nav a:hover:after {
    width: 100%;
    background: white;
}

/* Home page: the header floats over the banner (same grid cell) */
.top {
    display: grid;
    row-gap: var(--gap);
}

.top > header {
    grid-area: 1 / 1;
    align-self: start;
    z-index: 1;
}

.top > header.header_fixed {
    z-index: 10;
}

.hero {
    grid-area: 1 / 1 / span 2;
    height: 20em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em;
    background-image: url("../images/bg.webp");
    background-position: center 38%;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero h1 {
    display: flex;
    align-self: flex-end;
    margin-bottom: 1em;
    font-size: 1.8em;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background-color: #E8601A;
    padding: 0.5em;
    border-radius: 1em;
    box-shadow: 0 5px 0 #A2410F;
    position: relative;
    animation: come-in 1s ease-in-out 1;
}

/* ---------- 5. Home page ---------- */

/* ERP and BOB blocks: a logo on top, a list that slides in on hover (same grid cell) */
.filiales_block {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    overflow: hidden;
}

.block_init {
    height: 20em;
    border: 3px solid transparent;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block_init img {
    width: 15em;
}

.progial_block_init {
    grid-area: 1 / 1;
    border-image: linear-gradient(60deg, #96bd0d 0%, #c5e45b 50%, #abca3d 100%) 10;
}

.ibob_block_init {
    grid-area: 1 / 2;
    border-image: linear-gradient(45deg, #417fc1 0%, #91c5f2 52%, #679fd4 100%) 10;
}

.bob-logo {
    max-width: 40%;
}

.title-bob {
    color: var(--blue-bob);
}

.block_hover {
    display: flex;
    align-items: center;
    justify-content: center;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.5s ease-in-out;
}

.progial_block_hover {
    grid-area: 1 / 1;
    background-image: url("../images/progial_hover.webp");
    margin-left: -2000px;
}

.ibob_block_hover {
    grid-area: 1 / 2;
    background-image: url("../images/bob_hover.webp");
    margin-right: -2000px;
}

.progial_block_init:hover ~ .progial_block_hover,
.progial_block_init:focus-visible ~ .progial_block_hover,
.progial_block_hover:hover,
.progial_block_hover:focus-visible,
.ibob_block_init:hover ~ .ibob_block_hover,
.ibob_block_init:focus-visible ~ .ibob_block_hover,
.ibob_block_hover:hover,
.ibob_block_hover:focus-visible {
    margin: 0;
}

.btn-discover {
    display: flex;
    width: fit-content;
    margin: 5em auto 0;
    padding: 1em;
    border: 3px solid #fff;
    border-radius: 2em;
    background-color: transparent;
    color: #fff;
    font-weight: bold;
    transition: all 0.5s ease-in-out;
}

.btn-discover:hover {
    position: relative;
    top: 5px;
    background-color: #fff;
    color: var(--text);
}

.filiale_spec li {
    color: #fff;
    border-left: 3px solid #fff;
    padding-left: 1em;
    line-height: 2em;
}

/* Text on the left, map of France on the right */
.about {
    display: grid;
    grid-template-columns: repeat(12, 1fr) 0;
    column-gap: var(--gap);
}

.text_progial {
    grid-area: 1 / 2 / span 1 / span 6;
    text-align: justify;
    font-size: 1.2em;
    align-self: center;
}

.carte {
    grid-area: 1 / 6 / span 1 / span 6;
    width: 40%;
    justify-self: flex-end;
    align-self: center;
}

/* Fields of activity: 3 pictos on the first row, 4 on the second one (same picto size on both rows) */
#specialite {
    display: grid;
    grid-template: auto / repeat(12, 1fr);
    background-color: var(--band-bg);
    padding-top: 2em;
}

#specialite img {
    width: 20%;
}

#specialite h2 {
    grid-area: 1 / 2 / 1 / span 12;
}

.specialite-row {
    grid-area: 2 / 1 / auto / span 13;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.specialite-row div {
    flex: 0 0 33.333%;
    margin-bottom: 3em;
}

.specialite-row div:nth-child(n+4) {
    flex-basis: 25%;
}

#specialite .specialite-row div:nth-child(n+4) img {
    width: 26.667%;
}

/* ---------- 6. Contact: phone button and form, over the whole width ---------- */

#contact {
    grid-column: 2 / span 10;
}

.contact-call {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em 1.5em;
    margin-bottom: 1.5em;
}

.contact-call p {
    text-align: left;
}

.call-us {
    display: inline-flex;
    align-items: center;
    gap: 0.9em;
    padding: 0.4em 1.5em 0.4em 0.4em;
    border-radius: 3em;
    background-color: var(--band-bg);
    color: var(--text);
    line-height: 1.2;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.call-us:hover {
    background-color: #e3ecc6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.call-icon {
    display: grid;
    place-items: center;
    width: 2.8em;
    height: 2.8em;
    border-radius: 50%;
    background-color: var(--green-text);
    color: #fff;
}

.call-us:hover .call-icon svg {
    animation: ring 0.6s ease-in-out;
}

.call-text {
    display: flex;
    flex-direction: column;
}

.call-label {
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.call-number {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--green-text);
}

form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75em 1em;
}

.form_1 {
    grid-column: span 1;
}

.form_2,
.form_actions {
    grid-column: 1 / -1;
}

input,
textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid gray;
    border-radius: 0.25em;
    padding: 0.6em;
    font: inherit;
    font-size: 0.95em;
}

textarea {
    min-height: 7em;
    overflow: auto;
    resize: vertical;
}

input#rgpd-check {
    width: auto;
    margin-right: 0.4em;
}

.form_actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em 1em;
}

#form_button {
    width: auto;
    min-width: 12em;
    padding: 0.7em 2em;
    border: 0;
    border-radius: 2em;
    background-color: var(--green-text);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

#form_button:hover:not(:disabled) {
    background-color: var(--text);
}

#form_button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.error {
    color: #c00000;
}

.valid {
    color: green;
}

/* ---------- 7. Footer: three equal columns, each one centred, centred vertically too ---------- */

footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    justify-items: center;
    gap: 0.5em 2em;
    padding: 1.25em 2em 0.75em;
    background-color: var(--footer-bg);
    text-align: center;
}

footer p,
footer li,
footer a {
    color: #fff;
    text-decoration: none;
}

footer p {
    text-align: center;
}

footer a:hover {
    color: #fff !important;
}

.footer-title {
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--green-on-dark);
}

.footer-col--contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.social {
    display: flex;
    justify-content: center;
    gap: 0.4em;
}

.social-icons {
    width: 30px;
}

footer .primary-green-button a {
    width: 200px;
    text-align: center;
}

footer .primary-green-button .icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.2em;
    margin-right: 0.2em;
}

.droitsReserves {
    grid-column: 1 / -1;
    margin-top: 0.5em;
}

/* ---------- 8. Buttons ---------- */

.primary-green-button a {
    display: inline-block;
    background-color: var(--green-text);
    font-size: 13px;
    padding: 12px 18px;
    color: #fff;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 20px;
    transition: 0.4s all ease-in-out;
}

.primary-green-button a:hover {
    background: var(--text);
}

/* ---------- 9. Click & Collect ---------- */

@media only screen and (min-width: 1250px) {
    .margintitle {
        margin-left: 22em;
    }
}

#cc-hero {
    width: 100%;
    height: 300px;
    background-image: url("../images/click-and-collect.webp");
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    margin-top: -20px;
    text-align: center;
}

#cc-acroche {
    font-size: 1.2em;
    max-width: 1000px;
    line-height: 2em;
}

#section-cc-1 {
    grid-column: 2 / span 6;
}

#cc-illustration {
    grid-column: 9 / span 3;
    display: flex;
    align-self: flex-end;
    position: relative;
    animation: come-in 1s ease-in-out 1;
}

#cc-schema {
    grid-column: 2 / span 10;
    display: flex;
    width: 100%;
}

.cc-schema-item {
    text-align: center;
    display: block;
    margin: auto;
    padding: 2em;
}

.cc-schema-item img {
    width: 8em;
    display: block;
    margin: auto;
    max-height: 90px;
    margin-bottom: 2em;
}

.cc-schema-item span {
    font-size: 1.1em;
    color: #007eb3;
    font-weight: bold;
}

.cc-schema-arrow {
    width: 10em;
    align-self: center;
}

#section-cc-2 {
    grid-column: 2 / span 10;
}

.services-cc-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 80%;
    margin: auto;
}

.services-cc {
    border: 2px solid #0087bc;
    border-radius: 1em;
    width: 14em;
    padding: 3em;
    height: auto;
    text-align: center;
    line-height: 2em;
    margin-bottom: 2em;
}

.services-cc h3 {
    color: #007eb3;
}

.services-cc li {
    border-bottom: 1px solid darkturquoise;
    text-align: left;
    font-size: 0.9em;
    padding-bottom: 0.8em;
    margin-bottom: 0.8em;
}

.last-li {
    border: none !important;
}

.cc-picto {
    width: 120px;
}

#section-cc-3 {
    grid-column: 2 / span 10;
}

.list-links {
    line-height: 2em;
}

#cc-cta {
    grid-column: 1 / span 12;
    display: block;
    margin: 4em auto auto;
    text-align: center;
}

/* Chevron bullets of the lists */
.list-chevron li::before {
    content: "";
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    margin-right: 0.7em;
    border-top: 0.16em solid var(--green);
    border-right: 0.16em solid var(--green);
    transform: rotate(45deg);
}

/* ---------- 10. Legal notice ---------- */

.legal {
    margin-top: 2em;
    padding: 3em;
}

.error-page {
    text-align: center;
}

.error-page h1 {
    color: var(--green-text);
    margin-bottom: 1em;
}

.error-page p {
    text-align: center;
    margin-bottom: 1em;
}

/* ---------- 11. Responsive ---------- */

@media only screen and (min-width: 1990px) {
    .container {
        margin: auto;
    }
}

@media only screen and (max-width: 1100px) {
    form {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer: the three columns are stacked */
@media only screen and (max-width: 1056px) {
    footer {
        grid-template-columns: 1fr;
        row-gap: 0.75em;
    }
}

@media only screen and (max-width: 850px) {
    header {
        display: inline-grid;
        text-align: center;
        justify-content: center;
    }

    header.header_fixed {
        justify-content: center;
        width: 98%;
    }

    .logo {
        justify-self: center;
        margin-bottom: 1em;
    }

    .hero {
        text-align: center;
        background-image: url("../images/bg-mobile.webp");
        background-position: center;
    }

    .hero h1 {
        font-size: 1.3em;
        max-height: 160px;
        margin: 0 0 2em;
        align-self: flex-end;
    }

    .filiales_block {
        grid-template-columns: 1fr;
    }

    .progial_block_init,
    .progial_block_hover {
        grid-area: 1 / 1;
    }

    .ibob_block_init,
    .ibob_block_hover {
        grid-area: 2 / 1;
    }

    .text_progial {
        grid-area: 1 / 2 / span 1 / span 10;
    }

    .text_progial p {
        font-size: 0.9em;
    }

    .carte {
        grid-area: 2 / 1 / span 1 / span 12;
        margin: auto;
    }

    .about {
        row-gap: var(--gap);
    }

    .specialite-row div,
    .specialite-row div:nth-child(n+4) {
        flex-basis: 100%;
    }

    #specialite .specialite-row div:nth-child(n+4) img {
        width: 20%;
    }

    #contact {
        grid-column: 1 / -1;
        padding: 0 1.25em;
    }

    h2 {
        text-align: center;
    }

    .contact-call {
        justify-content: center;
    }

    .contact-call p {
        text-align: center;
    }

    /* Click & Collect */
    #section-cc-1,
    #cc-schema,
    #section-cc-2,
    #section-cc-3 {
        grid-column: 2 / span 10;
    }

    #cc-illustration {
        grid-column: 1 / span 12;
        display: flex;
        align-self: start;
        justify-self: center;
        width: 15em;
    }

    #cc-schema {
        display: block;
    }

    .cc-schema-arrow {
        display: none;
    }
}

@media only screen and (max-width: 680px) {
    form {
        grid-template-columns: 1fr;
    }

    .form_actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    #form_button {
        width: 100%;
    }

    .call-us {
        width: 100%;
        justify-content: center;
    }

    header.header_fixed {
        display: none;
    }

    .hero {
        height: 30em;
    }

    nav a {
        display: block;
        margin-bottom: 1em;
    }
}

@media only screen and (max-width: 471px) {
    .hero h1 {
        font-size: 1.2em;
    }

    #cc-hero {
        background-position-x: -12em;
    }
}

@media only screen and (max-width: 320px) {
    .logo {
        display: none;
    }

    header.header_fixed {
        width: 95%;
    }
}

/* ---------- 12. Animations ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@keyframes menu {
    from {
        top: -100px;
    }

    to {
        top: 0;
    }
}

@keyframes ring {
    0%,
    100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(-18deg);
    }

    40% {
        transform: rotate(16deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    80% {
        transform: rotate(6deg);
    }
}

@keyframes come-in {
    0% {
        right: -43em;
    }

    75% {
        right: 2em;
    }

    100% {
        right: 0;
    }
}
