/* ══════════════════════════════════════════════════════════════
   BPC Traffic Booster — Frontend Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Reading Progress Bar ── */
.bpctb-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c5ce7, #a855f7);
    z-index: 999999;
    transition: width 0.15s ease;
    width: 0;
}

/* ── Related Posts Grid ── */
.bpctb-related-posts {
    margin: 40px 0 20px;
    padding: 24px 0 0;
    border-top: 2px solid #f0f0f0;
}

.bpctb-related-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px;
}

.bpctb-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.bpctb-related-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bpctb-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.bpctb-related-thumb {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}

.bpctb-related-thumb.bpctb-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 32px;
}

.bpctb-related-info {
    padding: 14px;
}

.bpctb-related-info h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bpctb-related-date {
    font-size: 12px;
    color: #999;
}

/* ── "Read Next" Floating Bar ── */
.bpctb-readnext-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    height: 60px;
}

.bpctb-readnext-hidden {
    transform: translateY(100%);
}

.bpctb-readnext-visible {
    transform: translateY(0);
}

.bpctb-readnext-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.bpctb-readnext-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.bpctb-readnext-text {
    min-width: 0;
}

.bpctb-readnext-label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.bpctb-readnext-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bpctb-readnext-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    flex-shrink: 0;
}

.bpctb-readnext-close:hover {
    color: #333;
}

/* ── Auto-link styling ── */
a.bpctb-auto-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

/* ── Updated notice ── */
.bpctb-updated-notice {
    font-size: 14px;
}

/* ── Mobile Responsive ── */
@media (max-width: 600px) {
    .bpctb-related-grid {
        grid-template-columns: 1fr;
    }

    .bpctb-readnext-bar {
        height: 54px;
    }
}

/* ── Divi 5 Compatibility ── */

/* Progress bar above Divi fixed header */
.et-l .bpctb-progress-bar,
.et_divi_theme .bpctb-progress-bar {
    z-index: 1000001;
}

/* Read-next bar above Divi footer elements */
.et-l .bpctb-readnext-bar,
.et_divi_theme .bpctb-readnext-bar {
    z-index: 100000;
}

/* Related posts inside Divi content area */
.et_pb_post_content .bpctb-related-posts,
.et_builder_inner_content .bpctb-related-posts {
    clear: both;
}

/* Updated notice Divi spacing fix */
.et_pb_post_content .bpctb-updated-notice,
.et_builder_inner_content .bpctb-updated-notice {
    margin-left: 0;
    margin-right: 0;
}
