/* ============ ONLINE KİTAP OKUYUCU ============ */
.nt-reader-body {
    background: #171310;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.reader-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(216, 176, 139, .08), transparent 60%),
        #171310;
    color: var(--text, #f7f3ef);
    font-family: var(--sans, Inter, sans-serif);
}

/* Üst bar */
.reader-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .55rem .9rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(23, 19, 16, .92);
    z-index: 20;
}
.reader-title {
    flex: 1;
    text-align: center;
    font-family: var(--serif, Georgia, serif);
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reader-top-actions { display: flex; align-items: center; gap: .6rem; }
.reader-page-indicator { font-size: .82rem; color: var(--muted, #d2c4b4); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: .3rem; }
#readerPageInput {
    width: 48px; height: 30px;
    text-align: center;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    color: var(--text, #f7f3ef);
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}
#readerPageInput::-webkit-outer-spin-button,
#readerPageInput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#readerPageInput:focus { outline: none; border-color: rgba(216,176,139,.6); }
.reader-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: var(--text, #f7f3ef); cursor: pointer; text-decoration: none;
    font-size: 1.05rem; line-height: 1;
    transition: background .2s ease, border-color .2s ease;
}
.reader-icon:hover { background: rgba(216,176,139,.14); border-color: rgba(216,176,139,.4); }

/* Sahne */
.reader-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem .5rem;
    min-height: 0;
    overflow: hidden;
}
.reader-sheet-wrap {
    position: relative;
    flex: 1;
    max-width: 900px;
    min-width: 0;
    align-self: stretch;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .12s ease;
}
.reader-sheet-wrap.fade-out { opacity: 0; }
.reader-sheet-wrap.fade-in { animation: readerFadeIn .18s ease; }
@keyframes readerFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sayfa navigasyon okları (içeriğin üzerinde, yanlarda yüzer) */
.reader-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px; height: 64px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: var(--muted, #d2c4b4);
    font-size: 2rem; line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.reader-nav-prev { left: .5rem; }
.reader-nav-next { right: .5rem; }
.reader-nav:hover:not(.disabled) { background: rgba(216,176,139,.15); color: var(--warm, #d8b08b); }
.reader-nav.disabled { opacity: .25; cursor: default; }

/* Özet sayfası */
.reader-summary {
    width: min(560px, 92%);
    max-height: 100%;
    overflow-y: auto;
    text-align: center;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(180deg, rgba(39,31,25,.9), rgba(18,15,13,.85));
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.summary-cover {
    display: flex;
    justify-content: center;
    gap: .9rem;
    margin: 0 0 1rem;
}
.summary-cover img {
    width: 150px; height: 225px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.summary-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .2rem; letter-spacing: -.01em; }
.summary-author { color: var(--warm, #d8b08b); font-size: 1rem; margin: 0 0 1rem; }
.summary-rule { width: 64px; height: 1px; background: rgba(216,176,139,.5); margin: 0 auto 1rem; }
.summary-eyebrow { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--warm, #d8b08b); margin: 0 0 .5rem; }
.summary-text { color: var(--muted, #d2c4b4); line-height: 1.8; max-width: 48ch; margin: 0 auto 1rem; white-space: pre-line; }
.summary-meta { color: var(--muted, #d2c4b4); font-size: .85rem; margin-bottom: 1.4rem; }
.summary-next { margin-top: .4rem; }

/* PDF sayfası */
.reader-page {
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}
.reader-page[hidden] { display: none !important; }
.reader-page canvas {
    display: block;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0; /* yakınlaşınca canvas sıkışmasın, taşıp kaydırılabilsin */
}

/* Yükleme */
.reader-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .8rem; color: var(--muted, #d2c4b4);
}
.reader-loading[hidden] { display: none; }
.spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(216,176,139,.2);
    border-top-color: var(--warm, #d8b08b);
    animation: readerSpin .8s linear infinite;
}
@keyframes readerSpin { to { transform: rotate(360deg); } }

/* Alt bar */
.reader-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem .9rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(23, 19, 16, .92);
    z-index: 20;
}
.reader-dots { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: center; }
.reader-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .2s ease; }
.reader-dots .dot.active { background: var(--warm, #d8b08b); }

/* İlerleme */
.reader-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 40; }
.reader-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d4a56a, #d8b08b); transition: width .2s ease; }

/* Tam ekran */
.reader-app:fullscreen { background: #0f0c0a; }

/* Kopyalama koruması (sadece reader) */
.reader-app { -webkit-user-select: none; user-select: none; }
.reader-app img, .reader-app canvas { -webkit-user-drag: none; pointer-events: none; }

/* Mobil */
@media (max-width: 640px) {
    .reader-nav { width: 36px; height: 54px; font-size: 1.6rem; }
    .reader-nav-prev { left: .3rem; }
    .reader-nav-next { right: .3rem; }
    .reader-title { font-size: .95rem; }
    .reader-bottombar { padding: .5rem .6rem; }
    .reader-dots { max-width: 60vw; }
    .reader-dots .dot { width: 5px; height: 5px; }
    .reader-summary { padding: 1.1rem 1.2rem; }
    .summary-cover img { width: 120px; height: 180px; }
}

/* ============ OKUR YORUMLARI (okuyucunun altında) ============ */
.reader-comments {
    background: #120f0d;
    color: var(--text, #f7f3ef);
    padding: 3rem 1.25rem 4rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.reader-comments-inner { max-width: 860px; margin: 0 auto; }
.reader-comments-head { margin-bottom: 2rem; }
.reader-comments-head h2 { font-family: var(--serif, Georgia, serif); font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.reader-comments-closed { color: var(--muted, #d2c4b4); }
.reader-comments .comment-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.reader-comments .comment-list .children { list-style: none; margin: 1rem 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.reader-comments .comment-body {
    background: linear-gradient(180deg, rgba(39,31,25,.75), rgba(18,15,13,.6));
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 20px; padding: 1.2rem 1.3rem;
}
.reader-comments .comment-list .avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(216,176,139,.35); margin-right: .7rem; vertical-align: middle; }
.reader-comments .comment-list .fn { font-weight: 600; font-size: .95rem; }
.reader-comments .comment-list .comment-metadata { color: var(--muted, #d2c4b4); font-size: .78rem; margin: .2rem 0 .6rem; }
.reader-comments .comment-list .comment-content { color: var(--muted, #d2c4b4); line-height: 1.7; }
.reader-comments .comment-list .comment-content p { color: var(--muted, #d2c4b4); margin: 0; }
.reader-comments .comment-form label { display: block; color: var(--muted, #d2c4b4); font-size: .9rem; margin: 0 0 .3rem; }
.reader-comments .comment-form input[type="text"],
.reader-comments .comment-form input[type="email"],
.reader-comments .comment-form input[type="url"],
.reader-comments .comment-form textarea {
    width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border, rgba(255,255,255,.08));
    color: var(--text, #f7f3ef); border-radius: 10px; padding: .6rem .7rem; font-family: inherit; font-size: .9rem;
}
.reader-comments .comment-form input:focus, .reader-comments .comment-form textarea:focus { outline: none; border-color: rgba(216,176,139,.55); }
.reader-comments .comment-form .submit {
    background: linear-gradient(135deg, var(--gold,#d4a56a), var(--warm,#d8b08b)); color: #1a120e;
    border: none; border-radius: 999px; padding: .7rem 1.4rem; font-weight: 600; cursor: pointer;
}
.reader-comments .comment-form p { margin: 0 0 1rem; }
.reader-comments .comment-form .nt-comment-rating { display: flex; align-items: center; gap: .8rem; }

/* ============ YAKINLAŞTIRMA (büyüt/küçült/sıfırla) ============ */
.reader-zoom { display: inline-flex; align-items: center; gap: .3rem; }
.reader-zoom-level { min-width: 44px; text-align: center; font-size: .75rem; color: var(--muted, #d2c4b4); font-variant-numeric: tabular-nums; }
.reader-zoom-reset {
    display: inline-flex; align-items: center; justify-content: center;
    height: 34px; padding: 0 .7rem; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
    color: var(--text, #f7f3ef); font-size: .78rem; cursor: pointer; white-space: nowrap;
    transition: background .2s ease, border-color .2s ease;
}
.reader-zoom-reset:hover { background: rgba(216,176,139,.14); border-color: rgba(216,176,139,.4); }
.reader-zoom .reader-icon:disabled, .reader-zoom-reset:disabled { opacity: .35; pointer-events: none; }

/* Büyütünce sayfa gerçek boyutta görünsün ve kaydırılabilsin (çözünürlük bozulmaz) */
.reader-page { overflow: hidden; }
.reader-page.is-zoomed { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.reader-page.is-zoomed canvas { max-width: none; max-height: none; }

/* Mobil: sıkışmayı önle */
@media (max-width: 640px) {
    .reader-zoom-level { display: none; }
    .reader-top-actions { gap: .35rem; }
    .reader-zoom-reset { padding: 0 .5rem; font-size: .72rem; }
}

/* ============ DOKUNMA (çift parmak zoom + sürükleyip kaydırma) ============ */
/* Sayfa alanında tarayıcının doğal kıstırma/kaydırmasını devre dışı bırak → JS yönetsin */
.reader-page { touch-action: none; }

/* ============ SAYFA ÇEVİRME EFEKTİ ============ */
.reader-stage { perspective: 2000px; }
.reader-sheet-wrap { backface-visibility: hidden; transform-style: preserve-3d; }
.reader-sheet-wrap.flip-out-next { transform-origin: left center; animation: readerFlipOutNext .4s cubic-bezier(.4,0,.2,1) forwards; }
.reader-sheet-wrap.flip-out-prev { transform-origin: right center; animation: readerFlipOutPrev .4s cubic-bezier(.4,0,.2,1) forwards; }
.reader-sheet-wrap.flip-in-next { transform-origin: left center; animation: readerFlipInNext .4s cubic-bezier(.4,0,.2,1) forwards; }
.reader-sheet-wrap.flip-in-prev { transform-origin: right center; animation: readerFlipInPrev .4s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes readerFlipOutNext { from { transform: rotateY(0); } to { transform: rotateY(-90deg); } }
@keyframes readerFlipOutPrev { from { transform: rotateY(0); } to { transform: rotateY(90deg); } }
@keyframes readerFlipInNext { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@keyframes readerFlipInPrev { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .reader-sheet-wrap.flip-out-next, .reader-sheet-wrap.flip-out-prev,
    .reader-sheet-wrap.flip-in-next, .reader-sheet-wrap.flip-in-prev { animation: none; }
}
