/* Block extension, https://github.com/bauermartincom/yellow-block */

/* Block container */

.block {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin: 1.5rem 0;
    padding: 2.5rem 1.5rem;
    background-color: var(--block-color, transparent);
    background-image: var(--block-image, none);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}
.block > * {
    min-width: 0;
}
.block img,
.block video,
.block iframe {
    max-width: 100%;
}

/* Block content */

.block-content {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}
.block-content > :first-child {
    margin-top: 0;
}
.block-content > :last-child {
    margin-bottom: 0;
}

/* Vertical position of the content */

.block-align-top { justify-content: flex-start; }
.block-align-middle { justify-content: center; }
.block-align-bottom { justify-content: flex-end; }

/* Height of the block */

.block-height-auto { min-height: 0; }
.block-height-small { min-height: 12rem; }
.block-height-medium { min-height: 20rem; }
.block-height-large { min-height: 30rem; }
.block-height-screen { min-height: 100vh; }

@supports (min-height: 100svh) {
    .block-height-screen { min-height: 100svh; }
}

/* Overlay, improves legibility on background images */

.block-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    background: var(--block-overlay, rgba(0, 0, 0, 0.45));
    pointer-events: none;
}
.block-rounded.block-overlay::before {
    border-radius: inherit;
}

/* Text colour */

.block-text-light,
.block-text-light h1,
.block-text-light h2,
.block-text-light h3,
.block-text-light h4,
.block-text-light h5,
.block-text-light h6,
.block-text-light p,
.block-text-light li,
.block-text-light dt,
.block-text-light dd,
.block-text-light blockquote,
.block-text-light strong,
.block-text-light em,
.block-text-light a {
    color: #fff;
}
.block-text-dark,
.block-text-dark h1,
.block-text-dark h2,
.block-text-dark h3,
.block-text-dark h4,
.block-text-dark h5,
.block-text-dark h6,
.block-text-dark p,
.block-text-dark li,
.block-text-dark dt,
.block-text-dark dd,
.block-text-dark blockquote,
.block-text-dark strong,
.block-text-dark em,
.block-text-dark a {
    color: #111;
}

/* Optional styles */

.block-wide {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* 50vw includes the scrollbar, so a wide block would make the page a few pixels
   too wide. Both rules are needed: the one on html stops the body overflow from
   propagating to the viewport, the one on body does the actual clipping. Scoped
   with :has() so only pages with a wide block are affected, and "clip" instead
   of "hidden" so a sticky header keeps working. */
html:has(.block-wide) {
    overflow-x: clip;
}
html:has(.block-wide) body {
    overflow-x: clip;
}

/* 50vw includes the scrollbar, which would push the page a few pixels wide.
   Scoped with :has() so only pages that really use a wide block are affected. */
html:has(.block-wide) {
    overflow-x: clip;
}
.block-wide > .block-content {
    max-width: var(--block-width, 60rem);
    margin-left: auto;
    margin-right: auto;
}
.block-center {
    text-align: center;
}
.block-flush {
    padding: 0;
}
.block-rounded {
    border-radius: 6px;
    overflow: hidden;
}
.block-fixed {
    background-attachment: fixed;
}

/* Small screens */

@media screen and (max-width: 48em) {
    .block {
        padding: 2rem 1.25rem;
    }
    .block-height-medium { min-height: 16rem; }
    .block-height-large { min-height: 20rem; }
}
@media (hover: none) {
    .block-fixed { background-attachment: scroll; }
}
