/* =========================
   Reset / Base
========================= */
html[lang="ja"], body[lang="ja"]{
  line-break: strict;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
  text-wrap: pretty;          /* 折返し品質向上（未対応は無視） */
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: #000;
  font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
}

/* =========================
   Typography rendering normalization
   - Chrome/Safari/Firefoxでの見え方差を緩和
========================= */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;   /* Safari/macOS */
  -moz-osx-font-smoothing: grayscale;    /* Firefox/macOS */
  text-rendering: optimizeLegibility;    /* 字形とカーニング優先 */
}
body {
  /* グローバルの行間・字詰めを安定化（必要なら調整OK） */
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* =========================
   Background video
========================= */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* =========================
   Overlay backgrounds
========================= */
body.page-template-template-custom-front-page::after,
body.page-template-protected-home::after,
body.page-template-protected-contact::after,
body.page-template-protected-about::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("https://wtnb481.com/wp-content/uploads/2025/10/overlay_home.png") center/cover no-repeat transparent;
  z-index: 1;
  pointer-events: none;
}
body.page-template-template-custom-front-page::after {
  background: url("https://wtnb481.com/wp-content/uploads/2025/10/overlay_top.png") center/cover no-repeat transparent;
}

/* =========================
   Hide WP footer (all pages + 404)
========================= */
footer, footer *,
body.error404 .site-info,
body.error404 .footer-credits,
body.error404 footer a[href*="wordpress.org"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* =========================
   Navigation
========================= */
.home-nav-left {
  position: absolute;
  top: 30px;
  left: 80px;
  z-index: 3;
}
.home-nav-left .nav-btn {
  font-size: 35px;
  font-style: italic;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.home-nav-left .nav-btn:hover { color:#000; background:#fff; }

.home-nav-top {
  position: absolute;
  top: 30px;
  right: 80px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 30px;
  z-index: 3;
}
.nav-btn {
  font-size: 35px;
  font-style: italic;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: right;
  line-height: 1;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.nav-btn:hover { color:#000; background:#fff; }

@media screen and (max-width: 1000px) {
  .home-nav-left { top:20px; left:20px; }
  .home-nav-top { top:20px; right:20px; gap:15px; }
  .nav-btn { font-size:20px !important; }
}

/* =========================
   Works grid（PC）
========================= */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
  max-width: 1200px;
  margin: 120px auto 0;
  padding: 0 10px;
  position: relative;
  z-index: 2;
}
.grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}
.grid-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.4s ease;
}
.grid-item.visible img { opacity: 1; transform: translateY(0); }
.grid-item:hover img { transform: scale(1.05); }

/* Overlay */
.grid-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.grid-item .overlay h3 { font-size:20px; margin:0 0 8px; font-weight:bold; }
.grid-item .overlay p  { font-size:14px; margin:0; opacity:0.85; }
.grid-item:hover .overlay { opacity:1; }

/* =========================
   Works grid（スマホ）
========================= */
@media screen and (max-width: 600px) {
  .home-grid {
    grid-template-columns: 1fr;
    max-width: 100% !important;
    width: 100% !important;
    margin: 80px 0 0 0 !important;
    padding: 0 !important;
    justify-items: center;
  }
  .grid-item {
    width: 90% !important;
    margin: 0 !important;
    aspect-ratio: 1/1;
  }
}

/* =========================
   Vimeo modal
========================= */
.vimeo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.vimeo-modal-content {
  position: relative;
  width: 80%;
  max-width: 960px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.vimeo-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.vimeo-wrapper iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Close */
.vimeo-close {
  position: absolute;
  top: 5px;
  left: 20px; right: auto;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.2s;
}
.vimeo-modal-content:hover .vimeo-close { opacity: 1; }
.vimeo-close:hover { color: #f00; }

/* =========================================================
   Front Page: Password + Intro message（最終版）
   - PCで「守秘義務…」の行を必ず1行表示
   - 検索バーと文章の距離を少し広げる
   - 行間はタイトめ
========================================================= */
.form-row {
  margin-top: 22px;
  margin-bottom: 17px;                 /* ← 検索バー直下の距離を広げる */
}

/* 説明文ブロック本体 */
.password-container .intro-text{
  color:#fff;
  font-weight:600;
  font-style:;
  font-size:16px;
  line-height:1.45;                    /* ← 読みやすくタイト */
  text-align:center;
  margin:17px auto 0;                  /* ← バーとの距離を適度に */
  letter-spacing:0.03em;
  max-width: 900px;                    /* ← 1行保持を助ける */
  text-wrap: pretty;
  word-break: auto-phrase;
  display:block;
}

/* 行要素（既定） */
.password-container .intro-text .line{
  display:block;
  white-space:normal;                  /* 既定は自然折返し */
  text-align:center;
  margin:5px 0;
  width:100%;
}

/* PCでは3行目を必ず1行に固定 */
@media (min-width: 601px){
  .password-container .intro-text .line:nth-of-type(3){
    white-space: nowrap;               /* ← 1行固定 */
    word-break: keep-all;
    overflow-wrap: normal;
    letter-spacing: 0.02em;            /* わずかに詰めて収める */
  }
}

/* リンク */
.password-container .intro-text a{
  color:#fff;
  text-decoration: underline;
}

/* モバイル最適化（SPは自然改行） */
@media (max-width: 600px){
  .password-container .intro-text{
    font-size: 3.2vw;
    line-height: 1.55;
    max-width: 92vw;
    margin-top: 10px;
  }
  .password-container .intro-text .line{
    margin:4px 0;
    white-space: normal;               /* ← SPでは通常に戻す */
  }
}


/* スマホ：指を置いている間だけロール表示 */
.grid-item.press-preview .overlay { opacity: 1; }

/* Vimeo モーダル：ボタンを外に出せるようにする */
.vimeo-modal-content {
  position: relative;
  width: 80%;
  max-width: 960px;
  background: #000;
  border-radius: 8px;
  overflow: visible; /* ← ボタンを外側に出すため必須 */
}

/* 「X」ボタン：動画の中央下に常時表示 */
.vimeo-close {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 60%); /* 中央下から外に少しズラす */
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  z-index: 10000;
  opacity: 1;
  pointer-events: auto;
  transition: color .2s ease, background .2s ease;
}

/* PCホバー時は軽く反応 */
@media (hover:hover) and (pointer:fine) {
  .vimeo-close:hover {
    color: #f00;
    background: rgba(0,0,0,0.8);
  }
}

/* スマホは見た目少し小さく */
@media (hover:none) and (pointer:coarse) {
  .vimeo-close {
    width: 48px;
    height: 48px;
    font-size: 24px;
    transform: translate(-50%, 70%); /* やや下に寄せる */
    touch-action: manipulation;
  }
}