
/*
 * EbooksAR Reader
 * Native browser PDF viewer; no PDF.js dependency.
 */

body.ebooksar-reader-page {
    background: #eef1f5;
}

.ebooksar-reader-header {
    position: relative;
    z-index: 10;
    background: #172231;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.ebooksar-reader-header__inner {
    width: min(calc(100% - 32px), var(--es-container));
    min-height: 58px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ebooksar-reader-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    font-size: 1.17rem;
    font-weight: 800;
}

.ebooksar-reader-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 7px;
    font-size: 0.97rem;
}

.ebooksar-reader-header__label {
    color: #cbd5e1;
    font-size: 1.03rem;
    font-weight: 700;
}

.ebooksar-reader-main {
    min-height: calc(100vh - 58px);
    padding: 18px 0 28px;
}

.ebooksar-reader-shell {
    width: min(calc(100% - 28px), 1320px);
    margin-inline: auto;
}

.ebooksar-reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding: 13px 18px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
}

.ebooksar-reader-toolbar__title {
    min-width: 0;
}

.ebooksar-reader-toolbar__kicker {
    display: block;
    margin-bottom: 2px;
    color: #7b8491;
    font-size: 0.93rem;
    font-weight: 700;
}

.ebooksar-reader-toolbar h1 {
    max-width: 850px;
    margin: 0;
    color: #202733;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.ebooksar-reader-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 39px;
    padding: 0 13px;
    border: 1px solid #dbe5f3;
    border-radius: 9px;
    background: #f4f8ff;
    color: #1464f4;
    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 750;
    white-space: nowrap;
}

.ebooksar-reader-back:hover {
    border-color: #1464f4;
    background: #1464f4;
    color: #fff;
}

.ebooksar-reader-viewer {
    position: relative;
    height: min(78vh, 900px);
    min-height: 560px;
    overflow: hidden;
    background: #d8dde5;
    border: 1px solid #dfe4ea;
    box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

.ebooksar-reader-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.ebooksar-reader-mobile {
    display: none;
}

.ebooksar-reader-mobile__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #f4f8ff;
    color: #1464f4;
    font-size: 1.25rem;
}

.ebooksar-reader-mobile h2 {
    margin: 0 0 7px;
    color: #202733;
    font-size: 1.3rem;
    line-height: 1.5;
}

.ebooksar-reader-mobile p {
    max-width: 520px;
    margin: 0 auto 15px;
    color: #687383;
    font-size: 1.05rem;
    line-height: 1.8;
}

.ebooksar-reader-mobile__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    padding: 0 17px;
    border-radius: 10px;
    background: #1464f4;
    color: #fff;
    text-decoration: none;
    font-size: 1.07rem;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(20,100,244,.14);
}

.ebooksar-reader-mobile__button:hover {
    background: #0f57d5;
    color: #fff;
}

.ebooksar-reader-mobile small {
    display: block;
    max-width: 520px;
    margin: 11px auto 0;
    color: #8a93a1;
    font-size: 0.92rem;
    line-height: 1.6;
}

.ebooksar-reader-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-height: 52px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    color: #6b7280;
    font-size: 1.01rem;
    text-align: center;
}

.ebooksar-reader-fallback a {
    color: #1464f4;
    font-weight: 750;
}

.ebooksar-reader-error {
    max-width: 620px;
    margin: 12vh auto 0;
    padding: 40px 28px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
    text-align: center;
}

.ebooksar-reader-error__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #fff3d6;
    color: #a36a00;
    font-weight: 800;
}

.ebooksar-reader-error h1 {
    margin: 0 0 7px;
    font-size: 1.25rem;
}

.ebooksar-reader-error p {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 1.13rem;
}

.ebooksar-reader-error a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    border-radius: 9px;
    background: #1464f4;
    color: #fff;
    text-decoration: none;
    font-size: 1.07rem;
    font-weight: 750;
}

.ebooksar-reader-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 48px;
    padding: 8px 14px;
    color: #7b8491;
    font-size: 0.95rem;
}

.ebooksar-reader-footer a {
    color: #566171;
    font-weight: 750;
    text-decoration: none;
}

@media (max-width: 700px) {
    .ebooksar-reader-header__inner {
        width: min(calc(100% - 22px), var(--es-container));
        min-height: 52px;
    }

    .ebooksar-reader-header__label {
        display: none;
    }

    .ebooksar-reader-main {
        min-height: calc(100vh - 52px);
        padding: 10px 0 18px;
    }

    .ebooksar-reader-shell {
        width: calc(100% - 12px);
    }

    .ebooksar-reader-toolbar {
        min-height: 62px;
        padding: 10px 11px;
        gap: 10px;
        border-radius: 11px 11px 0 0;
    }

    .ebooksar-reader-toolbar h1 {
        font-size: .84rem;
        line-height: 1.45;
    }

    .ebooksar-reader-toolbar__kicker {
        font-size: 0.87rem;
    }

    .ebooksar-reader-back {
        width: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 0;
    }

    .ebooksar-reader-back span:first-child {
        font-size: 1.25rem;
    }

    .ebooksar-reader-viewer {
        display: none;
    }

    .ebooksar-reader-mobile {
        display: block;
        padding: 30px 18px 28px;
        background: #fff;
        border: 1px solid #dfe4ea;
        border-radius: 0 0 11px 11px;
        box-shadow: 0 8px 22px rgba(15,23,42,.05);
        text-align: center;
    }

    .ebooksar-reader-fallback {
        display: none;
    }
}

@media (max-width: 420px) {
    .ebooksar-reader-mobile {
        padding-inline: 14px;
    }
}
