/* The Conference Pulse outside the Pulse pages (js/pulse-promo.js): the card on conference
   pages and "This week in your field" on My Conference. */

/* ---- conference page card ---- */

.pulse-promo {
    box-sizing: border-box;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin: 1.5rem 0 0.5rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid #cdeae6;
    border-radius: 16px;
    background: linear-gradient(135deg, #f2fbf9 0%, #ffffff 60%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #334155;
}

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

.pulse-promo[hidden] {
    display: none;
}

.pulse-promo__mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: #11a191;
    color: #fff;
}

.pulse-promo__mark svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pulse-promo__body {
    flex: 1;
    min-width: 0;
}

.pulse-promo__kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d8a7c;
}

.pulse-promo__title {
    margin: 0 0 0.3rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
}

.pulse-promo__text {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.pulse-promo__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 34rem;
    margin: 0;
}

.pulse-promo__form[hidden] {
    display: none;
}

.pulse-promo__form input[type="email"] {
    flex: 1 1 14rem;
    min-width: 0;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    background: #fff;
}

.pulse-promo__form input[type="email"]:focus {
    outline: none;
    border-color: #11a191;
    box-shadow: 0 0 0 3px rgba(17, 161, 145, 0.18);
}

.pulse-promo__form input[aria-invalid="true"] {
    border-color: #e11d48;
}

.pulse-promo__form input[hidden] {
    display: none;
}

.pulse-promo__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.pulse-promo__btn {
    flex: none;
    padding: 0.7rem 1.3rem;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.pulse-promo__btn:hover {
    filter: brightness(1.06);
}

.pulse-promo__btn:focus-visible {
    outline: 2px solid #11a191;
    outline-offset: 3px;
}

.pulse-promo__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.pulse-promo__note {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.pulse-promo__note:empty {
    display: none;
}

.pulse-promo__note.is-error {
    color: #be123c;
}

.pulse-promo.is-done .pulse-promo__note {
    margin-top: 0;
}

.pulse-promo__link {
    display: inline-block;
    margin-top: 0.7rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0d6d6c;
    text-decoration: none;
}

.pulse-promo__link:hover {
    text-decoration: underline;
}

.pulse-promo.is-done .pulse-promo__text {
    display: none;
}

@media (max-width: 600px) {
    .pulse-promo {
        padding: 1.1rem;
    }

    .pulse-promo__mark {
        display: none;
    }

    .pulse-promo__btn {
        flex: 1 1 100%;
    }
}

/* ---- My Conference: this week in your field ----
   Wide screens: one row (mark, story, score tiles, button). Tablets: the tiles and button
   move under the story. Phones: a stack, the button full width. */

.pulse-week {
    --pw-teal: #11a191;
    --pw-deep: #0d6d6c;
    --pw-ink: #0f172a;
    --pw-body: #475569;
    --pw-muted: #64748b;
    box-sizing: border-box;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "mark main stats go";
    align-items: center;
    gap: 0.9rem 1.25rem;
    margin: 0.85rem 0;
    padding: 1rem 3rem 1rem 1.15rem;
    border: 1px solid #d3ebe7;
    border-radius: 18px;
    background:
        radial-gradient(130% 180% at 0% 0%, rgba(17, 161, 145, 0.11), transparent 52%),
        radial-gradient(90% 160% at 100% 100%, rgba(99, 102, 241, 0.07), transparent 60%),
        #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -18px rgba(15, 23, 42, 0.22);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--pw-body);
    overflow: hidden;
    animation: pulse-week-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Shown from the saved copy, with the rest of the page */
.pulse-week.is-instant {
    animation: none;
}

/* Tablet and up: on the hero card's and tab bar's column (css/my-conference-page.css) */
@media screen and (min-width: 769px) {
    .conference-container > .pulse-week {
        width: var(--mc-column);
        margin: 0 0 18px -80px;
    }
}

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

.pulse-week[hidden] {
    display: none;
}

/* The issue's colours down the left edge. */
.pulse-week::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #11a191, #6366f1);
}

@keyframes pulse-week-in {
    from { opacity: 0; transform: translateY(6px); }
}

.pulse-week__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- the mark: a heartbeat that draws itself ---- */

.pulse-week__mark {
    grid-area: mark;
    align-self: start;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    background: linear-gradient(140deg, #14b8a6, var(--pw-deep));
    box-shadow: 0 8px 18px -8px rgba(13, 109, 108, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #fff;
}

.pulse-week__mark svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pulse-week__mark path {
    stroke-dasharray: 100;
    animation: pulse-week-beat 2.8s ease-in-out 0.3s infinite;
}

@keyframes pulse-week-beat {
    0% { stroke-dashoffset: 100; }
    45%, 80% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

/* ---- the story ---- */

.pulse-week__main {
    grid-area: main;
    min-width: 0;
}

.pulse-week__kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.55rem;
    margin: 0 0 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pw-deep);
}

.pulse-week__issue {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--pw-muted);
}

.pulse-week__issue::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.pulse-week__story {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.14rem;
    font-weight: 700;
    line-height: 1.32;
    color: var(--pw-ink);
    text-decoration: none;
    text-wrap: pretty;
    min-height: 0;
}

a.pulse-week__story:hover {
    color: var(--pw-deep);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.pulse-week__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--pw-muted);
}

.pulse-week__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--desk, var(--pw-teal));
}

