/*
Theme Name: NewsDesk Classic
Theme URI: https://example.com/newsdesk-classic
Author: Your Studio
Author URI: https://example.com
Description: A classic, serious editorial news theme with a breaking-news ticker, featured hero story, category-tagged article grid, and clean serif typography. Original design inspired by traditional broadsheet news layouts — not a copy of any specific publisher's branding.
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newsdesk-classic
Tags: news, magazine, blog, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   0. CSS VARIABLES / THEME TOKENS
========================================================= */
:root {
  --nd-accent: #b80000;        /* serious-news red accent */
  --nd-accent-dark: #8f0000;
  --nd-ink: #141414;           /* near-black body text */
  --nd-ink-soft: #3a3a3a;
  --nd-muted: #6b6b6b;
  --nd-border: #dcdcdc;
  --nd-border-strong: #141414;
  --nd-bg: #ffffff;
  --nd-bg-alt: #f4f3f1;
  --nd-ticker-bg: #141414;
  --nd-font-headline: "Playfair Display", Georgia, "Times New Roman", serif;
  --nd-font-body: "Source Serif Pro", Georgia, serif;
  --nd-font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nd-max-width: 1200px;
}

/* =========================================================
   1. RESET & BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--nd-font-body);
  color: var(--nd-ink);
  background: var(--nd-bg);
  line-height: 1.55;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--nd-font-headline);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
}
.container {
  max-width: var(--nd-max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.screen-reader-text { position: absolute; left: -9999px; }

/* =========================================================
   2. TOP UTILITY BAR + BREAKING NEWS TICKER
========================================================= */
.nd-utility-bar {
  background: var(--nd-ticker-bg);
  color: #fff;
  font-family: var(--nd-font-ui);
  font-size: 13px;
}
.nd-utility-bar .container {
  display: flex;
  align-items: center;
  height: 34px;
  gap: 16px;
}
.nd-utility-bar .nd-date {
  white-space: nowrap;
  color: #bbbbbb;
}
.nd-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 20px;
}
.nd-ticker-label {
  background: var(--nd-accent);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 2px;
  margin-right: 10px;
  white-space: nowrap;
}
.nd-ticker-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  position: absolute;
  animation: nd-scroll 32s linear infinite;
}
.nd-ticker:hover .nd-ticker-track { animation-play-state: paused; }
@keyframes nd-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   3. MASTHEAD (LOGO + NAV)
========================================================= */
.nd-masthead {
  border-bottom: 4px solid var(--nd-border-strong);
  padding: 22px 0 14px;
}
.nd-masthead .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.nd-logo {
  font-family: var(--nd-font-headline);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--nd-ink);
}
.nd-logo span { color: var(--nd-accent); }
.nd-header-meta {
  font-family: var(--nd-font-ui);
  font-size: 12px;
  color: var(--nd-muted);
  text-align: right;
}

.nd-nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--nd-ink);
  padding: 6px 10px;
  font-family: var(--nd-font-ui);
  font-weight: 600;
  cursor: pointer;
}

