/*
Theme Name: MSTechpages
Theme URI: https://mstechpages.com
Author: MSTechpages
Author URI: https://mstechpages.com
Description: A dark, modern tech news theme for Windows and Microsoft coverage.
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mstechpages
Tags: dark, tech, news, magazine, responsive
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg-primary:    #0a0c10;
  --bg-secondary:  #111318;
  --bg-card:       #13161c;
  --bg-hover:      #1a1e27;
  --border:        #1f2330;
  --accent:        #0078d4;
  --accent-hover:  #1a8fe3;
  --accent-light:  rgba(0,120,212,0.12);
  --text-primary:  #f0f2f5;
  --text-secondary:#9aa3b2;
  --text-muted:    #5a6478;
  --white:         #ffffff;
  --header-height: 64px;
  --font-display:  'Barlow', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --shadow-card:   0 2px 12px rgba(0,0,0,0.4);
  --shadow-hover:  0 8px 32px rgba(0,0,0,0.6);
  --transition:    0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { color: var(--text-secondary); margin-bottom: 1rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-content { flex: 1; padding: 32px 0; }

/* Two-column layout: main + sidebar */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  /* Vista aurora — deep base with soft glowing orbs and right-side streaks */
  background:
    /* top-left teal orb */
    radial-gradient(ellipse 55% 120% at 2% 50%,   rgba(0, 140, 180, 0.18) 0%, transparent 70%),
    /* centre-left blue bloom */
    radial-gradient(ellipse 40% 160% at 22% 80%,  rgba(0, 90, 200, 0.14) 0%, transparent 65%),
    /* mid blue-purple sweep */
    radial-gradient(ellipse 60% 100% at 50% 120%, rgba(30, 60, 160, 0.12) 0%, transparent 70%),
    /* right large aurora bloom */
    radial-gradient(ellipse 55% 180% at 82% 60%,  rgba(0, 120, 220, 0.20) 0%, transparent 65%),
    /* far-right bright teal burst */
    radial-gradient(ellipse 30% 130% at 96% 40%,  rgba(0, 160, 200, 0.22) 0%, transparent 60%),
    /* upper-right diagonal streak */
    radial-gradient(ellipse 25% 60%  at 88% 0%,   rgba(0, 140, 210, 0.16) 0%, transparent 70%),
    /* lower-right sweep */
    radial-gradient(ellipse 40% 80%  at 100% 100%, rgba(10, 80, 180, 0.18) 0%, transparent 65%),
    /* trailing mid streak across right third */
    radial-gradient(ellipse 50% 40%  at 75% 50%,  rgba(0, 100, 190, 0.10) 0%, transparent 70%),
    /* solid dark base */
    rgba(10, 12, 16, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 120, 212, 0.20);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 40px;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-logo img {
  height: 38px;
  width: auto;
}

.site-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}

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

/* Primary Nav */
.primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a {
  display: block;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--white);
  background: var(--accent-light);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
}

.header-btn:hover {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Expanding inline search */
.header-search {
  display: flex;
  align-items: center;
  position: relative;
}

.header-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.header-search-toggle:hover {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* The form slides out to the left of the icon */
.header-search-form {
  display: flex;
  align-items: center;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.header-search.open .header-search-form {
  width: 280px;
  border-color: var(--accent);
  pointer-events: all;
}

/* Nudge the toggle icon to sit at the right end of the expanded bar */
.header-search.open .header-search-toggle {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--white);
}

.header-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0 10px 0 14px;
  height: 34px;
  white-space: nowrap;
  min-width: 0;
}

.header-search-input::placeholder { color: var(--text-muted); }

.header-search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 34px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition);
  padding: 0 8px 0 0;
}

.header-search-close:hover { color: var(--white); }

@media (max-width: 768px) {
  .header-search.open .header-search-form { width: 200px; }
}

/* Mobile hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .primary-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 2px; }
  .primary-nav a { width: 100%; padding: 10px 14px; }
}

/* ============================================================
   BREAKING NEWS TICKER
   ============================================================ */
