﻿/* ===================== COMMON IMAGE OPTIMIZATION ===================== */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===================== HEADER ===================== */
.topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: nowrap;
}

.logo img {
    height: 55px;
    width: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    object-fit: contain;
    object-position: left center;
}

/* NAV */
.main-nav {
    flex: 1;
    min-width: 0;
}

    .main-nav ul {
        display: flex;
        gap: 18px;
        align-items: center;
        margin: 0;
        padding: 0;
    }

    .main-nav li {
        list-style: none;
    }

    .main-nav a {
        font-weight: 600;
        white-space: nowrap;
        color: #111;
    }

/* RIGHT */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* SOCIAL */
.social-header {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

    .social-header a {
        width: 32px;
        height: 32px;
        background: #f1f1f1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

        .social-header a:hover {
            background: #d0021b;
            color: #fff;
        }

/* SEARCH */
.search-area {
    flex-shrink: 0;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: 20px;
    border: 1px solid #ccc;
    padding: 0;
    overflow: hidden;
}

.search-form input {
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 20px 0 0 20px;
    max-width: 160px;
    font-size: 14px;
}

.search-form input:focus {
    outline: none;
    border: none;
}

.search-form input::placeholder {
    color: #999;
}

.search-btn {
    height: 34px;
    width: 36px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: color 0.2s;
    padding: 0;
    margin-right: 4px;
}

.search-btn:hover {
    color: #d0021b;
}

/* BREAKING BAR */
.breaking-bar {
    background: linear-gradient(90deg, #d0021b 0%, #b00015 100%);
    color: #fff;
    display: flex;
    align-items: center;
    height: 50px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 2px 8px rgba(208, 2, 27, 0.3);
}

.breaking-title {
    background: #a00114;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.breaking-title i {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.breaking-content {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 20px;
    animation: scroll-ticker 40s linear infinite;
}

.breaking-news-item {
    display: inline-block;
    padding: 0 30px;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.news-separator {
    margin: 0 15px;
    opacity: 0.6;
    font-weight: bold;
}

.breaking-news-item:last-child .news-separator {
    display: none;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

.menu-toggle {
    display: none;
    font-size: 22px;
    cursor: pointer;
}

/* ===================== HERO / INDEX ===================== */
.hero-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.hero-main {
    position: relative;
}

    .hero-main img {
        width: 100%;
        height: 280px;
        object-fit: cover;
        border-radius: 4px;
    }

.hero-link {
    position: relative;
    overflow: hidden;
}

    .hero-link a {
        display: block;
    }

.hero-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
    color: #fff;
}

    .hero-overlay h1 {
        margin: 0 0 8px;
        font-size: 22px;
        line-height: 1.3;
    }

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.grid-news {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

    .grid-news a {
        display: block;
    }

.grid-news img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.grid-news h4 {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.3;
}

/* ===================== CATEGORY ===================== */
.category-block {
    margin: 30px 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #d0021b;
    padding-bottom: 10px;
}

    .category-header h2 {
        margin: 0;
        font-size: 22px;
        color: #111;
    }

    .category-header a {
        color: #d0021b;
        font-weight: 600;
        font-size: 14px;
        transition: color 0.3s;
    }

        .category-header a:hover {
            color: #a00114;
        }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.news-card {
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 280px;
}

    .news-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .news-card a {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

.news-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-card h4 {
    margin: 8px 0 5px;
    font-size: 14px;
    line-height: 1.4;
    color: #111;
    padding: 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    padding: 0 8px 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ===================== FOOTER ===================== */
.site-footer {
    background: #111;
    color: #fff;
    padding: 20px 0;
}

    .site-footer p {
        margin: 0;
        text-align: center;
        font-size: 14px;
    }

/* ===================== SHARE BUTTON ===================== */
.share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(208, 2, 27, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
    z-index: 10;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

    .share-btn:hover {
        background: rgba(208, 2, 27, 1);
        transform: scale(1.15);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .share-btn:active {
        transform: scale(0.95);
    }

    .share-btn i {
        display: flex;
        align-items: center;
        justify-content: center;
    }
/* ===================== DETAIL PAGE ===================== */
.news-detail {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

    .news-detail h1 {
        font-size: 32px;
        margin: 0 0 20px;
        line-height: 1.4;
        color: #111;
    }

    .news-detail img {
        width: 100%;
        max-height: 500px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 30px;
    }

    .news-detail p {
        font-size: 16px;
        line-height: 1.8;
        color: #333;
        margin-bottom: 15px;
    }
/* ===================== MOBILE ===================== */
@media (max-width: 992px) {

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #ddd;
    }

        .main-nav.active {
            display: block;
        }

        .main-nav ul {
            flex-direction: column;
            padding: 15px 0;
            gap: 14px;
        }

    .search-area {
        display: none;
    }

    .hero-wrap {
        grid-template-columns: 1fr;
    }

    .hero-main img {
        height: 220px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .grid-news img {
        height: 140px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .news-card img {
        height: 100px;
    }

    .news-card h4 {
        font-size: 13px;
    }

    .news-card p {
        font-size: 11px;
    }
}

@media (max-width: 768px) {

    .hero-main img {
        height: 180px;
    }

    .grid-news img {
        height: 120px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .news-card img {
        height: 90px;
    }

    .category-header h2 {
        font-size: 18px;
    }

    .hero-overlay h1 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {

    .hero-main img {
        height: 150px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .grid-news img {
        height: 100px;
    }

    .grid-news h4 {
        font-size: 12px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .news-card img {
        height: 80px;
    }

    .news-card h4 {
        font-size: 12px;
    }

    .news-card p {
        display: none;
    }

    .hero-overlay h1 {
        font-size: 16px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .category-header h2 {
        font-size: 16px;
    }
}
