/*
Theme Name: KONPEITO
Theme URI: https://example.com/konpeito
Author: 閣下
Description: 2026年のAIO（AI Overviews）対策とSEOを標準搭載した、洋菓子店の包み紙みたいなかわいい日本語ブログテーマ。JSON-LD構造化データ自動出力、llms.txt自動生成、目次自動生成、Core Web Vitals最適化（jQuery不使用・全JS defer）を備える。
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: konpeito
Tags: blog, news, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-patterns
*/

/* =========================================================
   0. Tokens — いちご × クリーム × ココア
   ========================================================= */
:root {
  --berry: #d13d68;          /* いちご */
  --berry-deep: #b83a5e;
  --berry-pale: #fdeef3;
  --cream: #fff9f3;          /* クリーム地 */
  --ink: #46342e;            /* ココア */
  --ink-soft: #7a635b;
  --ink-faint: #a89388;
  --line: #f0dfd4;
  --radius: 14px;
  --radius-s: 8px;
  --shadow: 0 3px 14px rgba(209, 61, 104, 0.10);
  --shadow-lift: 0 10px 28px rgba(209, 61, 104, 0.18);
  --font-display: "Kiwi Maru", "Hiragino Maru Gothic ProN", "Yu Gothic", serif;
  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --w-content: 720px;
  --w-wide: 1120px;
}

/* =========================================================
   1. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.95;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--berry); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--berry-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--ink);
}

:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -100%;
  background: var(--berry); color: #fff; padding: 0.5rem 1.2rem;
  border-radius: 999px; z-index: 100;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* =========================================================
   2. Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 249, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--line);
}
.site-header__inner {
  max-width: var(--w-wide); margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
  padding: 0 1.25rem; height: 68px;
}
.site-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.site-brand__mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--berry); color: #fff;
  border-radius: 50% 50% 50% 12%;   /* こんぺいとうのしずく型 */
  transform: rotate(-8deg);
  font-family: var(--font-display); font-size: 1.15rem;
}
.site-brand__name {
  font-family: var(--font-display); font-size: 1.3rem;
  color: var(--ink); letter-spacing: 0.06em;
}
.custom-logo { width: auto; height: 38px; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 0.3rem 0.2rem;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--berry); }
.site-nav .current-menu-item > a {
  text-decoration: underline wavy var(--berry);
  text-underline-offset: 6px; text-decoration-thickness: 1.5px;
}

.nav-toggle {
  display: none; margin-left: auto;
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1rem; cursor: pointer; color: var(--ink);
  font-family: inherit; font-size: 0.85rem;
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 68px;
    background: var(--cream); border-bottom: 2px dashed var(--line);
    padding: 1rem 1.25rem 1.5rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.25rem; }
  .site-nav a { display: block; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
}

/* =========================================================
   3. Layout
   ========================================================= */
.site-main { max-width: var(--w-wide); margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
.content-narrow { max-width: var(--w-content); margin-left: auto; margin-right: auto; }

/* =========================================================
   4. Front hero — 水玉の包み紙カード
   ========================================================= */
.hero {
  max-width: var(--w-wide);
  margin: 2rem auto 0;
  padding: 3.5rem 2rem 3rem;
  width: calc(100% - 2.5rem);
  text-align: center;
  background:
    radial-gradient(rgba(209, 61, 104, 0.10) 2.5px, transparent 3px) 0 0 / 26px 26px,
    #fff;
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) * 1.6);
}
.hero__title {
  font-size: clamp(1.8rem, 4.2vw, 2.7rem);
  margin: 0 0 1rem;
}
.hero__title .accent {
  color: var(--berry);
  text-decoration: underline wavy var(--berry-pale);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}
.hero__lede { color: var(--ink-soft); max-width: 34em; margin: 0 auto; font-size: 1rem; }
.hero__rule {
  width: 90px; height: 8px; border: none; margin: 1.8rem auto 0;
  background: radial-gradient(var(--berry) 3px, transparent 3.5px) 0 0 / 18px 8px repeat-x;
}

