/*
Theme Name: Rashin
Theme URI: https://rashin.example.jp/
Author: RASHIN
Description: IT転職・フリーランスエージェントの比較メディア向けWordPressテーマ。信頼感を軸にしたヒーロー演出、比較表、ランキング、診断、FAQ、ステマ規制対応のPR表記を標準搭載しています。
Version: 2.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rashin
Tags: blog, one-column, custom-menu, custom-logo, featured-images, translation-ready, block-styles, wide-blocks
*/

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* 濃紺を基調に。信頼＝彩度を抑えた寒色、行動＝暖色のアクセント1色のみ */
  --ink:     #0B1B2E;
  --navy:    #123055;
  --navy-2:  #1B4272;
  --steel:   #5B7395;
  --mist:    #F4F7FB;
  --white:   #FFFFFF;
  --line:    #DCE4EE;
  --line-2:  #EDF1F7;

  --cta:     #E8542F;   /* 行動を促す唯一の暖色 */
  --cta-dark:#C63E1C;
  --data:    #12866F;   /* 数値・肯定 */
  --warn:    #B9791A;   /* 注意・デメリット */

  --font-display: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --font-serif: "Shippori Mincho", "Yu Mincho", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --step--2: 0.72rem;
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(0.94rem, 0.9rem + 0.2vw, 1.02rem);
  --step-1:  clamp(1.1rem, 1.02rem + 0.4vw, 1.3rem);
  --step-2:  clamp(1.35rem, 1.18rem + 0.85vw, 1.8rem);
  --step-3:  clamp(1.7rem, 1.35rem + 1.6vw, 2.5rem);
  --step-4:  clamp(2.1rem, 1.5rem + 3vw, 3.8rem);

  --gap: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
  --block: clamp(3.25rem, 2rem + 5vw, 6rem);
  --wrap: 72rem;
  --wrap-narrow: 44rem;
  --radius: 10px;
  --radius-sm: 6px;
  --hair: 1px solid var(--line);
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --shadow: 0 1px 2px rgba(11,27,46,.06), 0 8px 24px -12px rgba(11,27,46,.18);
  --shadow-lg: 0 2px 4px rgba(11,27,46,.06), 0 24px 48px -20px rgba(11,27,46,.28);

  color-scheme: light;
}

/* =============================================================
   2. Base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 var(--step-0)/1.9 var(--font-body);
  font-feature-settings: "palt" 1;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
  line-break: strict;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.005em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.3em; }
p:last-child { margin-bottom: 0; }
a { color: var(--navy-2); text-decoration-thickness: 1px; }
a:hover { color: var(--cta); }
img, svg, video { max-width: 100%; height: auto; display: block; }
strong { font-weight: 700; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection { background: #FFD9CC; color: var(--ink); }

.skip-link, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus, .screen-reader-text:focus {
  width: auto; height: auto; clip-path: none; z-index: 100;
  background: var(--ink); color: var(--white); padding: 0.7em 1.2em; top: 0.75rem; left: 0.75rem;
}

/* =============================================================
   3. Layout
   ============================================================= */