.breaking-news-bar {
  background: var(--accent);
  padding: 7px 0;
  overflow: hidden;
}

.breaking-news-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breaking-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  background: rgba(0,0,0,0.2);
  padding: 3px 10px;
  border-radius: 2px;
}

.ticker-wrap {
  flex: 1;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 48px;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  opacity: 0.92;
}

.ticker-item a { color: var(--white); }
.ticker-item a:hover { opacity: 0.75; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.section-heading::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-heading .see-all {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-heading .see-all:hover { color: var(--accent-hover); }

/* ============================================================
   FEATURED / HERO POST
   ============================================================ */
.featured-post {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  aspect-ratio: 16/7;
  background: var(--bg-card);
}

.featured-post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured-post:hover img { transform: scale(1.03); }

.featured-post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 32px;
}

.featured-post .post-category {
  margin-bottom: 10px;
}

.featured-post h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--white);
  margin-bottom: 10px;
  max-width: 680px;
}

.featured-post h2 a { color: var(--white); }
.featured-post h2 a:hover { color: var(--accent-hover); }

.featured-post .post-meta { color: rgba(255,255,255,0.6); font-size: 0.8rem; }

/* ============================================================
   POST CARDS — GRID
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.posts-grid-2col { grid-template-columns: repeat(2, 1fr); }
.posts-grid-4col { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .posts-grid, .posts-grid-4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .posts-grid, .posts-grid-2col, .posts-grid-4col { grid-template-columns: 1fr; }
}

/* Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,120,212,0.3);
}

.post-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

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

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

.post-card-body {
  padding: 14px 16px 18px;
}

.post-card-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.post-card-body h3 a { color: inherit; }
.post-card-body h3 a:hover { color: var(--accent-hover); }

.post-card-body .post-excerpt {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post category badge */
.post-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 7px;
}

/* Post meta */
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-meta .sep { opacity: 0.4; }

/* ============================================================
   LIST-STYLE POSTS (sidebar / recent)
   ============================================================ */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-list-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.post-list-item:last-child { border-bottom: none; }

.post-list-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
}

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

.post-list-item:hover .post-list-thumb img { transform: scale(1.08); }

.post-list-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.post-list-info h4 a { color: inherit; }
.post-list-info h4 a:hover { color: var(--accent-hover); }

.post-list-info .post-meta { font-size: 0.72rem; }

/* ============================================================
   CHANNEL BUILDS WIDGET
   ============================================================ */
.builds-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.builds-widget-header {
  background: var(--accent);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.builds-widget-header h3 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
}

.build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.build-row:last-child { border-bottom: none; }
.build-row:hover { background: var(--bg-hover); }

