/*
Theme Name: NewsHub Pro
Theme URI: https://example.com/newshub-pro
Author: Your Name
Author URI: https://example.com
Description: A modern, feature-rich WordPress news/magazine theme with breaking news ticker, featured slider, multiple layouts, dark mode, advanced typography, and full customizer support. Built for newspapers, magazines, blogs, and editorial publications.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
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: newshub-pro
Tags: news, magazine, blog, two-columns, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. CSS Variables / Theme Tokens
   ========================================================================== */
:root {
  --color-primary: #c8102e;
  --color-primary-dark: #a00d24;
  --color-accent: #f5b800;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f5;
  --color-border: #e5e5e1;
  --color-link: #1a1a1a;
  --color-link-hover: var(--color-primary);
  --font-display: "Playfair Display", "Times New Roman", Georgia, serif;
  --font-body: "Source Serif Pro", "Georgia", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.12);
  --container: 1280px;
  --radius: 4px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --color-text: #f1f1ef;
  --color-text-muted: #a8a8a3;
  --color-bg: #0e0e0e;
  --color-bg-alt: #1a1a1a;
  --color-border: #2a2a2a;
  --color-link: #f1f1ef;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-link-hover); }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1.25em; }
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   3. Accessibility
   ========================================================================== */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 1rem; z-index: 9999;
  background: var(--color-primary); color: #fff; padding: 0.5rem 1rem;
  font-family: var(--font-sans); font-weight: 600;
}
.skip-link:focus { left: 1rem; color: #fff; }

/* ==========================================================================
   4. Top Bar
   ========================================================================== */
.site-topbar {
  background: var(--color-text);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 0.5rem 0;
}
.site-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-date { opacity: 0.85; font-weight: 500; }
.topbar-social { display: flex; gap: 0.75rem; }
.topbar-social a { color: #fff; opacity: 0.85; }
.topbar-social a:hover { opacity: 1; color: var(--color-accent); }
.topbar-tools { display: flex; gap: 1rem; align-items: center; }
.theme-toggle {
  background: none; border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 0.25rem 0.6rem; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.theme-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ==========================================================================
   5. Header / Masthead
   ========================================================================== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.masthead {
  padding: 2rem 0 1.5rem;
  text-align: center;
  border-bottom: 3px double var(--color-border);
}
.site-branding .site-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1;
}
.site-branding .site-title a { color: var(--color-text); }
.site-branding .custom-logo { margin: 0 auto; max-height: 80px; width: auto; }
.site-description {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
}
.header-ad {
  margin: 1rem auto;
  max-width: 728px;
  text-align: center;
}

/* ==========================================================================
   6. Primary Navigation
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}
.main-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
}
.main-menu li { position: relative; }
.main-menu a {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
}
.main-menu a:hover,
.main-menu .current-menu-item > a {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.main-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg);
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  z-index: 99;
}
.main-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-menu .sub-menu a {
  padding: 0.5rem 1rem;
  border-bottom: none;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
}
.search-toggle, .menu-toggle {
  background: none; border: none; padding: 0.5rem;
  color: var(--color-text); font-size: 1.2rem;
}
.menu-toggle { display: none; }

.header-search {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
  padding: 1rem 0; display: none;
}
.header-search.active { display: block; }
.header-search form { display: flex; max-width: 600px; margin: 0 auto; gap: 0.5rem; }
.header-search input[type="search"] {
  flex: 1; padding: 0.75rem 1rem; font-size: 1rem;
  border: 1px solid var(--color-border); background: var(--color-bg-alt);
  color: var(--color-text); font-family: var(--font-body);
}

/* ==========================================================================
   7. Breaking News Ticker
   ========================================================================== */
.breaking-news {
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 0;
  font-family: var(--font-sans);
  overflow: hidden;
}
.breaking-news .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.breaking-label {
  background: #fff;
  color: var(--color-primary);
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  position: relative;
}
.breaking-label::before {
  content: "•";
  margin-right: 0.4rem;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
.ticker a {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.ticker a:hover { color: var(--color-accent); }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   8. Hero / Featured Section
   ========================================================================== */
.hero-section {
  padding: 2.5rem 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}
.hero-main {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
  min-height: 480px;
}
.hero-main .post-thumb img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.hero-main:hover .post-thumb img { transform: scale(1.04); }
.hero-main .post-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.5) 60%, transparent 100%);
  color: #fff;
}
.hero-main .post-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0.5rem 0;
}
.hero-main .post-title a { color: #fff; }
.hero-main .post-title a:hover { color: var(--color-accent); }
.hero-main .post-excerpt { color: rgba(255,255,255,.85); margin: 0; }

.hero-side {
  display: grid;
  gap: 1.25rem;
  grid-template-rows: repeat(3, 1fr);
}
.hero-side .post-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.hero-side .post-thumb { overflow: hidden; }
.hero-side .post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition);
}
.hero-side .post-card:hover .post-thumb img { transform: scale(1.06); }
.hero-side .post-content {
  padding: 0.75rem 0.75rem 0.75rem 0;
}
.hero-side .post-title { font-size: 1rem; margin: 0.25rem 0; line-height: 1.3; }

