/* --------------------------------------------------
Article components (blog posts)

Used on single posts and inside the block editor.
Each component works from either a plain class (ud-callout)
or a block style (is-style-ud-ladder), so it can be added
by a block pattern, a block style or hand-written HTML.

Colours follow the Elementor kit palette.

The Elementor "Posts" template sets colour and margins on
every p and heading in the post content with a very specific
selector, so text colours and margins inside components use
!important to win.
-------------------------------------------------- */

:root {
    --ud-black: #191716;
    --ud-white: #fcfcfc;
    --ud-light: #f4f4f4;
    --ud-grey: #dbdbdb;
    --ud-mid: #6b6a69;
    --ud-pink: #e897b6;
    --ud-pink-tint: #fbeef3;
    --ud-jam: #7a1239;
    --ud-aqua: #8ad6d6;
    --ud-aqua-tint: #e9f6f6;
    --ud-teal: #2f6f72;
    --ud-butter: #ffdc7e;
    --ud-radius: 8px;
}

/* Lede: the opening paragraph */
p.ud-lede,
p.is-style-ud-lede {
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Eyebrow: small uppercase label above a heading */
p.ud-eyebrow,
.ud-eyebrow {
    display: block;
    margin: 0 0 0.5rem !important;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ud-teal) !important;
}

/* Callout: one big statement on a dark panel */
.ud-callout {
    margin: 3rem 0 1.5rem !important;
    padding: 40px;
    border-radius: var(--ud-radius);
    background: var(--ud-black);
    color: var(--ud-white);
}

.ud-callout p {
    margin: 0 !important;
    color: var(--ud-white) !important;
}

.ud-callout p + p {
    margin-top: 1rem !important;
}

.ud-callout p.ud-eyebrow {
    margin-bottom: 1rem !important;
    color: var(--ud-pink) !important;
}

.ud-callout p.ud-callout-statement {
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
    line-height: 1.2;
    font-weight: 700;
}

.ud-callout p.ud-eyebrow + p {
    margin-top: 0 !important;
}

/* Chips: a list shown as rounded tags */
ul.ud-chips,
ol.ud-chips,
.is-style-ud-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 2.5rem !important;
    padding: 0 !important;
    list-style: none;
}

.ud-chips li,
.is-style-ud-chips li {
    margin: 0 !important;
    padding: 6px 16px;
    border: 1px solid var(--ud-black);
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: capitalize;
}

/* Ladder: numbered steps that deepen in colour */
ul.ud-ladder,
ol.ud-ladder,
.is-style-ud-ladder {
    counter-reset: ud-step;
    display: grid;
    gap: 8px;
    margin: 1.5rem 0 3rem !important;
    padding: 0 !important;
    list-style: none;
}

.ud-ladder li,
.is-style-ud-ladder li {
    counter-increment: ud-step;
    position: relative;
    margin: 0 !important;
    padding: 18px 120px 18px 80px;
    border-radius: var(--ud-radius);
    background: var(--ud-light);
    color: var(--ud-black);
    font-weight: 600;
    line-height: 1.3;
}

.ud-ladder li::before,
.is-style-ud-ladder li::before {
    content: counter(ud-step, decimal-leading-zero);
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.ud-ladder li:nth-child(2),
.is-style-ud-ladder li:nth-child(2) {
    background: var(--ud-grey);
}

.ud-ladder li:nth-child(3),
.is-style-ud-ladder li:nth-child(3) {
    background: var(--ud-aqua);
}

.ud-ladder li:nth-child(n+4),
.is-style-ud-ladder li:nth-child(n+4) {
    background: var(--ud-teal);
    color: var(--ud-white);
}

.ud-ladder-tag {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.75;
}

/* Layer: one numbered step of a worked example */
.ud-layer {
    margin: 2.5rem 0 !important;
    padding-top: 2rem;
    border-top: 1px solid var(--ud-grey);
}

.ud-layer-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 0.75rem !important;
}

.ud-layer-head > * {
    margin: 0 !important;
}

.ud-layer-num {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 !important;
    border-radius: 50%;
    background: var(--ud-black);
    color: var(--ud-white) !important;
    font-size: 1.1rem !important;
    font-weight: 700;
    line-height: 1 !important;
}