.build-channel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-dot.canary  { background: #f5c542; box-shadow: 0 0 6px rgba(245,197,66,0.5); }
.channel-dot.dev     { background: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,0.5); }
.channel-dot.beta    { background: #2196f3; box-shadow: 0 0 6px rgba(33,150,243,0.5); }
.channel-dot.release { background: #9c27b0; box-shadow: 0 0 6px rgba(156,39,176,0.5); }

.build-channel-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.build-number {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.widget-content { padding: 4px 18px 14px; }

/* Tags cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 18px;
}

.tag-cloud a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.tag-cloud a:hover {
  color: var(--white);
  background: var(--accent-light);
  border-color: var(--accent);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 40px 0;
}

/* WordPress wraps numbers in .nav-links inside the nav */
.pagination .nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.pagination a,
.pagination span,
.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all var(--transition);
}

.pagination a:hover,
.pagination .page-numbers:hover        { color: var(--white); border-color: var(--accent); background: var(--accent-light); }
.pagination .current,
.pagination .page-numbers.current      { color: var(--white); background: var(--accent); border-color: var(--accent); }
.pagination .dots,
.pagination .page-numbers.dots         { border: none; background: none; color: var(--text-muted); width: auto; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-header { margin-bottom: 28px; }

.single-post-header h1 {
  margin: 12px 0 16px;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.single-post-thumb {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16/9;
  background: var(--bg-card);
}

.single-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-content {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-content h2, .post-content h3 { color: var(--white); margin: 2em 0 0.75em; }
.post-content p { margin-bottom: 1.25rem; }
.post-content a { color: var(--accent); border-bottom: 1px solid var(--accent-light); }
.post-content a:hover { color: var(--accent-hover); border-color: var(--accent); }

.post-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.post-content ul, .post-content ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  font-style: italic;
}

.post-content pre, .post-content code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.post-content pre { padding: 16px; overflow-x: auto; margin-bottom: 1.25rem; }
.post-content code { padding: 2px 6px; }
.post-content pre code { background: none; border: none; padding: 0; }

/* Post tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-tags a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.post-tags a:hover { color: var(--white); background: var(--accent-light); border-color: var(--accent); }

/* Author box */
.author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 32px;
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-name {
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.author-bio { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 48px 0 40px;
}

@media (max-width: 900px) {
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-widgets { grid-template-columns: 1fr; }
}

.footer-about .logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  display: block;
}
.footer-about .logo-text span { color: var(--accent); }
.footer-about p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--accent-hover); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.78rem; color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--accent-hover); }

/* Social icons */
.social-links { display: flex; gap: 8px; margin-top: 16px; }
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all var(--transition);
}
.social-links a:hover {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ============================================================
   DARK MODE TOGGLE
   ============================================================ */
body.light-mode {
  --bg-primary:    #f4f5f7;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-hover:      #f0f2f5;
  --border:        #dde1e9;
  --text-primary:  #0f1117;
  --text-secondary:#3d4557;
  --text-muted:    #8a94a8;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-gap { margin-bottom: 48px; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   NEWS CARD  (thumbnail + overlay category badge + title only)
   ============================================================ */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,120,212,0.35);
}

.news-card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

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

.news-card:hover .news-card-thumb img {
  transform: scale(1.06);
}

/* Category badge overlaid on top-left of image */
.news-card-thumb .post-category {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  background: rgba(0, 100, 180, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.07em;
  z-index: 2;
  pointer-events: none;
}

.news-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.news-card-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.news-card-body h3 a {
  color: inherit;
}

.news-card-body h3 a:hover {
  color: var(--accent-hover);
}

/* Date + author meta row */
.news-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.news-card-meta time,
.news-card-meta .news-card-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.news-card-meta i {
  font-size: 0.65rem;
  color: var(--accent);
  flex-shrink: 0;
}

.news-card-meta .news-card-author:hover { color: var(--accent-hover); }
.news-card-sep { opacity: 0.4; }

/* ============================================================
   KB SIDEBAR WIDGET
   ============================================================ */
.kb-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kb-widget .widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fff;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--accent);
}

.kb-widget .widget-title i {
  color: #fff;
  font-size: 0.78rem;
}

.kb-article-list { padding: 4px 0; }

.kb-article-item {
  border-bottom: 1px solid var(--border);
}

.kb-article-item:last-child { border-bottom: none; }

.kb-article-item a {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 16px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
  transition: all var(--transition);
}

.kb-article-item a:hover {
  color: var(--accent-hover);
  background: var(--bg-hover);
}

