/* ========================================================
   Signal and Drift - Tech Magazine Stylesheet (v2.0)
   Designed for Web & Mobile (360px+) with Presentation Typography
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800;900&display=swap');

:root {
  /* Colors inspired by Meta Newsroom */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-placeholder: #F0F2F5;
  --text-title: #1C2B33;
  --text-body: #344854;
  --text-muted: #657786;
  --border-light: #E4E7E9;
  --border-dark: #CCD0D5;
  
  /* Brand Accents */
  --accent-tech: #0064E0;      /* Tech & Agents */
  --accent-markets: #00875A;   /* Capital & Markets */
  --accent-culture: #6554C0;   /* Humanities & Culture */
  --accent-dark: #0B192C;

  /* Presentation Fonts */
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Container width */
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Image Reset — Prevents any image from overflowing its parent */
img {
  width: 100%;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background-color: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover {
  opacity: 0.88;
}

/* ========================================================
   Media & High-Resolution Editorial Images
   ======================================================== */
.media-frame {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1C2B33 0%, #0F172A 100%);
  border: 1px solid var(--border-light);
  display: block;
}

/* 1. Hero Image Specification */
.media-frame.aspect-hero {
  aspect-ratio: 16 / 10;
  max-height: 480px;
  border-radius: 12px;
}

.media-frame.aspect-hero img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2. Featured Field Notes Compact Thumbnail (height: 180px) */
.media-frame.thumb-featured {
  aspect-ratio: 16 / 9;
  height: 180px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.media-frame.thumb-featured img {
  width: 100%;
  height: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 3. All Published Dispatches 3-Col Thumbnail (height: 200px) */
.media-frame.thumb-dispatch,
.media-frame.aspect-16-9 {
  aspect-ratio: 16 / 9;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.media-frame.thumb-dispatch img,
.media-frame.aspect-16-9 img {
  width: 100%;
  height: 200px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Article Detail Hero Image */
.article-hero-container .media-frame.aspect-16-9,
.policy-container .media-frame.aspect-16-9 {
  height: auto;
  max-height: 460px;
  border-radius: 12px;
}

.article-hero-container .media-frame.aspect-16-9 img,
.policy-container .media-frame.aspect-16-9 img {
  height: 100%;
  max-height: 460px;
  border-radius: 12px;
}

.grid-card:hover .media-frame img,
.hero-story-card:hover .media-frame img {
  transform: scale(1.03);
}

.media-badge-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ========================================================
   Header & Navigation
   ======================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-title);
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 800;
  background-color: var(--text-title);
  color: #FFF;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 24px;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-title);
  position: relative;
  padding: 8px 0;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent-tech);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-tech);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-subscribe {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  background-color: var(--text-title);
  color: #FFF;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.btn-subscribe:hover {
  background-color: var(--accent-tech);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-title);
}

/* Expandable Header Search (Circular Button -> Rectangular Box) */
.nav-search-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: -6px;
}

.header-search-box {
  display: flex;
  align-items: center;
  width: 36px;
  height: 36px;
  background-color: #E6E9EF;
  border: 1.5px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  transition: width 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.22s ease,
              background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  cursor: pointer;
}

.header-search-box:hover:not(.is-open) {
  background-color: #DCE0E8;
  transform: scale(1.04);
}

.header-search-box.is-open {
  width: 248px;
  border-radius: 7px;
  background-color: #FFFFFF;
  border-color: var(--text-title);
  box-shadow: 0 4px 16px rgba(28, 43, 51, 0.08);
  cursor: text;
}

.header-search-trigger {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: #111827;
  cursor: pointer;
  flex-shrink: 0;
}

.header-search-input {
  width: 0;
  opacity: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-title);
  padding: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, width 0.22s ease;
}

.header-search-box.is-open .header-search-input {
  width: 100%;
  opacity: 1;
  padding: 0 4px 0 2px;
  pointer-events: auto;
}

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

/* Hide browser native search cancel X */
.header-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.header-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 5px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.header-search-box.is-open .header-search-clear {
  display: inline-flex;
}

.header-search-clear:hover {
  background-color: var(--bg-placeholder);
  color: var(--text-title);
}

.header-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 410px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  z-index: 250;
  display: none;
  padding: 8px;
}

.header-search-dropdown.is-visible {
  display: block;
}

.search-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}

.search-result-item {
  display: block;
  padding: 10px 10px;
  border-radius: 7px;
  transition: background-color 0.15s ease;
  text-decoration: none;
}

.search-result-item:hover {
  background-color: var(--bg-secondary);
  opacity: 1;
}

.search-result-cat {
  font-family: var(--font-heading);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 3px;
}

.search-result-cat.tech { color: var(--accent-tech); }
.search-result-cat.markets { color: var(--accent-markets); }
.search-result-cat.culture { color: var(--accent-culture); }

