/**
 * Past Paper / Syllabus wrapper styles.
 *
 * @package NN_Education
 */

html, body {
    overflow-x: clip !important;
    max-width: 100% !important;
    touch-action: pan-y !important;
}

.nn-pp-page-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
    overflow-x: hidden !important;
    color: #1b2b4b;
}

.nn-pp-infocard {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: #f0f4ff;
    border-left: 4px solid #2C3E50;
    border-radius: 10px;
    margin-bottom: 16px;
}

.nn-pp-infocard-title {
    font-size: 18px;
    font-weight: 900;
    color: #2C3E50;
}

.nn-pp-back-btn {
    padding: 8px 16px;
    background: #2C3E50;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    align-self: center;
}

.nn-pp-embed-box {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 8px;
}

.nn-pp-embed-ratio {
    position: relative;
    padding-bottom: 130%;
    height: 0;
    border-radius: 12px;
    overflow: hidden;
}

.nn-pp-embed-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    max-width: 100vw !important;
    transform: translateZ(0);
}
.nn-pp-fullscreen-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 2px 14px;
    margin-bottom: 6px;
    position: relative;
    z-index: 50;
    pointer-events: auto !important;
}

.nn-pp-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 10px 18px;
    background: #1b2b4b;
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    border: none;
    cursor: pointer !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(27, 43, 75, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 51;
    pointer-events: auto !important;
}

.nn-pp-fullscreen-btn * {
    pointer-events: none !important;
}

.nn-pp-fullscreen-btn:hover {
    background: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 43, 75, 0.3);
}

.nn-pp-fullscreen-btn:active {
    background: #121e35;
    transform: translateY(1px);
}

/* Universal Mobile & Desktop Fullscreen Mode */
.nn-pdf-fs-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    /* Use vh as fallback, then dvh so Safari accounts for its own toolbars */
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    z-index: 99999999 !important;
    margin: 0 !important;
    /* Push content up from the iOS home indicator / Safari bottom bar */
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
    background: #d3d3d8 !important;
    transform: none !important;
    overflow: hidden !important;
}

.nn-pdf-fs-active .nn-pp-embed-ratio {
    position: static !important;
    padding-bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100% !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.nn-pdf-fs-active iframe {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    /*
     * Leave space at the bottom for the iOS Safari toolbar and home indicator.
     * env(safe-area-inset-bottom) gives the height of the home bar on Face ID
     * devices; on older devices it is 0.
     */
    bottom: env(safe-area-inset-bottom, 0px) !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border: none !important;
    z-index: 99999998 !important;
    border-radius: 0 !important;
    transform: none !important;
}

.nn-pdf-fs-active .nn-pp-fullscreen-bar {
    display: none !important;
}

.nn-pdf-close-fs-btn {
    display: none;
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
    right: max(14px, env(safe-area-inset-right, 14px)) !important;
    z-index: 999999999 !important;
    background: rgba(27, 43, 75, 0.94) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 22px !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    min-height: 40px !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
}

.nn-pdf-fs-active .nn-pdf-close-fs-btn {
    display: inline-flex !important;
}

.nn-pdf-close-fs-btn:hover,
.nn-pdf-close-fs-btn:active {
    background: #0f1a2e !important;
    transform: scale(1.03);
}

/* ── FULLSCREEN BODY LOCK ─────────────────────────────────────────────── */
/*
 * iOS Safari ignores overflow:hidden on <body>.
 * The only reliable fix is position:fixed. We save the scroll
 * position in JS and restore it on exit.
 */
body.nn-pdf-fs-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    /* top is set dynamically by JS to preserve scroll position */
    left: 0 !important;
    right: 0 !important;
}

/*
 * Hide all page content EXCEPT the fullscreen embed box itself,
 * so nothing bleeds through behind the fixed overlay on mobile.
 */
body.nn-pdf-fs-locked > * {
    visibility: hidden !important;
}

body.nn-pdf-fs-locked .nn-pdf-fs-active,
body.nn-pdf-fs-locked .nn-pdf-fs-active *,
body.nn-pdf-fs-locked .nn-pdf-close-fs-btn {
    visibility: visible !important;
}

.nn-pp-fallback-link {
    text-align: center;
    padding: 8px 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7a99;
}

.nn-pp-fallback-link span {
    margin-right: 6px;
}

.nn-pp-fallback-link a {
    color: #2C3E50;
    font-weight: 700;
    text-decoration: none;
}

.nn-pp-fallback-link a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .entry-content,
    .ast-container,
    .site-content,
    #content,
    .content-area {
        padding: 0 !important;
        margin: 0 !important;
    }

    .nn-pp-page-wrap {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nn-pp-embed-box {
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .nn-pp-infocard {
        padding: 10px 12px !important;
        margin-top: 60px !important;
        margin-bottom: 0 !important;
        border-radius: 0 !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    .nn-pp-infocard-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .nn-pp-back-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
        flex-shrink: 0 !important;
    }

    .nn-pp-embed-ratio {
        /* vh fallback then dvh so Safari toolbars are excluded */
        height: calc(100vh - 125px) !important;
        height: calc(100dvh - 125px) !important;
        padding-bottom: 0 !important;
    }

    .nn-pp-fallback-link {
        margin-bottom: 12px;
    }
}

.nn-pp-page-wrap .adsbygoogle {
    margin: 16px 0 !important;
    border-radius: 8px;
    overflow: hidden;
}

/* ── PREMIUM CONTENT SKIN ─────────────────────────────────────────────── */

.nn-pp-page-wrap p {
    line-height: 1.75;
    color: #3d4f6b;
    margin: 0 0 16px;
}

.nn-pp-page-wrap > p:first-of-type {
    font-size: 16.5px;
    color: #243447;
}

.nn-pp-page-wrap strong {
    color: #2C3E50;
    font-weight: 800;
}

.nn-pp-page-wrap a:not(.nn-pp-back-btn):not(.nn-pp-fallback-link a) {
    color: #16A085;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(22, 160, 133, .3);
}

.nn-pp-page-wrap a:not(.nn-pp-back-btn):not(.nn-pp-fallback-link a):hover {
    border-bottom-color: #16A085;
}

.nn-pp-page-wrap h2,
.nn-pp-page-wrap h3 {
    font-size: 22px;
    font-weight: 800;
    color: #2C3E50;
    margin: 40px 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef3ff;
    position: relative;
}

.nn-pp-page-wrap > h2:first-of-type,
.nn-pp-page-wrap > h3:first-of-type {
    margin-top: 26px;
}

.nn-pp-page-wrap h2::after,
.nn-pp-page-wrap h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 56px;
    height: 2px;
    background: #16A085;
}