.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gap), var(--wrap-narrow)); }
.section { padding-block: var(--block); }
.section--mist { background: var(--mist); }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy a { color: #BBD4F2; }

.section-head { margin-bottom: clamp(1.75rem, 1rem + 2.5vw, 3rem); max-width: 44rem; }
.section-head h2 { font-size: var(--step-3); margin-bottom: 0.6rem; }
.section-head p { color: var(--steel); font-size: var(--step--1); margin: 0; }
.section--navy .section-head p { color: #A9C0DC; }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--step--2);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--steel);
  margin: 0 0 0.7rem; display: flex; align-items: center; gap: 0.7em;
}
.eyebrow::before { content: ""; width: 1.4rem; height: 2px; background: var(--cta); flex: none; }

/* =============================================================
   4. PR表記（ステマ規制対応）
   ============================================================= */
.pr-bar {
  background: var(--line-2); color: var(--navy);
  font-size: var(--step--2); letter-spacing: 0.02em;
  padding: 0.55em 0; border-bottom: var(--hair);
}
.pr-bar .wrap { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.pr-tag {
  background: var(--navy); color: var(--white);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  padding: 0.25em 0.6em; border-radius: 3px; flex: none;
}
.pr-note {
  display: flex; gap: 0.7em; align-items: flex-start;
  background: var(--line-2); border-left: 3px solid var(--steel);
  padding: 0.9em 1.1em; border-radius: var(--radius-sm);
  font-size: var(--step--1); color: var(--navy); margin: 1.5rem 0;
}

/* =============================================================
   5. Header
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 4px 20px -14px rgba(11,27,46,.5); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }

.brand { display: inline-flex; align-items: baseline; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; letter-spacing: 0.02em; }
.brand small { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--steel); }

.global-nav ul { display: flex; align-items: center; gap: clamp(0.8rem, 1.8vw, 1.6rem); list-style: none; margin: 0; padding: 0; }
.global-nav a { text-decoration: none; color: var(--ink); font-size: var(--step--1); font-weight: 500; padding: 0.4em 0; position: relative; display: inline-block; }
.global-nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--cta); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease); }
.global-nav a:hover::after, .global-nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-cta { display: none; }
@media (min-width: 62em) { .header-cta { display: inline-flex; } }

.menu-toggle { display: none; width: 2.75rem; height: 2.75rem; background: none; border: var(--hair); border-radius: var(--radius-sm); cursor: pointer; padding: 0; color: inherit; }
.menu-toggle span { display: block; width: 1.1rem; height: 2px; margin: 0.26rem auto; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.38rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-0.38rem) rotate(-45deg); }

@media (max-width: 47.9375em) {
  .menu-toggle { display: block; }
  .global-nav { position: absolute; inset-inline: 0; top: 100%; background: var(--white); border-bottom: var(--hair); display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease); box-shadow: var(--shadow); }
  .global-nav > ul { overflow: hidden; flex-direction: column; align-items: stretch; gap: 0; }
  .global-nav.is-open { grid-template-rows: 1fr; }
  .global-nav li + li { border-top: var(--hair); }
  .global-nav a { padding: 1rem var(--gap); font-size: var(--step-0); }
  .global-nav a::after { display: none; }
}

/* =============================================================
   6. Hero ＋ 信頼感のある背景アニメーション
   ============================================================= */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  background: linear-gradient(165deg, #0B1B2E 0%, #123055 55%, #16406E 100%);
  color: var(--white);
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-ambient {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  --mx: 0px; --my: 0px; --scroll-y: 0px;
}
.hero-ambient svg { width: 100%; height: 100%; display: block; }

/* ドットグリッド：非常に遅い等速移動 */
.hero-grid {
  transform: translate3d(calc(var(--mx) * 0.35), calc(var(--my) * 0.35 + var(--scroll-y) * 0.4), 0);
  animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift { to { transform: translate3d(calc(var(--mx) * 0.35 + 32px), calc(var(--my) * 0.35 + var(--scroll-y) * 0.4 + 32px), 0); } }

/* 折れ線：dasharray で描画。2.4秒で完成して止まる */
.hero-line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 2.4s var(--ease) forwards; }
.hero-line--2 { animation-delay: .35s; }
.hero-line--3 { animation-delay: .7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-node { opacity: 0; animation: node-in .5s var(--ease) forwards; }
@keyframes node-in { to { opacity: 1; } }

/* 終点のパルスだけが継続。3秒に1回、控えめに */
.hero-pulse { transform-origin: center; transform-box: fill-box; opacity: 0; animation: pulse 3.2s ease-out 2.6s infinite; }
@keyframes pulse {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(2.6); }
  100% { opacity: 0;   transform: scale(2.6); }
}

.hero-glow {
  transform: translate3d(calc(var(--mx) * -0.8), calc(var(--my) * -0.8), 0);
  transition: transform .8s var(--ease);
}
.has-js-motion .hero-glow { transition: none; }

.hero-inner { position: relative; max-width: 44rem; }
.hero .eyebrow { color: #9FC4EC; }
.hero .eyebrow::before { background: var(--cta); }
.hero h1 { font-size: var(--step-4); font-weight: 700; line-height: 1.28; letter-spacing: 0.01em; margin-bottom: 0.7em; }
.hero h1 .accent { color: #FFB79E; }
.hero-lead { font-size: var(--step-1); line-height: 1.95; color: #CBDCEF; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

/* ヒーロー直下の信頼指標 */
.trust-bar {
  display: grid; gap: 1px; background: rgba(255,255,255,.16);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius);
  overflow: hidden; margin-top: 2.75rem;
}
.trust-bar div { background: rgba(11,27,46,.35); padding: 1rem 1.1rem; backdrop-filter: blur(4px); }
.trust-bar dt { font-size: var(--step--2); color: #9FC4EC; letter-spacing: .06em; margin-bottom: .25rem; }
.trust-bar dd { margin: 0; font-family: var(--font-mono); font-size: var(--step-1); font-weight: 500; color: var(--white); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .hero-grid, .hero-pulse { animation: none; }
  .hero-line { stroke-dashoffset: 0; animation: none; }
  .hero-node { opacity: 1; animation: none; }
}

/* =============================================================
   7. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.95em 1.7em; border: 2px solid var(--cta); background: var(--cta); color: var(--white);
  font: 700 var(--step-0)/1 var(--font-display); letter-spacing: 0.03em;
  text-decoration: none; border-radius: var(--radius-sm); cursor: pointer;
  box-shadow: 0 2px 0 var(--cta-dark);
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--cta-dark); border-color: var(--cta-dark); color: var(--white); transform: translateY(1px); box-shadow: 0 1px 0 var(--cta-dark); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn::after { content: "›"; font-size: 1.3em; line-height: 0; margin-top: -0.1em; }
.btn--ghost { background: transparent; border-color: currentColor; color: currentColor; box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: currentColor; color: currentColor; transform: none; box-shadow: none; }
.btn--wide { width: 100%; }
.btn--sm { padding: 0.7em 1.2em; font-size: var(--step--1); }
.btn-note { display: block; text-align: center; font-size: var(--step--2); color: var(--steel); margin-top: 0.6rem; }

/* =============================================================
   8. 診断（3問でおすすめを出す）
   ============================================================= */
.quiz { background: var(--white); border: var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.quiz-progress { height: 4px; background: var(--line-2); }
.quiz-progress span { display: block; height: 100%; background: var(--cta); width: 0; transition: width .4s var(--ease); }
.quiz-body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.quiz-step { display: none; }
.quiz-step.is-active { display: block; animation: fade-up .35s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.quiz-count { font-family: var(--font-mono); font-size: var(--step--2); color: var(--steel); letter-spacing: .12em; }
.quiz-step h3 { font-size: var(--step-2); margin: 0.5rem 0 1.4rem; }
.quiz-options { display: grid; gap: 0.6rem; }
.quiz-options button {
  text-align: left; font: 500 var(--step-0)/1.6 var(--font-body); color: var(--ink);
  background: var(--white); border: var(--hair); border-radius: var(--radius-sm);
  padding: 1em 1.2em; cursor: pointer; display: flex; align-items: center; gap: 0.8em;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .12s var(--ease);
}
.quiz-options button::before {
  content: ""; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2px solid var(--line); flex: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.quiz-options button:hover { border-color: var(--navy-2); background: var(--mist); }
.quiz-options button:hover::before { border-color: var(--cta); box-shadow: inset 0 0 0 3px var(--cta); }
.quiz-result { display: none; }
.quiz-result.is-active { display: block; animation: fade-up .4s var(--ease); }
.quiz-back { background: none; border: none; color: var(--steel); font: inherit; font-size: var(--step--1); cursor: pointer; padding: 0; margin-top: 1.2rem; text-decoration: underline; }

/* =============================================================
   9. ランキングカード
   ============================================================= */
.rank-list { display: grid; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.rank-card {
  position: relative; background: var(--white); border: var(--hair); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: minmax(0,1fr); 
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.rank-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.rank-card--top { border-color: var(--cta); border-width: 2px; }

.rank-head { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.25rem; background: var(--mist); border-bottom: var(--hair); }
.rank-badge {
  flex: none; width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--navy); color: var(--white);
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500;
}
.rank-card--top .rank-badge { background: var(--cta); }
.rank-head h3 { font-size: var(--step-1); }
.rank-head .rank-kind { font-size: var(--step--2); color: var(--steel); font-family: var(--font-mono); letter-spacing: .1em; }

.rank-body { padding: 1.25rem; display: grid; gap: 1.1rem; }
@media (min-width: 48em) { .rank-body { grid-template-columns: 1fr 15rem; align-items: start; gap: 1.75rem; } }

.rank-score { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-bottom: 0.9rem; }
.rank-score div { display: flex; align-items: baseline; gap: 0.4em; }
.rank-score dt { font-size: var(--step--2); color: var(--steel); }
.rank-score dd { margin: 0; font-family: var(--font-mono); font-weight: 500; color: var(--data); font-variant-numeric: tabular-nums; }

.rank-points { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.45rem; font-size: var(--step--1); }
.rank-points li { display: flex; gap: 0.6em; align-items: flex-start; line-height: 1.7; }
.rank-points li::before { content: "✓"; color: var(--data); font-weight: 700; flex: none; }
.rank-points li.is-caution::before { content: "!"; color: var(--warn); }

.rank-aside { display: grid; gap: 0.5rem; align-content: start; }
.rank-fit { background: var(--mist); border-radius: var(--radius-sm); padding: 0.9rem 1rem; font-size: var(--step--1); }
.rank-fit strong { display: block; font-size: var(--step--2); color: var(--steel); margin-bottom: 0.3rem; letter-spacing: .06em; }

/* =============================================================
   10. 比較表
   ============================================================= */
.compare-wrap { position: relative; }
.compare-scroll { overflow-x: auto; border: var(--hair); border-radius: var(--radius); background: var(--white); -webkit-overflow-scrolling: touch; }
.compare-hint { font-size: var(--step--2); color: var(--steel); margin-top: 0.6rem; }
@media (min-width: 56em) { .compare-hint { display: none; } }

.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--step--1); min-width: 46rem; }
.compare-table th, .compare-table td { padding: 0.9em 1em; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.compare-table thead th { position: sticky; top: 0; z-index: 2; background: var(--navy); color: var(--white); font-family: var(--font-display); font-size: var(--step--2); letter-spacing: .08em; white-space: nowrap; }
.compare-table tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--white);
  font-weight: 700; font-family: var(--font-display); white-space: nowrap;
  box-shadow: 1px 0 0 var(--line);
}
.compare-table tbody tr:hover th, .compare-table tbody tr:hover td { background: var(--mist); }
.compare-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.compare-table .yes { color: var(--data); font-weight: 700; }
.compare-table .no { color: var(--steel); }
.compare-table td:last-child { text-align: center; white-space: nowrap; }

/* =============================================================
   11. データ（年収グラフなど）
   ============================================================= */
.data-card { background: var(--white); border: var(--hair); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.data-card figcaption { font-size: var(--step--2); color: var(--steel); margin-top: 1rem; line-height: 1.7; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; font-size: var(--step--1); }
.bar-track { background: var(--line-2); border-radius: 3px; height: 0.75rem; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--navy-2), var(--data)); border-radius: 3px; width: 0; transition: width 1.1s var(--ease); }
.is-revealed .bar-fill { width: var(--w, 0%); }
.bar-row b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }

/* =============================================================
   12. ステップ・チェックリスト・注記
   ============================================================= */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: var(--hair); border-radius: var(--radius); overflow: hidden; }
.steps li { counter-increment: step; background: var(--white); padding: 1.3rem 1.4rem 1.3rem 3.6rem; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 1.2rem; top: 1.35rem;
  width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--navy); color: var(--white); font-family: var(--font-mono); font-size: 0.78rem;
}
.steps h3 { font-size: var(--step-0); margin-bottom: 0.35rem; }
.steps p { font-size: var(--step--1); color: var(--steel); margin: 0; line-height: 1.8; }

.callout { border: var(--hair); border-left: 4px solid var(--navy-2); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; background: var(--mist); font-size: var(--step--1); margin: 1.8rem 0; }
.callout--caution { border-left-color: var(--warn); background: #FDF6E9; }
.callout strong { display: block; margin-bottom: 0.4rem; font-family: var(--font-display); }

/* =============================================================
   13. FAQ
   ============================================================= */
.faq { display: grid; gap: 0.6rem; }
.faq details { border: var(--hair); border-radius: var(--radius-sm); background: var(--white); overflow: hidden; }
.faq details[open] { border-color: var(--navy-2); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1em 3em 1.1em 1.2em; position: relative;
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-0); line-height: 1.6;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.3rem; top: 50%; width: 0.6rem; height: 0.6rem;
  border-right: 2px solid var(--steel); border-bottom: 2px solid var(--steel);
  transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .faq-a { padding: 0 1.2em 1.3em; font-size: var(--step--1); color: var(--navy); line-height: 1.9; }

/* =============================================================
   14. 運営者情報（E-E-A-T）
   ============================================================= */
.author-box { display: grid; gap: 1.2rem; border: var(--hair); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); background: var(--white); }
@media (min-width: 44em) { .author-box { grid-template-columns: 5rem 1fr; align-items: start; } }
.author-avatar { width: 5rem; height: 5rem; border-radius: 50%; background: var(--navy); color: var(--white); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.author-box h3 { font-size: var(--step-1); margin-bottom: 0.2rem; }
.author-role { font-size: var(--step--2); color: var(--steel); font-family: var(--font-mono); letter-spacing: .08em; margin-bottom: 0.8rem; }
.author-box p { font-size: var(--step--1); line-height: 1.9; }
.author-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; list-style: none; padding: 0; }
.author-facts li { font-size: var(--step--2); border: var(--hair); border-radius: 999px; padding: 0.3em 0.8em; color: var(--navy); }

.updated-badge { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-mono); font-size: var(--step--2); color: var(--steel); letter-spacing: .06em; }
.updated-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--data); }

