/* ================================
   Iran Nyheter - Flipboard-inspired
   Magazine-style UX
   ================================ */

/* CSS Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #767676;
    --border-color: #e8e8e8;
    --accent-color: #f52828;
    --accent-hover: #d41f1f;
    --accent-light: rgba(245, 40, 40, 0.08);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.10);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --danger-color: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.08);
    --success-color: #16a34a;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    --header-height: 56px;
    --tabs-height: 44px;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-card: #222222;
    --text-primary: #f0f0f0;
    --text-secondary: #aaaaaa;
    --text-muted: #999999;
    --border-color: #333333;
    --accent-color: #ff4444;
    --accent-hover: #ff6666;
    --accent-light: rgba(255, 68, 68, 0.12);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.4);
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
    --danger-light: rgba(220, 38, 38, 0.15);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overflow-x: hidden;
}

/* ================================
   Header - Flipboard style
   ================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-md);
    padding-top: var(--safe-top);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--header-height);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: var(--spacing-xs) 0;
    gap: var(--spacing-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.logo {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-emblem {
    height: 2rem;
    width: 2rem;
    max-width: 2rem;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-accent {
    color: var(--accent-color);
}

.logo-wrap {
    display: flex;
    flex-direction: column;
}

.header-updated {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1;
}

.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition-fast);
    height: 40px;
}

.header-search input:focus {
    outline: none;
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.header-search input:focus ~ .search-icon,
.header-search:focus-within .search-icon {
    color: var(--accent-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.theme-toggle {
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    touch-action: manipulation;
    color: var(--text-muted);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.icon-sun, .icon-moon {
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { color: #fbbf24; }
[data-theme="light"] .icon-moon,
:root:not([data-theme]) .icon-moon { display: none; }

.tagline { display: none; }

/* ================================
   Category Tabs - Flipboard nav
   ================================ */
.category-tabs {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: var(--header-height);
    z-index: 999;
    padding: 0 calc(max(var(--spacing-md), (100% - 1200px) / 2));
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: var(--tabs-height);
}

.category-tabs-inner {
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: var(--tabs-height);
    align-items: stretch;
}

.category-tabs-inner::-webkit-scrollbar { display: none; }

.category-tab {
    flex-shrink: 0;
    padding: 0 var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    touch-action: manipulation;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
}

.category-tab:hover {
    color: var(--text-primary);
}

.category-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.news-toggle,
.tweet-toggle,
.ig-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 var(--spacing-md);
    cursor: pointer;
    user-select: none;
    border-left: 1px solid var(--border-color);
}

.news-toggle input[type="checkbox"],
.tweet-toggle input[type="checkbox"],
.ig-toggle input[type="checkbox"] {
    accent-color: #0f1419;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.news-toggle-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.tweet-toggle-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.ig-toggle-label {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    line-height: 1;
}

/* ================================
   Podcast Section - Custom Player
   ================================ */
.podcast-section {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.podcast-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
}

.podcast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: var(--spacing-sm) 0;
    touch-action: manipulation;
}

.podcast-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.podcast-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.podcast-header-text h2 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.podcast-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.podcast-toggle-icon {
    font-size: 0.625rem;
    transition: var(--transition);
    color: var(--text-muted);
}

.podcast-section.collapsed .podcast-toggle-icon {
    transform: rotate(-90deg);
}

.podcast-section.collapsed .podcast-player { display: none; }

.podcast-player {
    padding: var(--spacing-sm) 0 var(--spacing-xs);
}

.podcast-player audio { display: none; }

.podcast-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.podcast-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.podcast-play-btn:hover { background: var(--accent-hover); }
.podcast-play-btn:active { transform: scale(0.95); }

.play-icon { margin-left: 2px; }

.podcast-progress-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.podcast-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    touch-action: none;
}

.podcast-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.podcast-progress-knob {
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
    touch-action: none;
}

.podcast-progress-bar:hover .podcast-progress-knob,
.podcast-progress-bar:active .podcast-progress-knob {
    opacity: 1;
}

.podcast-progress-bar:hover {
    height: 8px;
}

.podcast-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.podcast-speed-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: none;
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
}