/* ==========================================================================
   9. Post Meta
   ========================================================================== */
.post-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.post-meta .category-badge {
  background: var(--color-primary);
  color: #fff;
  padding: 0.2rem 0.6rem;
  font-weight: 700;
  font-size: 11px;
}
.post-meta .category-badge:hover { background: var(--color-primary-dark); color: #fff; }
.post-meta .meta-sep::before { content: "·"; margin: 0 0.25rem; opacity: 0.5; }
.post-meta a { color: var(--color-text-muted); }
.post-meta a:hover { color: var(--color-primary); }

/* ==========================================================================
   10. Section Headings
   ========================================================================== */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-text);
  position: relative;
}
.section-heading::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 80px; height: 2px;
  background: var(--color-primary);
}
.section-heading h2 {
  font-size: 1.5rem;
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-heading .view-all {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.section-heading .view-all:hover { color: var(--color-primary); }

/* ==========================================================================
   11. Content Layout (Main + Sidebar)
   ========================================================================== */
.site-content {
  padding: 2rem 0 4rem;
}
.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}
.content-area.full-width { grid-template-columns: 1fr; }

/* ==========================================================================
   12. Post Cards (Grid & List)
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}
.post-card {
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}
.post-card .post-thumb {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: 1rem;
  background: var(--color-bg-alt);
}
.post-card .post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-thumb img { transform: scale(1.05); }
.post-card .post-title {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0.5rem 0;
}
.post-card .post-excerpt {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.post-card .read-more {
  font-family: var(--font-sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: auto;
  padding-top: 0.5rem;
  display: inline-block;
}
.post-card .read-more::after {
  content: " →";
  transition: transform var(--transition);
  display: inline-block;
}
.post-card .read-more:hover::after { transform: translateX(4px); }

/* List style for archives */
.posts-list .post-card {
  flex-direction: row;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.posts-list .post-card .post-thumb {
  flex: 0 0 280px;
  margin: 0;
  aspect-ratio: 16/10;
}
.posts-list .post-card .post-content { flex: 1; }

/* ==========================================================================
   13. Sidebar / Widgets
   ========================================================================== */
.widget-area .widget {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
}
.widget-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-text);
  position: relative;
}
.widget-title::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 50px; height: 2px;
  background: var(--color-primary);
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.widget ul li:last-child { border-bottom: none; }

/* Popular posts widget */
.popular-posts .popular-post {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.popular-posts .popular-post:last-child { border-bottom: none; }
.popular-posts .post-thumb img {
  width: 80px; height: 80px; object-fit: cover;
}
.popular-posts .post-title { font-size: 0.95rem; margin: 0 0 0.25rem; line-height: 1.3; }
.popular-posts .post-date { font-size: 11px; color: var(--color-text-muted); }
.popular-posts .post-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
}

