/* =====================================================
   kurashicalc — 共通スタイルシート
   ライトテーマ固定
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700;900&family=Shippori+Mincho:wght@400;700;800&family=DM+Mono:wght@400;500&display=swap');

/* =====================
   VARIABLES
   ===================== */
:root {
  --bg:         #f7f5f0;
  --bg2:        #efede8;
  --surface:    #ffffff;
  --card:       #ffffff;
  --border:     #e0dcd4;
  --border2:    #ccc8c0;

  --accent:     #c0392b;
  --accent-bg:  #fdf0ee;
  --accent2:    #a0720a;

  --text:       #1a1814;
  --text2:      #4a4640;
  --muted:      #9a9590;

  --green:      #1a7a4a;
  --green-bg:   #edf7f2;
  --red:        #c0392b;
  --red-bg:     #fdf0ee;
  --yellow:     #a0720a;
  --yellow-bg:  #fef9ed;
  --orange:     #c07a20;
  --orange-bg:  #fef3e8;
  --purple:     #6d28d9;
  --purple-bg:  #f5f3ff;

  --shadow:     0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.12);

  --radius:     10px;
  --radius-sm:  6px;
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Serif JP', serif;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
strong { font-weight: 700; color: var(--text); }
img { max-width: 100%; display: block; }

/* =====================
   NAV
   ===================== */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 1px 0 var(--border);
}
.site-nav .logo {
  font-family: 'DM Mono', monospace;
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex; align-items: center; gap: 24px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
@media(max-width:560px){
  .site-nav { padding: 0 20px; }
  .nav-links .hide-sp { display: none; }
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 32px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
}
.site-footer a:hover { color: var(--text); }

/* =====================
   LAYOUT UTILS
   ===================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* =====================
   CARD
   ===================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
@media(max-width:560px){ .card { padding: 24px 20px; } }

.section-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.section-eyebrow::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--border);
}

/* =====================
   BUTTONS
   ===================== */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Shippori Mincho', serif;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 32px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  width: 100%;
  text-align: center;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

/* =====================
   FORM ELEMENTS
   ===================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text2); }
.field label strong { color: var(--text); }
.field-hint { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }

.input-wrap { position: relative; }
.input-wrap input,
.input-wrap select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: 'Noto Serif JP', serif;
  padding: 12px 44px 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.input-wrap select { padding-right: 14px; font-size: 14px; cursor: pointer; }
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.input-unit {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-family: 'DM Mono', monospace; font-size: 12px;
  color: var(--muted); pointer-events: none;
}

/* RANGE SLIDER */
input[type=range] {
  width: 100%; -webkit-appearance: none;
  height: 5px;
  background: var(--border2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* TOOLTIP */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  font-family: 'DM Mono', monospace;
  font-size: 9px; color: var(--muted);
  cursor: help; margin-left: 4px;
  vertical-align: middle;
  position: relative;
}
.tip:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  font-size: 11px; border-radius: var(--radius-sm);
  padding: 8px 12px; width: 200px;
  line-height: 1.6; z-index: 10;
  pointer-events: none; white-space: normal;
}

/* =====================
   CALLOUT BOXES
   ===================== */
.callout {
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.85;
  border-left: 3px solid;
}
.callout-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em;
  margin-bottom: 6px; font-weight: 500;
}
.callout.info   { background: var(--yellow-bg); border-color: var(--yellow); }
.callout.info   .callout-label { color: var(--yellow); }
.callout.good   { background: var(--green-bg);  border-color: var(--green); }
.callout.good   .callout-label { color: var(--green); }
.callout.warn   { background: var(--red-bg);    border-color: var(--red); }
.callout.warn   .callout-label { color: var(--red); }

/* =====================
   TABLE
   ===================== */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--bg2);
  padding: 12px 16px;
  text-align: left;
  font-size: 13px; font-weight: 700;
  border-bottom: 2px solid var(--border2);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg2); }
