/* --- LATEST NEWS BLOCK (UXT PRO) --- */

.latest-news-block-section {
    position: relative;
    overflow: visible !important;
    /* Critical for sticky sidebar */
}

@media (max-width: 768px) {
    /* Spacing handled globally in ui-kit.css */
}

.lnb-section-header {
    margin-bottom: var(--space-lg) !important;
    border-left: 4px solid var(--accent);
    padding-left: 20px;
}

.lnb-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.lnb-container-sidebar {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: stretch;
    position: relative;
    /* Ensure sidebar context */
    overflow: visible !important;
}

@media (max-width: 1100px) {
    .lnb-container-sidebar {
        grid-template-columns: 1fr;
    }
}

.lnb-tiles-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    overflow: visible !important;
}

/* Sidebar Column Wrapper */
.lnb-widget-column {
    height: fit-content;
    align-self: start;
    /* Grid Item: stick to top (don't stretch) */
    z-index: 10;
}

@media (max-width: 1100px) {
    .lnb-widget-column {
        position: static !important;
        padding-bottom: 0 !important;
        /* Kill trailing padding on mobile */
    }
}

/* --- Glass Matte Sidebar - Final Nuclear Reset --- */
body .lnb-widget-column.glass-matte {
    background: rgba(19, 23, 26, 0.75) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: none !important;
    box-shadow: none !important;
}

/* Kill borders, backgrounds and shadows for EVERYTHING inside - force transparency */
body .lnb-widget-column.glass-matte *,
body .lnb-widget-column.glass-matte *:before,
body .lnb-widget-column.glass-matte *:after {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-width: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Ensure common widget containers are transparent */
body .lnb-widget-column.glass-matte .widget,
body .lnb-widget-column.glass-matte [class*="widget"],
body .lnb-widget-column.glass-matte .card,
body .lnb-widget-column.glass-matte [class*="card"],
body .lnb-widget-column.glass-matte .sticky-sidebar>div,
body .lnb-widget-column.glass-matte section,
body .lnb-widget-column.glass-matte div {
    background: transparent !important;
}

/* Global text color for glass mode */
body .lnb-widget-column.glass-matte h1,
body .lnb-widget-column.glass-matte h2,
body .lnb-widget-column.glass-matte h3,
body .lnb-widget-column.glass-matte h4,
body .lnb-widget-column.glass-matte .widget-title,
body .lnb-widget-column.glass-matte p,
body .lnb-widget-column.glass-matte li,
body .lnb-widget-column.glass-matte span:not([class*="icon"]),
body .lnb-widget-column.glass-matte a {
    color: #fff !important;
}

body .lnb-widget-column.glass-matte a:hover {
    color: var(--accent) !important;
}

.lnb-widget-column .sticky-sidebar {
    position: relative;
    /* Вже не sticky */
}

.lnb-tile {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: block;
}

.lnb-tile:hover {
    z-index: 10;
}

/* --- Premium Reveal Effect --- */
.lnb-tile,
.ad-unit-wrap {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease) !important;
    will-change: transform, opacity;
}

.lnb-tile.is-revealed,
.ad-unit-wrap.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delay for Grid Items (Desktop only) */
@media (min-width: 951px) {
    .lnb-tile:nth-child(1) {
        transition-delay: 0.1s;
    }

    .lnb-tile:nth-child(2) {
        transition-delay: 0.2s;
    }

    .lnb-tile:nth-child(3) {
        transition-delay: 0.3s;
    }

    .lnb-tile:nth-child(4) {
        transition-delay: 0.4s;
    }

    .lnb-tile:nth-child(5) {
        transition-delay: 0.5s;
    }

    .lnb-tile:nth-child(6) {
        transition-delay: 0.6s;
    }

    .lnb-tile:nth-child(7) {
        transition-delay: 0.1s;
    }

    .lnb-tile:nth-child(8) {
        transition-delay: 0.2s;
    }

    .lnb-tile:nth-child(9) {
        transition-delay: 0.3s;
    }
}

