/*
 * Reverie - refinements on top of the Dream theme.
 * Loaded after theme.css and mw-dream.css.
 */

/* ---------- Full-screen pages (layouts/home.php, layouts/about-fullscreen.php) ---------- */

html:has(> body.rv-locked) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body.rv-locked {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

body.rv-fullscreen .main-container > .edit > .module:first-child > section:first-of-type,
body.rv-fullscreen .main-container > .edit > section:first-child {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
}

/* phones: the photo also runs behind the browser bars and into the screen edges (viewport-fit=cover);
   whatever it can't reach takes the photo's average colour, set by reverie.js */
@supports (height: 100lvh) {
    body.rv-locked .main-container > .edit > .module:first-child > section:first-of-type,
    body.rv-locked .main-container > .edit > section:first-child {
        height: 100lvh;
    }
}

html:has(> body.rv-fullscreen),
body.rv-fullscreen {
    background-color: var(--rv-edge, #f8f8f8);
}

body.rv-fullscreen .main-container .pos-vertical-center {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

body.rv-fullscreen > nav {
    padding-top: env(safe-area-inset-top, 0px);
}

/* live edit can save the parallax script's pixel height/offset into the page (e.g. "height: 944px"),
   which leaves a white band on taller screens; a full-screen page never scrolls, so always cover */
body.rv-fullscreen .main-container section .background-image-holder {
    top: 0 !important;
    height: 100% !important;
    transform: none !important;
    background-size: cover !important;
    background-position: center center !important;
}

/* same saved height elsewhere: never let a background end before its section does */
.imagebg .background-image-holder {
    min-height: 100%;
}

/* the menu floats over the full-screen image instead of pushing it down */
body.rv-fullscreen > nav {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

body.rv-fullscreen > nav .nav-bar {
    position: relative;
    background: none !important;
    box-shadow: none;
    border-bottom: 0;
}

/* ---------- Mobile navigation ---------- */

/* menu button: wavy threads instead of the theme's lines icon (header.php) */
.nav-mobile-toggle .rv-threads {
    display: inline-block;
    margin-top: 22px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    vertical-align: top;
}

.nav-mobile-toggle .rv-threads__open,
nav.nav-open .nav-mobile-toggle .rv-threads__closed {
    display: none;
}

nav.nav-open .nav-mobile-toggle .rv-threads__open {
    display: inline;
}

@media all and (max-width: 990px) {
    /* keep the bar (and the toggle) reachable while scrolling;
       sticky does not work here because the theme sets overflow on body */
    body:not(.rv-fullscreen):not(.rv-no-nav) {
        padding-top: 65px;
    }

    body:not(.rv-fullscreen) > nav {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    body > nav .nav-mobile-toggle {
        right: 15px !important;
    }

    body > nav .nav-bar,
    body > nav .nav-bar.nav--transparent,
    body > nav .nav-bar.nav--fixed {
        position: relative;
        background: #f8f8f8 !important;
    }

    body.rv-fullscreen > nav:not(.nav-open) .nav-bar {
        background: none !important;
    }

    body.rv-fullscreen > nav:not(.nav-open) .nav-mobile-toggle {
        color: #fff;
        opacity: 1;
        text-shadow: 0 0 6px rgba(0, 0, 0, .45);
    }

    body > nav.nav-open .nav-bar {
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1em;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    }

    body > nav .nav-main > ul > li {
        display: block;
        margin: 0;
    }

    /* sub-menus flow inside the list (the desktop dropdown box covered the next items) */
    body > nav .nav-main > ul ul {
        position: static !important;
        display: none !important;
        width: 100%;
        padding: 0 0 .5em !important;
        background: none !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body > nav .nav-main li.rv-open > ul {
        display: block !important;
    }

    body > nav .nav-main > ul ul li {
        display: block;
        margin: 0;
    }

    body > nav .nav-main > ul ul a {
        font-size: 11px;
        opacity: .75;
        color: inherit !important;
    }

    body > nav .rv-sub {
        display: inline-block;
        width: 2.2em;
        height: 2.2em;
        margin-left: .2em;
        padding: 0;
        border: 0;
        background: none;
        vertical-align: middle;
        cursor: pointer;
        color: inherit;
    }

    body > nav .rv-sub::before {
        content: "";
        display: inline-block;
        width: .6em;
        height: .6em;
        border-right: 1px solid currentColor;
        border-bottom: 1px solid currentColor;
        transform: translateY(-25%) rotate(45deg);
        transition: transform .2s ease;
    }

    body > nav li.rv-open > .rv-sub::before {
        transform: translateY(15%) rotate(-135deg);
    }
}

@media all and (min-width: 991px) {
    body > nav .rv-sub {
        display: none;
    }
}

/* ---------- Works / Work / Iteration / Exhibition components ---------- */

.rv-work,
.rv-iteration,
.rv-exhibitions,
.rv-works .rv-features,
.rv-works .rv-strip {
    background: #fff;
}

/* banner (rv_banner.php): same block as the Contact page, title centred */
.rv-banner h2 {
    margin: 0;
}

/* lighter shade than the theme's (data-overlay 3 = 30%) */
.rv-banner[data-overlay]:before {
    opacity: .1;
}

/* whitespace below the banner, same on Works and Exhibitions */
.rv-works .rv-features {
    padding-top: 7em;
}

.rv-exhibitions .rv-rows--list {
    padding-top: 0;
}

@media all and (max-width: 767px) {
    .rv-works .rv-features {
        padding-top: 3.5em;
    }
}

.rv-row__heading {
    margin: 0 0 .6em;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.2;
}

.rv-row__heading a {
    color: #252525;
    text-decoration: none;
}

/* entry text in the sans-serif used everywhere else (titles, menu, cards), not the theme's serif */
.rv-row__text p,
.rv-lead,
.rv-lead p {
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

/* ---------- About (layouts/about-fullscreen.php): text aligned left like Home ---------- */

body.rv-about .page-title .container .row > div {
    text-align: left !important;
}

/* on phones drop the side spacing saved in live edit, so the text starts where Home's does */
@media all and (max-width: 767px) {
    body.rv-about .page-title .container .row {
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.rv-about .page-title .container .row > div {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ---------- Contact (layouts/contacts-simple.php): aligned with Home, text left at Home's size ---------- */

body.rv-contact .page-title .container .row > div {
    margin-left: 0;
    text-align: left !important;
}

body.rv-contact .page-title .mw-row {
    display: block !important;
    padding: 0 !important;
}

body.rv-contact .page-title .mw-col {
    display: block !important;
    float: none !important;
    width: 100% !important;
}

body.rv-contact .page-title .mw-col .mw-empty-element,
body.rv-contact .page-title .mw-col .regular-mode {
    display: flex;
    align-items: center;
    gap: .6em;
}

body.rv-contact .page-title .mw-col .mw-icon {
    width: 1.2em;
    font-size: 18px !important;
    text-align: center;
}

body.rv-contact .page-title .mw-col .module-spacer {
    display: none;
}

body.rv-contact .page-title .mw-col h5 {
    margin: 0;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 23px;
    font-weight: 400;
    line-height: 39px;
}

/* "Download my most recent portfolio": a second row of the menu bar (same ground, type and shadow) */
.rv-download {
    position: relative;
    z-index: 2;
    padding: 0 0 1.1em;
    background: transparent;
    box-shadow: 0 14px 20px -18px rgba(0, 0, 0, .12);
    text-align: center;
}

.rv-download p {
    margin: 0;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rv-download a {
    color: #232323;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
}

.rv-features {
    display: grid;
    gap: 5em;
    padding: 5em 0;
}

.rv-feature {
    position: relative;
    display: block;
    height: clamp(280px, 55vh, 560px);
    overflow: hidden;
    background: #ececec;
    color: #fff;
    text-decoration: none;
}

.rv-feature__img,
.rv-row__media img,
.rv-card__media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover;
    transition: transform .8s ease;
}

.rv-feature::after,
.rv-row__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .22);
    pointer-events: none;
}

.rv-row__media--plain::after {
    display: none;
}

.rv-feature:hover .rv-feature__img,
.rv-row__media:hover img,
.rv-card:hover .rv-card__media img {
    transform: scale(1.03);
}

.rv-feature__title,
.rv-row__title {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(26px, 4.5vw, 56px);
    line-height: 1.1;
    color: #fff;
}

/* Works index: title and materials, centred together */
.rv-feature__caption {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #fff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
}

.rv-feature__caption .rv-feature__title {
    position: static;
    display: block;
    transform: none;
    font-size: clamp(22px, 3vw, 38px);
}

.rv-feature__materials {
    display: block;
    margin-top: .7em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92);
}

.rv-materials,
.rv-materials p {
    margin: 0 0 1em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 13px;
    letter-spacing: .04em;
    color: #767676;
}

.rv-feature:hover,
.rv-feature:focus,
.rv-row__media:hover,
.rv-row__media:focus {
    color: #fff;
    text-decoration: none;
}

.rv-page-head {
    padding: 6em 0 3em;
}

.rv-page-head h1 {
    margin-bottom: .4em;
}

.rv-kicker,
.rv-card__kicker {
    margin: 0 0 .6em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.rv-kicker a {
    color: inherit;
}

.rv-lead {
    max-width: 46em;
}

.rv-lead,
.rv-lead p {
    font-size: 15px;
}

.rv-rows {
    display: grid;
    gap: 5em;
    padding-bottom: 5em;
}

.rv-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: clamp(320px, 60vh, 600px);
}

.rv-row__media {
    position: relative;
    display: block;
    overflow: hidden;
    background: #ececec;
    color: #fff;
}

.rv-row__title {
    font-size: clamp(22px, 3vw, 40px);
}

.rv-row__text {
    align-self: center;
    max-width: 36em;
    padding: 3em 8%;
}

.rv-row--flip .rv-row__media {
    order: 2;
}

.rv-row--flip .rv-row__text {
    justify-self: end;
}

.rv-more {
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 12px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.rv-iteration__body {
    padding: 1em 0 3em;
}

.rv-iteration .container,
.rv-work--single .container {
    max-width: 1000px;
}

/* live edit only: labels above the editable boxes, and empty boxes outlined so they can be found */
.rv-field-label {
    margin: 1.2em 0 .3em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-style: normal;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #9a9a9a;
}

body.rv-live .rv-materials,
body.rv-live .rv-lead {
    min-height: 2em;
    outline: 1px dashed #c4c4c4;
    outline-offset: 4px;
}

.rv-edit-tip {
    max-width: 46em;
    margin: 0 0 1.5em;
    padding: .8em 1em;
    border: 1px dashed #c4c4c4;
    font-size: 13px;
    font-style: normal;
}

.rv-passthrough {
    padding-top: 5em;
}

@media all and (max-width: 767px) {
    .rv-passthrough {
        padding-top: 2.5em;
    }
}

.rv-iteration__body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 2.5em;
}

.rv-strip {
    padding: 4em 0;
}

.rv-strip__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 1.5em;
}

.rv-strip__title {
    margin: 0;
}

.rv-strip__arrows {
    display: flex;
    gap: .5em;
}

.rv-strip__arrow {
    width: 2.6em;
    height: 2.6em;
    font-size: 16px;
    line-height: 1;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 50%;
    background: none;
    color: #252525;
    cursor: pointer;
}

.rv-strip__arrow:hover {
    border-color: #252525;
}

.rv-strip__track {
    display: flex;
    gap: 1.5em;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.rv-strip__track::-webkit-scrollbar {
    display: none;
}

.rv-card {
    display: block;
    flex: 0 0 calc((100% - 3em) / 3);
    min-width: 240px;
    scroll-snap-align: start;
    color: #252525;
    text-decoration: none;
}

.rv-card:hover,
.rv-card:focus {
    color: #252525;
    text-decoration: none;
}

.rv-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: .9em;
    background: #ececec;
}

.rv-card__kicker {
    display: block;
    margin-bottom: .3em;
    color: #767676;
}

.rv-card__title {
    display: block;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

.rv-strip__more {
    margin: 1.5em 0 0;
}

.rv-strip__more a {
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 12px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.rv-draft {
    display: inline-block;
    margin-left: .6em;
    padding: .15em .5em;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .1em;
    text-transform: uppercase;
    vertical-align: middle;
}

.rv-hint {
    color: #767676;
    font-style: italic;
}

.rv-link-panel {
    margin: 3em 0;
    padding: 1em 1.2em;
    border: 1px dashed #c4c4c4;
    font-size: 14px;
}

.rv-link-panel summary {
    cursor: pointer;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
}

.rv-link-panel summary small {
    margin-left: .5em;
    color: #999;
}

.rv-link-panel label {
    display: block;
    margin: .3em 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

/* the theme restyles (and hides) native checkboxes */
.rv-link-panel input[type=checkbox] {
    -webkit-appearance: checkbox;
    appearance: auto;
    position: static;
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0 .5em 0 0;
    opacity: 1;
    visibility: visible;
    vertical-align: middle;
}

.rv-link-panel__group {
    margin: 1em 0 .2em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.rv-link-panel__status {
    margin: .6em 0 0;
    min-height: 1.4em;
    color: #767676;
}

@media all and (max-width: 767px) {
    .rv-features,
    .rv-rows {
        gap: 3em;
    }

    .rv-features {
        padding: 3em 0;
    }

    .rv-feature {
        height: clamp(240px, 62vw, 420px);
    }

    .rv-page-head {
        padding: 3em 0 1.5em;
    }

    .rv-row {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .rv-row__media {
        height: clamp(240px, 75vw, 460px);
    }

    .rv-row--flip .rv-row__media {
        order: 0;
    }

    .rv-row__text {
        padding: 1.5em 16px 0;
        justify-self: start !important;
    }

    .rv-strip {
        padding: 3em 0;
    }

    .rv-card {
        flex-basis: 78%;
        min-width: 0;
    }
}

@media all and (max-width: 767px) {
    /* the theme collapses height-70 sections to their content on phones */
    .rv-banner {
        display: flex;
        align-items: center;
        height: 45vh !important;
        min-height: 280px;
    }

    .rv-banner .container.pos-vertical-center {
        position: relative;
        top: auto;
        transform: none;
        width: 100%;
    }
}

/* ---------- Picture rows (modules/layouts/templates/skin-rv-pictures-*.php) ----------
   One row, equal heights, nothing cropped: reverie.js sets each picture's --rv-ratio
   (width / height) so the row splits its width in proportion. Same gap and bottom margin
   as single pictures on iteration pages. */

.rv-pics-block {
    padding: 0;
}

.rv-pics {
    display: flex;
    align-items: flex-start;
    gap: 1.25em;
    margin: 0 0 2.5em;
}

.rv-pics > img,
.rv-iteration__body .rv-pics > img {
    display: block;
    flex: var(--rv-ratio, 1) 1 0%;
    min-width: 0;
    width: auto;
    /* !important: live edit writes width/height into each picture's own style when placing it */
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
}

@media all and (max-width: 767px) {
    .rv-pics {
        gap: .75em;
    }

    /* 3 and 4 in a row stack on phones; 2 side by side stay together */
    .rv-pics--3,
    .rv-pics--4 {
        flex-direction: column;
        gap: 1.25em;
    }

    .rv-pics.rv-pics--3 > img,
    .rv-pics.rv-pics--4 > img {
        width: 100% !important;
        flex: none !important;
    }
}

/* ---------- Text page with banner (layouts/text-banner.php) ---------- */

.rv-text {
    padding: 5em 0 5em;
    background: #fff;
}

.rv-text__body {
    max-width: 38em;
    margin: 0 auto;
}

.rv-text__body p {
    margin: 0 0 1.3em;
    font-family: Montserrat, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.85;
    color: #555;
    text-align: left;
}

.rv-text__body p.rv-text__intro {
    margin-bottom: 1.4em;
    font-size: 20px;
    line-height: 1.6;
    color: #252525;
}

@media all and (max-width: 767px) {
    .rv-text {
        padding: 3em 0;
    }

    .rv-text__body p {
        font-size: 15px;
    }

    .rv-text__body p.rv-text__intro {
        font-size: 18px;
    }
}

/* live edit: Microweber hides its "Add Layout" button whenever the box holds any module (e.g. a spacer),
   not only a layout block; keep it visible in boxes that accept layouts but have none yet */
.edit[data-layout-container]:not(:has(.module-layouts)) .mw-le-ghost-layout {
    display: block !important;
}
