/* =============================================
   SaveOnPhone News Page Styles
   Append to main style.css
   ============================================= */

/* ── Hero Section ── */
.news-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1e3a5f 100%);
  padding: 64px 24px 48px;
  text-align: center;
  color: var(--white);
}

.news-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.news-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.news-hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  margin: 0 0 16px;
  line-height: 1.5;
}

.news-hero-count {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

/* ── Filter Bar (sticky) ── */
.news-filter-bar {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.news-filter-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.news-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.news-pill {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.news-pill:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: rgba(16,185,129,0.06);
}

.news-pill.active {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

/* ── Search Box ── */
.news-search-wrap {
  position: relative;
  min-width: 200px;
}

.news-search {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--slate-800);
  background: var(--slate-50);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.news-search:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

.news-search::placeholder {
  color: var(--slate-400);
}

.news-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

/* ── Main Content Area ── */
.news-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Card Grid ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ── Card ── */
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: newsCardFadeIn 0.35s ease both;
}

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

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

/* ── Card Gradient Header ── */
.news-card-gradient {
  position: relative;
  height: 110px;
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
}

.news-card-badge {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 14px;
}

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

.news-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-800);
  margin: 0 0 6px;
  line-height: 1.35;
}

.news-card-date {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-bottom: 10px;
}

.news-card-excerpt {
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.55;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  transition: color 0.2s;
}

.news-card:hover .news-card-link {
  color: var(--teal-dark);
}

/* ── Load More ── */
.news-load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.news-load-more {
  display: inline-block;
  padding: 12px 40px;
  background: var(--teal);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.news-load-more:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

/* ── No Results ── */
.news-no-results {
  text-align: center;
  color: var(--slate-400);
  font-size: 1.1rem;
  padding: 60px 0;
}

/* ── Responsive: Single Column on Mobile ── */
@media (max-width: 720px) {
  .news-hero {
    padding: 48px 20px 36px;
  }

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

  .news-hero-subtitle {
    font-size: 1rem;
  }

  .news-filter-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }

  .news-filter-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .news-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .news-search-wrap {
    min-width: unset;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .news-main {
    padding: 20px 16px 48px;
  }

  .news-card-gradient {
    height: 90px;
  }
}


/* ============================================================
   SaveOnPhone.com — News Styles Additions
   Article page + Dark mode for news & article pages
   Appended to news-styles.css
   ============================================================ */


/* ──────────────────────────────────────────────────────────────
   1. ARTICLE PAGE STYLES
   ────────────────────────────────────────────────────────────── */

/* Article header — hero-like dark gradient section */
.article-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #0f3460 100%);
  padding: 48px 24px 40px;
  position: relative;
  overflow: hidden;
}
.article-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Centered inner container */
.article-header-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

/* Breadcrumb */
.article-header-breadcrumb {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
}
.article-header-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
}
.article-header-breadcrumb a:hover {
  color: var(--teal);
}
.article-header-breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

/* Category badge */
.article-header-badge {
  display: inline-block;
  background: rgba(16,185,129,0.15);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border: 1px solid rgba(16,185,129,0.25);
}

/* Article title */
.article-header-title {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

/* Date and author meta line */
.article-header-meta {
  font-size: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.article-header-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-header-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Divider */
.article-header-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 24px;
}


/* ── Article body ── */
.article-body-wrap {
  padding: 40px 24px 56px;
  background: var(--body-bg);
}

/* Article content container — clean readable typography */
.article-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
}

/* Paragraphs */
.article-content p {
  margin-bottom: 20px;
}

/* Headings inside article */
.article-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.article-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.35;
}

/* Lists */
.article-content ul,
.article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.article-content ul {
  list-style: disc;
}
.article-content ol {
  list-style: decimal;
}
.article-content li {
  margin-bottom: 8px;
  color: var(--text-primary);
}
.article-content li::marker {
  color: var(--teal);
}