.kb-article-icon {
  color: var(--accent);
  font-size: 0.68rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Logo size */
.site-logo img {
  height: 46px;
  width: auto;
}

/* ============================================================
   HERO DUO  (latest news + latest KB, side by side)
   ============================================================ */
.hero-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 700px) {
  .hero-duo { grid-template-columns: 1fr; }
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.hero-card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

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

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

.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero-card-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hero-card-body h2 {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
}

.hero-card-body h2 a { color: inherit; }
.hero-card-body h2 a:hover { color: var(--accent-hover); }

/* Subtle left accent line per type */
.hero-card--news  { border-top: 3px solid var(--accent); }
.hero-card--kb    { border-top: 3px solid #4caf50; }

/* ============================================================
   KNOWLEDGE BASE PAGE
   ============================================================ */

.kb-page { padding: 36px 0 72px; }

/* Header */
.kb-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px; margin-bottom: 32px;
  padding-bottom: 28px; border-bottom: 1px solid var(--border);
}
.kb-header-left { display: flex; align-items: center; gap: 16px; }
.kb-header-icon-wrap {
  width: 52px; height: 52px; display: flex; align-items: center;
  justify-content: center; background: var(--accent-light);
  border: 1px solid rgba(0,120,212,0.3); border-radius: var(--radius-md);
  font-size: 1.4rem; color: var(--accent); flex-shrink: 0;
}
.kb-page-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 900;
  color: var(--text-primary); margin: 0 0 5px; letter-spacing: -0.03em;
  font-family: var(--font-display);
}
.kb-page-sub { font-size: 0.84rem; color: var(--text-muted); margin: 0; }

/* Search */
.kb-search-container { position: relative; width: 360px; flex-shrink: 0; }
@media (max-width: 700px) {
  .kb-header { flex-direction: column; align-items: flex-start; }
  .kb-search-container { width: 100%; }
}
.kb-search-box {
  display: flex; align-items: center; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kb-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 4px 16px rgba(0,0,0,0.2);
}
.kb-search-box > .fa-magnifying-glass {
  padding: 0 10px 0 14px; color: var(--accent); font-size: 0.85rem; flex-shrink: 0;
}
.kb-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.875rem; padding: 12px 6px; min-width: 0;
}
.kb-search-input::placeholder { color: var(--text-muted); }
.kb-search-clear {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0 8px; font-size: 0.8rem; transition: color 0.15s;
}
.kb-search-clear:hover { color: var(--text-primary); }
.kb-search-divider { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.kb-search-submit {
  background: var(--accent); border: none; color: #fff;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  padding: 12px 18px; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.kb-search-submit:hover { background: var(--accent-hover); }

/* Live results */
.kb-live-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 200; overflow: hidden; max-height: 420px; overflow-y: auto;
}
.kb-sr-label {
  padding: 10px 14px 8px; font-size: 0.72rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.kb-sr-label strong { color: var(--text-secondary); }
.kb-sr-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  color: var(--text-primary); border-bottom: 1px solid var(--border);
  transition: background 0.15s; font-size: 0.85rem;
}
.kb-sr-row:hover { background: var(--bg-hover); }
.kb-sr-row > .fa-file-lines { color: var(--accent); font-size: 0.8rem; flex-shrink: 0; }
.kb-sr-row > .fa-chevron-right { font-size: 0.65rem; color: var(--text-muted); margin-left: auto; flex-shrink: 0; transition: transform 0.15s, color 0.15s; }
.kb-sr-row:hover > .fa-chevron-right { transform: translateX(2px); color: var(--accent); }
.kb-sr-row-body { flex: 1; min-width: 0; }
.kb-sr-row-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-sr-row-date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; display: block; }
.kb-sr-loading, .kb-sr-empty { padding: 18px 14px; font-size: 0.83rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.kb-sr-all {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 14px; font-size: 0.78rem; font-weight: 700; color: var(--accent);
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  font-family: var(--font-display); transition: background 0.15s;
}
.kb-sr-all:hover { background: var(--accent-light); }

/* Category Nav */
.kb-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-bottom: 20px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.kb-nav-pill {
  display: inline-flex; align-items: center; border-radius: 8px;
  text-decoration: none; transition: all 0.18s; color: var(--text-secondary);
}
.kb-nav-pill-inner {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.kb-nav-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.kb-nav-pill.is-active { background: var(--pill-color, var(--accent)); color: #fff; box-shadow: 0 2px 10px var(--pill-glow, rgba(0,120,212,0.3)); }
.kb-nav-pill-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kb-nav-pill-icon svg { width: 20px; height: 20px; border-radius: 5px; }
.kb-nav-sep { color: var(--border); font-size: 0.6rem; display: flex; align-items: center; padding: 0 1px; pointer-events: none; }
@media (max-width: 860px) { .kb-nav { gap: 5px; } .kb-nav-sep { display: none; } }

/* Tag filter bar */
.kb-filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; margin-bottom: 24px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-left: 3px solid var(--filter-color, var(--accent));
  border-radius: var(--radius-md);
}
.kb-filter-label {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: flex; align-items: center; gap: 5px; flex-shrink: 0; margin-right: 4px;
}
.kb-filter-label i { color: var(--filter-color, var(--accent)); }
.kb-filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-filter-tag {
  display: inline-flex; align-items: center; padding: 4px 12px;
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; transition: all 0.18s; font-family: var(--font-display);
}
.kb-filter-tag:hover { border-color: var(--filter-color, var(--accent)); color: var(--white); background: var(--bg-hover); }
.kb-filter-tag.is-active { background: var(--filter-color, var(--accent)); border-color: var(--filter-color, var(--accent)); color: #fff; }

/* Cards grid */
.kb-cards-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}
@media (max-width: 800px) { .kb-cards-grid { grid-template-columns: 1fr; } }
.kb-cards-grid:has(.kb-card:only-child) { grid-template-columns: 1fr; max-width: 680px; }

/* Card */
.kb-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; display: flex;
  flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; position: relative;
}
.kb-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px var(--c, var(--accent)) inset; }
.kb-card-stripe { height: 3px; background: var(--c, var(--accent)); flex-shrink: 0; }

