/**
 * AICT News Hub Styles
 * Perplexity-style news aggregation page at /news/
 *
 * Color system: inherits AICT purple brand (#4a3aff / #6366f1)
 * Layout: full-width hero → sticky tabs → responsive card grid
 *
 * @package AICT_Core
 * @since 1.38.0
 */

/* ==========================================================================
   Layout wrapper
   ========================================================================== */

.aict-news-hub {
    background: #f8fafc;
    min-height: 100vh;
}

.aict-news-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.aict-news-hero {
    background: linear-gradient(135deg, #4a3aff 0%, #6366f1 50%, #8b5cf6 100%);
    padding: 3.5rem 0 3rem;
    text-align: center;
}

.aict-news-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.aict-news-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: aict-pulse 2s ease-in-out infinite;
}

@keyframes aict-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

.aict-news-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.1;
}

.aict-news-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   Category tabs bar
   ========================================================================== */

.aict-news-tabs-bar {
    position: sticky;
    top: 64px; /* below AICT header */
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.aict-news-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.625rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.aict-news-tabs::-webkit-scrollbar {
    display: none;
}

.aict-news-tab {
    flex-shrink: 0;
    padding: 0.45rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.aict-news-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.aict-news-tab.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* ==========================================================================
   Content area
   ========================================================================== */

.aict-news-content {
    padding: 2rem 1.25rem 4rem;
}

/* ==========================================================================
   News grid
   ========================================================================== */

.aict-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   News card
   ========================================================================== */

.aict-news-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.aict-news-card:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

/* Card image wrapper — gradient background visible on placeholder or broken img */
.aict-news-card-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aict-news-card-img-wrap img.aict-news-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Source initials shown when no image */
.aict-news-placeholder-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
    user-select: none;
}

/* Card body */
.aict-news-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.6rem;
}

/* Category badge + source row */
.aict-news-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.aict-news-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
}

.aict-news-card-source {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Title */
.aict-news-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Summary */
.aict-news-card-summary {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Footer: timestamp + actions */
.aict-news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
    gap: 0.5rem;
}

.aict-news-card-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.aict-news-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Read more link (inside card) */
.aict-news-read-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}

.aict-news-read-link:hover {
    color: #4a3aff;
}

/* Share buttons */
.aict-news-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-size: 0.75rem;
}

.aict-news-share-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.aict-news-share-btn svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* ==========================================================================
   Skeleton loading cards
   ========================================================================== */

.aict-news-skeleton {
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.aict-news-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: aict-shimmer 1.4s infinite linear;
    background-color: #f1f5f9;
}

@keyframes aict-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================================================
   Loading / empty states
   ========================================================================== */

.aict-news-loading {
    display: contents;
}

.aict-news-empty {
    text-align: center;
    padding: 5rem 1rem;
}

.aict-news-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.aict-news-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.aict-news-empty p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ==========================================================================
   Load more button
   ========================================================================== */

.aict-news-loadmore-wrap {
    text-align: center;
    margin-top: 2.5rem;
}

.aict-news-loadmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.aict-news-loadmore-btn:hover {
    background: #4a3aff;
}

.aict-news-loadmore-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .aict-news-hero {
        padding: 2.5rem 0 2rem;
    }
    .aict-news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .aict-news-tabs-bar {
        top: 56px;
    }
    .aict-news-content {
        padding: 1.25rem 1rem 3rem;
    }
}

@media (max-width: 480px) {
    .aict-news-hero-title {
        font-size: 1.75rem;
    }
    .aict-news-hero-subtitle {
        font-size: 0.925rem;
    }
}
