/* Sermoneta: consistent project text AFTER every PhotoMe portfolio gallery.
   Grids, masonry, proofing, horizontal, fullscreen, Ken Burns, Flow, split. */
body.sermoneta-portfolio-gallery-first #page_caption {
    display: none !important;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-after-gallery {
    position: relative;
    z-index: 20;
    display: flow-root;
    clear: both;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 72px max(24px, calc((100vw - 1000px) / 2)) 85px;
    background: #fff;
    color: #222;
    text-align: center;
    scroll-margin-top: 100px;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-after-title {
    margin: 0 0 30px;
    font-size: clamp(28px, 3.5vw, 48px);
    line-height: 1.2;
    font-weight: 200;
    text-align: center;
    color: #222;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-after-gallery .sermoneta-native-intro {
    box-sizing: border-box;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    font-size: inherit;
    line-height: 1.8;
    text-align: center;
}
.sermoneta-portfolio-after-gallery .sermoneta-native-intro p { margin-bottom: 12px; }
.sermoneta-portfolio-after-gallery .sermoneta-project-credits { font-size: 13px; margin-top: 24px; }

/* Split Screen: the native text pane (#page_caption) is removed by request.
   Without this adaptation the gallery would occupy only the right 50%,
   leaving an empty left half. Keep native PhotoMe gallery/grid controls. */
body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-split_screen, .sermoneta-layout-split_screen_wide) #page_content_wrapper.split {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: #fff;
}
body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-split_screen, .sermoneta-layout-split_screen_wide) #page_content_wrapper.split .inner,
body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-split_screen, .sermoneta-layout-split_screen_wide) #page_content_wrapper.split .inner_wrapper {
    width: 100%;
    max-width: none;
}

/* Fullscreen Cover / Fullscreen / Ken Burns / Flow: PhotoMe locks both
   document scrolling and #wrapper height. Keep the original gallery engine
   fixed/absolute in the first viewport, then reveal the project text below. */
html.sermoneta-gallery-document-scroll {
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
html.sermoneta-gallery-document-scroll body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-fullscreen_cover, .sermoneta-layout-fullscreen, .sermoneta-layout-kenburns, .sermoneta-layout-flow) {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}
html.sermoneta-gallery-document-scroll body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-fullscreen_cover, .sermoneta-layout-fullscreen, .sermoneta-layout-kenburns, .sermoneta-layout-flow) #wrapper {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}
body.sermoneta-portfolio-gallery-first .sermoneta-gallery-viewport-spacer {
    position: relative;
    height: 100vh;
    min-height: 500px;
    pointer-events: none;
    background: transparent;
}
body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-fullscreen_cover, .sermoneta-layout-fullscreen, .sermoneta-layout-kenburns, .sermoneta-layout-flow) .sermoneta-portfolio-after-gallery {
    z-index: 100;
}
body.sermoneta-portfolio-gallery-first.sermoneta-layout-flow #imageFlow {
    height: 80vh !important;
    top: 20vh !important;
}
body.sermoneta-portfolio-gallery-first .sermoneta-gallery-to-details {
    position: fixed;
    z-index: 990;
    bottom: 28px;
    left: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    color: #fff;
    font-size: 32px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    background: rgba(0,0,0,.22);
    transition: background .2s ease;
}
body.sermoneta-portfolio-gallery-first .sermoneta-gallery-to-details.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
body.sermoneta-portfolio-gallery-first .sermoneta-gallery-to-details:hover { background: rgba(0,0,0,.55); color: #fff; }
body.sermoneta-portfolio-gallery-first .sermoneta-gallery-to-details:focus-visible { outline: 2px solid white; outline-offset: 4px; }
@media(max-width:767px) {
    body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-after-gallery { padding: 44px 18px 58px; scroll-margin-top: 90px; }
    body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-after-title { margin-bottom: 22px; }
    body.sermoneta-portfolio-gallery-first .sermoneta-gallery-to-details { bottom: 18px; }
}

/* Canvas Ken Burns is normally in page flow; keep it in the first viewport
   instead of letting its canvas height push the description down twice. */
body.sermoneta-portfolio-gallery-first.sermoneta-layout-kenburns #kenburns,
body.sermoneta-portfolio-gallery-first.sermoneta-layout-kenburns #kenburns_overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1;
}
body.sermoneta-portfolio-gallery-first.sermoneta-layout-kenburns #kenburns_overlay {
    pointer-events: none;
}
body.sermoneta-portfolio-gallery-first:is(.sermoneta-layout-fullscreen_cover, .sermoneta-layout-fullscreen, .sermoneta-layout-kenburns, .sermoneta-layout-flow) #wrapper {
    padding-top: 0 !important;
}


/* Sequential gallery controls: PhotoMe Fullscreen, Ken Burns, Flow, Horizontal.
   The overlay does not intercept the gallery itself; only its buttons click. */
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player {
    position: fixed;
    inset: 0;
    z-index: 9950;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player.is-ready:not(.is-hidden) {
    opacity: 1;
    visibility: visible;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%;
    color: #fff !important;
    background: rgba(0,0,0,.32);
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    pointer-events: auto;
    line-height: 1;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background .2s ease, border-color .2s ease;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player-button:hover {
    background: rgba(0,0,0,.65);
    border-color: #fff;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}
body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player-button i { 
    font-size: 23px;
    line-height: 1;
    color: #fff;
    pointer-events: none;
}
body.sermoneta-portfolio-gallery-first .sq-player-prev {
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
}
body.sermoneta-portfolio-gallery-first .sq-player-next {
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
}
body.sermoneta-portfolio-gallery-first .sq-player-toggle {
    left: 26px;
    bottom: 28px;
}
body.sermoneta-portfolio-gallery-first .sq-player-toggle i {
    font-size: 16px;
}
/* Retain the independent down arrow at bottom centre on fullscreen galleries. */
@media (max-width: 767px) {
    body.sermoneta-portfolio-gallery-first .sermoneta-portfolio-player-button {
        width: 40px;
        height: 40px;
    }
    body.sermoneta-portfolio-gallery-first .sq-player-prev { left: 12px; }
    body.sermoneta-portfolio-gallery-first .sq-player-next { right: 12px; }
    body.sermoneta-portfolio-gallery-first .sq-player-toggle { left: 14px; bottom: 18px; }
}
