/* ==========================================================================
   CONTENT BOXES — Two-column layout (photo left, info right)
   Inspired by the "About Rudi" design with Cedarville Cursive signature
   ========================================================================== */

:root {
    --cb-accent: #be8e59;        /* Gold accent */
    --cb-accent-soft: rgba(190, 142, 89, 0.5);
    --cb-text: #1f1f1f;
    --cb-muted: #6c6c6c;
    --cb-bg: #ffffff;
    --cb-eyebrow-color: var(--cb-accent);
    --cb-radius: 18px;
    --cb-gap: clamp(36px, 5vw, 72px);
    --cb-photo-radius: 220px;     /* Soft circle shape for the photo */
}

.cb-wrap {
    container-type: inline-size;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: linear-gradient(180deg, #efefef 0%, #e1e1e1 100%);
    padding: 0;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

/* Subtle dotted texture — top-left and bottom-right of the section, not overlapping photo */
.cb-wrap::before,
.cb-wrap::after {
    content: "";
    position: absolute;
    background-image: radial-gradient(circle, var(--cb-accent) 1.4px, transparent 1.6px);
    background-size: 16px 16px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.cb-wrap::before {
    top: 64px;
    left: calc(4% + 100px);
    width: 200px;
    height: 120px;
}

.cb-wrap::after {
    bottom: 64px;
    right: 4%;
    width: 200px;
    height: 120px;
}

.cb-inner {
    width: min(1240px, calc(100% - 8%));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Single content box — two-column grid */
.cb {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: var(--cb-gap);
    align-items: stretch;
}

/* ── Photo side ── */
.cb-photo {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    height: 100%;
    overflow: hidden;
    align-self: stretch;
}

.cb-photo__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center bottom;
    border-radius: 6px;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.cb-photo.is-visible .cb-photo__img {
    opacity: 1;
    transform: scale(1);
}

/* ── Info side ── */
.cb-info {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-top: clamp(48px, 5vw, 72px);
    padding-bottom: clamp(48px, 5vw, 72px);
}

.cb-eyebrow {
    color: var(--cb-eyebrow-color);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    position: relative;
    padding-left: 56px;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}

.cb.is-visible .cb-eyebrow {
    opacity: 1;
    transform: translateX(0);
}

.cb-eyebrow::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 1px;
    background: var(--cb-accent);
}

.cb-title {
    margin: 0;
    color: var(--cb-text);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.015em;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.cb.is-visible .cb-title {
    opacity: 1;
    transform: translateY(0);
}

.cb-title__hl {
    color: var(--cb-accent);
    font-weight: 600;
}

.cb-content {
    color: var(--cb-muted);
    font-family: "Lato", sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    max-width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease 0.35s, transform 0.8s ease 0.35s;
}

.cb.is-visible .cb-content {
    opacity: 1;
    transform: translateY(0);
}

.cb-content p {
    margin: 0 0 0.85em;
}

.cb-content p:last-child {
    margin-bottom: 0;
}

.cb-signature {
    font-family: "Cedarville Cursive", "Brush Script MT", cursive;
    color: var(--cb-accent);
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    margin: 8px 0 4px;
    line-height: 1;
    opacity: 0;
    transform: translateY(10px) rotate(-1.5deg);
    transform-origin: left center;
    transition: opacity 0.8s ease 0.5s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}

.cb.is-visible .cb-signature {
    opacity: 1;
    transform: translateY(0) rotate(-1.5deg);
}

/* ── CTA button ── */
.cb-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    padding: 14px 32px;
    border: 2px solid var(--cb-accent-soft);
    border-radius: 999px;
    color: var(--cb-accent);
    background: #ffffff;
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.7s ease 0.85s,
        transform 0.7s ease 0.85s,
        background-color 0.4s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

.cb.is-visible .cb-cta {
    opacity: 1;
    transform: translateY(0);
}

.cb-cta:hover {
    background-color: var(--cb-accent);
    border-color: var(--cb-accent);
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 10px 24px -10px rgba(190, 142, 89, 0.55);
}

.cb-cta__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.cb-cta:hover .cb-cta__icon {
    transform: translateX(4px);
}

/* ── Responsive ── */
@media screen and (max-width: 767px) {
    .cb {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 36px;
    }

    .cb-photo {
        max-width: 340px;
        height: 100%;
        order: 2;
        align-self: stretch;
    }

    .cb-info {
        order: 1;
        align-items: center;
        text-align: center;
    }

    .cb-eyebrow {
        padding-left: 0;
        text-align: center;
    }

    .cb-eyebrow::before {
        display: none;
    }

    .cb-title {
        text-align: center;
    }

    .cb-content {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .cb-signature {
        text-align: center;
        transform-origin: center center;
    }

    .cb.is-visible .cb-signature {
        transform: translateY(0) rotate(-1.5deg);
    }

    .cb-wrap {
        padding: 0;
    }

    .cb-inner {
        width: min(1240px, calc(100% - 32px));
    }

    .cb-cta {
        padding: 12px 26px;
        align-self: center;
    }
}

@media screen and (max-width: 560px) {
    .cb-wrap {
        padding: 32px 0;
    }

    .cb-inner {
        width: calc(100% - 24px);
    }

    .cb {
        gap: 28px;
    }

    .cb-photo {
        max-width: 280px;
        height: 100%;
        align-self: stretch;
    }

    .cb-eyebrow {
        font-size: 0.72rem;
    }

    .cb-content {
        font-size: 0.95rem;
    }

    .cb-cta {
        align-self: center;
    }
}

/* A fixed 40% photo column contains the entire centred portrait. */
@media screen and (min-width: 768px) {
    html body .cb-wrap > .cb-inner > .cb {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
        gap: 0;
        align-items: stretch;
        --cb-viewport-gutter: calc((100cqw - min(1240px, 92cqw)) / 2);
    }

    html body .cb-wrap > .cb-inner > .cb > .cb-photo {
        position: relative !important;
        inset: auto !important;
        width: calc(100% + var(--cb-viewport-gutter)) !important;
        max-width: none !important;
        height: 100% !important;
        min-width: 0;
        margin: 0 0 0 calc(-1 * var(--cb-viewport-gutter)) !important;
        overflow: visible !important;
        transform: none !important;
    }

    html body .cb-wrap > .cb-inner > .cb > .cb-photo > .cb-photo__img {
        display: block !important;
        position: absolute;
        top: 0;
        right: auto;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        object-fit: contain !important;
        object-position: left center !important;
        transform: none !important;
        opacity: 1 !important;
    }

    html body .cb-wrap > .cb-inner > .cb > .cb-info {
        min-width: 0;
        box-sizing: border-box;
        margin-left: 0 !important;
        padding-left: clamp(20px, 2.5vw, 36px);
        position: relative;
        text-shadow: 0 1px 1px #fff;
    }

    .cb-wrap::before {
        left: calc(40% - 200px);
    }
}

@media screen and (min-width: 768px) and (max-width: 1080px) {
    .cb-info {
        gap: 8px;
        padding-top: clamp(48px, 5vw, 72px);
        padding-bottom: clamp(48px, 5vw, 72px);
    }

    .cb-title {
        font-size: clamp(1.5rem, 2.8vw, 1.9rem);
    }

    .cb-content {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}
@media screen and (min-width: 768px) and (max-width: 1080px) {
    .cb-eyebrow {
        font-size: 0.65rem;
        letter-spacing: 0.2em;
        padding-left: 30px;
    }
    .cb-eyebrow::before {
        width: 20px;
    }
    .cb-signature {
        margin: 0;
        font-size: 1.8rem;
    }
}
/* A gently drifting brand image sits behind the portrait only. */
@media screen and (min-width: 768px) {
    html body .cb-wrap > .cb-inner > .cb > .cb-photo {
        isolation: isolate;
        overflow: hidden !important;
    }

    .cb-photo::before {
        content: "";
        position: absolute;
        top: 72px;
        right: 0;
        left: auto;
        width: 112%;
        height: calc(100% - 72px);
        background: url("../admin/uploads/site_settings/content_boxes_bg.webp") right top / 100% auto no-repeat;
        opacity: 1;
        transform-origin: right top;
        animation: cb-brand-drift 18s ease-in-out infinite alternate;
        pointer-events: none;
        z-index: -1;
    }
}

@keyframes cb-brand-drift {
    0% { transform: translate(-2%, 0) scale(0.96); }
    50% { transform: translate(0, 2%) scale(1); }
    100% { transform: translate(-1%, 1%) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
    .cb-photo::before {
        animation: none;
        transform: none;
    }
}