.pulse-week__tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.pulse-week__more {
    min-height: 0;
    font-weight: 700;
    color: var(--pw-deep);
    text-decoration: none;
}

.pulse-week__more:hover {
    text-decoration: underline;
}

/* ---- score and deadline tiles ---- */

.pulse-week__stats {
    grid-area: stats;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pulse-week__stats li {
    display: flex;
    min-width: 0;
}

.pulse-week__stat {
    --desk: var(--pw-teal);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 8.4rem;
    min-height: 0;
    padding: 0.55rem 0.75rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--desk) 18%, #fff);
    border-radius: 13px;
    background: color-mix(in srgb, var(--desk) 6%, #fff);
    color: var(--pw-ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pulse-week__stat:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--desk) 40%, #fff);
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--desk) 60%, transparent);
}

.pulse-week__stat-label {
    overflow: hidden;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--desk);
}

.pulse-week__stat-num {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.pulse-week__stat-num i,
.pulse-week__stat-num small {
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--pw-muted);
}

.pulse-week__stat-num i.is-up {
    color: #059669;
}

.pulse-week__stat-num i.is-down {
    color: #be123c;
}

.pulse-week__stat-bar,
.pulse-week__radar {
    position: relative;
    height: 4px;
    margin-top: 0.3rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--desk) 16%, transparent);
}

.pulse-week__stat-bar::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--score, 0) * 1%);
    border-radius: inherit;
    background: var(--desk);
    animation: pulse-week-fill 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
    transform-origin: left center;
}

/* A usual week (50). */
.pulse-week__stat-bar::before {
    content: "";
    position: absolute;
    inset: -2px auto -2px 50%;
    z-index: 1;
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: #fff;
}

@keyframes pulse-week-fill {
    from { transform: scaleX(0); }
}

.pulse-week__stat.is-due {
    --desk: #e11d48;
}

.pulse-week__radar i {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--desk);
}

.pulse-week__radar i.is-mine {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    box-shadow: 0 0 0 2px var(--desk);
}

/* ---- the button and close ---- */