/* Reset for Mobile Stacking */
@media (max-width: 950px) {

    .lnb-tile,
    .ad-unit-wrap {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}


.lnb-tile-img-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.lnb-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

.lnb-tile:hover .lnb-tile-img {
    transform: scale(1.1);
}

.lnb-tile-cat {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    padding: 6px 14px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.lnb-tile-cat.cat-style-glass {
    background: rgba(19, 23, 26, 0.70) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    color: #fff !important;
    border: none !important;
}

/* Meta Row Styles */
.lnb-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #fff;
    opacity: 0.9;
}

.lnb-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lnb-tile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 40%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    color: #fff;
    z-index: 2;
    transition: var(--transition);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lnb-tile-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lnb-top-row {
    margin-bottom: 0;
}

.lnb-bottom-row {
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Base Category Badge in Content Area */
.lnb-tile-content .lnb-tile-cat {
    position: static;
    width: fit-content;
    padding: 4px 12px;
    margin-bottom: 0;
}

/* ============================================
   DARK THEME OVERLAYS (body:not(.light-theme))
   ============================================ */

/* Dark Theme - Glass overlay */
body:not(.light-theme) .ov-dark-glass .lnb-tile-content {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: none;
    bottom: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
    width: auto;
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

/* Dark Theme - Gradient overlay */
body:not(.light-theme) .ov-dark-darken .lnb-tile-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: #fff;
}

/* Dark Theme - Solid overlay */
body:not(.light-theme) .ov-dark-solid .lnb-tile-content {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
}

/* ============================================
   LIGHT THEME OVERLAYS (body.light-theme)
   ============================================ */

/* Light Theme - White Glass overlay */
body.light-theme .ov-light-glass .lnb-tile-content {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: none;
    bottom: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
    width: auto;
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

/* Light Theme - Dark Glass overlay (matches dark theme appearance) */
body.light-theme .ov-light-dark-glass .lnb-tile-content {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: none;
    bottom: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
    width: auto;
    border-radius: var(--radius-md);
    color: #fff;
}

body.light-theme .ov-light-dark-glass .lnb-tile-title {
    color: #fff;
}

body.light-theme .ov-light-dark-glass .lnb-meta-row {
    opacity: 1;
    color: #fff;
}

body.light-theme .ov-light-dark-glass .lnb-meta-item {
    color: #fff;
}

/* --- Hover Effects --- */
/* Floating Effect */
.hover-floating .lnb-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hover-floating .lnb-tile:hover .lnb-tile-img {
    transform: scale(1.1);
}

/* Persistent Effect (if needed) */
.hover-persistent .lnb-tile .lnb-tile-content {
    bottom: 10px;
    left: 10px;
    right: 10px;
    border-radius: var(--radius-md);
}

/* Shared Widget Item Hover */
.widget_news_list li,
.widget-recent-posts li,
.tab-comment-item {
    transition: var(--transition);
}

.widget_news_list li:hover,
.widget-recent-posts li:hover,
.tab-comment-item:hover {
    transform: translateX(5px);
}

/* Light Theme - Gradient overlay */
body.light-theme .ov-light-darken .lnb-tile-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: #fff;
}

body.light-theme .ov-light-darken .lnb-tile-title {
    color: #fff;
}

body.light-theme .ov-light-darken .lnb-meta-row {
    opacity: 1;
    color: #fff;
}

body.light-theme .ov-light-darken .lnb-meta-item {
    color: #fff;
}

/* Light Theme - Solid overlay */
body.light-theme .ov-light-solid .lnb-tile-content {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
}

body.light-theme .ov-light-solid .lnb-tile-title {
    color: #fff;
}

body.light-theme .ov-light-solid .lnb-meta-row {
    opacity: 1;
    color: #fff;
}

body.light-theme .ov-light-solid .lnb-meta-item {
    color: #fff;
}

.lnb-tile-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc-header {
    margin-bottom: var(--space-lg) !important;
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.lnb-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    opacity: 0.8;
}

.lnb-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lnb-meta-icon {
    color: currentColor;
}

/* Responsive Adaptive Stacking Effect */
@media (max-width: 950px) {

    .lnb-news-grid,
    .lnb-tiles-column {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        grid-template-columns: none !important;
        overflow: visible !important;
    }

    .lnb-container-sidebar {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--space-xl) !important;
        /* Gap between News and Sidebar on Mobile */
        grid-template-columns: none !important;
    }

    /* Target all tiles AND ad blocks within the grid */
    .lnb-tile,
    .ad-unit-wrap {
        position: relative !important;
        top: auto !important;
        margin-bottom: var(--space-md) !important;
        margin-top: 0 !important;
        height: 340px !important;
        width: 100% !important;
        z-index: 1 !important;
        background-color: var(--surface-1) !important;
        border-radius: var(--radius-lg);
        overflow: hidden;
    }

    /* Zero out margin for the very last item in the section to prevent gap spill */
    .latest-news-block-section,
    .latest-news-block-section .container,
    .latest-news-block-section .lnb-container-sidebar,
    .latest-news-block-section aside,
    .latest-news-block-section .lnb-widget-column,
    .latest-news-block-section .sticky-sidebar {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .latest-news-block-section .ad-unit-wrap:last-child,
    .latest-news-block-section .lnb-tile:last-child,
    .latest-news-block-section .widget:last-child {
        margin-bottom: 0 !important;
    }

    /* Ensure subsequent items stay on top of previous ones naturally or via z-index if needed */
    /* On mobile, we avoid the 'fan-out' nth-child trick to support infinite items */

    .lnb-section-header {
        /* margin-bottom handled globally in ui-kit.css */
        padding-left: 15px !important;
        border-left-width: 4px !important;
    }

    .lnb-tile-content {
        padding: 20px !important;
    }

    .lnb-tile-title {
        font-size: 1.25rem !important;
    }
}




/* Ad styles moved to UXT Ads Manager Plugin */

/* --- LATEST NEWS META BADGES (Dynamic Corner Zones) --- */
.lnb-tile-img-wrap {
    overflow: hidden;
    position: absolute;
    inset: 0;
}

.lnb-corner-top-left,
.lnb-corner-top-right,
.lnb-corner-bottom-left,
.lnb-corner-bottom-right {
    position: absolute;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.lnb-corner-top-left {
    top: 12px;
    left: 12px;
    align-items: flex-start;
}

.lnb-corner-top-right {
    top: 12px;
    right: 12px;
    align-items: flex-end;
}

.lnb-corner-bottom-left {
    bottom: 12px;
    left: 12px;
    align-items: flex-start;
}

.lnb-corner-bottom-right {
    bottom: 12px;
    right: 12px;
    align-items: flex-end;
}

.lnb-badge.glass {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    width: fit-content;
    white-space: nowrap;
}

.lnb-badge .lnb-meta-icon {
    width: 14px;
    height: 14px;
    opacity: 0.9;
}

/* Dark mode override for badge bg */
body:not(.light-theme) .lnb-badge.glass {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Ensure badges are clearly visible on light backgrounds */
body.light-theme .lnb-badge.glass {
    background: rgba(255, 255, 255, 0.45);
    /* Increased opacity */
    border-color: rgba(0, 0, 0, 0.05);
    /* Subtle dark border instead of white */
    color: var(--text-primary) !important;
    text-shadow: none;
}

body.light-theme .lnb-badge.glass .lnb-meta-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}