/* =========================================================
   5. Article cards
   ========================================================= */
.post-grid {
  display: grid; gap: 1.75rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-4px) rotate(-0.4deg);
  border-color: var(--berry-pale);
}
.card__thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--berry-pale); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card__cat {
  align-self: flex-start;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
  color: #fff; background: var(--berry);
  border-radius: 999px; padding: 0.15rem 0.8rem;
  text-decoration: none;
  transform: rotate(-2deg);       /* ステッカー風 */
}
.card__cat:hover { color: #fff; background: var(--berry-deep); }
.card__title { font-size: 1.06rem; margin: 0; line-height: 1.65; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--berry); }
.card__meta { margin-top: auto; font-size: 0.8rem; color: var(--ink-faint); display: flex; gap: 1em; }

.section-title {
  font-size: 1.35rem; margin: 0 0 1.6rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section-title::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--berry);
  border-radius: 50% 50% 50% 12%;
  transform: rotate(-8deg);
}
.section-title::after {
  content: ""; flex: 1; height: 4px;
  background: radial-gradient(var(--line) 2px, transparent 2.5px) 0 50% / 12px 4px repeat-x;
}

/* =========================================================
   6. Single article
   ========================================================= */
.entry-header { margin-bottom: 2rem; }
.entry-title { font-size: clamp(1.45rem, 3.2vw, 2.05rem); margin: 0.6rem 0 1rem; }
.entry-meta { font-size: 0.85rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 1.25em; }
.entry-meta time { color: inherit; }
.entry-thumb { margin: 1.75rem 0; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); }

.entry-content { font-size: 1.0625rem; }
.entry-content > * { margin-top: 1.6em; margin-bottom: 0; }
.entry-content h2 {
  font-size: 1.4rem; margin-top: 2.8em;
  padding: 0.55em 1.1em;
  background: var(--berry-pale);
  border-radius: 999px;
  display: flex; align-items: center; gap: 0.6em;
}
.entry-content h2::before {
  content: ""; width: 12px; height: 12px; flex: none;
  background: var(--berry); border-radius: 50% 50% 50% 12%;
  transform: rotate(-8deg);
}
.entry-content h3 {
  font-size: 1.18rem; margin-top: 2.2em;
  padding-bottom: 0.3em;
  text-decoration: underline wavy var(--berry-pale);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}
.entry-content blockquote {
  margin: 1.6em 0; padding: 1.1em 1.5em;
  background: #fff; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-soft);
}
.entry-content table { border-collapse: separate; border-spacing: 0; width: 100%; border: 2px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 0.6em 0.9em; }
.entry-content th { background: var(--berry-pale); font-weight: 700; }
.entry-content tr:last-child td, .entry-content tr:last-child th { border-bottom: none; }
.entry-content code { background: var(--berry-pale); padding: 0.15em 0.45em; border-radius: 6px; font-size: 0.92em; }
.entry-content pre { background: #4a3a34; color: #fdf3ec; padding: 1.2em 1.4em; border-radius: var(--radius); overflow-x: auto; }
.entry-content pre code { background: none; padding: 0; }

/* 結論ファースト（AIO要約）ボックス */
.konpeito-summary {
  background: #fff;
  border: 2px solid var(--berry);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.4rem;
  box-shadow: var(--shadow);
}
.konpeito-summary__label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  color: #fff; background: var(--berry); border-radius: 999px;
  padding: 0.18rem 1rem; margin: 0 0 0.7rem;
  transform: rotate(-1.5deg);
}
.konpeito-summary ul { margin: 0; padding-left: 0; list-style: none; }
.konpeito-summary li { margin: 0.4em 0; padding-left: 1.4em; position: relative; }
.konpeito-summary li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 10px; height: 10px;
  background: var(--berry); border-radius: 50% 50% 50% 12%;
  transform: rotate(-8deg);
}

