/* Smart Article Pagination Pro — Frontend CSS
   Target: < 20KB minified | Mobile-first | No CLS */

/* ── Variables (overridden by inline CSS from PHP) ── */
:root {
    --sap-btn-color: #1a7a4a;
    --sap-btn-text:  #ffffff;
    --sap-radius:    4px;
}

/* ── Page Wrapper ── */
.sap-page {
    /* No visual styles — just a semantic wrapper */
}

/* ── NEXT Section ── */
.sap-next-section {
    margin: 32px 0;
    text-align: center;
}

/* ── Continue Text ── */
.sap-continue-text {
    font-style: italic;
    color: #666666;
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.4;
}

/* ── NEXT Button ── */
.sap-next-button {
    display: block;
    width: 100%;
    min-height: 60px;
    padding: 16px 24px;
    background: var(--sap-btn-color, #1a7a4a);
    color: var(--sap-btn-text, #ffffff);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: var(--sap-radius, 4px);
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    /* Reserve space to prevent CLS */
    contain: layout;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.sap-next-button:hover,
.sap-next-button:active {
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--sap-btn-text, #ffffff);
    text-decoration: none;
}

/* Keyboard focus — WCAG 2.1 AA */
.sap-next-button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

/* ── Progress Bar ── */
.sap-progress {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 0 24px;
    position: relative;
}

.sap-progress-bar {
    height: 100%;
    background: var(--sap-btn-color, #1a7a4a);
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 4px;
}

.sap-progress-label {
    position: absolute;
    right: 0;
    top: 10px;
    font-size: 12px;
    color: #888888;
    white-space: nowrap;
}

/* ── Ad Zones ── */
.sap-ad-zone {
    margin: 16px 0;
    text-align: center;
    min-height: 10px; /* prevent CLS — real height set by ad */
}

/* ── AJAX Loading State ── */
.sap-loading {
    text-align: center;
    padding: 32px 16px;
    color: #888888;
    font-size: 15px;
}

.sap-loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--sap-btn-color, #1a7a4a);
    border-radius: 50%;
    animation: sap-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes sap-spin {
    to { transform: rotate(360deg); }
}

/* ── ARIA live region for AJAX ── */
.sap-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sap-next-button {
        min-height: 56px;
        font-size: 18px;
        padding: 14px 16px;
    }

    .sap-continue-text {
        font-size: 14px;
    }
}

/* ── Dark mode support ── */
@media (prefers-color-scheme: dark) {
    .sap-continue-text {
        color: #aaaaaa;
    }
    .sap-loading {
        color: #aaaaaa;
    }
}
