/* ==========================================================================
   Tirhutwani - High-Density Beta Homepage Stylesheet (home-beta.css)
   Fully responsive, high information density, light + dark mode parity.
   ========================================================================== */

/* ── 1. Instant Top Quick Bar (WhatsApp + Mobile App) ─────────────────── */
.beta-quickbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.625rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.5rem 0.875rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.beta-quickbar__label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.825rem;
    font-weight: 700;
    color: #334155;
}

.beta-quickbar__actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.beta-btn-wa {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: #25D366;
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.38rem 0.85rem;
    border-radius: 9999px;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(37, 211, 102, 0.28);
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-btn-wa:hover {
    background-color: #20bd5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.35);
}

.beta-btn-app {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: var(--color-primary, #dc2626);
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.38rem 0.85rem;
    border-radius: 9999px;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.28);
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.beta-btn-app:hover {
    background-color: var(--color-primary-dark, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.38);
}

/* Dark mode for quickbar */
[data-theme="dark"] .beta-quickbar {
    background: #182030;
    border-color: #2a354c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .beta-quickbar__label {
    color: #e2e8f0;
}

/* ── 2. Hero + Right-Hand Slim Stack Layout ────────────────────────────── */
.beta-hero-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .beta-hero-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.85fr) minmax(0, 1.15fr);
        gap: 1.25rem;
        align-items: stretch;
    }
}

.beta-hero-col {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Hero Article Card ─────────────────────────────────────── */
.beta-hero-card {
    position: relative;
    width: 100%;
    min-height: 22rem;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .beta-hero-card {
        min-height: 26rem;
    }
}

@media (min-width: 1024px) {
    .beta-hero-col {
        height: 100%;
        min-height: 100%;
    }
    .beta-hero-card {
        height: 100% !important;
        min-height: 100% !important;
    }
}

.beta-hero-media-link {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.beta-hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.beta-hero-card:hover .beta-hero-media {
    transform: scale(1.04);
}

.beta-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.08) 100%);
    pointer-events: none;
    z-index: 2;
}

.beta-hero-content {
    position: relative;
    z-index: 3;
    padding: 1.25rem 1.25rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.beta-stack-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
}

.beta-stack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-primary, #dc2626);
    margin-bottom: 0.1rem;
}

.beta-stack-title {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

[data-theme="dark"] .beta-stack-title {
    color: #f1f5f9;
}

.beta-stack-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-primary, #dc2626);
}

[data-theme="dark"] .beta-stack-badge {
    background: rgba(220, 38, 38, 0.22);
}

/* ── 3. High-Density Slim News Card (Item) ────────────────────────────── */
.beta-card-slim {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    padding: 0.625rem;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    min-height: 5.75rem;
}

.beta-card-slim:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -3px rgba(0, 0, 0, 0.08);
    border-color: var(--color-primary, #dc2626);
}

.beta-card-slim__thumb {
    width: 6.25rem;
    min-width: 6.25rem;
    height: 4.85rem;
    position: relative;
    border-radius: 0.45rem;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f1f5f9;
}

@media (min-width: 640px) {
    .beta-card-slim__thumb {
        width: 6.75rem;
        min-width: 6.75rem;
        height: 5.15rem;
    }
}

.beta-card-slim__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.beta-card-slim:hover .beta-card-slim__img {
    transform: scale(1.06);
}

.beta-card-slim__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.beta-card-slim__meta-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
}