/* =============================================================
   15. 追従CTA
   ============================================================= */
.sticky-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-top: var(--hair); box-shadow: 0 -6px 24px -16px rgba(11,27,46,.5);
  padding: 0.7rem var(--gap) calc(0.7rem + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform .35s var(--ease);
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta .wrap { display: flex; align-items: center; gap: 0.9rem; }
.sticky-cta p { margin: 0; font-size: var(--step--2); line-height: 1.5; flex: 1; min-width: 0; }
.sticky-cta strong { display: block; font-family: var(--font-display); font-size: var(--step--1); }
.sticky-cta .btn { flex: none; }
.sticky-cta-close { background: none; border: none; color: var(--steel); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0.3rem; flex: none; }
@media (min-width: 62em) { .sticky-cta { display: none; } }

/* =============================================================
   16. CTAブロック（記事中に差し込む）
   ============================================================= */
.cta-block {
  border: 2px solid var(--navy); border-radius: var(--radius); overflow: hidden;
  margin: 2.5rem 0; background: var(--white);
}
.cta-block-head { background: var(--navy); color: var(--white); padding: 0.7em 1.2em; font-family: var(--font-display); font-weight: 700; font-size: var(--step--1); letter-spacing: .04em; }
.cta-block-body { padding: 1.4rem 1.3rem; display: grid; gap: 1rem; }
@media (min-width: 44em) { .cta-block-body { grid-template-columns: 1fr 15rem; align-items: center; } }
.cta-block h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.cta-block p { font-size: var(--step--1); color: var(--navy); margin: 0; }

/* =============================================================
   17. カード / グリッド
   ============================================================= */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.card { background: var(--white); border: var(--hair); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 1.75rem); display: flex; flex-direction: column; gap: 0.6rem; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover { border-color: var(--navy-2); box-shadow: var(--shadow); }
.card h3 { font-size: var(--step-1); }
.card p { font-size: var(--step--1); color: var(--steel); line-height: 1.85; margin: 0; }
.card .num { font-family: var(--font-mono); font-size: var(--step--2); color: var(--cta); letter-spacing: .14em; }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.post-item { border-bottom: var(--hair); }
.post-item:first-child { border-top: var(--hair); }
.post-item a { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; padding: 1.3rem 0.4rem; text-decoration: none; color: var(--ink); transition: background .2s var(--ease), padding-left .2s var(--ease); }
.post-item a:hover { background: var(--mist); padding-left: 0.9rem; }
.post-item .post-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-0); line-height: 1.6; }
.post-item .post-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: var(--step--2); color: var(--steel); font-family: var(--font-mono); }
.post-item .post-cat { color: var(--navy-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.15em 0.7em; font-family: var(--font-body); }

/* =============================================================
   18. 記事本文 / 目次
   ============================================================= */
.article-header { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 3vw, 2rem); }
.article-header h1 { font-size: var(--step-3); margin-bottom: 0.7em; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.4em; list-style: none; margin: 0; padding: 0; font-size: var(--step--2); color: var(--steel); }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4em; color: var(--line); }
.breadcrumb a { text-decoration: none; color: var(--steel); }
.breadcrumb a:hover { color: var(--cta); text-decoration: underline; }

