/*
 * Joy News Suite — Single Article Styles
 * BUG FIX #4: Desktop width & related posts section
 */

/* ── Single Post Layout Fix ─────────────────────────────────────────────── */

/* Content column সর্বোচ্চ width নিশ্চিত করো */
.single-post .site-main,
.single-post main.site-main,
.single-post #main,
body.single-post .content-area {
    min-height: 60vh; /* ছোট content হলেও page খালি দেখাবে না */
}

/* Article content width ভালো করা */
.single-post article .entry-content,
.single-post article .post-content,
.single-post .single-content {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.9;
    font-size: 1.05rem;
}

/* Featured image full width */
.single-post .post-thumbnail,
.single-post .featured-image,
.single-post article > .wp-post-image {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 24px;
}

.single-post .post-thumbnail img,
.single-post .featured-image img,
.single-post article > .wp-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Short post হলে sidebar fill করার জন্য */
.single-post .content-area {
    flex: 1;
    min-height: 500px;
}

/* ── Related Posts Section ───────────────────────────────────────────────── */

.jns-related-posts {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #f0f0f0;
    clear: both;
}

.jns-related-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.jns-related-line {
    display: block;
    width: 4px;
    height: 28px;
    background: var(--jns-accent, #FD0000);
    border-radius: 2px;
    flex-shrink: 0;
}

.jns-related-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--jns-text, #1a1a2e);
    line-height: 1.3;
}

.jns-related-cat-label {
    color: var(--jns-accent, #FD0000);
}

/* Grid layout */
.jns-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .jns-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .jns-related-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual related post card */
.jns-related-item {
    background: var(--jns-bg-card, #ffffff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.jns-related-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

/* Thumbnail */
.jns-related-thumb-link {
    display: block;
    text-decoration: none;
}

.jns-related-thumb {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f0f0f0;
    transition: transform .3s;
}

.jns-related-item:hover .jns-related-thumb {
    transform: scale(1.04);
}

/* Body */
.jns-related-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Category badge */
.jns-related-badge {
    display: inline-block;
    background: var(--jns-accent, #FD0000);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .4px;
    align-self: flex-start;
}

/* Post title */
.jns-related-post-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
}

.jns-related-post-title a {
    color: var(--jns-text, #1a1a2e);
    text-decoration: none;
}

.jns-related-post-title a:hover {
    color: var(--jns-accent, #FD0000);
}

/* Meta */
.jns-related-meta {
    font-size: 12px;
    color: var(--jns-muted, #888);
}

/* ── Short article — minimum page height ────────────────────────────────── */

/* Content area যদি খুব ছোট হয় */
.single-post #primary,
.single-post .content-area {
    min-height: 70vh;
}

/* ── Single Article: Canvas Extend (no crop) ─────────────────────────────── */
.single-post .post-thumbnail,
.single-post .featured-image,
.single-post article .wp-post-image {
    position: relative;
    overflow: hidden;
    max-height: 520px;
    border-radius: var(--jns-radius, 8px);
    background: var(--jns-surface, #f0f0f0);
}

/* Blurred background */
.single-post .post-thumbnail::before,
.single-post .featured-image::before {
    content: '';
    position: absolute;
    inset: -24px;
    background-image: var(--jns-bg-img);
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(0.45) saturate(1.3);
    z-index: 0;
}

/* Image contains without cropping */
.single-post .post-thumbnail img,
.single-post .featured-image img,
.single-post .wp-post-image {
    position: relative !important;
    z-index: 1;
    width: 100%;
    max-height: 520px;
    object-fit: contain !important;
    object-position: center;
    display: block;
}
