/* ============================================================
   レシピ分量計算ツール - 共通スタイル
   全ページ（計算ツール本体・解説・法務）で共有する基礎CSS
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: linear-gradient(135deg, #fff5e6 0%, #ffe0cc 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.7;
  padding-bottom: 0;
}

/* ========== サイトヘッダー（全ページ共通） ========== */
.site-header {
  background: #fff;
  border-bottom: 2px solid #ffd9b3;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-logo {
  font-size: 16px;
  font-weight: bold;
  color: #d97706;
  text-decoration: none;
  white-space: nowrap;
}

.site-logo:hover {
  color: #b45309;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 6px 10px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
}

.site-nav a:hover {
  background: #fff5e6;
  color: #d97706;
}

.site-nav a.active {
  background: #d97706;
  color: #fff;
}

/* ========== サイトフッター（全ページ共通） ========== */
.site-footer {
  margin-top: 40px;
  padding: 24px 16px;
  background: #fff;
  border-top: 1px solid #ffd9b3;
  text-align: center;
  color: #888;
  font-size: 13px;
}

.site-footer-links {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.site-footer-links a {
  color: #666;
  text-decoration: none;
}

.site-footer-links a:hover {
  color: #d97706;
  text-decoration: underline;
}

.site-footer-copyright {
  font-size: 12px;
  color: #aaa;
}

/* ========== コンテンツページ用の共通レイアウト ========== */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 32px 28px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 26px;
  color: #d97706;
  margin-bottom: 8px;
  line-height: 1.4;
}

.page-subtitle {
  font-size: 15px;
  color: #888;
  margin-bottom: 24px;
}

/* 見出し */
.page-card h2 {
  font-size: 20px;
  color: #444;
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ffd9b3;
}

.page-card h2:first-child,
.page-card h2.first {
  margin-top: 0;
}

.page-card h3 {
  font-size: 16px;
  color: #555;
  margin-top: 20px;
  margin-bottom: 8px;
}

.page-card p {
  margin-bottom: 12px;
  color: #444;
}

.page-card ul,
.page-card ol {
  margin: 12px 0 12px 24px;
  color: #444;
}

.page-card li {
  margin-bottom: 6px;
}

.page-card strong {
  color: #d97706;
}

/* ========== 早見表など、表組み ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #fffbf5;
  color: #d97706;
  font-weight: bold;
  border-bottom: 2px solid #ffd9b3;
}

.data-table tr:hover td {
  background: #fafafa;
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ========== 注釈・補足ボックス ========== */
.note-box {
  margin: 16px 0;
  padding: 14px 16px;
  background: #fffbf5;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  color: #555;
  font-size: 14px;
}

.note-box.warning {
  background: #fef3c7;
  border-left-color: #f59e0b;
  color: #92400e;
}

.note-box.tip {
  background: #f0fdf4;
  border-left-color: #16a34a;
  color: #166534;
}

.note-box-title {
  font-weight: bold;
  margin-bottom: 4px;
}

/* ========== CTA（計算ツールへの誘導ボタン） ========== */
.cta-box {
  margin: 28px 0;
  padding: 20px;
  background: linear-gradient(135deg, #fff5e6 0%, #ffe0cc 100%);
  border: 2px dashed #d97706;
  border-radius: 12px;
  text-align: center;
}

.cta-box p {
  margin-bottom: 12px;
  font-weight: bold;
  color: #555;
}

.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background: #d97706;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
}

.cta-button:hover {
  background: #b45309;
}

/* ========== リンクリスト（関連ページ案内） ========== */
.related-links {
  margin-top: 24px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.related-links-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
}

.related-links ul {
  margin: 0;
  list-style: none;
}

.related-links li {
  margin-bottom: 4px;
}

.related-links a {
  color: #d97706;
  text-decoration: none;
  font-size: 14px;
}

.related-links a:hover {
  text-decoration: underline;
}

/* ========== スマホ向け ========== */
@media (max-width: 600px) {
  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px;
  }

  .site-logo {
    text-align: center;
  }

  .site-nav {
    justify-content: center;
  }

  .site-nav a {
    padding: 5px 8px;
    font-size: 12px;
  }

  .page-container {
    padding: 16px 8px;
  }

  .page-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .page-title {
    font-size: 22px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }
}

/* ========== 印刷時 ========== */
@media print {
  body {
    background: #fff !important;
  }

  .site-header,
  .site-footer {
    display: none !important;
  }

  .page-card {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .cta-box {
    display: none;
  }
}