/* Newsletter widget */
.newsletter-widget {
  background: var(--color-bg-alt);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--color-border);
}
.newsletter-widget p { font-size: 0.9rem; color: var(--color-text-muted); }
.newsletter-widget input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
}
.newsletter-widget button {
  width: 100%;
  padding: 0.75rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  transition: background var(--transition);
}
.newsletter-widget button:hover { background: var(--color-primary-dark); }

.sidebar-ad { text-align: center; margin: 1.5rem 0; }

/* ==========================================================================
   14. Single Post
   ========================================================================== */
.single-post-wrap {
  max-width: 760px;
  margin: 0 auto;
}
.entry-header { margin-bottom: 2rem; }
.entry-header .post-meta { margin-bottom: 1rem; }
.entry-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.entry-subtitle {
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--color-text-muted);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.entry-byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 14px;
}
.entry-byline .author-avatar img {
  border-radius: 50%;
  width: 48px; height: 48px;
}
.entry-byline .author-name { font-weight: 700; }
.entry-byline .reading-time {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 13px;
}

.entry-featured {
  margin: 2rem 0;
}
.entry-featured img { width: 100%; }
.entry-featured .caption {
  font-size: 13px;
  color: var(--color-text-muted);
  padding-top: 0.5rem;
  font-style: italic;
  font-family: var(--font-sans);
}

.entry-content {
  font-size: 1.125rem;
  line-height: 1.8;
}
.entry-content p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4em;
  float: left;
  line-height: 0.85;
  padding-right: 0.1em;
  padding-top: 0.1em;
  font-weight: 900;
  color: var(--color-primary);
}
.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 0 1rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--color-text);
}
.entry-content blockquote cite {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.entry-content img { margin: 1.5rem 0; }
.entry-content h2, .entry-content h3 { margin-top: 2rem; }
.entry-content pre {
  background: var(--color-bg-alt);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-left: 3px solid var(--color-primary);
}
.entry-content code {
  background: var(--color-bg-alt);
  padding: 0.15rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Tags */
.entry-tags {
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.entry-tags a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-right: 0.25rem;
  margin-bottom: 0.5rem;
  transition: all var(--transition);
}
.entry-tags a:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Social Share */
.social-share {
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.social-share .share-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 0.5rem;
}
.social-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: all var(--transition);
}
.social-share a:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Author Box */
.author-box {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-bg-alt);
  margin: 2rem 0;
  border: 1px solid var(--color-border);
}
.author-box .author-avatar img {
  border-radius: 50%;
  width: 100px; height: 100px;
}
.author-box .author-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}
.author-box .author-bio { margin: 0.5rem 0; font-size: 0.95rem; }
.author-box .author-social { display: flex; gap: 0.5rem; }
.author-box .author-social a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.author-box .author-social a:hover { color: var(--color-primary); }

/* Related Posts */
.related-posts {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 3px double var(--color-border);
}
.related-posts h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.related-grid .post-card .post-title { font-size: 1.1rem; }

/* Post Navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
.post-navigation .nav-link {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  display: block;
}
.post-navigation .nav-link:hover { border-color: var(--color-primary); }
.post-navigation .nav-label {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 0.25rem;
}
.post-navigation .nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.post-navigation .nav-next { text-align: right; }

/* ==========================================================================
   15. Comments
   ========================================================================== */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 3px double var(--color-border);
}
.comments-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}
.comment-list { list-style: none; padding: 0; }
.comment-list .comment {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}
.comment .comment-author { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.comment .comment-author img { width: 40px; height: 40px; border-radius: 50%; }
.comment .fn { font-weight: 700; font-family: var(--font-sans); }
.comment-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.comment-reply-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}
.children { list-style: none; padding-left: 2rem; border-left: 2px solid var(--color-border); margin-top: 1rem; }

.comment-form { margin-top: 2rem; }
.comment-form label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit {
  background: var(--color-primary);
  color: #fff;
  padding: 0.85rem 2rem;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  cursor: pointer;
}
.comment-form .submit:hover { background: var(--color-primary-dark); }

/* ==========================================================================
   16. Pagination
   ========================================================================== */
