/**
 * ==============================================================
 * SRMEDU-aapbiti Master Design System v2.0
 * Theme: SRMEDU-aapbiti (Educational & News Portal)
 * Integrates: Blogzine + Ghost Casper + Newsbit + Tabler UI
 * ==============================================================
 */

:root {
    --srm-primary: #0b66b7;
    --srm-primary-hover: #084d8d;
    --srm-primary-light: rgba(11, 102, 183, 0.08);
    --srm-accent: #f59e0b;
    --srm-success: #10b981;
    --srm-danger: #ef4444;

    /* Surface Colors - Light Mode */
    --srm-bg: #f8fafc;
    --srm-card-bg: #ffffff;
    --srm-card-border: rgba(226, 232, 240, 0.9);
    --srm-text-main: #0f172a;
    --srm-text-muted: #64748b;
    --srm-text-subtle: #94a3b8;
    --srm-divider: #e2e8f0;

    /* Elevation & Curves */
    --srm-radius-sm: 6px;
    --srm-radius-md: 10px;
    --srm-radius-lg: 14px;
    --srm-radius-xl: 18px;
    --srm-radius-full: 9999px;
    
    --srm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --srm-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
    --srm-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
    --srm-shadow-hover: 0 10px 24px rgba(11, 102, 183, 0.12);

    /* Typography */
    --srm-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-bs-theme="dark"] {
    --srm-bg: #0b0f19;
    --srm-card-bg: #151c2c;
    --srm-card-border: rgba(255, 255, 255, 0.08);
    --srm-text-main: #f1f5f9;
    --srm-text-muted: #94a3b8;
    --srm-text-subtle: #64748b;
    --srm-divider: rgba(255, 255, 255, 0.08);
    --srm-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--srm-bg) !important;
    color: var(--srm-text-main);
    font-family: var(--srm-font-sans);
}

/* ==============================================================
   1. HERO BENTO GRID SECTION (Blogzine + Tabler)
   ============================================================== */
.srm-hero-section {
    margin-bottom: 28px;
}

.srm-bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 992px) {
    .srm-bento-grid {
        grid-template-columns: 2.1fr 1.15fr 1fr;
        height: 395px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .srm-bento-grid {
        grid-template-columns: 1fr 1fr;
    }
    .srm-bento-grid .srm-hero-main {
        grid-column: span 2;
        height: 350px;
    }
}

/* Bento Card Base */
.srm-card {
    background: var(--srm-card-bg);
    border-radius: var(--srm-radius-lg);
    border: 1px solid var(--srm-card-border);
    box-shadow: var(--srm-shadow-md);
    overflow: hidden;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.srm-card:hover {
    box-shadow: var(--srm-shadow-hover);
}

/* 1.1 Main Slider (Left) */
.srm-hero-main {
    height: 100%;
    position: relative;
    isolation: isolate;
    background-color: var(--srm-card-bg);
}

@media (max-width: 767.98px) {
    .srm-hero-main {
        height: 240px;
        border-radius: var(--srm-radius-md);
    }
}

.srm-hero-main .swiper {
    width: 100%;
    height: 100%;
}

.srm-hero-main .swiper-wrapper,
.srm-hero-main .swiper-slide {
    height: 100% !important;
}

.srm-hero-main .srm-ambient-bg {
    position: absolute;
    inset: -20px;
    background-image: var(--srm-bg-img);
    background-size: cover;
    background-position: center;
    filter: blur(24px) brightness(0.92) saturate(1.2);
    transform: scale(1.15);
    opacity: 0.65;
    z-index: 0;
    pointer-events: none;
}

[data-bs-theme="dark"] .srm-hero-main .srm-ambient-bg {
    filter: blur(24px) brightness(0.45) saturate(1.2);
    opacity: 0.45;
}

.srm-hero-main .srm-hero-img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background-color: transparent !important;
    z-index: 1;
    transition: transform 0.4s ease;
}

.srm-hero-main:hover .srm-hero-img {
    transform: scale(1.02);
}

.srm-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.94) 0%,
        rgba(15, 23, 42, 0.7) 32%,
        rgba(15, 23, 42, 0.1) 60%,
        transparent 75%
    );
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem 1.4rem;
    pointer-events: none;
}

.srm-hero-overlay * {
    pointer-events: auto;
}

.srm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--srm-radius-sm);
    color: #ffffff !important;
    width: fit-content;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.srm-hero-title {
    color: #ffffff !important;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

@media (max-width: 767.98px) {
    .srm-hero-title {
        font-size: 1.02rem;
        line-height: 1.3;
    }
    .srm-hero-overlay {
        padding: 0.9rem;
    }
}

.srm-hero-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.srm-hero-title a:hover {
    color: #93c5fd !important;
}

.srm-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 1.2 Center Column (2 Stacked Trending Cards with Clean Body) */
.srm-hero-center {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

@media (max-width: 767.98px) {
    .srm-hero-center {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        height: auto;
    }
}

.srm-trend-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--srm-card-bg);
    border-radius: var(--srm-radius-md);
    overflow: hidden;
}

