/* ============================================
   News Portal - Multi-Section Layout CSS
   ============================================ */

:root {
    --primary-red: #c90000;
    --dark-bg: #121212;
    --light-bg: #f8f9fa;
    --text-dark: #222;
    --text-gray: #666;
    --card-radius: 12px;
    --section-gap: 45px;
}

/* ---- Breaking News Ticker ---- */
.breaking-ticker {
    background: var(--dark-bg);
    color: #fff;
    display: flex;
    align-items: stretch;
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    height: 42px;
}
.breaking-ticker .ticker-label {
    background: var(--primary-red);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    flex-shrink: 0;
    z-index: 2;
}
.breaking-ticker .ticker-label i {
    font-size: 0.75rem;
}
.breaking-ticker .ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}
.breaking-ticker .ticker-content {
    display: flex;
    align-items: center;
    animation: ticker-scroll 35s linear infinite;
    white-space: nowrap;
    padding-left: 20px;
}
.breaking-ticker .ticker-item {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.breaking-ticker .ticker-item:hover {
    text-decoration: underline;
    color: #ffd;
}
.breaking-ticker .ticker-custom-text {
    color: #ffdd57;
}
.breaking-ticker .ticker-separator {
    margin: 0 20px;
    opacity: 0.3;
    font-weight: 300;
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---- Featured Slider ---- */
.featured-slider-section {
    margin-bottom: var(--section-gap);
}
.featured-slider-section .swiper-slide {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    height: 450px;
}
.featured-slider-section .slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-slider-section .slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 35px 30px;
    color: #fff;
}
.featured-slider-section .slide-badge {
    background: var(--primary-red);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
    width: fit-content;
}
.featured-slider-section .slide-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}
.featured-slider-section .slide-title a {
    color: #fff;
    text-decoration: none;
}
.featured-slider-section .slide-meta {
    font-size: 0.85rem;
    opacity: 0.85;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}
.featured-slider-section .swiper-button-next,
.featured-slider-section .swiper-button-prev {
    color: #fff;
    background: rgba(0,0,0,0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.featured-slider-section .swiper-button-next:after,
.featured-slider-section .swiper-button-prev:after {
    font-size: 16px;
}
.featured-slider-section .swiper-pagination-bullet-active {
    background: var(--primary-red);
}

/* ---- Section Block ---- */
.news-section-block {
    margin-bottom: var(--section-gap);
}
.news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-red);
}
.news-section-header h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark-bg);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.news-section-header h3 i {
    color: var(--primary-red);
    font-size: 1.1rem;
}
.news-section-header .see-all {
    color: var(--primary-red);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.news-section-header .see-all:hover {
    text-decoration: underline;
}

/* ---- Grid 3 Layout ---- */
.section-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ---- Grid 4 Layout ---- */
.section-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* ---- Horizontal Scroll Layout ---- */
.section-horizontal-scroll {
    overflow-x: auto;
    display: flex;
    gap: 18px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.section-horizontal-scroll::-webkit-scrollbar {
    height: 4px;
}
.section-horizontal-scroll::-webkit-scrollbar-track {
    background: #eee;
    border-radius: 4px;
}
.section-horizontal-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.section-horizontal-scroll .news-card-sm {
    min-width: 280px;
    max-width: 300px;
    flex-shrink: 0;
}

/* ---- News Card (section items) ---- */
.news-card-sm {
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.news-card-sm:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.news-card-sm .card-thumb {
    height: 180px;
    overflow: hidden;
    position: relative;
}
.news-card-sm .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.news-card-sm:hover .card-thumb img {
    transform: scale(1.05);
}
.news-card-sm .card-thumb .cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-red);
    color: #fff;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
}
.news-card-sm .card-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-card-sm .card-info h5 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.news-card-sm .card-info h5 a {
    color: var(--text-dark);
    text-decoration: none;
}
.news-card-sm .card-info h5 a:hover {
    color: var(--primary-red);
}
.news-card-sm .card-info .card-date {
    margin-top: auto;
    font-size: 0.78rem;
    color: #999;
}

/* ---- List Layout (trending sidebar) ---- */
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.trending-list li {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}
.trending-list li:last-child {
    border-bottom: none;
}
.trending-list .trend-number {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-red);
    line-height: 1;
    min-width: 30px;
    opacity: 0.6;
}
.trending-list .trend-info h6 {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 4px;
}
.trending-list .trend-info h6 a {
    color: var(--text-dark);
    text-decoration: none;
}
.trending-list .trend-info h6 a:hover {
    color: var(--primary-red);
}
.trending-list .trend-info .trend-date {
    font-size: 0.75rem;
    color: #999;
}

/* ---- Sidebar ---- */
.news-sidebar {
    position: sticky;
    top: 80px;
}
.sidebar-widget {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.sidebar-widget .widget-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-bg);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-red);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-widget .widget-title i {
    color: var(--primary-red);
}

/* ---- Category Tags Cloud ---- */
.category-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.category-cloud .cat-tag {
    background: #f0f0f0;
    color: var(--text-dark);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.category-cloud .cat-tag:hover {
    background: var(--primary-red);
    color: #fff;
}

/* ---- "All News" fallback section ---- */
.all-news-section {
    margin-top: var(--section-gap);
}
.all-news-section .section-grid-3 {
    margin-bottom: 30px;
}

/* ---- Native Ad Card in Grid ---- */
.native-ad-card {
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.native-ad-card .native-ad-inner {
    width: 100%;
}
/* Force ad-card-wrapper to fit inside the grid cell */
.native-ad-card .ad-card-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.native-ad-card .ad-media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.native-ad-card .ad-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-height: none !important;
    border-radius: 0 !important;
}
.native-ad-card .ad-badge {
    position: absolute !important;
    top: 8px !important;
    left: auto !important;
    right: 8px !important;
    z-index: 20 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    padding: 3px 10px !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-radius: 4px !important;
    backdrop-filter: blur(2px) !important;
}
.native-ad-card .ad-link-block {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}
.native-ad-card .ad-overlay-gradient {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60% !important;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%) !important;
    display: flex !important;
    align-items: flex-end !important;
    padding: 15px !important;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10;
    border-radius: 0 !important;
}
.native-ad-card .ad-overlay-text {
    color: #fff !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    line-height: 1.3;
}
.native-ad-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    border: 1px dashed #ddd;
    border-radius: var(--card-radius);
    background: #fafafa;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.native-ad-placeholder .ad-label {
    display: inline-block;
    background: #eee;
    color: #999;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.native-ad-placeholder .ad-placeholder-text {
    font-size: 0.85rem;
    color: #bbb;
}

/* ---- Ad spacing ---- */
.news-ad-break {
    margin: 15px 0;
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .section-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .section-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .featured-slider-section .swiper-slide { height: 350px; }
    .featured-slider-section .slide-title { font-size: 1.4rem; }
    .news-sidebar { position: static; }
}
@media (max-width: 575px) {
    .section-grid-3 { grid-template-columns: 1fr; }
    .section-grid-4 { grid-template-columns: 1fr; }
    .featured-slider-section .swiper-slide { height: 280px; }
    .featured-slider-section .slide-title { font-size: 1.1rem; }
    .news-section-header h3 { font-size: 1.1rem; }
    .breaking-ticker { height: 36px; font-size: 0.8rem; }
    .breaking-ticker .ticker-label { font-size: 0.65rem; padding: 0 10px; }
}