.podcast-speed-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ================================
   Main Content
   ================================ */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-left: calc(var(--spacing-md) + var(--safe-left));
    padding-right: calc(var(--spacing-md) + var(--safe-right));
    width: 100%;
}

/* Hide sidebar on all views */
.filters-sidebar { display: none; }

/* ================================
   News Section
   ================================ */
.news-section { width: 100%; }

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.news-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.news-header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}


.news-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ================================
   News Grid - Magazine Layout
   ================================ */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

/* ================================
   News Card
   ================================ */
.news-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.news-card:active {
    transform: scale(0.99);
}

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--bg-secondary);
    display: block;
}


.news-card-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.news-card-source {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.news-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-card-date::before {
    content: "\00b7";
    margin-right: var(--spacing-sm);
}

.news-card-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.news-card-author::before {
    content: "\00b7";
    margin-right: var(--spacing-sm);
}

/* Share button */
.share-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.share-btn:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

.share-btn:active {
    transform: scale(0.9);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow-hover);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Highlight article when navigated to */
.news-card.highlight {
    animation: highlight-pulse 2s ease;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 0 3px var(--accent-color), var(--shadow-hover); }
}

.news-card-region {
    display: none;
}

.translated-badge {
    font-size: 0.6875rem;
    cursor: help;
}

.news-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
    display: block;
}

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

/* ================================
   Tweet Card
   ================================ */
.news-card.tweet-card {
    border-left: 3px solid #0f1419;
}

.tweet-badge {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f1419;
    line-height: 1;
}

.news-card.tweet-card .news-card-source {
    color: #0f1419;
}

.ig-badge {
    font-size: 0.8125rem;
    font-weight: 700;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

/* ================================
   Hero Card - First article
   ================================ */
.news-card.hero-card {
    grid-column: 1 / -1;
}

.news-card.hero-card .news-card-image {
    aspect-ratio: 2 / 1;
}

.news-card.hero-card .news-card-title {
    font-size: 1.625rem;
    line-height: 1.25;
    -webkit-line-clamp: 4;
}

.news-card.hero-card .news-card-excerpt {
    -webkit-line-clamp: 3;
    font-size: 1rem;
}

/* ================================
   Loading & Empty States
   ================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.loading-spinner.hidden { display: none; }

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md);
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* ================================
   Load More
   ================================ */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    touch-action: manipulation;
    min-height: 44px;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

/* ================================
   Footer
   ================================ */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-md);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-bottom));
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.footer-sources {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-update {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.auto-update-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.6875rem;
    color: var(--success-color);
    background: rgba(22, 163, 74, 0.08);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* ================================
   Tablet (768px+)
   ================================ */
@media (min-width: 768px) {
    .header {
        padding: 0 var(--spacing-lg);
    }

    .header-search {
        display: block;
    }

    .logo { font-size: 1.5rem; }

    .category-tabs { padding: 0 var(--spacing-lg); }

    .main-content {
        padding: var(--spacing-sm) var(--spacing-lg);
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .news-card:hover {
        box-shadow: var(--shadow-hover);
        transform: translateY(-2px);
    }

    .news-card:active {
        transform: translateY(-2px);
    }

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

    .podcast-container {
        padding: var(--spacing-sm) var(--spacing-lg);
    }
}

/* ================================
   Desktop (1024px+)
   ================================ */
@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .news-card.hero-card .news-card-title {
        font-size: 1.875rem;
    }
}

/* ================================
   Large Desktop (1400px+)
   ================================ */
@media (min-width: 1400px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ================================
   Mobile (<768px)
   ================================ */
@media (max-width: 767px) {
    :root {
        --header-height: 48px;
        --tabs-height: 40px;
    }

    .header {
        padding: 0 var(--spacing-sm);
    }

    .header-content {
        gap: var(--spacing-xs);
        padding: 0;
    }

    .header-left {
        gap: var(--spacing-sm);
    }

    .logo {
        font-size: 1.125rem;
    }

    .logo-emblem {
        height: 1.5rem;
        width: 1.5rem;
        max-width: 1.5rem;
    }

    .header-updated {
        font-size: 0.6rem;
    }

    .header-actions {
        gap: 0;
    }

    .header-actions .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .header-search {
        display: none;
    }

    .header-search.mobile-visible {
        display: block;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        padding: var(--spacing-sm) var(--spacing-md);
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        max-width: none;
        z-index: 998;
    }

    .search-toggle-btn {
        background: none;
        border: none;
        width: 38px;
        height: 38px;
        border-radius: var(--radius-full);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        transition: var(--transition-fast);
        touch-action: manipulation;
    }

    .search-toggle-btn:active {
        transform: scale(0.92);
    }

    /* Tabs */
    .category-tabs {
        padding: 0 var(--spacing-sm);
    }

    .category-tab {
        padding: 0 var(--spacing-sm);
        font-size: 0.75rem;
    }

    /* Main content */
    .main-content {
        padding: var(--spacing-xs) var(--spacing-sm);
        padding-left: calc(var(--spacing-sm) + var(--safe-left));
        padding-right: calc(var(--spacing-sm) + var(--safe-right));
    }

    /* News header controls full width */
    .news-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-xs);
    }

    .news-header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .news-count {
        font-size: 0.75rem;
    }

    /* Cards */
    .news-grid {
        gap: var(--spacing-sm);
    }

    .news-card-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .news-card-title {
        font-size: 1rem;
    }

    .news-card-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 3;
    }

    /* Hero card mobile */
    .news-card.hero-card .news-card-image {
        aspect-ratio: 16 / 9;
    }

    .news-card.hero-card .news-card-title {
        font-size: 1.25rem;
    }

    .news-card.hero-card .news-card-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
    }

    /* Podcast */
    .podcast-container {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .podcast-header-text h2 {
        font-size: 0.8125rem;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-md) var(--spacing-sm);
        padding-bottom: calc(var(--spacing-md) + var(--safe-bottom));
    }

    .footer p {
        font-size: 0.75rem;
    }

    .footer-sources {
        font-size: 0.625rem;
    }
}

