/* TreTre 法務ページ共通スタイル */
:root {
  --primary: #ff3d57;
  --accent: #df0b3e;
  --text: #1a1a1a;
  --text-sub: #666;
  --bg: #f4f8f7;
  --surface: #fff;
  --border: #e5e5e5;
  --font: 'Noto Sans JP', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(255, 140, 0, 0.22); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 max(20px, calc((100% - 1200px) / 2 + 20px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.legal-header .logo img { width: auto; height: 40px; }
.legal-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.legal-menu-btn:hover { background: rgba(0, 0, 0, 0.05); }
.legal-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.legal-menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.legal-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.legal-menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.legal-menu {
  position: absolute;
  top: 60px;
  right: max(20px, calc((100% - 1200px) / 2 + 20px));
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  padding: 8px;
  z-index: 20;
}
.legal-menu a {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
}
.legal-menu a:hover { background: #faf3ea; text-decoration: none; }
.legal-menu a.is-active { color: var(--primary); font-weight: 700; }

/* Hero */
.legal-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff3e2 0%, #fffdf9 55%, #f4f8f7 100%);
  border-bottom: 1px solid var(--border);
}
.legal-hero::after {
  content: "";
  position: absolute;
  right: max(24px, calc((100% - 1200px) / 2));
  bottom: -14px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  opacity: 0.85;
  box-shadow:
    -20px -20px 0 var(--primary),
    0 -20px 0 rgba(255, 140, 0, 0.45),
    -40px 0 0 rgba(255, 140, 0, 0.3),
    -20px -40px 0 rgba(255, 140, 0, 0.18);
}
.legal-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 20px 36px;
}
.legal-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.legal-hero h1 { font-size: 1.9rem; font-weight: 900; line-height: 1.4; }
.legal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.legal-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
}

/* Layout: TOC + Main */
.legal-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.legal-layout--single { grid-template-columns: minmax(0, 832px); justify-content: center; }
.legal-toc { padding: 40px 0 80px; }
.legal-toc nav { position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow-y: auto; }
.legal-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 10px;
}
.legal-toc ol { list-style: none; border-left: 2px solid var(--border); }
.legal-toc li a {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-sub);
  padding: 5px 0 5px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
}
.legal-toc li a:hover { color: var(--text); text-decoration: none; }
.legal-toc li a.is-current { color: var(--primary); font-weight: 700; border-left-color: var(--primary); }

/* Main */
.legal-main { padding: 40px 0 80px; min-width: 0; }
.legal-lead { color: var(--text-sub); font-size: 0.95rem; margin-bottom: 2em; }
.legal-main h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2em 0 0.8em;
  padding-left: 0.6em;
  border-left: 4px solid var(--primary);
  scroll-margin-top: 88px;
}
.legal-main h3 { font-size: 1rem; font-weight: 700; margin: 1.5em 0 0.5em; }
.legal-main h4 { font-size: 0.95rem; font-weight: 700; margin: 1.2em 0 0.4em; color: var(--text-sub); }
.legal-main p { margin: 0.6em 0; font-size: 0.92rem; }
.legal-main ol, .legal-main ul { margin: 0.6em 0 0.6em 1.4em; font-size: 0.92rem; }
.legal-main li { margin: 0.4em 0; }
.legal-main strong { font-weight: 700; }
.legal-main table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.88rem; }
.legal-main th, .legal-main td { border: 1px solid var(--border); padding: 0.6em 0.8em; text-align: left; vertical-align: top; }
.legal-main th { background: #faf3ea; font-weight: 700; white-space: nowrap; }
.legal-note { font-size: 0.85rem; color: var(--text-sub); margin: 0.4em 0; }
.legal-date { margin-top: 2.5em; font-size: 0.88rem; color: var(--text-sub); }

/* Footer */
.legal-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 32px 20px; text-align: center; }
.legal-footer nav { margin-bottom: 16px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: 0.85rem; }
.legal-footer .company { font-size: 0.8rem; color: var(--text-sub); line-height: 1.7; margin-bottom: 12px; }
.legal-footer .copyright { font-size: 0.75rem; color: var(--text-sub); }

@media (max-width: 1024px) {
  .legal-layout { grid-template-columns: minmax(0, 760px); }
  .legal-toc { display: none; }
}
@media (max-width: 600px) {
  .legal-hero h1 { font-size: 1.3rem; }
  .legal-eyebrow { font-size: 0.66rem; }
  .legal-badge { font-size: 0.7rem; padding: 2px 10px; }
  .legal-lead { font-size: 0.85rem; }
  .legal-main h2 { font-size: 1.02rem; }
  .legal-main h3 { font-size: 0.92rem; }
  .legal-main h4 { font-size: 0.86rem; }
  .legal-main { line-height: 1.7; }
  .legal-main p, .legal-main ol, .legal-main ul { font-size: 0.84rem; }
  .legal-main li { margin: 0.3em 0; }
  .legal-main table { font-size: 0.76rem; }
  .legal-main th, .legal-main td { padding: 0.5em 0.6em; }
  .legal-main th { white-space: normal; }
  .legal-note { font-size: 0.76rem; }
  .legal-date { font-size: 0.8rem; }
  .legal-footer nav { font-size: 0.8rem; }
}
