/*
Theme Name: FirstNews360
Theme URI: https://firstnews360.com
Author: FirstNews360
Description: A bold, modern tech news theme with dark/light mode
Version: 1.4
*/

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --card: #212121;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --muted: #888888;
  --accent: #e85d2f;
  --accent-hover: #d04f22;
  --accent2: #1e90ff;
  --tag-bg: #2a1a14;
  --tag-color: #e85d2f;
  --radius: 10px;
  --radius-lg: 14px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.light-mode {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #e0e0e0;
  --text: #111111;
  --muted: #666666;
  --accent: #e85d2f;
  --accent-hover: #c0411a;
  --accent2: #1565c0;
  --tag-bg: #fdeee8;
  --tag-color: #c0411a;
}

/* ===== BASE ===== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVBAR ===== */
#site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.site-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
}
.nav-links a:hover {
  color: var(--accent);
  background: var(--tag-bg);
  border-color: var(--tag-bg);
}
.nav-links a.active,
.nav-links .current-menu-item a {
  color: var(--accent);
  background: var(--tag-bg);
  border-color: var(--accent);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#mode-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font);
}
#mode-toggle:hover { border-color: var(--accent); color: var(--text); }

/* ===== HERO ===== */
.hero { padding: 28px 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.hero-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
}

.hero-main img,
.hero-main .post-thumbnail {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  filter: brightness(0.75);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 24px;
  width: 100%;
}

.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 10px;
}

.hero-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

/* ===== HERO SIDE CARDS ===== */
.hero-side { display: flex; flex-direction: column; gap: 12px; }

.side-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
}
.side-card:hover { border-color: var(--accent); transform: translateX(3px); }

.side-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.side-card-tag {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.side-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 5px;
}
.side-card-meta { font-size: 11px; color: var(--muted); }

/* ===== TRENDING BAR ===== */
.trending-bar { margin: 20px 0 0; }
.trending-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}
.trending-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.trending-divider { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
.trending-items { display: flex; gap: 24px; overflow: hidden; flex-wrap: wrap; }
.trending-item {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trending-item:hover { color: var(--text); }
.trending-num { color: var(--accent); font-weight: 600; }

/* ===== SECTIONS ===== */
.section { margin: 36px 0 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}
.see-all { font-size: 12px; color: var(--accent); }
.see-all:hover { text-decoration: underline; }

/* ===== ARTICLE CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.card-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: var(--surface);
  transition: transform 0.3s;
}
.article-card:hover .card-thumb img { transform: scale(1.03); }

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tag {
  font-size: 10px;
  color: var(--tag-color);
  background: var(--tag-bg);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}

.card-author { font-size: 11px; color: var(--muted); }
.card-read { font-size: 11px; color: var(--muted); }

/* ===== SINGLE POST ===== */
.single-container { max-width: 760px; margin: 40px auto; padding: 0 24px; }

.post-header { margin-bottom: 28px; }
.post-category {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.post-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
  color: var(--text);
}
.post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-featured-image {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}
.post-featured-image img { width: 100%; height: auto; }

.post-content { color: var(--text); font-size: 16px; line-height: 1.8; }
.post-content h2 { font-size: 22px; font-weight: 600; margin: 28px 0 12px; }
.post-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--card);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}
.post-content img { border-radius: var(--radius); margin: 20px 0; }

/* ===== NEWSLETTER ===== */
.newsletter { margin: 36px 0; }
.newsletter-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.newsletter-text h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.newsletter-text p { font-size: 13px; color: var(--muted); }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  outline: none;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.2s;
}
.newsletter-form button:hover { background: var(--accent-hover); }

/* ===== PAGINATION ===== */
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  transition: all 0.2s;
  text-decoration: none;
  margin: 2px;
}
.page-numbers:hover,
.page-numbers.current {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== FOOTER ===== */
#site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 12px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 12px; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .nav-links { display: none; }
  .post-title { font-size: 22px; }
  .newsletter-inner { flex-direction: column; align-items: flex-start; }
  .newsletter-form { flex-direction: column; width: 100%; }
  .newsletter-form input { width: 100%; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* Mobile menu active tab */
#mobile-menu a.active,
#mobile-menu .current-menu-item a {
  color: var(--accent) !important;
  font-weight: 600;
}