/* Design 15: a frosted welcome card over the conference's Jeddah waterfront. */
body.is-home #statsSection.leadership-section {
    position: relative; isolation: isolate; overflow: hidden; color: #123e58;
    height: auto; min-height: calc(100svh - 76px - env(safe-area-inset-bottom));
    padding: clamp(18px, 3svh, 36px) 0 24px !important;
    background: #b6e0ef;
}
body.is-home #statsSection.leadership-section::after {
    content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
    background: url("../img/sections-bg-mobile.webp?v=jeddah-20261017") center bottom / cover no-repeat;
    border: 0; border-radius: 0; transform: none; box-shadow: none;
    filter: saturate(.95) brightness(1.04); animation: none; opacity: 1;
}
body.is-home #statsSection.leadership-section::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, rgba(231,247,255,.64), rgba(239,249,255,.24) 40%, rgba(231,247,255,.16) 75%, rgba(220,242,252,.2));
    animation: none;
}
body.is-home #statsSection.leadership-section > .container:not(.sec-next-wrap) { flex: 0 0 auto; min-height: auto; padding-top: 0; max-width: 660px; }
body.is-home .hero .hero-countdown {
    max-width: 360px; margin: 0 auto 16px; padding: 12px;
    border: 1px solid rgba(255,255,255,.95); border-radius: 22px;
    background: linear-gradient(145deg, rgba(255,255,255,.68), rgba(226,245,255,.38));
    -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
    box-shadow: 0 8px 24px -17px rgba(14,77,114,.5), inset 0 1px 0 #fff;
}
body.is-home .hero .hero-countdown .countdown-label { color: #164b67; font-size: clamp(1rem, 4vw, 1.2rem); font-weight: 800; line-height: 1.5; margin-bottom: 10px; }
body.is-home .hero .hero-countdown .countdown-grid { gap: 6px; }
body.is-home .hero .hero-countdown .cd-cell {
    padding: 7px 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,.9);
    background: rgba(247,253,255,.7); box-shadow: 0 4px 12px -10px #124665;
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
body.is-home .hero .hero-countdown .cd-num { font-size: clamp(1.25rem, 4.5vw, 1.7rem); color: #116180; }
body.is-home .hero .hero-countdown .cd-unit { font-size: .62rem; color: #31566d; margin-top: 2px; }
.leadership-heading { text-align: center; margin-bottom: 16px; }
.leadership-heading h2 { margin: 5px 0; color: #946719; text-shadow: 0 1px 1px rgba(255,255,255,.85); font-size: clamp(1.4rem, 5vw, 1.9rem); }
.leadership-heading p { color: #2d536c; font-size: .82rem; line-height: 1.6; }
.leadership-panels { max-width: 480px; margin-inline: auto; }
.leadership-panel {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
    padding: 22px 24px 24px; border: 1.5px solid rgba(255,255,255,.95); border-radius: 30px;
    background: linear-gradient(150deg, rgba(255,255,255,.85), rgba(229,246,255,.64) 65%, rgba(255,250,237,.83));
    -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
    box-shadow: 0 16px 34px -22px rgba(14,77,114,.65), inset 0 1px 0 #fff;
}
.leadership-panel::after {
    content: ""; position: absolute; inset: auto 18px 0; height: 2px;
    background: linear-gradient(90deg, transparent, #d2ad5d, #f7e6b9, #d2ad5d, transparent);
}
.leadership-panel[hidden] { display: none; }
.leadership-panel + .leadership-panel:not([hidden]) { margin-top: 16px; }
.leadership-enhanced .leadership-panel { margin-top: 0; }
.leadership-portrait {
    flex: 0 0 auto; width: 100px; height: 100px; min-height: 0; border-radius: 50%; overflow: hidden;
    border: 2px solid rgba(255,255,255,.95); outline: 1px solid rgba(184,139,48,.4);
    background: linear-gradient(145deg, #f8fcff, #d6eaf4);
    box-shadow: 0 5px 14px -9px #265d79;
}
.leadership-portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 20%; }
.leadership-initial { display: grid; place-items: center; width: 100%; height: 100%; color: #987123; font-size: 2.6rem; }
.leadership-card-copy { width: 100%; min-width: 0; text-align: center; padding-top: 13px; }
.leadership-eyebrow { color: #6f531c; font-size: .8rem; font-weight: 700; }
.leadership-card-copy h3 { color: #123e58; font-size: 1.17rem; line-height: 1.6; margin: 5px 0 2px; }
.leadership-position { color: #375e76; font-size: .8rem; line-height: 1.7; }
.leadership-excerpt {
    color: #244c66; font-size: .91rem; line-height: 1.85; margin: 12px 0 16px;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.leadership-read {
    display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 44px;
    padding: 10px 26px; color: #49330e; background: linear-gradient(120deg, #f7e0a7, #d6ac55);
    border: 1px solid rgba(255,255,255,.7); border-radius: 999px; font-weight: 700; font-size: .85rem;
    text-decoration: none; box-shadow: 0 6px 14px -10px #82601e;
}
.leadership-tabs {
    display: flex; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 6px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 6px;
    width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 6px; border-radius: 18px;
    background: rgba(248,253,255,.78); border: 1px solid rgba(255,255,255,.95);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 9px 20px -15px rgba(14,77,114,.55);
}
.leadership-tab {
    display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 auto;
    min-width: max-content; max-width: none; padding: 5px 10px 6px; min-height: 60px;
    border: 1px solid transparent; border-radius: 15px; background: transparent;
    font-size: .66rem; font-weight: 700; line-height: 1.5; text-align: center;
    color: #31566d; text-decoration: none; white-space: nowrap; overflow-wrap: normal;
}
.leadership-tab-photo { display: block; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #e1ebef; border: 1px solid #fff; }
.leadership-tab-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.leadership-tab-photo .leadership-initial { font-size: 1rem; color: #68818f; }
.leadership-tab[aria-selected="true"] { color: #075c7b; background: rgba(255,255,255,.7); border-color: rgba(196,151,63,.42); box-shadow: inset 0 -2px 0 #c69b49; }
.leadership-tab[aria-selected="true"] .leadership-tab-photo { outline: 1px solid #bc9038; }
.leadership-manage { display: block; text-align: center; padding: 14px; color: #174f6b; text-decoration: underline; font-size: .8rem; }
body.is-home #statsSection.leadership-section .sec-next-wrap { padding: 18px 0 4px; }
.leadership-enhanced .leadership-fallback { display: none; }
.leadership-full-message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; font-size: 1rem; }
.leadership-fallback { margin-top: 20px; }
.leadership-dialog { margin: auto; width: min(700px, calc(100vw - 28px)); max-width: none; max-height: min(86dvh, 900px);
    padding: 48px 26px 28px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d5b77c; border-radius: 24px;
    background: #f8fbfe; color: #183b55; box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.leadership-dialog::backdrop { background: rgba(1,14,27,.8); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.leadership-close { position: absolute; top: 10px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid #d5dfeb; background: #fff; color: #183b55; font-size: 28px; cursor: pointer; }
.leadership-dialog-person { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #dfcc9e; }
.leadership-dialog-photo { flex: 0 0 92px; width: 92px; height: 112px; border-radius: 16px; overflow: hidden; background: #e4eef5; }
.leadership-dialog-photo img { width: 100%; height: 100%; object-fit: cover; }
.leadership-dialog-photo .leadership-initial { font-size: 2rem; color: #967020; }
.leadership-dialog .leadership-eyebrow { color: #8c661b; }
.leadership-dialog h2 { font-size: 1.25rem; color: #183b55; margin: 5px 0; line-height: 1.6; }
.leadership-dialog .leadership-position { color: #536d82; }
.leadership-tab:focus-visible, .leadership-read:focus-visible, .leadership-close:focus-visible { outline: 3px solid #e9bc5c; outline-offset: 3px; }

@media (min-width: 821px) {
    body.is-home #statsSection.leadership-section::after { background-image: url("../img/sections-bg-desktop.webp?v=jeddah-20261017"); }
}
@media (max-width: 540px) {
    .leadership-panel { padding: 18px 20px 20px; border-radius: 26px; }
    .leadership-portrait { width: 88px; height: 88px; }
    .leadership-excerpt { font-size: .87rem; margin: 10px 0 14px; }
    .leadership-read { width: min(100%, 250px); }
    .leadership-dialog { padding: 52px 18px 24px; }
    .leadership-dialog-person { gap: 12px; }
    .leadership-dialog-photo { width: 72px; height: 90px; flex-basis: 72px; }
}

/* Leave room above the raised Home button, while keeping the message compact. */
@media (max-width: 820px) {
    body.is-home #statsSection.leadership-section {
        padding: 12px 0 calc(36px + env(safe-area-inset-bottom)) !important;
    }
    body.is-home .hero .hero-countdown { max-width: 310px; padding: 9px 12px; margin-bottom: 10px; }
    body.is-home .hero .hero-countdown .countdown-label { margin-bottom: 6px; font-size: 1rem; }
    body.is-home .hero .hero-countdown .cd-cell { padding: 5px 4px; }
    .leadership-heading { margin-bottom: 12px; }
    .leadership-heading h2 { margin: 3px 0; font-size: 1.4rem; }
    .leadership-heading p { font-size: .76rem; }
    .leadership-panel { padding: 14px 18px 16px; }
    .leadership-portrait { width: 68px; height: 68px; }
    .leadership-card-copy { padding-top: 9px; }
    .leadership-card-copy h3 { font-size: 1.08rem; margin: 3px 0 2px; }
    .leadership-position { font-size: .76rem; line-height: 1.6; }
    .leadership-excerpt { margin: 8px 0 10px; font-size: .82rem; line-height: 1.7; -webkit-line-clamp: 2; }
    .leadership-read { padding: 8px 18px; min-height: 44px; }
    .leadership-tab-photo { width: 28px; height: 28px; }
    .leadership-tab { font-size: .7rem; }
    .leadership-manage { padding: 8px; }
    body.is-home #statsSection.leadership-section .sec-next-wrap { padding: 10px 0 0; margin-top: 0; }
}

/* The opening poster owns the countdown; the next screen is leadership only. */
body.is-home .hero .hero-countdown {
    display: block; position: absolute; z-index: 4; bottom: 24px; inset-inline-end: 24px;
    width: min(340px, calc(100% - 40px)); max-width: none; margin: 0; text-align: center;
}
body.is-home .hero .hero-countdown .countdown-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 6px;
}
body.is-home .hero .hero-countdown .cd-cell { min-width: 0; }
body.is-home .hero .hero-countdown .countdown-label { letter-spacing: 0; }
body.is-home .hero .hero-countdown .cd-unit { letter-spacing: 0; font-size: .65rem; }
body.is-home .hero .hero-countdown [data-cd-live] { color: #164b67; }
@media (max-width: 820px) {
    body.is-home .hero-screen > .hero-countdown.countdown {
        display: block; inset-inline-end: auto; left: 50%; bottom: 80px;
        width: min(340px, 88vw); transform: translateX(-50%); margin: 0;
    }
    body.is-home .hero-screen .sec-next { bottom: 26px; }
    body.is-home #statsSection.leadership-section { justify-content: center; }
}

/* Do not let the legacy poster visibility rule or fadeUp transform hide the clock. */
body.is-home .hero #countdown.hero-countdown {
    display: block; visibility: visible; opacity: 1; animation: none;
    color: #164b67; border: 1px solid rgba(255,255,255,.95);
    background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(222,244,255,.52));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px -15px rgba(14,77,114,.5), inset 0 1px 0 #fff;
}
@media (max-width: 820px) {
    body.is-home .hero-screen > #countdown.hero-countdown {
        top: 61%; bottom: auto; inset-inline: auto; left: 50%; right: auto;
        width: min(340px, 88vw); max-width: none; margin: 0; padding: 10px 12px;
        border-radius: 20px; transform: translateX(-50%); z-index: 4;
    }
    body.is-home .hero #countdown .countdown-label { font-size: clamp(.8rem, 3.4vw, 1rem); line-height: 1.4; margin-bottom: 7px; }
    body.is-home .hero #countdown .cd-num { font-size: clamp(1.3rem, 5vw, 1.7rem); }
}
@media (max-width: 820px) and (max-height: 560px) {
    body.is-home .hero-screen > #countdown.hero-countdown { top: auto; bottom: 76px; padding: 6px 10px; }
    body.is-home .hero #countdown .countdown-label { font-size: .75rem; margin-bottom: 4px; }
    body.is-home .hero #countdown .cd-cell { padding: 3px; }
    body.is-home .hero #countdown .cd-num { font-size: 1.1rem; }
}

/* Give leadership messages more presence within the phone's safe content area. */
@media (max-width: 820px) {
    body.is-home #statsSection.leadership-section {
        justify-content: flex-start;
        padding-top: clamp(38px, 6svh, 60px) !important;
    }
    body.is-home #statsSection.leadership-section > .container:not(.sec-next-wrap) {
        width: calc(100% - 24px); max-width: 660px; margin-inline: auto;
    }
    .leadership-heading { margin-bottom: 20px; padding-inline: 6px; }
    .leadership-heading h2 {
        font-size: clamp(1.65rem, 5.6vw, 2.1rem); line-height: 1.3;
        text-wrap: balance; overflow-wrap: anywhere;
    }
    .leadership-heading p { font-size: .84rem; line-height: 1.6; margin-top: 6px; }
    .leadership-panels { width: 100%; max-width: none; }
    .leadership-panel { padding: 20px 18px 22px; border-radius: 28px; }
    .leadership-portrait { width: 84px; height: 84px; }
    .leadership-card-copy { padding-top: 12px; }
    .leadership-card-copy h3 { font-size: 1.2rem; }
    .leadership-eyebrow { font-size: .85rem; }
    .leadership-position { font-size: .82rem; }
    .leadership-excerpt { font-size: .9rem; margin: 10px 0 14px; }
    .leadership-read { width: min(100%, 280px); }
}
@media (max-width: 820px) and (max-height: 650px) {
    body.is-home #statsSection.leadership-section { padding-top: 28px !important; }
}

/* Centre the clock between the venue artwork and the raised scroll arrow. */
@media (max-width: 820px) {
    body.is-home .hero-screen { --hero-arrow-bottom: clamp(60px, 10svh, 90px); }
    body.is-home .hero-screen .sec-next { bottom: var(--hero-arrow-bottom); }
    body.is-home .hero-screen > #countdown.hero-countdown {
        top: calc(78.75% - var(--hero-arrow-bottom) / 2 - 24px); bottom: auto;
        transform: translate(-50%, -50%);
    }
}

/* Keep the leadership arrow clear of the mobile bar, including browser chrome. */
@media (max-width: 820px) {
    body.is-home #statsSection.leadership-section {
        padding-top: clamp(18px, 3svh, 28px) !important;
        padding-bottom: calc(58px + env(safe-area-inset-bottom)) !important;
    }
    .leadership-heading { margin-bottom: 14px; }
    .leadership-tabs { margin-top: 10px; }
    body.is-home #statsSection.leadership-section .sec-next-wrap {
        padding: 8px 0 0; margin-top: 0; flex: 0 0 auto;
    }
    body.is-home #statsSection.leadership-section .sec-next {
        margin: 0 auto; animation: none;
    }
}