.kb-card-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--g, rgba(0,120,212,0.07)) 0%, transparent 60%);
}
.kb-card-head-logo {
  width: 60px; height: 60px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; background: var(--g, rgba(0,120,212,0.08));
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: box-shadow 0.2s;
}
.kb-card:hover .kb-card-head-logo { box-shadow: 0 0 0 2px var(--c, var(--accent)); }
.kb-card-logo-svg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.kb-card-logo-svg svg { width: 44px; height: 44px; border-radius: 10px; }
.kb-card-head-info { flex: 1; min-width: 0; }
.kb-card-title {
  font-size: 1rem; font-weight: 800; color: var(--text-primary);
  margin: 0 0 7px; letter-spacing: -0.015em; font-family: var(--font-display);
}
.kb-card-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-card-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
}
.kb-card-badge i { color: var(--c, var(--accent)); font-size: 0.65rem; }
.kb-card-badge--filter { border-color: var(--c, var(--accent)); color: var(--c, var(--accent)); background: var(--g, var(--accent-light)); }
.kb-card-viewall-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem;
  font-weight: 700; color: var(--c, var(--accent)); white-space: nowrap; flex-shrink: 0;
  font-family: var(--font-display); transition: gap 0.15s;
}
.kb-card-viewall-link:hover { gap: 8px; }

