/* ============================================================
   cYHBernews — style.css
   Design system: Modern Dark / Premium Video Layout
   Typography: Inter, system-ui
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Oswald:wght@500;700&display=swap');

:root {
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Oswald', 'Inter', sans-serif;
  
  /* YouTube-like Dark Theme */
  --bg: #0f0f0f;
  --surface: #212121;
  --surface-hover: #3d3d3d;
  --surface-light: #272727;
  --text: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-tertiary: #717171;
  --accent: #ff0000;
  --accent-hover: #cc0000;
  --border: #3f3f3f;
  --border-light: rgba(255, 255, 255, 0.1);
  
  --pill-bg: #272727;
  --pill-hover: #3f3f3f;
  --pill-active: #f1f1f1;
  --pill-active-text: #0f0f0f;
  
  --header-height: 56px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;

  --ease-spring: cubic-bezier(0.5, 0, 0.1, 1);
  --dur-normal: 300ms;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --surface-hover: #e5e5e5;
  --surface-light: #e5e5e5;
  --text: #0f0f0f;
  --text-secondary: #606060;
  --text-tertiary: #909090;
  --border: #cccccc;
  --border-light: rgba(0, 0, 0, 0.1);
  
  --pill-bg: #f2f2f2;
  --pill-hover: #e5e5e5;
  --pill-active: #0f0f0f;
  --pill-active-text: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; }
ul, ol { list-style: none; }

/* Loader */
#loader-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  transition: opacity var(--dur-normal), visibility var(--dur-normal);
}
#loader-overlay.hide { opacity: 0; visibility: hidden; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader-logo { width: 64px; height: 64px; object-fit: contain; animation: loaderFloat 2s ease-in-out infinite; }
@keyframes loaderFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.loader-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--text); letter-spacing: 1px; }
.loader-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.loader-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
.loader-bar-track { width: 200px; height: 4px; background: var(--surface); border-radius: 2px; overflow: hidden; }
.loader-bar-fill { height: 100%; width: 0%; background: #1c62b9; transition: width 0.3s; }

/* ── APP HEADER ── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}
.header-left, .header-center, .header-right { display: flex; align-items: center; }
.header-left { gap: 16px; width: 20%; min-width: 200px; }
.header-center { flex: 1; justify-content: center; max-width: 720px; gap: 8px; }
.header-right { gap: 16px; width: 20%; justify-content: flex-end; min-width: 240px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--surface-light); }
.icon-btn svg { width: 24px; height: 24px; stroke-width: 1.5; }

.logo { display: flex; align-items: center; gap: 6px; }
.logo-icon-img { width: 28px; height: 28px; object-fit: contain; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.5px; }

/* Search Bar */
.search-bar { display: flex; flex: 1; max-width: 600px; height: 40px; }
.search-input-wrapper {
  flex: 1; border: 1px solid var(--border); border-right: none;
  border-radius: 40px 0 0 40px;
  background: var(--bg);
  display: flex; align-items: center; padding-left: 20px;
  position: relative;
  transition: border-color 0.2s;
}
.search-input-wrapper:focus-within {
  border-color: #1c62b9; /* YouTube blue focus */
  margin-left: -1px; /* visual fix for border */
}
.search-icon-inside { width: 20px; height: 20px; color: var(--text); margin-right: 12px; display: none; }
.search-input-wrapper:focus-within .search-icon-inside { display: block; }

#news-search {
  width: 100%; background: transparent; border: none; color: var(--text); font-size: 16px; outline: none;
}
#news-search::placeholder { color: var(--text-tertiary); font-weight: 400; }
.clear-search-btn {
  background: none; border: none; padding: 0 12px; cursor: pointer; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; transition: color 0.2s;
}
.clear-search-btn:hover { color: var(--text); }
.search-btn {
  width: 64px; border: 1px solid var(--border); border-radius: 0 40px 40px 0;
  background: var(--surface-light); display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: background 0.2s;
}
.search-btn:hover { background: var(--surface-hover); }
.search-btn svg { width: 20px; height: 20px; stroke-width: 2; }
.mic-btn { background: var(--surface-light); margin-left: 8px; width: 40px; height: 40px; border-radius: 50%; }

.notification-btn { position: relative; }
.badge { position: absolute; top: 4px; right: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #0056b3; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; margin-left: 8px; }
.mobile-only-search { display: none; }

/* ── LAYOUT GRID ── */
.app-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ── SIDEBAR ── */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg);
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  min-height: calc(100vh - var(--header-height));
  overflow: visible;
  padding-bottom: 32px;
  display: flex; flex-direction: column;
  transition: width 0.2s var(--ease-spring);
  flex-shrink: 0;
}
body.sidebar-closed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.app-sidebar:hover::-webkit-scrollbar-thumb { background: var(--text-tertiary); }

