/*
Theme Name: Bogie HARD-BOILED
Author: Bogie HARD-BOILED
Description: ハードボイルド教習所。白い紙面と古い探偵事務所の空気を組み合わせた読み物型テーマ。
Version: 3.2.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: bogie-hardboiled
*/

:root {
  --ink: #24211e;
  --muted: #746d65;
  --paper: #fff;
  --warm: #f8f5ef;
  --warm-deep: #eee8de;
  --accent: #2e2925;
  --rust: #74503c;
  --reading: 46rem;
  --wide: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  font-size: 16px;
  line-height: 2.05;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-decoration-color: #a79e94; text-underline-offset: .2em; }
a:hover, a:focus-visible { color: var(--rust); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
[hidden] { display: none !important; }

.content-shell { width: min(100% - 2.5rem, var(--reading)); margin-inline: auto; }
.wide-shell { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.screen-reader-text { position: absolute; left: -9999px; }
.screen-reader-text:focus { left: 1rem; top: 1rem; z-index: 999; background: #fff; padding: .5rem .75rem; }

/* -------------------------------------------------------
   Header — one strong scene, then get out of the reader's way.
------------------------------------------------------- */
.site-header { background: #fff; }
.brand-scene {
  position: relative;
  display: block;
  height: clamp(11rem, 27vw, 19rem);
  overflow: hidden;
  background-image: url("assets/images/hero-desk.jpg");
  background-position: center 53%;
  background-size: cover;
  color: #f8f1e6;
  text-decoration: none;
}
.brand-scene__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12,10,8,.69) 0%, rgba(12,10,8,.33) 48%, rgba(12,10,8,.54) 100%);
}
.brand-scene__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%);
  color: #f5eee4;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.55);
}
.brand-scene__logo span {
  margin-bottom: .12em;
  font-size: clamp(1rem, 2.6vw, 1.55rem);
  font-style: italic;
  letter-spacing: .08em;
}
.brand-scene__logo strong {
  font-size: clamp(1.9rem, 6.4vw, 4.8rem);
  line-height: .98;
  letter-spacing: .075em;
  white-space: nowrap;
}
.header-inner {
  width: min(100% - 2.5rem, var(--wide));
  min-height: 3.25rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-toggle { display: none; border: 0; background: transparent; padding: .6rem; color: var(--ink); font-weight: 700; }
.primary-navigation ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.35rem; margin: 0; padding: 0; list-style: none; }
.primary-navigation a { display: block; padding: .65rem 0; font-size: .82rem; text-decoration: none; color: #504a44; }
.primary-navigation a:hover { color: #111; }
.site-main { min-height: 60vh; }

/* -------------------------------------------------------
   Front page — continuous editorial flow, not stacked cards.
------------------------------------------------------- */
.home-hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 4rem; text-align: center; }
.home-hero h1 {
  margin: 0 0 1.8rem;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: clamp(2.35rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: .03em;
}
.hero-image { width: min(55vw, 15rem); margin: 0 auto 1.8rem; }
.hero-copy { font-family: Georgia, "Yu Mincho", YuMincho, serif; font-size: 1.03rem; }
.hero-copy p { margin: .22rem 0; }
.hero-principles { margin-top: 1rem !important; font-weight: 700; line-height: 1.7; }
.home-section {
  padding: clamp(3.8rem, 8vw, 6.5rem) 0;
  scroll-margin-top: 1rem;
}
.home-section + .home-section { padding-top: 2.6rem; }
.home-section h2 {
  margin: 0 0 1.35rem;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  line-height: 1.45;
}
.home-section h3 {
  margin: 2.5rem 0 .55rem;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: 1.22rem;
  line-height: 1.55;
}
.home-section p { margin: 0 0 1.15rem; }
.school-intro { background: var(--warm); padding-block: clamp(4rem, 8vw, 6rem); }
.bridge-copy {
  margin-bottom: 1.2rem !important;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  font-weight: 700;
}
.home-stage { margin-top: 2.5rem; }
.text-action { margin-top: 1.25rem !important; }
.text-action a { font-weight: 700; text-decoration-thickness: 1px; }
.home-signoff {
  margin-top: 2.6rem !important;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-weight: 700;
}

/* -------------------------------------------------------
   Lower pages — essay first. Headings are landmarks, not boxes.
------------------------------------------------------- */
.page-header { padding: clamp(3.4rem, 7vw, 5.5rem) 0 1rem; }
.breadcrumb { margin: 0 0 1.2rem; color: var(--muted); font-size: .75rem; }
.breadcrumb a { color: var(--muted); }
.page-title {
  max-width: 19em;
  margin: 0;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: clamp(2rem, 6.5vw, 3.55rem);
  line-height: 1.34;
  letter-spacing: .015em;
}
.entry-content { padding: 1.2rem 0 5.8rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content dl { margin-top: 0; margin-bottom: 1.55rem; }
.entry-content h2 {
  margin: 3.9rem 0 1.15rem;
  padding: 0;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  line-height: 1.55;
}
.entry-content h3 { margin: 2.5rem 0 .75rem; font-size: 1.12rem; line-height: 1.65; }
.entry-content li + li { margin-top: .45rem; }
.entry-content strong { font-weight: 700; }
.bogie-signoff {
  margin: 2.8rem 0 0 !important;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.9;
}
.bogie-signoff::before { content: "— "; color: #9f968d; font-weight: 400; }

.lesson-links { margin: 2rem 0 2.4rem; }
.lesson-card {
  display: block;
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  position: relative;
  color: var(--ink);
  text-decoration: none;
}
.lesson-card::before { content: "→"; position: absolute; left: 0; top: 0; color: #9a8f84; }
.lesson-card strong { display: block; font-family: Georgia, "Yu Mincho", YuMincho, serif; font-size: 1.03rem; }
.lesson-card span { display: block; margin-top: .08rem; color: var(--muted); font-size: .88rem; line-height: 1.75; }
.lesson-card:hover strong { color: var(--rust); }

.work-list { margin: 1.5rem 0 2.2rem; }
.work-list dt { margin-top: 1.75rem; font-family: Georgia, "Yu Mincho", YuMincho, serif; font-weight: 700; }
.work-list dd { margin: .35rem 0 0 1.2rem; color: #48423d; }

.field-cases details { margin: 0 0 2rem; }
.field-cases summary {
  cursor: pointer;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.7;
}
.field-cases details > div { padding: .85rem 0 0 1.3rem; color: #46413c; }
.field-cases details > div > :last-child { margin-bottom: 0; }

.return-nav { margin-top: 4.5rem; font-size: .88rem; }
.return-nav a { color: var(--muted); text-decoration: none; }
.return-nav a:hover { color: var(--ink); }

/* -------------------------------------------------------
   Quizzes — all questions visible, result reveal with a five-step meter.
------------------------------------------------------- */
.bogie-quiz { margin: .5rem 0 2.5rem; }
.quiz-form { margin: 0; }
.quiz-question-block { margin: 0 0 2.55rem; padding: 0; border: 0; }
.quiz-question-block legend {
  width: 100%;
  margin-bottom: .8rem;
  font-family: Georgia, "Yu Mincho", YuMincho, serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.75;
}
.quiz-question-block legend span { color: #9a9188; font-weight: 400; }
.quiz-options { display: grid; gap: .25rem; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .3rem .4rem;
  border-radius: 3px;
  cursor: pointer;
}
.quiz-option:hover { background: var(--warm); }
.quiz-option input { appearance: none; width: 1.05rem; height: 1.05rem; flex: 0 0 1.05rem; margin-top: .45em; border: 1px solid #8f867d; border-radius: 2px; background: #fff; }
.quiz-option input:checked { background: #302b27; box-shadow: inset 0 0 0 3px #fff; }
.quiz-option span { line-height: 1.75; }
.bogie-button {
  display: inline-block;
  padding: .72rem 1.2rem;
  border: 0;
  border-radius: 2px;
  background: #282421;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.bogie-button:hover, .bogie-button:focus-visible { background: #4b4038; color: #fff; }
.quiz-error { margin: 0 0 1rem; color: #8a332c; font-weight: 700; }
.quiz-result {
  margin-top: 3.75rem;
  padding: 2.4rem 1.25rem 2.2rem;
  background: #f3f0eb;
  text-align: center;
  outline: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
}
.quiz-result.is-revealed { opacity: 1; transform: none; }
.quiz-result > * { width: min(100%, 39rem); margin-left: auto; margin-right: auto; }
.quiz-result-label { margin-bottom: .15rem; font-size: .92rem; font-weight: 700; letter-spacing: .08em; }
.quiz-result-arrows { margin-top: 0; margin-bottom: 1.55rem; letter-spacing: .22em; font-weight: 700; }
.quiz-meter-label { margin-bottom: .65rem; color: var(--muted); font-size: .9rem; }
.quiz-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: .42rem; max-width: 24rem; margin: 0 auto .75rem; }
.quiz-meter span { height: .7rem; background: #d7d1ca; border-radius: 99px; transition: background .22s ease .08s; }
.quiz-meter span.is-active { background: #302b27; }
.quiz-level { margin: .25rem auto 0; font-family: Georgia, "Yu Mincho", YuMincho, serif; font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; }
.quiz-score { margin-top: .25rem; color: var(--muted); font-size: .82rem; }
.quiz-result-title { margin-top: 1.7rem; margin-bottom: .75rem; font-family: Georgia, "Yu Mincho", YuMincho, serif; font-size: clamp(1.75rem, 5vw, 2.35rem); line-height: 1.35; }
.quiz-result-body { max-width: 34rem; line-height: 1.9; }
.quiz-actions { display: flex; justify-content: center; margin-top: 1.65rem; }
.quiz-after { margin-top: 2.5rem; }
.quiz-after--loser { max-width: 39rem; }

.graduation-certificate {
  max-width: 42rem;
  margin: 1rem auto 3rem;
  padding: clamp(2rem, 6vw, 4rem);
  background: #f7f4ee;
  text-align: center;
}
.graduation-certificate .certificate-kicker { margin-bottom: 1.35rem; color: var(--muted); font-size: .82rem; letter-spacing: .16em; }
.graduation-certificate h2 { margin-top: 0; font-size: clamp(2rem, 7vw, 3.2rem); }
.graduation-certificate p { max-width: 31rem; margin-left: auto; margin-right: auto; }
.graduation-certificate .certificate-sign { margin-top: 2.5rem; font-family: Georgia, "Yu Mincho", YuMincho, serif; font-size: 1.45rem; font-weight: 700; }

/* Forms / profile / ads */
.bogie-form { margin-top: 2rem; }
.form-field { margin-bottom: 1.45rem; }
.form-field label { display: block; margin-bottom: .3rem; font-weight: 700; }
.form-field input, .form-field textarea { width: 100%; padding: .75rem; border: 1px solid #aaa29a; background: #fff; }
.form-field textarea { min-height: 12rem; }
.profile-block { display: grid; gap: 2rem; align-items: start; }
.profile-image { width: 9.625rem; }
.bogie-ad-slot { margin: 2rem 0; min-height: 1px; }
.bogie-sitemap ul { list-style: none; padding-left: 0; }
.bogie-sitemap .children { padding-left: 1.2rem; }

/* Footer — deliberately quiet. */
.site-footer { padding: 2.7rem 0 2.3rem; background: var(--warm); color: var(--muted); font-size: .78rem; }
.footer-inner { display: flex; flex-direction: column; gap: .9rem; }
.footer-navigation ul { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.footer-navigation a { color: var(--muted); }
.copyright { margin: 0; }

@media (min-width: 64rem) {
  .profile-block { grid-template-columns: auto 1fr; }
}

@media (max-width: 48rem) {
  body { line-height: 1.95; }
  .brand-scene { height: 10.5rem; background-position: 56% 52%; }
  .brand-scene__logo strong { font-size: clamp(1.75rem, 10vw, 2.65rem); letter-spacing: .045em; }
  .header-inner { justify-content: flex-end; position: relative; }
  .menu-toggle { display: block; }
  .primary-navigation { display: none; position: absolute; top: 100%; right: 0; left: 0; z-index: 30; padding: .6rem 1.25rem 1rem; background: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.08); }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { display: block; }
  .primary-navigation a { padding: .55rem 0; }
  .home-hero { padding-top: 3.3rem; }
  .home-section { padding-block: 3.2rem; }
  .home-section + .home-section { padding-top: 2rem; }
  .entry-content { padding-bottom: 4.5rem; }
  .work-list dd { margin-left: 0; }
  .field-cases details > div { padding-left: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body:not(.home) .brand-scene { height: 9.5rem; }
body:not(.home) .brand-scene__logo strong { font-size: clamp(1.7rem, 5vw, 3.1rem); }
body:not(.home) .brand-scene__logo span { font-size: .9rem; }
.form-status { margin: 1.5rem 0; padding: .9rem 1rem; background: var(--warm); }
.form-status--success { color: #35533a; }
.bogie-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 48rem) {
  body:not(.home) .brand-scene { height: 7.5rem; }
}
.page-kicker { margin: 0 0 .5rem; color: var(--muted); font-size: .72rem; letter-spacing: .12em; }

.content-note { color: var(--muted); font-size: .88rem; }