.pagination, .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}
.pagination .page-numbers,
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  transition: all var(--transition);
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current,
.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   17. Footer
   ========================================================================== */
.site-footer {
  background: #0a0a0a;
  color: rgba(255,255,255,.7);
  padding: 4rem 0 0;
  margin-top: 4rem;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-widgets .widget-title {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.2);
}
.footer-widgets a { color: rgba(255,255,255,.7); }
.footer-widgets a:hover { color: var(--color-accent); }
.footer-widgets ul li { border-bottom-color: rgba(255,255,255,.08); }
.footer-brand .footer-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 1rem;
}
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
}
.footer-social a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.footer-bottom a { color: rgba(255,255,255,.7); transition: color 0.2s ease; }
.footer-bottom a:hover { color: var(--color-accent); }
.footer-bottom .footer-nav {
  display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0;
  flex-wrap: wrap;
}
.footer-bottom .footer-nav li { margin: 0; }
.footer-bottom .footer-nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-weight: 500;
}
.footer-bottom .footer-nav a:hover,
.footer-bottom .footer-nav .current-menu-item > a {
  color: var(--color-accent);
}

/* Also make sure widget menus dropped in footer columns are readable */
.footer-widgets .menu,
.footer-widgets .widget_nav_menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-widgets .widget_nav_menu li { border-bottom: 1px solid rgba(255,255,255,.08); padding: 0.5rem 0; }
.footer-widgets .widget_nav_menu li:last-child { border-bottom: 0; }
.footer-widgets .widget_nav_menu a { color: rgba(255,255,255,.85) !important; font-weight: 500; }
.footer-widgets .widget_nav_menu a:hover { color: var(--color-accent) !important; }

/* ==========================================================================
   18. 404 / No Results
   ========================================================================== */
.error-404, .no-results {
  text-align: center;
  padding: 4rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}
.error-404 .error-code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  margin: 0;
}

/* ==========================================================================
   19. Utility / Helpers
   ========================================================================== */
.aligncenter { display: block; margin: 1.5rem auto; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.alignwide { margin-left: -4rem; margin-right: -4rem; max-width: calc(100% + 8rem); }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.clear::after { content: ""; display: table; clear: both; }
.sticky .post-title::before {
  content: "★ ";
  color: var(--color-accent);
}

/* ==========================================================================
   20. Scroll-to-Top Button
   ========================================================================== */
.scroll-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 44px; height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 99;
  box-shadow: var(--shadow-md);
}
.scroll-top.visible {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.scroll-top:hover { background: var(--color-primary-dark); }

/* ==========================================================================
   21. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .footer-widgets { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: auto; grid-template-columns: repeat(3, 1fr); }
  .hero-side .post-card { grid-template-columns: 1fr; }
  .hero-side .post-thumb { aspect-ratio: 16/10; }
}
@media (max-width: 768px) {
  .content-area { grid-template-columns: 1fr; gap: 2rem; }
  .menu-toggle { display: block; }
  .main-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--color-border);
  }
  .main-menu.active { display: flex; }
  .main-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--color-bg-alt);
    padding-left: 1rem;
  }
  .hero-side { grid-template-columns: 1fr; }
  .posts-list .post-card { flex-direction: column; }
  .posts-list .post-card .post-thumb { flex: none; width: 100%; }
  .related-grid { grid-template-columns: 1fr; }
  .post-navigation { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr; gap: 2rem; }
  .author-box { grid-template-columns: 1fr; text-align: center; }
  .author-box .author-avatar { margin: 0 auto; }
  .entry-content p:first-of-type::first-letter { font-size: 3em; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .breaking-news .container { flex-direction: column; align-items: stretch; gap: 0.5rem; }
}

/* Print */
@media print {
  .site-nav, .site-footer, .breaking-news, .comments-area, .social-share, .scroll-top, .widget-area { display: none; }
  body { color: #000; background: #fff; }
  .container { max-width: 100%; }
}

/* ==========================================================================
   Push Notification Subscribe Button & Widget
   ========================================================================== */
.newshub-push-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}
.newshub-push-btn:hover {
  transform: translateY(-1px);
  background: #a30d24;
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.35);
}
.newshub-push-btn:active { transform: translateY(0); }
.newshub-push-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.newshub-push-btn__icon { display: inline-flex; }
.newshub-push-btn__icon svg { display: block; }

