/* ==========================================================================
   THE GLOBAL WIRE - Modern Editorial Components
   Breaking Ticker, Hero Grids, Article Cards, Trending Bar, Attribution
   ========================================================================== */

/* 1. Breaking News Ticker (PRD Section 21) */
.breaking-ticker-bar {
    background-color: var(--breaking-bg);
    border-bottom: 1px solid var(--breaking-border);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-size: 0.845rem;
}

.breaking-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--breaking-red);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.725rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-right: 1rem;
    flex-shrink: 0;
}

.breaking-pulse {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}

.breaking-ticker-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.breaking-marquee {
    display: inline-block;
    animation: ticker 40s linear infinite;
}

.breaking-marquee:hover {
    animation-play-state: paused;
}

.breaking-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.breaking-item:hover {
    color: var(--brand-primary);
}

.breaking-dot {
    color: var(--breaking-red);
}

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

/* 2. Badges & Tags */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    width: fit-content;
}

.badge-category {
    background-color: rgba(185, 28, 28, 0.08);
    color: var(--brand-primary);
    border-color: rgba(185, 28, 28, 0.15);
}

[data-theme="dark"] .badge-category {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-source {
    font-family: var(--font-mono);
    font-weight: 600;
    background-color: var(--bg-surface-subtle);
    color: var(--text-muted);
}

.badge-breaking {
    background-color: var(--breaking-red);
    color: #ffffff;
    border-color: var(--breaking-red);
}

.badge-trending {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

[data-theme="dark"] .badge-trending {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* 3. Hero Section Grid (PRD Section 25) */
.hero-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 2rem;
    margin-bottom: 3.5rem;
}

/* Lead Story Card */
.lead-story-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.lead-story-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.lead-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--bg-surface-subtle);
    overflow: hidden;
}

.lead-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lead-story-card:hover .lead-image-wrapper img {
    transform: scale(1.03);
}

.lead-story-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lead-story-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.lead-story-title {
    font-family: var(--font-serif);
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    letter-spacing: -0.025em;
}

.lead-story-title a:hover {
    color: var(--brand-primary);
}

.lead-story-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lead-story-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

/* Secondary Feature Grid */
.secondary-features-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-compact-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    transition: all var(--transition-fast);
}

.feature-compact-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateX(3px);
}

.feature-thumb {
    width: 110px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-surface-subtle);
    flex-shrink: 0;
}

.feature-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.feature-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feature-title a:hover {
    color: var(--brand-primary);
}

/* 4. Standard Article Cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-fast);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

.article-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: var(--bg-surface-subtle);
    overflow: hidden;
}

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

.article-card:hover .article-card-img img {
    transform: scale(1.04);
}

.article-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.article-card-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.32;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title a:hover {
    color: var(--brand-primary);
}

.article-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 5. Main Layout with Sidebar (PRD Section 25) */
.page-layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
}

/* Trending Sidebar Widget (PRD Section 20) */
.sidebar-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.trending-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trending-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

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

.trending-rank {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    color: var(--brand-primary);
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.trending-details {
    flex: 1;
}

.trending-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-title a:hover {
    color: var(--brand-primary);
}

.trending-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* 6. Article Reader Page (PRD Section 15, 60) */
.article-reader-layout {
    max-width: 820px;
    margin: 0 auto;
}

.reader-header {
    margin-bottom: 2rem;
}

.reader-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.reader-headline {
    font-family: var(--font-serif);
    font-size: 2.85rem;
    font-weight: 700;
    line-height: 1.18;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.reader-byline-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.byline-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.byline-author {
    font-weight: 700;
    color: var(--text-primary);
}

.byline-date {
    color: var(--text-muted);
}

/* Source Attribution Banner (PRD Section 15, 60) */
.source-attribution-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.attribution-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.attribution-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8125rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.attribution-btn:hover {
    background-color: var(--brand-primary-hover);
    color: #ffffff;
}

.reader-featured-media {
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.reader-featured-media img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.reader-lead-paragraph {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1.5rem;
}

.reader-body-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.reader-body-content p {
    margin-bottom: 1.5rem;
}

/* 7. Search Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.modal-overlay.active {
    display: flex;
}

.search-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 640px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.75rem;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.15rem;
    color: var(--text-primary);
    outline: none;
}

.search-results-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-result-row {
    padding: 0.85rem 1.25rem;
    display: block;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.search-result-row:hover {
    background-color: var(--bg-surface-subtle);
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }
    .page-layout-with-sidebar {
        grid-template-columns: 1fr;
    }
    .reader-headline {
        font-size: 2.2rem;
    }
}
