/*
Theme Name: NewsAtlas Custom
Theme URI: https://clicksterpulse.com
Author: Himanshu Mallick
Description: Full-featured custom WordPress editorial & magazine theme inspired by NewsAtlas with built-in NewsArticle JSON-LD Schema, Breadcrumbs, and complete Customizer controls.
Version: 4.0.0
Text Domain: newsatlas-custom
*/

:root {
  --bg-body: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-dark: #111317;
  --text-primary: #14171a;
  --text-secondary: #536471;
  --accent-primary: #e63946;
  --accent-hover: #c92a36;
  --border-color: #e5e7eb;
  --container-width: 1240px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

/* Top Bar & Ticker */
.top-bar {
  background: var(--bg-dark);
  color: #d1d5db;
  font-size: 0.78rem;
  padding: 8px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ticker-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.breaking-pill {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-size: 0.7rem;
  margin-right: 10px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Site Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  background-size: cover;
  background-position: center;
}

.site-header.is-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  gap: 20px;
}

.header-main.header-centered {
  flex-direction: column;
  text-align: center;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  display: inline-block;
}

.site-logo span {
  color: var(--accent-primary);
}

.site-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
}

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

/* Hero Mosaic Grid */
.hero-mosaic {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin: 28px 0 36px;
}

.hero-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tile-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #1e2430 0%, #111317 100%);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-main .tile-card {
  min-height: 436px;
}

.tile-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.4s ease;
}

.tile-card:hover img {
  transform: scale(1.04);
}

.tile-overlay {
  position: relative;
  z-index: 2;
  padding: 20px;
  background: linear-gradient(to top, rgba(10, 12, 16, 0.92) 0%, rgba(10, 12, 16, 0.45) 60%, transparent 100%);
  color: #ffffff;
}

.cat-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.hero-main .tile-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-subgrid .tile-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.tile-meta {
  font-size: 0.78rem;
  color: #d1d5db;
  margin-top: 6px;
}

/* Front Sections Block */
.front-section-block {
  margin-bottom: 40px;
}

.front-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Main Content + Sidebar Split */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  margin-bottom: 60px;
  align-items: start;
}

.content-layout.sidebar-left {
  grid-template-columns: 340px minmax(0, 1fr);
}

.content-layout.sidebar-left > aside {
  grid-column: 1;
  grid-row: 1;
}

.content-layout.sidebar-left > section,
.content-layout.sidebar-left > article {
  grid-column: 2;
  grid-row: 1;
}

.content-layout.no-sidebar {
  grid-template-columns: 1fr;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 22px;
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 64px;
  height: 2px;
  background: var(--accent-primary);
}

/* Post Feed Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.post-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #252b36 0%, #161a22 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 6px 0 10px;
}

.post-card-title a:hover {
  color: var(--accent-primary);
}

.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.post-card-meta {
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.trending-list {
  list-style: none;
  counter-reset: trend;
}

.trending-list li {
  counter-increment: trend;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.trending-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-list li::before {
  content: "0" counter(trend);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-primary);
  min-width: 26px;
}

.trending-list a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}

.trending-list a:hover {
  color: var(--accent-primary);
}

.ad-slot {
  background: #f1f3f5;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Breadcrumb Navigation */
.newsatlas-breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.newsatlas-breadcrumbs a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.newsatlas-breadcrumbs .bc-sep {
  color: #9ca3af;
}

.newsatlas-breadcrumbs .bc-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* Single Post & Page View */
.single-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
}

.single-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 12px 0 16px;
}

.single-featured-img {
  border-radius: var(--radius-md);
  margin: 20px 0 26px;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.single-content p {
  margin-bottom: 18px;
  font-size: 1.03rem;
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #9ca3af;
  padding: 48px 0 24px;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #262930;
}

.footer-grid.cols-2 {
  grid-template-columns: 1.5fr 1fr;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  display: inline-block;
}

.footer-logo span {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.back-to-top {
  background: var(--accent-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

@media (max-width: 960px) {
  .hero-mosaic,
  .content-layout,
  .content-layout.sidebar-left,
  .front-section-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .content-layout.sidebar-left > aside,
  .content-layout.sidebar-left > section,
  .content-layout.sidebar-left > article {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .hero-subgrid,
  .posts-grid {
    grid-template-columns: 1fr;
  }
}
