@charset "UTF-8";

/*
 * Gallery page: the strips of thumbnails of its projects, and the carousel that opens over the
 * page when one of them is clicked (FO-GALLERIES-02 to -06).
 *
 * Everything is sized from one single length per breakpoint, "--fo-thumb-size": the square cells,
 * the gap between them and the wider cells of a video only project all derive from it, so recaling
 * the page is a one number change.
 */

.fo-gallery-page {
    --fo-thumb-size: min(46vw, 300px);
    --fo-strip-gap: 3.5vw;
    --fo-title-gutter: 7vw;
    --fo-arrow-icon: 3.5vw;
    --fo-arrow-padding: 2.3vw 1.7vw;
    --fo-tool-icon: 5vw;

    padding-bottom: 8vh;
}

.fo-gallery-page__title {
    margin: 8vh 0 9vh 0;
    font-family: var(--fo-font-serif);
    font-size: 8vw;
    line-height: 115%;
    text-align: center;
}

/* ------------------- P R O J E C T ------------------- */

.fo-project {
    margin-bottom: 9vh;
}

.fo-project__title {
    margin: 0 var(--fo-title-gutter) 2.5vh var(--fo-title-gutter);
    font-family: var(--fo-font-serif);
    font-size: 6vw;
    line-height: 120%;
    text-align: left;
}

/*
 * A project holding too few medias to fill the screen gets a narrower band, which the controller
 * centres; the title follows it rather than staying alone on the far left, exactly as the site in
 * production does.
 */
.fo-project--narrow .fo-project__title {
    margin-left: 0;
    margin-right: 0;
    text-align: center;
}

/* The band is the positioning context of the two arrows, so they follow it when it narrows */
.fo-project__band {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/*
 * "column-gap" has no effect of its own here, the Swiper container being a block: it carries the
 * gap of the design down to the controller, which reads it back already resolved into pixels and
 * hands it over as the space between two slides.
 */
.fo-strip {
    -moz-column-gap: var(--fo-strip-gap);
    column-gap: var(--fo-strip-gap);
}

/*
 * The slow drift of FO-GALLERIES-03. Swiper chains its transitions with no pause; making their
 * timing function linear is what removes the step between two slides and turns the chain into one
 * continuous travel. Swiper 14 exposes that function as a custom property, so nothing is overridden.
 */
.fo-strip--drifting {
    --swiper-wrapper-transition-timing-function: linear;
}

/* ------------- T H U M B N A I L   C E L L ------------- */

/*
 * Square cells, whatever the proportions of the thumbnail inside. Thumbnails are generated at four
 * hundred pixels on their longest side with their own ratio preserved, so they come in every shape:
 * "cover" fills the cell by the smaller of the two dimensions and crops the other, centred. Nothing
 * is ever stretched.
 */
.fo-thumb {
    width: var(--fo-thumb-size);
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    background: none;
    overflow: hidden;
    cursor: pointer;
}

.fo-thumb__img {
    display: block;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    -webkit-transition: opacity 1s ease, -webkit-transform 1s ease;
    -moz-transition: opacity 1s ease, -moz-transform 1s ease;
    -o-transition: opacity 1s ease, -o-transform 1s ease;
    transition: opacity 1s ease, transform 1s ease;
}

/* The zoom is clipped by the cell: the square never changes size, only what is seen through it */
.fo-thumb:hover .fo-thumb__img {
    opacity: 0.6;
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

/* ---------------- V I D E O   C E L L ---------------- */

/*
 * A project whose medias are all iframes plays them where the thumbnails would be (FO-GALLERIES-04).
 * The cell keeps the proportions of the video and is a third taller than a square one, which is the
 * "full size display" of the user story; on a narrow screen it simply takes the width it is given.
 * 64/27 is that third (4/3) multiplied by the 16/9 of the video.
 */
.fo-embed {
    width: min(92vw, calc(var(--fo-thumb-size) * 64 / 27));
    height: auto;
    aspect-ratio: 16 / 9;
    background: var(--fo-color-text);
}

.fo-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* -------------------- A R R O W S -------------------- */

.fo-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    padding: var(--fo-arrow-padding);
    border: 0;
    background: rgba(100, 100, 100, 0.45);
    line-height: 0;
    cursor: pointer;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    -webkit-transition: background-color 0.7s ease;
    -moz-transition: background-color 0.7s ease;
    -o-transition: background-color 0.7s ease;
    transition: background-color 0.7s ease;
}

.fo-arrow:hover {
    background: rgba(150, 150, 150, 0.35);
}

.fo-arrow img {
    display: block;
    width: var(--fo-arrow-icon);
    height: auto;
}

.fo-arrow--prev {
    left: 1.5vw;
}

.fo-arrow--next {
    right: 1.5vw;
}

/* Over the carousel the arrows stand on the media itself: the maquette shows them with no frame */
.fo-arrow--overlay {
    z-index: 3;
    background: none;
}

.fo-arrow--overlay:hover {
    background: none;
    opacity: 0.6;
}

/* ------------------- O V E R L A Y ------------------- */

.fo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--fo-z-carousel);
    width: 100vw;
    height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/* The flex display above would otherwise win over the browser's own rule for the attribute */