.nn-pp-page-wrap h4,
.nn-pp-page-wrap h5 {
    font-size: 17px;
    font-weight: 800;
    color: #2C3E50;
    margin: 26px 0 10px;
}

.nn-pp-page-wrap ul,
.nn-pp-page-wrap ol {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.nn-pp-page-wrap ul li,
.nn-pp-page-wrap ol li {
    position: relative;
    padding: 8px 0 8px 30px;
    line-height: 1.6;
    color: #3d4f6b;
    border-bottom: 1px solid #f2f5fb;
}

.nn-pp-page-wrap ul li:last-child,
.nn-pp-page-wrap ol li:last-child {
    border-bottom: none;
}

.nn-pp-page-wrap ul li::before {
    content: '✓';
    position: absolute;
    left: 2px;
    top: 8px;
    color: #16A085;
    font-weight: 800;
}

.nn-pp-page-wrap ol {
    counter-reset: nn-pp-counter;
}

.nn-pp-page-wrap ol li {
    padding-left: 38px;
}

.nn-pp-page-wrap ol li::before {
    counter-increment: nn-pp-counter;
    content: counter(nn-pp-counter);
    left: 0;
    top: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2C3E50;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nn-pp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border: 1px solid #e9eef8;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(18, 39, 90, .04);
}

.nn-pp-page-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nn-pp-page-wrap table th {
    background: #2C3E50;
    color: #fff;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    white-space: nowrap;
}

.nn-pp-page-wrap table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f3fa;
    color: #3d4f6b;
    vertical-align: top;
}

.nn-pp-page-wrap table tr:last-child td {
    border-bottom: none;
}

.nn-pp-page-wrap table tbody tr:nth-child(even) td {
    background: #f8faff;
}

.nn-pp-page-wrap table td.nn-pp-answer-cell {
    color: #16A085;
    font-weight: 800;
    white-space: nowrap;
}

.nn-pp-faq-item {
    background: #fff;
    border: 1px solid #e9eef8;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(18, 39, 90, .03);
    overflow: hidden;
}

.nn-pp-faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 44px 16px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #2C3E50;
    position: relative;
    line-height: 1.4;
}

.nn-pp-faq-item summary::-webkit-details-marker {
    display: none;
}

.nn-pp-faq-item summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 700;
    color: #16A085;
}

.nn-pp-faq-item[open] summary::after {
    content: '–';
}

.nn-pp-faq-item summary:hover {
    background: #f8faff;
}

.nn-pp-faq-body {
    padding: 0 18px 18px;
    font-size: 14.5px;
    line-height: 1.65;
    color: #5a6e8c;
}

.nn-pp-faq-body p {
    margin: 0;
    padding-left: 0;
    border: none;
    color: inherit;
}

.nn-pp-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f8faff, #eef7f4);
    border: 1.5px solid #16A085;
    border-radius: 16px;
    padding: 20px 22px;
    margin: 24px 0 32px;
    box-shadow: 0 4px 16px rgba(22, 160, 133, .08);
    flex-wrap: wrap;
}

.nn-pp-cta-icon {
    font-size: 34px;
    flex-shrink: 0;
    line-height: 1;
}

.nn-pp-cta-body {
    flex: 1;
    min-width: 200px;
}

.nn-pp-cta-title {
    font-size: 16px;
    font-weight: 800;
    color: #2C3E50;
    margin-bottom: 4px;
}

.nn-pp-cta-text {
    margin: 0;
    font-size: 13.5px;
    color: #5a6e8c;
    line-height: 1.6;
}

.nn-pp-cta-price {
    color: #16A085;
    font-weight: 800;
}

.nn-pp-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2C3E50, #16A085);
    color: #fff !important;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(18, 39, 90, .15);
    transition: opacity .15s, transform .15s;
}

.nn-pp-cta-btn:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.nn-pp-cta-btn--active {
    background: #e8f7f3 !important;
    color: #0f766e !important;
    border: 1px solid #b8e3d8;
    box-shadow: none;
    cursor: default;
}

.nn-pp-cta-btn--active:hover {
    opacity: 1;
    transform: none;
}

@media (max-width: 560px) {
    .nn-pp-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .nn-pp-cta-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nn-pp-page-wrap h2,
    .nn-pp-page-wrap h3 {
        font-size: 19px;
        margin: 30px 0 14px;
    }

    .nn-pp-page-wrap table {
        font-size: 13px;
    }

    .nn-pp-page-wrap table th,
    .nn-pp-page-wrap table td {
        padding: 10px 12px;
    }
}