.search-result-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.34;
  color: var(--text-title);
  margin-bottom: 4px;
}

.search-result-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.search-empty-msg {
  padding: 18px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================================
   Main Container & Section Headers
   ======================================================== */
.main-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.section-header {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-title);
}

/* Category Pill Badges */
.category-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.category-tag.tech { color: var(--accent-tech); }
.category-tag.markets { color: var(--accent-markets); }
.category-tag.culture { color: var(--accent-culture); }

/* ========================================================
   1. Hero Section: Side-by-Side 5.5 : 4.5 Magazine Layout
   ======================================================== */
.hero-story-card {
  display: grid;
  grid-template-columns: 5.5fr 4.5fr;
  gap: 36px;
  align-items: center;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
}

.hero-story-card .story-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.26;
  color: var(--text-title);
  margin-bottom: 14px;
  letter-spacing: -0.4px;
}

.hero-excerpt {
  font-size: 0.98rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 18px;
}

.story-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================================
   2. Most Viewed (1-5 Ranking): 5-Column Compact Card Grid
   ======================================================== */
.featured-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 44px;
}

.most-viewed-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 44px;
}

.most-viewed-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 11px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.most-viewed-card:hover {
  box-shadow: 0 8px 22px rgba(28, 43, 51, 0.08);
  transform: translateY(-2px);
  border-color: var(--border-dark);
}

.most-viewed-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-frame.thumb-most-viewed {
  aspect-ratio: 16 / 10;
  height: 108px;
  border-radius: 7px;
  margin-bottom: 10px;
  position: relative;
}

.media-frame.thumb-most-viewed img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: 7px;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.most-viewed-card:hover .media-frame.thumb-most-viewed img {
  transform: scale(1.04);
}

.rank-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  background: rgba(11, 25, 44, 0.88);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.rank-badge.rank-top {
  background: linear-gradient(135deg, #0064E0 0%, #6554C0 100%);
  border-color: rgba(255, 255, 255, 0.32);
}

.most-viewed-card .category-tag {
  font-size: 0.62rem;
  margin-bottom: 4px;
  letter-spacing: 0.6px;
}

.most-viewed-title {
  font-family: var(--font-heading);
  font-size: 0.87rem;
  font-weight: 800;
  line-height: 1.34;
  color: var(--text-title);
  margin-bottom: 10px;
  letter-spacing: -0.15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.most-viewed-meta {
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.view-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-body);
  font-weight: 700;
}

.view-count-pill svg {
  width: 13px;
  height: 13px;
  opacity: 0.78;
}

/* ========================================================
   3. All Published Dispatches: 3-Column Magazine Grid
   ======================================================== */
.dispatches-three-col,
.grid-three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 44px;
}

.grid-two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 44px;
}

.grid-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.grid-card:hover {
  box-shadow: 0 8px 24px rgba(28, 43, 51, 0.07);
  transform: translateY(-2px);
}

.grid-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-title);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.grid-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================================
   Subnav & Category Filter Bar
   ======================================================== */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  background-color: var(--bg-secondary);
  color: var(--text-title);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active,
.filter-chip:hover {
  background-color: var(--text-title);
  color: #FFF;
  border-color: var(--text-title);
}

/* ========================================================
   Newsletter & Ad Inserter Section
   ======================================================== */
.newsletter-banner {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px 28px;
  margin: 48px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}

.newsletter-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 8px;
}

.newsletter-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  outline: none;
}

.newsletter-input:focus {
  border-color: var(--accent-tech);
}

.newsletter-submit {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  background-color: var(--accent-tech);
  color: #FFF;
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

/* Hidden until a live <ins class="adsbygoogle"> unit is injected */
.ad-banner-box {
  display: none;
  width: 100%;
  margin: 32px 0;
  text-align: center;
}

.ad-banner-box:has(ins.adsbygoogle) {
  display: block;
}

/* ========================================================
   Article Detail Page Styles
   ======================================================== */
.article-header {
  max-width: 840px;
  margin: 0 auto 32px;
  text-align: left;
}

.article-header .category-tag {
  font-size: 0.8rem;
}

.article-header-title {
  font-family: var(--font-heading);
  font-size: 2.45rem;
  font-weight: 900;
  line-height: 1.22;
  color: var(--text-title);
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.article-header-excerpt {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-body);
  margin-bottom: 20px;
  font-weight: 500;
}

.article-hero-container {
  max-width: 920px;
  margin: 0 auto 40px;
}

.article-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.78;
  color: #2D3748;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 48px 0 16px;
  letter-spacing: -0.3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 32px 0 12px;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 22px 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  border-left: 4px solid var(--accent-tech);
  background-color: var(--bg-secondary);
  padding: 18px 22px;
  margin: 26px 0;
  border-radius: 0 8px 8px 0;
  font-weight: 500;
  color: var(--text-title);
}

