/* ============================================================
   MEDIA HUNT - Main Stylesheet
   Theme: White / Black / Red | Modern Newspaper + Glass UI
   ============================================================ */

:root {
  --nm-red: #e50914;
  --nm-red-dark: #b3070f;
  --nm-black: #0d0d0d;
  --nm-white: #ffffff;
  --nm-gray-50: #f7f7f8;
  --nm-gray-100: #eeeeef;
  --nm-gray-300: #d4d4d8;
  --nm-gray-500: #71717a;
  --nm-gray-700: #3f3f46;
  --nm-border: #e4e4e7;
  --nm-font-serif: Georgia, 'Times New Roman', serif;
  --nm-font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --nm-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --nm-radius: 10px;
  --nm-glass-bg: rgba(255,255,255,0.7);
  --nm-glass-border: rgba(255,255,255,0.35);
}

[data-theme="dark"] {
  --nm-white: #121214;
  --nm-black: #f5f5f5;
  --nm-gray-50: #1a1a1d;
  --nm-gray-100: #202024;
  --nm-gray-300: #3a3a3f;
  --nm-gray-500: #a1a1aa;
  --nm-gray-700: #d4d4d8;
  --nm-border: #2b2b30;
  --nm-glass-bg: rgba(20,20,22,0.7);
  --nm-glass-border: rgba(255,255,255,0.08);
  background: var(--nm-white);
  color: var(--nm-black);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--nm-font-sans);
  background: var(--nm-white);
  color: var(--nm-black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top Utility Bar ---------- */
.nm-topbar {
  background: var(--nm-black);
  color: #fff;
  font-size: 12.5px;
}
.nm-topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.nm-topbar a { opacity: .85; margin-left: 14px; }
.nm-topbar a:hover { opacity: 1; color: var(--nm-red); }

/* ---------- Breaking News Strip ---------- */
.nm-breaking {
  background: var(--nm-red);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 40px;
}
.nm-breaking .tag {
  background: var(--nm-black);
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
  font-size: 13px;
}
.nm-breaking-ticker { overflow: hidden; flex: 1; position: relative; height: 100%; }
.nm-breaking-track {
  display: flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
  animation: nm-scroll 32s linear infinite;
  height: 100%;
  padding-left: 100%;
}
.nm-breaking-track a { font-size: 13.5px; font-weight: 500; }
@keyframes nm-scroll { from { transform: translateX(0);} to { transform: translateX(-100%);} }

/* ---------- Header ---------- */
.nm-header {
  background: var(--nm-white);
  border-bottom: 1px solid var(--nm-border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(12px);
  background: var(--nm-glass-bg);
}
.nm-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.nm-logo { font-family: var(--nm-font-serif); font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.nm-logo span { color: var(--nm-red); }
.nm-tagline { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--nm-gray-500); margin-top: -4px; }
.nm-header-actions { display: flex; align-items: center; gap: 14px; }
.nm-icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--nm-gray-50); border: 1px solid var(--nm-border);
  cursor: pointer; transition: .2s;
}
.nm-icon-btn:hover { background: var(--nm-red); color: #fff; border-color: var(--nm-red); }

/* ---------- Nav / Mega Menu ---------- */
.nm-nav { background: var(--nm-black); }
.nm-nav-list { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.nm-nav-list li { position: relative; }
.nm-nav-list a {
  display: block; padding: 13px 16px; color: #fff; font-size: 13.5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.nm-nav-list a:hover, .nm-nav-list a.active { color: var(--nm-red); border-color: var(--nm-red); }
.nm-mega {
  display: none; position: absolute; left: 0; top: 100%; background: #fff; color: #111;
  min-width: 640px; padding: 20px; box-shadow: var(--nm-shadow); border-radius: 0 0 10px 10px;
  grid-template-columns: repeat(3,1fr); gap: 16px; z-index: 50;
}
.nm-nav-list li:hover .nm-mega { display: grid; }
.nm-mega a { color: #111; padding: 6px 0; font-weight: 500; text-transform: none; }
.nm-mega a:hover { color: var(--nm-red); }

/* ---------- Hero Slider ---------- */
.nm-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin: 24px 0; }
.nm-hero-main { position: relative; border-radius: var(--nm-radius); overflow: hidden; height: 460px; }
.nm-hero-main img { width: 100%; height: 100%; object-fit: cover; }
.nm-hero-overlay {
  position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 55%);
  display: flex; align-items: flex-end; padding: 28px;
}
.nm-hero-content { color: #fff; }
.nm-badge { display: inline-block; background: var(--nm-red); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; margin-bottom: 10px; letter-spacing: .5px; }
.nm-hero-title { font-family: var(--nm-font-serif); font-size: 30px; line-height: 1.25; font-weight: 700; margin: 0 0 8px; }
.nm-hero-meta { font-size: 12.5px; opacity: .85; }
.nm-hero-side { display: flex; flex-direction: column; gap: 14px; }
.nm-hero-side-item { display: flex; gap: 10px; }
.nm-hero-side-item img { width: 92px; height: 66px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.nm-hero-side-item h4 { margin: 0 0 4px; font-size: 14px; line-height: 1.35; }

/* ---------- Section headers ---------- */
.nm-section { margin: 36px 0; }
.nm-section-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--nm-black); padding-bottom: 8px; margin-bottom: 18px; }
.nm-section-title { font-family: var(--nm-font-serif); font-size: 22px; font-weight: 800; position: relative; padding-left: 12px; border-left: 5px solid var(--nm-red); }
.nm-section-link { font-size: 13px; font-weight: 600; color: var(--nm-red); }

/* ---------- Cards / Grid ---------- */
.nm-grid { display: grid; gap: 20px; }
.nm-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.nm-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.nm-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.nm-card {
  background: var(--nm-white); border: 1px solid var(--nm-border); border-radius: var(--nm-radius);
  overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.nm-card:hover { transform: translateY(-3px); box-shadow: var(--nm-shadow); }
.nm-card img { width: 100%; height: 170px; object-fit: cover; }
.nm-card-body { padding: 14px; }
.nm-card-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--nm-red); letter-spacing: .5px; }
.nm-card-title { font-family: var(--nm-font-serif); font-size: 16px; font-weight: 700; margin: 6px 0; line-height: 1.35; }
.nm-card-meta { font-size: 12px; color: var(--nm-gray-500); display: flex; gap: 10px; }

.nm-layout { display: grid; grid-template-columns: 2.3fr 1fr; gap: 28px; }

/* Ranked list (Most Read / Trending) */
.nm-ranked-list { list-style: none; margin: 0; padding: 0; }
.nm-ranked-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--nm-border); }
.nm-rank-num { font-family: var(--nm-font-serif); font-size: 26px; font-weight: 800; color: var(--nm-gray-300); width: 32px; flex-shrink: 0; }
.nm-ranked-list h4 { margin: 0; font-size: 14px; line-height: 1.35; }