.sidebar-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
body.sidebar-closed .sidebar-section .section-title { display: none; }
body.sidebar-closed .sidebar-footer { display: none; }

.section-title { padding: 8px 24px; font-size: 14px; font-weight: 600; color: var(--text); }
.sidebar-item {
  display: flex; align-items: center; padding: 10px 24px; gap: 20px;
  font-size: 14px; font-weight: 400; color: var(--text);
  margin: 0 12px; border-radius: 10px;
  transition: background 0.2s;
}
body.sidebar-closed .sidebar-item {
  flex-direction: column; gap: 4px; padding: 16px 0; margin: 0 4px; font-size: 10px; text-align: center;
}
body.sidebar-closed .sidebar-item span {
  width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px;
}
.sidebar-item:hover { background: var(--surface-light); }
.sidebar-item.active { background: var(--surface-hover); font-weight: 500; }
.sidebar-item.active-topic { font-weight: 600; }
.sidebar-item svg { width: 22px; height: 22px; stroke-width: 1.5; flex-shrink: 0; }

.sidebar-footer { padding: 16px 24px; font-size: 13px; color: var(--text-tertiary); display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border-light); }
.sidebar-footer p { text-align: left; }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-secondary); transition: color 0.2s; }
.sidebar-footer a:hover { color: var(--text); }
.sidebar-footer .footer-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ── MAIN CONTENT ── */
.app-main {
  flex: 1;
  background: var(--bg);
  min-width: 0;
  padding: 24px 40px;
}

/* Hero Section */
.hero-section {
  width: 100%;
  margin-bottom: 24px;
}
.hero-card {
  position: relative;
  width: 100%;
  min-height: 380px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 36px;
  text-decoration: none;
  color: #fff;
  background: #0f141c;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid var(--border-light);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.6);
}
.hero-card img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0.75;
  transition: transform 0.5s ease;
}
.hero-card:hover img {
  transform: scale(1.02);
}
.hero-card::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(13,17,23,0.2) 0%, rgba(13,17,23,0.7) 45%, rgba(13,17,23,0.96) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2; display: flex; flex-direction: column; gap: 12px;
  max-width: 920px;
}
.hero-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: fit-content;
  align-self: flex-start;
}
.hero-badge {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.5px; text-transform: uppercase;
  width: fit-content;
}
.hero-badge svg { width: 14px; height: 14px; stroke-width: 2.5; }
.grid-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 4px; display: flex; align-items: center; gap: 4px; letter-spacing: 0.5px;
}
.grid-badge svg { width: 12px; height: 12px; stroke-width: 2.5; }
.hero-category {
  font-size: 12px; font-weight: 700; color: #e2e8f0; letter-spacing: 0.8px; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(8px);
  padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.18);
  width: fit-content;
  display: inline-flex;
  align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 40px); font-weight: 700; line-height: 1.22; letter-spacing: -0.5px;
  margin: 0;
}
.hero-title a {
  color: #ffffff;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  transition: color 0.2s;
}
.hero-title a:hover {
  color: var(--accent);
}
.hero-desc {
  font-size: 15px; color: #cbd5e1; line-height: 1.6; font-weight: 400; max-width: 850px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.hero-meta {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #9ca3af; font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  flex-wrap: wrap;
}
.hero-meta-dot { opacity: 0.5; }
.hero-source {
  display: flex; align-items: center; gap: 8px; font-weight: 600; color: #fff;
}
.hero-source-avatar {
  width: 24px; height: 24px; background: #0f857e; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 700;
}
.hero-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px;
}
.read-story-btn {
  background: #fff; color: #000; font-weight: 600; font-size: 14px; height: 42px; padding: 0 22px; border-radius: 21px; border: none; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.read-story-btn:hover { background: #e5e5e5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.read-story-btn svg { width: 16px; height: 16px; stroke-width: 2.2; }

/* Category Pills */
.pills-container-wrapper {
  position: sticky; top: var(--header-height); z-index: 100;
  background: var(--bg);
  padding: 16px 0;
  margin: 0 -40px 24px; padding-left: 40px; padding-right: 40px;
  border-bottom: 1px solid var(--border-light);
}
.category-pills {
  display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 8px 16px; border-radius: 8px; background: var(--pill-bg); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.pill:hover { background: var(--pill-hover); }
.pill.active { background: var(--pill-active); color: var(--pill-active-text); font-weight: 600; }

/* News Grid (YouTube style) */
.news-feed {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px 16px;
}

.news-card {
  display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text);
  position: relative;
  height: 100%;
}
.card-thumbnail {
  width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--surface);
}
.card-thumbnail img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease-spring);
}
.news-card:hover .card-thumbnail img { transform: scale(1.05); }

