/* キッズライフハック — 共通テーマ（トップ・ドリル・法務ページ） */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;800&display=swap');

:root {
  --bg: #fff9f0;
  --surface: #ffffff;
  --text: #2d3436;
  --muted: #636e72;
  --accent: #ff6b6b;
  --accent-2: #4ecdc4;
  --accent-3: #ffe66d;
  --purple: #7c4dff;
  --border: #ffeaa7;
  --shadow: 0 8px 24px rgba(45, 52, 54, 0.08);
  --radius: 16px;
  --header-height: 64px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", system-ui, "Hiragino Maru Gothic ProN", sans-serif;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body.klh-site {
  padding-top: var(--header-height);
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.42;
}

.bg-blob.a { width: 280px; height: 280px; background: #ffd93d; top: -60px; right: -40px; }
.bg-blob.b { width: 220px; height: 220px; background: #6bcbff; bottom: 8%; left: -50px; }
.bg-blob.c { width: 180px; height: 180px; background: #ff9a9e; top: 38%; right: 12%; }

header,
main,
#main-content,
.klh-page-wrap,
#klh-header,
#klh-footer-links {
  position: relative;
  z-index: 1;
}

/* ===== トップページ ヘッダー ===== */
body:not(.klh-site) header {
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--accent-3);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  box-shadow: var(--shadow);
}

body:not(.klh-site) .logo {
  font-weight: 800;
  color: var(--text);
  font-size: 1.15rem;
}

body:not(.klh-site) .desktop-cats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

body:not(.klh-site) .desktop-cats a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  background: #f1f3f5;
  border-radius: 999px;
  padding: 6px 12px;
  transition: background 0.2s;
}

body:not(.klh-site) .desktop-cats a:hover { background: var(--accent-3); }

body:not(.klh-site) .menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 202;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body:not(.klh-site) .menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

body:not(.klh-site) .menu-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
body:not(.klh-site) .menu-btn.active span:nth-child(2) { opacity: 0; }
body:not(.klh-site) .menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

body:not(.klh-site) nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 260px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 201;
  padding-top: 80px;
}

body:not(.klh-site) nav.open { right: 0; }
body:not(.klh-site) nav ul { list-style: none; padding: 0; margin: 0; }
body:not(.klh-site) nav ul li a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  border-bottom: 2px dashed #eee;
}

body:not(.klh-site) nav ul li a:hover { background: #fff5e6; }

body:not(.klh-site) .overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 52, 54, 0.25);
  display: none;
  z-index: 198;
}

body:not(.klh-site) .overlay.active { display: block; }

body:not(.klh-site) {
  padding-top: var(--header-height);
}

/* ===== トップ メイン ===== */
#main-content {
  padding: 20px 16px 40px;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.hero {
  margin-bottom: 1.75rem;
  padding: 1.4rem 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #fff5e6 100%);
  border-radius: var(--radius);
  border: 3px dashed var(--accent-3);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  line-height: 1.3;
  color: var(--text);
}

.hero-lead,
.subtitle {
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.hero-deco {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.85;
  user-select: none;
}

.hero-deco.d1 { top: 0.5rem; right: 0.8rem; }
.hero-deco.d2 { bottom: 0.4rem; right: 2.5rem; }
.hero-deco.d3 { top: 0.8rem; left: 0.8rem; font-size: 1.2rem; }

.intro-text {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.65;
  font-weight: 700;
  padding: 0 8px;
}

.category-section {
  max-width: 950px;
  margin: 0 auto 40px;
  text-align: left;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.category-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  border-left: 6px solid var(--accent);
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow);
}

.drill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.drill-card,
.kids-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
  will-change: transform;
  min-height: 110px;
}

.drill-card:hover {
  border-color: #ffd93d;
}

.drill-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
  line-height: 1.35;
}

.drill-desc {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
}

.value-section,
.about-site {
  max-width: 900px;
  margin: 0 auto 36px;
  text-align: left;
  background: #fff;
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 3px solid #dbeafe;
  box-shadow: var(--shadow);
  line-height: 1.8;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.value-section h2,
.about-site h2 {
  margin-top: 0;
  color: var(--purple);
  font-size: 1.35rem;
  text-align: center;
  border-bottom: 3px dashed #e8dff5;
  padding-bottom: 12px;
  font-weight: 800;
}

.value-section h3,
.about-site h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 1.4em;
}