.fo-overlay[hidden] {
    display: none;
}

.fo-overlay__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--fo-color-text);
    opacity: 0.9;
}

/* Nothing of the page shows through in fullscreen, and some browsers paint the element white */
.fo-overlay--fullscreen .fo-overlay__backdrop {
    opacity: 1;
}

.fo-overlay__tools {
    position: absolute;
    top: 3vh;
    right: 2vw;
    z-index: 3;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 2vw;
}

.fo-overlay__tool {
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    cursor: pointer;
    -webkit-transition: opacity 0.7s ease;
    -moz-transition: opacity 0.7s ease;
    -o-transition: opacity 0.7s ease;
    transition: opacity 0.7s ease;
}

.fo-overlay__tool:hover {
    opacity: 0.6;
}

.fo-overlay__icon {
    display: block;
    width: var(--fo-tool-icon);
    height: auto;
}

/* The two fullscreen icons sit side by side; the state class on the overlay reveals the right one */
.fo-overlay__icon--exit,
.fo-overlay--fullscreen .fo-overlay__icon--enter {
    display: none;
}

.fo-overlay--fullscreen .fo-overlay__icon--exit {
    display: block;
}

.fo-medias {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
}

.fo-media {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    height: 100vh;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/*
 * An image takes the whole height of the screen, less a small margin, and its width follows its own
 * ratio. Should that width pass the width of the page, and only then, "contain" scales the whole
 * thing down inside the box instead of cropping or stretching it (FO-GALLERIES-06).
 */
.fo-media__img {
    display: block;
    width: auto;
    height: 94vh;
    max-width: 100vw;
    -o-object-fit: contain;
    object-fit: contain;
}

/*
 * A video takes three quarters of the height, its width following the ratio the controller read on
 * the iframe itself; sixteen ninths is the default, which is what YouTube and Vimeo hand out. The
 * width is settled first so that a narrow screen reduces the height rather than the proportions.
 */
.fo-media__embed {
    width: min(100vw, calc(75vh * var(--fo-embed-ratio, 16 / 9)));
    aspect-ratio: var(--fo-embed-ratio, 16 / 9);
}

.fo-media__embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.fo-overlay--fullscreen .fo-media__img {
    height: 100vh;
}

.fo-overlay--fullscreen .fo-media__embed {
    width: min(100vw, calc(90vh * var(--fo-embed-ratio, 16 / 9)));
}

/* -------- R E S P O N S I V E    D E S I G N --------- */

@media only screen and (min-width: 768px) {
    .fo-gallery-page {
        --fo-thumb-size: min(33vw, 300px);
        --fo-strip-gap: 2.5vw;
        --fo-title-gutter: 5vw;
        --fo-arrow-icon: 2.5vw;
        --fo-arrow-padding: 1.8vw 1.1vw;
        --fo-tool-icon: 3.2vw;
    }

    .fo-gallery-page__title { font-size: 5vw; }
    .fo-project__title { font-size: 4.2vw; }
}

@media only screen and (min-width: 992px) {
    .fo-gallery-page {
        --fo-thumb-size: min(26vw, 300px);
        --fo-strip-gap: 2vw;
        --fo-title-gutter: 3vw;
        --fo-arrow-icon: 1.9vw;
        --fo-arrow-padding: 1.6vw 0.9vw;
        --fo-tool-icon: 2.4vw;
    }

    .fo-gallery-page__title {
        margin: 6vh 0 7vh 0;
        font-size: 3.3vw;
    }

    .fo-project__title { font-size: 3vw; }
    .fo-project { margin-bottom: 7vh; }
}

@media only screen and (min-width: 1200px) {
    .fo-gallery-page {
        --fo-thumb-size: min(21vw, 300px);
        --fo-strip-gap: 1.7vw;
        --fo-title-gutter: 2vw;
        --fo-arrow-icon: 1.3vw;
        --fo-arrow-padding: 1vw 0.6vw;
        --fo-tool-icon: 1.6vw;
    }

    .fo-gallery-page__title { font-size: 2.4vw; }
    .fo-project__title { font-size: 2vw; }
}
