/* ============================================================
   DEAD RECKONING — ICS/OT Cybersecurity Blog
   Ghost Theme Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:ital,wght@0,400;0,500;1,400&display=swap');

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

:root {
  --bg:          #0f0f0d;
  --bg-surface:  #141410;
  --bg-hover:    #1a1a16;
  --border:      #2e2e28;
  --border-mid:  #3e3e38;
  --text-primary:   #e8e2d4;
  --text-secondary: #9a9a8e;
  --text-muted:     #5a5a52;
  --accent:      #c0783a;
  --accent-dark: #994f1f;
  --danger:      #d94f4f;
  --info:        #4a7a9b;
  --warn:        #a89a40;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Barlow', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-primary); }

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

/* ---- Layout ----------------------------------------------- */
.site-wrapper { min-height: 100vh; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container--narrow { max-width: 760px; margin: 0 auto; padding: 0 2rem; }

/* ---- Header ----------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.header-grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, #1a1a16 39px, #1a1a16 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #1a1a16 39px, #1a1a16 40px);
  opacity: 0.4;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 0;
  max-width: 1100px;
  margin: 0 auto;
}

.site-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

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

.site-description {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Nav -------------------------------------------------- */
.site-nav {
  display: flex;
  gap: 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 1.2rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover,
.site-nav a.nav-current {
  color: var(--accent);
  background: var(--bg-hover);
}

/* ---- Ticker ----------------------------------------------- */
.site-ticker {
  background: var(--accent);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.ticker-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--bg);
  white-space: nowrap;
  padding: 0 1rem;
  letter-spacing: 0.15em;
  flex-shrink: 0;
}

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

.ticker-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--bg);
  white-space: nowrap;
  display: inline-block;
  animation: ticker-scroll 40s linear infinite;
}

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

/* ---- Homepage Feed ---------------------------------------- */
.home-feed {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 800px) {
  .home-feed { grid-template-columns: 1fr; padding: 1rem; }
}

/* ---- Post Cards ------------------------------------------- */
.post-feed { min-width: 0; }

.post-card--featured {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
  position: relative;
}
.post-card--featured:hover { border-color: var(--accent); }

.post-card--featured .card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-label-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.6s step-end infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.15} }

.post-card--featured h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

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

.post-card--featured .excerpt {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.post-card {
  border-bottom: 1px solid #1e1e1a;
  padding: 1.25rem 0 1.25rem 0.5rem;
  border-left: 2px solid transparent;
  transition: border-color 0.15s, padding-left 0.15s;
}
.post-card:hover {
  border-left-color: var(--accent);
  padding-left: 1rem;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}
.post-card h3 a { color: inherit; }
.post-card h3 a:hover { color: var(--accent); }

.post-card .excerpt {
  font-size: 13px;
  color: #6a6a5e;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

/* ---- Post Meta -------------------------------------------- */
.post-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}

.meta-severity { color: var(--danger); font-weight: 700; }
.meta-accent   { color: var(--accent); }

/* ---- Tags ------------------------------------------------- */
.tag-list { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; }

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
}
.tag:hover { color: var(--text-primary); border-color: var(--border-mid); }
.tag--crit { border-color: var(--danger); color: var(--danger); }
.tag--warn { border-color: var(--accent); color: var(--accent); }
.tag--info { border-color: var(--info);   color: var(--info); }

/* ---- Read More Button ------------------------------------- */
.btn-read-more {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.45rem 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1rem;
  transition: background 0.15s, color 0.15s;
}
.btn-read-more:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
  min-width: 0;
}

@media (max-width: 800px) {
  .sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
  }
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

/* Sidebar About */
.author-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1rem;
}
.author-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.author-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}
.author-bio {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.cert-list { display: flex; flex-wrap: wrap; gap: 4px; }
.cert {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 6px;
}
.status-line {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4a9a5a;
  animation: pulse-dot 2s step-end infinite;
  flex-shrink: 0;
}

/* Sidebar CVE cards */
.cve-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.cve-card:hover { border-color: var(--accent); }
.cve-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}
.cve-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.cvss-bar {
  margin-top: 6px;
  height: 3px;
  background: var(--border);
  border-radius: 1px;
}
.cvss-fill {
  height: 100%;
  border-radius: 1px;
}
.cvss-fill--crit { background: var(--danger); }
.cvss-fill--high { background: var(--accent); }
.cvss-fill--med  { background: var(--warn); }
.cvss-score {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---- Single Post ------------------------------------------ */
.post-header {
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}
.post-header .header-grid {
  opacity: 0.25;
}
.post-header-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}
.post-header .post-tags { margin-bottom: 1rem; }
.post-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.post-byline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.post-byline .byline-sep { color: var(--border-mid); }

/* ---- Post Content ----------------------------------------- */
.post-content {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.post-content a { color: var(--accent); border-bottom: 1px solid var(--accent-dark); }
.post-content a:hover { color: var(--text-primary); }

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--text-secondary);
}

.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #a8d8a8;
  line-height: 1.5;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--accent);
  padding: 1px 5px;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content figure { margin: 2rem 0; }
.post-content figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}

/* ---- Post Feature Image ----------------------------------- */
.post-feature-image {
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 0 2rem;
}
.post-feature-image img {
  width: 100%;
  border: 1px solid var(--border);
}

/* ---- Post Footer ------------------------------------------ */
.post-footer {
  border-top: 1px solid var(--border);
  max-width: 760px;
  margin: 3rem auto 0;
  padding: 2rem;
}

.post-footer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* ---- Pagination ------------------------------------------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.4rem 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.pagination a:hover { background: var(--accent); color: var(--bg); }

.pagination .page-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Tag / Author Archive --------------------------------- */
.archive-header {
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.archive-header-inner { max-width: 1100px; margin: 0 auto; }

.archive-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.archive-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.archive-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 0.5rem;
  max-width: 600px;
}

/* ---- 404 -------------------------------------------------- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}
.error-code {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.error-message {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 4rem;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
}
.footer-brand span { color: var(--accent); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

/* ---- Subscribe Form --------------------------------------- */
.subscribe-form { margin-top: 1rem; }
.subscribe-form form { display: flex; gap: 0; }
.subscribe-form input[type="email"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-primary);
  padding: 0.5rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 12px;
  flex: 1;
  outline: none;
  min-width: 0;
}
.subscribe-form input[type="email"]::placeholder { color: var(--text-muted); }
.subscribe-form input[type="email"]:focus { border-color: var(--accent); }
.subscribe-form button {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.subscribe-form button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ---- Ghost Card Width Classes (required) ------------------ */
.kg-width-wide {
  margin-left: -4rem;
  margin-right: -4rem;
}

.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

@media (max-width: 600px) {
  .kg-width-wide { margin-left: -1rem; margin-right: -1rem; }
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .container, .container--narrow { padding: 0 1rem; }
  .home-feed { padding: 1rem; }
  .post-header { padding: 2rem 1rem 1.5rem; }
  .post-content { padding: 0 1rem; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}
