/* =========================================================
   CBBC SITE-WIDE FLOATING CHURCH EVENTS BOOKMARK
   Added to visitor pages only; no header/footer navigation edits.
========================================================= */

.cbbc-events-float {
    position: fixed;
    z-index: 950;
    right: 22px;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 258px;
    min-height: 112px;
    padding: 12px 17px 12px 12px;
    overflow: visible;
    border: 1px solid rgba(230, 211, 164, .62);
    border-radius: 15px;
    color: #fff;
    text-decoration: none;
    background:
        radial-gradient(circle at 15% 0%, rgba(100, 166, 193, .22), transparent 48%),
        linear-gradient(138deg, #143a53 0%, #174b67 60%, #1a5a65 100%);
    box-shadow: 0 12px 32px rgba(11, 42, 59, .28), 0 2px 7px rgba(11, 42, 59, .16);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cbbc-events-float::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    pointer-events: none;
}

.cbbc-events-float:hover {
    transform: translateY(-5px) rotate(-.5deg);
    border-color: #f0dca9;
    box-shadow: 0 18px 38px rgba(11, 42, 59, .34), 0 0 0 4px rgba(230, 211, 164, .13);
}

.cbbc-events-float:focus-visible {
    outline: 3px solid #d9c58e;
    outline-offset: 5px;
}

.cbbc-events-book {
    position: relative;
    z-index: 2;
    display: block;
    flex: 0 0 67px;
    width: 67px;
    height: 88px;
    perspective: 650px;
    filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .28));
    animation: cbbcEventsBookFloat 3.7s ease-in-out infinite;
    transition: transform .35s ease;
}

.cbbc-events-float:hover .cbbc-events-book {
    transform: translateY(-3px) rotate(-3deg);
    animation-play-state: paused;
}

.cbbc-events-book-pages {
    position: absolute;
    top: 4px;
    right: 0;
    width: 58px;
    height: 80px;
    border-radius: 3px 6px 6px 3px;
    background: repeating-linear-gradient(0deg, #fff 0 3px, #e6ecef 3px 4px);
    box-shadow: 3px 3px 0 #d6dfe4, 6px 5px 0 #bdcbd3;
}

.cbbc-events-book-spine {
    position: absolute;
    z-index: 2;
    top: 3px;
    left: 1px;
    width: 11px;
    height: 81px;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(90deg, #0c2b42, #2a6682 72%, #17445e);
}

.cbbc-events-book-cover {
    position: absolute;
    z-index: 3;
    top: 1px;
    left: 7px;
    display: flex;
    width: 56px;
    height: 83px;
    flex-direction: column;
    align-items: center;
    padding: 9px 4px 6px 8px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 3px 6px 6px 3px;
    color: #f6e9c7;
    text-align: center;
    background: linear-gradient(90deg, rgba(0,0,0,.24), transparent 15%), linear-gradient(145deg, #28617e, #17435f 58%, #0b2e48);
    box-shadow: inset 0 0 0 2px rgba(230, 207, 154, .22), inset 0 0 0 5px rgba(230, 207, 154, .06);
    transform-origin: left center;
    transform: rotateY(-5deg);
    transition: transform .45s cubic-bezier(.2,.75,.25,1);
}

.cbbc-events-float:hover .cbbc-events-book-cover {
    transform: rotateY(-22deg) translateX(-2px);
}

.cbbc-events-book-mark {
    color: #f0dca9;
    font-family: Georgia, serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.cbbc-events-book-rule {
    width: 25px;
    height: 1px;
    margin: 5px 0 6px;
    background: #d6bd83;
}

.cbbc-events-book-cover strong {
    color: #fff8e7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 9px;
    line-height: 1.17;
    letter-spacing: .5px;
}

.cbbc-events-book-cover small {
    margin-top: 6px;
    color: #e6d4a6;
    font-size: 5px;
    font-weight: 800;
    letter-spacing: 1px;
}

.cbbc-events-book-ribbon {
    position: absolute;
    z-index: 4;
    top: -5px;
    right: 7px;
    width: 12px;
    height: 35px;
    background: linear-gradient(90deg, #b83e46, #ed817b 55%, #a52d36);
    box-shadow: 1px 2px 3px rgba(0, 0, 0, .25);
    transition: height .3s ease;
}

.cbbc-events-book-ribbon::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 7px solid #17435f;
}

.cbbc-events-float:hover .cbbc-events-book-ribbon {
    height: 43px;
}

.cbbc-events-copy {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
}

.cbbc-events-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    color: #e9d7a7;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.cbbc-events-kicker i {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8bd3a6;
    box-shadow: 0 0 0 3px rgba(139, 211, 166, .13);
}

.cbbc-events-kicker i::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(139, 211, 166, .78);
    border-radius: 50%;
    animation: cbbcEventsDotPulse 2.2s ease-out infinite;
}

.cbbc-events-title {
    display: block;
    color: #fff;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: .4px;
    animation: cbbcEventsTextPulse 2.8s ease-in-out infinite;
}

.cbbc-events-subtitle {
    display: block;
    margin-top: 4px;
    color: rgba(239, 247, 249, .77);
    font-size: 9px;
    line-height: 1.35;
}

.cbbc-events-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    color: #f0dca9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .35px;
}

.cbbc-events-action b {
    display: inline-block;
    font-size: 17px;
    line-height: .8;
    animation: cbbcEventsArrow 1.4s ease-in-out infinite;
}

.cbbc-events-edge-mark {
    position: absolute;
    top: -8px;
    right: 16px;
    z-index: 5;
    padding: 4px 8px 5px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 4px 4px 0 0;
    color: #fff6df;
    background: #ad3c43;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .18);
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 1.3px;
}

@keyframes cbbcEventsTextPulse {
    0%, 100% { letter-spacing: .4px; text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50% { letter-spacing: .85px; text-shadow: 0 0 9px rgba(255, 255, 255, .4); }
}

@keyframes cbbcEventsArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@keyframes cbbcEventsDotPulse {
    0% { transform: scale(.7); opacity: .85; }
    75%, 100% { transform: scale(1.8); opacity: 0; }
}

@keyframes cbbcEventsBookFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -4px; }
}

