/*
Theme Name: YuviNews
Theme URI: https://yuvinews.com
Author: YuviNews
Author URI: https://yuvinews.com
Description: A cutting-edge Google News style WordPress theme featuring Google Material 3 UI, live feed update button, dynamic weather, market trends, topic clustering, full WordPress Customizer controls, and Google News Schema.org indexing.
Version: 2.1.0
Tested up to: 6.7
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yuvinews
Tags: news, magazine, google-news, responsive-layout, dark-mode, custom-colors, custom-menu, featured-images, translation-ready
*/

:root {
  --gn-blue: #1a73e8;
  --gn-blue-hover: #1557b0;
  --gn-blue-light: #e8f0fe;
  --gn-red: #ea4335;
  --gn-green: #34a853;
  --gn-yellow: #fbbc05;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafd;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafd;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-tertiary: #80868b;
  --border-subtle: #dadce0;
  --border-light: #e8eaed;
  --search-bg: #f1f3f4;
  --header-shadow: 0 1px 3px rgba(60,64,67,0.08), 0 1px 2px rgba(60,64,67,0.16);
  --card-shadow: 0 1px 2px rgba(60,64,67,0.1), 0 1px 3px rgba(60,64,67,0.06);
  --card-shadow-hover: 0 4px 12px rgba(60,64,67,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --font-family: 'Roboto', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --max-width: 1440px;
  --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-card: #202124;
  --bg-card-hover: #2d2e30;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-tertiary: #bdc1c6;
  --border-subtle: #3c4043;
  --border-light: #2c2c2c;
  --search-bg: #282a2d;
  --gn-blue-light: rgba(26, 115, 232, 0.2);
  --header-shadow: 0 1px 4px rgba(0,0,0,0.6);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
  --card-shadow-hover: 0 4px 14px rgba(0,0,0,0.7);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gn-blue);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container-gn {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----------------------------------------------------
 * Google News Top Header
 * ---------------------------------------------------- */
.gn-header {
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--header-shadow);
}

.gn-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.gn-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.gn-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.gn-menu-btn:hover {
  background: var(--search-bg);
  color: var(--text-primary);
}

.gn-logo {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.gn-logo .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 75%, #ea4335 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  margin-right: 10px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.gn-logo .news-badge {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* Center Search Bar */
.gn-header-center {
  flex: 1;
  max-width: 680px;
  display: flex;
  justify-content: center;
}

.gn-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--search-bg);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.gn-search-box:focus-within {
  background: var(--bg-primary);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 6px rgba(32,33,36,0.28);
}

.gn-search-box i {
  color: var(--text-secondary);
  font-size: 16px;
  margin-right: 12px;
}

.gn-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
}

.gn-search-input::placeholder {
  color: var(--text-secondary);
}

/* Right Actions (Weather, Update & Theme Toggle) */
.gn-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Header Update Button */
.gn-header-update-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gn-blue);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
}

.gn-header-update-btn:hover {
  background: var(--gn-blue-hover);
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

.gn-header-update-btn.loading i,
.gn-update-btn.loading i {
  animation: gn-spin 0.75s linear infinite;
}

@keyframes gn-spin {
  100% { transform: rotate(360deg); }
}

.gn-weather-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gn-blue-light);
  color: var(--gn-blue);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.gn-weather-badge:hover {
  background: rgba(26, 115, 232, 0.22);
}

.gn-theme-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.gn-theme-btn:hover {
  background: var(--search-bg);
  color: var(--text-primary);
}

/* ----------------------------------------------------
 * Google News Horizontal Category Tabs
 * ---------------------------------------------------- */
.gn-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  padding: 8px 0 10px;
  border-top: 1px solid var(--border-light);
}

.gn-nav-tabs::-webkit-scrollbar {
  display: none;
}

.gn-tab-item {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gn-tab-item:hover {
  background: var(--search-bg);
  color: var(--text-primary);
}

.gn-tab-item.active {
  background: var(--gn-blue-light);
  color: var(--gn-blue);
  font-weight: 600;
}

/* ----------------------------------------------------
 * Google News 3-Column Layout
 * ---------------------------------------------------- */
.gn-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 24px 0 60px;
  align-items: start;
}

/* Left Sidebar Navigation */
.gn-left-nav {
  position: sticky;
  top: 124px;
  height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}

.gn-nav-group {
  margin-bottom: 24px;
}

.gn-nav-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 16px 8px;
}

.gn-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.gn-nav-link i {
  font-size: 16px;
  color: var(--text-secondary);
  width: 20px;
  text-align: center;
}

.gn-nav-link:hover {
  background: var(--search-bg);
}

.gn-nav-link.active {
  background: var(--gn-blue-light);
  color: var(--gn-blue);
  font-weight: 600;
}

