/* =====================================================
   legal.css — Policy & Tokusho page styles
   Loaded after base.css + layout.css. Shared between
   /policy (利用規約) and /tokusho (特定商取引法に基づく表記).

   Sections:
     1. .legal-hero               — centered editorial hero on cream
     2. .legal-body               — reading-width wrapper
     3. .legal-intro              — opening paragraph card
     4. .legal-article            — numbered editorial article (policy)
     5. .legal-section-block      — labeled section block (tokusho)
     6. .legal-table              — definition table (tokusho)
     7. .legal-callout            — highlighted notice box
     8. .legal-meta               — date + signature footer
     9. .legal-link-card          — cross-link card to sibling page
    10. .section-cta              — bottom CTA mirror (for partials/cta.php)
   ===================================================== */

/* =====================
   1. LEGAL HERO — Centered editorial header on cream
   Mirrors the course-hero rhythm (breadcrumb + headline) but
   without the right-side image. A subtle dotted gold pattern
   provides texture; a soft cream wash at the bottom feathers
   the hero into the white body section below.
   ===================== */
.legal-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(360px, 50vh, 460px);
  padding: calc(var(--header-h) + var(--sp-lg)) 0 var(--sp-xl);
  background-color: var(--bg-cream);
}
.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(245, 158, 11, 0.10) 1px, transparent 1.2px);
  background-size: 28px 28px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.legal-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent 0%, var(--bg-cream) 100%);
  pointer-events: none;
  z-index: 0;
}
.legal-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.legal-hero-breadcrumb {
  margin: 0 0 1.25rem;
  display: flex;
  justify-content: flex-start;
}
.legal-hero-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}
.legal-hero-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.legal-hero-breadcrumb-item + .legal-hero-breadcrumb-item::before {
  content: '/';
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
}
.legal-hero-breadcrumb-link {
  color: var(--text-light);
  transition: color var(--transition);
}
.legal-hero-breadcrumb-link:hover {
  opacity: 1;
  color: var(--primary);
}
.legal-hero-breadcrumb-current {
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--text-main);
}

.legal-hero-eyebrow {
  display: block;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.legal-hero-title {
  font-size: clamp(1.85rem, 3.6vw, 2.55rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-main);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
.legal-hero-title-em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--text-main);
  white-space: nowrap;
}
.legal-hero-title-em::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: -0.12em;
  height: 0.32em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 18' preserveAspectRatio='none'><path d='M4 12 Q 80 2, 160 8 T 316 6' fill='none' stroke='%23F59E0B' stroke-width='5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.legal-hero-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.95;
  margin: 0;
}

@media (max-width: 520px) {
  .legal-hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: var(--sp-lg);
  }
  .legal-hero-title { font-size: 1.6rem; line-height: 1.5; }
}

/* =====================
   2. LEGAL BODY — Fills the shared 1080px container
   The wrapper itself has no width cap so it sits inside .container
   and matches the rest of the site's reading rhythm.
   ===================== */
.section-legal { background: var(--bg-white); }
.legal-body {
  margin: 0 auto;
}

/* =====================
   3. LEGAL INTRO — Opening paragraph card
   ===================== */
.legal-intro {
  margin-bottom: var(--sp-xl);
  padding: var(--sp-lg);
  background: var(--bg-cream);
  border: 1px solid var(--border-warm);
  border-radius: var(--r-md);
  font-size: 0.94rem;
  line-height: 1.95;
  color: var(--text-light);
}
.legal-intro p { margin: 0 0 0.65rem; }
.legal-intro p:last-child { margin-bottom: 0; }
.legal-intro ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  list-style: none;
}
.legal-intro ul li {
  position: relative;
  padding-left: 0.2rem;
  margin: 0.2rem 0;
}
.legal-intro ul li::before {
  content: '・';
  position: absolute;
  left: -1.1rem;
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 520px) {
  .legal-intro { padding: 1.25rem; }
}

/* =====================
   4. LEGAL ARTICLE — Numbered editorial sections (policy)
   Layout: a big handwritten Caveat number on the upper left,
   article title (h2 with 第N条 prefix) on the right, body below.
   Dashed separator between articles.
   ===================== */
.legal-article {
  position: relative;
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px dashed var(--border-warm);
}
.legal-article:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.legal-article-head {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.legal-article-num {
  font-family: var(--font-deco);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 0.85;
  letter-spacing: 0;
  transform: rotate(-4deg);
  transform-origin: left center;
}
.legal-article-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0;
  letter-spacing: 0.005em;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.legal-article-title-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
}
.legal-article-title-text { display: inline-block; }