.tag-new { background: var(--accent-bg); color: var(--accent); font-family: 'DM Mono', monospace; font-size: 11px; padding: 2px 7px; border-radius: 3px; margin-left: 6px; }
.tag-old { background: var(--bg2); color: var(--muted); font-family: 'DM Mono', monospace; font-size: 11px; padding: 2px 7px; border-radius: 3px; margin-left: 6px; }

/* =====================
   VERDICT (結果判定)
   ===================== */
.verdict {
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  border: 1.5px solid;
  position: relative; overflow: hidden;
}
.verdict::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
}
.verdict.safe   { border-color: var(--green);  background: var(--green-bg); }
.verdict.safe::before   { background: var(--green); }
.verdict.warn   { border-color: var(--yellow); background: var(--yellow-bg); }
.verdict.warn::before   { background: var(--yellow); }
.verdict.danger { border-color: var(--red);    background: var(--red-bg); }
.verdict.danger::before { background: var(--red); }
.verdict-icon   { font-size: 28px; margin-bottom: 8px; }
.verdict-title  { font-size: 20px; font-weight: 900; margin-bottom: 8px; font-family: 'Shippori Mincho', serif; }
.verdict-desc   { font-size: 14px; color: var(--text2); line-height: 1.85; }

/* =====================
   WALL ROWS
   ===================== */
.walls-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.walls-card-head {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.14em;
  color: var(--accent);
  background: var(--bg2);
}
.wall-row {
  display: flex; align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  gap: 14px; transition: background 0.15s;
}
.wall-row:last-child { border-bottom: none; }
.wall-row:hover { background: var(--bg2); }
.wall-amount { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; width: 72px; flex-shrink: 0; }
.wall-info { flex: 1; }
.wall-name { font-size: 13px; margin-bottom: 3px; }
.wall-desc { font-size: 11px; color: var(--muted); }
.wall-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.wall-bar-fill { height: 100%; border-radius: 2px; transition: width 0.8s cubic-bezier(0.16,1,0.3,1); }
.wall-badge { font-family: 'DM Mono', monospace; font-size: 11px; padding: 3px 9px; border-radius: 3px; flex-shrink: 0; }
.wall-badge.over   { background: var(--red-bg);    color: var(--red); }
.wall-badge.under  { background: var(--green-bg);  color: var(--green); }
.wall-badge.near   { background: var(--yellow-bg); color: var(--yellow); }
.wall-margin { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); width: 80px; text-align: right; flex-shrink: 0; }
@media(max-width:480px){ .wall-margin { display: none; } }

/* =====================
   COMPARE
   ===================== */
.compare-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.compare-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.compare-title::before { content: ''; width: 4px; height: 18px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
@media(max-width:480px){ .compare-grid { grid-template-columns: 1fr; } }
.compare-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px; text-align: center;
}
.compare-box .c-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; font-family: 'DM Mono', monospace; }
.compare-box .c-amount { font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 500; color: var(--text); }
.compare-box .c-note { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: 'DM Mono', monospace; }
.compare-box.better { border-color: var(--green); background: var(--green-bg); }
.compare-box.better .c-amount { color: var(--green); }
.compare-box.worse  { border-color: var(--red); background: var(--red-bg); }
.compare-box.worse  .c-amount { color: var(--red); }
.compare-arrow { text-align: center; font-size: 18px; color: var(--muted); }
.compare-diff { text-align: center; margin-top: 16px; font-size: 14px; }
.diff-up   { color: var(--green); font-weight: 700; }
.diff-down { color: var(--red); font-weight: 700; }

/* =====================
   ADVICE
   ===================== */
.advice-list { display: flex; flex-direction: column; gap: 12px; }
.advice-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.85; }
.advice-num {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--accent); background: var(--accent-bg);
  border-radius: 3px; padding: 2px 7px;
  flex-shrink: 0; margin-top: 3px;
}

/* =====================
   ARTICLE STYLES
   ===================== */
