/* ==========================================================================
   Pieter Tieghem Photography - site stylesheet
   One stylesheet for every page. Sections:
   1. Base          5. Home page            9. Lightbox
   2. Header        6. Portfolio overview   10. Text pages (about, prints)
   3. Mobile menu   7. Series gallery
   4. Footer        8. Series navigation
   Breakpoints: phone <= 768px, tablet 769-1280px, desktop > 1280px.
   ========================================================================== */


/* 1. Base
   ========================================================================== */

@font-face {
    font-family: 'effra';
    src: url('../includes/font/effra-regular.woff') format('woff');
    font-display: swap;
}
@font-face {
    font-family: 'effra_bold';
    src: url('../includes/font/effra-bold.woff') format('woff');
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body,
h1, h2, h3, p, ul, li, figure, figcaption {
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    border: 0;
}

a {
    color: #fff;
    text-decoration: none;
    transition: color .3s ease;
}

body {
    min-height: 100vh;
    padding: 0 50px;
    background-color: #000;
    color: #bfbfbf;
    font-family: effra, arial, sans-serif;
    font-size: 14px;
    line-height: 26px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

/* Very dark grey content area on every page; header and footer stay black. */
main {
    padding: 25px;
    background-color: #0e0e0e;
}

/* Shared heading style: series titles and text page headings. */
.page-title,
.page-heading h1,
.page-heading h2 {
    margin: 0;
    color: rgba(243, 243, 243, .78);
    font-family: effra, arial, sans-serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 3px;
    text-transform: uppercase;
}

@media (max-width: 1280px) {
    main {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .page-title {
        font-size: 16px;
    }
}


/* 2. Header
   ========================================================================== */

header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
}

header .logo {
    display: block;
    min-width: 0;
}

/* Fixed size: some browsers (Safari) otherwise shrink the logo to nothing. */
header .logo img {
    width: 282px;
    height: auto;
    max-width: none;
}

header nav ul {
    display: flex;
}

header nav li + li {
    margin-left: 44px;
}

header nav a {
    color: #959595;
}

header nav a:hover,
header nav a.active {
    color: #fff;
}

/* Hamburger button: only visible on phones. */
.menu-toggle {
    display: none;
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-right: -11px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    position: absolute;
    left: 11px;
    width: 22px;
    height: 2px;
    background-color: #fff;
    transition: transform .3s ease, opacity .3s ease, top .3s ease;
}

.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }

.nav-open .menu-toggle span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}
.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}
.nav-open .menu-toggle span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}


/* 3. Mobile menu (phones only)
   ========================================================================== */

@media (max-width: 768px) {
    header {
        height: 60px;
        padding: 0 16px;
    }

    header .logo {
        position: relative;
        z-index: 2;
        margin-right: 16px;
    }

    header .logo img {
        width: min(282px, calc(100vw - 92px));
    }

    .menu-toggle {
        display: block;
        z-index: 2;
    }

    /* Full screen black overlay with centered links. */
    header nav {
        position: fixed;
        z-index: 1;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #000;
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease, visibility 0s linear .3s;
    }

    .nav-open header nav {
        opacity: 1;
        visibility: visible;
        transition: opacity .3s ease;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
    }

    header nav li + li {
        margin: 26px 0 0;
    }

    header nav a {
        color: #fff;
        font-size: 28px;
        line-height: 1.3;
    }

    header nav a.active {
        color: #959595;
    }

    body.nav-open {
        overflow: hidden;
    }
}


/* 4. Footer
   ========================================================================== */

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
}

footer .copyrights p {
    font-size: 13px;
}

footer .social-links ul {
    display: flex;
    align-items: center;
}

footer .social-links li + li {
    margin-left: 20px;
}

footer .social-links a {
    display: block;
    color: #959595;
}

footer .social-links a:hover {
    color: #fff;
}

footer .social-links svg {
    display: block;
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    footer {
        height: 50px;
        padding: 0 16px;
        justify-content: center;
    }

    footer .copyrights {
        display: none;
    }
}