/* Subtle bell ring animation on hover */
.newshub-push-btn:hover .newshub-push-btn__icon {
  animation: newshub-bell-ring 0.6s ease;
  transform-origin: top center;
}
@keyframes newshub-bell-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}

/* Widget version */
.newshub-push-widget {
  text-align: center;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.06), rgba(245, 184, 0, 0.06));
  border: 1px solid rgba(200, 16, 46, 0.15);
  border-radius: 12px;
}
.newshub-push-widget__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  margin-bottom: 0.75rem;
}
.newshub-push-widget__desc {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text-muted, #555);
}

/* Nav-bar version (when enabled via filter) */
.menu-item-push a {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-primary);
  color: #fff !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px;
  font-size: 0.85rem !important;
}
.menu-item-push a:hover { background: #a30d24; color: #fff !important; }
.newshub-nav-bell { font-size: 0.9em; }

/* Dark mode */
[data-theme="dark"] .newshub-push-widget {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.15), rgba(245, 184, 0, 0.1));
  border-color: rgba(200, 16, 46, 0.3);
}
[data-theme="dark"] .newshub-push-widget__desc { color: #b8b8b8; }

/* ==========================================================================
   Recent Posts Widget
   ========================================================================== */
.recent-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.recent-post {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border, #eaeaea);
  align-items: flex-start;
}
.recent-post:first-child { padding-top: 0; }
.recent-post:last-child { border-bottom: 0; padding-bottom: 0; }

.recent-post__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
}
.recent-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.recent-post:hover .recent-post__thumb img { transform: scale(1.06); }

