/* valisk.eu */

/* blockflow.css is enqueued from Site::enqueue() ahead of this file. this theme keeps
   all block css in this file: tokens, shared parts, then one section per block in the
   order the blocks are registered in functions.php. */

/* fonts: local woff2 files (latin subset), the same ones the under-construction page uses */
@font-face {
    font-family: "Red Hat Display";
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/red-hat-display-800.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
}

/* vars: the valisk house style tokens (design system variant 4) */
:root {

    /* colors */
    --paper: #F6F3EC;
    --surface: #ffffff;
    --ink: #14201C;
    --muted: #55615B;
    --line: #D8D3C6;
    --pine: #0F5C4A;
    --pine-deep: #0A3D32;
    --mist: #DCEBE4;
    --signal: #F5B800;

    /* hairlines */
    --border: 1px solid var(--line);

    /* corners */
    --radius: 10px;
    --radius-l: 20px;

    /* fonts */
    --font-heading: "Red Hat Display", system-ui, sans-serif;
    --font-body: "IBM Plex Sans", system-ui, sans-serif;

    /* spacing scale: the house style's own steps (8 / 16 / 24 / 48), not the 15px
       scale of other blockflow themes */
    --space-xs: .5rem;
    --space-s: 1rem;
    --space-m: 1.5rem;
    --space-l: 3rem;

    /* container: its width, and the gutter left and right of it */
    --container-width: 992px;
    --gutter: var(--space-m);

    /* width of a column of running text */
    --text-width: 34em;

    /* gen transition */
    --transition-speed-and-ease: .2s ease;
    --transition-all: all var(--transition-speed-and-ease);

    /* breakpoints — reference only. custom properties can't be used inside @media
       conditions, so the literal px values are repeated below: sm 480px / md 810px */
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.625;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* the footer stays at the bottom of the window on a short page */
#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* headings */
h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.375rem, 6.2vw, 4rem);
    line-height: 1.04;
    letter-spacing: -.02em;
}

h2 {
    font-size: 1.875rem;
    line-height: 1.2;
    letter-spacing: -.015em;
}

h3 {
    font-size: 1.375rem;
    line-height: 1.25;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 var(--space-s);

    &:last-child {
        margin-bottom: 0;
    }
}

strong,
b {
    font-weight: 600;
}

:focus-visible {
    outline: 3px solid var(--signal);
    outline-offset: 3px;
}

/* the rich-text vocabulary: an italic line alone in its paragraph is the label with
   the status lamp */
.block p > em:only-child {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: 999px;
    font-style: normal;
    font-weight: 600;
    font-size: .875rem;
    line-height: 1.25rem;
    color: var(--pine);
    background-color: var(--mist);

    &::before {
        content: "";
        width: 8px;
        height: 8px;
        flex: none;
        border-radius: 50%;
        background-color: var(--signal);
        box-shadow: 0 0 0 2px var(--pine);
    }
}

.block p:has(> em:only-child) {
    margin-bottom: var(--space-m);
}

/* buttons: a bold link is the green button, a plain link next to it the outlined one */
.block-hero .contact p a,
.block-error404 strong > a,
.block-text strong > a,
.block .button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--pine);
    box-shadow: inset 0 0 0 2px var(--pine);

    &:hover {
        color: var(--paper);
        background-color: var(--pine-deep);
        box-shadow: inset 0 0 0 2px var(--pine-deep);
    }
}

.block-hero .contact p strong a,
.block-hero .contact p a:has(strong),
.block-error404 strong > a,
.block-text strong > a,
.block-pricing .featured .button {
    color: var(--paper);
    background-color: var(--pine);
}

/* container */
.container {
    width: 100%;
    max-width: calc(var(--container-width) + 2 * var(--gutter));
    padding: 0 var(--gutter);
    margin: 0 auto;
}

/* content blocks get their vertical rhythm from the wrapper */
.block > .container.content {
    padding-block: var(--space-l);
}

/* a block that follows another one starts with a hairline */
main > .block + .block > .container.content {
    padding-top: 0;

    &::before {
        content: "";
        display: block;
        margin-bottom: var(--space-l);
        border-top: var(--border);
    }
}


/* ========================================================================
   404
   ======================================================================== */

.block-error404 {
    .text {
        max-width: var(--text-width);

        h1 {
            margin-bottom: var(--space-s);
        }
    }
}


/* ========================================================================
   HEADER
   ======================================================================== */