/* 5. Home page (body class "home")
   ========================================================================== */

.home main {
    height: calc(100vh - 200px);
    padding: 0;
    background-color: #0e0e0e;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* The whole photo is a link to the portfolio. */
.home-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* Phones, tablets and narrow windows: show the whole photo, never crop it. */
@media (max-width: 1024px), (max-width: 1366px) and (hover: none) {
    .home main {
        background-size: contain;
    }
}

@media (max-width: 768px) {
    .home main {
        height: calc(100vh - 110px);
        height: calc(100svh - 110px);
    }
}


/* 6. Portfolio overview (portfolio.html)
   Columns: 1 on small phones, 2 up to 1024px, 3 up to 1440px, 4 above.
   ========================================================================== */

.portfolio .articles-wrapper {
    display: flex;
    flex-wrap: wrap;
}

.portfolio article {
    width: 25%;
    padding: 25px;
}

/* The whole cover is one link. */
.portfolio .article-wrapper {
    position: relative;
    display: block;
}

.portfolio figure {
    overflow: hidden;
}

.portfolio figure img {
    width: 100%;
    height: auto;
    transition: transform .5s ease;
}

/* Thin white frame, shown on hover. */
.portfolio .article-wrapper::after {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, .85);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

.portfolio .overlay {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 10px;
    width: 80%;
    max-width: 350px;
    padding: 10px 15px;
    color: #fff;
    text-align: center;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity .3s ease;
}

.portfolio .overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: .7;
    transition: opacity .3s ease;
}

.portfolio .overlay:hover::before {
    opacity: 1;
}

.portfolio .overlay .title {
    position: relative;
    margin: 0;
    color: #fff;
    font-family: effra, arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Hover: slight zoom inside the tile, thin white frame and the title. */
@media (hover: hover) {
    .portfolio .article-wrapper:hover figure img {
        transform: scale(1.04);
    }
    .portfolio .article-wrapper:hover::after,
    .portfolio .article-wrapper:hover .overlay {
        opacity: 1;
    }
}

/* Touch screens: always show the titles. */
@media (hover: none) {
    .portfolio .overlay {
        opacity: 1;
    }
}

@media (max-width: 1440px) {
    .portfolio article {
        width: 33.333%;
    }
}

@media (max-width: 1280px) {
    .portfolio article {
        padding: 10px;
    }
}

@media (max-width: 1024px) {
    .portfolio article {
        width: 50%;
    }
}

@media (max-width: 560px) {
    .portfolio article {
        width: 100%;
    }
}


/* 7. Series gallery (body class "portfolio-page")
   Square thumbnails. Columns: 3 on phones, 4 up to 1440px, 5 above.
   ========================================================================== */

.gallery-heading {
    padding: 38px 25px 8px;
}

.gallery .wrapper {
    display: flex;
    flex-wrap: wrap;
}

.gallery figure {
    width: 20%;
    padding: 25px;
}

.gallery figure a {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #0b0b0b;
}

.gallery figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

/* Captions are only shown in the lightbox. */
.gallery figure figcaption {
    display: none;
}

/* Thin white frame, shown on hover. */
.gallery figure a::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, .85);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}

/* Hover: slight zoom inside the square and the frame. */
@media (hover: hover) {
    .gallery figure a:hover img {
        transform: scale(1.04);
    }
    .gallery figure a:hover::after {
        opacity: 1;
    }
}

@media (max-width: 1440px) {
    .gallery figure {
        width: 25%;
    }
}