.ud-layer--3 .ud-layer-num {
    background: var(--ud-aqua);
    color: var(--ud-black) !important;
}

.ud-layer--4 .ud-layer-num {
    background: var(--ud-teal);
}

.ud-layer h3 {
    margin: 0 !important;
    font-size: 1.5rem;
    line-height: 1.2;
}

.ud-layer h3 .ud-eyebrow {
    margin-bottom: 0.25rem !important;
}

.ud-layer-head p.ud-eyebrow {
    margin-bottom: 0.25rem !important;
}

.ud-layer > p {
    margin: 0 0 1.25rem !important;
}

/* Compare: two examples side by side */
.ud-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 1.5rem 0 2.5rem !important;
}

.ud-layer .ud-compare {
    margin: 0 !important;
}

.ud-compare > .ud-compare-card {
    margin: 0 !important;
    padding: 20px 22px;
    border-radius: var(--ud-radius);
    border-top: 4px solid var(--ud-pink);
    background: var(--ud-pink-tint);
}

.ud-compare > .ud-compare-card + .ud-compare-card {
    border-top-color: var(--ud-aqua);
    background: var(--ud-aqua-tint);
}

.ud-compare-card p {
    margin: 0 !important;
    font-size: 1.05rem;
    line-height: 1.45;
    font-weight: 500;
}

.ud-compare-card p.ud-compare-label {
    display: block;
    margin-bottom: 0.4rem !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ud-mid) !important;
}

/* Lists inside compare cards (side-by-side comparison) */
.ud-compare-card ul,
.ud-compare-card ol {
    margin: 0 !important;
    padding-left: 1.1em !important;
}

.ud-compare-card li {
    margin: 0 0 0.5em !important;
    font-size: 1rem;
    line-height: 1.45;
}

.ud-compare-card li:last-child {
    margin-bottom: 0 !important;
}

.ud-compare-card h3 {
    margin: 0 0 0.75rem !important;
    font-size: 1.3rem;
    line-height: 1.2;
}

/* A short note after the list in a comparison card */
.ud-compare-card ul + p,
.ud-compare-card ol + p {
    margin-top: 1rem !important;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(25, 23, 22, 0.12);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--ud-mid) !important;
}

/* Hook: the takeaway box */
.ud-hook {
    margin: 3rem 0 2rem !important;
    padding: 40px;
    border-radius: var(--ud-radius);
    background: var(--ud-butter);
    color: var(--ud-black);
}

.ud-hook p.ud-hook-statement {
    margin: 0 0 1.5rem !important;
    font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
    line-height: 1.25;
    font-weight: 700;
}

.ud-hook > p.ud-hook-statement:last-child {
    margin-bottom: 0 !important;
}

.ud-hook-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 !important;
}

.ud-hook-split > * {
    margin: 0 !important;
    padding: 18px 20px;
    border-radius: var(--ud-radius);
    background: rgba(255, 255, 255, 0.55);
}

.ud-hook-split > *:last-child {
    background: var(--ud-black);
    color: var(--ud-white);
}

.ud-hook-split p {
    margin: 0 !important;
    color: inherit !important;
    line-height: 1.4;
}

.ud-hook-split p.ud-hook-label {
    margin-bottom: 0.25rem !important;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Mobile */
@media (max-width: 767px) {
    p.ud-lede,
    p.is-style-ud-lede {
        font-size: 1.15rem;
    }

    .ud-callout,
    .ud-hook {
        padding: 28px 24px;
    }

    .ud-ladder li,
    .is-style-ud-ladder li {
        padding: 14px 16px 14px 60px;
    }

    .ud-ladder li::before,
    .is-style-ud-ladder li::before {
        top: 14px;
        left: 16px;
        transform: none;
        font-size: 1.3rem;
    }

    .ud-ladder-tag {
        position: static;
        display: block;
        margin-top: 4px;
        transform: none;
    }

    .ud-layer h3 {
        font-size: 1.25rem;
    }

    .ud-compare,
    .ud-hook-split {
        grid-template-columns: 1fr;
    }
}
