/*
Theme Name: IntelloWork Blog
Description: Blog theme matching the intellowork.com marketing site — same header, footer, palette (mkt tokens), IBM Plex Sans + Space Grotesk, card grid listing.
Version: 1.0.0
Author: IntelloWork
Text Domain: intellowork-blog
*/

/* ---- Brand tokens (mirrors ai-frontend app/globals.css --mkt-*) ---- */
:root {
  --mkt-accent: 205 90% 45%;          /* #0B72C4 primary blue */
  --mkt-accent-strong: 209 92% 33%;
  --mkt-accent-soft: 205 90% 95%;
  --mkt-secondary: 199 93% 54%;       /* #1CB0F4 cyan */
  --mkt-navy: 215 42% 14%;            /* #14202E ink */
  --mkt-text: 215 42% 14%;
  --mkt-text-soft: 215 18% 38%;
  --mkt-text-mute: 215 14% 60%;
  --mkt-border: 210 25% 89%;
  --mkt-surface: 0 0% 100%;
  --mkt-surface-tint: 205 70% 99%;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: hsl(var(--mkt-text));
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

.iw-container { max-width: 80rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 1024px) { .iw-container { padding-left: 2rem; padding-right: 2rem; } }

/* ---- Header (MarketingHeader clone) ---- */
.iw-header {
  position: sticky; top: 0; z-index: 40; width: 100%;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: all 300ms ease;
}
.iw-header.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid hsl(var(--mkt-border) / 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.iw-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.iw-logo img { height: 34px; width: auto; display: block; }
.iw-nav { display: none; align-items: center; gap: 1.75rem; font-size: 0.875rem; font-weight: 500; color: hsl(var(--mkt-text-soft)); }
@media (min-width: 1024px) { .iw-nav { display: flex; } }
.iw-nav a { position: relative; text-decoration: none; transition: color 200ms; }
.iw-nav a:hover { color: hsl(var(--mkt-text)); }
.iw-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  border-radius: 9999px; background: hsl(var(--mkt-accent)); transition: width 300ms;
}
.iw-nav a:hover::after { width: 100%; }
.iw-header-ctas { display: flex; align-items: center; gap: 0.5rem; }
.iw-signin {
  display: none; height: 2.5rem; align-items: center; justify-content: center;
  padding: 0 1rem; font-size: 0.875rem; font-weight: 500; color: hsl(var(--mkt-text-soft));
  text-decoration: none; border-radius: 9999px; transition: color 200ms;
}
@media (min-width: 640px) { .iw-signin { display: inline-flex; } }
.iw-signin:hover { color: hsl(var(--mkt-text)); }
.mkt-cta-primary {
  display: inline-flex; height: 2.5rem; align-items: center; justify-content: center;
  padding: 0 1rem; font-size: 0.875rem; text-decoration: none;
  background: linear-gradient(135deg, #1CB0F4 0%, #0B72C4 100%);
  color: #fff; font-weight: 600; border-radius: 9999px;
  box-shadow: 0 14px 28px rgba(11, 114, 196, 0.28);
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}
.mkt-cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(11, 114, 196, 0.36);
  filter: brightness(1.06);
}

/* ---- Blog hero ---- */
.iw-hero { padding: 7rem 1.5rem 3rem; text-align: center; }
.iw-hero-inner { max-width: 48rem; margin: 0 auto; }
.mkt-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.875rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: hsl(var(--mkt-accent-soft));
  border: 1px solid hsl(var(--mkt-accent) / 0.25);
  color: hsl(var(--mkt-accent));
}
.iw-hero h1 {
  margin: 1.25rem 0 0; font-family: var(--font-display);
  font-size: 2.5rem; font-weight: 700; letter-spacing: -0.028em; line-height: 1.1;
}
@media (min-width: 640px) { .iw-hero h1 { font-size: 3rem; } }
.iw-hero p { margin: 1rem auto 0; max-width: 40rem; font-size: 1.0625rem; line-height: 1.75rem; color: hsl(var(--mkt-text-soft)); }

/* ---- Card grid (blog index) ---- */
.iw-grid-section { padding: 0 1.5rem 6rem; }
.iw-grid { max-width: 80rem; margin: 0 auto; display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .iw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .iw-grid { grid-template-columns: repeat(3, 1fr); } }
.iw-card {
  display: flex; flex-direction: column; height: 100%;
  border-radius: 1rem; border: 1px solid hsl(var(--mkt-border));
  background: hsl(var(--mkt-surface)); padding: 1.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.iw-card:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--mkt-accent));
  box-shadow: 0 18px 40px -20px hsl(var(--mkt-accent) / 0.5);
}
.iw-card-kicker {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: hsl(var(--mkt-accent));
}
.iw-card h2 {
  margin: 0.625rem 0 0; font-family: var(--font-display);
  font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35;
  color: hsl(var(--mkt-text));
}
.iw-card-excerpt { margin: 0.625rem 0 0; font-size: 0.9rem; line-height: 1.55; color: hsl(var(--mkt-text-soft)); }
.iw-card-excerpt p { margin: 0; }
.iw-card-meta { margin-top: auto; padding-top: 1.25rem; font-size: 0.78rem; color: hsl(var(--mkt-text-mute)); }

