/* =============================================
 *  JR Homepage Layout — Africa Radio Style
 * ============================================= */

.jr-homepage-layout { max-width: 1200px; margin: 0 auto; font-family: var(--jr-font); }
.jr-homepage-layout a { text-decoration: none !important; color: inherit !important; }
.jr-homepage-layout a:hover .jr-hp-title { color: var(--jr-accent) !important; }
.jr-homepage-layout img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Section ── */
.jr-hp-section { padding: 32px 0; }
.jr-hp-section--gray { background: #f5f5f5; padding: 32px 20px; margin: 0 -20px; }

/* ── Headings ── */
.jr-hp-heading { font-size: 22px; font-weight: 800; color: #1a1a2e; margin: 0 0 24px; text-transform: uppercase; letter-spacing: 0.5px; }
.jr-hp-heading--sm { font-size: 18px; margin-bottom: 16px; }
.jr-hp-heading--border { padding-bottom: 10px; border-bottom: 3px solid #1a1a2e; display: inline-block; margin-bottom: 24px; }

/* ── Titles ── */
.jr-hp-title { margin: 0; line-height: 1.3; transition: color 0.2s ease; }
.jr-hp-title--lg { font-size: 22px; font-weight: 700; margin-top: 10px; }
.jr-hp-title--md { font-size: 17px; font-weight: 600; margin-top: 8px; }
.jr-hp-title--sm { font-size: 14px; font-weight: 600; margin-top: 8px; }

/* ── Badge ── */
.jr-hp-badge { display: inline-block; padding: 3px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: #E94560; color: #fff !important; border-radius: 3px; margin-top: 8px; }

/* ── Meta / Excerpt ── */
.jr-hp-meta { display: block; font-size: 12px; color: #888; margin-top: 4px; }
.jr-hp-excerpt { font-size: 14px; color: #555; line-height: 1.6; margin: 8px 0 0; }

/* ── Image wrappers ── */
.jr-hp-img-wrap { border-radius: 4px; overflow: hidden; }
.jr-hp-img-wrap img { transition: transform 0.3s ease; }
.jr-hp-img-wrap:hover img { transform: scale(1.03); }

/* ═══════════════════════════════
 *  FEATURED SECTION (top)
 * ═══════════════════════════════ */
.jr-hp-featured { display: grid; grid-template-columns: 1fr 1fr 280px; gap: 20px; padding: 24px 0; border-bottom: 1px solid #e8e8e8; }
.jr-hp-featured-main .jr-hp-featured-img { height: 300px; border-radius: 4px; overflow: hidden; }
.jr-hp-featured-side { display: flex; flex-direction: column; gap: 16px; }
.jr-hp-featured-side-item { display: block; }
.jr-hp-thumb-sm { height: 140px; border-radius: 4px; overflow: hidden; }

/* Live feed — 5 visible, rest scrollable */
.jr-hp-live-feed { border-left: 1px solid #e8e8e8; padding-left: 20px; display: flex; flex-direction: column; }
.jr-hp-feed-scroll { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }
.jr-hp-feed-scroll::-webkit-scrollbar { width: 4px; }
.jr-hp-feed-scroll::-webkit-scrollbar-track { background: transparent; }
.jr-hp-feed-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
.jr-hp-feed-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; line-height: 1.4; flex-shrink: 0; transition: background 0.15s ease; }
.jr-hp-feed-item:last-child { border-bottom: none; }
.jr-hp-feed-item:hover { background: #fafafa; padding-left: 4px; }
.jr-hp-feed-date { font-weight: 700; color: #E94560; flex-shrink: 0; min-width: 40px; font-size: 12px; }
.jr-hp-feed-title { color: #333; font-weight: 500; }

/* ═══════════════════════════════
 *  LATEST NEWS
 * ═══════════════════════════════ */
.jr-hp-latest-top { display: grid; grid-template-columns: 1fr 300px; gap: 32px; margin-bottom: 24px; }
.jr-hp-latest-main .jr-hp-img-wrap { height: 280px; }

/* Most Read */
.jr-hp-most-read { border-left: 1px solid #e8e8e8; padding-left: 24px; }
.jr-hp-mr-list { list-style: none; margin: 0; padding: 0; counter-reset: mr; }
.jr-hp-mr-list li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.jr-hp-mr-list li a { display: flex; gap: 12px; align-items: flex-start; }
.jr-hp-rank { font-size: 24px; font-weight: 800; color: #E94560; line-height: 1; min-width: 24px; opacity: 0.7; }
.jr-hp-mr-title { font-size: 13px; font-weight: 500; color: #333; line-height: 1.4; }

/* ═══════════════════════════════
 *  CARD ROW (3 columns)
 * ═══════════════════════════════ */
.jr-hp-card-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.jr-hp-card { display: block; }
.jr-hp-card-img { height: 160px; border-radius: 4px; overflow: hidden; }
.jr-hp-card-img img { transition: transform 0.3s ease; }
.jr-hp-card:hover .jr-hp-card-img img { transform: scale(1.03); }

/* ═══════════════════════════════
 *  CATEGORY BLOCK
 * ═══════════════════════════════ */
.jr-hp-cat-top { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.jr-hp-cat-main .jr-hp-img-wrap { height: 260px; }
.jr-hp-cat-side .jr-hp-img-wrap { height: 200px; }

/* ═══════════════════════════════
 *  CAROUSEL (Programs / Podcasts)
 * ═══════════════════════════════ */
.jr-hp-carousel-wrap { position: relative; overflow: hidden; }
.jr-hp-carousel { display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; padding: 4px 0 12px; }
.jr-hp-carousel::-webkit-scrollbar { display: none; }

.jr-hp-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: #fff !important; box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important; border: none !important; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; transition: background 0.2s ease; }
.jr-hp-arrow:hover { background: #FFD700 !important; }
.jr-hp-arrow--prev { left: 4px; }
.jr-hp-arrow--next { right: 4px; }
.jr-hp-arrow svg { fill: #1a1a2e; }

/* Program card */
.jr-hp-program-card { flex-shrink: 0; width: 220px; display: block; }
.jr-hp-program-img { height: 180px; border-radius: 8px; overflow: hidden; background: #FFD700; }
.jr-hp-program-img img { border-radius: 8px; }
.jr-hp-program-info { padding: 8px 0; }

/* Podcast card */
.jr-hp-podcast-card { flex-shrink: 0; width: 200px; display: block; }
.jr-hp-podcast-img { height: 200px; border-radius: 8px; overflow: hidden; }
.jr-hp-podcast-img img { border-radius: 8px; }

/* ═══════════════════════════════
 *  EMPTY STATE
 * ═══════════════════════════════ */
.jr-homepage-layout .jr-empty { text-align: center; padding: 60px 20px; color: #999; font-size: 15px; background: #f9f9f9; border-radius: 8px; }

/* ═══════════════════════════════
 *  MERCH GRID (masonry-like)
 * ═══════════════════════════════ */
.jr-homepage-layout .jr-hp-merch-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-rows: 200px !important;
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Make some items span 2 rows for masonry effect */
.jr-homepage-layout .jr-hp-merch-item:nth-child(1) { grid-row: span 2; }
.jr-homepage-layout .jr-hp-merch-item:nth-child(4) { grid-row: span 2; }
.jr-homepage-layout .jr-hp-merch-item:nth-child(7) { grid-row: span 2; }

.jr-homepage-layout .jr-hp-merch-item {
    position: relative !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: block !important;
    background: #f0f0f0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.jr-homepage-layout .jr-hp-merch-img {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
}

.jr-homepage-layout .jr-hp-merch-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.4s ease;
}

.jr-hp-merch-item:hover .jr-hp-merch-img img {
    transform: scale(1.05);
}

/* Hover overlay with name + price */
.jr-homepage-layout .jr-hp-merch-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jr-homepage-layout .jr-hp-merch-item:hover .jr-hp-merch-overlay {
    opacity: 1;
}

.jr-hp-merch-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
    line-height: 1.3;
}

.jr-hp-merch-price {
    font-size: 12px;
    color: #FFD700 !important;
    font-weight: 700;
}

/* ═══════════════════════════════
 *  CONTENT + SIDEBAR BANNERS (like Africa Radio right column)
 * ═══════════════════════════════ */
.jr-hp-content-with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.jr-hp-content-main { min-width: 0; }
.jr-hp-sidebar-banners { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; align-self: start; }

.jr-hp-banner { border-radius: 8px; overflow: hidden; }
.jr-hp-banner-img { width: 100% !important; height: auto !important; display: block; border-radius: 8px; transition: opacity 0.2s ease; }
.jr-hp-banner a:hover .jr-hp-banner-img { opacity: 0.9; }

.jr-hp-banner-placeholder { padding: 40px 20px; text-align: center; background: #f5f5f5; border-radius: 8px; border: 2px dashed #ddd; color: #aaa; font-size: 13px; line-height: 1.5; }

/* ═══════════════════════════════
 *  RESPONSIVE
 * ═══════════════════════════════ */
@media (max-width: 1024px) {
    .jr-hp-featured { grid-template-columns: 1fr 1fr; }
    .jr-hp-live-feed { display: none; }
    .jr-hp-content-with-sidebar { grid-template-columns: 1fr; }
    .jr-hp-sidebar-banners { display: none !important; }
}

@media (max-width: 767px) {
    .jr-hp-featured { grid-template-columns: 1fr; }
    .jr-hp-featured-side { flex-direction: row; gap: 12px; }
    .jr-hp-featured-side-item { flex: 1; }
    .jr-hp-latest-top { grid-template-columns: 1fr; }
    .jr-hp-most-read { border-left: none; padding-left: 0; border-top: 1px solid #e8e8e8; padding-top: 20px; }
    .jr-hp-card-row { grid-template-columns: 1fr; }
    .jr-hp-cat-top { grid-template-columns: 1fr; }
    .jr-hp-heading { font-size: 18px; }
    .jr-hp-title--lg { font-size: 18px; }
    .jr-homepage-layout .jr-hp-merch-grid { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: 160px !important; }
}