.about-site .about-site-heading-owner { color: #e17055; }
.about-site .about-site-heading-guide { color: #00b894; }
.about-site .about-site-heading-guardian { color: #e84393; }

.value-faq details {
  border: 2px solid #ffeaa7;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #fffdf5;
}

.value-faq summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--purple);
}

.footer-links {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px dashed #eee;
  text-align: center;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 12px;
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

a { color: #0984e3; }

/* ===== ドリルページ共通ヘッダー ===== */
#klh-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--accent-3);
  box-shadow: var(--shadow);
  font-family: "M PLUS Rounded 1c", system-ui, sans-serif;
}

#klh-home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, #ffe66d, #ffd93d);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

#klh-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#klh-recipe-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  color: #2d3436;
  background: linear-gradient(135deg, #fff9f0, #ffeaa7);
  border: 2px solid #fdcb6e;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}

#klh-recipe-link:hover {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

#klh-oshikatsu-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  color: #880e4f;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border: 2px solid #f48fb1;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}

#klh-oshikatsu-link:hover {
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

/* 推し活ページ：shindan 診断バナー（本文先頭） */
#klh-shindan-banner {
  margin: 0 0 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #ad1457, #e91e63, #ec407a);
  border: 2px solid #f8bbd0;
  box-shadow: 0 3px 0 rgba(136, 14, 79, 0.12);
}

.klh-shindan-banner-link {
  display: block;
  padding: 0.7rem 12px;
  text-align: center;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.klh-shindan-banner-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

#klh-menu-toggle {
  border: none;
  background: #f1f3f5;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

#klh-dropdown {
  position: fixed;
  top: calc(var(--header-height) + 6px);
  right: 10px;
  width: min(92vw, 360px);
  max-height: calc(100vh - 90px);
  overflow: auto;
  background: #fff;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 201;
}

.klh-hidden { display: none !important; }

.klh-category {
  border: 2px solid #ffeaa7;
  border-radius: 12px;
  margin: 0 0 8px;
  overflow: hidden;
  background: #fffdf5;
}

.klh-category summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-weight: 800;
  color: var(--text);
  background: #fff5e6;
}

.klh-sub-links {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
}

.klh-sub-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8f9fa;
}

.klh-sub-link:hover { background: #fff5e6; }

#klh-footer-links {
  margin: 40px auto 20px;
  text-align: center;
  font-size: 0.9em;
  line-height: 1.8;
  color: var(--muted);
  font-family: "M PLUS Rounded 1c", system-ui, sans-serif;
}

#klh-footer-links a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 10px;
  font-weight: 700;
}

.klh-label-mobile { display: none; }

/* ===== 法務・サイトマップ ===== */
.klh-page-wrap {
  max-width: 820px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.klh-page-card {
  background: #fff;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 3px solid #dbeafe;
  box-shadow: var(--shadow);
}

.klh-page-card h1 {
  margin-top: 0;
  color: var(--purple);
  font-weight: 800;
  border-bottom: 3px dashed #e8dff5;
  padding-bottom: 10px;
}

.klh-page-card h2 {
  font-size: 1.15rem;
  margin-top: 1.6em;
  color: #e17055;
  font-weight: 800;
}

.back-link {
  margin-top: 32px;
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ffe66d, #ffd93d);
  color: var(--text);
  border-radius: 999px;
}

@media (max-width: 600px) {
  body:not(.klh-site) .desktop-cats { display: none; }
  .drill-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .drill-card { padding: 14px 8px; min-height: 96px; }
  .drill-title { font-size: 0.92rem; }
  .drill-desc { font-size: 0.72rem; }
  .value-section, .about-site { padding: 18px 14px; }
}

@media (min-width: 601px) {
  body:not(.klh-site) .menu-btn { display: none; }
  body:not(.klh-site) nav { display: none; }
  body:not(.klh-site) .overlay { display: none !important; }
}

@media (max-width: 768px) {
  #klh-header { padding: 0 10px; }
  #klh-home-link { font-size: 12px; padding: 7px 10px; }
  #klh-recipe-link { font-size: 12px; padding: 7px 10px; }
  #klh-oshikatsu-link { font-size: 12px; padding: 7px 10px; }
  .klh-label-desktop { display: none; }
  .klh-label-mobile { display: inline; font-size: 16px; }
  #klh-menu-toggle { min-width: 44px; }
  #klh-dropdown { right: 8px; width: min(94vw, 340px); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob { display: none; }
}
