/*
Theme Name: TechFaction
Theme URI: https://techfaction.ca
Author: TechFaction Inc.
Description: Custom dark theme for TechFaction consulting site.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: techfaction
*/

/* ===========================
   TOKENS & RESET
   =========================== */
:root {
  --navy: #0A1628;
  --navy-mid: #0f1f3d;
  --navy-surface: #152242;
  --ms-blue: #0078D4;
  --ms-blue-light: #1a8fe3;
  --cyan: #00B4D8;
  --white: #FFFFFF;
  --text-primary: #F0F4FF;
  --text-muted: #8A9BBD;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(0,180,216,0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.2s ease;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Sora', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ms-blue-light); }
img { max-width: 100%; display: block; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   HEADER / NAV
   =========================== */
#site-header {
  background: rgba(10,22,40,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

#site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: 1160px;
  margin: 0 auto;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.site-logo span { color: var(--ms-blue); }

#primary-nav ul,
#primary-nav ul li {
  list-style: none !important;
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#primary-nav ul {
  display: flex !important;
  gap: 32px;
}

#primary-nav li::before,
#primary-nav li::marker {
  display: none !important;
  content: none !important;
}

#primary-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

#primary-nav a:hover,
#primary-nav .current-menu-item a { color: var(--text-primary); }

.nav-cta {
  background: var(--ms-blue);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--ms-blue-light); color: var(--white) !important; }

/* ===========================
   MAIN CONTENT
   =========================== */
#content { min-height: 70vh; }

.site-main {
  padding: 60px 0;
}

/* ===========================
   BLOG — ARCHIVE / INDEX
   =========================== */
