/* ── Reset ──────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Headline ───────────────────────────────────────────────────────────────── */
.s2p-headline-wrap {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 2rem;
    padding: 2rem 0 0;
}

.s2p-headline-category {
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #666666;
    margin-bottom: 1.2rem;
    font-family: Arial, Helvetica, sans-serif;
}

.s2p-headline-title {
    font-family: Georgia, serif;
    font-size: 51.2px;
    font-weight: 700;
    color: #666666;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.s2p-headline-title em {
    font-size: 51.2px;
    font-style: italic;
    font-weight: 700;
    color: #666666;
    display: block;
}

.s2p-headline-subtitle p {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 400;
    color: #666666;
    line-height: 1.7;
    margin: 0 0 1.5rem;
}

/* ── Live count ─────────────────────────────────────────────────────────────── */
.s2p-live-count-wrap {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 0.75rem;
    padding: 0;
}

.s2p-live-count {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 13px;
    color: #555;
    margin-bottom: 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
}

/* Each status item: dot + label in one inline unit */
.s2p-count-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    font-family: Arial, Helvetica, sans-serif;
}

.s2p-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Available — green pulse */
.s2p-count-item.s2p-dot-available .s2p-pulse-dot {
    background: #1A9C56;
    box-shadow: 0 0 0 2px rgba(26, 156, 86, 0.25);
}

/* Speaking — burgundy */
.s2p-count-item.s2p-dot-speaking .s2p-pulse-dot {
    background: #66023c;
    box-shadow: 0 0 0 2px rgba(102, 2, 60, 0.2);
}

/* Offline — muted grey */
.s2p-count-item.s2p-dot-offline .s2p-pulse-dot {
    background: #999;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* ── Loading ────────────────────────────────────────────────────────────────── */
#s2p-cards-loading {
    text-align: center;
    padding: 1.5rem 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #666;
    font-size: 0.9rem;
}

#s2p-cards-loading .s2p-spinner {
    width: 40px;
    height: 40px;
    margin: 10px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #185FA5;
    border-radius: 50%;
    animation: s2p-spin 1s linear infinite;
}

@keyframes s2p-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Grid ───────────────────────────────────────────────────────────────────── */
.s2p-reader-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 2rem;
    gap: 20px;
}

.s2p-reader-grid.s2p-center-1,
.s2p-reader-grid.s2p-center-2,
.s2p-reader-grid.s2p-last-row-1,
.s2p-reader-grid.s2p-last-row-2,
.s2p-reader-grid.s2p-last-row-3 {
    justify-content: center;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.s2p-reader-card {
    width: 220px;
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.s2p-reader-card:hover {
    border-color: #85B7EB;
}

/* ── Card header — fixed photo, no crop ─────────────────────────────────────── */
.s2p-card-header {
    position: relative;
    height: 170px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #bdc3c7, #2c3e50); /* fallback — overridden by inline style */
    display: flex;
    justify-content: center;
    align-items: center;
}

.s2p-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("https://soul2path.com/wp-content/uploads/headers/agenthead.webp");
    background-repeat: repeat-x;
    background-position: center;
    opacity: 0.5;
}

.s2p-card-header a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.s2p-card-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
    border: 4px solid #fff;
    display: block;
    flex-shrink: 0;
}

/* ── Status pill — sits on the card itself, overlapping the header bottom ───── */
/*
    The pill is a SIBLING of .s2p-card-header, not a child of it.
    The card has position:relative; the pill uses absolute positioning
    relative to the card. Header height is 220px, pill is ~28px tall,
    so bottom of pill = 220px − 14px = 206px from card top.
*/
.s2p-status-pill {
    position: absolute;
    top: 156px;             /* header height (170) minus half pill height (14) */
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 18px;
    border-radius: 100px;
    white-space: nowrap;
    z-index: 20;
    letter-spacing: 0.3px;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    pointer-events: none;
}

/* ── New reader ribbon ──────────────────────────────────────────────────────── */
.s2p-ribbon-wrap {
    position: absolute;
    overflow: hidden;
    width: 120px;
    height: 120px;
    top: 0;
    left: 0;
    z-index: 3;
    pointer-events: none;
}

.s2p-ribbon {
    position: absolute;
    text-align: center;
    transform: rotate(-45deg);
    width: 200px;
    top: 22px;
    left: -70px;
    color: #fff;
    padding: 2px 0;
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    font-family: Arial, Helvetica, sans-serif;
}

