/* =========================================================
   中島重久堂：トップページ専用CSS（is_front_page() のときだけ読み込み）
   色・フォントの変数とヘッダー・フッターは njk-common.css
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 2;
  letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.container { padding: 0 var(--gutter); }

/* ---------- 共通パーツ ---------- */
.text-block:hover .arrow-line, .twocol__text:hover .arrow-line { width: 68px; opacity: .85; }
/* 写真の上（暗い背景）では白をやや強めに */
.pk .arrow-line, .cta .arrow-line { opacity: .75; }

/* 見出し・本文のまとまり。矢印はその下に右寄せで置く */
.text-block { width: fit-content; max-width: 100%; }
.more { display: flex; justify-content: flex-end; margin-top: 24px; padding: 6px 0; color: inherit; }

.text-link {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 1.3rem; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.text-link::before {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: 14px; height: 1px; background: var(--ink);
  transform-origin: left; transition: transform .5s var(--ease);
}
.text-link:hover::before { transform: scaleX(12); }
.text-link::after {
  content: ''; width: 32px; height: 10px; background: currentColor; opacity: .5; transition: transform .4s var(--ease), opacity .4s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 10'%3E%3Cpath d='M0 9.5H31.5M31.5 9.5L24.2 4.4' fill='none' stroke='%23000' stroke-width='.7'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 10'%3E%3Cpath d='M0 9.5H31.5M31.5 9.5L24.2 4.4' fill='none' stroke='%23000' stroke-width='.7'/%3E%3C/svg%3E") no-repeat center / contain;
}
.text-link:hover::after { transform: translateX(6px); opacity: .85; }
.text-link--right { display: flex; width: fit-content; margin-left: auto; }

.sec-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 140px; padding-bottom: 64px; }
.sec-head__en { font-family: var(--en); font-style: italic; font-weight: 600; font-size: 1.3rem; color: var(--ink); letter-spacing: .08em; }
.sec-head__ja { font-family: var(--serif); font-size: 2.4rem; letter-spacing: .18em; }
.sec-head--right { flex-direction: column; align-items: flex-end; gap: 14px; }

/* スクロール表示 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
/* 白背景の写真5枚をクロスフェードでつなぐ。文字は濃色＋白いにじみで写真上でも読めるように */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; background: #eeedeb; color: var(--ink); }
.hero__slide {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.08);
  transition: opacity 2.4s ease, transform 9s linear;
}
.hero__slide picture, .hero__slide img { display: block; width: 100%; height: 100%; }
.hero__slide img { object-fit: cover; object-position: center; }
.hero__slide.is-active { opacity: 1; transform: scale(1); }
.hero__copy {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-weight: 400; font-size: 4.8rem; letter-spacing: .32em;
  white-space: nowrap; text-shadow: 0 0 24px rgba(255,255,255,.9), 0 0 48px rgba(255,255,255,.7);
  padding-left: .32em; /* 字間の右余りを相殺して中央に */
}
.hero__copy span { display: inline-block; opacity: 0; filter: blur(8px); transition: opacity 2s var(--ease), filter 2s var(--ease); }
.hero__copy span:nth-child(2) { transition-delay: .6s; }
.hero.is-loaded .hero__copy span { opacity: 1; filter: none; }
.hero__en {
  position: absolute; left: 40px; bottom: 36px;
  font-family: var(--en); font-style: italic; font-size: 1.3rem; opacity: .8;
}
.hero__scroll { position: absolute; right: 40px; bottom: 0; height: 90px; width: 1px; background: rgba(51,51,51,.2); overflow: hidden; }
.hero__scroll::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: scrollLine 2.4s var(--ease) infinite; }
.hero__scroll span { position: absolute; right: 10px; bottom: 96px; font-family: var(--en); font-size: 1.1rem; writing-mode: vertical-rl; }
@keyframes scrollLine { to { top: 100%; } }

/* ---------- PICK UP ---------- */
.pickup { padding: 2px 0 0; }
.pickup__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 25vw; gap: 2px;
  grid-template-areas:
    "a  a  s1 s2"
    "a  a  b  b"
    "s3 s4 b  b";
}
.pickup__grid { grid-template-rows: 25vw 25vw 25vw; }
.pickup__grid > :nth-child(1) { grid-area: s1; }
.pickup__grid > :nth-child(2) { grid-area: s2; }
.pickup__grid > :nth-child(3) { grid-area: a; }
.pickup__grid > :nth-child(4) { grid-area: b; }
.pickup__grid > :nth-child(5) { grid-area: s3; }
.pickup__grid > :nth-child(6) { grid-area: s4; }
.pk { position: relative; overflow: hidden; color: #fff; background: #ddd; }
.pk > picture { position: absolute; inset: 0; }
.pk img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.pk:hover img { transform: scale(1.05); }
.pk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(25,20,18,.62), rgba(25,20,18,0) 55%); transition: opacity .6s; }
.pk:hover::after { opacity: .75; }
.pk__body, .pk .arrow-line { z-index: 1; }
/* 文字は左下 */
.pk__body { position: absolute; left: 26px; bottom: 22px; display: flex; flex-direction: column; gap: 2px; }
.pk__body b { font-family: var(--en); font-style: italic; font-weight: 600; font-size: 2rem; letter-spacing: .06em; line-height: 1.2; }
.pk .arrow-line { position: absolute; right: 16px; bottom: 16px; }