.article-dl { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: var(--step--2); color: var(--steel); margin: 0 0 1.2rem; font-family: var(--font-mono); }
.article-dl div { display: flex; gap: 0.5em; }
.article-dl dd { margin: 0; }

.article-layout { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: minmax(0,1fr); padding-bottom: var(--block); }
@media (min-width: 62em) { .article-layout { grid-template-columns: minmax(0,1fr) 16rem; } .article-aside { order: 2; } }

.article-content { max-width: 42em; }
.article-content > * + * { margin-top: 1.35em; }
.article-content h2 { font-size: var(--step-2); margin-top: 2.6em; padding: 0.7em 0 0.7em 0.9em; border-left: 5px solid var(--cta); background: var(--mist); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; scroll-margin-top: 6rem; }
.article-content h3 { font-size: var(--step-1); margin-top: 2em; padding-bottom: 0.4em; border-bottom: 2px solid var(--line); scroll-margin-top: 6rem; }
.article-content .lead { font-size: var(--step-1); line-height: 2; color: var(--navy); }
.article-content blockquote { margin: 2.2em 0; padding: 1.2em 1.4em; background: var(--mist); border-radius: var(--radius-sm); font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.95; }
.article-content blockquote footer { font-family: var(--font-body); font-size: var(--step--1); color: var(--steel); margin-top: 0.7em; }
.article-content ul, .article-content ol { padding-left: 1.3em; }
.article-content li + li { margin-top: 0.45em; }
.article-content table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.article-content th, .article-content td { border: var(--hair); padding: 0.8em 0.7em; text-align: left; }
.article-content thead th { background: var(--mist); font-family: var(--font-display); }
.article-content code { font-family: var(--font-mono); font-size: 0.88em; background: var(--line-2); padding: 0.15em 0.4em; border-radius: 3px; }
.article-content figcaption { font-size: var(--step--2); color: var(--steel); margin-top: 0.6em; }

