/*
 * Zumesco Tech Theme — Global Stylesheet
 * Design tokens (CSS custom properties) + minimal base styles.
 * These mirror the theme.json presets so both PHP templates and
 * the block editor share the same values.
 *
 * DO NOT add component-specific styles here.
 * Components belong in /template-parts/ alongside their PHP files.
 */

/* ══════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════ */
:root {
  /* Palette */
  --zu-dark:          #1e293b;
  --zu-purple:        #7c3aed;
  --zu-purple-hover:  #6d28d9;
  --zu-purple-light:  #ede9fe;
  --zu-purple-mid:    #a78bfa;
  --zu-white:         #ffffff;
  --zu-surface-1:     #f8fafc;
  --zu-surface-2:     #f1f5f9;
  --zu-border:        #e2e8f0;
  --zu-text-muted:    #64748b;
  --zu-text-mid:      #334155;
  --zu-text-label:    #1e293b;
  --zu-deep-navy:     #0f172a;
  --zu-success:       #059669;
  --zu-success-bg:    #d1fae5;
  --zu-warning:       #d97706;
  --zu-warning-bg:    #fef3c7;
  --zu-info:          #2563eb;
  --zu-info-bg:       #dbeafe;

  /* Typography */
  --zu-font-sans:     'DM Sans', system-ui, sans-serif;
  --zu-font-serif:    'Instrument Serif', Georgia, serif;

  /* Radii */
  --zu-radius-sm:     6px;
  --zu-radius-md:     10px;
  --zu-radius-lg:     16px;
  --zu-radius-xl:     24px;
  --zu-radius-full:   9999px;

  /* Shadows */
  --zu-shadow-card:   0 4px 16px rgba(30, 41, 59, .07);
  --zu-shadow-lift:   0 20px 48px rgba(100, 116, 139, .16);
  --zu-shadow-purple: 0 10px 28px rgba(124, 58, 237, .32);

  /* Layout */
  --zu-max-w:         1120px;
  --zu-content-w:     780px;
  --zu-header-h:      68px;

  /* Transitions */
  --zu-transition:    0.22s ease;
}

/* ══════════════════════════════════════
   RESET / BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--zu-font-sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.75;
  color: var(--zu-dark);
  background: var(--zu-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Links ── */
a { color: var(--zu-purple); text-decoration: none; transition: color var(--zu-transition); }
a:hover { color: var(--zu-purple-hover); }
a:focus-visible { outline: 2px solid var(--zu-purple); outline-offset: 3px; border-radius: 2px; }

/* ── Images & media ── */
img, svg, video { max-width: 100%; height: auto; display: block; }

/* ── Forms reset ── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── Lists ── */
ul, ol { padding-left: 1.375rem; }
ul { list-style: disc; }
ol { list-style: decimal; }

/* ══════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════ */
h1, h2 {
  font-family: var(--zu-font-serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--zu-text-label);
  line-height: 1.1;
}

h3, h4, h5, h6 {
  font-family: var(--zu-font-sans);
  font-weight: 700;
  color: var(--zu-text-label);
  line-height: 1.3;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.85rem, 4vw,  2.75rem); line-height: 1.15; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem;  }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--zu-text-label); }
em, i { font-style: italic; }
small { font-size: 0.875rem; }

blockquote {
  border-left: 3px solid var(--zu-purple);
  background: var(--zu-purple-light);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--zu-radius-md) var(--zu-radius-md) 0;
  font-family: var(--zu-font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--zu-purple-hover);
  line-height: 1.65;
}

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875rem;
}

code {
  background: var(--zu-surface-2);
  padding: 0.15rem 0.375rem;
  border-radius: 4px;
  color: var(--zu-purple-hover);
}

pre {
  background: var(--zu-dark);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--zu-radius-lg);
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code { background: none; color: inherit; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--zu-border);
  margin: 2rem 0;
}

/* ══════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════ */
.zu-container {
  max-width: var(--zu-max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.zu-container--narrow { max-width: var(--zu-content-w); }
.zu-container--wide   { max-width: 1440px; }

/* WordPress required classes */
.site        { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

.entry-content { max-width: var(--zu-content-w); }
.entry-content > * + * { margin-top: 1.25rem; }
.entry-content ul, .entry-content ol { margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: 0.4rem; }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--zu-purple);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--zu-radius-md) var(--zu-radius-md);
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Screen reader only */
.screen-reader-text,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════
   NAVIGATION
══════════════════════════════════════ */
.primary-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--zu-header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, .7);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--zu-dark);
  letter-spacing: -0.025em;
  text-decoration: none;
}
.nav-logo .logo-accent { color: var(--zu-purple); }

/* Primary nav links */
.primary-navigation ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.primary-navigation a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--zu-text-mid);
  border-radius: var(--zu-radius-sm);
  transition: color var(--zu-transition), background var(--zu-transition);
  text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a {
  color: var(--zu-purple);
  background: var(--zu-purple-light);
}

/* Mobile hamburger */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--zu-dark);
  border-radius: 2px;
  transition: all var(--zu-transition);
}

