/*
Theme Name: Naopo Lab
Theme URI: https://naoyoshi.com/
Author: なおぽラボ
Description: WordPress・Mac・PCの実用情報に特化した軽量オリジナルテーマ。
Version: 0.2.6
Text Domain: naopo-lab
*/

:root {
  --ink: #13233a;
  --muted: #617089;
  --paper: #f3f6fb;
  --surface: #ffffff;
  --line: #dce4ef;
  --brand: #2563eb;
  --brand-dark: #1749b0;
  --accent: #ffb000;
  --cyan: #06b6d4;
  --radius: 14px;
  --shadow: 0 14px 34px rgba(30, 64, 175, .1);
  --content: 760px;
  --wide: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(37, 99, 235, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-dark); text-underline-offset: .18em; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto !important; width: auto; height: auto; padding: .75rem 1rem;
  margin: .5rem; background: #fff; z-index: 99999;
}
.site-shell { width: min(calc(100% - 32px), var(--wide)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243, 246, 251, .94);
  border-bottom: 1px solid rgba(220, 228, 239, .95);
  backdrop-filter: blur(14px);
}
.admin-bar .site-header { top: 32px; }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.custom-logo { display: block; max-height: 44px; width: auto; }
.site-title { margin: 0; font-size: 1.28rem; line-height: 1.2; letter-spacing: .02em; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-title a::before { content: "N"; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px; color: #fff; background: linear-gradient(145deg, var(--brand), #4f8cff); border-radius: 7px; box-shadow: 4px 4px 0 #b9d8ff; font-weight: 900; }
.site-description { margin: 2px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.primary-nav ul { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { color: var(--ink); font-size: .92rem; font-weight: 700; text-decoration: none; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--brand); }
.menu-toggle { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 11px; color: var(--ink); cursor: pointer; }

.hero { padding: 72px 0 48px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 36px; align-items: stretch; }
.hero-main { position: relative; overflow: hidden; padding: clamp(30px, 5vw, 64px); border: 1px solid #294c7b; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #0b1f3a 0%, #153a67 60%, #1f5ca6 100%); box-shadow: 10px 10px 0 #d4e6ff; }
.hero-main::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 28px 28px; }
.hero-main::after { content: ""; position: absolute; right: -90px; top: -110px; width: 300px; height: 300px; border: 54px solid rgba(6,182,212,.22); border-radius: 50%; }
.hero-main > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 14px; color: var(--brand); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.hero-main .eyebrow { color: #7dd3fc; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.18; letter-spacing: -.035em; }
.hero-copy { max-width: 650px; margin: 20px 0 0; color: #dcecff; font-size: clamp(1rem, 2vw, 1.16rem); }
.hero-side { position: relative; display: grid; align-content: center; padding: 32px; border: 1px solid #c9d7ea; border-top: 5px solid var(--accent); border-radius: 14px; background: var(--surface); box-shadow: 7px 7px 0 #e1e9f4; }
.hero-side::before { content: "LAB NOTE 01"; position: absolute; top: 16px; right: 18px; color: #8ba0bc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .66rem; letter-spacing: .1em; }
.hero-side strong { display: block; margin-bottom: 12px; color: var(--brand-dark); font-size: 1.15rem; }
.hero-side p { margin: 0; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border-radius: 999px; font-weight: 800; text-decoration: none; }
.button-primary { color: #12213a; background: var(--accent); box-shadow: 3px 3px 0 #895f00; }
.button-primary:hover { color: var(--brand); }
.button-secondary { color: #fff; border: 1px solid rgba(255,255,255,.55); }
.button-secondary:hover { color: #fff; background: rgba(255,255,255,.1); }

.section { padding: 34px 0 62px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; }
.section-heading p { margin: 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.category-card { display: block; min-height: 156px; padding: 24px; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.category-card:nth-child(2) { border-top-color: var(--cyan); }
.category-card:nth-child(3) { border-top-color: var(--accent); }
.category-card:nth-child(4) { border-top-color: #8b5cf6; }
.category-card:hover { transform: translateY(-3px); color: var(--ink); border-color: #9bbcf3; box-shadow: var(--shadow); }
.category-card span { color: var(--brand); font-size: .8rem; font-weight: 800; }
.category-card h3 { margin: 12px 0 4px; font-size: 1.18rem; }
.category-card p { margin: 0; color: var(--muted); font-size: .86rem; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #dbeafe, #cffafe); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.post-card:hover .post-card-media img { transform: scale(1.025); }
.post-card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand-dark); font-size: 2.2rem; font-weight: 900; }
.post-card-body { padding: 20px; }
.post-card-meta, .entry-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .78rem; }
.post-card-category { color: var(--brand); font-weight: 800; }
.post-card h2, .post-card h3 { margin: 10px 0 8px; font-size: 1.08rem; line-height: 1.48; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--brand); }
.post-card-excerpt { margin: 0; color: var(--muted); font-size: .9rem; }

.content-layout { display: block; max-width: var(--content); padding: 52px 0 72px; }
.entry-card { padding: clamp(24px, 5vw, 52px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.entry-header { margin-bottom: 34px; }
.entry-title { margin: 10px 0 14px; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.35; letter-spacing: -.025em; }
.entry-thumbnail { margin: 0 0 34px; overflow: hidden; border-radius: 16px; }
.entry-content { overflow-wrap: anywhere; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin: 2.4em 0 .9em; padding: .7em .85em; border-left: 5px solid var(--brand); border-radius: 0 10px 10px 0; background: #eaf2ff; font-size: 1.5rem; line-height: 1.45; }
.entry-content h3 { margin: 2em 0 .75em; padding-bottom: .45em; border-bottom: 2px solid var(--line); font-size: 1.24rem; line-height: 1.5; }
.entry-content h4 { margin-top: 1.8em; font-size: 1.08rem; }
.entry-content p, .entry-content ul, .entry-content ol { margin-top: 0; margin-bottom: 1.45em; }
.entry-content li + li { margin-top: .35em; }
.entry-content blockquote { margin: 1.7em 0; padding: 18px 22px; color: #44526a; border-left: 4px solid var(--accent); background: #fff7df; }
.entry-content pre { overflow: auto; padding: 18px; color: #eaf3ff; background: #101d31; border-radius: 10px; }
.entry-content code { padding: .12em .35em; background: #eaf0f8; border-radius: 5px; }
.entry-content pre code { padding: 0; background: transparent; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: #eaf2ff; }
.entry-content .wp-block-image img { border-radius: 12px; }
.entry-content h2[id], .entry-content h3[id], .entry-content h4[id] { scroll-margin-top: 100px; }
.naopo-toc { margin: 2rem 0; padding: 20px 24px; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 12px; background: #f8fbff; }
.naopo-toc summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.naopo-toc-list { margin: 16px 0 0; padding: 0; list-style: none; }
.naopo-toc-list li { margin: .55rem 0; }
.naopo-toc-list .toc-level-3 { padding-left: 1.25rem; }
.naopo-toc-list .toc-level-4 { padding-left: 2.5rem; font-size: .94em; }
.naopo-toc-list a { color: var(--ink); text-decoration: none; }
.naopo-toc-list a:hover, .naopo-toc-list a:focus-visible { color: var(--brand); text-decoration: underline; }
.entry-footer { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { padding: 4px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; text-decoration: none; }

.widget { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.widget-title { margin: 0 0 14px; font-size: 1rem; }
.widget ul { margin: 0; padding-left: 1.2em; }
.profile-card p { margin: 0; color: var(--muted); font-size: .88rem; }

.archive-header { padding: 52px 0 20px; }
.archive-header h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.archive-description { color: var(--muted); }
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span { min-width: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; text-decoration: none; }
.pagination .current { color: #fff; border-color: var(--brand); background: var(--brand); }
.breadcrumbs { margin: 0 0 18px; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: inherit; }
.post-navigation { margin-top: 24px; }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.post-navigation a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; }
.nav-next { text-align: right; }
.comments-area { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

.site-footer { padding: 44px 0 26px; color: #dbe8f6; background: #0d1b2f; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: start; }
.footer-title { margin: 0 0 8px; color: #fff; font-size: 1.18rem; }
.footer-copy { max-width: 560px; margin: 0; color: #aebfd6; font-size: .88rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; margin: 0; padding: 0; list-style: none; }
.footer-nav a { color: #dbe8f6; font-size: .85rem; text-decoration: none; }
.copyright { margin: 30px 0 0; padding-top: 20px; color: #8399b5; border-top: 1px solid rgba(255,255,255,.1); font-size: .76rem; }
.naopo-ad { min-height: 120px; margin: 30px 0; overflow: hidden; text-align: center; }
.naopo-ad__label { margin: 0 0 6px; color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.empty-state { padding: 44px; border: 1px dashed #bdc9c5; border-radius: var(--radius); background: rgba(255,255,255,.55); text-align: center; }

@media (max-width: 900px) {
  .admin-bar .site-header { top: 46px; }
  .menu-toggle { display: inline-flex; }
  .primary-nav { position: absolute; inset: 72px 16px auto; display: none; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 6px; }
  .primary-nav a { display: block; padding: 9px 10px; }
  .hero-grid, .footer-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-nav ul { justify-content: flex-start; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .site-shell { width: min(calc(100% - 22px), var(--wide)); }
  .site-description { display: none; }
  .hero { padding-top: 34px; }
  .hero-main, .hero-side { border-radius: 20px; }
  .category-grid, .post-grid { grid-template-columns: 1fr; }
  .entry-card { border-radius: 18px; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .nav-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