.block-header {
    .header {
        position: relative;
        padding: var(--space-m) 0;
    }

    .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-s) var(--space-m);
    }

    .home {
        display: block;

        svg {
            display: block;
            height: 44px;
            width: auto;
        }
    }

    .menu {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs) var(--space-m);
        font-weight: 600;

        a:hover,
        .active > a {
            color: var(--pine);
        }

        /* a menu item with the css class "support" gets the lifebuoy */
        .support > a {
            display: inline-flex;
            align-items: center;
            gap: var(--space-xs);
            color: var(--pine);

            &::before {
                content: "";
                width: 1.25em;
                height: 1.25em;
                flex: none;
                background-color: currentColor;
                mask: url(../images/icons/support.svg) no-repeat center / contain;
                transition: transform .4s ease;
            }

            &:hover {
                color: var(--pine-deep);

                &::before {
                    transform: rotate(45deg);
                }
            }
        }
    }

    /* skip link: only there for whoever tabs to it */
    .skip {
        position: absolute;
        left: var(--gutter);
        top: -100px;
        padding: var(--space-xs) var(--space-s);
        border-radius: var(--radius);
        color: var(--paper);
        background-color: var(--pine);
        z-index: 10;

        &:focus {
            top: var(--space-xs);
        }
    }
}


/* ========================================================================
   CONTENTS (pages and articles)
   ======================================================================== */

.block-contents {
    .container.content > * {
        max-width: 42rem;
    }

    time {
        display: block;
        margin-bottom: var(--space-s);
        font-size: .875rem;
        line-height: 1.25rem;
        color: var(--muted);
    }

    h1 {
        margin-bottom: var(--space-m);
        font-size: clamp(2.125rem, 5vw, 3.25rem);
        line-height: 1.08;
    }

    /* the line under the title of an article: <p class="tagline"> */
    .tagline {
        margin-bottom: var(--space-m);
        font-size: 1.25rem;
        line-height: 1.875rem;
        color: var(--muted);
    }

    h2 {
        margin: var(--space-l) 0 var(--space-s);
    }

    h3,
    h4 {
        margin: var(--space-m) 0 var(--space-xs);
    }

    h4 {
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 1rem;
    }

    p,
    ul,
    ol {
        font-size: 1.0625rem;
        line-height: 1.75rem;
    }

    ul,
    ol {
        margin: 0 0 var(--space-s);
        padding-left: 1.25em;

        li {
            margin-bottom: 4px;
        }
    }

    ul {
        list-style: disc;
    }

    li::marker {
        color: var(--pine);
    }

    a {
        display: inline;
        color: var(--pine);
        text-decoration: underline;
        text-underline-offset: .15em;

        &:hover {
            color: var(--pine-deep);
        }
    }

    blockquote {
        margin: var(--space-m) 0;
        padding: var(--space-s) var(--space-m);
        border: var(--border);
        border-radius: var(--radius);
        font-weight: 600;
        background-color: var(--surface);
    }

    img {
        height: auto;
        border-radius: var(--radius);
    }

    figure {
        margin: var(--space-m) 0;
    }

    figcaption {
        margin-top: var(--space-xs);
        font-size: .875rem;
        color: var(--muted);
    }

    hr {
        margin: var(--space-l) 0;
        border: 0;
        border-top: var(--border);
    }

    code {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: .9em;
        background-color: var(--mist);
    }

    pre {
        margin: var(--space-m) 0;
        padding: var(--space-s) var(--space-m);
        border-radius: var(--radius);
        overflow-x: auto;
        font-size: .875rem;
        line-height: 1.5rem;
        color: var(--paper);
        background-color: var(--pine-deep);

        code {
            padding: 0;
            font-size: inherit;
            background: none;
        }
    }

    table {
        width: 100%;
        margin: var(--space-m) 0;

        th,
        td {
            padding: var(--space-xs) var(--space-s) var(--space-xs) 0;
            border-bottom: var(--border);
            text-align: left;
            vertical-align: top;
        }
    }

    /* the way back under an article */
    .back {
        margin-top: var(--space-l);
        font-size: 1rem;
        font-weight: 600;

        a {
            text-decoration: none;

            &::before {
                content: "\2190\00a0";
            }
        }
    }
}


/* ========================================================================
   HERO
   ======================================================================== */

