/* ==========================================================================
   NewsMax Pro - Master CSS Architecture & Layout Resets
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL RESET & CRITICAL MEDIA CONSTRAINTS
   -------------------------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: var(--nm-color-bg, #ffffff);
  color: var(--nm-color-text, #0f172a);
  font-family: var(--nm-font-body, 'Source Sans Pro', sans-serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* CRITICAL MEDIA RESET - Prevents Image Blow-outs & Broken Layouts */
img, picture, video, canvas, svg, iframe {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

figure {
  margin: 0;
  max-width: 100%;
}

a {
  color: var(--nm-color-accent, #2563eb);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--nm-color-accent-hover, #1d4ed8);
}

/* --------------------------------------------------------------------------
   2. CONTAINER & LAYOUT GRID SYSTEM
   -------------------------------------------------------------------------- */
.nm-container {
  max-width: 1320px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.nm-container-narrow {
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.nm-section-padding {
  padding-top: 40px;
  padding-bottom: 40px;
}

.nm-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Homepage & Archive 2-Column Grid */
.nm-content-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

@media (min-width: 992px) {
  .nm-content-layout-grid {
    grid-template-columns: 1fr 340px;
  }
}

/* 3-Column Post Card Grid */
.nm-post-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 640px) {
  .nm-post-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .nm-post-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   3. HERO MAGAZINE SECTION GRID
   -------------------------------------------------------------------------- */
.nm-hero-section {
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.nm-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 992px) {
  .nm-hero-grid {
    grid-template-columns: 3fr 1fr;
  }
}

.nm-hero-main-col {
  width: 100%;
}

.nm-hero-side-col {
  width: 100%;
}

.nm-hero-card-featured {
  position: relative;
  min-height: 480px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background-color: #0f172a;
}

.nm-hero-card-featured img,
.nm-hero-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1;
}

.nm-hero-card-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(15,23,42,0.92) 100%);
  padding: 32px;
  color: #ffffff;
}

.nm-hero-title {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900;
  line-height: 1.18;
  margin-top: 10px;
  margin-bottom: 12px;
}

.nm-hero-title a {
  color: #ffffff;
}

.nm-hero-title a:hover {
  color: #60a5fa;
}

.nm-hero-excerpt {
  color: #cbd5e1;
  font-size: 1.0625rem;
  margin-bottom: 16px;
}

.nm-hero-side-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nm-hero-side-item {
  padding: 20px;
}

.nm-side-title {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 4px;
  margin-bottom: 8px;
}

.nm-side-title a {
  color: var(--nm-color-text, #0f172a);
}

/* --------------------------------------------------------------------------
   4. CARD COMPONENTS & ASPECT RATIO CONTROL
   -------------------------------------------------------------------------- */
.nm-card {
  background-color: var(--nm-color-surface, #ffffff);
  border: 1px solid var(--nm-color-border, #e5e7eb);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.nm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  border-color: var(--nm-color-accent, #2563eb);
}

.nm-card-media {
  position: relative;
  width: 100%;
  padding-top: 60%; /* 16:10 Aspect Ratio */
  overflow: hidden;
  background-color: #f1f5f9;
}

.nm-card-media img,
.nm-card-media a img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 350ms ease;
}

.nm-card:hover .nm-card-media img {
  transform: scale(1.05);
}

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

.nm-card-title {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 6px;
  margin-bottom: 8px;
}

.nm-card-title a {
  color: var(--nm-color-text, #0f172a);
}

.nm-card-excerpt {
  color: var(--nm-color-text-secondary, #475569);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  flex-grow: 1;
}

.nm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--nm-color-text-muted, #94a3b8);
  border-top: 1px solid var(--nm-color-border-subtle, #f1f5f9);
  padding-top: 12px;
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   5. HEADER & NAVIGATION STYLING
   -------------------------------------------------------------------------- */
.nm-topbar-ticker {
  background-color: #111827;
  color: #ffffff;
  font-size: 0.8125rem;
  padding: 8px 0;
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
}

.nm-pulse-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #ef4444;
  margin-right: 12px;
}

.nm-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: nmPulse 1.6s infinite;
}

@keyframes nmPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.nm-site-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nm-header-main-bar {
  height: 72px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nm-color-border, #e5e7eb);
}

.nm-logo-text {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: 1.625rem;
  font-weight: 900;
  color: var(--nm-color-primary, #111827);
}

.nm-nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.nm-nav-menu a {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--nm-color-text, #0f172a);
}

.nm-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nm-icon-btn {
  background: transparent;
  border: 1px solid var(--nm-color-border, #e5e7eb);
  color: var(--nm-color-text, #0f172a);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. ARTICLE SINGLE PAGE STYLING
   -------------------------------------------------------------------------- */
.nm-article-headline {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 16px 0;
}

.nm-article-subheadline {
  font-size: 1.25rem;
  color: var(--nm-color-text-secondary, #475569);
  line-height: 1.45;
  margin-bottom: 24px;
}

.nm-article-hero-image-wrap {
  margin: 32px 0 48px 0;
}

.nm-hero-img {
  width: 100% !important;
  max-height: 580px;
  object-fit: cover !important;
  border-radius: 20px;
}

.nm-article-body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

@media (min-width: 992px) {
  .nm-article-body-grid {
    grid-template-columns: 1fr 340px;
  }
}

.nm-typography-article {
  font-family: var(--nm-font-article, 'Merriweather', Georgia, serif);
  font-size: 1.1875rem;
  line-height: 1.8;
}

.nm-typography-article p {
  margin-bottom: 1.75em;
}

/* --------------------------------------------------------------------------
   7. FOOTER STYLING
   -------------------------------------------------------------------------- */
.nm-site-footer {
  background-color: #0b0f17;
  color: #f3f4f6;
  padding-top: 60px;
  padding-bottom: 40px;
  margin-top: 60px;
}

.nm-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 768px) {
  .nm-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .nm-footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.nm-footer-title {
  font-family: var(--nm-font-heading, 'Inter', sans-serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
}

.nm-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nm-footer-links a {
  color: #9ca3af;
  line-height: 2.2;
}

.nm-footer-links a:hover {
  color: #ffffff;
}

.nm-footer-bottom {
  border-top: 1px solid #1f2937;
  margin-top: 40px;
  padding-top: 24px;
  font-size: 0.875rem;
  color: #6b7280;
}

/* --------------------------------------------------------------------------
   8. WORDPRESS GUTENBERG & ALIGNMENT RESETS
   -------------------------------------------------------------------------- */
.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

@media (min-width: 768px) {
  .wp-block-columns { flex-wrap: nowrap; }
}

.wp-block-column {
  flex: 1;
  min-width: 0;
}

.alignwide { max-width: 1320px; width: 100%; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
