/* ─── Engineering Toolkit Pro — Main Compiled CSS ─────────────────── */

/* Reset & Layout */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: var(--border);
}

/* ─── Light Mode (Default Variables) ──────────────────────────────── */
:root {
  --background: #F8FAFC;
  --foreground: #0F172A;
  --card: #FFFFFF;
  --card-foreground: #0F172A;
  --popover: #FFFFFF;
  --popover-foreground: #0F172A;
  --primary: #2563EB;
  --primary-foreground: #FFFFFF;
  --secondary: #F1F5F9;
  --secondary-foreground: #0F172A;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #F1F5F9;
  --accent-foreground: #0F172A;
  --destructive: #EF4444;
  --border: #E2E8F0;
  --input: #CBD5E1;
  --ring: #2563EB;
  --grid-line: rgba(0, 0, 0, 0.03);
}

/* ─── Dark Mode Overrides (when .dark active) ──────────────────────── */
.dark {
  --background: #0B0F17;
  --foreground: #F1F5F9;
  --card: #0F172A;
  --card-foreground: #F1F5F9;
  --popover: #0F172A;
  --popover-foreground: #F1F5F9;
  --primary: #3B82F6;
  --primary-foreground: #FFFFFF;
  --secondary: #1E293B;
  --secondary-foreground: #F1F5F9;
  --muted: #1E293B;
  --muted-foreground: #94A3B8;
  --accent: #1E293B;
  --accent-foreground: #F1F5F9;
  --destructive: #EF4444;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.15);
  --ring: #3B82F6;
  --grid-line: rgba(255, 255, 255, 0.02);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-align: left !important;
}

/* Glassmorphism & Cards */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.04);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}

.card-content {
  padding: 1.5rem;
  text-align: left;
}

/* ═══════════════════════════════════════════════════════════════════
   2-COLUMN GRID LAYOUT (Main Content + 320px Sidebar)
   Guarantees Sidebar sits on the right on Desktop without wrapping
   ═══════════════════════════════════════════════════════════════════ */

.site-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  align-items: start;
}

@media (min-width: 1024px) {
  .site-content-grid {
    grid-template-columns: minmax(0, 1fr) 320px !important;
    gap: 2.5rem !important;
  }
}

#secondary.sidebar,
aside.sidebar {
  width: 100% !important;
  max-width: 100% !important;
  position: static !important;
  overflow: visible !important;
  text-align: left;
}

@media (min-width: 1024px) {
  #secondary.sidebar,
  aside.sidebar {
    width: 320px !important;
    max-width: 320px !important;
  }
}

/* Engineering Grid Background */
.engineering-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Form Inputs */
.form-input, .form-select, textarea.form-input {
  width: 100%;
  height: 2.375rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--card);
  border: 1px solid var(--input);
  border-radius: 0.5rem;
  color: var(--foreground);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  text-align: left;
}

textarea.form-input {
  height: auto;
}