.nd-primary-nav {
  background: var(--nd-ink);
}
.nd-primary-nav .container { padding-left: 20px; padding-right: 20px; }
.nd-primary-nav ul {
  display: flex;
  flex-wrap: wrap;
}
.nd-primary-nav a {
  display: block;
  color: #fff;
  font-family: var(--nd-font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 13px 16px;
  border-right: 1px solid rgba(255,255,255,.12);
}
.nd-primary-nav li:first-child a { color: #ff5757; }
.nd-primary-nav a:hover { background: var(--nd-accent); color: #fff; }

/* =========================================================
   4. CATEGORY TAGS
========================================================= */
.nd-tag {
  display: inline-block;
  font-family: var(--nd-font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--nd-accent);
  border-bottom: 2px solid var(--nd-accent);
  padding-bottom: 2px;
  margin-bottom: 8px;
}
.nd-tag.alt-world   { color: #1a5cb0; border-color: #1a5cb0; }
.nd-tag.alt-business{ color: #0a7d3c; border-color: #0a7d3c; }
.nd-tag.alt-tech     { color: #7a2fb0; border-color: #7a2fb0; }
.nd-tag.alt-sport    { color: #c07a00; border-color: #c07a00; }

/* =========================================================
   5. HERO / FEATURED SECTION
========================================================= */
.nd-hero {
  padding: 30px 0;
  border-bottom: 1px solid var(--nd-border);
}
.nd-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}
.nd-hero-main img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 14px;
}
.nd-hero-main h1 {
  font-size: 38px;
  margin-bottom: 12px;
}
.nd-hero-main p.nd-dek {
  font-size: 19px;
  color: var(--nd-ink-soft);
  margin-bottom: 10px;
}
.nd-byline {
  font-family: var(--nd-font-ui);
  font-size: 12px;
  color: var(--nd-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nd-hero-side { display: flex; flex-direction: column; gap: 18px; }
.nd-side-story { display: flex; gap: 12px; border-bottom: 1px solid var(--nd-border); padding-bottom: 16px; }
.nd-side-story:last-child { border-bottom: none; }
.nd-side-story img { width: 96px; height: 72px; object-fit: cover; flex-shrink: 0; }
.nd-side-story h3 { font-size: 16px; margin-bottom: 4px; }

/* =========================================================
   6. MAIN CONTENT + SIDEBAR LAYOUT
========================================================= */
.nd-content-wrap {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 40px;
  align-items: start;
  padding: 34px 0 30px;
}
.nd-section-title {
  font-size: 22px;
  border-bottom: 3px solid var(--nd-ink);
  padding-bottom: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nd-section-title::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--nd-accent);
  display: inline-block;
}

.nd-article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 28px;
  margin-bottom: 40px;
}
.nd-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 10px; }
.nd-card h3 { font-size: 19px; margin-bottom: 6px; }
.nd-card p { color: var(--nd-ink-soft); font-size: 15px; margin: 0 0 8px; }

.nd-list-story {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--nd-border);
}
.nd-list-story img { width: 120px; height: 90px; object-fit: cover; flex-shrink: 0; }
.nd-list-story h3 { font-size: 18px; margin-bottom: 4px; }
.nd-list-story p { font-size: 14px; color: var(--nd-ink-soft); margin: 0; }

/* Category feature sections (World / Business / Tech / Sport, etc.) */
.nd-cat-section { margin-bottom: 42px; }
.nd-cat-section:last-child { margin-bottom: 0; }
.nd-section-title a:first-child { color: inherit; }
.nd-section-title a:first-child:hover { color: var(--nd-accent); }
.nd-more-link {
  margin-left: auto;
  font-family: var(--nd-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--nd-accent);
  text-transform: none;
  white-space: nowrap;
}
.nd-more-link:hover { text-decoration: underline; }
.nd-article-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .nd-article-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .nd-article-grid-4 { grid-template-columns: 1fr; } }

/* Single post typography */
.nd-single-content { font-size: 19px; }
.nd-single-content p { margin: 0 0 1.2em; }
.nd-single-content h2 { font-size: 26px; margin-top: 1.4em; }
.nd-single-content blockquote {
  border-left: 4px solid var(--nd-accent);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  font-style: italic;
  font-size: 21px;
  color: var(--nd-ink-soft);
}
.nd-featured-image { margin-bottom: 20px; }
.nd-featured-image figcaption {
  font-family: var(--nd-font-ui);
  font-size: 13px;
  color: var(--nd-muted);
  margin-top: 6px;
}

/* =========================================================
   7. SIDEBAR / WIDGETS
========================================================= */
.nd-sidebar .widget {
  margin-bottom: 34px;
  border: 1px solid var(--nd-border);
  padding: 18px;
}
.nd-sidebar .widget:last-child { margin-bottom: 0; }
.nd-sidebar .widget-title {
  font-family: var(--nd-font-ui);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--nd-ink);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.nd-most-read li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--nd-border);
  align-items: baseline;
}
.nd-most-read li:last-child { border-bottom: none; }
.nd-most-read .nd-rank {
  font-family: var(--nd-font-headline);
  font-size: 22px;
  color: var(--nd-accent);
  font-weight: 900;
  width: 24px;
  flex-shrink: 0;
}

/* =========================================================
   8. FOOTER
========================================================= */

/* 8.1 — "Explore" band: horizontal scrollable pills above the main footer */
.nd-footer-explore {
  display: block;
  width: 100%;
  background: #1c1c1c;
  border-top: 1px solid #333;
}
.nd-footer-explore-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nd-footer-explore-label {
  font-family: var(--nd-font-ui);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
}
ul.nd-footer-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nd-footer-pills li {
  flex-shrink: 0;
  margin: 0;
  list-style: none;
}
.nd-footer-pills li a {
  display: inline-block;
  font-family: var(--nd-font-ui);
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: capitalize;
}
.nd-footer-pills li a:hover {
  background: var(--nd-accent);
  border-color: var(--nd-accent);
  color: #fff;
}