/* Play/Share hover overlay */
.card-thumbnail-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; z-index: 2;
}
.news-card:hover .card-thumbnail-overlay { opacity: 1; }
.share-btn {
  background: rgba(15,15,15,0.72); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; backdrop-filter: blur(8px); position: relative; z-index: 3; box-shadow: 0 4px 12px rgba(0,0,0,0.22); transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.share-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.42); transform: translateY(-2px); }
.share-btn.active { color: #ff5b78; background: rgba(255,91,120,0.18); border-color: rgba(255,91,120,0.55); }
.share-btn.active:hover { background: rgba(255,91,120,0.28); }
.share-btn svg { width: 20px; height: 20px; pointer-events: none; }
.share-btn.active svg { filter: drop-shadow(0 0 6px rgba(255,91,120,0.45)); }
.like-count { min-width: 0; font-size: 12px; font-weight: 700; line-height: 1; }
.share-btn.like-btn:has(.like-count:not(:empty)) { width: auto; min-width: 44px; padding: 0 10px; border-radius: 22px; }
.hero-action-btn { width: auto; min-height: 42px; height: 42px; padding: 0 16px; border-radius: 21px; }
.hero-action-btn .action-label { font-size: 13px; font-weight: 600; }
.hero-action-btn.like-btn .like-count:not(:empty)::before { content: '•'; margin-right: 6px; opacity: 0.55; }
.card-actions { display: flex; gap: 8px; }

.card-details { display: flex; gap: 12px; align-items: flex-start; flex: 1; }
.card-source-icon {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface-hover); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--text); text-transform: uppercase; margin-top: 4px;
}
.card-info { display: flex; flex-direction: column; gap: 4px; flex: 1; height: 100%; }
.card-title {
  font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
  margin-bottom: 2px;
}
.card-meta-small {
  font-size: 14px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; font-weight: 400;
}
.card-meta-small span.source { color: var(--text-secondary); }
.card-meta-small div.stats { display: flex; align-items: center; gap: 4px; }

/* Empty state / Pager */
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; padding: 60px 20px; gap: 16px; color: var(--text-secondary); text-align: center; }
.clear-filters-btn { padding: 10px 20px; background: var(--surface-light); border-radius: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: background 0.2s; }
.clear-filters-btn:hover { background: var(--surface-hover); }

.pager { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 40px; margin-bottom: 40px; }
#pager-status { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
#load-more-news { background: var(--pill-active); color: var(--pill-active-text); font-weight: 600; padding: 12px 32px; border-radius: 24px; font-size: 15px; display: flex; align-items: center; gap: 8px; transition: transform 0.2s; }
#load-more-news:hover { transform: translateY(-2px); }

/* Responsive */
/* Rail colapsado: solo tablet/desktop pequeño. Por debajo de 769px el sidebar
   es un drawer completo, así que estas reglas no deben alcanzarlo. */
