/* ═══════════════════════════════════════════════════════
   Content Upgrades Stylesheet
   TOC, reading progress, sticky links, FAQ, countdown,
   reading toolbar, recently-added strip, continue reading
   ═══════════════════════════════════════════════════════ */

/* ── Reading progress bar ── */
.cu-progress {
    position: fixed;
    top: 0; left: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--primary, #9e0000), #ff6b6b);
    z-index: 10001;
    transition: width 0.1s linear;
    will-change: width;
}

/* ── Reading toolbar (font size / print) ── */
.cu-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 20px 0;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.cu-toolbar .cu-tb-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: auto;
}
.cu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.cu-btn:hover { border-color: var(--primary, #9e0000); color: var(--primary, #9e0000); }
.cu-btn.active { background: var(--primary, #9e0000); color: #fff; border-color: var(--primary, #9e0000); }

/* Font-size steps applied to the article body */
.post-full-content.cu-fs-1 { font-size: 1.15rem; }
.post-full-content.cu-fs-2 { font-size: 1.28rem; line-height: 2; }

/* ── Table of Contents ── */
.cu-toc {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary, #9e0000);
    border-radius: 10px;
    padding: 4px 6px;
    margin: 0 0 25px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cu-toc-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}
.cu-toc-toggle i.fa-list-ul { color: var(--primary, #9e0000); margin-right: 8px; }
.cu-toc-caret { transition: transform 0.2s; color: #94a3b8; }
.cu-toc.collapsed .cu-toc-caret { transform: rotate(180deg); }
.cu-toc-list {
    margin: 0;
    padding: 4px 14px 14px 34px;
    max-height: 460px;
    overflow: auto;
}
.cu-toc.collapsed .cu-toc-list { display: none; }
.cu-toc-list li { margin: 7px 0; line-height: 1.4; }
.cu-toc-list li.cu-toc-sub { margin-left: 16px; list-style: circle; }
.cu-toc-list a { color: #475569; text-decoration: none; font-size: 0.93rem; }
.cu-toc-list a:hover { color: var(--primary, #9e0000); text-decoration: underline; }
.cu-toc-list a.cu-active { color: var(--primary, #9e0000); font-weight: 700; }

/* Offset anchored headings so they aren't hidden under sticky bars */
.post-body h2[id], .post-body h3[id] { scroll-margin-top: 90px; }

/* ── Last-date countdown banner ── */
.cu-countdown {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 25px 0;
    padding: 16px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.25);
}
.cu-countdown .cu-cd-label {
    font-weight: 700;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cu-countdown .cu-cd-timer {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.cu-cd-unit {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    min-width: 52px;
}
.cu-cd-unit b { display: block; font-size: 1.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cu-cd-unit span { font-size: 0.66rem; text-transform: uppercase; opacity: 0.85; letter-spacing: 0.5px; }
.cu-countdown.cu-expired { background: linear-gradient(135deg, #334155 0%, #475569 100%); box-shadow: none; }

/* ── Sticky / highlighted Important Links CTA ── */
.info-box.links-box { position: relative; }
.info-box.links-box::before {
    content: 'IMPORTANT';
    position: absolute;
    top: 10px; right: 12px;
    background: #fde68a;
    color: #92400e;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}
.cu-quick-apply {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid var(--primary, #9e0000);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.cu-quick-apply .cu-qa-text { font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.cu-quick-apply a.cu-qa-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(220,38,38,0.35);
    transition: transform 0.15s;
    white-space: nowrap;
}
.cu-quick-apply a.cu-qa-btn:hover { transform: translateY(-2px); }

/* ── FAQ accordion ── */
.cu-faq-list { padding: 4px 0 0 0 !important; }
.cu-faq-item {
    border-bottom: 1px solid #fca5a5;
    background: #fff;
}
.cu-faq-item:last-child { border-bottom: none; }
.cu-faq-q {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    font-weight: 700;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 10px;
    outline: none;
}
.cu-faq-q::-webkit-details-marker { display: none; }
.cu-faq-q::before {
    content: '\f067'; /* plus */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #dc2626;
    font-size: 0.85rem;
    transition: transform 0.2s;
}
.cu-faq-item[open] .cu-faq-q::before { content: '\f068'; /* minus */ }
.cu-faq-a { padding: 0 18px 16px 40px; color: #1e293b; line-height: 1.7; }
.cu-faq-a table { width: 100%; }

/* ── Recently added strip (homepage) ── */
.cu-recent-strip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cu-recent-strip .cu-rs-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 14px;
}
.cu-recent-strip .cu-rs-head i { color: #dc2626; }
.cu-rs-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.cu-rs-card {
    scroll-snap-align: start;
    flex: 0 0 260px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    text-decoration: none;
    color: #334155;
    transition: all 0.15s;
    background: #f8fafc;
}
.cu-rs-card:hover { border-color: var(--primary, #9e0000); transform: translateY(-2px); }
.cu-rs-cat {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: var(--primary, #9e0000);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.cu-rs-title { font-weight: 600; font-size: 0.92rem; line-height: 1.4; }
.cu-rs-time { font-size: 0.75rem; color: #94a3b8; margin-top: 8px; }

/* ── Category stat badges (homepage) ── */
.cu-cat-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.cu-cat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary, #9e0000);
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    transition: all 0.15s;
}
.cu-cat-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.cu-cat-chip .cu-cc-name { font-weight: 600; font-size: 0.9rem; text-transform: capitalize; }
.cu-cat-chip .cu-cc-count {
    font-weight: 800;
    background: #fef2f2;
    color: #b91c1c;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.85rem;
}

/* ── Continue reading (homepage, JS-filled) ── */
#cuContinueReading { display: none; }

/* ── Empty-state suggestions ── */
.cu-suggest {
    margin-top: 22px;
    text-align: left;
}
.cu-suggest h4 {
    font-size: 0.95rem;
    color: #475569;
    margin: 0 0 12px 0;
}
.cu-suggest ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cu-suggest li a {
    display: block;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    font-size: 0.9rem;
}
.cu-suggest li a:hover { border-color: var(--primary, #9e0000); color: var(--primary, #9e0000); }

/* ── Threaded comments / reply UI ── */
.cu-comment-actions { margin-top: 8px; display: flex; gap: 14px; align-items: center; }
.cu-comment-actions button {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}
.cu-comment-actions button:hover { color: var(--primary, #9e0000); }
.cu-comment-actions button.liked { color: var(--primary, #9e0000); }
.comment-item .comment-item { margin-left: 28px; margin-top: 12px; background: #f8fafc !important; }
.cu-reply-box { margin: 10px 0 0 28px; display: none; }
.cu-reply-box.open { display: block; }
.cu-reply-box input, .cu-reply-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: inherit;
}

@media (max-width: 768px) {
    .cu-countdown .cu-cd-timer { margin-left: 0; width: 100%; }
    .cu-quick-apply { flex-direction: column; align-items: stretch; }
    .cu-quick-apply a.cu-qa-btn { margin-left: 0; text-align: center; }
}

@media print {
    .cu-progress, .cu-toolbar, .cu-toc, .cu-countdown, .cu-quick-apply { display: none !important; }
}