.form-input:focus, .form-select:focus, textarea.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Result Cards */
.result-card {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.result-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Tabs UI */
.tabs-list {
  display: inline-flex;
  height: 2.25rem;
  align-items: center;
  border-radius: 0.5rem;
  background-color: var(--secondary);
  padding: 0.25rem;
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  background: transparent;
  cursor: pointer;
}

.tab-btn.active {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   WORDPRESS POST & ARTICLE CONTENT TYPOGRAPHY (.entry-content)
   High-specificity rules that guarantee proper left alignment, gaps, and tables
   ═══════════════════════════════════════════════════════════════════ */

.entry-content,
.post-content,
.article-content,
.prose,
article.single-post-article {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--foreground);
  position: relative !important;
  display: block !important;
  width: 100% !important;
  overflow: visible !important;
  text-align: left !important;
}

/* Paragraphs & Paragraph Gaps */
.entry-content p,
.entry-content .wp-block-paragraph,
.post-content p,
.prose p {
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.85 !important;
  font-size: 1.0625rem !important;
  color: var(--foreground) !important;
  opacity: 0.94;
  display: block !important;
  clear: none;
  text-align: left !important;
}

/* Heading Sizes, Weights & Gaps */
.entry-content h1,
.entry-content .wp-block-heading:is(h1),
.prose h1 {
  font-size: 2.25rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  margin-top: 2.75rem !important;
  margin-bottom: 1.25rem !important;
  color: var(--foreground) !important;
  letter-spacing: -0.025em !important;
  text-align: left !important;
}

.entry-content h2,
.entry-content .wp-block-heading:is(h2),
.prose h2 {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin-top: 2.75rem !important;
  margin-bottom: 1.15rem !important;
  color: var(--foreground) !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0.5rem !important;
  letter-spacing: -0.02em !important;
  text-align: left !important;
}

.entry-content h3,
.entry-content .wp-block-heading:is(h3),
.prose h3 {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin-top: 2.25rem !important;
  margin-bottom: 1rem !important;
  color: var(--foreground) !important;
  letter-spacing: -0.015em !important;
  text-align: left !important;
}

.entry-content h4,
.entry-content .wp-block-heading:is(h4),
.prose h4 {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.75rem !important;
  color: var(--foreground) !important;
  text-align: left !important;
}

/* Links */
.entry-content a,
.prose a {
  color: var(--primary) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  font-weight: 500 !important;
}

.entry-content a:hover,
.prose a:hover {
  opacity: 0.8 !important;
}

/* Bold & Italic */
.entry-content strong,
.entry-content b,
.prose strong,
.prose b {
  font-weight: 700 !important;
  color: var(--foreground) !important;
}

.entry-content em,
.entry-content i,
.prose em,
.prose i {
  font-style: italic !important;
}

/* Lists with clear indentations */
.entry-content ul,
.entry-content .wp-block-list:is(ul),
.prose ul {
  list-style-type: disc !important;
  margin-top: 0.75rem !important;
  margin-bottom: 1.75rem !important;
  padding-left: 2rem !important;
  text-align: left !important;
}

.entry-content ol,
.entry-content .wp-block-list:is(ol),
.prose ol {
  list-style-type: decimal !important;
  margin-top: 0.75rem !important;
  margin-bottom: 1.75rem !important;
  padding-left: 2rem !important;
  text-align: left !important;
}

.entry-content li,
.prose li {
  margin-bottom: 0.65rem !important;
  line-height: 1.75 !important;
  color: var(--foreground) !important;
  text-align: left !important;
}

/* Blockquotes */
.entry-content blockquote,
.entry-content .wp-block-quote,
.prose blockquote {
  border-left: 4px solid var(--primary) !important;
  background-color: var(--secondary) !important;
  padding: 1.25rem 1.75rem !important;
  margin: 2rem 0 !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
  font-style: italic !important;
  color: var(--foreground) !important;
  text-align: left !important;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Code & Preformatted */
.entry-content code,
.prose code {
  font-family: 'JetBrains Mono', monospace !important;
  background-color: var(--secondary) !important;
  color: var(--primary) !important;
  padding: 0.2rem 0.45rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.875em !important;
  border: 1px solid var(--border) !important;
}

.entry-content pre,
.entry-content .wp-block-code pre,
.prose pre {
  font-family: 'JetBrains Mono', monospace !important;
  background-color: var(--secondary) !important;
  color: var(--foreground) !important;
  padding: 1.25rem !important;
  border-radius: 0.5rem !important;
  overflow-x: auto !important;
  margin: 1.75rem 0 !important;
  border: 1px solid var(--border) !important;
  font-size: 0.875rem !important;
  line-height: 1.65 !important;
  text-align: left !important;
}

/* Tables — Rich Gutenberg & HTML Table Styling */
.entry-content table,
.entry-content .wp-block-table table,
.wp-block-table table,
.prose table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-top: 1.75rem !important;
  margin-bottom: 2rem !important;
  font-size: 0.9375rem !important;
  display: table !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  text-align: left !important;
}

.entry-content th,
.entry-content td,
.entry-content .wp-block-table th,
.entry-content .wp-block-table td,
.prose th,
.prose td {
  padding: 0.875rem 1.15rem !important;
  border: 1px solid var(--border) !important;
  text-align: left !important;
}

.entry-content th,
.entry-content .wp-block-table th,
.prose th {
  background-color: var(--secondary) !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
  text-align: left !important;
}

.entry-content tr:nth-child(even) td,
.prose tr:nth-child(even) td {
  background-color: rgba(0, 0, 0, 0.02) !important;
}
.dark .entry-content tr:nth-child(even) td,
.dark .prose tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Images & Media */
.entry-content img,
.entry-content .wp-block-image img,
.prose img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MEDIAVINE, GROW & JOURNEY AD PLACEMENT STYLES
   (Strictly scoped to ad units only — never affects body or articles)
   ═══════════════════════════════════════════════════════════════════ */

.mediavine-ad,
.mv-ad-box,
.mv-in-content,
.mediavine-ad-container,
.sidebar-ad-slot,
ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 2rem auto !important;
  text-align: center !important;
  clear: both !important;
  overflow: visible !important;
  min-height: 50px;
  position: relative !important;
  z-index: 10 !important;
}

/* Pagination */
.pagination-nav .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  margin: 0 0.25rem;
}

.pagination-nav .page-numbers:hover,
.pagination-nav .page-numbers.current {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Animations */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spinSlow 12s linear infinite;
}
