/* ============================================================
   MIRAI JAPAN 共通基盤
   design-preview / global-contract.json のデザイントークンに準拠。
   影響範囲を限定するため、すべて .mj- プレフィックスで閉じる。
   既存テーマのスタイルは上書きしない。
   ============================================================ */

:root {
  --mj-ink: #12334d;
  --mj-brand: #09629e;
  --mj-brand-dark: #084b7b;
  --mj-brand-soft: #dfedf8;
  --mj-mist: #edf7fc;
  --mj-surface: #fbfdff;
  --mj-line: #c9dfe9;
  --mj-muted: #506a7e;

  --mj-container: 1200px;
  --mj-gutter: 44px;
  --mj-gutter-mobile: 24px;

  --mj-font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --mj-font-serif: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --mj-font-figure: Georgia, "Times New Roman", serif;

  /* 参照 style.css は body{font-size:17px} のあとに body{font-size:18px} で上書きしている */
  --mj-body-size: 18px;
  --mj-line-height: 1.95;
}

/* ---- レイアウト ---- */
.mj-section {
  font-family: var(--mj-font-body);
  font-size: var(--mj-body-size);
  line-height: var(--mj-line-height);
  color: var(--mj-ink);
}

.mj-wrap {
  max-width: var(--mj-container);
  margin-inline: auto;
  padding-inline: var(--mj-gutter);
}

@media (max-width: 760px) {
  .mj-wrap {
    padding-inline: var(--mj-gutter-mobile);
  }
}

/* ---- タイポグラフィ ----
   参照 style.css: .serif,h1,h2{font-family:'Noto Serif JP',serif;font-weight:400}
   h3 は明朝に含まれない（.pathway h3 など、必要な箇所だけ個別に明朝を指定している）*/
.mj-section h1,
.mj-section h2 {
  font-family: var(--mj-font-serif);
  font-weight: 400;
  color: var(--mj-ink);
  margin-block-start: 0;
  text-wrap: balance;
}

.mj-section h3 {
  font-family: var(--mj-font-body);
  font-weight: 400;
  color: var(--mj-ink);
  margin-block-start: 0;
}

.mj-section p {
  color: var(--mj-muted);
  margin-block-start: 0;
}

.mj-eyebrow {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mj-brand);
  margin-block-end: 22px;
}

.mj-lead {
  font-size: 17px;
  line-height: 2.1;
}

/* ---- ボタン ---- */
.mj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 38px;
  min-height: 54px;
  padding: 15px 25px;
  border: 1px solid var(--mj-brand);
  border-radius: 2px;
  background: var(--mj-brand);
  color: #fff;
  font-size: 15px;
  line-height: 1.7;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mj-btn::after {
  content: "↗";
  font-size: 20px;
}

.mj-btn:hover {
  background: var(--mj-brand-dark);
  border-color: var(--mj-brand-dark);
}

.mj-btn--outline {
  background: transparent;
  color: var(--mj-brand);
  border-color: #84b4d2;
}

.mj-btn--outline:hover {
  background: var(--mj-brand-soft);
  border-color: #84b4d2;
}

.mj-textlink {
  display: inline-flex;
  gap: 36px;
  padding-block: 7px;
  border-block-end: 1px solid #84a9bf;
  font-size: 15px;
  text-decoration: none;
  color: inherit;
}

.mj-textlink::after {
  content: "→";
}

.mj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 25px;
}

/* ---- フォーカス（アクセシビリティ） ---- */
.mj-section a:focus-visible,
.mj-section button:focus-visible,
.mj-section summary:focus-visible,
.mj-section input:focus-visible {
  outline: 3px solid var(--mj-brand);
  outline-offset: 4px;
}

/* ---- 動きの制御 ----
   parallax / reveal は各セクションのJSが .mj-motion-* を付け外しする。
   OSの「視差効果を減らす」設定を最優先で尊重する。 */
.mj-parallax {
  transform: translate3d(0, var(--mj-parallax-y, 0px), 0);
  will-change: transform;
}

.mj-motion-paused .mj-parallax {
  transform: none !important;
}

