/*
 * Theme Mijn Werk Online (included with BS CMS).
 *
 * For photographers and artists: calm and white, the work comes first.
 * Builds on the starter set (forms, text, blocks, the cookie banner); this
 * file changes the tokens and adds the layout of the theme:
 *
 *  1. Tokens         colours, type, sizes (most are theme settings)
 *  2. Frame          sidebar (menu-left) or bar on top (menu-top)
 *  3. Header         logo, menu, languages, light/dark, social links
 *  4. Content        widths, page titles, text
 *  5. Cards          blog overview and the posts block, "load more"
 *  6. Footer
 *  7. Intro screen   intro.tpl with the slideshow (mwo.js)
 *  8. Small screens  bar with a menu button, the menu over the page
 *
 * The classes on <body> come from layout.tpl: menu-left or menu-top,
 * logo-left, sticky, no-titles.
 */

@import url("../../site/site.css");


/* ---------- 1. Tokens ---------- */

/*
 * The values below are the defaults of the theme settings (theme.json);
 * what the owner chooses in Themes → Settings comes after this file.
 */
:root {
    --paper: #ffffff;
    --ink: #333333;
    --accent: #c34143;
    --deep: var(--paper);
    /* The footer is light, so the cookie banner (core) takes the text colour. */
    --consent-bg: var(--ink);
    --consent-ink: var(--paper);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --size: 16px;
    --heading-size: 32px;
    --heading-case: none;
    --heading-weight: 500;
    --menu-size: 15px;
    --menu-case: none;

    --page: 1170px;           /* text, titles and forms */
    --frame: 2000px;          /* galleries and the blog grid */
    --gutter: clamp(20px, 3.5vw, 40px);
    --sidebar: 240px;
    --logo-width: 200px;
    --bar: 64px;              /* height of the bar on small screens */
    --radius: 0px;

    --columns: 3;
    --ratio: 1.5;

    --intro-overlay: 30%;
    --intro-ink: #ffffff;
}

/* Dark: for the device setting and for the button (data-theme). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #000000;
        --ink: #dddddd;
        --accent: #e0686a;
        --deep: var(--paper);
    }
}

:root[data-theme="dark"] {
    --paper: #000000;
    --ink: #dddddd;
    --accent: #e0686a;
    --deep: var(--paper);
}

body.mwo { font-size: var(--size); line-height: 1.6; }


/* ---------- 2. Frame ---------- */

.mwo-frame { display: flex; flex-direction: column; flex: 1; min-height: 100vh; }
.mwo-page { display: flex; flex-direction: column; flex: 1; min-width: 0; }

@media (min-width: 860px) {
    /* Sidebar on the left; it stays put while the page scrolls. */
    .menu-left .mwo-frame { flex-direction: row; }
    .menu-left .site-header {
        position: sticky;
        top: 0;
        flex: none;
        width: var(--sidebar);
        height: 100vh;
        overflow-y: auto;
        border-bottom: 0;
    }

    /* Bar on top that stays visible while scrolling (setting "sticky"). */
    .menu-top.sticky .site-header { position: sticky; top: 0; z-index: 30; background: var(--paper); }
}

@media (min-width: 860px) and (max-width: 1099px) {
    .menu-left { --sidebar: 180px; }
}


/* ---------- 3. Header ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header__inner { display: flex; align-items: center; gap: 24px; }

.site-brand__link { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.site-brand__link picture { display: block; }
.site-brand__logo { display: block; width: var(--logo-width); max-width: 100%; height: auto; }
.site-brand__name { font-size: 18px; font-weight: 600; line-height: 1.2; }
.site-brand__tagline { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.site-nav a { font-size: var(--menu-size); text-transform: var(--menu-case); letter-spacing: .03em; color: var(--ink); }
.site-nav a:hover, .site-nav .is-active > a, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: none; }

.site-header__extra { display: flex; align-items: center; justify-content: center; gap: 12px; }
.site-header__extra:empty { display: none; }

/* Social links (partials/social), in the sidebar or in the footer. */
.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--ink); }
.social a:hover { color: var(--accent); }
.social svg { width: 20px; height: 20px; }

