/*
Theme Name: Guardian Gaze WP
Theme URI: https://guardiangaze.com
Author: RedSecLabs
Author URI: https://redseclabs.com
Description: Official WordPress theme for Guardian Gaze WP — AI-powered security scanner by RedSecLabs.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: guardian-gaze-wp
Tags: blog, custom-menu, featured-images, threaded-comments
*/

:root {
  /* Same palette as guardiangaze.com/wp: #0B0B77 navy and its shades only. */
  --primary: #0B0B77;
  --primary-deep: #09095e;
  --primary-dark: #030440;
  --primary-tint: #f4f4f9;
  --primary-tint-2: #ebebf5;
  --primary-soft: #d9d9ec;
  --gold: #E9AF14;
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --border: #e6e8ef;
  --border-strong: #d4d6e2;
  --ink: #202020;
  --ink-2: #2b2b3a;
  --text: #3f3f4c;
  --text-2: #626275;
  --text-3: #8a8a9c;
  --text-4: #c4c4d0;
  --safe: #1a8a4e;
  --safe-tint: #e6f5ed;
  --warn: #c97a07;
  --warn-tint: #fcf3e3;
  --danger: #c4344e;
  --danger-tint: #fce8ed;
  /* Same type as guardiangaze.com/wp: Plus Jakarta Sans headings, Inter body. */
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(11,11,119,.05), 0 0 0 1px rgba(11,11,119,.04);
  --shadow-md: 0 6px 20px -6px rgba(11,11,119,.14), 0 0 0 1px rgba(11,11,119,.05);
  --shadow-lg: 0 24px 60px -24px rgba(3,4,64,.35), 0 0 0 1px rgba(11,11,119,.05);
  --shadow-navy: 0 8px 30px -10px rgba(11,11,119,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
a { color: inherit; text-decoration: none; }

/* ── ANNOUNCEMENT BAR (hidden by default) ── */
.announce { display: none; }

/* ── SITE HEADER ──
   The header is the main site's global nav (.ggn), styled by this
   theme's css/gg-global-nav.css (see functions.php).
   Only the WordPress admin-bar offset lives here. */
.admin-bar .ggn { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .ggn { top: 46px; }
}

/* ── PAGE HERO ── */
.page-hero {
  padding: 80px 0 56px;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -180px; right: -180px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--primary-tint) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.page-hero-inner { position: relative; z-index: 1; max-width: 960px; }
.page-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 20px;
}
.page-hero h1 em { color: var(--primary); font-style: normal; font-weight: 700; }
.page-hero .lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  max-width: 60ch;
  margin-bottom: 0;
}
.page-hero-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  margin-bottom: 18px;
  font-weight: 500;
}

/* ── SECTION SHELL ── */
section.std { padding: 100px 0; }
section.std.alt {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sec-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  margin-bottom: 14px;
  font-weight: 500;
}
h2.sec-title {
  font-family: var(--display);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 18px;
  max-width: 22ch;
}
h2.sec-title em { font-style: normal; color: var(--primary); font-weight: 700; }
.sec-lede { font-size: 17px; color: var(--text); max-width: 60ch; line-height: 1.55; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  background: var(--primary);
  color: white;
  font-weight: 500;
  font-size: 15px;
  border-radius: 10px;
  transition: all .18s;
  box-shadow: var(--shadow-navy);
  letter-spacing: -.005em;
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px;
  background: white;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: all .18s;
  letter-spacing: -.005em;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }

/* ── BLOG GRID ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.blog-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: all .2s;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-md);
}
.blog-card.featured {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
  background: linear-gradient(135deg, white 0%, var(--primary-tint) 200%);
  border-color: var(--primary-soft);
}
.blog-image {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-deep));
  border-radius: 10px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.blog-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(58,134,254,.28), transparent 60%);
}
.blog-image span { position: relative; z-index: 1; }
/* With a real image, a plain dark letterbox instead of the gradient + glow. */
.blog-image:has(img) {
  background: var(--primary-dark);
}
.blog-image:has(img)::before {
  display: none;
}
/* contain, not cover: the featured card's image column stretches with the
   text, and cover cropped the bottom of the image. */
