/*
Theme Name: Itcertguide
Theme URI: https://www.itcertguide.com/
Author: Itcertguide
Description: Blog theme for itcertguide.com/blog. Matches the static marketing site. Install WordPress in the /blog directory only.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: itcertguide
*/

:root {
  --text: #09090b;
  --text-secondary: #52525b;
  --text-tertiary: #71717a;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --surface-3: #e4e4e7;
  --border: #d4d4d8;
  --accent: #8b5cf6;
  --accent-deep: #7c3aed;
  --link: #7c3aed;
  --on-accent: #fafafa;
  --header-height: 64px;
  --shadow: 0 8px 24px rgba(9, 9, 11, 0.06);
  color-scheme: light;
}

html.dark {
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --surface: #09090b;
  --surface-2: #18181b;
  --surface-3: #27272a;
  --border: #27272a;
  --link: #a78bfa;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: Geist, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { overflow-wrap: anywhere; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 70;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.container { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
}

.logo { display: flex; align-items: center; }
.logo img { height: 36px; width: auto; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.cta {
  display: none;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent-deep);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.cta:hover { background: var(--accent-deep); }
.cta svg { width: 16px; height: 16px; display: block; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.desktop-nav { display: none; }
.desktop-nav > ul,
.mobile-nav > ul { display: flex; }
.desktop-nav a,
.mobile-nav a { text-decoration: none; }

.desktop-nav > ul { align-items: center; gap: 2px; }
.desktop-nav > ul > li > a,
.mobile-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 12px;
  border-radius: 999px;
}
.desktop-nav > ul > li > a:hover,
.mobile-nav a:hover,
.desktop-nav a[aria-current="page"] { background: var(--surface-3); }

.has-sub { position: relative; }
.sub {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.has-sub:hover > .sub,
.has-sub:focus-within > .sub { display: block; }
.sub a {
  display: flex;
  width: 100%;
  border-radius: 6px;
  padding: 6px 12px;
}
.sub a:hover { background: var(--surface-3); }

.mobile-nav { padding: 8px 0 12px; }
.mobile-cta { display: inline-flex; margin: 8px 0 16px; }
.mobile-nav[hidden] { display: none !important; }
.mobile-nav > ul { flex-direction: column; gap: 4px; }
.mobile-nav .sub {
  display: block;
  position: static;
  border: 0;
  background: transparent;
  padding: 0 0 8px 12px;
  min-width: 0;
}
.mobile-nav .cta { display: inline-flex; margin-top: 16px; }

@media (min-width: 1024px) {
  .bar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header-actions { margin-left: 0; justify-self: end; }
  .cta { display: inline-flex; }
  .menu-toggle, .mobile-nav, .mobile-cta { display: none !important; }
  .desktop-nav { display: block; }
}

.section { padding: 56px 0 72px; }
@media (min-width: 768px) { .section { padding: 72px 0; } }

.blog-intro {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}
@media (min-width: 768px) {
  .blog-intro { grid-template-columns: 1.4fr 0.8fr; align-items: end; }
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
@media (min-width: 768px) { h1 { font-size: 2.25rem; } }

.lede {
  margin: 10px 0 0;
  max-width: 42rem;
  color: var(--text-tertiary);
  font-size: 1.125rem;
  font-weight: 300;
}

.search input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 14px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.cards { display: grid; gap: 20px; }
@media (min-width: 768px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card-media { padding: 8px 8px 0; }
.card-media img,
.cover-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-3);
}
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.card-meta, .article-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}
.card h2 { margin: 0; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.03em; }
.card p { margin: 0; color: var(--text-secondary); }

.more { margin: 48px 0 8px; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.03em; }

.post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid;
  gap: 6px 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
}
.post-row:hover { background: var(--surface-2); }
.row-title { color: var(--text); font-weight: 500; }
@media (min-width: 768px) {
  .post-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; align-items: center; }
  .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.article-head { max-width: 800px; margin: 0 auto 28px; text-align: center; }
.article-head .lede { margin-inline: auto; }
.crumbs { margin: 0 0 16px; color: var(--text-tertiary); font-size: 0.875rem; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.article-cover {
  width: min(75ch, 100%);
  margin: 0 auto 32px;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.prose {
  width: min(75ch, 100%);
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.prose > p:first-of-type { font-size: 1.35rem; font-weight: 300; color: var(--text); }
.prose h2, .prose h3 { color: var(--text); font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.prose h2 { font-size: 1.75rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.35rem; margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }
.prose li { margin: 0.35rem 0; }
.prose a { color: var(--link); text-decoration: none; }
.prose a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { color: var(--text); font-weight: 500; }

.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0 10px;
}
.page-numbers.current, .page-numbers:hover { background: var(--surface-3); color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 64px 0 40px; }
.footer-grid {
  display: grid;
  gap: 32px;
  margin-bottom: 56px;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
.footer-grid h2 { margin: 0 0 12px; font-size: 14px; font-weight: 500; }
.footer-grid a, .legal a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 300;
}
.footer-grid li + li { margin-top: 8px; }
.footer-grid a:hover, .legal a:hover { color: var(--text); }

.footer-bar {
  display: grid;
  gap: 16px;
  align-items: center;
}
@media (min-width: 640px) {
  .footer-bar { grid-template-columns: 1fr auto 1fr; }
  .legal { justify-self: center; }
  .appearance { justify-self: end; }
}
.legal { display: flex; gap: 16px; }
.copy { margin: 0; color: var(--text-tertiary); font-size: 14px; }
.appearance { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); }
.appearance p { margin: 0; }

.themes {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.themes button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.themes button[aria-pressed="true"],
.themes button:hover { background: var(--surface-3); color: var(--text); }
.themes svg { width: 16px; height: 16px; }

.whatsapp {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.whatsapp:hover { background: #1ebe57; }
.whatsapp svg { width: 28px; height: 28px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
::selection { background: #ddd6fe; }
html.dark ::selection { background: #2e1065; color: #fafafa; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .whatsapp { transition: none; }
}
