:root {
    --black: #1c1c1c;
    --black-transparent: #1c1c1cdd;
    --black-transparenter: #1c1c1c99;
    --white: #ccc;
    --whiter: #eee;
    --blue: #009fd4;
    --blue-transparent: #009fd425;
    --blue-dark: #02516b;
    --green: #5fb217;
    --green-transparent: #5fb21725;
    --green-dark: #2e560b;
    --accent-gradient: linear-gradient(90deg, var(--blue), var(--green));
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--white);
    color: var(--black);
    line-height: 1.5;
}


/* Hero style */

.hero-header {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-bg {
    position: relative;
    width: 100%;
    max-width: 540px;
    object-fit: contain;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--black-transparenter);
    padding: 0;
}

.hero-header a.logo {
    height: 40vh;
    display: inline-block;
}

.hero-header .hero-overlay a.logo {
    height: 100%;
    display: inline-block;
}

.hero-header img.logo {
    height: 100%;
}

a,
a:active,
a:hover {
    color: var(--black)
}

.content-box {
    max-width: 60rem;
    padding: 0 1.5rem;
}

header {
    text-align: center;
}

h1 {
    margin-top: 2.5rem;
    text-align: center;
    clear: both;
}

p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-word;
}

.info-box p {
    text-align: center;
}

section {
    margin-bottom: 2.5rem;
}

footer {
    margin-top: 4rem 0;
    padding-bottom: 4rem;
}

footer p {
    text-align: center;
}


.accent1 {
    color: var(--green);
}

.accent2 {
    color: var(--blue);
}

.accent-bar {
    width: 100%;
    height: 0.3rem;
    background: var(--accent-gradient);
    clear: both;
}


/* Image styles */

.photo-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 0.5rem;
    margin: 2rem 0;
    display: block;
    position: relative;
}

.photo-img {
    width: 100%;
    height: auto;
}

.photo-credit {
    text-align: center;
}

/* Info boxes */

.info-box {
    background: var(--whiter);
    color: var(--black);
    margin: 2.5rem auto;
    padding: 1rem 3rem;
    position: relative;
    border-radius: 0 2.5rem 0 2.5rem;
    display: block;
    width: fit-content;
    max-width: 100%;
    text-align: center;
}

.info-box p {
    margin-bottom: 0.5rem;
}

.info-box::before,
.info-box::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background: transparent;
}

.info-box::before {
    top: -2px;
    left: -2px;
    border-top: 6px solid var(--green);
    border-left: 6px solid var(--green);
    z-index: 900;
}

.info-box::after {
    bottom: -2px;
    right: -2px;
    border-bottom: 6px solid var(--blue);
    border-right: 6px solid var(--blue);
    z-index: 900;
}

/* expandable people/project boxes */

/* box placements */