.legal-article-body p {
  font-size: 0.93rem;
  line-height: 1.95;
  color: var(--text-light);
  margin: 0 0 0.6rem;
}
.legal-article-body p:last-child { margin-bottom: 0; }
.legal-article-body p.indent { padding-left: 1.5em; }

.legal-article-body h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--primary-dark);
  margin: 1.6rem 0 0.75rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--primary);
}
.legal-article-body h3:first-child { margin-top: 0; }

.legal-article-body em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding: 0 0.1em;
  z-index: 0;
}
.legal-article-body em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 0.3em;
  background: rgba(245, 158, 11, 0.22);
  z-index: -1;
}

.legal-article-body a {
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-article-body a:hover { opacity: 1; color: var(--primary-dark); }

@media (max-width: 520px) {
  .legal-article-head {
    grid-template-columns: 3.2rem 1fr;
    gap: 0.85rem;
  }
  .legal-article-num { font-size: 2rem; }
  .legal-article-title { font-size: 1.05rem; }
}

/* =====================
   5. LEGAL SECTION BLOCK — Labeled section (tokusho)
   ===================== */
.legal-section-block {
  margin-bottom: var(--sp-xl);
}
.legal-section-block:last-child { margin-bottom: 0; }

.legal-section-head {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
}
.legal-section-num {
  font-family: var(--font-deco);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 0.85;
  transform: rotate(-4deg);
  transform-origin: left center;
}
.legal-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.legal-section-title-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
}

@media (max-width: 520px) {
  .legal-section-head {
    grid-template-columns: 3.2rem 1fr;
    gap: 0.85rem;
  }
  .legal-section-num { font-size: 2rem; }
  .legal-section-title { font-size: 1.1rem; }
}

/* =====================
   6. LEGAL TABLE — Definition table (tokusho key-value)
   Wraps in .legal-table-wrap for soft border + shadow.
   On mobile (≤640px), rows collapse: <th> stacks above <td>.
   ===================== */
.legal-table-wrap {
  border: 1px solid var(--border-warm);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: 0 4px 20px rgba(35, 25, 15, 0.06);
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.85;
  margin: 0;
}
.legal-table th,
.legal-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-warm);
  vertical-align: top;
  text-align: left;
}
.legal-table tr:last-child th,
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table th {
  width: 30%;
  background: var(--bg-warm);
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.legal-table td {
  color: var(--text-light);
  background: var(--bg-white);
}
.legal-table td p { margin: 0 0 0.5rem; }
.legal-table td p:last-child { margin: 0; }
.legal-table td a {
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-table td a:hover { opacity: 1; color: var(--primary-dark); }
.legal-table td ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-table td ul li {
  position: relative;
  padding-left: 1em;
  margin: 0.15rem 0;
}
.legal-table td ul li::before {
  content: '・';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.legal-table-label {
  display: block;
  font-family: var(--font-en);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
}
.legal-table-label:first-child { margin-top: 0; }

@media (max-width: 640px) {
  .legal-table { font-size: 0.88rem; }
  .legal-table thead { display: none; }
  .legal-table tbody { display: block; }
  .legal-table tr {
    display: block;
    border-bottom: 1px solid var(--border-warm);
  }
  .legal-table tr:last-child { border-bottom: 0; }
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.85rem 1rem;
    white-space: normal;
  }
  .legal-table th {
    padding-bottom: 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }
  .legal-table td { padding-top: 0.35rem; }
}

/* =====================
   7. LEGAL CALLOUT — Highlighted notice box
   Used for "返金不可" warnings and similar consumer notices.
   ===================== */
.legal-callout {
  margin: 0.75rem 0 0.85rem;
  padding: 0.85rem 1.05rem;
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.9;
}
.legal-callout-label {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.legal-callout p { margin: 0 0 0.4rem; }
.legal-callout p:last-child { margin: 0; }

/* =====================
   8. LEGAL META — Date + signature footer
   ===================== */
.legal-meta {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--border-warm);
  text-align: right;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.85;
}
.legal-meta p { margin: 0; }
.legal-meta-sig {
  display: block;
  font-family: var(--font-deco);
  font-size: 1.45rem;
  color: var(--primary);
  margin-top: 0.2rem;
  line-height: 1;
}

/* =====================
   9. LEGAL LINK CARD — Cross-link card (policy ↔ tokusho)
   ===================== */
.legal-link-card {
  margin-top: var(--sp-lg);
  padding: 1.1rem 1.4rem;
  background: var(--bg-cream);
  border: 1px solid var(--border-warm);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.legal-link-card:hover {
  opacity: 1;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.legal-link-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.legal-link-card-eyebrow {
  font-family: var(--font-en);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.legal-link-card-label {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.98rem;
}
.legal-link-card-arrow {
  flex-shrink: 0;
  color: var(--primary);
  font-weight: 700;
  transition: transform var(--transition);
}
.legal-link-card:hover .legal-link-card-arrow { transform: translateX(4px); }

@media (max-width: 520px) {
  .legal-link-card { padding: 1rem 1.1rem; gap: 0.85rem; }
  .legal-link-card-label { font-size: 0.92rem; }
}

/* =====================
  10. BOTTOM CTA — Mirrored from home.css so partials/cta.php renders
      correctly without needing home.css or course.css loaded.
   ===================== */
.section-cta {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-cream);
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(420px, 56vh, 560px);
  padding: clamp(var(--sp-xl), 8vw, var(--sp-2xl)) 0;
}
.cta-visual { position: absolute; inset: 0; z-index: 0; }
.cta-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
  display: block;
}
.cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(250, 247, 243, 0.96) 0%,
      rgba(250, 247, 243, 0.92) 30%,
      rgba(250, 247, 243, 0.78) 46%,
      rgba(250, 247, 243, 0.35) 62%,
      rgba(250, 247, 243, 0)    80%
    );
  pointer-events: none;
}
.cta-inner { position: relative; z-index: 2; width: 100%; }
.cta-content { max-width: min(540px, 50%); }
.cta-header { position: relative; z-index: 1; margin: 0 0 1.75rem; }
.cta-title {
  font-size: clamp(1.55rem, 1.55vw + 1.1rem, 2.25rem);
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}
.cta-title-em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--text-main);
  white-space: nowrap;
}
.cta-title-em::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: -0.12em;
  height: 0.32em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 18' preserveAspectRatio='none'><path d='M4 12 Q 80 2, 160 8 T 316 6' fill='none' stroke='%23F59E0B' stroke-width='5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.cta-title-break { display: inline; }