/* Mobile nav */
@media (max-width: 860px) {
  .primary-navigation,
  .nav-cta-wrap { display: none; }
  .menu-toggle  { display: flex; }

  .primary-navigation.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: var(--zu-header-h) 0 0;
    background: var(--zu-white);
    z-index: 800;
    padding: 2rem var(--zu-container-pad, 1.25rem);
    overflow-y: auto;
  }

  .primary-navigation.is-open ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .primary-navigation.is-open a {
    font-size: 1.125rem;
    padding: 0.75rem 1rem;
  }
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.zu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--zu-radius-md);
  font-family: var(--zu-font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--zu-transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.zu-btn--primary { background: var(--zu-purple); color: #fff; }
.zu-btn--primary:hover {
  background: var(--zu-purple-hover);
  transform: translateY(-2px);
  box-shadow: var(--zu-shadow-purple);
  color: #fff;
}

.zu-btn--outline {
  background: transparent;
  color: var(--zu-dark);
  border: 1.5px solid var(--zu-border);
}
.zu-btn--outline:hover { border-color: var(--zu-purple); color: var(--zu-purple); transform: translateY(-1px); }

.zu-btn--ghost-white {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px);
}
.zu-btn--ghost-white:hover { background: rgba(255, 255, 255, .22); transform: translateY(-1px); }

.zu-btn--sm  { padding: 0.5rem 1.125rem; font-size: 0.875rem; }
.zu-btn--lg  { padding: 0.9rem 2.25rem;  font-size: 1rem; }
.zu-btn--full { width: 100%; }

/* ══════════════════════════════════════
   POST / ENTRY STYLES
══════════════════════════════════════ */
.entry-header { margin-bottom: 2rem; }
.entry-title  { margin-bottom: 0.75rem; }
.entry-meta   { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--zu-text-muted); margin-bottom: 1.5rem; }
.entry-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--zu-border); font-size: 0.875rem; color: var(--zu-text-muted); }

.post-thumbnail {
  margin-bottom: 2rem;
  border-radius: var(--zu-radius-lg);
  overflow: hidden;
}
.post-thumbnail img { width: 100%; height: auto; display: block; }

.post-thumbnail--placeholder {
  aspect-ratio: 16 / 9;
  background: var(--zu-purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--zu-purple);
}

/* Archive card grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.post-card {
  border: 1.5px solid var(--zu-border);
  border-radius: var(--zu-radius-lg);
  overflow: hidden;
  background: var(--zu-white);
  transition: all var(--zu-transition);
}
.post-card:hover { box-shadow: var(--zu-shadow-lift); transform: translateY(-4px); border-color: rgba(124,58,237,.25); }
.post-card__body { padding: 1.5rem; }
.post-card__title { font-family: var(--zu-font-serif); font-size: 1.125rem; font-weight: 400; line-height: 1.3; margin-bottom: 0.625rem; }
.post-card__excerpt { font-size: 0.875rem; color: var(--zu-text-muted); line-height: 1.7; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.site-content-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.no-sidebar .site-content-wrap,
.template-full-width .site-content-wrap {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .site-content-wrap { grid-template-columns: 1fr; }
}

.widget { margin-bottom: 2rem; }
.widget-title { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--zu-text-muted); margin-bottom: 1rem; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer { background: var(--zu-deep-navy); color: rgba(255,255,255,.55); padding: clamp(3rem,7vw,5rem) 0 1.75rem; }

/* ══════════════════════════════════════
   BLOCK EDITOR ALIGNMENT
══════════════════════════════════════ */
.wp-block-group.alignfull,
.wp-block-cover.alignfull,
.wp-block-image.alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}

.wp-block-group.alignwide,
.wp-block-image.alignwide {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--zu-max-w);
}

/* ══════════════════════════════════════
   ICONS
══════════════════════════════════════ */
.zu-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ══════════════════════════════════════
   UTILITIES
══════════════════════════════════════ */
.fade-up { opacity: 0; transform: translateY(22px); transition: opacity .58s ease, transform .58s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

.text-purple  { color: var(--zu-purple) !important; }
.text-muted   { color: var(--zu-text-muted) !important; }
.text-center  { text-align: center !important; }
.font-serif   { font-family: var(--zu-font-serif) !important; }
.font-italic  { font-style: italic !important; }

/* Pagination */
.page-numbers { display: flex; align-items: center; gap: 0.375rem; justify-content: center; margin: 3rem 0; list-style: none; padding: 0; }
.page-numbers a, .page-numbers span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.75rem; border-radius: var(--zu-radius-md); font-size: 0.875rem; font-weight: 700; border: 1.5px solid var(--zu-border); color: var(--zu-text-mid); transition: all var(--zu-transition); }
.page-numbers a:hover { border-color: var(--zu-purple); color: var(--zu-purple); background: var(--zu-purple-light); }
.page-numbers .current { background: var(--zu-purple); color: #fff; border-color: var(--zu-purple); }
.page-numbers .dots { border: none; min-width: auto; }
