/* AIHowto 1.0.0 — Mobile-first editorial stylesheet (system fonts only, zero frameworks) */
:root {
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --accent: #2563eb;
  --green: #0e7c6b;
  --amber: #b45309;
  --danger: #dc2626;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
img, svg, video, iframe { max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 0; }
h1 { font-size: 28px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Accessibility & Progress Bar */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { left: 12px; text-decoration: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 1000; }
body.admin-bar .progress-bar, body.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }

/* Sticky White Header */
.site-header { position: sticky; top: 0; z-index: 900; background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.site-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-logo img { max-height: 42px; width: auto; display: block; }
.site-identity { display: flex; flex-direction: column; }
.site-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.site-title:hover { color: var(--accent); text-decoration: none; }
.site-tagline { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.menu-toggle { display: inline-flex; align-items: center; gap: 7px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font: 600 14px inherit; cursor: pointer; }
.menu-toggle-bars { position: relative; width: 16px; height: 2px; background: var(--ink); display: inline-block; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: var(--ink); }
.menu-toggle-bars::before { top: -5px; }
.menu-toggle-bars::after { top: 5px; }

.header-panel { display: none; width: 100%; flex-direction: column; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.header-panel.open { display: flex; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.primary-nav a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 15px; font-weight: 600; color: var(--ink); }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { background: #eff6ff; color: var(--accent); text-decoration: none; }

.header-search { display: flex; gap: 6px; width: 100%; }
.header-search input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); }
.header-search button, .hero-search button, .inline-search button { padding: 8px 15px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 600 15px inherit; cursor: pointer; white-space: nowrap; }
.header-search button:hover, .hero-search button:hover, .inline-search button:hover { filter: brightness(0.93); }

/* Homepage Hero & 3 Pillars */
.hero { background: var(--ink); color: #fff; padding: 44px 0 40px; }
.hero h1 { color: #fff; font-size: 30px; line-height: 1.18; margin: 0 0 12px; max-width: 680px; }
.hero-lead { color: #cbd5e1; font-size: 17px; line-height: 1.6; max-width: 640px; margin: 0 0 22px; }
.hero-search { display: flex; flex-direction: column; gap: 10px; max-width: 580px; }
.hero-search input { width: 100%; padding: 13px 16px; border: 1px solid #334155; border-radius: 9px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.hero-search button { padding: 13px 22px; border-radius: 9px; font-size: 16px; }

.pillars-section { padding: 28px 0 8px; }
.pillars { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pillar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.pillar-title { font-size: 19px; margin: 0 0 8px; }
.pillar-title a { color: var(--ink); }
.pillar-title a:hover { color: var(--accent); text-decoration: none; }
.pillar-desc { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 14px; flex: 1; }
.pillar-link { font-size: 15px; font-weight: 700; color: var(--accent); align-self: flex-start; }

/* Card Grids, Empty States & Pagination */
.latest-section, .archive-section, .search-section, .error-404-section { padding: 28px 0 40px; }
.section-title, .page-heading { margin: 0 0 18px; }
.archive-header { margin-bottom: 24px; max-width: 720px; }
.archive-description, .search-results-count { color: var(--muted); font-size: 16px; margin: 6px 0 0; }
.search-query { color: var(--accent); }

.post-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-thumb { display: block; background: #e2e8f0; aspect-ratio: 16 / 9; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cat-chip { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); align-self: flex-start; line-height: 1.3; }
.card-title { font-size: 18.5px; line-height: 1.35; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 13.5px; color: var(--muted); margin-top: auto; padding-top: 6px; }

.empty-state, .error-404-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; max-width: 720px; }
.empty-state p:first-child { margin-top: 0; }
.empty-state p:last-child { margin-bottom: 0; }
.error-404-desc { color: var(--muted); margin: 0 0 20px; }
.inline-search { display: flex; flex-wrap: wrap; gap: 8px; max-width: 520px; margin-top: 14px; }
.inline-search input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; }
.error-404-home { margin: 20px 0 0; }
.btn-back-home { font-weight: 600; }

.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 14.5px; font-weight: 600; }
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Single Post, TOC & Reading Layout */
.layout { display: grid; grid-template-columns: 1fr; gap: 32px; padding-top: 28px; padding-bottom: 44px; align-items: start; }
.content-col { min-width: 0; max-width: 720px; width: 100%; }

.breadcrumb { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { margin: 0 6px; color: #94a3b8; }

.entry-header h1 { margin: 0 0 12px; }
.entry-meta { font-size: 14.5px; color: var(--muted); margin: 0 0 22px; }
.entry-author { color: var(--ink); font-weight: 600; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.entry-thumb figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

.toc { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 26px; }
.toc.is-empty, .toc[hidden] { display: none; }
.toc-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); margin: 0 0 10px; }
.toc-list { margin: 0; padding-left: 20px; font-size: 15.5px; line-height: 1.55; }
.toc-list li { margin: 6px 0; }
.toc-list a { font-weight: 500; }

.entry-content { font-size: 17px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content table, .entry-content figure { margin: 0 0 20px; }
.entry-content li { margin-bottom: 6px; }
.entry-content h2 { margin: 38px 0 14px; padding-top: 6px; scroll-margin-top: 88px; }
.entry-content h3 { margin: 28px 0 10px; scroll-margin-top: 88px; }
.entry-content blockquote { margin: 24px 0; padding: 16px 20px; border-left: 4px solid var(--accent); background: #eff6ff; border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9em; background: #e2e8f0; color: var(--ink); padding: 2px 6px; border-radius: 5px; }
.entry-content pre { background: var(--ink); color: #f1f5f9; padding: 18px 20px; border-radius: var(--radius); overflow-x: auto; margin: 22px 0; font-size: 14.5px; line-height: 1.6; }
.entry-content pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.entry-content table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); font-size: 15.5px; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: #f1f5f9; color: var(--ink); font-weight: 700; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* Authoring Callout Blocks (.aihowto-prompt, .aihowto-tip, .aihowto-warning) */
.aihowto-prompt { background: #f0fdf4; border: 1px solid #a7f3d0; border-left: 4px solid var(--green); border-radius: var(--radius); padding: 16px 18px; margin: 24px 0; color: var(--ink); }
.aihowto-prompt:not(.is-ready)::before { content: "COPY THIS PROMPT"; display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--green); margin-bottom: 10px; }
.aihowto-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #bbf7d0; }
.aihowto-prompt-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }
.copy-btn { background: #fff; color: var(--green); border: 1px solid #86efac; border-radius: 6px; padding: 5px 12px; font: 700 13px/1.3 inherit; cursor: pointer; }
.copy-btn:hover, .copy-btn.is-copied { background: var(--green); border-color: var(--green); color: #fff; }
.aihowto-prompt-body p:last-child, .aihowto-prompt > p:last-child, .aihowto-tip p:last-child, .aihowto-warning p:last-child { margin-bottom: 0; }

.aihowto-tip { background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid var(--amber); border-radius: var(--radius); padding: 15px 18px; margin: 22px 0; color: var(--ink); }
.aihowto-tip strong:first-child { color: var(--amber); }
.aihowto-warning { background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid var(--danger); border-radius: var(--radius); padding: 15px 18px; margin: 22px 0; color: var(--ink); }
.aihowto-warning strong:first-child { color: #b91c1c; }

/* AdSense Slots (collapse cleanly when empty) */
.ad-slot { margin: 26px 0; text-align: center; overflow: hidden; }
.sidebar .ad-slot { margin: 0 0 18px; }
.ad-slot:empty { display: none; }

/* Author Box, Post Nav, Related & Comments */
.author-box, .related-guides, .comments-area { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-top: 28px; }
.author-box { display: flex; gap: 16px; align-items: flex-start; }
.author-avatar img { border-radius: 50%; display: block; }
.author-name { font-size: 18px; margin: 0 0 6px; }
.author-bio { font-size: 15px; color: var(--muted); margin: 0; line-height: 1.6; }

.post-nav { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
.post-nav-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.post-nav-item:empty { display: none; }
.post-nav-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.post-nav-item a { font-weight: 600; font-size: 15.5px; }

.related-guides h2, .comments-title { font-size: 20px; margin: 0 0 14px; }
.related-list, .popular-list { list-style: none; margin: 0; padding: 0; }
.related-list li, .popular-list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.related-list li:first-child, .popular-list li:first-child { padding-top: 0; border-top: 0; }
.related-list a, .popular-list a { font-weight: 600; color: var(--ink); line-height: 1.4; }
.related-list a:hover, .popular-list a:hover { color: var(--accent); }
.related-meta, .popular-meta { font-size: 13px; color: var(--muted); }

.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.comment-meta { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.comment-author { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.comment-author img { border-radius: 50%; }
.comment-respond label { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15.5px; }
.comment-respond .form-submit input[type="submit"] { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; font: 600 15px inherit; cursor: pointer; }

/* Sidebar & Footer */
.sidebar { display: grid; grid-template-columns: 1fr; gap: 18px; }
.sidebar .widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.widget-title { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { margin-bottom: 8px; font-size: 15px; line-height: 1.45; }
.sidebar .widget li:last-child { margin-bottom: 0; }

.site-footer { background: var(--ink); color: #cbd5e1; padding: 44px 0 28px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.footer-title { display: inline-block; font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-title:hover { color: #fff; }
.footer-desc { margin: 0; font-size: 15px; color: #94a3b8; max-width: 440px; line-height: 1.6; }
.site-footer .widget-title { color: #fff; font-size: 15px; margin-bottom: 10px; }
.site-footer .widget ul, .footer-menu { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { margin-bottom: 7px; font-size: 14.5px; }
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: #94a3b8; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 16px; }
.copyright { margin: 0; }

.aligncenter { display: block; margin: 20px auto; }
.alignleft { float: left; margin: 6px 20px 14px 0; }
.alignright { float: right; margin: 6px 0 14px 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* Breakpoint 1: > 720px */
@media (min-width: 721px) {
  body, .entry-content { font-size: 18px; line-height: 1.75; }
  h1, .hero h1, .entry-header h1, .page-heading { font-size: 34px; }
  h2, .section-title, .entry-content h2 { font-size: 26px; }
  h3, .entry-content h3 { font-size: 21px; }

  .menu-toggle { display: none; }
  .header-panel { display: flex; width: auto; flex: 1; flex-direction: row; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 0; border-top: 0; }
  .primary-nav ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .header-search { width: auto; }
  .header-search input { width: 185px; flex: none; }

  .hero { padding: 58px 0 52px; }
  .hero-search { flex-direction: row; }
  .hero-search input { flex: 1; }

  .pillars, .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-nav-next { text-align: right; }

  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .ad-slot { grid-column: 1 / -1; margin-bottom: 0; }
  .footer-grid.has-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
}

/* Breakpoint 2: > 1024px */
@media (min-width: 1025px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid.has-widgets { grid-template-columns: 1.7fr 1fr 1fr 1fr; }
}