/* ---------- Sidebar widgets ---------- */
.nm-widget { background: var(--nm-gray-50); border: 1px solid var(--nm-border); border-radius: var(--nm-radius); padding: 16px; margin-bottom: 20px; }
.nm-widget-title { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--nm-black); }
.nm-ticker-widget { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--nm-border); }
.nm-ticker-widget .up { color: #16a34a; } .nm-ticker-widget .down { color: var(--nm-red); }

/* ---------- Newsletter ---------- */
.nm-newsletter {
  background: var(--nm-black); color: #fff; border-radius: var(--nm-radius);
  padding: 34px; text-align: center; margin: 40px 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(229,9,20,.25), transparent 50%);
}
.nm-newsletter h3 { font-family: var(--nm-font-serif); font-size: 26px; margin: 0 0 8px; }
.nm-newsletter form { display: flex; max-width: 420px; margin: 18px auto 0; gap: 8px; }
.nm-newsletter input[type=email] { flex: 1; padding: 12px 14px; border-radius: 6px; border: none; font-size: 14px; }
.nm-btn { background: var(--nm-red); color: #fff; border: none; padding: 12px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; transition: .2s; }
.nm-btn:hover { background: var(--nm-red-dark); }
.nm-btn-outline { background: transparent; border: 1.5px solid var(--nm-black); color: var(--nm-black); }

/* ---------- Ad slots ---------- */
.nm-ad-slot { display: flex; align-items: center; justify-content: center; background: var(--nm-gray-50); border: 1px dashed var(--nm-gray-300); border-radius: 8px; min-height: 90px; margin: 20px 0; font-size: 12px; color: var(--nm-gray-500); overflow: hidden; }

/* ---------- Article page ---------- */
.nm-article-header { max-width: 820px; margin: 24px auto 0; }
.nm-article-title { font-family: var(--nm-font-serif); font-size: 36px; line-height: 1.25; font-weight: 800; margin: 12px 0; }
.nm-article-excerpt { font-size: 18px; color: var(--nm-gray-700); margin-bottom: 16px; }
.nm-article-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--nm-gray-500); padding-bottom: 16px; border-bottom: 1px solid var(--nm-border); flex-wrap: wrap; }
.nm-author-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--nm-gray-300); }
.nm-article-image { max-width: 900px; margin: 24px auto; border-radius: var(--nm-radius); overflow: hidden; }
.nm-article-body { max-width: 780px; margin: 0 auto; font-size: 18px; line-height: 1.85; font-family: var(--nm-font-serif); }
.nm-article-body p { margin: 0 0 20px; }
.nm-share-bar { display: flex; gap: 10px; margin: 24px auto; max-width: 780px; }
.nm-share-bar a, .nm-share-bar button { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--nm-gray-50); border: 1px solid var(--nm-border); cursor: pointer; }

