/* =====================================================================
   NewsPortalPro - Public site styles
   ===================================================================== */

:root {
    --npp-red: #dc3545;
    --npp-dark: #1a1d29;
    --npp-gray: #6c757d;
    --npp-light: #f6f7fb;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--npp-light);
    color: #212529;
}

a {
    text-decoration: none;
}

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.main-navbar {
    background-color: var(--npp-dark) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.main-navbar .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--npp-red);
}

/* ---------------------------------------------------------------------
   Breaking news ticker
   --------------------------------------------------------------------- */
.breaking-bar {
    background: linear-gradient(90deg, #b02a37, var(--npp-red));
    color: #fff;
    overflow: hidden;
}

.breaking-label {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 28s linear infinite;
}

.ticker-track a {
    color: #fff;
    margin-right: 3rem;
}

.ticker-track a:hover {
    text-decoration: underline;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* ---------------------------------------------------------------------
   Hero section
   --------------------------------------------------------------------- */
.hero-section {
    background:
        linear-gradient(135deg, rgba(26, 29, 41, 0.92), rgba(176, 42, 55, 0.75)),
        var(--npp-dark);
    color: #fff;
    padding: 4.5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

.hero-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    transition: transform 0.25s ease, background 0.25s ease;
}

.hero-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.12);
}

.hero-card a {
    color: #fff;
}

/* ---------------------------------------------------------------------
   Section headings
   --------------------------------------------------------------------- */
.section-title {
    position: relative;
    font-weight: 700;
    padding-left: 0.85rem;
    margin-bottom: 1.5rem;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 4px;
    border-radius: 2px;
    background: var(--npp-red);
}

/* ---------------------------------------------------------------------
   News cards
   --------------------------------------------------------------------- */
.news-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: fadeUp 0.5s ease both;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0.75rem 1.5rem rgba(20, 24, 40, 0.12) !important;
}

.news-card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #e9ecef;
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .news-card-img {
    transform: scale(1.06);
}

.card-flag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
}

.category-badge {
    background: rgba(220, 53, 69, 0.1);
    color: var(--npp-red);
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.category-badge:hover {
    background: var(--npp-red);
    color: #fff;
}

.news-card .card-title a {
    color: #212529;
    transition: color 0.2s ease;
}

.news-card .card-title a:hover {
    color: var(--npp-red);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Trending list (sidebar style)
   --------------------------------------------------------------------- */
.trending-item {
    display: flex;
    gap: 0.9rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e9ecef;
}

.trending-item:last-child {
    border-bottom: 0;
}

.trending-rank {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: rgba(220, 53, 69, 0.35);
    min-width: 2rem;
}

.trending-item a {
    color: #212529;
    font-weight: 600;
}

.trending-item a:hover {
    color: var(--npp-red);
}

/* ---------------------------------------------------------------------
   Category tiles
   --------------------------------------------------------------------- */
.category-tile {
    display: block;
    border-radius: 0.75rem;
    padding: 1.75rem 1.25rem;
    text-align: center;
    background: #fff;
    color: #212529;
    box-shadow: 0 2px 8px rgba(20, 24, 40, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.2s;
}

.category-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(20, 24, 40, 0.12);
    color: var(--npp-red);
}

.category-tile i {
    font-size: 1.9rem;
    color: var(--npp-red);
}

/* ---------------------------------------------------------------------
   Article page
   --------------------------------------------------------------------- */
.article-hero-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.article-content {
    font-size: 1.075rem;
    line-height: 1.85;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-meta {
    color: var(--npp-gray);
    font-size: 0.9rem;
}

.author-box {
    background: #fff;
    border-left: 4px solid var(--npp-red);
    border-radius: 0.5rem;
}

/* ---------------------------------------------------------------------
   Page header strip (breadcrumbs)
   --------------------------------------------------------------------- */
.page-header-strip {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
    background-color: var(--npp-dark) !important;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #adb5bd;
    margin-right: 0.4rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
    background: var(--npp-red);
    color: #fff;
    transform: translateY(-3px);
}

/* ---------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------- */
.error-404 {
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: 800;
    color: var(--npp-red);
    line-height: 1;
}

/* ---------------------------------------------------------------------
   Responsive tweaks
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .main-navbar .navbar-collapse {
        padding-bottom: 0.75rem;
    }

    .main-navbar form[role="search"] {
        margin-top: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section .display-5 {
        font-size: 1.75rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .breaking-label {
        font-size: 0.7rem;
    }

    .trending-rank {
        font-size: 1.25rem;
        min-width: 1.5rem;
    }

    .section-title {
        font-size: 1.15rem;
    }
}

/* Keyboard focus visibility */
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(220, 53, 69, 0.5);
    outline-offset: 2px;
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ticker-track {
        animation: none;
        padding-left: 0;
    }
}