.toc { position: sticky; top: 5.5rem; border: var(--hair); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--white); font-size: var(--step--1); }
.toc h2 { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); margin-bottom: 0.8rem; font-weight: 400; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.toc a { display: block; padding: 0.42em 0 0.42em 0.85em; border-left: 2px solid var(--line); text-decoration: none; color: var(--steel); line-height: 1.5; transition: color .2s var(--ease), border-color .2s var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); border-left-color: var(--cta); font-weight: 500; }
.toc .is-sub a { padding-left: 1.8em; font-size: 0.94em; }

.article-nav { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-top: var(--hair); padding-top: 2rem; margin-top: 3rem; }
.article-nav a { text-decoration: none; display: grid; gap: 0.3rem; color: var(--ink); }
.article-nav span { font-family: var(--font-mono); font-size: var(--step--2); color: var(--steel); letter-spacing: .12em; }
.article-nav strong { font-family: var(--font-display); font-size: var(--step-0); }
.article-nav a:hover strong { color: var(--cta); }

/* =============================================================
   19. Footer
   ============================================================= */
.site-footer { background: var(--ink); color: #C3D2E4; padding-block: var(--block) 2.5rem; margin-bottom: 4.5rem; }
@media (min-width: 62em) { .site-footer { margin-bottom: 0; } }
.footer-grid { display: grid; gap: 2.5rem var(--gap); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer-grid h2 { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); font-weight: 400; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: var(--step--1); }
.footer-grid a { text-decoration: none; color: #C3D2E4; }
.footer-grid a:hover { color: var(--white); text-decoration: underline; }
.footer-brand .brand-name, .footer-brand .brand { color: var(--white); }
.footer-brand p { font-size: var(--step--1); color: #93A9C2; max-width: 24em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; font-size: var(--step--2); color: var(--steel); }
.footer-disclosure { font-size: var(--step--2); color: #93A9C2; line-height: 1.8; margin-top: 1.5rem; max-width: 52em; }

/* =============================================================
   20. Utilities / Motion
   ============================================================= */
.text-center { text-align: center; }
.measure { max-width: 36em; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }

.to-top { position: fixed; right: 1rem; bottom: 5.5rem; z-index: 40; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; background: var(--navy); color: var(--white); border: none; border-radius: 50%; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(.5rem); transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 62em) { .to-top { bottom: 1.2rem; } }

[data-reveal] { opacity: 0; transform: translateY(1rem); }
.has-js-motion [data-reveal] { transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--reveal-delay, 0ms); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .bar-fill { width: var(--w, 0%); }
}

/* =============================================================
   21. WordPress
   ============================================================= */
.alignwide { width: min(52rem, 92vw); margin-inline: calc(50% - min(26rem, 46vw)); max-width: none; }
.alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.aligncenter { margin-inline: auto; }
.pagination { border-top: var(--hair); padding-top: 1.8rem; margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pagination .page-numbers { min-width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; font-family: var(--font-mono); font-size: var(--step--1); border: var(--hair); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.pagination .page-numbers:hover { border-color: var(--cta); }
.pagination .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.search-form { display: flex; gap: 0.5rem; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; font: inherit; font-size: var(--step-0); padding: 0.7em 0.9em; border: var(--hair); border-radius: var(--radius-sm); background: var(--white); }
.search-form .search-submit { font: 700 var(--step--1)/1 var(--font-display); padding: 0 1.2em; border: 1px solid var(--navy); background: var(--navy); color: var(--white); border-radius: var(--radius-sm); cursor: pointer; }
.no-results { border: var(--hair); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--mist); }
.admin-bar .site-header { top: 32px; }
.admin-bar .toc { top: 7.5rem; }
@media screen and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.custom-logo { max-height: 2.2rem; width: auto; }

@media print {
  .site-header, .site-footer, .toc, .to-top, .sticky-cta, .hero-ambient, .quiz { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
}

/* =============================================================
   Contact Form 7 — RASHIN テーマ用スタイル
   style.css の末尾に追記するか、外観 > カスタマイズ > 追加CSS に貼る。
   CF7 本体のCSSを上書きするため、セレクタは意図的に長めにしています。
   ============================================================= */

/* ---------- 全体 ---------- */
.wpcf7 {
  max-width: 34rem;
  margin-block: 2rem;
}
.wpcf7 form.wpcf7-form { margin: 0; }

/* CF7 が自動で入れる p / br を無害化（下のフィルタを使わない場合の保険） */
.wpcf7 form.wpcf7-form > p { margin: 0; }
.wpcf7 form.wpcf7-form > br { display: none; }

.rashin-form {
  display: grid;
  gap: 1.5rem;
}

/* ---------- 各項目 ---------- */
.rashin-form .field {
  display: grid;
  gap: 0.5rem;
}

.rashin-form .field > label {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.rashin-form .req,
.rashin-form .opt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  padding: 0.28em 0.6em;
  border-radius: 3px;
  line-height: 1;
}
.rashin-form .req { background: var(--cta); color: #fff; }
.rashin-form .opt { background: var(--line-2); color: var(--steel); }

.rashin-form .hint {
  font-size: 0.76rem;
  color: var(--steel);
  line-height: 1.7;
}

/* CF7 は入力欄を span.wpcf7-form-control-wrap で包む */
.rashin-form .wpcf7-form-control-wrap { display: block; }

/* ---------- 入力欄 ---------- */
.wpcf7 .rashin-form :is(
  input[type="text"], input[type="email"], input[type="url"],
  input[type="tel"], input[type="number"], input[type="date"],
  textarea, select
) {
  width: 100%;
  font: inherit;
  font-size: 1rem;              /* iOS で拡大されないよう16px相当を維持 */
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  padding: 0.8em 0.95em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(11, 27, 46, .04);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.wpcf7 .rashin-form :is(input, textarea, select):hover { border-color: var(--steel); }

.wpcf7 .rashin-form :is(input, textarea, select):focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(232, 84, 47, .16);
}

.wpcf7 .rashin-form ::placeholder { color: #A9B6C7; }

.wpcf7 .rashin-form textarea {
  min-height: 10rem;
  resize: vertical;
}

/* セレクトの矢印を自前で描く */
.wpcf7 .rashin-form select {
  padding-right: 2.6em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235B7395' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  background-size: 12px 8px;
  cursor: pointer;
}