.recent-post__body {
  flex: 1;
  min-width: 0;
}
.recent-post__cat {
  display: inline-block;
  font-family: var(--font-sans, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.recent-post__cat:hover { text-decoration: underline; }

.recent-post__title {
  font-size: 0.95rem;
  line-height: 1.35;
  margin: 0 0 0.3rem;
  font-weight: 700;
}
.recent-post__title a {
  color: var(--color-heading, #111);
  text-decoration: none;
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease;
}
.recent-post__title a:hover { background-size: 100% 1px; }

.recent-post__date {
  font-size: 0.78rem;
  color: var(--color-text-muted, #777);
  font-family: var(--font-sans, sans-serif);
}
.recent-post__excerpt {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-text-muted, #555);
  margin: 0.35rem 0 0;
}

.recent-posts__empty {
  color: var(--color-text-muted, #777);
  font-style: italic;
  margin: 0;
}

/* Dark mode */
[data-theme="dark"] .recent-post { border-bottom-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .recent-post__title a { color: #f0f0f0; }
[data-theme="dark"] .recent-post__date,
[data-theme="dark"] .recent-post__excerpt { color: #b8b8b8; }

/* Mobile */
@media (max-width: 480px) {
  .recent-post__thumb { flex: 0 0 64px; width: 64px; height: 64px; }
  .recent-post__title { font-size: 0.9rem; }
}

/* ==========================================================================
   Spacing & Mobile-Friendliness Fixes
   ========================================================================== */

/* 1. Prevent any element from causing horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* 2. Better breathing room inside the page container */
.container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

/* 3. Make sure long words / URLs wrap instead of pushing layout wide */
.entry-content,
.entry-content p,
.entry-content li,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content a,
.post-title,
.entry-title,
.recent-post__title,
.popular-post .post-title,
.comment-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* 4. Embeds / iframes / videos stay inside their container on mobile */
.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content video {
  max-width: 100%;
  height: auto;
}

/* 5. Tables become horizontally scrollable instead of overflowing */
.entry-content table {
  display: block;
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

/* 6. Pre / code blocks scroll horizontally instead of overflowing */
.entry-content pre {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.entry-content code {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 7. Disable problematic alignwide negative margins on small screens */
@media (max-width: 900px) {
  .alignwide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
  .alignfull {
    margin-left: calc(50% - 50vw + 0.75rem);
    margin-right: calc(50% - 50vw + 0.75rem);
    max-width: calc(100vw - 1.5rem);
  }
}

/* 8. Tablet: keep container padding comfortable */
@media (max-width: 768px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .single-post-wrap {
    padding: 0;
  }
  .entry-content {
    font-size: 1.05rem;
    line-height: 1.75;
  }
  .entry-title {
    font-size: clamp(1.6rem, 6vw, 2.25rem);
    line-height: 1.25;
  }
  .entry-subtitle {
    font-size: 1.05rem;
  }
  .entry-content h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  .entry-content h3 {
    font-size: 1.25rem;
    line-height: 1.35;
  }
  .entry-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 1rem;
  }
  .entry-byline {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .entry-byline .reading-time {
    margin-left: 0;
    width: 100%;
  }
  .social-share {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* 9. Phones: more space on the sides so text isn't kissing the edge */
@media (max-width: 480px) {
  .container {
    padding-left: 1.125rem;
    padding-right: 1.125rem;
  }
  .entry-content {
    font-size: 1rem;
    line-height: 1.7;
  }
  .entry-content p {
    margin-bottom: 1.1em;
  }
  .entry-content img,
  .entry-featured img,
  .wp-block-image img {
    border-radius: 4px;
  }
  .entry-content blockquote {
    font-size: 1.05rem;
    padding: 1rem;
    margin: 1.5rem 0;
  }
  .entry-content blockquote::before {
    display: none;
  }
  /* Remove the giant drop-cap on phones — it crowds the text */
  .entry-content p:first-of-type::first-letter {
    font-size: 2.5em;
    margin-right: 0.05em;
  }
  /* Comments & forms shouldn't overflow */
  .comment-form input,
  .comment-form textarea,
  .comment-form select,
  .search-form input {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Tighten post cards */
  .post-card .post-content {
    padding: 1rem;
  }
  /* Featured image margin tighter on mobile */
  .entry-featured {
    margin: 1.25rem 0;
  }
}

/* 10. Extra-small phones (older / narrow devices) */
@media (max-width: 360px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .entry-title {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Mobile Edge-Spacing Fix (v2) — forces all content to stay inside the
   viewport with breathing room, including full-width Gutenberg blocks.
   ========================================================================== */

@media (max-width: 768px) {
  /* Stronger container padding so nothing kisses the screen edge */
  .container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Kill all full-width / wide alignments on mobile — keep them inside */
  .entry-content .alignfull,
  .entry-content .alignwide,
  .entry-content > .wp-block-group.alignfull,
  .entry-content > .wp-block-group.alignwide,
  .entry-content > .wp-block-cover.alignfull,
  .entry-content > .wp-block-cover.alignwide,
  .entry-content > .wp-block-columns.alignfull,
  .entry-content > .wp-block-columns.alignwide,
  .single-post-wrap .alignfull,
  .single-post-wrap .alignwide {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Any direct child of entry-content must stay inside its parent */
  .entry-content > *,
  .single-post-wrap > * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Stat cards / colored info boxes / custom HTML blocks the user adds */
  .entry-content .wp-block-group,
  .entry-content .wp-block-cover,
  .entry-content .wp-block-columns,
  .entry-content .wp-block-table,
  .entry-content figure,
  .entry-content table {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Columns block: stack on mobile so 2-column / 3-column layouts don't squeeze */
  .entry-content .wp-block-columns {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  .entry-content .wp-block-column {
    flex-basis: 100% !important;
    min-width: 0 !important;
  }
}

/* Phones: tighter but still breathable, never edge-to-edge */
@media (max-width: 480px) {
  .container {
    padding-left: 1.125rem !important;
    padding-right: 1.125rem !important;
  }
  /* Slightly smaller internal padding for colored info boxes */
  .entry-content .wp-block-group {
    padding: 1rem !important;
  }
}