.srm-trend-img-box {
    position: relative;
    width: 100%;
    height: 115px;
    overflow: hidden;
    background: #e2e8f0;
}

@media (max-width: 767.98px) {
    .srm-trend-img-box {
        height: 100px;
    }
}

.srm-trend-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.35s ease;
}

.srm-trend-card:hover .srm-trend-img {
    transform: scale(1.05);
}

.srm-badge-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.srm-trend-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.srm-trend-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--srm-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srm-trend-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.srm-trend-title a:hover {
    color: var(--srm-primary);
}

/* 1.3 Right Column (Live Headlines / Top Headlines) */
.srm-hero-live {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.25rem;
    background: var(--srm-card-bg);
}

@media (max-width: 991.98px) {
    .srm-hero-live {
        height: auto;
    }
}

.srm-live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--srm-primary);
}

.srm-live-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--srm-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.srm-pulse-dot {
    width: 9px;
    height: 9px;
    background-color: var(--srm-danger);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.6);
    animation: srmPulse 1.8s infinite;
}

@keyframes srmPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.srm-live-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.srm-live-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px dashed var(--srm-divider);
}

.srm-live-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.srm-live-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--srm-primary-light);
    color: var(--srm-primary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.srm-live-content {
    flex-grow: 1;
    min-width: 0;
}

.srm-live-text {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--srm-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.srm-live-text a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.srm-live-text a:hover {
    color: var(--srm-primary);
}

.srm-live-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    white-space: nowrap !important;
}

.srm-live-cat {
    font-weight: 600;
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.srm-live-date {
    color: var(--srm-text-subtle);
    white-space: nowrap !important;
    flex-shrink: 0;
}

/* ==============================================================
   2. CATEGORY SECTIONS & MODERN CARDS OVERHAUL
   (Upgrades the old Magazine layout into modern Blogzine/Tabler)
   ============================================================== */

/* Section Titles */
.section-category {
    margin-bottom: 32px;
}

.section-category .section-title {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--srm-divider);
    position: relative;
}

.section-category .section-title .title {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--srm-text-main);
    margin: 0;
    position: relative;
    display: inline-block;
}

.section-category .section-title .title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 48px;
    height: 3px;
    background: var(--srm-primary);
    border-radius: var(--srm-radius-full);
}

/* Subcategory Tabs */
.section-category .nav-tabs,
.section-category .category-tabs {
    border-bottom: none !important;
    gap: 6px;
    display: flex;
    flex-wrap: wrap;
}

.section-category .nav-tabs .nav-link {
    border: none !important;
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--srm-text-muted) !important;
    background: var(--srm-card-bg) !important;
    border-radius: var(--srm-radius-full) !important;
    box-shadow: var(--srm-shadow-sm);
    transition: all 0.2s ease;
}

.section-category .nav-tabs .nav-link:hover,
.section-category .nav-tabs .nav-link.active {
    background: var(--srm-primary) !important;
    color: #ffffff !important;
}

/* Post Items in Category Blocks (Modern 16:9 Widescreen Cards) */
.col-post-item-vr {
    margin-bottom: 20px;
}

.post-item-vr,
.post-item {
    background: var(--srm-card-bg);
    border: 1px solid var(--srm-card-border);
    border-radius: var(--srm-radius-md);
    overflow: hidden;
    box-shadow: var(--srm-shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-item-vr:hover,
.post-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--srm-shadow-hover);
}

.post-item-vr .image,
.post-item .image {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
    overflow: hidden;
    position: relative;
    background: #e2e8f0;
}

.post-item-vr .image img,
.post-item .image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.35s ease;
}

.post-item-vr:hover .image img,
.post-item:hover .image img {
    transform: scale(1.05);
}

