/* ── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:         #1a1a2e;
  --navy-light:   #252545;
  --accent:       #1a73e8;
  --accent-dark:  #1557b0;
  --accent-light: #e8f0fe;
  --text:         #1f2937;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #ffffff;
  --bg-gray:      #f9fafb;
  --card-shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --card-hover:   0 4px 12px rgba(0,0,0,.12);
  --radius:       6px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
  display: none; /* hidden on mobile */
}
@media (min-width: 768px) { .top-bar { display: block; } }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.top-bar a { color: #fff; opacity: .85; }
.top-bar a:hover { opacity: 1; }

/* ── Header / Nav ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 60px;
}
.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.site-logo .logo-health  { color: #fff; }
.site-logo .logo-cyber   {
  color: var(--accent);
  font-style: italic;
  margin: 0 1px;
}
.site-logo .logo-insights {
  color: rgba(255,255,255,.65);
  font-weight: 500;
  font-size: .72em;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-left: 5px;
  align-self: center;
}
.site-logo:hover { color: #fff; opacity: .9; }

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .2s;
}

/* Nav links */
.site-nav {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--navy-light);
  padding: 8px 0;
  z-index: 99;
}
.site-nav.open { display: block; }
.site-nav a {
  display: block;
  color: #e2e8f0;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-nav a:hover, .site-nav a.active { color: #fff; background: rgba(255,255,255,.05); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex !important;
    position: static;
    background: none;
    padding: 0;
    gap: 4px;
    align-items: center;
  }
  .site-nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius);
    border-bottom: none;
    font-size: 14px;
  }
  .site-nav a:hover { background: rgba(255,255,255,.1); }
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ── Category Badge ──────────────────────────────────────────────────────── */
.cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 3px 8px;
  border-radius: 3px;
  color: #fff;
  background: var(--accent);
  margin-bottom: 8px;
}

/* ── Card Thumbnail ──────────────────────────────────────────────────────── */
.card-thumb {
  height: 160px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
/* Shield icon only shown when no photo (img absent) */
.card-thumb:not(:has(img))::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' opacity='.12'%3E%3Cpath fill='white' d='M32 4L8 16v16c0 14 10.7 27 24 30 13.3-3 24-16 24-30V16L32 4zm0 8l16 8v14c0 9.7-7 19-16 22-9-3-16-12.3-16-22V20l16-8z'/%3E%3C/svg%3E") center/40% no-repeat;
}

/* ── Post Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--card-hover); transform: translateY(-2px); }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 16px; line-height: 1.4; margin-bottom: 8px; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--accent); }
.card-excerpt { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex: 1; margin-bottom: 12px; }
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-meta .read-time::before { content: '· '; }

/* ── Hero Card ───────────────────────────────────────────────────────────── */
.hero-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 32px;
}
.hero-thumb {
  height: 220px;
  position: relative;
}
.hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
.hero-thumb:not(:has(img))::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' opacity='.1'%3E%3Cpath fill='white' d='M32 4L8 16v16c0 14 10.7 27 24 30 13.3-3 24-16 24-30V16L32 4zm0 8l16 8v14c0 9.7-7 19-16 22-9-3-16-12.3-16-22V20l16-8z'/%3E%3C/svg%3E") center/30% no-repeat;
}
.hero-body { padding: 20px; }
.hero-body h2 { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.hero-body h2 a { color: var(--text); }
.hero-body h2 a:hover { color: var(--accent); }
.hero-excerpt { font-size: 15px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.6; }
.hero-meta { font-size: 13px; color: var(--text-muted); }
.read-more {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.read-more:hover { background: var(--accent-dark); color: #fff; }

@media (min-width: 768px) {
  .hero-card { display: grid; grid-template-columns: 340px 1fr; }
  .hero-thumb { height: auto; min-height: 240px; border-radius: var(--radius) 0 0 var(--radius); }
  .hero-body { padding: 28px; }
  .hero-body h2 { font-size: 26px; }
}

/* ── Main Page Layout ────────────────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 24px 0 40px;
}
@media (min-width: 1024px) {
  .page-layout { grid-template-columns: 1fr 280px; }
}

/* ── Post Grid ───────────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #fff;
  background: var(--navy);
  padding: 10px 14px;
}
.widget-body { padding: 14px; }

.recent-posts-list { list-style: none; }
.recent-posts-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.recent-posts-list li:last-child { border-bottom: none; }
.recent-posts-list a { color: var(--text); line-height: 1.4; }
.recent-posts-list a:hover { color: var(--accent); }
.recent-posts-list .rp-date { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cat-list { list-style: none; }
.cat-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cat-list li:last-child { border-bottom: none; }
.cat-list a { color: var(--text); }
.cat-list a:hover { color: var(--accent); }
.cat-list .count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-gray);
  padding: 2px 6px;
  border-radius: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: center;
}
.stat-item { padding: 10px 0; }
.stat-item .num { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-item .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Single Post ─────────────────────────────────────────────────────────── */
.post-header { margin-bottom: 24px; }
.post-header h1 { font-size: 26px; line-height: 1.3; margin: 10px 0; }
.post-meta { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.post-hero-thumb {
  height: 240px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  position: relative;
}
.post-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.post-hero-thumb:not(:has(img))::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' opacity='.1'%3E%3Cpath fill='white' d='M32 4L8 16v16c0 14 10.7 27 24 30 13.3-3 24-16 24-30V16L32 4zm0 8l16 8v14c0 9.7-7 19-16 22-9-3-16-12.3-16-22V20l16-8z'/%3E%3C/svg%3E") center/25% no-repeat;
}

@media (min-width: 768px) {
  .post-header h1 { font-size: 32px; }
  .post-hero-thumb { height: 320px; }
}

/* Post body typography */
.post-body { max-width: 780px; }
.post-body h2 { font-size: 20px; margin: 28px 0 12px; color: var(--navy); }
.post-body h3 { font-size: 17px; margin: 22px 0 10px; color: var(--navy); }
.post-body p  { margin-bottom: 16px; line-height: 1.75; }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; }
.post-body li { margin-bottom: 6px; line-height: 1.65; }
.post-body strong { color: var(--navy); }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 10px 16px;
  margin: 20px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ── Affiliate Books ─────────────────────────────────────────────────────── */
.books-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 2px solid var(--border);
}
.books-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) { .books-grid { grid-template-columns: repeat(3, 1fr); } }