.beta-card-slim__cat {
    color: var(--color-primary, #dc2626);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 7.5rem;
}

.beta-card-slim__dot {
    color: #94a3b8;
    font-size: 0.65rem;
}

.beta-card-slim__time {
    color: #64748b;
    font-size: 0.72rem;
    white-space: nowrap;
}

.beta-card-slim__title {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.32;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: color 0.15s ease;
}

.beta-card-slim:hover .beta-card-slim__title {
    color: var(--color-primary, #dc2626);
}

.beta-card-slim__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #64748b;
}

.beta-card-slim__source {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.beta-card-slim__source:hover {
    color: var(--color-primary, #dc2626);
    text-decoration: underline;
}

.beta-card-slim__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.beta-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    transition: all 0.15s ease;
    cursor: pointer;
    padding: 0;
    text-decoration: none !important;
}

.beta-btn-action:hover {
    background-color: rgba(220, 38, 38, 0.08);
    color: var(--color-primary, #dc2626);
    border-color: var(--color-primary, #dc2626);
}

.beta-btn-action--bookmarked {
    color: var(--color-primary, #dc2626);
    border-color: rgba(220, 38, 38, 0.4);
    background-color: rgba(220, 38, 38, 0.06);
}

/* Dark mode for slim cards */
[data-theme="dark"] .beta-card-slim {
    background-color: #182030;
    border-color: #2a354c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .beta-card-slim:hover {
    border-color: var(--color-primary, #dc2626);
    box-shadow: 0 6px 14px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .beta-card-slim__thumb {
    background-color: #0f172a;
}

[data-theme="dark"] .beta-card-slim__title {
    color: #f1f5f9;
}

[data-theme="dark"] .beta-card-slim__time,
[data-theme="dark"] .beta-card-slim__footer {
    color: #94a3b8;
}

[data-theme="dark"] .beta-btn-action {
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .beta-btn-action:hover {
    background-color: rgba(220, 38, 38, 0.2);
    border-color: var(--color-primary, #dc2626);
    color: #ffffff;
}

/* ── 4. Category-Wise 2-Column Grid ────────────────────────────────────── */
.beta-category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .beta-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

.beta-cat-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.beta-cat-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.beta-cat-box__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.beta-cat-box__bar {
    width: 0.25rem;
    height: 1.1rem;
    background-color: var(--color-primary, #dc2626);
    border-radius: 9999px;
}

.beta-cat-box__title {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    color: #0f172a;
    margin: 0;
}

.beta-cat-box__more {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-primary, #dc2626);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.beta-cat-box__more:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.beta-cat-box__body {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1;
}

/* Dark mode for Category Grid */
[data-theme="dark"] .beta-cat-box {
    background-color: #182030;
    border-color: #2a354c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .beta-cat-box__header {
    background: #111827;
    border-bottom-color: #2a354c;
}

[data-theme="dark"] .beta-cat-box__title {
    color: #f1f5f9;
}

/* ── Odd-Count Category Box (Full Width Span & 2-Column Subgrid) ─────── */
.beta-category-grid > .beta-cat-box:last-child:nth-child(odd),
.beta-cat-box--full-width {
    grid-column: 1 / -1;
}

@media (min-width: 640px) {
    .beta-category-grid > .beta-cat-box:last-child:nth-child(odd) .beta-cat-box__body,
    .beta-cat-box--full-width .beta-cat-box__body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    /* If odd number of articles (e.g. 5) in full-width box, lead article spans 2 columns */
    .beta-category-grid > .beta-cat-box:last-child:nth-child(odd) .beta-cat-box__body > .beta-card-slim:first-child:nth-last-child(odd),
    .beta-cat-box--full-width .beta-cat-box__body > .beta-card-slim:first-child:nth-last-child(odd) {
        grid-column: 1 / -1;
    }
}

/* ── 5. In-Feed Ads between Grid rows ─────────────────────────────────── */
.beta-infeed-wrapper {
    grid-column: 1 / -1;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── 5b. Main Layout Grid (Feed on Left + Sidebar on Right) ───────────── */
.beta-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.beta-main-feed {
    width: 100%;
    min-width: 0;
}

.beta-reels-area {
    width: 100%;
}

.beta-reels-area .beta-reels-strip {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.beta-sidebar-area {
    width: 100%;
    min-width: 0;
}

@media (min-width: 1024px) {
    .beta-layout-grid {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 2rem;
        align-items: start;
    }

    .beta-main-feed {
        min-width: 0;
    }

    .beta-sidebar-area {
        position: sticky;
        top: 5.5rem;
    }
}

/* ── 6. Bottom Reels Section (Under Left Feed Only) ───────────────────── */
.beta-reels-strip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.875rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.beta-reels-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--color-primary, #dc2626);
}

.beta-reels-title {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.beta-reels-more {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary, #dc2626);
    text-decoration: none;
}

.beta-reels-more:hover {
    text-decoration: underline;
}

.beta-reels-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

@media (min-width: 640px) {
    .beta-reels-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .beta-reels-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

.beta-reel-card {
    position: relative;
    border-radius: 0.6rem;
    overflow: hidden;
    background-color: #0f172a;
    aspect-ratio: 9 / 14;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none !important;
}

.beta-reel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.beta-reel-card__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.beta-reel-card:hover .beta-reel-card__thumb {
    transform: scale(1.05);
}

.beta-reel-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 2;
}

.beta-reel-card__play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 3;
    transition: transform 0.2s ease, background 0.2s ease;
}

.beta-reel-card:hover .beta-reel-card__play-badge {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--color-primary, #dc2626);
    border-color: var(--color-primary, #dc2626);
}

.beta-reel-card__info {
    position: relative;
    z-index: 4;
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.beta-reel-cat-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fca5a5;
    line-height: 1;
}

.beta-reel-card__title {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    font-weight: 700;
    font-size: 0.775rem;
    line-height: 1.25;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    margin: 0;
}

.beta-reel-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #cbd5e1;
}

.beta-reel-platform-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    color: #ffffff;
    line-height: 1;
}

/* Dark mode for Reels */
[data-theme="dark"] .beta-reels-strip {
    background: #182030;
    border-color: #2a354c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .beta-reels-title {
    color: #f1f5f9;
}

/* ── Inshorts Feed Enhancements for Beta Card Slim ───────── */
.beta-card-slim {
    min-height: auto !important;
}

.beta-card-slim__title {
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    color: #090d16 !important;
    margin-bottom: 0.45rem !important;
}

[data-theme="dark"] .beta-card-slim__title {
    color: #f8fafc !important;
}

@media (max-width: 639px) {
    .beta-card-slim {
        flex-direction: column !important;
    }
    .beta-card-slim__thumb {
        width: 100% !important;
        height: 180px !important;
    }
}
