/* ================================================================
   mottoku koramu — 共有スタイル
   mottoku 本体の style.css の CSS 変数を継承する。
   ================================================================ */

.koramu-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 48px;
  align-items: start;
}

.koramu-main { min-width: 0; }

.koramu-side {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 0.9rem;
}

.koramu-side-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 0;
  box-shadow: var(--shadow-sm);
}

.koramu-side-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 18px 10px;
}

.koramu-toc { list-style: none; padding: 0; margin: 0; }

.koramu-toc a {
  display: block;
  padding: 8px 18px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  font-weight: 500;
  line-height: 1.5;
}

.koramu-toc a:hover {
  color: var(--brand);
  background: var(--brand-lighter);
}

.koramu-toc a.active {
  color: var(--brand-deep);
  border-left-color: var(--brand);
  background: var(--brand-lighter);
  font-weight: 600;
}

/* ===== Breadcrumb ===== */
.koramu-crumbs {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 0.82rem; color: var(--muted);
  list-style: none; padding: 0; margin: 0 0 18px;
}
.koramu-crumbs a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
.koramu-crumbs a:hover { color: var(--brand); }
.koramu-crumbs .sep { color: var(--muted-light); font-size: 0.72rem; margin: 0 2px; }
.koramu-crumbs .current { color: var(--text); font-weight: 500; }

/* ===== Article header ===== */
.koramu-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.koramu-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 0 0 14px;
}
.koramu-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--muted);
}
.koramu-meta .item { display: flex; align-items: center; gap: 5px; }
.koramu-cat-pill {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  background: var(--brand-lighter); color: var(--brand-deep);
  letter-spacing: 0.05em;
}

/* ===== Section card ===== */
.koramu-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.koramu-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-lighter);
  scroll-margin-top: 90px;
}

.koramu-section h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
  scroll-margin-top: 90px;
}

.koramu-section p {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.koramu-section p:last-child { margin-bottom: 0; }

.koramu-section strong {
  color: var(--text);
  font-weight: 700;
  background: linear-gradient(transparent 60%, var(--brand-light) 60%);
  padding: 0 2px;
}

.koramu-section a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-color: var(--brand-light);
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.koramu-section a:hover { color: var(--brand); text-decoration-color: var(--brand); }

.koramu-section ul, .koramu-section ol {
  margin: 0 0 14px;
  padding-left: 24px;
}
.koramu-section li {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ===== Info callouts ===== */
.koramu-callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  margin: 18px 0;
  font-size: 0.92rem;
  line-height: 1.75;
}
.koramu-callout-icon { flex-shrink: 0; font-size: 1.2rem; line-height: 1.5; }
.koramu-callout-body { flex: 1; }
.koramu-callout-body p { margin: 0; }

.koramu-callout.tip { background: var(--brand-lighter); border-color: var(--brand); color: var(--brand-darker); }
.koramu-callout.warn { background: #fffbeb; border-color: #d97706; color: #78350f; }
.koramu-callout.info { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.koramu-callout.note { background: var(--border-light); border-color: var(--muted-light); color: var(--text-secondary); }

[data-theme="dark"] .koramu-callout.warn { background: #2a1f08; color: #fde68a; }
[data-theme="dark"] .koramu-callout.info { background: #0f1f3a; color: #bfdbfe; }
[data-theme="dark"] .koramu-callout.note { background: #1a2638; color: var(--text-secondary); }

/* ===== Table ===== */
.koramu-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.koramu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.koramu-table th {
  background: var(--brand-lighter);
  color: var(--brand-darker);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.86rem;
  border-bottom: 2px solid var(--border);
}

.koramu-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}

.koramu-table tr:last-child td { border-bottom: none; }
.koramu-table tr:hover td { background: var(--brand-bg); }

.koramu-table td.num, .koramu-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.koramu-table .hl { color: var(--brand-deep); font-weight: 700; }

[data-theme="dark"] .koramu-table th { background: var(--brand-bg); color: var(--text); }

/* ===== Key facts grid ===== */
.koramu-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}

.koramu-fact {
  background: var(--brand-bg);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.koramu-fact-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-deep);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.koramu-fact-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.koramu-fact-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

[data-theme="dark"] .koramu-fact { background: var(--brand-bg); border-color: var(--brand-deep); }

/* ===== Steps ===== */
.koramu-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.koramu-steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 56px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.koramu-steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
}

.koramu-steps li strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
  margin-bottom: 4px;
  background: none;
  padding: 0;
}

.koramu-steps li span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== FAQ ===== */
.koramu-faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.koramu-faq summary {
  padding: 16px 18px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  list-style: none;
  position: relative;
  padding-right: 44px;
}

.koramu-faq summary::-webkit-details-marker { display: none; }

.koramu-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.koramu-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.koramu-faq details > div {
  padding: 0 18px 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
  border-top: 1px solid var(--border-light);
}

.koramu-faq details > div p { margin: 12px 0 0; }

/* ===== Interactive widget shell ===== */
.koramu-widget {
  background: linear-gradient(135deg, var(--brand-bg) 0%, var(--card) 80%);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.koramu-widget-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

.koramu-widget-title::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: var(--brand);
}

.koramu-widget label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.koramu-widget input[type="number"],
.koramu-widget input[type="text"],
.koramu-widget select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.koramu-widget input:focus,
.koramu-widget select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.koramu-widget button {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.koramu-widget button:hover { background: var(--brand-deep); }
.koramu-widget button:active { transform: scale(0.98); }

.koramu-widget-grid {
  display: grid;
  gap: 14px;
}

.koramu-widget-result {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-sm);
}

.koramu-widget-result-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.koramu-widget-result-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.koramu-widget-result-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.6;
}

/* ===== Related articles ===== */
.koramu-related {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.koramu-related h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

.koramu-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.koramu-related-card {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.koramu-related-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.koramu-related-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 6px;
}

.koramu-related-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

/* ===== Article footer note ===== */
.koramu-foot-note {
  margin-top: 36px;
  padding: 16px 20px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ===== Index page ===== */
.koramu-idx-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 18px;
}
.koramu-idx-hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.koramu-idx-hero p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.koramu-idx-cats {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 60px;
}

.koramu-idx-cat {
  margin-bottom: 36px;
}

.koramu-idx-cat-title {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-lighter);
}

.koramu-idx-cat-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.koramu-idx-cat-title .count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.koramu-idx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.koramu-idx-card {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.koramu-idx-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ===== Footer link to koramu (subtle entry) ===== */
.footer-koramu-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted) !important;
  margin-top: 6px;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.footer-koramu-link:hover { opacity: 1; color: var(--brand) !important; }

/* ===== Mobile responsive ===== */
@media (max-width: 900px) {
  .koramu-wrap {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 14px 60px;
  }
  .koramu-side {
    position: static;
    max-height: none;
    overflow-y: visible;
    order: 2;
  }
  .koramu-header h1 { font-size: 1.5rem; }
  .koramu-section { padding: 20px 18px; }
  .koramu-section h2 { font-size: 1.2rem; }
  .koramu-widget { padding: 18px; }
  .koramu-widget-result-value { font-size: 1.5rem; }
}