@media (max-width: 1280px) {
    .gallery-heading {
        padding: 25px 10px 5px;
    }
    .gallery figure {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .gallery-heading {
        padding: 25px 12px 5px;
    }
    .gallery figure {
        width: 33.333%;
        padding: 2px;
    }
}


/* 8. Series navigation (added by js/site.js under every series)
   ========================================================================== */

.series-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 25px 10px;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.series-nav a {
    display: inline-flex;
    align-items: center;
    color: #959595;
}

.series-nav a:hover {
    color: #fff;
}

.series-nav .prev,
.series-nav .next {
    flex: 1 1 0;
}

.series-nav .next {
    justify-content: flex-end;
}

.series-nav .prev::before,
.series-nav .next::after {
    content: "";
    width: 6px;
    height: 6px;
    border-left: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
}

.series-nav .prev::before {
    margin-right: 12px;
    transform: rotate(45deg);
}

.series-nav .next::after {
    margin-left: 12px;
    transform: rotate(-135deg);
}

@media (max-width: 1280px) {
    .series-nav {
        padding: 25px 10px 10px;
    }
}

@media (max-width: 768px) {
    .series-nav {
        padding: 25px 12px 10px;
        font-size: 11px;
        letter-spacing: 2px;
    }
    /* Not enough room for three links on a phone. */
    .series-nav .all {
        display: none;
    }
}


/* 9. Lightbox (Magnific Popup, class "portfolio-lightbox")
   ========================================================================== */

/* No page scrolling while the lightbox is open. */
html.lightbox-open,
html.lightbox-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

/* Open and close: soft fade of background and photo. */
.portfolio-lightbox.mfp-bg {
    background: #0b0b0b;
    opacity: 0;
    transition: opacity .3s ease-out;
}
.portfolio-lightbox.mfp-bg.mfp-ready {
    opacity: .95;
}
.portfolio-lightbox.mfp-bg.mfp-removing {
    opacity: 0;
}
.portfolio-lightbox.mfp-wrap .mfp-content {
    opacity: 0;
    transition: opacity .3s ease-out;
}
.portfolio-lightbox.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
}
.portfolio-lightbox.mfp-wrap.mfp-removing .mfp-content {
    opacity: 0;
}

/* Spacious black breathing room around the framed photograph. */
.portfolio-lightbox .mfp-container {
    padding: 40px 80px 68px;
}

.portfolio-lightbox.mfp-image-holder .mfp-content,
.portfolio-lightbox .mfp-image-holder .mfp-content {
    max-width: 75vw;
}

/* The frame hugs the actual image. */
.portfolio-lightbox .mfp-figure img.mfp-img {
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, .85);
    max-width: 75vw !important;
    max-height: 70vh !important;
}

.portfolio-lightbox .mfp-figure::after {
    display: none;
}

/* Changing photo: crossfade. The old photo (.lightbox-ghost, a copy made
   by js/site.js) fades out while the new one fades in on top of it.
   280ms: keep in sync with CROSSFADE_MS in js/site.js. */
.portfolio-lightbox .mfp-figure {
    opacity: 1;
    transition: opacity 280ms ease-in-out;
}
.portfolio-lightbox .mfp-figure.image-out {
    opacity: 0;
    transition: none;
}
.portfolio-lightbox .lightbox-ghost {
    z-index: 1044; /* just below the new photo */
    opacity: 1;
    pointer-events: none;
    transition: opacity 280ms ease-in-out;
}
/* Same frame as the real photo, so the copy matches it pixel for pixel. */
.portfolio-lightbox img.lightbox-ghost {
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .85);
}
.portfolio-lightbox .lightbox-ghost.is-fading {
    opacity: 0;
}

/* Caption, anchored below the image. */
.portfolio-lightbox .mfp-figure figcaption {
    position: static;
    padding: 0;
    background: transparent;
    transform: none;
}

.portfolio-lightbox .mfp-bottom-bar {
    position: fixed;
    top: auto;
    bottom: 22px;
    left: 0;
    width: 100%;
    margin: 0;
    text-align: center;
}

.portfolio-lightbox .mfp-title {
    padding: 0;
    color: #ccc;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
}