/* ── Featured badge — top-right of header, anchored ────────────────────────── */
.s2p-featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: auto;
    left: auto;
    transform: none;
    color: #fff;
    padding: 3px 10px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 5;
    white-space: nowrap;
    font-family: Arial, Helvetica, sans-serif;
    pointer-events: none;
}

/* ── Card body ──────────────────────────────────────────────────────────────── */
.s2p-card-body {
    padding: 22px 14px 16px;   /* top padding clears the half-pill (14px) + breathing room */
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    font-family: Arial, Helvetica, sans-serif;
    /* clip the white body to the card's bottom rounded corners */
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.s2p-reader-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* ── Stars ──────────────────────────────────────────────────────────────────── */
.s2p-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.s2p-star {
    width: 10px;
    height: 10px;
    clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}

.s2p-star-on   { background: #F5A623; }
.s2p-star-half {
    background: linear-gradient(to right, #F5A623 50%, #E0E0E0 50%);
}
.s2p-star-off  { background: #E0E0E0; }

/* ── Phone code ─────────────────────────────────────────────────────────────── */
.s2p-phone-code {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

.s2p-phone-code span {
    color: #185FA5;
    font-weight: 600;
}

/* ── Action buttons ─────────────────────────────────────────────────────────── */
.s2p-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.s2p-btn-call {
    background: #185FA5;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 9px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.15s;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none !important;
}

.s2p-btn-call svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
    flex-shrink: 0;
}

.s2p-btn-call:hover   { filter: brightness(0.85); }
.s2p-btn-call:visited { color: #fff !important; }

/* Status-driven call button colour — data attribute on card */
.s2p-reader-card[data-sort="1"] .s2p-btn-call              { background: #0C6B3A; }
.s2p-reader-card[data-sort="2"] .s2p-btn-call,
.s2p-reader-card[data-sort="3"] .s2p-btn-call,
.s2p-reader-card[data-sort="4"] .s2p-btn-call,
.s2p-reader-card[data-sort="5"] .s2p-btn-call              { background: #66023c; }
.s2p-reader-card[data-sort="6"] .s2p-btn-call              { background: #aaa; }

.s2p-btn-profile {
    background: transparent;
    color: #185FA5 !important;
    border: 0.5px solid #B5D4F4;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    display: block;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
}

.s2p-btn-profile:hover   { background: #E6F1FB; border-color: #378ADD; }
.s2p-btn-profile:visited { color: #185FA5 !important; }

/* ── Footer CTA ─────────────────────────────────────────────────────────────── */
.s2p-footer-cta {
    text-align: center;
    margin-top: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    clear: both;
}

.s2p-btn-view-all {
    background: #EBF0F8;
    color: #1E3F7A !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    padding: 16px 48px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none !important;
    transition: background 0.15s;
}

.s2p-btn-view-all:hover   { background: #d5e0f0; }
.s2p-btn-view-all:visited { color: #1E3F7A !important; }

.s2p-arrow { font-size: 0.9rem; }

/* ── Refresh message ────────────────────────────────────────────────────────── */
.s2p-refresh-msg {
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #999;
    margin-top: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .s2p-headline-wrap {
        width: 100%;
        padding: 1.5rem 10px 0;
    }
    .s2p-live-count-wrap {
        padding: 0 10px;
    }
    .s2p-headline-title {
        font-size: 2.4rem;
    }
    .s2p-headline-title em {
        font-size: 32px;
    }
    .s2p-headline-subtitle p {
        font-size: 1rem;
    }
    .s2p-reader-grid {
        padding: 0 10px 1rem;
        gap: 16px;
    }
    .s2p-reader-card {
        width: calc(50% - 8px);
    }
    .s2p-card-body {
        padding: 22px 10px 12px;
        gap: 6px;
    }
    .s2p-reader-name {
        font-size: 0.9rem;
    }
    .s2p-phone-code {
        font-size: 0.72rem;
    }
    .s2p-btn-call,
    .s2p-btn-profile {
        font-size: 0.75rem;
        padding: 8px 0;
    }
}

@media (max-width: 420px) {
    .s2p-reader-card {
        width: calc(100% - 20px);
    }
}