.book-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg-gray);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.book-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.book-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.book-author { font-size: 12px; color: var(--text-muted); }
.book-reason { font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.book-link {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  background: #ff9900;
  color: #111;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.book-link:hover { background: #e68a00; color: #111; }

/* ── Post Navigation ─────────────────────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav-item {
  font-size: 13px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-gray);
}
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.post-nav-item a { color: var(--text); font-weight: 500; }
.post-nav-item a:hover { color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { margin: 32px 0; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination li a, .pagination li.active a {
  display: block;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
}
.pagination li a:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.pagination li.active a { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Section Header ──────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.section-title-bar {
  display: inline-block;
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ── Category Page Header ────────────────────────────────────────────────── */
.cat-header {
  background: var(--navy);
  color: #fff;
  padding: 28px 0;
  margin-bottom: 0;
}
.cat-header h1 { font-size: 24px; margin-bottom: 6px; }
.cat-header p { font-size: 14px; opacity: .75; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: #e2e8f0;
  margin-top: 60px;
  padding: 40px 0 20px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 32px;
}
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer-brand .site-logo { font-size: 16px; margin-bottom: 10px; display: block; }
.footer-brand p { font-size: 13px; opacity: .7; line-height: 1.6; }
.footer-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #fff; margin-bottom: 12px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #9ca3af; font-size: 13px; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}
.footer-bottom a { color: #6b7280; }
.footer-bottom a:hover { color: #fff; }

.affiliate-disclaimer {
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  line-height: 1.5;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ── Language Toggle ─────────────────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  overflow: hidden;
  font-size: 11px;
}
.lang-btn {
  padding: 2px 8px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .5px;
  transition: background .15s, color .15s;
}
.lang-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.lang-btn.active {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* ── Newsletter Banner ───────────────────────────────────────────────────── */
.newsletter-banner {
  background: linear-gradient(135deg, #1a1a2e, #1a73e8);
  border-radius: var(--radius);
  padding: 28px 28px 20px;
  margin: 28px 0;
  color: #fff;
}
.newsletter-banner-inner {
  max-width: 640px;
}
.newsletter-banner h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.newsletter-banner p {
  font-size: 14px;
  opacity: .85;
  line-height: 1.5;
  margin-bottom: 16px;
}
.newsletter-disclaimer {
  font-size: 11px !important;
  opacity: .6 !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

/* ── Subscribe Form (banner inline) ─────────────────────────────────────── */
.subscribe-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  outline: none;
}

/* ── Subscribe Button ────────────────────────────────────────────────────── */
.subscribe-btn {
  display: inline-block;
  background: #fff;
  color: var(--accent) !important;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  border: none;
  cursor: pointer;
}
.subscribe-btn:hover { background: #e8f0fe; transform: translateY(-1px); }
.subscribe-btn-full {
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: #fff !important;
  padding: 11px 20px;
}
.subscribe-btn-full:hover { background: var(--accent-dark); }

/* ── Sidebar subscribe widget ────────────────────────────────────────────── */
.sidebar-subscribe { border-top: 3px solid var(--accent); }

/* ── Subscribe/Unsubscribe page ──────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.sub-status-box {
  border-radius: 8px;
  padding: 40px 32px;
}
.sub-ok  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.sub-err { background: #fff1f2; border: 1px solid #fecdd3; }
.sub-status-box h1, .sub-status-box h2 { color: var(--navy); margin-bottom: 10px; }
.sub-status-box p  { color: var(--text-muted); line-height: 1.6; margin-bottom: 0; }
.sub-status-icon   { font-size: 52px; margin-bottom: 16px; }

.sub-error-msg {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #c62828;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

.subscribe-form-page input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.subscribe-form-page input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