@media (min-width: 768px) {
    .search-toggle-btn { display: none; }
}

/* ================================
   Skip to content (a11y)
   ================================ */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10001;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: var(--spacing-sm);
}

/* ================================
   Read/Unread articles
   ================================ */
.news-card.read-article {
    opacity: 0.7;
}

[data-theme="dark"] .news-card.read-article {
    opacity: 0.55;
}

.read-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.read-badge svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-read-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.detail-read-badge svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ================================
   Bookmark button
   ================================ */
.bookmark-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.bookmark-btn:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

.bookmark-btn.bookmarked {
    color: var(--accent-color);
}

/* ================================
   Offline banner
   ================================ */
.offline-banner {
    background: #f59e0b;
    color: #1a1a1a;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1001;
}

/* ================================
   Focus visible (a11y)
   ================================ */
.news-card:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: var(--shadow-hover);
}

.category-tab:focus-visible,
.theme-toggle:focus-visible,
.bookmark-btn:focus-visible,
.share-btn:focus-visible,
.podcast-play-btn:focus-visible,
.podcast-speed-btn:focus-visible,
.btn-primary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ================================
   Language toggle
   ================================ */
.lang-toggle-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ================================
   Modal / Overlay
   ================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    animation: slideUp 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}

.modal-header h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.modal-close-btn:hover {
    background: var(--border-color);
    border-color: transparent;
    color: var(--text-primary);
}

.modal-close-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.modal-body {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.modal-empty {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-lg);
    font-size: 0.875rem;
}

.related-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    background: var(--bg-secondary);
}

.related-card-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.related-card-info {
    flex: 1;
    min-width: 0;
}

