:root {
    --nl-bg: #f7f4f9;
    --nl-surface: #ffffff;
    --nl-fg: #1d1a24;
    --nl-muted: #6a6275;
    --nl-line: #e6dfec;
    --nl-brand: #8e1f7c;
    --nl-brand-deep: #5a1150;
    --nl-brand-soft: #f3e4f5;
    --nl-brand-ink: #8e1f7c;
    --nl-on-brand: #ffffff;
    --nl-hero-from: #5a1150;
    --nl-hero-to: #8e1f7c;
    --nl-paper: #e8e3ec;
    --nl-paper-ink: #4a4255;
    --nl-pdf-red: #d93025;
    --nl-shadow: 0 14px 34px rgba(70, 20, 80, .13);
    --nl-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --nl-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Dark mode: system setting */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --nl-bg: #15101b;
        --nl-surface: #1f1827;
        --nl-fg: #f1ecf5;
        --nl-muted: #aaa0b6;
        --nl-line: #352c41;
        --nl-brand: #a2338f;
        --nl-brand-soft: #35203a;
        --nl-brand-ink: #e08fd2;
        --nl-shadow: 0 14px 34px rgba(0, 0, 0, .45);
    }
}

/* Dark mode: agar aapki site data-theme="dark" use karti hai */
:root[data-theme="dark"] {
    --nl-bg: #15101b;
    --nl-surface: #1f1827;
    --nl-fg: #f1ecf5;
    --nl-muted: #aaa0b6;
    --nl-line: #352c41;
    --nl-brand: #a2338f;
    --nl-brand-soft: #35203a;
    --nl-brand-ink: #e08fd2;
    --nl-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}


.nl-page,
.nl-page *,
.nl-page *::before,
.nl-page *::after {
    box-sizing: border-box;
}

.nl-page {
    background: var(--nl-bg);
    color: var(--nl-fg);
    font-family: var(--nl-font-body);
    font-size: 15px;
    line-height: 1.6;
    padding-bottom: 56px;
}

    .nl-page [hidden] {
        display: none !important;
    }

    .nl-page a {
        color: inherit;
    }

    .nl-page button {
        font: inherit;
        color: inherit;
    }

    .nl-page :focus-visible {
        outline: 3px solid var(--nl-brand-ink);
        outline-offset: 2px;
    }

.nl-inner {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Hero ---------- */
.nl-page .nl-hero {
    background: linear-gradient(135deg, var(--nl-hero-from), var(--nl-hero-to));
    color: #fff;
    padding-block: 52px 96px 0;
}

.nl-page .nl-eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    opacity: .8;
}

.nl-page .nl-hero h1 {
    font: 700 clamp(30px, 5vw, 46px)/1.1 var(--nl-font-display);
    margin: 0px 0 0px;
    color: #fff;
    text-wrap: balance;
    text-align: center;
}

.nl-page .nl-hero p {
    margin: 0;
    max-width: 56ch;
    opacity: .92;
}

/* ---------- Featured (latest issue) ---------- */
.nl-stage {
    margin-top: 0;
    position: relative;
}

.nl-featured {
    background: var(--nl-surface);
    border: 1px solid var(--nl-line);
    border-radius: 20px;
    box-shadow: var(--nl-shadow);
    padding: 22px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}

.nl-pill {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--nl-brand-soft);
    color: var(--nl-brand-ink);
    padding: 5px 12px;
    border-radius: 99px;
}

.nl-page .nl-featured h2 {
    font: 700 clamp(22px, 3.4vw, 30px)/1.2 var(--nl-font-display);
    margin: 14px 0 10px;
    color: var(--nl-fg);
    text-wrap: balance;
}

.nl-featured p {
    margin: 0 0 16px;
    color: var(--nl-muted);
    max-width: 60ch;
}

.nl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: var(--nl-muted);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}

.nl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Buttons ---------- */
.nl-page .nl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 11px;
    border: 2px solid var(--nl-brand);
    background: transparent;
    color: var(--nl-brand-ink);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}

    .nl-page .nl-btn:hover {
        background: var(--nl-brand-soft);
    }

.nl-page .nl-btn--solid {
    background: var(--nl-brand);
    color: var(--nl-on-brand);
}

    .nl-page .nl-btn--solid:hover {
        background: var(--nl-brand-deep);
        border-color: var(--nl-brand-deep);
    }

.nl-btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}

/* ---------- PDF cover ---------- */
.nl-cover-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--nl-line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--nl-brand-soft);
    cursor: pointer;
    position: relative;
}

    .nl-cover-btn img {
        display: block;
        width: 100%;
        max-width: 100%;
        /* aspect-ratio: 924 / 1308; */
        object-fit: cover;
        transition: transform .35s;
        height: auto;
    }

.nl-tag-pdf {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--nl-pdf-red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ---------- Archive ---------- */
.nl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    margin: 44px 0 20px;
}

.nl-page .nl-toolbar h2 {
    font: 700 26px/1.2 var(--nl-font-display);
    margin: 0;
    color: var(--nl-fg);
}

