/* -------------------------------------------------------------
   BhrosaCAB Media Page Styles
   Technologies: Clean CSS + Bootstrap 5
-------------------------------------------------------------- */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-color: #f59e0b;
    --dark-bg: #111827;
    --light-bg: #f8fafc;
    --card-border: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --card-hover-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-bg);
    color: #1e293b;
    line-height: 1.6;
}

/* HERO SECTION (100% Matching Reference Design) */
.hero-section {
    position: relative;
    min-height: 230px;
    height: 44vh;
    background-image: url('images/herobg.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Dark Moody Charcoal City Overlay */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 20, 24, 0.88);
    backdrop-filter: blur(1.5px);
    z-index: 1;
}

/* 1. Dark Geometric Wedge (Behind the Blue Cut) */
.hero-dark-cut {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 42%;
    background: #1c1c1c;
    clip-path: polygon(42% 100%, 55% 0%, 100% 0%, 100% 100%);
    z-index: 2;
}

/* 2. Sky Blue Banner Cut (Exact Color: #87ceeb) */
.hero-blue-cut {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 42%;
    background: #87ceeb;
    clip-path: polygon(55% 0%, 100% 0%, 100% 100%, 50% 100%);
    z-index: 3;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
}

/* 3. Far-right Sky Blue Vertical Accent Strip */
.hero-right-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: #87ceeb;
    z-index: 4;
}

/* Hero Content Box (Left Aligned) */
.hero-content-box {
    max-width: 650px;
    padding-left: 0.5rem;
}

/* Hero Badge with Angled Cut Corner */
.hero-badge {
    display: inline-block;
    background-color: #87ceeb;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 1.5px;
    padding: 0.35rem 1.6rem 0.35rem 1.1rem;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
}

/* Orange Accent Circle */
.hero-orange-dot {
    width: 16px;
    height: 16px;
    background-color: #d97706;
    border-radius: 50%;
    display: inline-block;
}

/* Hero Title (Sky Blue, Bold, Uppercase, Matching Reference) */
.hero-title {
    color: #87ceeb;
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.15;
    margin-top: 0.4rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments for mobile cuts */
@media (max-width: 768px) {
    .hero-section {
        min-height: 190px;
        height: auto;
        padding: 2.5rem 0;
    }

    .hero-dark-cut {
        clip-path: polygon(25% 100%, 45% 0%, 100% 0%, 100% 100%);
        height: 32%;
    }

    .hero-blue-cut {
        clip-path: polygon(45% 0%, 100% 0%, 100% 100%, 40% 100%);
        height: 32%;
    }

    .hero-title {
        font-size: 1.85rem;
    }
}

/* PULSE DOT */
.pulse-dot {
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* VIEW SWITCHER TOOLBAR (Matching uploaded design) */
.view-switcher-group {
    background: #090d16;
    padding: 5px 6px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #151d2f;
    border: 1.5px solid transparent;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.22s ease-in-out;
    outline: none;
    padding: 0;
}

.view-btn:hover {
    background: #1e293b;
    color: #cbd5e1;
    transform: translateY(-1px);
}

/* Active State with Neon Blue Border & Glow */
.view-btn.active {
    background: #0f1c3f;
    color: #ffffff;
    border: 2px solid #2563eb;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.5), inset 0 0 6px rgba(37, 99, 235, 0.3);
}

/* MEDIA FEED CONTAINER (Dynamic depending on layout) */
.media-feed-container {
    transition: max-width 0.3s ease;
    margin: 0 auto;
}

/* 1-COLUMN LAYOUT */
.media-feed-container.layout-view-1 {
    max-width: 880px;
}

.media-feed-container.layout-view-1 .media-month-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 2-COLUMN LAYOUT */
.media-feed-container.layout-view-2 {
    max-width: 1160px;
}

.media-feed-container.layout-view-2 .media-month-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8rem;
}

.media-feed-container.layout-view-2 .media-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.media-feed-container.layout-view-2 .media-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

.media-feed-container.layout-view-2 .media-title {
    font-size: 1.22rem;
}

/* 2-COLUMN IMAGE: Top aligned so header & faces show */
.media-feed-container.layout-view-2 .media-image-wrapper img {
    height: 280px;
    object-fit: cover;
    object-position: top center !important;
}

.media-feed-container.layout-view-2 .media-description {
    flex-grow: 1;
    font-size: 0.95rem;
}

/* 3-COLUMN LAYOUT (DEFAULT) */
.media-feed-container.layout-view-3 {
    max-width: 1360px;
}

.media-feed-container.layout-view-3 .media-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.media-feed-container.layout-view-3 .media-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.media-feed-container.layout-view-3 .media-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.25rem;
}