.blog-header {
  text-align: center;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.blog-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.blog-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.post-card {
  background: var(--navy-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,180,216,0.12);
  border-color: var(--cyan);
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-card-meta .category {
  background: rgba(0,120,212,0.15);
  color: var(--ms-blue-light);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  color: var(--text-primary);
}

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

.post-card .excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ms-blue-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more:hover { color: var(--cyan); }

/* ===========================
   SINGLE POST
   =========================== */
.single-post-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.post-header .post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.post-header .post-meta .category-tag {
  background: rgba(0,120,212,0.15);
  color: var(--ms-blue-light);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.post-header .post-excerpt {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Post body content */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #d0d8f0;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 12px;
}

.post-content p { margin-bottom: 20px; }

.post-content ul, .post-content ol {
  margin: 0 0 20px 24px;
}

.post-content li { margin-bottom: 8px; }

.post-content strong { color: var(--text-primary); font-weight: 600; }

.post-content code {
  background: var(--navy-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.88em;
  color: var(--cyan);
  font-family: 'Fira Code', 'Consolas', monospace;
}

.post-content pre {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ms-blue);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9em;
  color: var(--text-primary);
}

.post-content blockquote {
  border-left: 3px solid var(--cyan);
  background: var(--navy-surface);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.post-content th {
  background: var(--navy-surface);
  color: var(--text-primary);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--ms-blue);
}

.post-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.post-content tr:hover td { background: rgba(255,255,255,0.02); }

/* Back link */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color var(--transition);
}
.back-to-blog:hover { color: var(--cyan); }

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

.pagination a, .pagination span {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.pagination a:hover { border-color: var(--cyan); color: var(--cyan); }
.pagination .current { background: var(--ms-blue); color: white; border-color: var(--ms-blue); }

/* ===========================
   FOOTER
   =========================== */
#site-footer {
  background: var(--navy-mid);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-logo span { color: var(--ms-blue); }

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.footer-links,
.footer-links li {
  list-style: none !important;
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.footer-links li::before,
.footer-links li::marker {
  display: none !important;
  content: none !important;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px !important;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--cyan); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===========================
   BUTTONS
   =========================== */
a.btn-primary,
.btn-primary {
  display: inline-block !important;
  background: var(--ms-blue) !important;
  background-color: var(--ms-blue) !important;
  color: var(--white) !important;
  padding: 12px 28px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border: none !important;
  text-decoration: none !important;
  transition: background var(--transition), transform var(--transition);
  line-height: 1.5 !important;
}
a.btn-primary:hover,
.btn-primary:hover {
  background: var(--ms-blue-light) !important;
  background-color: var(--ms-blue-light) !important;
  transform: translateY(-1px);
  color: var(--white) !important;
}

a.btn-ghost,
.btn-ghost {
  display: inline-block !important;
  color: var(--text-muted) !important;
  padding: 12px 28px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border: 1px solid var(--border) !important;
  background: transparent !important;
  text-decoration: none !important;
  transition: border-color var(--transition), color var(--transition);
  line-height: 1.5 !important;
}
a.btn-ghost:hover,
.btn-ghost:hover {
  border-color: var(--cyan) !important;
  color: var(--cyan) !important;
}

/* ===========================
   SECTION SHARED
   =========================== */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 40px;
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,120,212,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,120,212,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-cred-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.cred-divider {
  color: var(--ms-blue);
  opacity: 0.6;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: -80px;
  width: 600px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(0,120,212,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   EXPERTISE
   =========================== */
.expertise {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.expertise-card {
  background: var(--navy-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.expertise-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 32px rgba(0,180,216,0.08);
}

.expertise-icon {
  width: 36px;
  height: 4px;
  background: linear-gradient(90deg, var(--ms-blue), var(--cyan));
  border-radius: 2px;
  margin-bottom: 20px;
}

.expertise-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.expertise-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===========================
   RECENT POSTS (HOMEPAGE)
   =========================== */
.recent-posts {
  padding: 80px 0;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header-row .section-title { margin-bottom: 0; }

.view-all-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ms-blue-light);
  white-space: nowrap;
}
.view-all-link:hover { color: var(--cyan); }

/* ===========================
   ABOUT PAGE
   =========================== */
.about-wrap {
  padding: 60px 0 80px;
}

.about-header {
  max-width: 700px;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.about-header h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-title-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.about-body {
  max-width: 700px;
}

.about-section {
  margin-bottom: 48px;
}

.about-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.about-lead {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.about-section p {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-list {
  list-style: none;
  padding: 0;
}

.about-list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 12px 0 12px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.about-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 0.85rem;
}

.about-list li strong {
  color: var(--text-primary);
}

.about-list li:last-child { border-bottom: none; }

.about-contact-section {
  background: var(--navy-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.about-contact-section h2 {
  border-bottom: none;
  padding-bottom: 0;
}

.about-contact-section p {
  margin-bottom: 24px;
}

/* ===========================
   UTILITIES
   =========================== */
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--cyan); }
.text-blue { color: var(--ms-blue-light); }

/* ===========================
   RESPONSIVE
   =========================== */

/* Tablet — 768px and below */
@media (max-width: 768px) {

  /* Header */
  #site-header .header-inner {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  #primary-nav ul {
    gap: 20px;
  }

  #primary-nav a {
    font-size: 0.85rem;
  }

  /* Hero */
  .hero {
    padding: 64px 0 56px;
  }

  .hero-headline {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }

  /* Section titles */
  .section-title {
    font-size: 1.6rem;
  }

  /* Expertise grid */
  .expertise-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .expertise-card {
    padding: 24px 20px;
  }

  /* Posts grid */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-card {
    padding: 20px;
  }

  /* Section spacing */
  .expertise {
    padding: 56px 0;
  }

  .recent-posts {
    padding: 56px 0;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* About */
  .about-wrap {
    padding: 40px 0 60px;
  }

  .about-header {
    margin-bottom: 40px;
    padding-bottom: 28px;
  }

  .about-header h1 {
    font-size: 2rem;
  }

  .about-contact-section {
    padding: 24px 20px;
  }

  /* Single post */
  .single-post-wrap {
    padding: 32px 16px;
  }

  .post-header h1 {
    font-size: 1.6rem;
  }

  /* Blog archive */
  .blog-header {
    padding: 40px 0 32px;
  }

  .blog-header h1 {
    font-size: 1.9rem;
  }

  /* Footer */
  .footer-links {
    gap: 16px;
  }
}

/* Mobile — 480px and below */
@media (max-width: 480px) {

  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0 44px;
  }

  .hero-eyebrow {
    font-size: 0.72rem;
  }

  .hero-headline {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.45rem;
    margin-bottom: 28px;
  }

  .expertise-card h3 {
    font-size: 1rem;
  }

  .post-card h2 {
    font-size: 1.05rem;
  }

  .about-header h1 {
    font-size: 1.75rem;
  }

  .about-lead {
    font-size: 1rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }

  /* Stack nav on very small screens */
  #site-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  #primary-nav ul {
    gap: 16px;
  }
}

/* ===========================
   CALLOUT BLOCKS
   =========================== */
.callout {
  border-left: 4px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.callout strong {
  display: inline-block;
  margin-right: 4px;
}

.callout-warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
}

.callout-warning strong { color: #f59e0b; }

.callout-tip {
  border-color: var(--cyan);
  background: rgba(0, 180, 216, 0.07);
  color: var(--text-primary);
}

.callout-tip strong { color: var(--cyan); }

.callout-info {
  border-color: var(--ms-blue-light);
  background: rgba(0, 120, 212, 0.08);
  color: var(--text-primary);
}

.callout-info strong { color: var(--ms-blue-light); }

.callout-danger {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.callout-danger strong { color: #ef4444; }