.article-meta { margin-bottom: 40px; }
.article-category {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.14em;
  color: var(--accent); background: var(--accent-bg);
  border-radius: 3px; padding: 3px 10px;
  margin-bottom: 16px;
}
.article-title {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 800; line-height: 1.3;
  margin-bottom: 20px; letter-spacing: -0.01em;
}
.article-info {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--muted);
}
.toc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 22px 28px; margin: 36px 0;
}
.toc-title {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 12px;
}
.toc ol { padding-left: 18px; }
.toc li { font-size: 13px; margin-bottom: 5px; }
.toc a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.toc a:hover { color: var(--accent); }

.article-body h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 22px; font-weight: 800;
  margin: 52px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.article-body h2::before { content: '── '; color: var(--accent); font-size: 16px; }
.article-body h3 {
  font-size: 17px; font-weight: 700;
  margin: 32px 0 12px; color: var(--accent2);
}
.article-body p { font-size: 15px; color: var(--text2); margin-bottom: 18px; line-height: 1.95; }
.article-body strong { color: var(--text); }
.article-body a { color: var(--accent); }

/* CTA BOX */
.cta-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px; margin: 40px 0;
  text-align: center;
}
.cta-box h3 { font-size: 18px; margin-bottom: 10px; }
.cta-box p { font-size: 14px; color: var(--text2); margin-bottom: 20px; }
.cta-btn {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-family: 'Noto Serif JP', serif;
  font-weight: 700; font-size: 15px;
  padding: 14px 32px; border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }

/* RELATED */
.related { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--border); }
.related-title { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:480px){ .related-grid { grid-template-columns: 1fr; } }
.related-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px;
  text-decoration: none; display: block;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.related-card .r-cat { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--accent); margin-bottom: 7px; }
.related-card .r-ttl { font-size: 14px; color: var(--text); line-height: 1.6; }

/* =====================
   PAGE-SPECIFIC: PRIVACY / CONTACT
   ===================== */
.page-label { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.15em; color: var(--accent); margin-bottom: 16px; }
.page-title { font-family: 'Shippori Mincho', serif; font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.page-updated { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); margin-bottom: 40px; }

.prose h2 {
  font-size: 16px; font-weight: 700;
  margin: 36px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--text);
}
.prose p { font-size: 14px; color: var(--text2); margin-bottom: 12px; line-height: 1.85; }
.prose ul { padding-left: 20px; margin-bottom: 12px; }
.prose ul li { font-size: 14px; color: var(--text2); margin-bottom: 5px; }

/* CONTACT FORM */
.form-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow);
}
@media(max-width:560px){ .form-card { padding: 24px 20px; } }
.form-card .field { margin-bottom: 22px; }
.form-card textarea {
  width: 100%; min-height: 150px; resize: vertical;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'Noto Serif JP', serif; font-size: 15px;
  padding: 12px 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.form-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
#success-msg {
  display: none;
  background: var(--green-bg); border: 1px solid var(--green);
  border-radius: var(--radius); padding: 32px; text-align: center; margin-top: 20px;
}
#success-msg .s-icon { font-size: 36px; margin-bottom: 10px; }
#success-msg h3 { font-size: 20px; margin-bottom: 8px; color: var(--green); }
#success-msg p { font-size: 14px; color: var(--text2); }

/* =====================
   FOOTER NOTE
   ===================== */
.footer-note {
  font-size: 11px; color: var(--muted);
  font-family: 'DM Mono', monospace;
  line-height: 1.85;
  border-top: 1px solid var(--border);
  padding-top: 20px; margin-top: 28px;
}
.reset-link {
  display: block; text-align: center;
  color: var(--muted); font-size: 13px;
  margin-top: 20px; cursor: pointer;
  font-family: 'DM Mono', monospace; text-decoration: underline;
}
.reset-link:hover { color: var(--text); }

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-down { animation: fadeDown 0.5s ease both; }
.anim-up   { animation: fadeUp  0.5s ease both; }