/* Blockquote */
.article-content blockquote {
  border-left: 4px solid var(--teal);
  margin: 28px 0;
  padding: 16px 24px;
  background: var(--slate-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Links inside article */
.article-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.article-content a:hover {
  color: var(--teal-dark);
}

/* Images inside article */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 24px 0;
}

/* Code inline */
.article-content code {
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

/* Horizontal rule inside content */
.article-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 32px 0;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 720px;
  margin: 0 auto;
  padding-top: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
}
.back-link:hover {
  color: var(--teal-dark);
  gap: 10px;
}
.article-body-wrap .back-link {
  display: flex;
}

/* Sub-footer */
.sub-footer {
  background: var(--navy);
  color: #94a3b8;
  text-align: center;
  padding: 24px;
  font-size: 13px;
}
.sub-footer a {
  color: var(--teal);
  text-decoration: none;
}
.sub-footer a:hover {
  color: var(--teal-dark);
}


/* ── Article responsive ── */
@media (max-width: 640px) {
  .article-header {
    padding: 32px 16px 28px;
  }
  .article-header-title {
    font-size: 24px;
  }
  .article-header-meta {
    font-size: 13px;
    gap: 10px;
  }
  .article-body-wrap {
    padding: 28px 16px 40px;
  }
  .article-content {
    font-size: 15px;
  }
  .article-content h2 {
    font-size: 20px;
    margin-top: 32px;
  }
  .article-content h3 {
    font-size: 17px;
    margin-top: 24px;
  }
  .article-content blockquote {
    padding: 12px 16px;
    margin: 20px 0;
  }
}


/* ──────────────────────────────────────────────────────────────
   2. DARK MODE — NEWS PAGE (news-styles.css classes)
   ────────────────────────────────────────────────────────────── */

/* News hero */
[data-theme="dark"] .news-hero {
  background: linear-gradient(135deg, #060d1a 0%, #0c1b33 50%, #0a2040 100%);
}

/* News filter bar */
[data-theme="dark"] .news-filter-bar {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* News search input */
[data-theme="dark"] .news-search {
  background: #0f172a;
  border-color: var(--border-color);
  color: var(--text-primary);
}
[data-theme="dark"] .news-search::placeholder {
  color: var(--slate-400);
}
[data-theme="dark"] .news-search:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

/* News filter pills / category buttons */
[data-theme="dark"] .news-pill {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--slate-400);
}
[data-theme="dark"] .news-pill:hover {
  border-color: var(--teal);
  color: var(--teal);
}
[data-theme="dark"] .news-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* News cards grid area */
[data-theme="dark"] .news-grid {
  background: transparent;
}

/* Individual news cards */
[data-theme="dark"] .news-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-theme="dark"] .news-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: rgba(16,185,129,0.3);
}

/* Card image area */
[data-theme="dark"] .news-card-img {
  border-bottom-color: var(--border-color);
}

/* Card badge */
[data-theme="dark"] .news-card-badge {
  background: rgba(16,185,129,0.15);
  color: var(--teal);
  border-color: rgba(16,185,129,0.25);
}

/* Card content area */
[data-theme="dark"] .news-card-body {
  background: transparent;
}

/* Card title */
[data-theme="dark"] .news-card-title {
  color: var(--text-primary);
}
[data-theme="dark"] .news-card-title:hover,
[data-theme="dark"] .news-card:hover .news-card-title {
  color: var(--teal);
}

/* Card description */
[data-theme="dark"] .news-card-desc {
  color: var(--text-secondary);
}

/* Card meta (date, author) */
[data-theme="dark"] .news-card-meta {
  color: var(--text-secondary);
  border-top-color: var(--border-color);
}

/* Card read more link */
[data-theme="dark"] .news-card-link {
  color: var(--teal);
}
[data-theme="dark"] .news-card-link:hover {
  color: #34d399;
}