/* Book-opening navigation transition. */
.cbbc-events-transition {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #fff 0%, #f5fafc 58%, #e5f0f5 100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

.cbbc-events-transition.is-opening {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cbbc-events-transition-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    perspective: 1500px;
}

.cbbc-events-transition-book {
    position: relative;
    width: min(250px, 64vw);
    height: min(330px, 74vw);
    min-height: 245px;
    transform-style: preserve-3d;
    filter: drop-shadow(0 20px 22px rgba(19, 53, 73, .2));
    transform: translateY(15px) scale(.95);
    transition: transform .42s ease;
}

.cbbc-events-transition.is-opening .cbbc-events-transition-book {
    transform: translateY(0) scale(1);
}

.cbbc-events-transition-pages {
    position: absolute;
    inset: 7px 0 7px 13px;
    border-radius: 4px 10px 10px 4px;
    background: repeating-linear-gradient(0deg, #fff 0 4px, #e9ecec 4px 5px);
    box-shadow: 5px 4px 0 #d8e0e3, 9px 7px 0 #c5d1d7;
}

.cbbc-events-transition-inside {
    position: absolute;
    inset: 7px 4px 7px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9cba8;
    border-radius: 3px 9px 9px 3px;
    color: #17384d;
    background: linear-gradient(90deg, #f5eedc, #fffdf6 14%, #fffdf6);
}

.cbbc-events-transition-inside > span,
.cbbc-events-transition-cover > span {
    color: #c3a66d;
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 4px;
}

.cbbc-events-transition-inside i,
.cbbc-events-transition-cover i {
    width: 65px;
    height: 1px;
    margin: 16px 0 19px;
    background: #bca36c;
}

.cbbc-events-transition-inside strong {
    color: #17384d;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(23px, 5vw, 30px);
}

.cbbc-events-transition-inside small {
    margin-top: 10px;
    color: #667985;
    font-size: 11px;
}

.cbbc-events-transition-cover {
    position: absolute;
    z-index: 2;
    inset: 0 0 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 4px 10px 10px 4px;
    color: #f7eac9;
    text-align: center;
    background: linear-gradient(90deg, rgba(0,0,0,.24), transparent 10%), linear-gradient(145deg, #285f7d, #17435f 56%, #0b2e48);
    box-shadow: inset 0 0 0 3px rgba(230, 207, 154, .2), inset 0 0 0 9px rgba(230, 207, 154, .055);
    transform-origin: left center;
    backface-visibility: hidden;
    transition: transform .82s cubic-bezier(.64,.02,.25,1);
}

.cbbc-events-transition.is-opening .cbbc-events-transition-cover {
    transform: rotateY(-158deg);
}

.cbbc-events-transition-cover > strong {
    color: #fff8e7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 7vw, 38px);
    line-height: 1.18;
    letter-spacing: 1.8px;
}

.cbbc-events-transition-cover > small {
    margin-top: 20px;
    color: #e6d4a6;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 3px;
}

.cbbc-events-transition-cover > b {
    position: absolute;
    top: -1px;
    right: 31px;
    width: 22px;
    height: 78px;
    background: linear-gradient(90deg, #c14b4e, #e17a75 55%, #a9343b);
}

.cbbc-events-transition-stage > p {
    color: #315e78;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 17px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease .2s, transform .35s ease .2s;
}

.cbbc-events-transition.is-opening .cbbc-events-transition-stage > p {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 650px) {
    .cbbc-events-float {
        right: 13px;
        bottom: 16px;
        width: 238px;
        min-height: 100px;
        gap: 11px;
        padding: 10px 13px 10px 10px;
    }

    .cbbc-events-book {
        flex-basis: 59px;
        width: 59px;
        height: 80px;
        transform: scale(.92);
        transform-origin: center;
    }

    .cbbc-events-title { font-size: 16px; }
    .cbbc-events-subtitle { font-size: 8px; }
}

@media (max-width: 390px) {
    .cbbc-events-float {
        right: 10px;
        bottom: 12px;
        width: 220px;
        min-height: 94px;
        gap: 8px;
    }

    .cbbc-events-kicker { font-size: 8px; }
    .cbbc-events-title { font-size: 15px; }
    .cbbc-events-action { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .cbbc-events-float,
    .cbbc-events-book,
    .cbbc-events-book-cover,
    .cbbc-events-book-ribbon,
    .cbbc-events-kicker i::after,
    .cbbc-events-title,
    .cbbc-events-action b,
    .cbbc-events-transition,
    .cbbc-events-transition-book,
    .cbbc-events-transition-cover,
    .cbbc-events-transition-stage > p {
        transition: none !important;
        animation: none !important;
    }
}