@media (max-width: 760px) {
  .mj-parallax {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mj-parallax {
    transform: none !important;
  }
}

/* ---- 動きの停止/再開ボタン ---- */
.mj-motion-controls {
  display: flex;
  justify-content: flex-end;
  margin-block-end: 18px;
}

.mj-motion-toggle {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #a8c7d9;
  border-radius: 22px;
  background: none;
  color: #41657d;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.mj-motion-toggle:hover {
  background: #dbeef9;
}

@media (prefers-reduced-motion: reduce) {
  .mj-motion-controls {
    display: none;
  }
}

/* 動きを止めたとき・OSの視差軽減・画面外・タブ非表示では、
   視差だけでなくCSSアニメーションも止める */
.mj-anim-paused [data-mj-animated] {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-mj-animated] {
    animation: none !important;
  }
}

/* ============================================================
   セクション共通の見出しブロック（eyebrow + 見出し + 説明）
   ============================================================ */
.mj-head {
  max-width: 46em;
  margin-block-end: 42px;
}

/* 参照 .sectionhead h2{font-size:36px;letter-spacing:.07em;margin:0} */
.mj-head__title {
  font-size: 36px;
  line-height: 1.75;
  letter-spacing: 0.07em;
  margin-block-end: 16px;
}

.mj-head__body > :last-child {
  margin-block-end: 0;
}

.mj-head:last-child {
  margin-block-end: 0;
}

@media (max-width: 760px) {
  .mj-head {
    margin-block-end: 30px;
  }

  /* 参照 @media(max-width:760px){.sectionhead h2{font-size:29px}} */
  .mj-head__title {
    font-size: 29px;
    line-height: 1.8;
  }
}

/* ---- 項目を並べるグリッド（SHOPLINEの @media は使えるが、
        auto-fit で自然に折り返す方を優先する） ---- */