.block-hero {
    .text-and-panel {
        display: grid;
        gap: var(--space-l);
        align-items: center;

        @media screen and (min-width: 810px) {
            grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
        }
    }

    .text {
        h1 {
            margin-bottom: var(--space-s);
        }

        p,
        blockquote {
            max-width: var(--text-width);
        }

        p {
            margin-bottom: var(--space-m);
        }

        /* the paragraph right under the title is the intro */
        h1 + p {
            font-size: 1.1875rem;
            line-height: 1.875rem;
        }

        /* a quote is the white box */
        blockquote {
            margin: 0 0 var(--space-m);
            padding: var(--space-s) var(--space-m);
            border: var(--border);
            border-radius: var(--radius);
            font-weight: 600;
            background-color: var(--surface);

            p {
                margin: 0;
            }
        }
    }

    .contact {
        p {
            max-width: var(--text-width);
        }

        /* the paragraph with the links is the row of buttons */
        p:has(a) {
            display: flex;
            flex-wrap: wrap;
            gap: var(--space-s);
        }
    }

    /* the principles, in small print */
    .principles {
        display: grid;
        gap: var(--space-s);
        max-width: var(--text-width);
        margin-top: var(--space-l);
        padding-top: var(--space-m);
        border-top: var(--border);
        font-size: .875rem;
        line-height: 1.375rem;
        color: var(--muted);

        @media screen and (min-width: 480px) {
            grid-template-columns: 1fr 1fr;
            gap: var(--space-m);
        }

        strong {
            display: flex;
            align-items: center;
            gap: var(--space-xs);
            margin-bottom: 4px;
            color: var(--ink);

            &::before {
                content: "";
                width: 8px;
                height: 8px;
                flex: none;
                margin-left: 2px;
                border-radius: 50%;
                background-color: var(--signal);
                box-shadow: 0 0 0 2px var(--pine);
            }
        }
    }

    /* the dark panel: photo on top, numbered list under it */
    .panel {
        display: flex;
        flex-direction: column;
        padding: var(--space-m);
        border-radius: var(--radius-l);
        overflow: hidden;
        color: var(--paper);
        background-color: var(--pine-deep);

        @media screen and (min-width: 810px) {
            min-height: 360px;
        }

        img {
            display: block;
            width: calc(100% + 2 * var(--space-m));
            max-width: none;
            height: auto;
            aspect-ratio: 3 / 2;
            margin: calc(-1 * var(--space-m)) calc(-1 * var(--space-m)) var(--space-s);
            object-fit: cover;
            background-color: var(--pine);
        }

        .items {
            list-style: none;
            margin: 0;
            padding: 0;
            counter-reset: item;

            li {
                display: flex;
                gap: var(--space-s);
                padding: 10px 0;
                border-top: 1px solid rgba(220, 235, 228, .22);
                font-weight: 600;
                counter-increment: item;

                &:first-child {
                    border-top: 0;
                }

                &::before {
                    content: counter(item, decimal-leading-zero);
                    font-weight: 400;
                    font-variant-numeric: tabular-nums;
                    color: var(--mist);
                }
            }
        }
    }
}


/* ========================================================================
   TEXT
   ======================================================================== */

.block-text {
    .text {
        max-width: 42rem;

        h1,
        h2 {
            margin-bottom: var(--space-s);
        }

        h1 {
            font-size: clamp(2.125rem, 5vw, 3.25rem);
            line-height: 1.08;
        }

        /* the paragraph right under the page title is the intro */
        h1 + p {
            font-size: 1.1875rem;
            line-height: 1.875rem;
        }

        ul {
            margin: 0 0 var(--space-s);
            padding-left: 1.25em;
            list-style: disc;
        }

        :not(strong) > a {
            display: inline;
            color: var(--pine);
            text-decoration: underline;
            text-underline-offset: .15em;
        }
    }
}


/* ========================================================================
   CHECKLISTS ("achter de schermen")
   ======================================================================== */