.post-item-vr .caption,
.post-item .caption {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.post-item-vr .caption .title,
.post-item .caption .title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-item-vr .caption .title a,
.post-item .caption .title a {
    color: var(--srm-text-main) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.post-item-vr:hover .caption .title a,
.post-item:hover .caption .title a {
    color: var(--srm-primary) !important;
}

/* Post Meta in Category Cards */
.post-meta {
    font-size: 0.75rem;
    color: var(--srm-text-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.post-meta a {
    color: inherit;
    text-decoration: none;
}

/* Small Horizontal Post Items (3-Column / Latest Section) */
.post-item-small {
    background: var(--srm-card-bg);
    border: 1px solid var(--srm-card-border);
    border-radius: var(--srm-radius-md);
    padding: 10px;
    margin-bottom: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-item-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--srm-shadow-hover);
}

.post-item-small .image {
    width: 90px;
    height: 68px;
    flex-shrink: 0;
    border-radius: var(--srm-radius-sm);
    overflow: hidden;
    position: relative;
    background: #e2e8f0;
}

.post-item-small .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item-small:hover .image img {
    transform: scale(1.06);
}

.post-item-small .title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.post-item-small .title a {
    color: var(--srm-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-item-small:hover .title a {
    color: var(--srm-primary);
}

/* Breaking News Ticker (Modern Clean Strip) */
.section-newsticker {
    background: var(--srm-card-bg);
    border: 1px solid var(--srm-card-border);
    border-radius: var(--srm-radius-md);
    padding: 6px 12px;
    box-shadow: var(--srm-shadow-sm);
}

.section-newsticker .breaking-title {
    background: var(--srm-danger) !important;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: var(--srm-radius-sm);
    text-transform: uppercase;
}

/* Full Clickable Overlay Helper */
.srm-full-link {
    position: absolute;
    inset: 0;
    z-index: 3;
}

/* ==============================================================
   3. CATEGORY BLOCK 1 & SLIDER CARDS FIX
   (Image on top, caption/title below - matching featured layout)
   ============================================================== */
.section-cat-block-1 .post-item-vr {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    background: var(--srm-card-bg);
    border: 1px solid var(--srm-card-border);
    border-radius: var(--srm-radius-md);
    overflow: hidden;
    box-shadow: var(--srm-shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.section-cat-block-1 .post-item-vr:hover {
    transform: translateY(-3px);
    box-shadow: var(--srm-shadow-hover);
}

.section-cat-block-1 .post-item-vr .image {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    overflow: hidden !important;
    position: relative !important;
    background: #e2e8f0;
    flex-shrink: 0;
}

.section-cat-block-1 .post-item-vr .image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.35s ease;
}

.section-cat-block-1 .post-item-vr:hover .image img {
    transform: scale(1.05);
}

.section-cat-block-1 .post-item-vr .image::after {
    display: none !important;
}

.section-cat-block-1 .post-item-vr .caption {
    position: static !important;
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    flex-grow: 1 !important;
    width: 100% !important;
    background: transparent !important;
}

.section-cat-block-1 .post-item-vr .caption .title {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
}

.section-cat-block-1 .post-item-vr .caption .title a {
    color: var(--srm-text-main) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.section-cat-block-1 .post-item-vr:hover .caption .title a {
    color: var(--srm-primary) !important;
}

.section-cat-block-1 .post-item-vr .caption .post-meta,
.section-cat-block-1 .post-item-vr .caption .post-meta a,
.section-cat-block-1 .post-item-vr .caption .post-meta span,
.section-cat-block-1 .post-item-vr .caption .post-meta i {
    color: var(--srm-text-subtle) !important;
}

/* Category Slider: Ensure height is auto and text below image */
.section-cat-slider .section-content {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

.category-slider-container .post-item-mid {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    margin-bottom: 0 !important;
}

.category-slider-container .post-item-mid .image {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0;
}

.category-slider-container .post-item-mid .image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.category-slider-container .post-item-mid .title {
    margin-top: 8px !important;
    margin-bottom: 4px !important;
    font-size: var(--vr-fs-title-xs) !important;
    line-height: var(--vr-lh-title-xs) !important;
    font-weight: 600 !important;
}

.category-slider-container .post-item-mid .title a {
    color: var(--srm-text-main) !important;
    text-decoration: none !important;
}

.category-slider-container .post-item-mid:hover .title a {
    color: var(--srm-primary) !important;
}

/* ==============================================================
   4. FOOTER TRENDING POSTS FIX
   (Fixes white box and illegible white text in dark footer)
   ============================================================== */
#footer .post-item-small,
footer .post-item-small,
.footer-widget .post-item-small {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--srm-radius-md) !important;
    padding: 10px !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

#footer .post-item-small:hover,
footer .post-item-small:hover,
.footer-widget .post-item-small:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

#footer .post-item-small .image,
footer .post-item-small .image,
.footer-widget .post-item-small .image {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--srm-radius-sm) !important;
}

#footer .post-item-small .title a,
footer .post-item-small .title a,
.footer-widget .footer-posts .post-item-small .title a,
.footer-widget .post-item-small .title a {
    color: #f1f5f9 !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

#footer .post-item-small:hover .title a,
footer .post-item-small:hover .title a,
.footer-widget .footer-posts .post-item-small:hover .title a,
.footer-widget .post-item-small:hover .title a {
    color: var(--srm-accent, #f59e0b) !important;
}

#footer .post-item-small .post-meta,
#footer .post-item-small .post-meta a,
#footer .post-item-small .post-meta span,
#footer .post-item-small .post-meta i,
footer .post-item-small .post-meta,
footer .post-item-small .post-meta a,
footer .post-item-small .post-meta span,
footer .post-item-small .post-meta i,
.footer-widget .post-item-small .post-meta,
.footer-widget .post-item-small .post-meta a,
.footer-widget .post-item-small .post-meta span,
.footer-widget .post-item-small .post-meta i {
    color: #94a3b8 !important;
}