/* Article list */
.kb-card-articles { list-style: none; padding: 0; margin: 0; flex: 1; }
.kb-card-article { border-bottom: 1px solid var(--border); }
.kb-card-article:last-child { border-bottom: none; }
.kb-card-article > a {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  color: var(--text-primary); text-decoration: none; transition: background 0.15s;
}
.kb-card-article > a:hover { background: var(--bg-hover); }
.kb-card-article-pip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent));
  flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s, transform 0.15s;
}
.kb-card-article > a:hover .kb-card-article-pip { opacity: 1; transform: scale(1.3); }
.kb-card-article-content { flex: 1; min-width: 0; }
.kb-card-article-name {
  display: block; font-size: 0.86rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.35; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-card-article > a:hover .kb-card-article-name { color: var(--c, var(--accent)); }
.kb-card-article-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-card-article-date { font-size: 0.69rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kb-card-article-date i { font-size: 0.62rem; }
.kb-card-article-taglist { display: flex; gap: 4px; flex-wrap: wrap; }
.kb-card-article-tag {
  display: inline-block; padding: 1px 6px; font-size: 0.63rem; font-weight: 600;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 3px; color: var(--text-muted);
}
.kb-card-article-chev { font-size: 0.62rem; color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s, color 0.15s; }
.kb-card-article > a:hover .kb-card-article-chev { transform: translateX(3px); color: var(--c, var(--accent)); }

/* Card footer */
.kb-card-foot { padding: 11px 16px; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.kb-card-foot-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: 0.77rem; font-weight: 700;
  color: var(--c, var(--accent)); transition: gap 0.15s;
}
.kb-card-foot-btn:hover { gap: 10px; }

/* Light mode */
body.light-mode .kb-card { box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
body.light-mode .kb-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.12), 0 0 0 1px var(--c, var(--accent)) inset; }
body.light-mode .kb-search-box { background: #fff; }

/* ============================================================
   LARGE CARD GRID — 2-col, used on Reviews / Articles pages
   Reuses .news-card but in a 2-col grid with taller image
   ============================================================ */
.large-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 40px;
}

@media (max-width: 700px) {
  .large-card-grid { grid-template-columns: 1fr; }
}

/* Shorter image in large grid */
.large-card-grid .news-card-thumb {
  aspect-ratio: 16/7;
  min-height: 160px;
  max-height: 200px;
}

/* Slightly larger title in large grid */
.large-card-grid .news-card-body h3 {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.3;
}

/* Slightly more padding */
.large-card-grid .news-card-body {
  padding: 16px 18px 18px;
  gap: 10px;
}

/* Larger border radius to match the screenshot style */
.large-card-grid .news-card {
  border-radius: var(--radius-lg);
  border-width: 1px;
}

/* Stronger hover glow */
.large-card-grid .news-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: var(--accent);
}

/* In large card grid, allow titles to wrap fully (no truncation) */
.large-card-grid .news-card-body h3 {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* ============================================================
   AMAZON AFFILIATE BLOCK
   ============================================================ */
.mstp-affiliate-block {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}

.mstp-affiliate-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: #ff9900;
  padding: 10px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
}

.mstp-affiliate-header i {
  font-size: 1rem;
}

.mstp-affiliate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}

.mstp-affiliate-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0;
  background: var(--bg-card);
  text-decoration: none;
  transition: background 0.15s;
  overflow: hidden;
}

.mstp-affiliate-item:hover {
  background: var(--bg-secondary);
}

.mstp-affiliate-item:hover .mstp-affiliate-item-cta {
  color: #ffb347;
}

/* Thumbnail area — icon placeholder or real photo */
.mstp-affiliate-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ic, #0078d4) 12%, var(--bg-secondary));
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.mstp-affiliate-item:hover .mstp-affiliate-thumb {
  background: color-mix(in srgb, var(--ic, #0078d4) 20%, var(--bg-secondary));
}

.mstp-affiliate-thumb i {
  font-size: 2rem;
  color: var(--ic, #0078d4);
  opacity: 0.85;
}

/* Real photo (PA API) */
.mstp-affiliate-thumb--photo {
  background: var(--bg-secondary);
}

.mstp-affiliate-thumb--photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

/* Text area below thumb */
.mstp-affiliate-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  padding: 10px 12px 6px;
  flex: 1;
}

.mstp-affiliate-item-cta {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9900;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px 10px;
  transition: color 0.15s;
}

.mstp-affiliate-item-cta i {
  font-size: 0.55rem;
}

.mstp-affiliate-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ff9900;
  padding: 0 12px 4px;
}

.mstp-affiliate-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.mstp-affiliate-disclaimer i {
  color: var(--accent);
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

@media (max-width: 700px) {
  .mstp-affiliate-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page-wrap {
  max-width: 740px;
}

.contact-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 8px 0 32px;
  line-height: 1.6;
}

/* Alerts */
.contact-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 28px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.contact-alert i { margin-top: 2px; flex-shrink: 0; }
.contact-alert ul { margin: 0; padding: 0 0 0 16px; }
.contact-alert--success {
  background: rgba(16, 124, 16, 0.15);
  border: 1px solid rgba(16, 124, 16, 0.4);
  color: #6fcf6f;
}
.contact-alert--error {
  background: rgba(210, 50, 50, 0.12);
  border: 1px solid rgba(210, 50, 50, 0.35);
  color: #f08080;
}

/* Form layout */
.contact-form { display: flex; flex-direction: column; gap: 20px; }

.contact-form-row--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact-form-group label span { color: var(--accent); }

.contact-form-group input,
.contact-form-group select,
.contact-form-group textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.contact-form-group textarea { resize: vertical; min-height: 140px; }

.contact-form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.contact-form-group input:focus,
.contact-form-group select:focus,
.contact-form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.18);
}