.block-checklists {
    .text {
        margin-bottom: var(--space-m);

        h2 {
            margin-bottom: var(--space-xs);
        }

        p {
            color: var(--muted);
        }
    }

    .items {
        display: grid;
        gap: var(--space-m);

        @media screen and (min-width: 810px) {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        > li {
            padding: var(--space-m);
            border: var(--border);
            border-radius: var(--radius);
            background-color: var(--surface);
        }

        h3 {
            margin-bottom: var(--space-s);
            font-family: var(--font-body);
            font-weight: 600;
            font-size: .875rem;
            line-height: 1.25rem;
            letter-spacing: .06em;
            text-transform: uppercase;
            color: var(--pine);
        }

        ul li {
            position: relative;
            padding: 6px 0 6px 26px;
            font-size: .9375rem;
            line-height: 1.375rem;

            /* check mark: two borders of a rotated box */
            &::before {
                content: "";
                position: absolute;
                left: 4px;
                top: 10px;
                width: 6px;
                height: 11px;
                border: solid var(--pine);
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }
        }
    }
}


/* ========================================================================
   PRICEHERO (the opening of the pricing page)
   ======================================================================== */

.block-pricehero {
    .text-and-panel {
        display: grid;
        gap: var(--space-l);
        align-items: center;

        @media screen and (min-width: 810px) {
            grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
        }
    }

    .text {
        h1 {
            margin-bottom: var(--space-s);
            font-size: clamp(2.125rem, 5vw, 3.25rem);
            line-height: 1.08;
        }

        p {
            max-width: var(--text-width);
        }

        /* the paragraph right under the title is the intro */
        h1 + p {
            margin-bottom: var(--space-m);
            font-size: 1.1875rem;
            line-height: 1.875rem;
        }
    }

    /* the dark panel, the same one as on the homepage */
    .panel {
        display: flex;
        flex-direction: column;
        padding: var(--space-m);
        border-radius: var(--radius-l);
        color: var(--paper);
        background-color: var(--pine-deep);

        @media screen and (min-width: 810px) {
            padding: calc(var(--space-m) + var(--space-xs));
        }
    }

    h2 {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        margin-bottom: var(--space-s);
        font-family: var(--font-body);
        font-weight: 600;
        font-size: .875rem;
        line-height: 1.25rem;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--mist);

        /* the status lamp */
        &::before {
            content: "";
            width: 8px;
            height: 8px;
            flex: none;
            border-radius: 50%;
            background-color: var(--signal);
        }
    }

    .price {
        margin-bottom: var(--space-s);
        color: var(--mist);

        strong {
            margin-right: 4px;
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 3.5rem;
            line-height: 1;
            letter-spacing: -.02em;
            color: var(--paper);
        }
    }

    .details {
        margin-bottom: var(--space-m);

        p {
            margin-bottom: var(--space-xs);
        }

        ul {
            margin: var(--space-xs) 0 0;
        }

        ul li {
            position: relative;
            padding: 8px 0 8px 26px;
            border-top: 1px solid rgba(220, 235, 228, .22);
            font-size: .9375rem;
            line-height: 1.375rem;

            &:first-child {
                border-top: 0;
            }

            /* check mark: two borders of a rotated box */
            &::before {
                content: "";
                position: absolute;
                left: 4px;
                top: 12px;
                width: 6px;
                height: 11px;
                border: solid var(--signal);
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }
        }
    }

    .button {
        align-self: flex-start;
        color: var(--pine-deep);
        background-color: var(--paper);
        box-shadow: none;

        &:hover {
            color: var(--pine-deep);
            background-color: var(--signal);
            box-shadow: none;
        }
    }

    .note {
        margin: var(--space-s) 0 0;
        padding: 0 var(--space-xs);
        font-size: .875rem;
        line-height: 1.375rem;
        color: var(--muted);
    }
}


/* ========================================================================
   PRICING (price cards)
   ======================================================================== */

/* right under a text block or the price hero the cards belong to it: no hairline in between */
main > :is(.block-text, .block-pricehero) + .block-pricing > .container.content::before {
    display: none;
}