.cta-header-desc {
  font-size: clamp(0.86rem, 0.35vw + 0.78rem, 1rem);
  color: var(--text-light);
  line-height: 1.95;
  margin-top: 1.1rem;
}
.cta-header-desc em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
}
.cta-header-desc sup { font-size: 0.6em; vertical-align: super; }
.cta-header-break { display: inline; }
.cta-body { position: relative; z-index: 1; }
.cta-action { margin: 0 0 1.25rem; }
.cta-btn:hover { transform: none; }
.cta-btn-arrow {
  display: inline-block;
  margin-left: 0.35em;
  transition: transform var(--transition);
}
.cta-btn:hover .cta-btn-arrow { transform: translateX(4px); }
.cta-btn-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}
.cta-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.cta-checks li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
}
.cta-check-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 174, 239, 0.12);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.cta-alt {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 1.85rem 0 0;
}
.cta-alt-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ja);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  padding-bottom: 2px;
}
.cta-alt-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.cta-alt-link:hover { opacity: 1; }
.cta-alt-link:hover::after { transform: scaleX(1); }
.cta-alt-arrow {
  display: inline-block;
  margin-left: 0.35em;
  transition: transform var(--transition);
}
.cta-alt-link:hover .cta-alt-arrow { transform: translateX(4px); }

@media (max-width: 1023px) {
  .cta-img { object-position: 86% 50%; }
  .cta-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(250, 247, 243, 0.97) 0%,
        rgba(250, 247, 243, 0.93) 38%,
        rgba(250, 247, 243, 0.70) 58%,
        rgba(250, 247, 243, 0.25) 82%,
        rgba(250, 247, 243, 0)    100%
      );
  }
  .section-cta { min-height: clamp(400px, 50vh, 520px); }
  .cta-content { max-width: min(460px, 60%); }
}
@media (max-width: 767px) {
  .cta-img { object-position: 70% 92%; }
  .cta-overlay {
    background:
      linear-gradient(
        180deg,
        rgba(250, 247, 243, 0.96) 0%,
        rgba(250, 247, 243, 0.90) 50%,
        rgba(250, 247, 243, 0.55) 100%
      );
  }
  .section-cta {
    min-height: auto;
    padding: var(--sp-xl) 0;
    align-items: stretch;
  }
  .cta-content { max-width: 100%; }
  .cta-header { margin-bottom: 1.5rem; }
}
@media (max-width: 520px) {
  .cta-header-break { display: none; }
  .cta-btn { width: 100%; }
  .cta-btn-note { font-size: 0.74rem; }
  .cta-checks { gap: 0.4rem 0.95rem; margin-top: 1rem; }
  .cta-checks li { font-size: 0.75rem; }
  .cta-alt { margin-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-link-card-arrow,
  .cta-btn-arrow,
  .cta-alt-arrow { transition: none; }
}
