/* =============================================================
   ITS Education Asia - News Page Styles
   File: css/news-style.css
   Description: All custom styles for the enhanced news page,
                including layout, cards, sidebar, search widget,
                animations, and utility classes.
   ============================================================= */


/* =====================
   1. BASE RESET
   ===================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    overflow-x: hidden;
    color: #333;
}

a {
    text-decoration: none !important;
    color: #337ab7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}


/* =====================
   2. BUTTONS
   ===================== */

/* Primary enrol button */
.btn-enrol {
    background: #0092c8;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-enrol:hover {
    background: #007ab0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 146, 200, 0.35);
}


/* =====================
   3. PAGE HERO BANNER
   ===================== */
.page-hero {
    background: linear-gradient(135deg, #003760 0%, #0056a3 60%, #0092c8 100%);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle dot pattern overlay */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3e%3ccircle cx='30' cy='30' r='1.5' fill='rgba(255,255,255,0.08)'/%3e%3c/svg%3e") repeat;
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.8);
    margin: 8px 0 0;
    font-size: 15px;
    position: relative;
}


/* =====================
   4. MAIN LAYOUT GRID
   ===================== */

/* Two-column layout: news (flexible) + sidebar (300px) */
.page-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Stack to single column on tablets and below */
@media (max-width: 992px) {
    .page-content {
        grid-template-columns: 1fr;
    }
    /* Move sidebar above articles on small screens */
    .sidebar {
        order: -1;
    }
}


/* =====================
   5. NEWS SECTION HEADER
   ===================== */
.news-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.news-section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #003760;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Blue left-border accent on the heading */
.news-section-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: #0092c8;
    border-radius: 2px;
}

/* Filter bar is hidden (reserved for future use) */
.filter-bar {
    display: none;
}


/* =====================
   6. NEWS CARD GRID
   ===================== */

/* 3-column grid on desktop */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* 2 columns on medium screens */
@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1 column on mobile */
@media (max-width: 540px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}


/* =====================
   7. NEWS CARD
   ===================== */
.news-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;

    /* Scroll-in animation (overridden by JS IntersectionObserver) */
    animation: fadeInUp 0.5s ease backwards;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

/* Hidden state used by search filtering */
.news-card.hidden {
    display: none;
}

/* Card image wrapper — clips the zoom effect */
.image-wrap {
    overflow: hidden;
    position: relative;
}

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

/* Subtle zoom on hover */
.news-card:hover .news-card-image {
    transform: scale(1.04);
}

/* Category badge (hidden — kept for potential future use) */
.card-badge {
    display: none;
}

/* Card body */
.news-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px;
    line-height: 1.5;
    flex: 1;
    transition: color 0.2s;
}

.news-card:hover .news-card-title {
    color: #0092c8;
}

.news-card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 14px;
}

/* Author + timestamp row */
.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: auto;
}

.news-card-meta .author {
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-card-meta .author i {
    color: #0092c8;
}

.news-card-meta .time-ago {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-card-meta .time-ago i {
    color: #aaa;
}

/* Read More arrow link */
.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0092c8;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    transition: gap 0.2s;
}

/* Arrow slides right on card hover */
.news-card:hover .read-more-link {
    gap: 9px;
}

/* Keyword highlight inside cards (applied by search JS) */
.news-card mark {
    background: linear-gradient(120deg, #bbebff 0%, #d4f4ff 100%);
    color: #003760;
    font-weight: 700;
    border-radius: 2px;
    padding: 0 1px;
}

/* =====================
   8.1 NO RESULTS STATE (list)
   ===================== */
.no-results-list {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.no-results-list i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d0e8f5;
}

.no-results-list h3 {
    color: #bbb;
    font-size: 18px;
}

/* =====================
   8.2 NO RESULTS STATE (Search)
   ===================== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
    display: none; /* shown by JS when search has 0 matches */
}

.no-results i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d0e8f5;
}

.no-results h3 {
    color: #bbb;
    font-size: 18px;
}


/* =====================
   12. READING PROGRESS BAR
   ===================== */
#read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #0092c8, #29aae3);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s;
}



/* =====================
   19. KEYFRAME ANIMATIONS
   ===================== */

/* Card fade-up entrance */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dropdown menu open */
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Search preview item slide-in */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator bounce */
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* Skeleton shimmer (reserved for future lazy-load use) */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
