/* Shared front-end rules for native BBS blocks.
   Ported from the LIVE theme (bbs3.css).

   Blocks are self-contained and balanced; widening is done here rather than by
   closing and re-opening page.php's wrappers. .columns becomes an inline-size
   query container, so .bbs-block--wide can take the column's full width from
   inside .main-content-column without referencing the viewport - which keeps
   it scrollbar-safe and free of horizontal overflow. */

.columns:has(> .main-content-column) {
    container-type: inline-size;
}

/* A display:table column stretches past its own width to fit an oversized
   child, so a wide block dragged the column out (and the table off the side of
   the page). LIVE's bbs3.css switches .main-content-column to flow-root for the
   same reason; this does it here for any page that holds a wide block, until
   DEV's bbs3.css catches up. */
.main-content-column:has(.bbs-block--wide) {
    display: flow-root;
}

.bbs-block {
    margin: 0;
}

.bbs-block--wide {
    width: 100cqi;
    margin-left: 50%;
    transform: translateX(-50%);
}

.bbs-block--centre {
    text-align: center;
}

/* ---- video (ported from LIVE bbs3.css) ---- */

.video-container {
    margin: 0 auto;
    width: 100%;
    max-width: 994px;
}

h2.section-title {
    padding: 0 30px;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.row.padded h2.section-title {
    padding: 0 5px;
}

h2.section-title.text-centre {
    padding: 0 25px;
}

@media (min-width: 1024px) {
    h2.section-title,
    .row.padded h2.section-title {
        padding: 0 20px;
    }
}

lite-youtube {
    background-color: #000;
    position: relative;
    display: block;
    contain: content;
    background-position: center center;
    background-size: cover;
    cursor: pointer;
}

/* gradient */
lite-youtube::before {
    content: attr(data-title);
    display: block;
    position: absolute;
    top: 0;
    background-image: linear-gradient(180deg, rgb(0 0 0 / 67%) 0%, rgb(0 0 0 / 54%) 14%, rgb(0 0 0 / 15%) 54%, rgb(0 0 0 / 5%) 72%, rgb(0 0 0 / 0%) 94%);
    height: 99px;
    width: 100%;
    font-family: "YouTube Noto",Roboto,Arial,Helvetica,sans-serif;
    color: hsl(0deg 0% 93.33%);
    text-shadow: 0 0 2px rgba(0,0,0,.5);
    font-size: 18px;
    padding: 25px 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

lite-youtube:hover::before {
    color: white;
}

lite-youtube::after {
    content: "";
    display: block;
    padding-bottom: calc(100% / (16 / 9));
}

lite-youtube > iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
}

lite-youtube > .lyt-playbtn {
    display: block;
    width: 100%;
    height: 100%;
    background: no-repeat center/68px 48px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
    position: absolute;
    cursor: pointer;
    z-index: 1;
    filter: grayscale(100%);
    transition: filter .1s cubic-bezier(0, 0, 0.2, 1);
    border: 0;
}

lite-youtube:hover > .lyt-playbtn,
lite-youtube .lyt-playbtn:focus {
    filter: none;
}

lite-youtube.lyt-activated {
    cursor: unset;
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated > .lyt-playbtn {
    opacity: 0;
    pointer-events: none;
}

.lyt-visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* /youtube */

/* vimeo */

lite-vimeo {
    aspect-ratio: 16 / 9;
    background-color: #000;
    position: relative;
    display: block;
    contain: content;
    background-position: center center;
    background-size: cover;
    cursor: pointer;
}

lite-vimeo > iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
}

lite-vimeo > .ltv-playbtn {
    font-size: 10px;
    padding: 0;
    width: 6.5em;
    height: 4em;
    background: rgba(23, 35, 34, .75);
    z-index: 1;
    opacity: .8;
    border-radius: .5em;
    transition: opacity .2s ease-out, background .2s ease-out;
    outline: 0;
    border: 0;
    cursor: pointer;
}

lite-vimeo:hover > .ltv-playbtn {
    background-color: rgb(0, 173, 239);
    opacity: 1;
}

lite-vimeo > .ltv-playbtn::before {
    content: '';
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #fff;
}

lite-vimeo > .ltv-playbtn,
lite-vimeo > .ltv-playbtn::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
}

lite-vimeo.ltv-activated {
    cursor: unset;
}

lite-vimeo.ltv-activated::before,
lite-vimeo.ltv-activated > .ltv-playbtn {
    opacity: 0;
    pointer-events: none;
}

/* /vimeo */