/* News pagination */
[data-theme="dark"] .news-pagination {
  border-top-color: var(--border-color);
}
[data-theme="dark"] .news-pagination a,
[data-theme="dark"] .news-pagination button {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
[data-theme="dark"] .news-pagination a:hover,
[data-theme="dark"] .news-pagination button:hover {
  border-color: var(--teal);
  color: var(--teal);
}
[data-theme="dark"] .news-pagination .active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* News "no results" state */
[data-theme="dark"] .news-no-results {
  color: var(--text-secondary);
}

/* Featured / spotlight card variant */
[data-theme="dark"] .news-featured {
  background: var(--card-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .news-featured:hover {
  border-color: rgba(16,185,129,0.3);
}

/* News section wrapper background */
[data-theme="dark"] .news-section {
  background: var(--body-bg);
}

/* News sidebar (if present) */
[data-theme="dark"] .news-sidebar {
  background: var(--card-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .news-sidebar-title {
  color: var(--text-primary);
}

/* Load more button */
[data-theme="dark"] .news-load-more {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
[data-theme="dark"] .news-load-more:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* Category tag colors in dark mode */
[data-theme="dark"] .news-tag {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}


/* ──────────────────────────────────────────────────────────────
   3. DARK MODE — ARTICLE PAGE
   ────────────────────────────────────────────────────────────── */

/* Article header gradient */
[data-theme="dark"] .article-header {
  background: linear-gradient(135deg, #060d1a 0%, #0c1b33 50%, #0a2040 100%);
}

/* Breadcrumb */
[data-theme="dark"] .article-header-breadcrumb {
  color: #64748b;
}
[data-theme="dark"] .article-header-breadcrumb a {
  color: #64748b;
}
[data-theme="dark"] .article-header-breadcrumb a:hover {
  color: var(--teal);
}

/* Badge is already teal-on-transparent so it works, but reinforce */
[data-theme="dark"] .article-header-badge {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.2);
}

/* Title stays white (#fff) — no change needed */

/* Meta line */
[data-theme="dark"] .article-header-meta {
  color: #64748b;
}

/* Divider */
[data-theme="dark"] .article-header-divider {
  border-top-color: rgba(255,255,255,0.06);
}

/* Body wrapper */
[data-theme="dark"] .article-body-wrap {
  background: var(--body-bg);
}

/* Article content text */
[data-theme="dark"] .article-content {
  color: var(--text-primary);
}
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3 {
  color: var(--text-primary);
}
[data-theme="dark"] .article-content li {
  color: var(--text-primary);
}

/* Blockquote */
[data-theme="dark"] .article-content blockquote {
  background: rgba(255,255,255,0.04);
  border-left-color: var(--teal);
  color: var(--text-secondary);
}

/* Inline code */
[data-theme="dark"] .article-content code {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

/* HR inside content */
[data-theme="dark"] .article-content hr {
  border-top-color: var(--border-color);
}

/* Article images — subtle border for contrast */
[data-theme="dark"] .article-content img {
  border: 1px solid var(--border-color);
}

/* Back link */
[data-theme="dark"] .back-link {
  color: var(--teal);
}
[data-theme="dark"] .back-link:hover {
  color: #34d399;
}

/* Sub-footer */
[data-theme="dark"] .sub-footer {
  background: #060d1a;
  color: #64748b;
}
[data-theme="dark"] .sub-footer a {
  color: var(--teal);
}


/* ──────────────────────────────────────────────────────────────
   4. prefers-color-scheme AUTO — NEWS & ARTICLE
   Mirrors [data-theme="dark"] for users who have not toggled
   ────────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .news-hero {
    background: linear-gradient(135deg, #060d1a 0%, #0c1b33 50%, #0a2040 100%);
  }
  html:not([data-theme="light"]) .news-filter-bar {
    background: var(--card-bg);
    border-color: var(--border-color);
  }
  html:not([data-theme="light"]) .news-search {
    background: #0f172a;
    border-color: var(--border-color);
    color: var(--text-primary);
  }
  html:not([data-theme="light"]) .news-search::placeholder {
    color: var(--slate-400);
  }
  html:not([data-theme="light"]) .news-pill {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--slate-400);
  }
  html:not([data-theme="light"]) .news-pill:hover {
    border-color: var(--teal);
    color: var(--teal);
  }
  html:not([data-theme="light"]) .news-pill.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
  }
  html:not([data-theme="light"]) .news-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  html:not([data-theme="light"]) .news-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: rgba(16,185,129,0.3);
  }
  html:not([data-theme="light"]) .news-card-badge {
    background: rgba(16,185,129,0.15);
    color: var(--teal);
  }
  html:not([data-theme="light"]) .news-card-title {
    color: var(--text-primary);
  }
  html:not([data-theme="light"]) .news-card-desc {
    color: var(--text-secondary);
  }
  html:not([data-theme="light"]) .news-card-meta {
    color: var(--text-secondary);
    border-top-color: var(--border-color);
  }
  html:not([data-theme="light"]) .news-card-link {
    color: var(--teal);
  }
  html:not([data-theme="light"]) .news-pagination a,
  html:not([data-theme="light"]) .news-pagination button {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
  }
  html:not([data-theme="light"]) .news-pagination .active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
  }
  html:not([data-theme="light"]) .news-load-more {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
  }
  html:not([data-theme="light"]) .news-tag {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-secondary);
  }

  /* Article page auto dark */
  html:not([data-theme="light"]) .article-header {
    background: linear-gradient(135deg, #060d1a 0%, #0c1b33 50%, #0a2040 100%);
  }
  html:not([data-theme="light"]) .article-header-breadcrumb,
  html:not([data-theme="light"]) .article-header-breadcrumb a {
    color: #64748b;
  }
  html:not([data-theme="light"]) .article-header-badge {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.2);
  }
  html:not([data-theme="light"]) .article-header-meta {
    color: #64748b;
  }
  html:not([data-theme="light"]) .article-header-divider {
    border-top-color: rgba(255,255,255,0.06);
  }
  html:not([data-theme="light"]) .article-body-wrap {
    background: var(--body-bg);
  }
  html:not([data-theme="light"]) .article-content blockquote {
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
  }
  html:not([data-theme="light"]) .article-content code {
    background: rgba(255,255,255,0.08);
  }
  html:not([data-theme="light"]) .article-content img {
    border: 1px solid var(--border-color);
  }
  html:not([data-theme="light"]) .sub-footer {
    background: #060d1a;
    color: #64748b;
  }
}