.contact-char-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Submit button */
.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  transition: background 0.2s, transform 0.15s;
}
.contact-submit-btn:hover {
  background: #106ebe;
  transform: translateY(-1px);
}
.contact-submit-btn:active { transform: translateY(0); }

/* Honeypot — completely hidden from humans */
.mstp-hp-wrap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Alt contact section */
.contact-alt-info {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.contact-alt-info h2 {
  font-size: 1.15rem;
  margin: 0 0 20px;
  color: var(--text-primary);
}
.contact-alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-alt-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.contact-alt-item > i {
  font-size: 1.4rem;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}
.contact-alt-item strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.contact-alt-item a, .contact-alt-item span { font-size: 0.85rem; color: var(--text-secondary); }
.contact-alt-item a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 600px) {
  .contact-form-row--half { grid-template-columns: 1fr; }
}

/* ============================================================
   HOMEPAGE — FEATURED KNOWLEDGE BASE SECTION
   ============================================================ */

/* Full-bleed panel with subtle distinction from the news above */
.kb-featured-section {
  margin: 0 -20px 48px;
  padding: 48px 20px 52px;
  background:
    linear-gradient(180deg, rgba(0,120,212,0.06) 0%, transparent 100%),
    var(--bg-secondary);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
}

.kb-featured-inner {
  max-width: var(--content-max-width, 1200px);
  margin: 0 auto;
}

/* Header row: icon + title/desc on left, "Browse all" link on right */
.kb-featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.kb-featured-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kb-featured-title > i {
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0,120,212,0.4));
}

.kb-featured-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.2;
}

.kb-featured-title p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.kb-featured-viewall {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: gap 0.2s;
}
.kb-featured-viewall:hover { gap: 11px; color: var(--accent-hover); }
.kb-featured-viewall i { font-size: 0.75rem; }

/* 3-col grid, slightly tighter gap than news */
.posts-grid--kb {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Footer CTA button */
.kb-featured-footer {
  margin-top: 32px;
  text-align: center;
}

.kb-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 13px 32px;
  border-radius: 6px;
  transition: background 0.2s, transform 0.15s, gap 0.2s;
}
.kb-featured-cta:hover {
  background: #106ebe;
  transform: translateY(-2px);
  gap: 14px;
  color: #fff;
}
.kb-featured-cta i:first-child { font-size: 0.9rem; }
.kb-featured-cta i:last-child  { font-size: 0.78rem; }

/* Responsive */
@media (max-width: 900px) {
  .posts-grid--kb { grid-template-columns: repeat(2, 1fr); }
  .kb-featured-title h2 { font-size: 1.25rem; }
}
@media (max-width: 600px) {
  .kb-featured-section { margin: 0 -16px 36px; padding: 36px 16px 40px; }
  .posts-grid--kb { grid-template-columns: 1fr; }
  .kb-featured-viewall { display: none; } /* shown via footer CTA instead */
}

/* ============================================================
   GUTENBERG BLOCK SUPPORT
   Styles for core blocks used in pages/posts.
   ============================================================ */