.article-body pre {
  background-color: #0F172A;
  color: #E2E8F0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 0.88rem;
  margin: 24px 0;
  line-height: 1.55;
  border: 1px solid #1E293B;
}

.article-body code {
  background-color: #EDF2F7;
  color: #C53030;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
}

.article-body pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.92rem;
}

.article-body th, 
.article-body td {
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background-color: var(--bg-secondary);
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-title);
}

/* Technical Diagram Box */
.diagram-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 24px 18px;
  margin: 32px 0;
  text-align: center;
  overflow-x: auto;
}

.diagram-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Author Box */
.author-bio-card {
  max-width: 800px;
  margin: 44px auto 0;
  padding: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.author-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-tech), var(--accent-culture));
  color: #FFF;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ========================================================
   Article Comments Section (Option B — Clean Editorial Style)
   ======================================================== */
.comments-section {
  max-width: 800px;
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.comments-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.01em;
  margin: 0;
}

.comments-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.comment-form {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 28px;
}

.comment-form-row {
  margin-bottom: 12px;
}

.comment-input,
.comment-textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-body);
  background-color: #FFFFFF;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-input {
  max-width: 320px;
}

.comment-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.comment-input:focus,
.comment-textarea:focus {
  border-color: var(--accent-tech);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.08);
}

/* Layer 1 Honeypot field — completely invisible to human readers */
.comment-hp-wrap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-submit-btn {
  padding: 10px 20px;
  background-color: var(--text-title);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.comment-submit-btn:hover {
  opacity: 0.9;
}

.comment-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.comment-feedback {
  font-size: 0.85rem;
  font-weight: 600;
}

.comment-feedback.error {
  color: #DC2626;
}

.comment-feedback.success {
  color: #0D9488;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item {
  padding: 16px 18px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.comment-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-author-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-dark);
  color: var(--text-title);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-author-badge.is-author {
  background: linear-gradient(135deg, var(--accent-tech), var(--accent-culture));
  border-color: transparent;
  color: #FFFFFF;
}

.comment-author-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-title);
}

.comment-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.comment-role-badge.author {
  background-color: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.comment-role-badge.you {
  background-color: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.comment-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.comment-edited-tag {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
}

.comment-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-action-btn {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: color 0.15s ease;
}

.comment-action-btn:hover {
  color: var(--text-title);
  text-decoration: underline;
}

.comment-action-btn.delete {
  color: #DC2626;
  opacity: 0.8;
}

.comment-action-btn.delete:hover {
  color: #B91C1C;
  opacity: 1;
}

.comment-reply-target {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-tech);
  margin-right: 6px;
}

.comment-body-text {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.comment-children {
  margin-top: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-children.deep-level {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.comment-inline-box {
  margin-top: 12px;
  padding: 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.comment-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.comment-btn-secondary {
  padding: 7px 14px;
  background-color: #FFFFFF;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  cursor: pointer;
}

.comment-btn-primary {
  padding: 7px 16px;
  background-color: var(--text-title);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.comment-empty-state {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 6px 2px;
}

/* ========================================================
   Policy & Contact Forms
   ======================================================== */
.policy-container {
  max-width: 820px;
  margin: 24px auto 64px;
}

.contact-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
  margin-top: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  background-color: #FFF;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-tech);
}

/* ========================================================
   Footer (Meta Newsroom Clean Aesthetic)
   ======================================================== */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 56px 24px 32px;
  margin-top: 56px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-title);
  margin-bottom: 10px;
}

.footer-brand-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-title);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-link:hover {
  color: var(--text-title);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================
   Responsive Breakpoints (Tablet & 360px Mobile)
   ======================================================== */
@media (max-width: 1080px) {
  .most-viewed-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-story-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .dispatches-three-col,
  .grid-three-col,
  .grid-two-col {
    grid-template-columns: repeat(2, 1fr);
  }
  .newsletter-banner {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links, .btn-subscribe {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .nav-search-item {
    margin-left: 0;
    margin-top: 6px;
  }
  .header-search-box.is-open {
    width: 100%;
  }
  .header-search-dropdown {
    left: 0;
    right: 0;
    width: 100%;
  }
  .most-viewed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .featured-notes-grid,
  .dispatches-three-col,
  .grid-three-col,
  .grid-two-col {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-title {
    font-size: 1.55rem;
    line-height: 1.3;
  }
  .article-header-title {
    font-size: 1.75rem;
  }
  .article-header-excerpt {
    font-size: 1rem;
  }
  .article-body {
    font-size: 0.98rem;
  }
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .diagram-box svg {
    min-width: 600px;
  }
  .article-body pre {
    font-size: 0.8rem;
    padding: 14px;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-submit {
    width: 100%;
  }
  .author-bio-card {
    flex-direction: column;
    text-align: center;
  }
  .comment-input {
    max-width: 100%;
  }
  .comment-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .comment-submit-btn {
    width: 100%;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}