.boxes {
    font-size: 0.8em;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.boxes.actualites {
    align-items: start;
}

.boxes section {
    margin: 0;
}

.boxes a {
    text-decoration: none;
    flex-direction: column;
    flex: 1;
}

.boxes .box img {
    display: block;
    width: 100%;
    border-radius: 2.5rem 0 2.5rem 0;
    object-fit: cover;
    height: auto;
}

.boxes .box {
    display: flex;
    flex-direction: column;
}

.boxes .summary {
  display: flex;
  flex-direction: column;
}

.boxes .more, .boxes .close {
    text-align: right;
}

.boxes div {
    border-radius: 0 2.5rem 0 2.5rem;
    padding: 1rem;
}

.boxes div:nth-of-type(even) {
    border-radius: 2.5rem 0 2.5rem 0;
}

.detail {
    display: none;
}


/* open boxes */
.box.open {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
}

.box.open .detail {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.box.open img, .box.open .summary {
    grid-column: 1;
}


.box.open .more {
    display: none;
}

.summary .more, .detail .close {
    text-align: right;
    font-size: 1.5em;
    margin-top: auto;
}

/* box styling */

.summary p {
    text-align: center;
    margin-bottom: 0;
}

.actualites .summary p {
    margin-bottom: 1rem;
    text-align: justify;
}

.summary p.name {
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
}

.summary p.location {
    font-size: 1em;
    font-style: italic;
}

.summary p.occupation {
    font-size: 1.2em;
    font-style: italic;
}

.summary ul {
    padding-left: 1rem;
    margin-top: 1rem;
}

.lastname {
    text-transform: uppercase;
}

.boxes div.detail {
    padding: 1.5rem;
}

news {
    justify-content: end;
}

/* box colors */

.blue div {
    background-color: var(--blue-transparent);
}

.green div {
    background-color: var(--green-transparent);
}

.blue .summary p.name {
    color: var(--blue);
}

.green .summary p.name {
    color: var(--green);
}

.blue p, .blue a {
    color: var(--blue-dark);
}

.green p, .green a {
    color: var(--green-dark);
}


p {
    text-align: left;
    margin-bottom: 0.5rem;
}

div.clear {
    clear: both;
}

svg {
    width: 2.5em;
    height: 2.5em;
    fill: currentColor;
}

a:hover svg, a:active svg {
    fill: url(#gradient)
}

/* Column layout for projects */

.projets {
    display: block;
    column-count: 3;
    column-gap: 1rem;
}

.projets .box {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* Menu */

.nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--black-transparent);
    color: var(--white);
    font-size: 0.8em;
}

.main-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;

    max-width: 34rem;
    margin: 0 auto;
    padding-top: 0.5rem;
}

/* the sticky nav bar requires anchor offset */
* {
    scroll-margin-top: 3rem;
}

/* Reduce navigation to 2 columns on very small screens, adjusting the anchor offset accordingly */
@media (max-width: 480px) {
    .main-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    * {
        scroll-margin-top: 5rem;
    }
}

.main-nav a {
    display: inline-block;
    padding-bottom: 0.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}

.main-nav a:hover {
    text-decoration: none;
    color: var(--blue);
}

.main-nav a::nth-of-type(even):hover {
    text-decoration: none;
    color: var(--green);
}

footer {
    background-color: var(--black-transparent);
    width: 100%;
    font-size: 0.8rem;
    color: var(--white);
    margin: 0;
    padding: 1.5rem 1rem;
}

footer a:hover,
footer a:active {
    text-decoration: underline;
    color: var(--white);
}

footer a {
    color: var(--white);
    text-decoration: none;
}

footer p {
    margin: 0;
}



/* Responsiveness
 - Large font size in general, but scale down font size on smaller screens
 - Adapt image zooming to ensure everyone remains visible
*/
html {
    font-size: 32px;
}

@media (max-width: 1200px) {
    html {
        font-size: 28px
    }

    .boxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .projets {
        column-count: 2;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 24px
    }

    .hero-bg {
        transform: scale(1.1);
    }

    .boxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .projets {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 20px
    }

    .hero-bg {
        transform: scale(1.2);
    }

    .boxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .projets {
        column-count: 1;
    }

    /* larger arrows */
    
    .more, .close {
        font-size: 1.8em;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 16px
    }

    .hero-bg {
        transform: scale(1.2);
    }
    
    .boxes {
        grid-template-columns: repeat(1, 1fr);
    }

    .projets {
        column-count: 1;
    }

    /* also expand only to single column */

    .box.open {
        display: block;
        grid-column: auto;
    }

    .box.open .detail, .box.open .summary {
        display: block;
        grid-column: auto;
        grid-row: auto;
        height: auto;
    }

    /* larger arrows */
    .more, .close {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .hero-bg {
        transform: scale(1.1);
    }
    
    .boxes {
        grid-template-columns: repeat(1, 1fr);
    }

    .projets {
        column-count: 1;
    }

    /* also expand only to single column */

    .box.open {
        display: block;
        grid-column: auto;
    }

    .box.open .detail, .box.open .summary {
        display: block;
        grid-column: auto;
        grid-row: auto;
        height: auto;
    }

    /* larger arrows */
    .more, .close {
        font-size: 2em;
    }

}