.media-feed-container.layout-view-3 .media-title {
    font-size: 1.08rem;
    line-height: 1.4;
    min-height: 3rem;
}

/* 3-COLUMN IMAGE: Top aligned so header & faces show */
.media-feed-container.layout-view-3 .media-image-wrapper img {
    height: 280px;
    object-fit: cover;
    object-position: top center !important;
}

.media-feed-container.layout-view-3 .media-description {
    font-size: 0.9rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive fallbacks for 2 & 3 column grids */
@media (max-width: 992px) {
    .media-feed-container.layout-view-3 .media-month-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .media-feed-container.layout-view-2 .media-month-grid,
    .media-feed-container.layout-view-3 .media-month-grid {
        grid-template-columns: 1fr;
    }
}

/* MONTH & YEAR HEADER DIVIDER */
.month-group-header {
    position: relative;
    margin: 3.5rem 0 2rem;
}

.month-group-header:first-child {
    margin-top: 1rem;
}

.month-divider-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e1 20%, #cbd5e1 80%, transparent);
    z-index: 1;
}

.month-year-badge {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.6rem 1.6rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* SINGLE NEWSPAPER ROW CARD */
.media-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 2.5rem;
    transition: all 0.3s ease;
}

.media-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

/* DATE BAR */
.media-date-bar {
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.media-date-text {
    font-weight: 700;
    color: #334155;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-newspaper-source {
    font-size: 0.85rem;
    color: #64748b;
    background: #ffffff;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

/* CARD CONTENT */
.media-card-body {
    padding: 1.25rem 1.5rem;
}

/* IMAGE CONTAINER */
.media-image-wrapper {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
    cursor: pointer;
}

/* Global rule: ALL card images must anchor to TOP CENTER */
.media-image-wrapper img {
    object-position: top center !important;
}

.media-feed-container.layout-view-1 .media-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 900px;
    object-fit: contain;
    background-color: #f1f5f9;
    display: block;
    transition: transform 0.3s ease;
}

.media-image-wrapper:hover img {
    transform: scale(1.015);
}

.image-zoom-overlay {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.media-image-wrapper:hover .image-zoom-overlay {
    opacity: 1;
    transform: translateY(-2px);
    background: rgba(13, 110, 253, 0.92);
}

/* 3. DESCRIPTION */
.media-description {
    font-size: 1rem;
    color: #334155;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    background: #f8fafc;
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* 4. LINK ACTION */
.media-action-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    transition: all 0.2s ease;
}

.btn-read-more:hover {
    transform: translateX(4px);
}

/* ==============================================================
   LIGHTBOX MODAL POPUP (100% Matching Screenshot: media_1789199632743.png)
============================================================== */

/* Backdrop darkness */
.modal-backdrop.show {
    opacity: 0.82;
    background-color: #000000;
}

/* Modal Dialog centering and dimension constraints */
.modal-custom-popup {
    max-width: fit-content !important;
    max-width: -moz-fit-content !important;
    width: auto !important;
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
}

/* White card with rounded corners */
.lightbox-white-card {
    background-color: #ffffff !important;
    border-radius: 18px !important;
    padding: 28px 48px;
    /* साइड्स में पैडिंग बढ़ाकर चौड़ाई बढ़ाई गई */
    min-width: min(720px, 94vw);
    /* चौड़ाई (width) को थोड़ा बड़ा किया */
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Top Action Buttons (Full Size Button + Close Button) */
.lightbox-top-actions {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1060;
}

/* Full Size / View Full Page Button (Pura photo full with me open karne ke liye) */
.lightbox-view-full-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #0f172a;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.22s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-view-full-btn:hover {
    background-color: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.lightbox-view-full-btn:active {
    transform: scale(0.96);
}

/* Circular Black Close Button with White X */
.lightbox-close-circle-btn {
    position: relative;
    width: 36px;
    height: 36px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease;
    padding: 0;
}

.lightbox-close-circle-btn:hover {
    background-color: #1e293b;
    transform: scale(1.08);
}

.lightbox-close-circle-btn:active {
    transform: scale(0.95);
}

/* Image wrapper - No scrollbars! */
.lightbox-img-wrapper {
    width: 100%;
    max-height: calc(95vh - 56px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup image - Fits screen 100% proportionally */
.lightbox-popup-img {
    max-height: calc(93vh - 56px);
    max-width: 90vw;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* RESPONSIVE DESIGN (Mobile & Tablets) */
@media (max-width: 768px) {
    .hero-section {
        min-height: 30vh;
        max-height: 35vh;
        padding: 1.5rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .media-card-body {
        padding: 1.25rem;
    }

    .media-title {
        font-size: 1.2rem;
    }

    .media-image-wrapper img {
        height: 280px;
        object-fit: cover;
        object-position: top center !important;
    }
}