@media (min-width: 860px) {
    /* Sidebar: everything centred below each other, social links at the bottom. */
    .menu-left .site-header__inner { flex-direction: column; align-items: stretch; gap: 30px; min-height: 100%; padding: 40px 20px; text-align: center; }
    .menu-left .site-header__menu { display: flex; flex: 1; flex-direction: column; gap: 24px; }
    .menu-left .site-nav ul { flex-direction: column; align-items: center; gap: 2px; }
    .menu-left .site-nav a { display: block; padding: 6px 0; }
    /* Submenus are simply open, a little smaller. */
    .menu-left .site-nav ul ul { display: flex; position: static; min-width: 0; padding: 0 0 6px; background: none; border: 0; box-shadow: none; }
    .menu-left .site-nav ul ul a { padding: 3px 0; font-size: .9em; color: var(--muted); }
    .menu-left .site-header__menu .social { margin-top: auto; }

    /* On top: the logo centred above the menu ... */
    .menu-top .site-header__inner { flex-direction: column; gap: 18px; max-width: var(--frame); margin: 0 auto; padding: 24px var(--gutter) 18px; text-align: center; }
    .menu-top .site-header__menu { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; }
    .menu-top .site-nav ul { justify-content: center; }

    /* ... or to the left of it (setting "logo position"). */
    .menu-top.logo-left .site-header__inner { flex-direction: row; padding-top: 14px; padding-bottom: 14px; text-align: left; }
    .menu-top.logo-left .site-brand__link { align-items: flex-start; }
    .menu-top.logo-left .site-header__menu { flex: 1; justify-content: flex-end; }
}


/* ---------- 4. Content ---------- */

/* The frame is wide (galleries, the blog grid); text keeps --page. */
.mwo .container { max-width: calc(var(--frame) + 2 * var(--gutter)); }
.mwo .site-main { padding: 40px 0 72px; }
.menu-top .site-main { padding-top: 24px; }

.mwo .site-main :is(.entry__header, .listing__intro, .welcome, .prose, .entry-field:not(.entry-field--sections), .cards, .landing, .block:not(.block--gallery):not(.block--posts)) {
    max-width: var(--page);
}
/* Menu on the left: text along the left edge; on top: centred. */
.menu-top .site-main :is(.entry__header, .listing__intro, .welcome, .prose, .entry-field:not(.entry-field--sections), .cards, .landing, .block:not(.block--gallery):not(.block--posts)) {
    margin-left: auto;
    margin-right: auto;
}
.menu-top .entry__header { text-align: center; }

.entry__header { margin-bottom: 24px; }
.entry__title, .listing__title {
    font-size: var(--heading-size);
    font-weight: var(--heading-weight);
    line-height: 1.15;
    letter-spacing: .01em;
    text-transform: var(--heading-case);
}
h1, h2, h3, h4 { text-transform: var(--heading-case); }
.mwo .prose { font-size: inherit; }
/* Headings in the text and block titles follow the page title (setting "heading size"), so they never outgrow it. */
.mwo .prose :is(h1, h2, h3, h4), .mwo .site-main .block__title { font-weight: var(--heading-weight); letter-spacing: .01em; }
.mwo .prose h1 { font-size: calc(var(--heading-size) * .85); }
.mwo .prose h2, .mwo .site-main .block__title { font-size: max(1.15em, calc(var(--heading-size) * .72)); }
.mwo .prose h3 { font-size: max(1.05em, calc(var(--heading-size) * .6)); }
.mwo .prose h4 { font-size: max(1em, calc(var(--heading-size) * .5)); }

/* Setting "hide page titles": still there for screen readers and search engines. */
.no-titles .entry__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.no-titles .entry__header:not(:has(> :not(.entry__title))) { margin: 0; }


/* ---------- 5. Cards ---------- */

.cards-grid { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 40px 24px; margin: 0; padding: 0; list-style: none; }
.card { min-width: 0; }
.card__photo { display: block; overflow: hidden; aspect-ratio: var(--ratio); background: var(--line); }
.card__photo picture { display: block; height: 100%; }
.card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card__photo:hover img { transform: scale(1.04); }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .05em; }
.card__meta a { color: inherit; font-weight: 600; text-decoration: none; text-transform: uppercase; }
.card__meta a:hover { color: var(--accent); }
.card__meta time + a::before { content: "|"; margin-right: 8px; opacity: .5; }
.card__title { margin: 6px 0 0; font-size: 1.05em; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; }
.card__photo + .card__title { margin-top: 14px; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__text { margin: 6px 0 0; color: var(--muted); font-size: .85em; line-height: 1.65; }

.more { margin: 48px 0 0; text-align: center; }
.more__button { display: inline-block; padding: 10px 28px; border: 1px solid var(--line); color: var(--ink); font-size: 13px; letter-spacing: .05em; text-decoration: none; }
.more__button:hover { border-color: var(--ink); }
.more__button[aria-busy="true"] { opacity: .5; cursor: progress; }

.block--posts .block__title { margin-bottom: 24px; }


/* ---------- 6. Footer ---------- */

/* Not a solid block like in the starter set: a thin line and centred text. */
.mwo .site-footer { background: var(--paper); color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; text-align: center; }
.mwo .site-footer__inner { flex-direction: column; align-items: center; gap: 14px; padding-top: 30px; padding-bottom: 30px; }
.mwo .site-footer__area { color: var(--ink); }
.mwo .site-footer a { color: var(--ink); }
.mwo .site-footer__nav ul { justify-content: center; }
.mwo .site-footer :focus-visible { outline-color: var(--accent); }


/* ---------- 7. Intro screen (intro.tpl) ---------- */

.mwo-intro { min-height: 100vh; }
.mwo-intro .preview { position: relative; z-index: 3; }
.intro {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #111;
    color: var(--intro-ink);
}
.intro__slides, .intro__slide { position: absolute; inset: 0; }
.intro__slide { opacity: 0; transition: opacity 1.5s ease-in-out; }
.intro__slide.is-active { opacity: 1; }
.intro__slide picture { display: block; height: 100%; }
.intro__photo { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* The dark veil (setting) for readable text. */
.intro::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / var(--intro-overlay)); }

