/* ===== "Leaving Code News" redirect page (ads) ===== */
.rd-area {
    --rd-bg: #f6f5fa;
    --rd-surface: #ffffff;
    --rd-border: rgba(16, 12, 40, 0.08);
    --rd-text: #1f1d2b;
    --rd-muted: #6b6880;
    --rd-accent: var(--color-primary, #49108b);
    --rd-accent-soft: rgba(73, 16, 139, 0.09);
    display: grid;
    place-items: center;
    min-height: calc(100vh - 260px);
    padding: 56px 0;
    background: var(--rd-bg);
}

body.active-dark-mode .rd-area {
    --rd-bg: #111116;
    --rd-surface: #1d1d24;
    --rd-border: rgba(255, 255, 255, 0.08);
    --rd-text: #f3f3f6;
    --rd-muted: #a3a1b3;
    --rd-accent: #a98bf5;
    --rd-accent-soft: rgba(169, 139, 245, 0.14);
}

.rd-card {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--rd-border);
    border-radius: 24px;
    background: var(--rd-surface);
    box-shadow: 0 20px 50px rgba(16, 12, 40, 0.08);
    text-align: center;
}

.rd-banner {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    margin-bottom: 22px;
    border-radius: 16px;
    object-fit: cover;
}

.rd-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--rd-accent-soft);
    color: var(--rd-accent);
    font-size: 12px;
    font-weight: 700;
}

.rd-area .rd-title {
    margin: 0 0 8px;
    color: var(--rd-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.rd-domain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 22px;
    color: var(--rd-muted);
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Countdown */
.rd-progress {
    overflow: hidden;
    height: 6px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: var(--rd-accent-soft);
}

.rd-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--rd-accent);
    transition: width linear;
}

.rd-count {
    margin: 0 0 22px;
    color: var(--rd-muted);
    font-size: 14px;
}

.rd-count b {
    color: var(--rd-text);
}

/* Buttons */
.rd-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.rd-area .rd-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 14px;
    background: var(--color-primary, #49108b);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.rd-area .rd-go:hover,
.rd-area .rd-go:focus-visible {
    background: #5b1aa8;
    color: #fff;
}

.rd-area button.rd-stay {
    width: auto;
    padding: 12px 20px;
    border: 1px solid var(--rd-border);
    border-radius: 14px;
    background: transparent;
    color: var(--rd-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Newsletter pages: the main action can be a form button, the second one a link */
.rd-area button.rd-go {
    border: 0;
    cursor: pointer;
}

.rd-area a.rd-stay {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    border: 1px solid var(--rd-border);
    border-radius: 14px;
    color: var(--rd-text);
    font-size: 15px;
    font-weight: 600;
}

.rd-area a.rd-stay:hover {
    border-color: var(--rd-accent);
    color: var(--rd-accent);
}

.rd-area button.rd-stay:hover {
    border-color: var(--rd-accent);
    color: var(--rd-accent);
}

.rd-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--rd-border);
    color: var(--rd-muted);
    font-size: 13px;
    line-height: 1.8;
}

.rd-note i {
    margin-top: 4px;
}

@media (max-width: 575px) {
    .rd-area {
        padding: 28px 0;
    }

    .rd-card {
        padding: 20px;
        border-radius: 20px;
    }

    .rd-area .rd-title {
        font-size: 19px;
    }

    .rd-actions > * {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rd-progress span {
        transition: none !important;
    }
}

/* Link details: summary + who shared it */
.rd-desc {
    margin: -8px 0 14px;
    color: var(--rd-muted);
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.rd-by {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    color: var(--rd-muted);
    font-size: 13px;
}

.rd-by img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