/* 8.2 — Main footer columns */
.nd-footer {
  background: var(--nd-ink);
  color: #d8d8d8;
  padding: 44px 0 20px;
  font-family: var(--nd-font-ui);
}
.nd-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 34px;
}
.nd-footer-col h4,
.nd-footer h4 {
  position: relative;
  color: #fff;
  font-family: var(--nd-font-ui);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
  padding-bottom: 12px;
}
.nd-footer-col h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  background: var(--nd-accent);
}
.nd-footer ul li { margin-bottom: 9px; font-size: 14px; }
.nd-footer ul li a { color: #c8c8c8; }
.nd-footer ul li a:hover { color: var(--nd-accent); }

/* 8.3 — Follow-us social badges */
.nd-social-icons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nd-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-family: var(--nd-font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: background .15s ease;
}
.nd-social-icon:hover { background: var(--nd-accent); }
.nd-footer-note {
  font-size: 13px;
  line-height: 1.5;
  color: #999;
  margin: 0;
}

/* 8.4 — Bottom bar */
.nd-footer-bottom {
  border-top: 1px solid #333;
  padding-top: 18px;
  font-size: 12px;
  color: #999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.nd-footer-bottom-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.nd-footer-bottom-links a:hover { color: var(--nd-accent); }

/* =========================================================
   9. RESPONSIVE
========================================================= */

/* Smooth momentum scrolling for horizontally-scrolling strips on touch devices */
.nd-ticker,
.nd-footer-explore-inner {
  -webkit-overflow-scrolling: touch;
}

/* ---- Tablet (≤900px): stack hero/sidebar, 2-up grids ---- */
@media (max-width: 900px) {
  .nd-hero-grid { grid-template-columns: 1fr; }
  .nd-content-wrap { grid-template-columns: 1fr; gap: 34px; }
  .nd-article-grid { grid-template-columns: 1fr 1fr; }
  .nd-footer-grid { grid-template-columns: 1fr 1fr; }
  .nd-sidebar { margin-top: 6px; }
}

/* ---- Nav collapses to a hamburger a bit earlier than content stacking,
        so a long category menu never gets cramped into one line ---- */
@media (max-width: 800px) {
  .nd-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
  }
  .nd-primary-nav ul { display: none; flex-direction: column; }
  .nd-primary-nav.nd-open ul { display: flex; }
  .nd-primary-nav a {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 13px 16px;
    min-height: 44px; /* comfortable tap target */
    display: flex;
    align-items: center;
  }
}

/* ---- Phone (≤640px) ---- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .nd-logo { font-size: 28px; }
  .nd-header-meta { display: none; }
  .nd-masthead { padding: 18px 0 12px; }

  .nd-utility-bar .container { gap: 10px; }
  .nd-date { display: none; } /* saves space; ticker is the priority content */

  .nd-hero-main h1 { font-size: 24px; }
  .nd-hero-main p.nd-dek { font-size: 16px; }
  .nd-hero-main img { aspect-ratio: 16/10; }
  .nd-side-story img { width: 84px; height: 64px; }

  .nd-section-title { font-size: 19px; }

  .nd-article-grid,
  .nd-article-grid-4,
  .nd-footer-grid { grid-template-columns: 1fr; }

  /* Compact, consistent card rhythm on a single column */
  .nd-card { padding-bottom: 6px; border-bottom: 1px solid var(--nd-border); margin-bottom: 4px; }
  .nd-card:last-child { border-bottom: none; }
  .nd-card img { aspect-ratio: 16/10; }
  .nd-card h3 { font-size: 18px; }

  .nd-list-story,
  .nd-side-story { gap: 12px; }
  .nd-list-story img { width: 96px; height: 72px; }

  .nd-cat-section { margin-bottom: 30px; }
  .nd-content-wrap { padding: 26px 0 24px; gap: 30px; }

  .nd-footer-explore-inner { padding: 12px 16px; }
  .nd-footer-bottom { flex-direction: column; align-items: flex-start; }
  .nd-footer { padding: 34px 0 18px; }
}

/* ---- Small phone (≤380px): SE / mini-width devices ---- */
@media (max-width: 380px) {
  .nd-logo { font-size: 24px; }
  .nd-hero-main h1 { font-size: 21px; }
  .nd-ticker-label { font-size: 10px; padding: 2px 6px; }
  .nd-card h3, .nd-list-story h3 { font-size: 16px; }
}