/* FAQ */
.konpeito-faq details {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  margin-top: 0.8em;
  transition: border-color 0.2s;
}
.konpeito-faq details[open] { border-color: var(--berry); }
.konpeito-faq summary {
  cursor: pointer; font-weight: 700; padding: 1em 1.3em; list-style: none;
  position: relative; padding-right: 3em;
}
.konpeito-faq summary::before {
  content: "Q"; display: inline-grid; place-items: center;
  width: 1.6em; height: 1.6em; margin-right: 0.6em;
  color: #fff; background: var(--berry);
  border-radius: 50% 50% 50% 12%; transform: rotate(-8deg);
  font-size: 0.82em;
}
.konpeito-faq summary::after {
  content: "+"; position: absolute; right: 1.2em; top: 50%; transform: translateY(-50%);
  color: var(--berry); font-size: 1.35em; font-weight: 400;
}
.konpeito-faq details[open] summary::after { content: "−"; }
.konpeito-faq details > :not(summary) { padding: 0 1.4em 1.2em; margin: 0; color: var(--ink-soft); }

/* 目次 */
.konpeito-toc {
  background: #fff; border: 2px dashed var(--berry); border-radius: var(--radius);
  padding: 1.4rem 1.7rem; margin: 2.2em 0;
}
.konpeito-toc__title {
  font-family: var(--font-display); font-size: 1rem;
  letter-spacing: 0.14em; margin: 0 0 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.konpeito-toc__title::before {
  content: ""; width: 12px; height: 12px;
  background: var(--berry); border-radius: 50% 50% 50% 12%; transform: rotate(-8deg);
}
.konpeito-toc ol { margin: 0; padding-left: 0; counter-reset: toc; list-style: none; }
.konpeito-toc > ol > li { counter-increment: toc; margin: 0.4em 0; }
.konpeito-toc > ol > li::before {
  content: counter(toc);
  display: inline-grid; place-items: center;
  width: 1.5em; height: 1.5em; margin-right: 0.6em;
  background: var(--berry-pale); color: var(--berry-deep);
  border-radius: 50%; font-size: 0.82em; font-weight: 700;
}
.konpeito-toc ol ol { padding-left: 2.4em; }
.konpeito-toc ol ol li { font-size: 0.93em; margin: 0.25em 0; color: var(--ink-soft); }
.konpeito-toc ol ol li::before { content: "・"; color: var(--berry); }
.konpeito-toc a { color: var(--ink); text-decoration: none; }
.konpeito-toc a:hover { color: var(--berry); text-decoration: underline wavy var(--berry-pale); }

/* 更新日表示 */
.entry-dates { display: flex; gap: 1.25em; align-items: center; }
.entry-dates .modified { color: var(--berry); font-weight: 700; }

/* 著者ボックス（E-E-A-T） */
.author-box {
  display: flex; gap: 1.25rem; align-items: flex-start;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; margin-top: 3.5rem;
}
.author-box__avatar img { border-radius: 50%; width: 64px; height: 64px; border: 3px solid var(--berry-pale); }
.author-box__label {
  font-size: 0.74rem; letter-spacing: 0.08em; color: var(--berry);
  margin: 0; font-weight: 700;
}
.author-box__name { font-family: var(--font-display); font-size: 1.1rem; margin: 0.15rem 0 0.5rem; }
.author-box__bio { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* パンくず */
.breadcrumb { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 1.5rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45em; margin: 0; padding: 0; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 0.45em; color: var(--berry); }
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--berry); }