.nl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.nl-page .nl-chip {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 99px;
    border: 1px solid var(--nl-line);
    background: var(--nl-surface);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .nl-page .nl-chip[aria-pressed="true"],
    .nl-page .nl-chip:hover {
        background: var(--nl-brand);
        border-color: var(--nl-brand);
        color: var(--nl-on-brand);
    }

.nl-chip-n {
    opacity: .7;
    font-weight: 500;
    margin-left: 4px;
}

.nl-page .nl-search {
    min-height: 38px;
    width: 210px;
    max-width: 100%;
    padding: 0 15px;
    border-radius: 99px;
    border: 1px solid var(--nl-line);
    background: var(--nl-surface);
    color: var(--nl-fg);
    font: inherit;
    font-size: 14px;
}

.nl-search::placeholder {
    color: var(--nl-muted);
}

.nl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 20px;
}

.nl-card {
    background: var(--nl-surface);
    border: 1px solid var(--nl-line);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    transition: transform .22s, box-shadow .22s;
}

    .nl-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--nl-shadow);
    }

        .nl-card:hover .nl-cover-btn img {
            transform: scale(1.03);
        }

.nl-page .nl-card h3 {
    font-size: 14.5px;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
    color: var(--nl-fg);
    text-wrap: balance;
}

.nl-when {
    font-size: 12.5px;
    color: var(--nl-muted);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.nl-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--nl-muted);
}

.nl-page .nl-read {
    background: none;
    border: 0;
    padding: 0;
    color: var(--nl-brand-ink);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
}

    .nl-page .nl-read:hover {
        text-decoration: underline;
    }

.nl-empty {
    grid-column: 1 / -1;
    color: var(--nl-muted);
    padding: 30px 0;
}

/* ---------- PDF reader (popup) ---------- */
.nl-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(24, 8, 30, .68);
    backdrop-filter: blur(4px);
}

    .nl-overlay.is-open {
        display: flex;
    }

.nl-reader {
    background: var(--nl-surface);
    color: var(--nl-fg);
    width: min(1020px, 100%);
    height: min(90vh, 940px);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.nl-reader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--nl-line);
}

.nl-reader-title {
    min-width: 0;
}

.nl-page .nl-reader-title h2 {
    font: 600 15.5px/1.3 var(--nl-font-body);
    margin: 0;
    color: var(--nl-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nl-reader-title small {
    color: var(--nl-muted);
    font-size: 12.5px;
}

.nl-reader-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.nl-page .nl-reader-actions .nl-btn {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 10px;
}

.nl-page .nl-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: var(--nl-brand-soft);
    color: var(--nl-brand-ink);
    cursor: pointer;
    display: grid;
    place-items: center;
}

    .nl-page .nl-icon-btn:hover {
        background: var(--nl-brand);
        color: var(--nl-on-brand);
    }

    .nl-page .nl-icon-btn:disabled {
        opacity: .35;
        cursor: default;
    }

        .nl-page .nl-icon-btn:disabled:hover {
            background: var(--nl-brand-soft);
            color: var(--nl-brand-ink);
        }

.nl-icon-btn svg {
    width: 18px;
    height: 18px;
}

.nl-frame-wrap {
    flex: 1;
    min-height: 0;
    background: var(--nl-paper);
    position: relative;
}

    .nl-frame-wrap iframe {
        width: 100%;
        height: calc(100% - 36px);
        border: 0;
        display: block;
    }

.nl-fallback {
    position: absolute;
    inset: auto 0 0 0;
    text-align: center;
    font-size: 12.5px;
    padding: 8px 12px;
    color: var(--nl-muted);
    background: var(--nl-surface);
    border-top: 1px solid var(--nl-line);
}

.nl-page .nl-fallback a {
    color: var(--nl-brand-ink);
    font-weight: 600;
}

.nl-pages {
    height: calc(100% - 36px);
    overflow: auto;
    padding: 16px;
    background: var(--nl-paper);
}

    .nl-pages canvas {
        display: block;
        margin: 0 auto 14px;
        max-width: 100%;
        height: auto;
        background: #fff;
        box-shadow: 0 4px 16px rgba(30, 10, 40, .2);
    }

    .nl-pages .nl-note {
        margin: 40px auto;
        max-width: 44ch;
        text-align: center;
        color: var(--nl-paper-ink);
    }

.nl-page .nl-pages .nl-note a {
    color: #8e1f7c;
    font-weight: 600;
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    .nl-featured {
        grid-template-columns: 1fr;
        gap: 18px;
    }

        .nl-featured .nl-cover-btn {
            max-width: 220px;
        }

    .nl-page .nl-search {
        width: 100%;
    }

    .nl-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .nl-overlay {
        padding: 0;
    }

    .nl-reader {
        height: 100%;
        border-radius: 0;
    }

    .nl-reader-actions .nl-btn-label {
        display: none;
    }

    .nl-page .nl-reader-actions .nl-btn {
        padding: 0 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nl-page * {
        transition: none !important;
    }
}