.pulse-week__go {
    grid-area: go;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0 1.15rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pw-teal), var(--pw-deep));
    box-shadow: 0 8px 18px -10px rgba(13, 109, 108, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.pulse-week__go span {
    transition: transform 0.2s ease;
}

.pulse-week__go:hover {
    filter: brightness(1.07);
}

.pulse-week__go:hover span {
    transform: translateX(3px);
}

.pulse-week__go:focus-visible,
.pulse-week__stat:focus-visible,
.pulse-week__close:focus-visible,
.pulse-week a:focus-visible {
    outline: 2px solid var(--pw-teal);
    outline-offset: 2px;
}

.pulse-week__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.pulse-week__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

.pulse-week__close svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* ---- tablets: tiles and button under the story ---- */

@media (max-width: 1100px) {
    .pulse-week.has-stats {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "mark main main"
            "mark stats go";
    }

    .pulse-week.has-stats .pulse-week__go {
        justify-self: end;
    }
}

/* ---- phones: a stack ---- */

@media (max-width: 640px) {
    .pulse-week,
    .pulse-week.has-stats {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "mark kicker"
            "story story"
            "meta meta"
            "stats stats"
            "go go";
        gap: 0;
        padding: 0.95rem 1rem 1rem 1.15rem;
        border-radius: 16px;
    }

    .pulse-week__main {
        display: contents;
    }

    .pulse-week__mark {
        align-self: center;
        width: 2.25rem;
        height: 2.25rem;
        margin-right: 0.7rem;
        border-radius: 11px;
    }

    .pulse-week__mark svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .pulse-week__kicker {
        grid-area: kicker;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
        margin: 0;
        padding-right: 2rem;
    }

    .pulse-week__issue::before {
        display: none;
    }

    .pulse-week__story {
        grid-area: story;
        margin-top: 0.8rem;
        font-size: 1.2rem;
        -webkit-line-clamp: 3;
    }

    .pulse-week__meta {
        grid-area: meta;
    }

    /* One row of equal tiles (at most three). */
    .pulse-week__stats {
        display: grid;
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-flow: column;
        gap: 0.45rem;
        margin-top: 0.9rem;
    }

    .pulse-week__stat {
        width: auto;
        flex: 1;
        padding: 0.5rem 0.6rem 0.6rem;
        border-radius: 12px;
    }

    .pulse-week__stat-num {
        font-size: 1.2rem;
    }

    .pulse-week__go,
    .pulse-week.has-stats .pulse-week__go {
        justify-self: stretch;
        margin-top: 0.9rem;
        min-height: 2.9rem;
    }

    .pulse-week__close {
        top: 0.6rem;
        right: 0.6rem;
    }
}

/* ---- the follow nudge ---- */

.pulse-nudge {
    position: fixed;
    left: 50%;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1150;
    box-sizing: border-box;
    display: flex;
    gap: 0.95rem;
    align-items: flex-start;
    width: min(28rem, calc(100vw - 1.5rem));
    padding: 1.15rem 2.6rem 1.15rem 1.15rem;
    border: 1px solid #cdeae6;
    border-radius: 18px;
    background: linear-gradient(140deg, #f2fbf9 0%, #ffffff 55%);
    box-shadow: 0 24px 60px -18px rgba(15, 23, 42, 0.35), 0 2px 8px rgba(15, 23, 42, 0.06);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #334155;
    opacity: 0;
    transform: translate(-50%, 1.25rem) scale(0.98);
    transition: opacity 0.28s ease, transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

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

.pulse-nudge.is-open {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.pulse-nudge__mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    box-shadow: 0 6px 16px -6px rgba(13, 109, 108, 0.6);
    color: #fff;
}

.pulse-nudge__mark svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pulse-nudge.is-open .pulse-nudge__mark path {
    stroke-dasharray: 100;
    animation: pulse-nudge-beat 1.1s ease-out 0.2s both;
}

@keyframes pulse-nudge-beat {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

.pulse-nudge__body {
    flex: 1;
    min-width: 0;
}

.pulse-nudge__kicker {
    margin: 0 0 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d8a7c;
}

.pulse-nudge__title {
    margin: 0 0 0.3rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.18rem;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
}

.pulse-nudge__text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
}

.pulse-nudge__text a {
    display: inline-block;
    margin-top: 0.35rem;
    font-weight: 600;
    color: #0d6d6c;
    text-decoration: none;
}

.pulse-nudge__text a:hover {
    text-decoration: underline;
}

.pulse-nudge__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-top: 0.85rem;
}

.pulse-nudge.is-done .pulse-nudge__actions {
    display: none;
}

.pulse-nudge__btn {
    padding: 0.62rem 1.15rem;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.pulse-nudge__btn:hover {
    filter: brightness(1.06);
}

.pulse-nudge__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.pulse-nudge__later {
    padding: 0.4rem 0.1rem;
    border: 0;
    background: none;
    color: #64748b;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.pulse-nudge__later:hover {
    color: #0f172a;
}

.pulse-nudge__btn:focus-visible,
.pulse-nudge__later:focus-visible,
.pulse-nudge__close:focus-visible {
    outline: 2px solid #11a191;
    outline-offset: 3px;
}

.pulse-nudge__note {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.pulse-nudge__note:empty {
    display: none;
}

.pulse-nudge__note.is-error {
    color: #be123c;
}

.pulse-nudge__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.pulse-nudge__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.pulse-nudge__close svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

@media (max-width: 600px) {
    .pulse-nudge {
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        padding: 1rem 2.4rem 1rem 1rem;
        gap: 0.8rem;
    }

    .pulse-nudge__mark {
        width: 2.3rem;
        height: 2.3rem;
    }

    .pulse-nudge__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pulse-nudge__btn {
        min-height: 2.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-week,
    .pulse-week__mark path,
    .pulse-week__stat-bar::after,
    .pulse-nudge.is-open .pulse-nudge__mark path {
        animation: none;
    }

    .pulse-week__stat,
    .pulse-week__go span,
    .pulse-nudge {
        transition: none;
    }
}

@media print {
    .pulse-week,
    .pulse-nudge {
        display: none;
    }
}
