/*
Theme Name: MicroviaPCB B2B
Theme URI: https://microviapcb.com
Author: MicroviaPCB Team
Author URI: https://microviapcb.com
Description: Flat industrial B2B WordPress theme for Microvia PCB and HDI PCB engineering content, with DFM quick-check and cost estimate tools.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: microviapcb
Tags: two-columns, custom-menu, featured-images, translation-ready, block-styles
*/

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0b63ce;
  --brand-dark: #094c9e;
  --tint: #f2f7fd;
  --radius: 10px;
  --maxw: 1160px;
}

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

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-links { margin-top: 16px; font-size: 14px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.logo { text-decoration: none; font-weight: 700; color: #111; letter-spacing: .2px; }
.menu { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.menu a { text-decoration: none; color: #111; font-size: 14px; }
.menu a:hover,
.menu .current-menu-item > a { color: var(--brand); }

/* Layout blocks */
.site-main { padding: 28px 16px 8px; }

.card,
.single,
.page,
.tool-box,
.mv-cta,
.no-results,
.comments-area {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.entry-title { margin: 0 0 8px; font-size: 1.6rem; line-height: 1.3; }
.card .entry-title { font-size: 1.15rem; }
.card .entry-title a { text-decoration: none; }
.card .entry-title a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p,
.entry-content li { max-width: 72ch; }
.entry-content h2 { margin-top: 28px; font-size: 1.25rem; }
.entry-content h3 { margin-top: 22px; font-size: 1.05rem; }

.archive-header { margin: 0 0 16px; }
.archive-header h1 { margin: 0 0 4px; font-size: 1.5rem; }

/* Image set */
.mv-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.mv-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  margin: 0;
}
.mv-card img { display: block; width: 100%; }
.mv-card figcaption { padding: 8px 10px; color: var(--muted); font-size: 12px; }

/* Buttons and CTA */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--brand);
  background: none;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-ghost:hover { background: var(--tint); }

.mv-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mv-cta h3 { margin: 0; font-size: 1.1rem; width: 100%; }
.mv-cta p { margin: 0; flex: 1 1 260px; color: var(--muted); }

/* Tools */
.tool-box h2 { margin-top: 0; font-size: 1.15rem; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.tool-grid label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
input,
select,
textarea {
  margin-top: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.tool-grid .btn { align-self: end; }
.result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--tint);
  border: 1px solid #dbeafe;
  font-size: 15px;
}
.result:empty { display: none; }
.result dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.result dt { color: var(--muted); }
.result dd { margin: 0; }

/* Search form */
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form label { flex: 1 1 220px; }
.search-form input[type="search"] { width: 100%; margin-top: 0; }

/* Pagination and post navigation */
.pagination { margin: 8px 0 24px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }

.post-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.post-nav a { font-size: 14px; }

/* Comments */
.comments-area ol { list-style: none; padding-left: 0; }
.comments-area .children { list-style: none; padding-left: 20px; }
.comment-body { border-bottom: 1px solid var(--line); padding: 12px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 24px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px 16px;
}
.footer-grid h4 { margin: 0 0 8px; font-size: 14px; }
.footer-grid p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* Admin-side seeding notice reuse */
.mv-seed-progress { font-weight: 600; }

@media (max-width: 640px) {
  .site-header { position: static; }
  .nav-wrap { min-height: 0; padding: 10px 0; }
  .entry-title { font-size: 1.35rem; }
  .card, .single, .page, .tool-box, .mv-cta { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