/* タグ */
.entry-tags { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.entry-tags a {
  font-size: 0.8rem; color: var(--ink-soft); text-decoration: none;
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.9rem;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.entry-tags a:hover { border-color: var(--berry); color: var(--berry); transform: rotate(-2deg); }

/* 前後記事ナビ */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a {
  display: block; background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; text-decoration: none; color: var(--ink); font-size: 0.9rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.post-nav a:hover { box-shadow: var(--shadow); border-color: var(--berry-pale); }
.post-nav .nav-label { display: block; font-size: 0.72rem; color: var(--berry); margin-bottom: 0.3rem; letter-spacing: 0.06em; font-weight: 700; }
.post-nav .nav-next { text-align: right; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }

/* =========================================================
   7. Archive / Search / 404
   ========================================================= */
.archive-header { margin-bottom: 2.25rem; }
.archive-title { font-size: 1.55rem; margin: 0 0 0.5rem; }
.archive-title .prefix {
  display: inline-block;
  color: #fff; background: var(--berry); font-size: 0.62em;
  border-radius: 999px; padding: 0.1em 1em; margin-right: 0.6em;
  transform: rotate(-2deg); vertical-align: middle;
}
.archive-description { color: var(--ink-soft); font-size: 0.95rem; }

.pagination { margin-top: 3rem; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; gap: 0.5rem; }
.pagination .page-numbers {
  display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 0.6rem;
  background: #fff; border: 2px solid var(--line); border-radius: 50%;
  text-decoration: none; color: var(--ink); font-size: 0.9rem;
}
.pagination .page-numbers.current { background: var(--berry); border-color: var(--berry); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--berry); color: var(--berry); }

.search-form { display: flex; gap: 0.5rem; max-width: 480px; }
.search-form input[type="search"] {
  flex: 1; padding: 0.65rem 1.2rem; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 999px; background: #fff;
  font-family: inherit;
}
.search-form input[type="search"]:focus { border-color: var(--berry); outline: none; }
.search-form button {
  padding: 0.65rem 1.5rem; background: var(--berry); color: #fff; border: none;
  border-radius: 999px; font-family: inherit; font-size: 0.95rem; cursor: pointer;
  transition: background 0.2s;
}
.search-form button:hover { background: var(--berry-deep); }
.search-form button:active { transform: translateY(1px); }

.error-404 { text-align: center; padding: 4rem 0; }
.error-404 .code {
  font-family: var(--font-display); font-size: 5rem; color: var(--berry);
  margin: 0; line-height: 1;
}

/* =========================================================
   8. Comments
   ========================================================= */
.comments-area { margin-top: 3.5rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-top: 1rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-author { font-weight: 700; font-size: 0.95rem; }
.comment-metadata { font-size: 0.78rem; color: var(--ink-faint); }
.comment-form label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 0.6rem 1rem; border: 2px solid var(--line); border-radius: var(--radius-s);
  font-family: inherit; font-size: 0.95rem; background: #fff;
}
.comment-form .form-submit input {
  background: var(--berry); color: #fff; border: none; border-radius: 999px;
  padding: 0.7rem 2.2rem; font-size: 0.95rem; cursor: pointer; font-family: inherit;
}
.comment-form .form-submit input:hover { background: var(--berry-deep); }

/* =========================================================
   9. Footer
   ========================================================= */
.site-footer {
  background: var(--ink); color: #e8ddd6;
  margin-top: 4rem;
  border-top: 6px solid var(--berry);
}
.site-footer__inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}
.site-footer__brand { font-family: var(--font-display); font-size: 1.2rem; color: #fff; letter-spacing: 0.08em; }
.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.site-footer__nav a { color: #e8ddd6; text-decoration: none; font-size: 0.88rem; }
.site-footer__nav a:hover { color: #fff; text-decoration: underline wavy var(--berry); }
.site-footer__copy { font-size: 0.78rem; color: #a89388; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px dashed #6b564d; }

/* =========================================================
   10. WP core alignment
   ========================================================= */
.alignwide { margin-left: calc(50% - min(50vw, var(--w-wide) / 2) + 1.25rem); margin-right: calc(50% - min(50vw, var(--w-wide) / 2) + 1.25rem); }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption, figure { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 0.82rem; color: var(--ink-faint); text-align: center; margin-top: 0.5em; }