.gn-nav-link.active i {
  color: var(--gn-blue);
}

/* ----------------------------------------------------
 * Center Main Feed (Top Stories & Cards)
 * ---------------------------------------------------- */
.gn-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.gn-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.gn-section-title i {
  color: var(--gn-blue);
}

/* Section Update Button */
.gn-update-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--gn-blue);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.gn-update-btn:hover {
  background: var(--gn-blue-light);
  border-color: var(--gn-blue);
}

/* Spotlight Big Hero Card */
.gn-spotlight-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 24px;
  transition: var(--transition);
}

.gn-spotlight-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-subtle);
}

.gn-spotlight-thumb {
  position: relative;
  aspect-ratio: 16/9;
  max-height: 400px;
  overflow: hidden;
  background: #202124;
}

.gn-spotlight-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gn-spotlight-card:hover .gn-spotlight-thumb img {
  transform: scale(1.02);
}

.gn-spotlight-body {
  padding: 24px;
}

.gn-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.gn-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text-primary);
}

.gn-source-badge .badge-icon {
  width: 16px;
  height: 16px;
  background: var(--gn-blue);
  color: #fff;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.gn-time-ago {
  color: var(--text-tertiary);
}

.gn-spotlight-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.gn-spotlight-title a:hover {
  color: var(--gn-blue);
}

.gn-spotlight-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.gn-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  font-size: 13px;
}

.gn-full-coverage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gn-blue);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  background: var(--gn-blue-light);
}

.gn-full-coverage-btn:hover {
  background: rgba(26, 115, 232, 0.25);
}

/* Compact Google News Horizontal Cards */
.gn-news-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.gn-compact-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: var(--transition);
}

.gn-compact-card:hover {
  box-shadow: var(--card-shadow-hover);
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.gn-compact-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 96px;
}

.gn-compact-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.gn-compact-title a:hover {
  color: var(--gn-blue);
}

.gn-compact-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #202124;
}

.gn-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gn-compact-card:hover .gn-compact-thumb img {
  transform: scale(1.05);
}

/* Topic Cluster Sections */
.gn-topic-cluster {
  margin-top: 36px;
}

.gn-cluster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ----------------------------------------------------
 * Right Sidebar (Weather, Market & Ad)
 * ---------------------------------------------------- */
.gn-right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gn-widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: var(--transition);
}

.gn-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Weather Widget Card */
.gn-weather-card {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.gn-weather-card .gn-widget-header {
  color: #ffffff;
}

.gn-weather-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gn-temp-big {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}

.gn-weather-icon {
  font-size: 48px;
  color: #fbbc05;
}

.gn-weather-details {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 10px;
}

/* Financial Markets Widget */
.gn-market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.gn-market-row:last-child {
  border-bottom: none;
}

.gn-market-name {
  font-weight: 600;
  color: var(--text-primary);
}

.gn-market-change.positive {
  color: var(--gn-green);
  font-weight: 600;
}

.gn-market-change.negative {
  color: var(--gn-red);
  font-weight: 600;
}

/* Trending Topic Pills */
.gn-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gn-topic-pill {
  display: inline-block;
  background: var(--search-bg);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.gn-topic-pill:hover {
  background: var(--gn-blue-light);
  color: var(--gn-blue);
  border-color: var(--gn-blue);
}

/* Floating Toast Notification */
.gn-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #202124;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gn-toast.active {
  transform: translateY(0);
  opacity: 1;
}

.gn-toast i {
  color: #34a853;
  font-size: 18px;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 42px;
  height: 42px;
  background: var(--gn-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
  border: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--gn-blue-hover);
  transform: translateY(-2px);
}

/* ----------------------------------------------------
 * Responsive Breakpoints
 * ---------------------------------------------------- */
@media (max-width: 1200px) {
  .gn-layout {
    grid-template-columns: 220px 1fr;
  }
  .gn-right-sidebar {
    display: none;
  }
  .gn-cluster-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .gn-layout {
    grid-template-columns: 1fr;
  }
  .gn-left-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background: var(--bg-primary);
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    z-index: 1001;
    padding: 20px 10px;
  }
  .gn-left-nav.active {
    display: block;
  }
  .gn-header-center {
    max-width: 300px;
  }
}

@media (max-width: 600px) {
  .gn-header-top {
    height: 56px;
  }
  .gn-weather-badge {
    display: none;
  }
  .gn-header-update-btn span {
    display: none;
  }
  .gn-spotlight-title {
    font-size: 18px;
  }
  .gn-compact-title {
    font-size: 14px;
  }
  .gn-compact-thumb {
    width: 80px;
    height: 80px;
  }
  .gn-cluster-grid {
    grid-template-columns: 1fr;
  }
}
