/* Condobox — classes/widgets/Condobox/condobox.php
   vw on the 1440 canvas like hero.css; px from 1024 down.

   Copy on one side, a grid of ruled items on the other. Each item is a title
   and a paragraph behind a vertical rule — no panel, no card.

   The Columns controls write --cdb-cols-set / -tab / -mob, never --cdb-cols:
   Elementor's selector carries two classes and would `outrank the breakpoints. */

.cdb {
    --cdb-bg: #e5d9be;
    --cdb-ink: #1c3244;
    --cdb-body: #5a6880;
    --cdb-rule: #c9a961;
    --cdb-stripe: rgba(255, 255, 255, .22);
    --cdb-stripe-gap: 18px;
    --cdb-btn-bg: #e8b64a;
    --cdb-btn-ink: #1c3244;

    --cdb-split: 46%;
    --cdb-cols: var(--cdb-cols-set, 2);

    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 5.56vw 120px;
    overflow: hidden;
    /* longhand on purpose: the Background Image control writes background-image
       here, and a shorthand would keep resetting it */
    background-color: var(--cdb-bg);
    color: var(--cdb-ink);
}

.cdb *,
.cdb *::before,
.cdb *::after {
    box-sizing: border-box;
}

/* the faint vertical weave, drawn over the background image rather than in it
   so an uploaded photo and the stripes can be used together */

.cdb__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--cdb-split) 1fr;
    align-items: center;
    column-gap: 4vw;
    column-gap: 4vw;
    row-gap: 3vw;
}

/* Visual order only — the DOM keeps the copy first, so the stacked layout and
   screen readers both still lead with it. */
.cdb--copy-right .cdb__content {
    order: 2;
}

.cdb--align-top .cdb__inner {
    align-items: start;
}

.cdb--align-bottom .cdb__inner {
    align-items: end;
}

/* ---------- Copy ---------- */
.cdb__eyebrow {
    display: flex;
    align-items: center;
    gap: .8vw;
    margin: 0 0 1.2vw;
}

.cdb__eyebrow-dash {
    flex: 0 0 auto;
    width: 1.75vw;
    height: max(2px, .14vw);
    background: var(--cdb-ink);
}

.cdb__eyebrow-text {
    font-size: max(12px, .94vw);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cdb-ink);
}

.cdb__title {
    margin: 0 0 1.8vw;
    font-size: max(30px, 3.6vw);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.01em;
    color: var(--cdb-ink);
}

.cdb__lead {
    margin: 0;
    font-size: max(14px, 1.2vw);
    line-height: 1.65;
    color: var(--cdb-body);
}

.cdb__lead p {
    margin: 0 0 1em;
}

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

/* ---------- Items ---------- */
.cdb__grid {
    display: grid;
    grid-template-columns: repeat(var(--cdb-cols), minmax(0, 1fr));
    gap: 2vw 2.2vw;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* logical properties so the rule follows the writing direction rather than
   always sitting on the physical left */
.cdb__item {
    border-inline-start: max(2px, .17vw) solid var(--cdb-rule);
    padding-inline-start: 1.1vw;
}

.cdb__item-title {
    margin: 0 0 .6vw;
    font-size: max(15px, 1.5vw);
    font-weight: 700;
    line-height: 1.25;
    color: var(--cdb-ink);
}

.cdb__item-text {
    margin: 0;
    font-size: max(12px, 1.05vw);
    line-height: 1.6;
    color: var(--cdb-body);
}

/* ---------- Button ---------- */
.cdb__actions {
    display: flex;
    margin-top: 2.2vw;
}

.cdb__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.15vw 2.4vw;
    border: 0;
    border-radius: .45vw;
    background: var(--cdb-btn-bg);
    font-size: max(15px, 1.35vw);
    font-weight: 600;
    line-height: 1;
    color: var(--cdb-btn-ink);
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.cdb__btn:hover,
.cdb__btn:focus {
    background: var(--cdb-ink);
    color: #fff;
    transform: translateY(-2px);
}

/* Entrance — held at frame one by assets/css/reveal.css */
@media (prefers-reduced-motion: no-preference) {

    .cdb--animated .cdb__eyebrow,
    .cdb--animated .cdb__title,
    .cdb--animated .cdb__lead,
    .cdb--animated .cdb__actions,
    .cdb--animated .cdb__item {
        animation: cdb-up .7s cubic-bezier(.22, 1, .36, 1) both;
    }

    .cdb--animated .cdb__eyebrow { animation-delay: .08s; }
    .cdb--animated .cdb__title { animation-delay: .16s; }
    .cdb--animated .cdb__lead { animation-delay: .24s; }
    .cdb--animated .cdb__actions { animation-delay: .32s; }
    .cdb--animated .cdb__item:nth-child(1) { animation-delay: .30s; }
    .cdb--animated .cdb__item:nth-child(2) { animation-delay: .38s; }
    .cdb--animated .cdb__item:nth-child(3) { animation-delay: .46s; }
    .cdb--animated .cdb__item:nth-child(4) { animation-delay: .54s; }
    .cdb--animated .cdb__item:nth-child(n+5) { animation-delay: .62s; }
}

@keyframes cdb-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 1024px) {

    .cdb {
        --cdb-cols: var(--cdb-cols-tab, 2);
        padding: 56px 32px;
    }

    .cdb__inner {
        grid-template-columns: 1fr;
        row-gap: 36px;
    }

    /* the copy leads once stacked, whichever side it takes on desktop */
    .cdb--copy-right .cdb__content {
        order: 0;
    }

    .cdb__eyebrow {
        gap: 10px;
        margin-bottom: 12px;
    }

    .cdb__eyebrow-dash {
        width: 24px;
    }

    .cdb__eyebrow-text {
        font-size: 13px;
    }

    .cdb__title {
        margin-bottom: 18px;
        font-size: 38px;
    }

    .cdb__lead {
        max-width: 60ch;
        font-size: 17px;
    }

    .cdb__grid {
        gap: 24px 26px;
    }

    .cdb__item {
        padding-inline-start: 14px;
    }

    .cdb__item-title {
        margin-bottom: 6px;
        font-size: 19px;
    }

    .cdb__item-text {
        font-size: 15px;
    }

    .cdb__actions {
        margin-top: 26px;
    }

    .cdb__btn {
        padding: 16px 28px;
        border-radius: 8px;
        font-size: 17px;
    }
}

@media (max-width: 600px) {

    .cdb {
        --cdb-cols: var(--cdb-cols-mob, 1);
        padding: 40px 20px;
    }

    .cdb__title {
        font-size: 30px;
    }

    .cdb__lead {
        font-size: 16px;
    }

    .cdb__grid {
        gap: 22px;
    }

    .cdb__item-title {
        font-size: 18px;
    }

    .cdb__actions {
        display: block;
    }

    .cdb__btn {
        width: 100%;
        padding: 15px 22px;
        font-size: 16px;
    }
}