/* ---- Pagination ---- */
.iw-pagination { margin-top: 3rem; display: flex; justify-content: center; gap: 0.5rem; font-size: 0.9rem; }
.iw-pagination .page-numbers {
  display: inline-flex; min-width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center;
  padding: 0 0.625rem; border-radius: 9999px; border: 1px solid hsl(var(--mkt-border));
  color: hsl(var(--mkt-text-soft)); text-decoration: none; transition: all 200ms;
}
.iw-pagination .page-numbers:hover { border-color: hsl(var(--mkt-accent) / 0.5); color: hsl(var(--mkt-accent)); }
.iw-pagination .page-numbers.current { background: hsl(var(--mkt-navy)); border-color: hsl(var(--mkt-navy)); color: #fff; }

/* ---- Single post ---- */
.iw-single { padding: 6.5rem 1.5rem 5rem; }
.iw-single-inner { max-width: 46rem; margin: 0 auto; }
.iw-backlink {
  display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.85rem; font-weight: 500;
  color: hsl(var(--mkt-accent)); text-decoration: none;
}
.iw-backlink:hover { text-decoration: underline; }
.iw-single-meta { margin-top: 1.5rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--mkt-accent)); }
.iw-single h1.iw-title {
  margin: 0.75rem 0 0; font-family: var(--font-display);
  font-size: 2.25rem; font-weight: 700; letter-spacing: -0.028em; line-height: 1.15;
}
@media (min-width: 640px) { .iw-single h1.iw-title { font-size: 2.75rem; } }
.iw-single-date { margin-top: 1rem; font-size: 0.875rem; color: hsl(var(--mkt-text-mute)); }

/* Post content typography */
.iw-content { margin-top: 2.5rem; font-size: 1.0625rem; line-height: 1.8; color: hsl(var(--mkt-text-soft)); }
.iw-content h1, .iw-content h2, .iw-content h3, .iw-content h4 {
  font-family: var(--font-display); color: hsl(var(--mkt-text));
  letter-spacing: -0.02em; line-height: 1.3; margin: 2.25rem 0 0.75rem;
}
.iw-content h1 { font-size: 1.75rem; }
.iw-content h2 { font-size: 1.5rem; }
.iw-content h3 { font-size: 1.25rem; }
.iw-content h4 { font-size: 1.1rem; }
.iw-content p { margin: 1rem 0; }
.iw-content a { color: hsl(var(--mkt-accent)); text-decoration: underline; text-underline-offset: 2px; }
.iw-content a:hover { color: hsl(var(--mkt-accent-strong)); }
.iw-content ul, .iw-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.iw-content li { margin: 0.375rem 0; }
.iw-content blockquote {
  margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid hsl(var(--mkt-accent)); color: hsl(var(--mkt-text));
}
.iw-content hr { margin: 2.5rem 0; border: none; border-top: 1px solid hsl(var(--mkt-border)); }
.iw-content code { background: hsl(var(--mkt-surface-tint)); border: 1px solid hsl(var(--mkt-border)); border-radius: 0.375rem; padding: 0.1rem 0.35rem; font-size: 0.9em; }
.iw-content pre { background: hsl(var(--mkt-navy)); color: #e8eef5; border-radius: 0.75rem; padding: 1.25rem; overflow-x: auto; }
.iw-content pre code { background: none; border: none; color: inherit; padding: 0; }
.iw-content figure.wp-block-table { margin: 1.5rem 0; overflow-x: auto; }
.iw-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.iw-content th, .iw-content td { border: 1px solid hsl(var(--mkt-border)); padding: 0.625rem 0.875rem; text-align: left; }
.iw-content th { background: hsl(var(--mkt-surface-tint)); color: hsl(var(--mkt-text)); font-weight: 600; }
.iw-content img { border-radius: 0.75rem; }

/* ---- Footer (MarketingFooter clone) ---- */
.iw-footer {
  border-top: 1px solid hsl(var(--mkt-border) / 0.6);
  background: rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 3rem 1.5rem;
}
@media (min-width: 640px) { .iw-footer { padding-left: 2rem; padding-right: 2rem; } }
.iw-footer-grid { display: grid; gap: 2.5rem; max-width: 80rem; margin: 0 auto; }
@media (min-width: 1024px) { .iw-footer-grid { grid-template-columns: 1.4fr 2fr; } }
.iw-footer-tagline { margin-top: 1rem; max-width: 28rem; font-size: 0.875rem; line-height: 1.5rem; color: hsl(var(--mkt-text-soft)); }
.iw-footer-cols { display: grid; gap: 2rem; }
@media (min-width: 640px) { .iw-footer-cols { grid-template-columns: repeat(3, 1fr); } }
.iw-footer-col p { margin: 0; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.24em; color: hsl(var(--mkt-text-soft)); }
.iw-footer-col ul { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.iw-footer-col li { margin: 0.5rem 0; }
.iw-footer-col a { font-size: 0.875rem; color: hsl(var(--mkt-text)); text-decoration: none; transition: color 200ms; }
.iw-footer-col a:hover { color: hsl(var(--mkt-accent)); }
.iw-footer-bottom {
  max-width: 80rem; margin: 2.5rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--mkt-border) / 0.5);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  font-size: 0.75rem; color: hsl(var(--mkt-text-soft));
}
.iw-footer-bottom p { margin: 0; }
.iw-footer-bottom a { font-weight: 600; color: hsl(var(--mkt-text)); text-decoration: none; }
.iw-footer-bottom a:hover { color: hsl(var(--mkt-accent)); }

/* Empty state */
.iw-empty {
  max-width: 28rem; margin: 0 auto; border-radius: 1rem; border: 1px solid hsl(var(--mkt-border));
  background: hsl(var(--mkt-surface)); padding: 2.5rem; text-align: center;
  color: hsl(var(--mkt-text-mute)); box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Hide the admin bar bump on the sticky header when logged in */
body.admin-bar .iw-header { top: 32px; }