.block-pricing {
    .items {
        display: grid;
        gap: var(--space-m);

        @media screen and (min-width: 810px) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        /* each item takes two rows of the shared grid, card and note, so the cards
           end at the same height whether or not a note sits under one of them */
        > li {
            display: grid;
            grid-template-rows: subgrid;
            grid-row: span 2;
            gap: 0;
        }
    }

    .card {
        display: flex;
        flex-direction: column;
        padding: var(--space-m);
        border: var(--border);
        border-radius: var(--radius-l);
        background-color: var(--surface);

        @media screen and (min-width: 810px) {
            padding: calc(var(--space-m) + var(--space-xs));
        }
    }

    /* the featured card: green border, filled button */
    .featured .card {
        border-color: var(--pine);
        box-shadow: 0 0 0 1px var(--pine);
    }

    h2 {
        margin-bottom: var(--space-s);
        font-family: var(--font-body);
        font-weight: 600;
        font-size: .875rem;
        line-height: 1.25rem;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--pine);
    }

    .price {
        margin-bottom: var(--space-s);
        color: var(--muted);

        strong {
            margin-right: 4px;
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 1.5rem;
            line-height: 1.2;
            letter-spacing: -.015em;
            color: var(--ink);
        }
    }

    /* only the featured card shouts its price */
    .featured .price strong {
        font-size: 2.5rem;
        line-height: 1.1;
        letter-spacing: -.02em;
    }

    /* a card without a price opens with a question or statement instead */
    .details h3 {
        margin-bottom: var(--space-s);
        font-size: 1.5rem;
        line-height: 1.2;
        letter-spacing: -.015em;
    }

    .details {
        margin-bottom: var(--space-m);

        p {
            margin-bottom: var(--space-xs);
        }

        ul {
            margin: var(--space-xs) 0 var(--space-s);
        }

        ul li {
            position: relative;
            padding: 5px 0 5px 26px;
            font-size: .9375rem;
            line-height: 1.375rem;

            /* check mark: two borders of a rotated box */
            &::before {
                content: "";
                position: absolute;
                left: 4px;
                top: 9px;
                width: 6px;
                height: 11px;
                border: solid var(--pine);
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }
        }
    }

    /* the button sits at the bottom of the card, whatever the length of the list */
    .button {
        margin-top: auto;
        align-self: flex-start;
    }

    .note {
        margin: var(--space-s) 0 0;
        padding: 0 var(--space-xs);
        font-size: .875rem;
        line-height: 1.375rem;
        color: var(--muted);
    }
}


/* ========================================================================
   CTA (the dark green panel)
   ======================================================================== */

.block-cta {
    .panel {
        display: grid;
        gap: var(--space-m);
        align-items: center;
        padding: var(--space-m);
        border-radius: var(--radius-l);
        color: var(--paper);
        background-color: var(--pine-deep);

        @media screen and (min-width: 810px) {
            grid-template-columns: minmax(0, 1fr) auto;
            gap: var(--space-l);
            padding: var(--space-l);
        }
    }

    .text {
        max-width: var(--text-width);

        h2 {
            margin-bottom: var(--space-s);
        }

        p {
            color: var(--mist);
        }
    }

    .button {
        justify-self: start;
        color: var(--pine-deep);
        background-color: var(--paper);
        box-shadow: none;

        &:hover {
            color: var(--pine-deep);
            background-color: var(--signal);
            box-shadow: none;
        }
    }
}


/* ========================================================================
   POSTS (the list of articles)
   ======================================================================== */

.block-posts {
    h2 {
        margin-bottom: var(--space-s);
    }

    .posts > li {
        border-top: var(--border);

        &:first-child {
            border-top: 0;
        }
    }

    .post {
        display: grid;
        gap: var(--space-xs) var(--space-l);
        padding: var(--space-m) 0;

        /* title on the left, excerpt next to it */
        @media screen and (min-width: 810px) {
            grid-template-columns: 16rem minmax(0, 1fr);
            align-items: baseline;
        }

        h3 {
            font-size: 1.125rem;
            line-height: 1.5rem;
        }

        time {
            display: block;
            margin-top: 4px;
            font-size: .875rem;
            line-height: 1.25rem;
            color: var(--muted);
        }

        p {
            margin-bottom: var(--space-xs);
            color: var(--muted);
        }

        /* the arrow comes from here, the editor never types it */
        .more {
            font-weight: 600;
            color: var(--pine);

            &::after {
                content: "\00a0\2192";
            }
        }

        &:hover .more {
            color: var(--pine-deep);
            text-decoration: underline;
            text-underline-offset: .15em;
        }

        &:hover h3 {
            color: var(--pine);
        }
    }

    .posts > li:first-child .post {
        padding-top: var(--space-xs);
    }

    .posts > li:last-child .post {
        padding-bottom: 0;
    }
}


/* ========================================================================
   FOOTER
   ======================================================================== */

.block-footer {
    border-top: var(--border);
    font-size: .875rem;
    line-height: 1.25rem;
    color: var(--muted);

    > .container.content {
        padding-block: var(--space-m);
    }

    .text-and-copyright {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--space-xs) var(--space-m);
    }

    p {
        margin: 0;
    }

    a {
        display: inline;
        color: var(--pine);
        text-decoration: underline;
    }

    strong {
        color: var(--ink);
    }

    .address,
    .street-postalcode-and-place {
        display: inline;
    }

    .copyright-and-menu {
        @media screen and (min-width: 810px) {
            text-align: right;
        }
    }

    .footer-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 0 var(--space-s);

        @media screen and (min-width: 810px) {
            justify-content: flex-end;
        }
    }
}