/* Counter (e.g. 3/14), top left, same look as the close button. */
.portfolio-lightbox .mfp-counter {
    position: fixed;
    top: 18px;
    left: 22px;
    right: auto;
    height: 40px;
    color: #fff;
    font-family: effra, arial, sans-serif;
    font-size: 12px;
    line-height: 40px;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Close button. */
.portfolio-lightbox .mfp-close,
.portfolio-lightbox.mfp-image-holder .mfp-close,
.portfolio-lightbox .mfp-image-holder .mfp-close {
    position: fixed;
    top: 18px;
    right: 22px;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: arial, sans-serif;
    line-height: 40px;
    text-align: center;
    opacity: 1;
    cursor: pointer;
}

/* Previous / next arrows (thin chevrons drawn in CSS). */
.portfolio-lightbox .arrow-left,
.portfolio-lightbox .arrow-right {
    position: fixed;
    z-index: 1046;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    background-color: #000;
    cursor: pointer;
}

.portfolio-lightbox .arrow-left {
    left: 28px;
}

.portfolio-lightbox .arrow-right {
    right: 28px;
}

.portfolio-lightbox .arrow-left::before,
.portfolio-lightbox .arrow-right::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
}

.portfolio-lightbox .arrow-left::before {
    margin-left: -2px;
    transform: rotate(45deg);
}

.portfolio-lightbox .arrow-right::before {
    margin-left: -6px;
    transform: rotate(-135deg);
}

@media (max-width: 768px) {
    .portfolio-lightbox .mfp-container {
        padding: 42px 18px 66px;
    }

    .portfolio-lightbox.mfp-image-holder .mfp-content,
    .portfolio-lightbox .mfp-image-holder .mfp-content {
        max-width: 88vw;
    }

    .portfolio-lightbox .mfp-figure img.mfp-img {
        max-width: 88vw !important;
        max-height: 68vh !important;
    }

    /* Phones: swipe instead of arrows. */
    .portfolio-lightbox .arrow-left,
    .portfolio-lightbox .arrow-right {
        display: none;
    }

    .portfolio-lightbox .mfp-close,
    .portfolio-lightbox.mfp-image-holder .mfp-close,
    .portfolio-lightbox .mfp-image-holder .mfp-close {
        top: 5px;
        right: 8px;
    }

    .portfolio-lightbox .mfp-counter {
        top: 5px;
        left: 14px;
    }

    .portfolio-lightbox .mfp-bottom-bar {
        bottom: 18px;
    }
}


/* 10. Text pages (body class "text-page": about.html, prints.html)
   ========================================================================== */

.text-page main {
    padding: 75px 25px;
}

.text-page .inner-container {
    width: 1100px;
    max-width: 100%;
    margin: 0 auto;
}

.text-page .page-heading h1 {
    margin-bottom: 20px;
}

.text-page .page-heading h2 {
    margin: 30px 0 20px;
    font-size: 16px;
}

.text-page main p {
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.text-page .text-block {
    max-width: 760px;
    margin-bottom: 20px;
}

.text-page .row {
    display: flex;
    flex-wrap: wrap;
    column-gap: 4%;
}

.text-page .column {
    margin-bottom: 30px;
}

.text-page .column.one-third  { width: 30.666%; }
.text-page .column.one-fourth { width: 22%; }

.text-page .info-label {
    margin-bottom: 20px;
}

.text-page .info-label .label {
    margin: 0;
    color: #fff;
    font-family: effra_bold, effra, arial, sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.text-page .info-label .text {
    margin: 0;
}

.text-page .print-size li {
    line-height: 24px;
    letter-spacing: 1px;
}

@media (max-width: 1280px) {
    .text-page main {
        padding: 50px 15px;
    }
    .text-page .column.one-third,
    .text-page .column.one-fourth {
        width: 48%;
    }
}

@media (max-width: 768px) {
    .text-page main {
        padding: 30px 16px;
    }
    .text-page .column.one-third,
    .text-page .column.one-fourth {
        width: 100%;
        margin-bottom: 20px;
    }
}