.intro__content { position: relative; z-index: 2; max-width: 800px; padding: 20px; text-align: center; }
.intro__title { margin: 0 0 1rem; font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 400; line-height: 1; letter-spacing: .05em; text-shadow: 2px 2px 10px rgb(0 0 0 / .5); animation: intro-down 1s ease-out; }
.intro__tagline { margin: 0 0 2.5rem; font-size: clamp(1rem, 2.4vw, 1.2rem); letter-spacing: .03em; text-shadow: 1px 1px 5px rgb(0 0 0 / .5); animation: intro-up 1s ease-out .3s backwards; }
.intro__button {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid currentColor;
    color: inherit;
    font-size: 14px;
    letter-spacing: .15em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background .3s, color .3s;
    animation: intro-up 1s ease-out .6s backwards;
}
.intro__button:hover { background: var(--intro-ink); color: #111; }
.intro__button:focus-visible { outline-color: var(--intro-ink); }

@keyframes intro-down { from { opacity: 0; transform: translateY(-30px); } }
@keyframes intro-up { from { opacity: 0; transform: translateY(30px); } }

@media (prefers-reduced-motion: reduce) {
    .intro__slide, .card__photo img, .intro__button { transition: none; }
    .intro__title, .intro__tagline, .intro__button { animation: none; }
}


/* ---------- 8. Small screens ---------- */

/*
 * One bar with the logo and the menu button for both layouts; the menu
 * opens over the page below the bar (site.js sets .is-open). Without
 * JavaScript the menu stays visible below the logo.
 */
@media (max-width: 859px) {
    .site-header { position: sticky; top: 0; z-index: 30; }
    .site-header__inner { flex-wrap: wrap; justify-content: space-between; padding: 0 var(--gutter); }
    .site-brand { display: flex; align-items: center; min-height: var(--bar); }
    .site-brand__link { flex-direction: row; }
    .site-brand__logo { width: auto; max-width: min(var(--logo-width), 55vw); max-height: 40px; }
    .site-brand__tagline { display: none; }

    .site-header__menu { width: 100%; padding-bottom: 16px; }
    .site-header__extra { justify-content: flex-start; margin-top: 16px; }
    .site-header__menu .social { justify-content: flex-start; margin-top: 12px; }

    .js .site-header__toggle { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; border-radius: 0; color: var(--ink); }
    .js .site-header__toggle[aria-expanded="true"] { background: none; color: var(--ink); }
    /* Three bars of 22px, a little further apart than in the starter set. */
    .site-header__toggle-icon { width: 22px; height: 14px; }
    .site-header__toggle-icon::before, .site-header__toggle-icon::after { width: 22px; }
    .site-header__toggle-icon::before { box-shadow: 0 6px 0 currentColor; }
    .site-header__toggle-icon::after { top: 12px; }
    [aria-expanded="true"] > .site-header__toggle-icon::before, [aria-expanded="true"] > .site-header__toggle-icon::after { top: 6px; }

    .js .site-header__menu.is-open {
        display: block;
        position: fixed;
        inset: var(--bar) 0 0;
        z-index: 30;
        overflow-y: auto;
        padding: 8px var(--gutter) 32px;
        background: var(--paper);
        border-top: 1px solid var(--line);
    }
    .js .site-nav a { font-size: 17px; text-transform: var(--menu-case); }
    .js .site-nav > ul > li:first-child { border-top: 0; }
    .site-header__menu .social { margin-left: -8px; }

    .mwo .site-main { padding-top: 24px; }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 559px) {
    .cards-grid { grid-template-columns: minmax(0, 1fr); }
}