.blog-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 14px;
}
.blog-meta .cat { color: var(--primary); font-weight: 600; }
.blog-meta .sep { color: var(--text-4); }
.blog-h {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.018em;
  color: var(--ink);
  margin-bottom: 12px;
}
.blog-card.featured .blog-h { font-size: 30px; }
.blog-excerpt {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 20px;
  flex-grow: 1;
}
.blog-card.featured .blog-excerpt { font-size: 16px; }
.blog-author { font-size: 13px; color: var(--text-2); }

/* No posts */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
}
.no-posts h3 { font-family: var(--display); font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }

/* ── BLOG PAGINATION ── */
.blog-pagination {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}
.blog-pagination .navigation { width: auto; }
.blog-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0; margin: 0;
}
.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: .15s;
  font-family: var(--sans);
}
.blog-pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.blog-pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.blog-pagination .page-numbers.dots { border: none; background: none; color: var(--text-4); cursor: default; }

/* ── NEWSLETTER STRIP ── */
.cta-strip {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
  color: white;
  padding: 56px 48px;
  border-radius: 18px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-strip h3 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 8px;
  max-width: 30ch;
}
.cta-strip p { font-size: 15px; color: rgba(255,255,255,.78); max-width: 50ch; }
.cta-strip .btn-primary {
  background: white;
  color: var(--primary-deep);
  flex-shrink: 0;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.4);
}
.cta-strip .btn-primary:hover { background: var(--primary-tint); color: var(--primary-deep); }

/* ── SINGLE POST ── */
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 22px;
}
.post-meta-row .cat { color: var(--primary); font-weight: 600; }
.post-meta-row .sep { color: var(--text-4); }

.prose {
  max-width: 920px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}
.prose h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.018em;
  color: var(--ink);
  margin-top: 40px;
  margin-bottom: 16px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 0 0 16px 24px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 20px 24px;
  background: var(--primary-tint);
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  color: var(--ink-2);
  font-style: italic;
}
.prose pre {
  background: var(--ink);
  border-radius: 10px;
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 20px;
}
.prose pre code { background: none; color: rgba(255,255,255,.85); padding: 0; font-size: 13px; }
.prose code {
  background: var(--primary-tint);
  color: var(--primary-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
}
.prose img { max-width: 100%; border-radius: 8px; margin: 8px 0 20px; display: block; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14px; }
.prose th { background: var(--surface-2); padding: 10px 14px; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.prose td { padding: 10px 14px; border: 1px solid var(--border); }

.post-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}
.post-author-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-deep));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.post-author-name { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); }
.post-author-role { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* Post navigation */
.post-nav {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.post-nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s;
}
.post-nav a:hover { color: var(--primary); }
.post-nav a svg { width: 16px; height: 16px; }
.post-nav a.next { margin-left: auto; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 32px;
  transition: .15s;
}
.back-link:hover { color: var(--primary); }
.back-link svg { width: 16px; height: 16px; }

/* ── FOOTER ──
   The footer is the main site's home-page footer (.footer-v2), styled by
   this theme's css/gg-footer.css (see functions.php). */

/* ── GENERIC PAGE ── */
.page-content { max-width: 760px; margin: 0 auto; padding: 80px 48px 96px; }
.page-content h1 {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--ink);
  letter-spacing: -.02em;
}

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .blog-card.featured { grid-column: span 2; grid-template-columns: 1fr; }
  .blog-card.featured .blog-image { min-height: 180px; }
  .cta-strip { flex-direction: column; align-items: flex-start; padding: 40px 32px; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .page-hero { padding: 56px 0 40px; }
  section.std { padding: 64px 0; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card.featured { grid-column: span 1; padding: 28px; grid-template-columns: 1fr; }
  .blog-card.featured .blog-h { font-size: 24px; }
  .cta-strip { padding: 32px 24px; }
  .cta-strip h3 { font-size: 22px; }
}
/* ── CARD IMAGES ──
   Every card leads with an image: the post's featured image, else the first
   image in the post, else a branded navy placeholder (gg_card_media()). */
.blog-card { padding: 0; overflow: hidden; }
.blog-card .card-body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex-grow: 1; }
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--primary-dark);
  overflow: hidden;
  flex-shrink: 0;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.blog-card:hover .card-media img { transform: scale(1.04); }
.card-media--placeholder {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 75% 20%, rgba(58,134,254,.35), transparent 55%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
}
.card-media--placeholder svg { width: 44px; height: 44px; opacity: .9; }
.card-media--placeholder span {
  position: absolute; left: 18px; bottom: 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.8);
}
.blog-h { font-size: 20px; }