/* ---------- Footer ---------- */
.nm-footer { background: var(--nm-black); color: #d4d4d8; margin-top: 50px; padding: 46px 0 0; }
.nm-footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 24px; padding-bottom: 34px; }
.nm-footer h5 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.nm-footer ul { list-style: none; margin: 0; padding: 0; }
.nm-footer li { margin-bottom: 9px; font-size: 13.5px; }
.nm-footer a:hover { color: var(--nm-red); }
.nm-footer-bottom { border-top: 1px solid #26262a; padding: 16px 0; text-align: center; font-size: 12.5px; color: var(--nm-gray-500); }

/* ---------- Forms (login/admin shared) ---------- */
.nm-form-group { margin-bottom: 16px; }
.nm-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.nm-form-group input, .nm-form-group textarea, .nm-form-group select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--nm-border); border-radius: 7px; font-size: 14px;
  background: var(--nm-white); color: var(--nm-black);
}
.nm-alert { padding: 12px 16px; border-radius: 7px; margin-bottom: 16px; font-size: 14px; }
.nm-alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.nm-alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ---------- Tools Page ---------- */
.nm-tool-card {
  background: var(--nm-white); border: 1px solid var(--nm-border); border-radius: var(--nm-radius);
  padding: 22px; text-align: center; transition: transform .2s, box-shadow .2s;
}
.nm-tool-card:hover { transform: translateY(-3px); box-shadow: var(--nm-shadow); border-color: var(--nm-red); }
.nm-tool-icon { font-size: 34px; margin-bottom: 10px; }
.nm-tool-card h3 { font-family: var(--nm-font-serif); font-size: 16px; margin: 6px 0; }
.nm-tool-card p { font-size: 12.5px; color: var(--nm-gray-500); margin: 0; }