.related-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.related-card-source {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 767px) {
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-backdrop.detail-backdrop {
        align-items: stretch;
    }

    .modal-content {
        max-width: 100%;
        max-height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal-header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ================================
   Article Detail Modal
   ================================ */
.detail-modal {
    max-width: 720px;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.detail-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    will-change: transform, opacity;
}

.detail-modal-body {
    padding: 0;
    gap: 0;
}

.detail-modal-image-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.detail-modal-image {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.detail-modal-title {
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    padding: var(--spacing-lg) var(--spacing-lg) 0;
}

.detail-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.detail-modal-dot {
    margin: 0 2px;
    color: var(--text-muted);
}

.detail-modal-region {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-modal-author {
    font-style: italic;
}

.detail-modal-description {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.detail-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    gap: var(--spacing-md);
}

.detail-modal-read-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.detail-modal-read-btn:hover {
    background: var(--accent-hover);
}

.detail-modal-read-btn:active {
    transform: scale(0.97);
}

.detail-modal-read-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.detail-modal-secondary-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.detail-share-btn,
.detail-bookmark-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.detail-share-btn:hover,
.detail-bookmark-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light);
}

.detail-bookmark-btn.bookmarked {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.detail-share-btn:focus-visible,
.detail-bookmark-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.detail-modal-original {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.detail-modal-original-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.detail-modal-original-desc {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}

.detail-modal--tweet {
    border-top: 3px solid var(--text-primary);
}

.detail-modal-handle {
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    margin: 8px auto 0;
    opacity: 0.4;
}

.detail-modal-source {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 767px) {
    .detail-modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .detail-modal .modal-header {
        border-radius: 0;
    }

    .detail-modal-title {
        font-size: 1.1875rem;
    }

    .detail-modal-image {
        max-height: 240px;
    }

    .detail-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-modal-read-btn {
        justify-content: center;
        width: 100%;
    }

    .detail-modal-secondary-actions {
        justify-content: center;
    }

    .modal-backdrop.detail-backdrop {
        padding: 0;
        align-items: stretch;
    }
}

/* ================================
   Article Navigation (Detail Modal)
   ================================ */
.detail-nav-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.detail-nav-progress {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.detail-nav-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    border-radius: var(--radius-full);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
    box-shadow: 0 0 6px rgba(245, 40, 40, 0.3);
}

[data-theme="dark"] .detail-nav-progress-fill {
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
}

.detail-nav-counter {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-nav-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    touch-action: manipulation;
    flex-shrink: 0;
}

.detail-nav-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light);
}

.detail-nav-btn:active:not(:disabled) {
    transform: scale(0.93);
}

.detail-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.detail-nav-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Swipe hint overlay */
.detail-swipe-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 5;
}

.detail-swipe-hint.top {
    top: 12px;
}

.detail-swipe-hint.bottom {
    bottom: 12px;
}

.detail-swipe-hint.visible {
    opacity: 0.7;
}

/* Mobile: hide desktop nav buttons, show swipe handle */
@media (max-width: 767px) {
    .detail-nav-btn {
        display: none;
    }

    .detail-nav-bar {
        padding: var(--spacing-xs) var(--spacing-md);
    }
}

/* Desktop: hide the drag handle */
@media (min-width: 768px) {
    .detail-modal-handle {
        display: none;
    }
}

[dir="rtl"] .detail-modal-read-btn {
    flex-direction: row-reverse;
}

@media (max-width: 767px) {
    [dir="rtl"] .detail-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ================================
   Related button on card
   ================================ */
.related-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.related-btn:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

.related-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ================================
   Share Collection (Footer)
   ================================ */
.footer-share {
    margin-top: var(--spacing-md);
}

.share-collection-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 20px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.share-collection-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.share-collection-btn:active {
    transform: scale(0.97);
}

.share-collection-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ================================
   RTL Support (Persian)
   ================================ */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-search {
    direction: rtl;
}

[dir="rtl"] .header-search input {
    padding: 8px 40px 8px 16px;
    text-align: right;
}

[dir="rtl"] .search-icon {
    left: auto;
    right: 13px;
}

[dir="rtl"] .category-tabs-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .news-card-meta {
    flex-direction: row-reverse;
}

[dir="rtl"] .bookmark-btn {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .news-card.tweet-card {
    border-left: none;
    border-right: 3px solid #0f1419;
}

[dir="rtl"] .news-toggle,
[dir="rtl"] .tweet-toggle,
[dir="rtl"] .ig-toggle {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

[dir="rtl"] .podcast-header-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .podcast-controls {
    flex-direction: row-reverse;
}


[dir="rtl"] .related-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .share-collection-btn {
    flex-direction: row-reverse;
}

/* ================================
   Utility
   ================================ */
.hidden { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   iOS Safari Fixes
   ================================ */
@supports (-webkit-touch-callout: none) {
    body { min-height: -webkit-fill-available; }
    .header-search input { font-size: 16px; }
}

@media (orientation: landscape) {
    .header {
        padding-left: calc(var(--spacing-md) + var(--safe-left));
        padding-right: calc(var(--spacing-md) + var(--safe-right));
    }
}



/* ================================
   Cluster Badge
   ================================ */
.cluster-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-light);
    color: var(--accent-color);
    border: none;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    touch-action: manipulation;
    white-space: nowrap;
}

.cluster-badge:hover {
    background: var(--accent-color);
    color: #ffffff;
}

.cluster-badge:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.cluster-badge-icon {
    font-size: 0.625rem;
    transition: transform var(--transition-fast);
}

.cluster-badge.expanded .cluster-badge-icon {
    transform: rotate(180deg);
}

/* ================================
   Cluster Expansion
   ================================ */
.cluster-expansion {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: fadeIn 0.2s ease;
}

.cluster-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

.cluster-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.cluster-item-source {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    min-width: 80px;
}

.cluster-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cluster-item-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cluster-item-separator {
    color: var(--text-muted);
    margin: 0 2px;
}

/* ================================
   Perspective Dots
   ================================ */
.perspective-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.perspective-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    cursor: help;
}

.perspective-dot[data-perspective="state"] { background: #ef4444; }
.perspective-dot[data-perspective="opposition"] { background: #3b82f6; }
.perspective-dot[data-perspective="western"] { background: #22c55e; }
.perspective-dot[data-perspective="regional"] { background: #f97316; }
.perspective-dot[data-perspective="swedish"] { background: #eab308; }

.perspective-dot::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.perspective-dot:hover::after {
    opacity: 1;
}

/* Perspective Legend */
.perspective-legend {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-md);
    justify-content: center;
    margin: 0 auto;
    padding: 6px 16px;
}

.perspective-legend .news-count {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
}

.perspective-legend-sep {
    background: var(--border-color);
    height: 14px;
    width: 1px;
}

.perspective-legend-item {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 0.6875rem;
    gap: 4px;
    white-space: nowrap;
}

.perspective-legend-item .perspective-dot {
    cursor: default;
    height: 7px;
    width: 7px;
}

/* ================================
   Small phones (<375px, iPhone SE etc.)
   ================================ */
@media (max-width: 374px) {
    .logo {
        font-size: 1rem;
    }

    .logo-emblem {
        height: 1.25rem;
        width: 1.25rem;
        max-width: 1.25rem;
    }

    .header-actions .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .search-toggle-btn {
        width: 34px;
        height: 34px;
    }

    .category-tab {
        padding: 0 6px;
        font-size: 0.6875rem;
    }

    .news-card.hero-card .news-card-title {
        font-size: 1.125rem;
    }

}

/* ================================
   Mobile adjustments for new features
   ================================ */
@media (max-width: 767px) {
    .cluster-expansion {
        padding: var(--spacing-xs);
        gap: 4px;
    }

    .cluster-item {
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .cluster-item:last-child {
        border-bottom: none;
    }

    .cluster-item-source {
        font-size: 0.6875rem;
        min-width: auto;
        order: 1;
    }

    .cluster-item-separator {
        display: none;
    }

    .cluster-item-title {
        flex-basis: 100%;
        order: 3;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    .cluster-item-time {
        order: 2;
        margin-left: auto;
    }

    .cluster-item .perspective-dot {
        order: 0;
    }

    .perspective-legend {
        padding: 5px 12px;
        gap: var(--spacing-xs) var(--spacing-sm);
    }

    .perspective-legend .news-count {
        font-size: 0.75rem;
    }

    .perspective-legend-sep {
        height: 12px;
    }

    .perspective-legend-item {
        font-size: 0.625rem;
        gap: 3px;
    }
}

/* ================================
   Dark theme adjustments
   ================================ */
[data-theme="dark"] .cluster-item:hover {
    background: var(--bg-primary);
}

/* ================================
   RTL Support for new features
   ================================ */
[dir="rtl"] .perspective-legend {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .perspective-dots {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .perspective-dot::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .cluster-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .cluster-item-source {
    text-align: right;
}

/* ================================
   Reduced Motion (WCAG 2.3.3)
   ================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}