.grid-head {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 28px;
}
.grid-head h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em; color: var(--ink);
}
.grid-head p { color: var(--text-2); font-size: 15px; }

/* ── BLOG HOME HERO + CAROUSEL ── */
.blog-hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.blog-hero::before {
  content: ''; position: absolute; top: -220px; right: -200px;
  width: 760px; height: 760px;
  background: radial-gradient(circle, var(--primary-tint-2) 0%, transparent 60%);
  pointer-events: none;
}
.blog-hero .container { position: relative; }
.blog-hero-head {
  display: flex; align-items: end; justify-content: space-between; gap: 32px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.blog-hero-head h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.02em;
  color: var(--ink); max-width: 18ch;
}
.blog-hero-head h1 em { font-style: normal; color: var(--primary); }
.blog-hero-head .lede { font-size: 17px; color: var(--text); max-width: 46ch; line-height: 1.55; }

.gg-carousel {
  position: relative;
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 0%, rgba(58,134,254,.22), transparent 50%),
    linear-gradient(135deg, var(--primary-dark) 0%, #06064f 55%, var(--primary) 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: #fff;
}
.gg-car-viewport { position: relative; }
.gg-slide {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: center;
  padding: 40px;
}
/* Only the active slide is in the layout; the others sit on top of it,
   invisible, so the carousel never jumps in height between slides. */
.gg-carousel.is-ready .gg-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: translateX(24px);
  transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s;
}
.gg-carousel.is-ready .gg-slide.is-active {
  position: relative;
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .6s ease, transform .6s ease, visibility 0s;
}
.gg-slide-media {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,.06);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.6);
}
.gg-slide-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.gg-slide-media:hover img { transform: scale(1.03); }
.gg-slide-media.card-media--placeholder { display: flex; }
.gg-slide .blog-meta { color: rgba(255,255,255,.65); }
.gg-slide .blog-meta .cat { color: var(--gold); }
.gg-slide .blog-meta .sep { color: rgba(255,255,255,.35); }
.gg-slide-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.02em;
  margin-bottom: 14px;
}
.gg-slide-title a { color: #fff; }
.gg-slide-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.gg-slide-excerpt { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.78); margin-bottom: 24px; }
.gg-slide-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gg-slide-author { font-size: 13.5px; color: rgba(255,255,255,.7); }
.gg-slide .btn-primary { background: #fff; color: var(--primary); box-shadow: none; padding: 12px 20px; font-weight: 600; }
.gg-slide .btn-primary:hover { background: var(--primary-tint); color: var(--primary-deep); }

.gg-car-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 40px 28px;
}
.gg-car-dots { display: flex; gap: 8px; }
.gg-car-dot {
  position: relative; width: 28px; height: 4px; border: 0; padding: 0;
  border-radius: 4px; background: rgba(255,255,255,.25); cursor: pointer; overflow: hidden;
}
.gg-car-dot::after {
  content: ''; position: absolute; inset: 0; background: #fff;
  transform: scaleX(0); transform-origin: left;
}
.gg-car-dot.is-active { width: 44px; }
.gg-car-dot.is-active::after { transform: scaleX(1); }
.gg-carousel.is-playing .gg-car-dot.is-active::after { animation: gg-car-progress var(--gg-car-interval, 6s) linear forwards; }
.gg-carousel.is-paused .gg-car-dot.is-active::after { animation-play-state: paused; }
@keyframes gg-car-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.gg-car-arrows { display: flex; gap: 10px; }
.gg-car-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06);
  color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.gg-car-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }
.gg-car-btn svg { width: 18px; height: 18px; }
.gg-car-dot:focus-visible, .gg-car-btn:focus-visible, .gg-slide a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}

@media (max-width: 980px) {
  .gg-slide { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .gg-car-controls { padding: 0 24px 22px; }
}
@media (max-width: 640px) {
  .blog-hero { padding: 40px 0 28px; }
  .gg-slide-excerpt { display: none; }
  .gg-car-btn { width: 38px; height: 38px; }
  .gg-car-controls { padding: 0 18px 18px; gap: 10px; }
  .gg-car-dot { width: 16px; }
  .gg-car-dot.is-active { width: 28px; }
  .gg-car-arrows { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .gg-carousel.is-ready .gg-slide, .card-media img, .gg-slide-media img { transition: none; }
}
.gg-carousel:not(.is-ready) .gg-slide:not(.is-active) { display: none; }
