/*
Theme Name: City E News
Theme URI: https://cityenews.com
Author: Antigravity
Author URI: https://cityenews.com
Description: A modern, ultra-responsive, lightweight, and fast news magazine theme designed specifically for City E News. Features clean headline hierarchy, breaking news ticker, multi-column magazine grid, social sharing, and full mobile optimization.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.7
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: cityenews
Tags: news, magazine, blog, grid-layout, two-columns, custom-menu, featured-images, responsive-layout, translation-ready
*/

:root {
  --primary-color: #c8102e; /* News Crimson */
  --primary-dark: #9b0b21;
  --secondary-color: #0f172a; /* Deep Slate/Navy */
  --accent-color: #d97706;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #ffffff;
  --bg-alt: #f8fafc;
  --border-color: #e2e8f0;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  --font-heading: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --container-width: 1200px;
  --transition: all 0.25s ease-in-out;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--primary-color);
}

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

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* 1. TOP BAR */
.top-bar {
  background-color: var(--secondary-color);
  color: #94a3b8;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.live-date {
  display: flex;
  align-items: center;
  gap: 6px;
}
.top-social-links a {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 13px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}
.top-social-links a:hover {
  background: var(--primary-color);
  color: #ffffff;
}

/* 2. MAIN HEADER */
.main-header {
  background: #ffffff;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.site-branding .site-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--secondary-color);
}
.site-branding .site-title span {
  color: var(--primary-color);
}
.site-branding .site-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.header-banner-ad {
  display: none;
}
@media (min-width: 768px) {
  .header-banner-ad {
    display: block;
    max-width: 600px;
  }
}

/* 3. PRIMARY NAVIGATION */
.nav-wrapper {
  background-color: var(--secondary-color);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}
.main-nav li a {
  display: block;
  padding: 14px 16px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 3px solid transparent;
}
.main-nav li a:hover,
.main-nav li.current-menu-item > a {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: var(--primary-color);
  color: #ffffff;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-toggle-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 16px;
}
.search-toggle-btn:hover {
  color: var(--primary-color);
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  padding: 10px;
}

/* Search Dropdown Modal */
.header-search-bar {
  display: none;
  background: #ffffff;
  padding: 15px 0;
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
.header-search-bar.active {
  display: block;
}
.search-form-inner {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
}
.search-form-inner input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 4px 0 0 4px;
  font-size: 15px;
  outline: none;
}
.search-form-inner button[type="submit"] {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 0 20px;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
  cursor: pointer;
}

/* 4. BREAKING NEWS TICKER */
.breaking-ticker-wrap {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  height: 42px;
  overflow: hidden;
}
.ticker-badge {
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.ticker-content {
  flex: 1;
  padding: 0 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--text-main);
}
.ticker-content a {
  font-weight: 500;
}
.ticker-content a:hover {
  text-decoration: underline;
}

/* 5. HOMEPAGE & LAYOUT */
.main-content-area {
  padding: 30px 0 50px;
}
.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
@media (min-width: 992px) {
  .layout-grid {
    grid-template-columns: 8fr 4fr;
  }
}

/* Section Headings */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  position: relative;
}
.section-title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 8px;
  margin-bottom: -2px;
  border-bottom: 2px solid var(--primary-color);
  letter-spacing: 0.5px;
}

/* Hero Featured Section */
.hero-news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 35px;
}
@media (min-width: 768px) {
  .hero-news-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

/* Clean News Card (Headline UNDER Image - No Clashes!) */
.news-card {
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  box-shadow: var(--hover-shadow);
  transform: translateY(-2px);
}
.card-thumbnail-wrap {
  position: relative;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 9;
}
.card-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .card-thumbnail-wrap img {
  transform: scale(1.04);
}
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--secondary-color);
}
.card-title a {
  color: inherit;
}
.card-title a:hover {
  color: var(--primary-color);
}
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}
.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-excerpt {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Secondary List Cards */
.sub-news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.list-card {
  display: flex;
  gap: 14px;
  background: #ffffff;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.list-card-thumb {
  width: 110px;
  height: 75px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}
.list-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.list-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.list-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.list-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Category 2-Column Grid */
.news-grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}
@media (min-width: 640px) {
  .news-grid-2col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 6. SIDEBAR */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.widget {
  background: #ffffff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: var(--card-shadow);
}
.widget-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary-color);
}
.trending-numbered-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trending-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}
.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.trending-rank {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  min-width: 20px;
}
.trending-text a {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--secondary-color);
}
.trending-text a:hover {
  color: var(--primary-color);
}

/* 7. SINGLE ARTICLE PAGE (Fixes Whitespace & Overflow Glitches) */
.single-article-container {
  background: #ffffff;
  padding: 28px;
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  margin-top: 0; /* NO 300px whitespace bug! */
}
.article-breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.article-breadcrumbs a:hover {
  color: var(--primary-color);
}
.single-category-badge {
  display: inline-block;
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}
.single-post-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--secondary-color);
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .single-post-title {
    font-size: 34px;
  }
}
.single-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}
.single-featured-image {
  margin-bottom: 24px;
  border-radius: 6px;
  overflow: hidden;
}
.single-featured-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* Clean Inline Social Share Bar */
.inline-share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #000000; }
.share-btn.wa { background: #25d366; }
.share-btn.ln { background: #0a66c2; }
.share-btn:hover { opacity: 0.9; color: #ffffff; }

/* Article Body Typography */
.article-entry-content {
  font-size: 17px;
  line-height: 1.8;
  color: #27272a;
}
.article-entry-content p {
  margin-bottom: 20px;
}
.article-entry-content h2, 
.article-entry-content h3 {
  color: var(--secondary-color);
  margin-top: 30px;
  margin-bottom: 14px;
  font-weight: 700;
}
.article-entry-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-alt);
  font-style: italic;
  color: #334155;
}

/* Tag Cloud (Comma-separated proper links) */
.article-tags-wrap {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.article-tags-wrap .tag-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--secondary-color);
}
.article-tags-wrap a {
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.article-tags-wrap a:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Related Stories */
.related-posts-section {
  margin-top: 40px;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .related-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 8. FOOTER */
.site-footer {
  background-color: #0b1120;
  color: #94a3b8;
  padding-top: 50px;
  border-top: 4px solid var(--primary-color);
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}
.footer-widget-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
}
.footer-widget p {
  font-size: 13px;
  line-height: 1.6;
}
.footer-widget ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.footer-widget ul a {
  color: #94a3b8;
}
.footer-widget ul a:hover {
  color: #ffffff;
  padding-left: 4px;
}
.footer-bottom-bar {
  padding: 20px 0;
  font-size: 12px;
  text-align: center;
  color: #64748b;
}
.footer-bottom-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
}
.footer-bottom-links a {
  color: #cbd5e1;
}
.footer-bottom-links a:hover {
  color: var(--primary-color);
}

/* 9. MOBILE RESPONSIVE OVERRIDES */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--secondary-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
  }
  .main-nav li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .top-bar-left {
    display: none;
  }
  .top-bar .container {
    justify-content: center;
  }
}
