/*
 * Reading experience enhancements (Sprint 52) — additive, News360-safe.
 * Loaded only on the article page. All interactive JS lives in
 * public/js/reading-experience.js. No CSS framework changed.
 */
:root {
    --rx-accent: #f0563a; /* thin accent for the progress bar / toolbar */
}

/* 1) Reading progress bar — fixed, thin, above the header. No layout shift. */
.rx-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 2000;
    pointer-events: none;
}
.rx-progress__bar {
    height: 100%;
    width: 0;
    background: var(--rx-accent);
    transition: width 0.1s linear;
}

/* 2) Remaining reading time — small pill, appears while reading. */
.rx-remaining {
    position: fixed;
    right: 16px;
    bottom: 76px;
    z-index: 1999;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 20px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.rx-remaining.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4) Code block toolbar — overlays the pre corner (no layout shift / no CLS). */
.dlab-post-text pre {
    position: relative;
}
.rx-code-toolbar {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}
.rx-code-lang {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c9d1d9;
    opacity: 0.85;
}
.rx-copy-btn {
    font-size: 12px;
    color: #c9d1d9;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 3px 9px;
    cursor: pointer;
    line-height: 1.2;
}
.rx-copy-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}
.rx-copy-btn.is-copied {
    color: #fff;
    background: rgba(46, 160, 67, 0.85);
    border-color: rgba(46, 160, 67, 0.9);
}

/* 5) Image lightbox — full-screen overlay, built on demand (no initial CLS). */
.dlab-post-text img {
    cursor: zoom-in;
}
.rx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
}
.rx-lightbox[hidden] {
    display: none;
}
.rx-lightbox__img {
    max-width: 92vw;
    max-height: 88vh;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
}
.rx-lightbox__btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
}
.rx-lightbox__btn:hover {
    background: rgba(255, 255, 255, 0.28);
}
.rx-lightbox__close {
    top: 20px;
    right: 20px;
}
.rx-lightbox__prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.rx-lightbox__next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* 7) Helpful widget — "Bu içerik faydalı oldu mu?" (UI only, no persistence). */
.rx-helpful {
    text-align: center;
    padding: 26px 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 50px;
}
.rx-helpful__btns {
    display: inline-flex;
    gap: 12px;
    margin-top: 12px;
}
.rx-helpful__btn {
    font-size: 20px;
    background: #f6f6f6;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 8px 18px;
    cursor: pointer;
}
.rx-helpful__btn:hover {
    background: #efefef;
}
.rx-helpful__btn.is-selected {
    background: var(--rx-accent);
    border-color: var(--rx-accent);
}
.rx-helpful__thanks {
    margin-top: 14px;
    color: #2ea043;
    font-weight: 600;
}

/* 9) Sticky article TOC (desktop only; the column is hidden < lg via markup). */
.rx-toc.sticky-top {
    top: 90px;
}

/* The TOC uses its own class (rx-toc-widget, set in post.blade) so News360's
   .widget_categories float/inline + hover-padding-shift rules never apply.
   Fully self-contained: one item per row, stable hover (colour only, no jump),
   long headings wrap cleanly. News360 core CSS untouched. */
.rx-toc-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.rx-toc-widget ul li {
    display: block;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}
.rx-toc-widget ul li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #323234;
    font-size: 15px;
    line-height: 1.45;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.rx-toc-widget ul li a:hover {
    background-color: var(--bg-color);
    color: #fff;
}

/* 10) Wider, balanced reading width (News360 .min-container was 750px, which
   left the article + TOC boxed with large empty side margins). Widen on large
   screens only; text column stays a comfortable reading measure and the TOC
   gets room. Scoped to the article page (this stylesheet loads only here);
   News360 core CSS (style.css/templete.css) is untouched. */
@media (min-width: 992px) {
    .min-container {
        max-width: 1140px;
    }

    /* Pin the article to a comfortable measure (~68-75 characters at 17px).
       The 8/12 column inside .min-container is ~730px wide, so this caps the
       line length deterministically instead of leaving it to grid maths. */
    [data-rx-article] {
        max-width: 720px;
    }
}

/* 11) Meta line — one quiet row above the title, not four competing labels. */
.rx-post-meta ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}
.rx-post-meta ul li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    float: none;
    color: #77777c;
    font-size: 13px;
    line-height: 1.4;
}
/* Dot separator between items (not before the first). */
.rx-post-meta ul li + li::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #c4c4c8;
    margin-right: 14px;
}
.rx-post-meta .post-category a {
    color: var(--bg-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* 12) Vertical rhythm — everything in the article body spaced off one scale,
   so headings group with the text they introduce instead of floating. */
[data-rx-article] .title {
    line-height: 1.25;
    margin-bottom: 24px;
}
.dlab-post-text {
    font-size: 17px;
    line-height: 1.75;
    color: #2f2f31;
}
.dlab-post-text p {
    margin-bottom: 1.5em;
}
.dlab-post-text > p.lead {
    font-size: 19px;
    line-height: 1.65;
    color: #55555a;
    margin-bottom: 1.6em;
}
.dlab-post-text h2,
.dlab-post-text h3,
.dlab-post-text h4 {
    line-height: 1.3;
    margin-bottom: 0.6em;
}
.dlab-post-text h2 {
    margin-top: 2.2em;
}
.dlab-post-text h3,
.dlab-post-text h4 {
    margin-top: 1.8em;
}
.dlab-post-text ul,
.dlab-post-text ol {
    margin-bottom: 1.5em;
}
.dlab-post-text li {
    margin-bottom: 0.5em;
}
.dlab-post-text blockquote,
.dlab-post-text pre,
.dlab-post-text img,
.dlab-post-text table {
    margin-top: 1.75em;
    margin-bottom: 1.75em;
}

/* TOC jumps land below the sticky header instead of under it. */
.dlab-post-text h2[id],
.dlab-post-text h3[id] {
    scroll-margin-top: 100px;
}