.mj-items {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.mj-item__title {
  font-size: 18px;
  line-height: 1.7;
  margin-block-end: 8px;
  color: rgb(var(--color-text));
}

.mj-item__text {
  font-size: 15px;
  margin-block-end: 0;
}

.mj-item__text > :last-child {
  margin-block-end: 0;
}

/* テーマのグローバルな a 色指定に負けないよう、MIRAIセクション内のボタンは
   配色スキームのトークンで明示する（各セクションで書き漏らさないための共通規定） */
.mj-section a.mj-btn {
  background: rgb(var(--color-button-background));
  border-color: rgb(var(--color-button-background));
  color: rgb(var(--color-button-text));
}

.mj-section a.mj-btn--outline {
  background: transparent;
  border-color: rgb(var(--color-button-secondary-border));
  color: rgb(var(--color-button-secondary-text));
}

.mj-section a.mj-textlink {
  color: rgb(var(--color-text));
}

/* ============================================================
   水面の演出（design-preview/style.css の .water-surface を移植）
   写真と文字は変形させず、重ねた2層だけを動かす。
   ============================================================ */
mj-water {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.mj-water-surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.mj-water-surface::before,
.mj-water-surface::after {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  will-change: transform;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
}

/* 1層目：水の光 */
.mj-water-surface::before {
  background-image: var(--mj-water-img);
  background-size: cover;
  opacity: 0.25;
  filter: contrast(1.12);
  animation: mj-water-flow 22s ease-in-out infinite alternate;
}

/* 2層目：波紋 */
.mj-water-surface::after {
  background:
    repeating-radial-gradient(ellipse at 27% 35%, transparent 0 48px, #fff9 50px, #fff0 55px, transparent 71px),
    repeating-radial-gradient(ellipse at 70% 65%, transparent 0 72px, #b4eaff55 75px, transparent 81px, transparent 106px);
  opacity: 0.17;
  filter: blur(2px);
  animation: mj-water-ripple 17s ease-in-out infinite alternate;
}

@keyframes mj-water-flow {
  0%   { transform: translate3d(-2%, -1%, 0) rotate(-2deg) scale(1.05); }
  50%  { transform: translate3d(1%, 2%, 0) rotate(1deg) scale(1.1); }
  100% { transform: translate3d(3%, -2%, 0) rotate(3deg) scale(1.05); }
}

@keyframes mj-water-ripple {
  0%   { transform: translate3d(-3%, 2%, 0) scale(1.02, 0.97) rotate(-3deg); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.13, 1.05) rotate(3deg); }
}

/* 停止条件：画面外 / 動きを止める / タブ非表示 */
mj-water.is-offscreen .mj-water-surface::before,
mj-water.is-offscreen .mj-water-surface::after,
.mj-motion-paused .mj-water-surface::before,
.mj-motion-paused .mj-water-surface::after,
.mj-water-doc-hidden .mj-water-surface::before,
.mj-water-doc-hidden .mj-water-surface::after {
  animation-play-state: paused !important;
}

/* スマートフォンは波紋を出さず、光だけ薄く・ゆっくり */
@media (max-width: 760px) {
  .mj-water-surface::after { display: none; }
  .mj-water-surface::before { opacity: 0.18; animation-duration: 26s; }
}

/* OSの「視差効果を減らす」設定では水面自体を出さない */
@media (prefers-reduced-motion: reduce) {
  .mj-water-surface { display: none; }
}

/* ============================================================
   スクロール時の出現演出（design-preview/style.css の [data-reveal] を移植）
   ============================================================ */
.mj-motion-ready [data-reveal] {
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.mj-motion-ready [data-reveal].mj-awaiting-reveal {
  opacity: 0;
  transform: translateY(22px);
}

.mj-motion-ready [data-reveal].mj-is-visible {
  opacity: 1;
  transform: none;
}

.mj-motion-paused [data-reveal] {
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 760px) {
  .mj-motion-ready [data-reveal].mj-awaiting-reveal {
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mj-motion-ready [data-reveal],
  .mj-motion-ready [data-reveal].mj-awaiting-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* 参照 .note{font-size:12px!important;color:var(--muted)} .note a{text-decoration:underline} */
.mj-note {
  font-size: 12px;
  color: var(--mj-muted);
  margin: 0;
}

.mj-note a {
  text-decoration: underline;
}

/* ============================================================
   リッチテキスト（商品説明・記事本文など、管理画面で書かれた本文）
   参照 .article-body p{line-height:2.2;font-size:18px}
        .article-body h2{font-size:28px;margin:55px 0 25px;line-height:1.8}
        .article-body .note{font-size:13px}
   貼り付けHTMLのインラインstyleを打ち消すため !important を併用する。
   ============================================================ */
/* ---- 本文 ---- */
.mj-rte > :first-child {
  margin-block-start: 0;
}

.mj-rte > :last-child {
  margin-block-end: 0;
}

.mj-rte p {
  font-size: var(--mj-body-size);
  line-height: 2.2;
  margin-block: 0 28px;
}

.mj-rte h2,
.mj-rte h3 {
  margin-block: 48px 20px;
}

.mj-rte h2 { font-size: 28px; }
.mj-rte h3 { font-size: 21px; font-weight: 500; }

.mj-rte img {
  max-width: 100%;
  height: auto;
  display: block;
}

.mj-rte a {
  color: var(--mj-brand);
  text-decoration: underline;
}

.mj-rte ul,
.mj-rte ol {
  padding-inline-start: 1.4em;
  margin-block: 0 28px;
}

.mj-rte li {
  margin-block-end: 8px;
}

/* ---- 表 ---- */
/* 商品説明に貼られた背景色・枠線・文字サイズを打ち消して .specrow の見た目にする */
.mj-rte div[style] {
  overflow-x: auto;
}

.mj-rte table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 0 !important;
  font-size: 16px !important;
  line-height: 1.95 !important;
  margin-block: 10px 0 !important;
}

.mj-rte th,
.mj-rte td {
  background: transparent !important;
  border: 0 !important;
  border-block-end: 1px solid var(--mj-line) !important;
  padding: 20px 0 !important;
  vertical-align: top !important;
  text-align: start !important;
  white-space: normal !important;
}

.mj-rte th {
  width: 33% !important;
  padding-inline-end: 20px !important;
  font-weight: 400 !important;
  color: var(--mj-muted) !important;
}

/* 参照の .specrow は上線を持たない */
.mj-rte tr:first-child th,
.mj-rte tr:first-child td {
  border-block-start: 0 !important;
}

/* リッチテキストのSP表示（参照 @media(max-width:760px){.specrow{grid-template-columns:1fr;gap:8px}}） */
@media (max-width: 760px) {
  .mj-rte p { font-size: 17px; line-height: 2.05; }

  /* 参照 @media(max-width:760px){.specrow{grid-template-columns:1fr;gap:8px}} */
  .mj-rte table,
  .mj-rte tbody,
  .mj-rte tr,
  .mj-rte th,
  .mj-rte td {
    display: block !important;
    width: auto !important;
  }

  .mj-rte th {
    border-block-end: 0 !important;
    padding: 16px 0 0 !important;
    font-size: 15px !important;
  }

  .mj-rte td {
    padding: 4px 0 16px !important;
  }}
