/**
 * Theme Name: Scouts
 * Template:   twentytwentyfive
 * Theme URI:  https://12thchichester.org.uk
 * Description: A custom theme for 12th chichester scouts.
 * Version: 0.2
 * Author: George Barrett
 * Author URI: https://gcbarrett.com
 */

.cover-box-with-buttons>.wp-block-cover__background {
    width: 0px;
    height: 0px;
}

.cover-box-with-buttons>.wp-block-cover__inner-container {
    background-color: #000000ab;
    padding: 1em;
}

.center-img>img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-columns:has(div.cols-center) {
    min-height: 215px;
}

div:has(div.col-center) {
    height: 100%;
}

@media (min-width: 1201px) {
    div.cover-box-with-buttons>div.wp-block-cover__image-background {
        background-position: 50% 0% !important;
        /* background-color: #000000ab; */
        /* background-color: #1d2327; */
        background-repeat: no-repeat;
        background-size: auto !important;
    }

    div.cover-box-with-buttons>div.wp-block-cover__image-background::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image: inherit;
        background-size: cover;
        filter: blur(10px);
    }
}

.cols-center {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    margin-bottom: auto;
    height: 100%;
}

@media (max-width: 600px) {
    .wp-block-columns {
        display: flex;
        flex-direction: column;
    }

    .wp-block-column.mobile-first {
        order: -1;
    }
}

.is-style-scarf-hr {
    border: none;
    height: 4rem;
    background: url('imgs/scarf.gif') center center no-repeat;
    background-size: contain;
}

/* Floating Sidebar Layout */
.has-sidebar-layout {
    position: relative;
}



.floating-sidebar {
    background-color: #f7f7f7;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
    margin: 2rem auto 0;
    /* max-width: 1200px; */
}

.floating-sidebar>* {
    margin-bottom: 0.8rem;
}

.floating-sidebar>*:last-child {
    margin-bottom: 0;
}

.floating-sidebar h3,
.floating-sidebar h4 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e0e0e0;
}

.floating-sidebar .wp-block-table-of-contents ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.floating-sidebar .wp-block-table-of-contents li {
    margin: 0.3rem 0;
}

.floating-sidebar .wp-block-latest-posts {
    padding-left: 0;
}

.floating-sidebar .wp-block-latest-posts li {
    margin-bottom: 0.75rem;
}

/* Mobile: sidebar stacked above content */
@media (max-width: 600px) {
    .floating-sidebar {
        position: relative;
        margin-left: var(--wp--style--root--padding-left);
        margin-right: var(--wp--style--root--padding-right);
        padding-right: var(--wp--style--root--padding-right);
        padding-left: var(--wp--style--root--padding-left);
        margin: 0 0 2rem 0;
        order: -1;
    }
}

/* @media (min-width: 601px) and (max-width: 1178px) {
    main:has(.floating-sidebar) {
        border: red solid 1px;
    }
} */
@media (max-width: 1178px) {
    .floating-sidebar {
        margin-bottom: 1rem;
    }
}

/* Desktop: floating sidebar on the right */
@media (min-width: 1179px) {
    .floating-sidebar {
        top: 500px;
        position: absolute;
        /* position: fixed;
        top: 100px; */
        right: 20px;
        width: 250px;
        max-width: 280px;
        margin: 0;
        z-index: 100;
    }

    /* Ensure main content has enough right margin to not overlap with sidebar */
    .has-sidebar-layout .wp-block-post-content>* {
        margin-right: 300px;
    }

    /* But allow certain blocks to be full width */
    .has-sidebar-layout .wp-block-post-content>.wp-block-cover,
    .has-sidebar-layout .wp-block-post-content>.wp-block-group.alignfull,
    .has-sidebar-layout .wp-block-post-content>.wp-block-image.alignfull,
    .has-sidebar-layout .wp-block-post-content>.alignfull {
        margin-right: 0;
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (min-width: 1200px) {
    .floating-sidebar {
        right: calc((100vw - 1200px) / 2 - 40px);
        width: 300px;
    }

    .has-sidebar-layout .wp-block-post-content>* {
        margin-right: 270px;
    }
}