/* ---------- PRODUCTS ---------- */
.p-row { position: relative; height: clamp(380px, 38vw, 600px); overflow: hidden; display: flex; align-items: center; border-top: 2px solid #fff; background: #f1f0ee; }
.p-row__img {
  position: absolute; inset: -8% 0; display: block;
  will-change: transform; transition: transform 1.6s var(--ease);
}
.p-row__img img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); }
/* 明るい製品写真：写真を帯の72%幅に置き、文字側の端を写真の背景色（--bg）に溶け込ませる
   → 横長の帯でも商品が拡大されすぎず、文字と商品が重ならない */
.p-row--light { background: var(--bg, #f1f0ee); }
.p-row--light .p-row__img { left: auto; right: 0; width: 72%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%); mask-image: linear-gradient(to right, transparent 0%, #000 30%); }
.p-row--light.p-row--right .p-row__img { left: 0; right: auto;
  -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 30%); mask-image: linear-gradient(to left, transparent 0%, #000 30%); }
.p-row--light::before, .p-row--right.p-row--light::before { display: none; }
.p-row::before { content: ''; position: absolute; inset: 0; z-index: 1; }
.p-row--dark { color: #fff; }
.p-row--dark::before { background: linear-gradient(90deg, rgba(20,16,14,.72) 0%, rgba(20,16,14,.35) 45%, rgba(20,16,14,.05) 75%); }
.p-row--light { color: var(--ink); }
.p-row--right { justify-content: flex-end; }
.p-row__inner { position: relative; z-index: 2; width: 100%; }
.p-row--right .p-row__inner { width: auto; padding-left: 0; }
.p-row__name {
  display: flex; align-items: center; gap: 12px; width: 280px;
  padding-bottom: 14px; margin-bottom: 30px; position: relative;
  border-bottom: 1px solid currentColor; border-color: rgba(127,127,127,.5);
}
.p-row__name::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 18px; height: 1px; background: currentColor; }
.p-row__name .en { font-family: var(--en); font-weight: 600; font-size: 2.2rem; letter-spacing: .06em; white-space: nowrap; }
.p-row__name .arrow-line { margin-left: auto; }
.p-row__catch { font-family: var(--serif); font-size: 2.2rem; line-height: 1.8; letter-spacing: .14em; margin-bottom: 18px; }
.p-row__desc { font-size: 1.2rem; line-height: 2.1; opacity: .9; }

/* ---------- CUSTOMIZE（2カラム） ---------- */
.twocol { padding-bottom: 160px; }
.twocol__body { display: grid; grid-template-columns: 62% 1fr; align-items: center; gap: 4%; }
.twocol__img { overflow: hidden; height: clamp(300px, 28vw, 460px); }
.twocol__img picture { display: block; height: 100%; }
.twocol__img img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.twocol__text { padding-right: var(--gutter); max-width: 520px; }
.twocol__title {
  display: flex; align-items: center; gap: 16px; position: relative;
  padding-bottom: 12px; margin-bottom: 28px; border-bottom: 1px solid var(--line);
}
.twocol__title::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 14px; height: 1px; background: var(--ink); }
.twocol__title em { font-family: var(--en); font-style: normal; font-weight: 600; font-size: 2.2rem; letter-spacing: .04em; }
.twocol__title span:not(.arrow-line) { font-size: 1.1rem; }
.twocol__title .arrow-line { margin-left: auto; }
.twocol__text > p { font-size: 1.3rem; line-height: 2.2; }

/* ---------- MOVIE ---------- */
.movie__frame { position: relative; aspect-ratio: 16 / 9; max-height: 100vh; width: 100%; overflow: hidden; background: #0d0c0b; color: #fff; }
.movie__video, .movie__poster, .movie__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.movie__poster { transition: opacity 1s; }
.movie.is-playing .movie__poster { opacity: 0; pointer-events: none; }
.movie__caption { position: absolute; left: var(--gutter); bottom: 40px; z-index: 1; }
.movie__caption .sec-head__en { color: #fff; }
.movie__caption p { font-family: var(--en); font-weight: 500; font-size: 3.2rem; letter-spacing: .08em; line-height: 1.2; }
.movie__toggle {
  position: absolute; right: 32px; bottom: 36px; z-index: 1; width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,.6); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: background .3s;
}
.movie__toggle:hover { background: rgba(255,255,255,.15); }
/* 再生中＝一時停止アイコン（2本線）、停止中＝再生アイコン（三角） */
.movie__toggle span { width: 10px; height: 12px; border-left: 2px solid #fff; border-right: 2px solid #fff; }
.movie__toggle[aria-pressed="true"] span { width: 0; height: 0; border: 0; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }

/* ---------- GALLERY (POLICY) ---------- */
.policy { background: var(--bg-gray); padding: 130px 0 120px; overflow: hidden; }
.policy__title { font-family: var(--serif); font-size: 3rem; letter-spacing: .14em; margin-top: 6px; }
.policy__lead { font-family: var(--serif); font-size: 1.5rem; margin-top: 10px; color: var(--ink-soft); }
.policy__slider {
  display: flex; gap: 2px; margin-top: 64px; padding-left: calc(var(--gutter) - 2%);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth;
}
.policy__slider::-webkit-scrollbar { display: none; }
.pc {
  position: relative; flex: 0 0 38vw; height: 28vw; min-height: 300px;
  scroll-snap-align: start; overflow: hidden; color: #fff;
  display: flex; align-items: flex-end; justify-content: space-between; padding: 24px 22px;
}
.pc { justify-content: flex-end; background: #ddd; }
.pc > picture { position: absolute; inset: 0; }
.pc img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.pc:hover img { transform: scale(1.05); }
.pc .arrow-line { position: relative; z-index: 1; color: #fff; opacity: 0; transition: opacity .4s, width .4s var(--ease); }
.pc:hover .arrow-line { opacity: .75; }
.policy__foot { display: flex; align-items: center; gap: 32px; margin-top: 28px; }
.policy__nav { display: flex; gap: 4px; }
.policy__nav button { width: 64px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.policy__foot .text-link { margin-left: auto; }

/* ---------- NEWS（見出しを左に固定・右に2段組リスト） ---------- */
.news { padding: 130px 0 140px; }
.news__wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; }
.news__side { align-self: start; }
.news__side .sec-head__ja { margin-top: 8px; }
.news__side .text-link { margin-top: 40px; }
.news__list li { border-bottom: 1px solid var(--line); }
.news__list li:first-child { border-top: 1px solid var(--line); }
.news__list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 32px; padding: 26px 4px; transition: background .3s; }
.news__list a:hover { background: #faf9f8; }
.news__meta { display: flex; align-items: center; gap: 14px; }
.news__list time { font-family: var(--en); font-style: italic; font-weight: 600; font-size: 1.7rem; color: var(--ink); }
.news__list .cat { font-family: var(--en); font-style: italic; font-weight: 500; font-size: 1.4rem; color: var(--ink-soft); }
.news__list p { grid-column: 1; font-size: 1.5rem; }
.news__list .arrow-line { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- CTA ---------- */
.cta { position: relative; height: clamp(360px, 36vw, 520px); display: flex; align-items: center; color: #fff; overflow: hidden; }
.cta { background: #2a2624; }
.cta__img { position: absolute; inset: 0; }
.cta__img img { width: 100%; height: 100%; object-fit: cover; }
.cta::after { content: ''; position: absolute; inset: 0; background: rgba(30,26,24,.5); }
.cta--factory { height: clamp(420px, 46vw, 680px); }
/* 製造ブロックだけ背景をパララックス：上下に15%ずつ余白を持たせ、JSで translate する */
.cta--factory .cta__img { inset: -15% 0; will-change: transform; }
.cta--factory::after { background: linear-gradient(90deg, rgba(20,18,16,.72) 0%, rgba(20,18,16,.3) 55%, rgba(20,18,16,.1) 100%); }
.cta__inner { position: relative; z-index: 1; }
.cta__title {
  display: flex; align-items: center; gap: 10px; min-width: 320px; width: fit-content; font-family: var(--sans); font-size: 1.8rem; letter-spacing: .12em;
  padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.5); position: relative;
}
.cta__title::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 18px; height: 1px; background: #fff; }
.cta__title b { font-weight: 500; letter-spacing: .2em; }
.cta__ja { font-family: var(--serif); font-size: 2rem; letter-spacing: .14em; }
.cta__ja--sub { font-size: 1.4rem; letter-spacing: .1em; }
.cta__title .arrow-line { margin-left: auto; }
.cta p { font-size: 1.3rem; }

/* =========================================================
   RESPONSIVE（960px）
   ========================================================= */
@media (max-width: 960px) {
  body { font-size: 1.3rem; }

  .hero { height: auto; min-height: 100svh; }
  .hero__copy { font-size: 2.8rem; letter-spacing: .22em; padding-left: .22em; white-space: normal; width: 100%; text-align: center; }
  .hero__copy span { display: block; }
  .hero__en { left: 20px; }
  .hero__scroll { right: 20px; }

  .sec-head { flex-direction: column; gap: 6px; padding-top: 96px; padding-bottom: 40px; }
  .sec-head--right { align-items: flex-start; }
  .sec-head__ja { font-size: 1.9rem; letter-spacing: .12em; }

  .pickup__grid {
    grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 44vw;
    grid-template-areas: "a a" "a a" "s1 s2" "b b" "b b" "s3 s4";
  }
  .pk__body { left: 16px; bottom: 14px; }
  .pk__body b { font-size: 1.7rem; }
  .pk .arrow-line { right: 12px; bottom: 12px; }

  .p-row { height: auto; min-height: 120vw; align-items: flex-end; }
  .p-row--right { justify-content: flex-start; }
  .p-row__inner, .p-row--right .p-row__inner { width: 100%; padding: 40px var(--gutter); }
  .p-row--dark::before { background: linear-gradient(to top, rgba(20,16,14,.82) 0%, rgba(20,16,14,.35) 55%, rgba(20,16,14,0) 80%); }
  /* 白背景の製品写真は、写真を上・テキストを下に分けて商品を隠さない */
  .p-row--light { flex-direction: column; align-items: stretch; min-height: 0; }
  .p-row--light .p-row__img, .p-row--light.p-row--right .p-row__img { position: relative; inset: auto; width: 100%; height: 68vw; transform: none !important; -webkit-mask-image: none; mask-image: none; }
  .p-row--light .p-row__inner, .p-row--right.p-row--light .p-row__inner { padding: 32px var(--gutter) 48px; background: #fff; }
  .p-row__catch { font-size: 1.8rem; }
  .p-row__desc br, .p-row__catch br { display: none; }
  .p-row__name { width: 100%; }
  .text-block { width: auto; }

  .twocol { padding-bottom: 100px; }
  .twocol__body { grid-template-columns: 1fr; gap: 40px; }
  .twocol__img { height: 50vw; }
  .twocol__text { padding: 0 var(--gutter); max-width: none; }

  .movie__frame { aspect-ratio: 4 / 5; }
  .movie__caption { bottom: 24px; }
  .movie__caption p { font-size: 2.2rem; }
  .movie__toggle { right: 20px; bottom: 24px; }

  .policy { padding: 90px 0; }
  .policy__title { font-size: 2.2rem; }
  .pc { flex-basis: 78vw; height: 60vw; min-height: 0; }
  .policy__foot { flex-wrap: wrap; }
  .policy__foot .text-link { margin-left: 0; width: 100%; }

  .news { padding: 90px 0 100px; }
  .news__wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .news__side br { display: none; }
  .news__list a { gap: 4px 20px; padding: 20px 0; }

  .cta { height: 100vw; max-height: 480px; }
  .cta--factory .cta__img { inset: 0; transform: none !important; }
  .cta--factory { height: 120vw; max-height: 560px; align-items: flex-end; padding-bottom: 48px; }
  .cta--factory::after { background: linear-gradient(to top, rgba(20,18,16,.8) 0%, rgba(20,18,16,.2) 70%); }
  .cta p br { display: none; }
  .cta__title { width: 100%; }
}

/* =========================================================
   英語版（html[lang|="en"]）
   ========================================================= */
html[lang|="en"] body { letter-spacing: .02em; }
html[lang|="en"] .hero__copy { font-weight: 500; font-size: 5.6rem; letter-spacing: .04em; padding-left: 0; }
html[lang|="en"] .sec-head__ja { font-weight: 500; font-size: 3rem; line-height: 1.35; letter-spacing: .03em; }
html[lang|="en"] .p-row__catch { font-weight: 500; font-size: 2.8rem; line-height: 1.35; letter-spacing: .02em; }
html[lang|="en"] .p-row__desc { max-width: 540px; line-height: 1.9; }
html[lang|="en"] .twocol__text > p { line-height: 1.9; }
html[lang|="en"] .policy__title { letter-spacing: .08em; }
html[lang|="en"] .policy__lead { font-size: 1.9rem; }
html[lang|="en"] .cta__ja { font-weight: 500; font-size: 2.8rem; letter-spacing: .03em; }
html[lang|="en"] .cta__ja--sub { font-size: 1.8rem; }
@media (max-width: 960px) {
  html[lang|="en"] .hero__copy { font-size: 3.6rem; letter-spacing: .02em; padding-left: 0; line-height: 1.3; }
  html[lang|="en"] .sec-head__ja { font-size: 2.4rem; letter-spacing: .02em; }
  html[lang|="en"] .p-row__catch { font-size: 2.3rem; }
  /* 英語の説明文は2文構成なので、スマホでも文の区切りで改行を残す */
  html[lang|="en"] .p-row__desc br, html[lang|="en"] .cta p br { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