@media (min-width: 769px) and (max-width: 1024px) {
  body:not(.sidebar-closed) .app-sidebar { width: var(--sidebar-collapsed-width); }
  body:not(.sidebar-closed) .sidebar-section .section-title { display: none; }
  body:not(.sidebar-closed) .sidebar-footer { display: none; }
  body:not(.sidebar-closed) .sidebar-item { flex-direction: column; gap: 4px; padding: 16px 0; margin: 0 4px; font-size: 10px; text-align: center; }
  body:not(.sidebar-closed) .sidebar-item span { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.mobile-close-search { display: none; }

/* Scrim del drawer móvil (oculto por defecto en desktop) */
.sidebar-scrim { display: none; }

@media (max-width: 768px) {
  .app-main { padding: 16px; }
  .pills-container-wrapper { margin: 0 -16px 16px; padding-left: 16px; padding-right: 16px; }
  
  .header-left { min-width: 0; width: auto; gap: 8px; }
  .header-right { min-width: 0; width: auto; gap: 8px; }
  .logo-text { display: none; }
  .header-center { display: none; }
  .mobile-only-search { display: flex; }
  
  .app-header.mobile-search-active .header-left,
  .app-header.mobile-search-active .header-right { display: none; }
  .app-header.mobile-search-active .header-center {
    display: flex; width: 100%; max-width: none;
  }
  .app-header.mobile-search-active .mobile-close-search { display: flex; margin-right: 8px; }
  .app-header.mobile-search-active .mic-btn { display: none; }
  
  .hero-card { min-height: 320px; padding: 20px 16px; border-radius: 14px; }
  .hero-content, .hero-desc { max-width: 100%; }
  .hero-content { gap: 10px; }
  .hero-title { font-size: 20px; line-height: 1.25; }
  .hero-desc { font-size: 13px; line-height: 1.5; -webkit-line-clamp: 3; }
  .hero-actions { gap: 8px; margin-top: 4px; }
  .hero-card .read-story-btn { font-size: 13px; height: 38px; padding: 0 16px; }
  .hero-action-btn { min-height: 38px; height: 38px; padding: 0 12px; }
  .hero-action-btn .action-label { display: none; }
  /* ── SIDEBAR COMO DRAWER OFF-CANVAS ── */
  .app-sidebar {
    position: fixed; left: 0; top: var(--header-height); bottom: 0;
    z-index: 900;
    width: min(82vw, var(--sidebar-width));
    min-height: 0;
    transform: translateX(-100%);
    transition: transform var(--dur-normal) var(--ease-spring);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
    border-right: 1px solid var(--border-light);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    padding-bottom: 16px;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  /* Bloquea el scroll del fondo mientras el drawer está abierto */
  body.sidebar-open { overflow: hidden; }

  /* El body puede arrastrar .sidebar-closed desde una sesión en desktop:
     forzamos siempre el layout completo del drawer en móvil. */
  body.sidebar-closed .app-sidebar { width: min(82vw, var(--sidebar-width)); }
  body.sidebar-closed .sidebar-section .section-title { display: block; }
  body.sidebar-closed .sidebar-footer { display: flex; }
  body.sidebar-closed .sidebar-item,
  .sidebar-item {
    flex-direction: row; align-items: center; text-align: left;
    gap: 18px; padding: 12px 20px; margin: 0 8px; font-size: 15px;
  }
  body.sidebar-closed .sidebar-item span,
  .sidebar-item span { width: auto; padding: 0; }
  .section-title { padding: 8px 20px; }

  .app-sidebar .sidebar-footer { display: flex; padding: 16px 20px; }
  .sidebar-footer p { display: block; }
  .sidebar-footer .footer-link-text { display: inline; }
  .sidebar-footer .footer-icon { width: 20px; height: 20px; margin: 0; }

  /* Fondo oscurecido detrás del drawer */
  .sidebar-scrim {
    display: block;
    position: fixed; inset: var(--header-height) 0 0 0;
    z-index: 890;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden;
    transition: opacity var(--dur-normal), visibility var(--dur-normal);
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; }
}

/* Card Read More */
.card-read-more {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  margin-top: auto;
  padding-top: 8px;
  transition: gap 0.2s;
}
.card-read-more:hover { gap: 8px; }
.card-read-more svg { width: 14px; height: 14px; }

/* Toast & Back to Top */
.toast { position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 24px; border-radius: 8px; font-weight: 500; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 10000; transition: bottom 0.3s var(--ease-spring); display: flex; align-items: center; gap: 8px; }
.toast.show { bottom: 32px; }
.back-to-top { position: fixed; bottom: 32px; right: 32px; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-light); color: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); opacity: 0; transform: translateY(20px); pointer-events: none; transition: all 0.3s var(--ease-spring); z-index: 90; }
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--surface-hover); }

/* ── NEWS MODAL ── */
.news-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}
.news-modal.active { opacity: 1; visibility: visible; pointer-events: auto; }
.news-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
}
.news-modal-content {
  position: relative; z-index: 1;
  width: 90%; max-width: 560px; max-height: 90vh;
  background: var(--surface); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(20px); transition: transform 0.3s var(--ease-spring);
}
.news-modal.active .news-modal-content { transform: translateY(0); }
.news-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background 0.2s;
}
.news-modal-close:hover { background: var(--accent); }
.news-modal-close svg { width: 20px; height: 20px; }
.news-modal-image {
  width: 100%; aspect-ratio: 16/9; overflow: hidden; flex-shrink: 0;
  background: var(--bg);
}
.news-modal-image img { width: 100%; height: 100%; object-fit: cover; }
.news-modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-category {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  line-height: 1.2; color: var(--text);
}
.modal-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.modal-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-tertiary); }
.modal-source { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-secondary); }
.modal-source-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text);
}
.modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.modal-action-btn {
  display: flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 14px; border-radius: 21px;
  background: var(--surface-light); color: var(--text); border: 1px solid transparent;
  font-size: 13px; font-weight: 600;
  transition: background 0.2s;
}
.modal-action-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.modal-action-btn.active { color: #ff5b78; background: rgba(255,91,120,0.12); border-color: rgba(255,91,120,0.4); }
.modal-action-btn.active svg { filter: drop-shadow(0 0 5px rgba(255,91,120,0.4)); }
.modal-action-btn svg { width: 18px; height: 18px; }
.modal-read-full {
  background: var(--accent); color: #fff; text-decoration: none;
}
.modal-read-full:hover { background: var(--accent-hover); }

.card-title.card-preview-trigger { cursor: pointer; transition: color 0.15s ease; }
.card-title.card-preview-trigger:hover { color: var(--accent); }