/* ── Media & Text block ─────────────────────────────────────── */
.wp-block-media-text {
  display: grid;
  grid-template-columns: 50% 1fr;
  grid-template-rows: auto;
  align-items: center;
  gap: 32px;
  margin-bottom: 2rem;
}
.wp-block-media-text.has-media-on-the-right {
  grid-template-columns: 1fr 50%;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
  grid-column: 2;
  grid-row: 1;
}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
  grid-column: 1;
  grid-row: 1;
}
.wp-block-media-text__media img,
.wp-block-media-text__media figure {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.wp-block-media-text__content {
  padding: 0 8px;
}
.wp-block-media-text.is-stacked-on-mobile
  @media (max-width: 600px) {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .wp-block-media-text {
    grid-template-columns: 1fr !important;
  }
  .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media,
  .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ── Columns block ──────────────────────────────────────────── */
.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 2rem;
  align-items: flex-start;
}
.wp-block-column {
  flex: 1 1 0%;
  min-width: 0;
}
@media (max-width: 700px) {
  .wp-block-columns {
    flex-direction: column;
  }
  .wp-block-column {
    width: 100% !important;
    flex-basis: 100% !important;
  }
}

/* ── Image block ────────────────────────────────────────────── */
.wp-block-image {
  margin-bottom: 1.5rem;
}
.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}
.wp-block-image.aligncenter,
.wp-block-image.aligncenter img { margin-left: auto; margin-right: auto; }
.wp-block-image.alignleft  { float: left;  margin: 0 24px 16px 0; }
.wp-block-image.alignright { float: right; margin: 0 0 16px 24px; }
.wp-block-image figcaption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
}

/* ── Group / Cover / Row / Stack ────────────────────────────── */
.wp-block-group {
  margin-bottom: 1.5rem;
}
.wp-block-group.is-layout-flex,
.wp-block-group.is-style-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.wp-block-cover {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.wp-block-cover__inner-container {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  padding: 24px;
}

/* ── Buttons block ──────────────────────────────────────────── */
.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.wp-block-button__link {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}
.wp-block-button__link:hover {
  background: #106ebe;
  transform: translateY(-1px);
  color: #fff !important;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent) !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--accent);
  color: #fff !important;
}

/* ── Quote / Pullquote ──────────────────────────────────────── */
.wp-block-quote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 0 0 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0 6px 6px 0;
}
.wp-block-quote p { margin: 0; font-style: italic; }
.wp-block-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: normal;
}
.wp-block-pullquote {
  border-top: 4px solid var(--accent);
  border-bottom: 4px solid var(--accent);
  padding: 24px;
  text-align: center;
  margin-bottom: 1.5rem;
}
.wp-block-pullquote blockquote p {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  font-style: italic;
}

/* ── Table block ────────────────────────────────────────────── */
.wp-block-table {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.wp-block-table th,
.wp-block-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.wp-block-table th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-primary);
}
.wp-block-table.is-style-stripes tr:nth-child(odd) td {
  background: rgba(255,255,255,0.03);
}

/* ── Separator ──────────────────────────────────────────────── */
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.wp-block-separator.is-style-wide { width: 100%; }
.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
  color: var(--text-secondary);
}
.wp-block-separator.is-style-dots::before {
  content: '· · ·';
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

/* ── Code block ─────────────────────────────────────────────── */
.wp-block-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.875rem;
}

/* ── alignwide / alignfull ──────────────────────────────────── */
.post-content .alignwide {
  margin-left:  -40px;
  margin-right: -40px;
  max-width: calc(100% + 80px);
  width: calc(100% + 80px);
}
.post-content .alignfull {
  margin-left:  calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}
@media (max-width: 700px) {
  .post-content .alignwide,
  .post-content .alignfull {
    margin-left: -16px;
    margin-right: -16px;
    max-width: calc(100% + 32px);
    width: calc(100% + 32px);
  }
}

/* ── Clearfix for floated images ────────────────────────────── */
.post-content::after,
.wp-block-group::after {
  content: '';
  display: table;
  clear: both;
}
