/* ==========================================================================
   Watch Nigeria — Main Stylesheet
   Palette matches the theme logo (navy + gold) in both light and dark mode
   ========================================================================== */

:root {
  --color-navy: #081274;       /* logo circle */
  --color-navy-dark: #050c52;  /* pressed/hover state of navy */
  --color-navy-light: #1b2896; /* lighter navy for secondary accents */
  --color-gold: #ffd800;       /* logo "N" */
  --color-gold-dark: #d9b700;  /* pressed/hover state of gold */
  --color-oxblood: #4a0404;    /* section headings + on-image category labels */
  --color-cream: #fbf6ee;
  --color-cream-2: #f3ead9;
  --color-text: #201f2e;
  --color-text-muted: #5c5b73;
  --color-border: #e2e1ec;
  --color-card: #ffffff;

  --bg: var(--color-cream);
  --bg-alt: var(--color-cream-2);
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --border: var(--color-border);
  --card: var(--color-card);
  --accent: var(--color-navy);
  --accent-2: var(--color-gold-dark);
  --accent-3: var(--color-gold);
  /* Dark color on the light background. Swapped to a light color in
     dark mode below, so section headings and on-image category labels
     always stay visible whichever mode is active. */
  --heading-color: var(--color-oxblood);

  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-site-title: 'Poppins', 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 10px;
  --shadow: 0 4px 16px rgba(8, 18, 116, 0.1);
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #05081f;
  --bg-alt: #0a0e33;
  --text: #ede9d8;
  --text-muted: #a9a8c2;
  --border: #1c2266;
  --card: #0b1040;
  --accent: var(--color-gold);
  --accent-2: var(--color-navy-light);
  --accent-3: #ffe066;
  /* Light color — mirrors --heading-color's light-mode dark tone so
     headings and category labels flip to light-on-dark automatically. */
  --heading-color: var(--color-cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}

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

/* ---------- Responsive media safety net ----------
   Forces ANY image/figure/embed inside post content to respect the
   viewport, even if WordPress (or a pasted image) sets an inline
   pixel width — this is what was causing images to render at
   desktop size on mobile. */
.entry-content img,
.entry-content figure,
.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object,
.card-excerpt img,
.hero img,
.card-thumb img {
  max-width: 100% !important;
  width: auto;
  height: auto;
}
.entry-content figure { margin: 0 0 1.5em; }
.entry-content figure img { width: 100%; }
.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.entry-content iframe { aspect-ratio: 16 / 9; height: auto; }
.entry-content { overflow-wrap: break-word; word-wrap: break-word; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 20px;
  gap: 12px 20px;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 2px;
}
.site-logo-link,
.custom-logo-link { display: flex; align-items: center; }
.site-branding img.custom-logo { max-height: 44px; width: auto; }
.site-title-link { text-decoration: none; display: inline-flex; align-items: center; }
.site-title {
  /* Bolder, more geometric than the body/heading serif — echoes the
     blocky lettering in the logo mark. Color is set inline in <head>
     from Appearance → Customize → Site Identity → Site Title Color. */
  font-family: var(--font-site-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent); /* fallback if the customizer color is ever unset */
  margin: 0;
  white-space: nowrap;
}
.site-description {
  flex-basis: 100%;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  line-height: 1.4;
  margin: 0;
  padding-left: 2px;
  max-width: 420px;
}

/* The site title's color is normally set by the Customizer (Appearance →
   Customize → Site Identity → Site Title Color) via an inline <style> tag
   in <head>. In dark mode that chosen color often can't register well
   against the dark background, so it's automatically swapped to white
   the instant the visitor flips the dark/light toggle — no reload
   needed, since it's just following the data-theme attribute the toggle
   already sets. Switching back to light mode restores the Customizer
   color automatically. !important is required here only to win over
   the inline style's equal specificity. */
[data-theme="dark"] .site-title {
  color: #fff !important;
}

.primary-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.primary-nav ul { display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  background: var(--accent);
  color: #fff;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.theme-toggle,
.menu-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover, .menu-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* Search button is a labeled pill (icon + text), not a compressed
   icon-only circle, so it reads clearly at any screen size. */
.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.search-toggle:hover {
  background: var(--accent);
  color: #fff;
}
.search-toggle svg.icon-search { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.search-toggle-label { line-height: 1; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

.menu-toggle { display: none; }
.menu-toggle-label { display: none; }

/* ---------- Header search panel (mobile + desktop) ---------- */
.site-search-panel {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.site-search-panel[hidden] { display: none; }
.site-search-panel .search-form { margin: 0; }
.site-search-panel .form-row { margin-bottom: 0; }
.site-search-panel input[type="search"] { flex: 1; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { background: var(--color-navy-dark); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-row { margin-bottom: 14px; }

/* ---------- Hero / Featured ---------- */
.hero {
  position: relative;
  margin: 24px auto;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 1200px;
}
.hero-link { display: block; position: relative; }
.hero img { width: 100%; height: 520px; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,15,10,0.85) 0%, rgba(20,15,10,0.15) 55%, rgba(20,15,10,0) 100%);
}
.hero-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px;
  color: #fff;
  max-width: 860px;
}
.hero-category {
  display: inline-block;
  background: var(--heading-color);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  transition: background var(--transition), color var(--transition);
}
.hero-title { font-size: clamp(1.9rem, 1.2rem + 2vw, 3rem); line-height: 1.12; color: #fff; margin-bottom: 10px; }
.hero-title a { color: #fff; }
.hero-meta { font-size: 0.9rem; color: #f0e5d8; letter-spacing: 0.3px; }

/* ---------- Section headers ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 10px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
  margin-bottom: 24px;
}
.section-header h2 {
  font-family: var(--font-site-title);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--heading-color);
  transition: color var(--transition);
  position: relative;
  padding-left: 18px;
}
.section-header h2::before {
  content: "";
  position: absolute;
  left: 0; top: 0.12em; bottom: 0.12em;
  width: 6px;
  border-radius: 3px;
  background: var(--accent-3);
}
.section-header .view-all {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Post grid / cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.post-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.post-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-thumb { position: relative; }
.card-thumb img { width: 100%; height: 170px; object-fit: cover; }
.card-cat {
  position: absolute; top: 10px; left: 10px;
  background: var(--heading-color);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.card-body { padding: 16px; }
.card-title { font-size: 1.05rem; margin-bottom: 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 10px; }
.card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.card-meta img.avatar { width: 20px; height: 20px; border-radius: 50%; }

/* ---------- Sidebar / widgets ---------- */
.content-layout { display: grid; grid-template-columns: 2.4fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.widget h3 {
  font-family: var(--font-site-title);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--heading-color);
  margin-bottom: 16px;
}
.widget h3::after {
  content: "";
  display: block;
  width: 40px; height: 3px;
  margin-top: 10px;
  background: var(--accent-3);
  border-radius: 2px;
}
.widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; }
.widget ul li:last-child { border-bottom: none; }

/* ---------- Homepage: full-width magazine list (no sidebar, no grid) ----------
   Every section's stories are stacked in a single column: large
   featured image on top, headline underneath, then excerpt and byline.
   Scoped to .homepage-main so archive, category, search and
   single-post cards are unaffected. */
.homepage-main .post-grid.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.homepage-main .post-list .card {
  display: block;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  overflow: visible;
  margin: 0 0 30px;
  padding: 0 0 30px;
}
.homepage-main .post-list .card:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.homepage-main .post-list .card:hover { transform: none; box-shadow: none; }
.homepage-main .post-list .card-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.homepage-main .post-list .card-thumb img {
  width: 100%;
  height: clamp(220px, 36vw, 460px);
  object-fit: cover;
  transition: transform 0.5s ease;
}
.homepage-main .post-list .card:hover .card-thumb img { transform: scale(1.03); }
.homepage-main .post-list .card-cat { top: 16px; left: 16px; font-size: 0.75rem; padding: 5px 14px; }
.homepage-main .post-list .card-body { padding: 20px 0 0; }
.homepage-main .post-list .card-title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.2;
  margin-bottom: 10px;
}
.homepage-main .post-list .card-excerpt { font-size: 1.02rem; margin-bottom: 12px; }
.homepage-main .post-list .card-meta { font-size: 0.85rem; }
.homepage-main .pagination {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}
@media (min-width: 1400px) {
  .homepage-main .pagination { max-width: 1280px; }
}
/* Theme Options → Homepage switches */
.wn-hide-excerpt .homepage-main .card-excerpt { display: none; }
.wn-hide-meta .homepage-main .card-meta { display: none; }

/* ---------- Single post: article + right sidebar (desktop) ----------
   Reuses .content-layout (same two-column, desktop-only sidebar
   behavior as archive/category/search). The article column drops its
   own centering/padding since .content-layout supplies the spacing,
   and the "You May Also Like" grid uses 2 columns to fit beside the
   sidebar. Scoped to .single-layout so static pages (page.php) keep
   their original centered layout. */
.single-layout .single-main { min-width: 0; }
.single-layout .single-post { max-width: none; margin: 0; padding: 0; }
.single-layout .related-posts.section { padding-left: 0; padding-right: 0; max-width: none; }
.single-layout .related-posts .post-grid { grid-template-columns: repeat(2, 1fr); }
/* Larger sidebar. Width comes from Theme Options → Posts & Sidebar
   (--wn-sidebar-w, default 400px), capped at 36% of the layout so the
   article never gets squeezed on smaller laptop screens. */
@media (min-width: 901px) {
  .single-layout { grid-template-columns: minmax(0, 1fr) min(var(--wn-sidebar-w, 400px), 36%); }
  .single-layout.sidebar-left { grid-template-columns: min(var(--wn-sidebar-w, 400px), 36%) minmax(0, 1fr); }
  .single-layout.sidebar-left .sidebar { order: -1; }
  .single-layout.no-sidebar { grid-template-columns: minmax(0, 800px); justify-content: center; }
}
.single-layout .widget { padding: 26px; }
.single-layout .widget ul li { font-size: 1rem; padding: 10px 0; }
@media (max-width: 700px) {
  .single-layout .related-posts .post-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .single-layout { padding: 24px 14px; }
}

/* ---------- Single post ---------- */
.single-post { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.single-post .post-thumb img { width: 100%; border-radius: var(--radius); margin-bottom: 24px; }
.single-post .post-category {
  color: var(--accent); font-weight: 700; text-transform: uppercase;
  font-size: 0.8rem; letter-spacing: 1px;
}
.single-post h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.12; letter-spacing: -0.01em; margin: 10px 0 18px; }
.single-post .post-meta {
  display: flex; align-items: center; gap: 14px;
  color: var(--text-muted); font-size: 0.9rem;
  padding-bottom: 20px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.single-post .post-meta img.avatar { width: 32px; height: 32px; border-radius: 50%; }
.entry-content { font-size: 1.12rem; line-height: 1.8; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol {
  margin: 0 0 1.2em; padding-left: 1.4em;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content ul ul { list-style: circle; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content img { border-radius: var(--radius); margin: 1em 0; }
.entry-content a {
  color: #1a4fd6;
  font-weight: 700;
  text-decoration: underline;
}
.entry-content a:hover { color: var(--accent-2); }
.entry-content blockquote {
  border-left: 5px solid var(--accent-3);
  margin: 1.8em 0; padding: 0.6em 1.4em;
  background: var(--bg-alt); font-style: italic;
  font-family: var(--font-heading); font-size: 1.25rem; line-height: 1.5;
  border-radius: 0 8px 8px 0;
}
/* ---------- Social share ---------- */
.social-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.social-share .share-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-right: 4px;
}
.social-share a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  transition: transform var(--transition), opacity var(--transition);
}
.social-share a:hover { transform: translateY(-1px); opacity: 0.92; color: #fff; }
.social-share a svg { width: 15px; height: 15px; fill: currentColor; }
.share-facebook { background: #1877f2; }
.share-x { background: #000; }
[data-theme="dark"] .share-x { background: #2a2a2a; }
.share-whatsapp { background: #25d366; }

.author-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--bg-alt); border-radius: var(--radius);
  padding: 20px; margin: 40px 0;
}
.author-box img { width: 60px; height: 60px; border-radius: 50%; }
.author-socials { display: flex; gap: 8px; margin-top: 10px; }
.author-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.author-socials a:hover { background: var(--accent); color: #fff; }
.author-socials a svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 40px; }
.comment-list { margin-bottom: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author { font-weight: 700; }
.comment-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy); color: #dcdff0; margin-top: 60px; }
[data-theme="dark"] .site-footer { background: #030616; }
.footer-inner {
  /* Fluid, edge-to-edge: spans the full viewport width on every
     device, with side padding that scales with the screen. */
  width: 100%; max-width: none; margin: 0; padding: 56px clamp(20px, 5vw, 96px) 24px;
  padding-left: max(clamp(20px, 5vw, 96px), env(safe-area-inset-left));
  padding-right: max(clamp(20px, 5vw, 96px), env(safe-area-inset-right));
  /* Three columns (About / Explore / Legal) that share the full width. */
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
}
.footer-col { min-width: 0; overflow-wrap: anywhere; }
.footer-inner li a { display: inline-block; padding: 4px 0; }
.footer-inner h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-inner a { color: #b7bce6; }
.footer-inner a:hover { color: var(--color-gold); }
.footer-about p { color: #b7bce6; font-size: 0.9rem; }
.footer-bottom {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center; font-size: 0.82rem; color: #9ba0d1;
  padding: 18px max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow-wrap: anywhere;
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 30px 0; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem;
}
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Dark mode contrast fix ----------
   In dark mode --accent becomes the gold from the logo, which reads
   poorly with white text/icons on top of it. These elements keep their
   accent-colored background but switch their foreground to a dark navy
   so they stay legible without touching the light-mode styling above. */
[data-theme="dark"] .primary-nav a:hover,
[data-theme="dark"] .primary-nav .current-menu-item > a,
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .menu-toggle:hover,
[data-theme="dark"] .btn,
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .pagination .current {
  color: var(--color-navy-dark);
}
/* .btn:hover always swaps to a solid navy-dark background (see base rules
   above), so it needs white text back even in dark mode — otherwise this
   block's blanket ".btn" rule would make the hover text unreadable. */
[data-theme="dark"] .btn:hover {
  color: #fff;
}

/* ---------- Large desktop / wide screens ----------
   Container is already capped at 1200px so large monitors keep a
   readable line length automatically; this just gives extra-wide
   viewports a bit more breathing room in the gutters. */
@media (min-width: 1400px) {
  .container,
  .section,
  .hero,
  .content-layout {
    max-width: 1280px;
  }
}

/* ---------- Desktop: Menu drop-down ----------
   On screens wider than 700px the menu is no longer a row of links in
   the header. A "Menu" button (next to Search and the light/dark
   toggle, at the top-right) opens a drop-down list underneath it. The
   mobile slide-in panel (700px and below) is defined further down. */
@media (min-width: 701px) {
  /* One row: brand on the left, buttons on the right (top-right). The
     brand may shrink (its tagline wraps) instead of pushing the buttons
     onto a second row. */
  .header-inner { position: relative; flex-wrap: nowrap; }
  .site-branding { order: 1; min-width: 0; }
  .header-actions { order: 2; }
  .menu-toggle {
    display: inline-flex;
    width: auto; height: 40px;
    padding: 0 16px; gap: 8px;
    border-radius: 999px;
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  }
  .menu-toggle-label { display: inline; line-height: 1; }
  .menu-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; }
  .primary-nav {
    position: absolute;
    top: 100%; right: 20px;
    width: 280px; max-width: calc(100vw - 40px);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 101;
  }
  .primary-nav.open { opacity: 1; visibility: visible; transform: none; }
  .primary-nav ul { flex-direction: column; flex-wrap: nowrap; width: 100%; gap: 2px; }
  .primary-nav a { display: block; width: 100%; border-radius: 8px; }
  .primary-nav ul ul { padding-left: 14px; margin-top: 2px; }
}
[data-theme="dark"] .menu-toggle[aria-expanded="true"] { color: var(--color-navy); }

/* ---------- Tablet / mobile ----------
   The sidebar widget area is desktop-only (right column, via
   .content-layout's grid). Below this breakpoint it's hidden rather
   than stacked, since .content-layout collapses to a single column. */
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .primary-nav { position: fixed; top: var(--wn-header-h, 74px); left: 0; right: 0; bottom: 0;
    background: var(--bg); flex-direction: column; align-items: flex-start;
    padding: 20px; transform: translateX(-100%); transition: transform var(--transition);
    overflow-y: auto; z-index: 99;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; width: 100%; }
  .primary-nav a { display: block; width: 100%; border-radius: 8px; }
  .menu-toggle { display: inline-flex; }
  .post-grid { grid-template-columns: 1fr; }
  .hero img { height: 280px; }
  .hero-title { font-size: 1.5rem; }
  .site-branding img.custom-logo { max-height: 34px; }
  .site-title { font-size: 1.1rem; white-space: normal; }
  /* Header row: brand on the left, Search / light-dark / Menu buttons
     pinned to the top-right corner. */
  .header-inner { flex-wrap: nowrap; align-items: flex-start; }
  .site-branding { flex: 1 1 0; min-width: 0; }
  .header-actions { align-self: flex-start; }
  .site-description {
    font-size: 0.62rem;
    letter-spacing: 0.8px;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .header-actions { gap: 6px; }
  .site-search-panel .form-row { flex-direction: row; }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .container, .section, .hero { padding-left: 14px; padding-right: 14px; }
  .footer-inner {
    grid-template-columns: 1fr; gap: 24px; padding-top: 40px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .footer-inner li a { padding: 6px 0; }
  .header-inner { padding: 10px 14px; gap: 10px; }
  .theme-toggle, .menu-toggle { width: 36px; height: 36px; font-size: 1rem; }
  .search-toggle { height: 36px; padding: 0 12px; gap: 5px; font-size: 0.78rem; }
  .search-toggle svg.icon-search { width: 14px; height: 14px; }
  .hero { margin: 14px auto; }
  .hero img { height: 220px; }
  .hero-content { padding: 20px; }
  .hero-title { font-size: 1.3rem; }
  .section { padding: 28px 14px 6px; }
  .section-header h2 { font-size: 1.4rem; }
  .single-post { padding: 24px 14px; }
  .single-post h1 { font-size: 1.6rem; }
  .card-body { padding: 12px; }
}

/* Very narrow phones: Search collapses to its icon (label stays available to screen readers). */
@media (max-width: 380px) {
  .search-toggle { padding: 0; width: 36px; justify-content: center; }
  .search-toggle-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
  }
}

/* ---------- Ad slots ----------
   Neutral wrappers only — sizing/format is whatever the pasted ad
   unit code renders. The label is screen-reader/visual disclosure
   only and never affects layout. */
.wn-ad-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin: 24px auto;
  max-width: 1200px;
}
.wn-ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.wn-ad-header,
.wn-ad-in-feed,
.wn-ad-footer {
  padding: 0 20px;
}
.wn-ad-in-content { margin: 28px 0; }
.wn-ad-after-content { margin: 32px 0; }
.wn-ad-sidebar { margin: 0 0 24px; }
.wn-ad-slot > *,
.wn-ad-slot ins { max-width: 100%; }

/* ---------- Sponsored post badge ---------- */
.wn-sponsored-badge {
  display: inline-block;
  background: var(--accent-3);
  color: var(--color-text);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.card-thumb .wn-sponsored-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  margin-left: 0;
}

/* ---------- Table of contents ---------- */
.wn-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 28px;
}
.wn-toc-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 10px;
}
.wn-toc ul { list-style: none; margin: 0; padding: 0; }
.wn-toc li { padding: 4px 0; }
.wn-toc-level-3 { padding-left: 18px; font-size: 0.92rem; }
.wn-toc a { color: var(--text); }
.wn-toc a:hover { color: var(--accent); }