.nm-calc-wrap { max-width: 640px; margin: 20px auto; }
.nm-calc-box { background: var(--nm-white); border: 1px solid var(--nm-border); border-radius: var(--nm-radius); padding: 26px; }
.nm-calc-box h1 { font-family: var(--nm-font-serif); font-size: 24px; margin-top: 0; }
.nm-calc-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.nm-calc-row .nm-form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
.nm-calc-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.nm-calc-tab {
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--nm-border); cursor: pointer; font-size: 13px; font-weight: 600;
  background: var(--nm-gray-50);
}
.nm-calc-tab.active { background: var(--nm-red); color: #fff; border-color: var(--nm-red); }
.nm-calc-result {
  background: var(--nm-gray-50); border-radius: 10px; padding: 20px; margin-top: 18px; text-align: center;
}
.nm-calc-result .big { font-size: 30px; font-weight: 800; color: var(--nm-red); font-family: var(--nm-font-serif); }
.nm-calc-result .label { font-size: 12px; color: var(--nm-gray-500); text-transform: uppercase; letter-spacing: .4px; }
.nm-calc-breakdown { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 16px; }
.nm-calc-breakdown div { background: var(--nm-white); border: 1px solid var(--nm-border); border-radius: 8px; padding: 12px; text-align: center; }
.nm-calc-breakdown .val { font-weight: 800; font-size: 15px; }
.nm-calc-breakdown .lbl { font-size: 11px; color: var(--nm-gray-500); text-transform: uppercase; }

/* ---------- Mobile ---------- */
.nm-mobile-toggle { display: none; }

@media (max-width: 960px) {
  .nm-hero { grid-template-columns: 1fr; }
  .nm-layout { grid-template-columns: 1fr; }
  .nm-grid.cols-4 { grid-template-columns: repeat(2,1fr); }
  .nm-grid.cols-3 { grid-template-columns: repeat(2,1fr); }
  .nm-footer-grid { grid-template-columns: repeat(2,1fr); }
  .nm-article-title { font-size: 26px; }
  .nm-article-body { font-size: 16.5px; }

  /* Slide-out mobile navigation */
  .nm-mobile-toggle { display: flex; }
  .nm-nav-list {
    display: none;
    flex-direction: column;
    background: var(--nm-black);
    max-height: 70vh;
    overflow-y: auto;
  }
  .nm-nav-list.nm-nav-open { display: flex; }
  .nm-nav-list a { border-bottom: 1px solid rgba(255,255,255,.08); padding: 14px 16px; }
  /* Mega menu is desktop-only — hover doesn't exist on touch */
  .nm-mega { display: none !important; }

  /* Header stays compact so the hero is visible sooner */
  .nm-header { position: static; }
  .nm-logo { font-size: 26px; }
  .nm-tagline { font-size: 9.5px; letter-spacing: 1px; }
  .nm-topbar { font-size: 11.5px; }
  .nm-topbar a { margin-left: 10px; }

  /* Empty ad slots shouldn't eat half the screen on mobile */
  .nm-ad-slot { min-height: 60px; font-size: 11px; margin: 12px 0; }
}

@media (max-width: 600px) {
  .nm-grid.cols-4, .nm-grid.cols-3, .nm-grid.cols-2 { grid-template-columns: 1fr; }
  .nm-footer-grid { grid-template-columns: 1fr; }

  /* Hero: shorter, and a much stronger scrim so the headline is always
     legible over any photo (this is what was making the title unreadable) */
  .nm-hero-main { height: 340px; }
  .nm-hero-overlay {
    background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.75) 45%, rgba(0,0,0,.35) 100%);
    padding: 18px;
  }
  .nm-hero-title { font-size: 22px; }
  .nm-hero-meta { font-size: 11.5px; }
  .nm-badge { font-size: 10px; padding: 3px 8px; }

  .nm-section { margin: 26px 0; }
  .nm-section-title { font-size: 19px; }
  .nm-card img { height: 190px; }
  .nm-hero-side-item img { width: 76px; height: 58px; }
  .nm-hero-side-item h4 { font-size: 13.5px; }

  .nm-article-title { font-size: 23px; }
  .nm-article-excerpt { font-size: 16px; }
  .nm-article-body { font-size: 16px; }
  .nm-article-meta { gap: 10px; font-size: 12px; }

  /* Stack the newsletter form instead of squashing it */
  .nm-newsletter { padding: 24px 18px; }
  .nm-newsletter h3 { font-size: 21px; }
  .nm-newsletter form { flex-direction: column; }
  .nm-newsletter .nm-btn { width: 100%; }

  /* Comfortable tap targets */
  .nm-icon-btn { width: 42px; height: 42px; }
  .nm-share-bar a, .nm-share-bar button { width: 42px; height: 42px; }

  .nm-calc-box { padding: 18px; }
  .nm-calc-breakdown { grid-template-columns: 1fr; }
  .nm-widget { padding: 14px; }
}