﻿
/* 調整 */
.hamburger {z-index: 10001;}
.mobile-menu {z-index: 10000;}
.mobile-menu.is-open{
  z-index: 10;
}

/* ハンバーガー隠し */
.hamburger{
  transition: opacity 0.4s ease;
}
.hamburger.is-hidden{
  opacity: 0;
  pointer-events: none;
}


/* メニューOPEN中はヘッダー（ロゴ＋ハンバーガー）を画面固定にする */

/* 共通（SP + タブレット） */
@media (max-width: 1024px){
  body.menu-open .fv-header{
    position: fixed;
    z-index: 20002;
  }

  body.menu-open .hamburger,
  body.menu-open .hamburger.is-hidden{
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* SP（〜767） */
@media (max-width: 767px){
  body.menu-open .fv-header{
    top: 12px;
    left: 14px;
    right: 14px;
  }

  body.menu-open .fv-logo{
    opacity: 1;
    animation: none;
  }

  body.menu-open.menu-open-scrolled .fv-logo{
    opacity: 0;
    animation: logoFadeOnly 2.35s ease forwards;
    animation-delay: 0.12s;
  }
}

/* タブレット（768〜1024） */
@media (min-width: 768px) and (max-width: 1024px){
  body.menu-open .fv-header{
    top: 20px;
    left: 28px;
    right: 28px;
  }
}


@keyframes logoFadeOnly{ to{ opacity: 1; } }




/* ===== OQ Modal (restart) ===== */
.oq-modal{
  position: fixed;
  inset: 0;

  /* フェード用 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;

  z-index: 30000;
}

.oq-modal.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 1s ease, visibility 0s linear 0s;
}

.oq-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

/* ★panelは“位置決め＆×の土台”。overflowはvisibleにする */
.oq-modal__panel{
  position: relative;
  width: min(92vw, 1000px);
  max-width: 1000px;
  max-height: 85vh;

  /* 中央寄せ */
  margin: 6vh auto 0;

  /* ×を外に出すため */
  overflow: visible;

  /* 子に高さを渡す */
  display: flex;
  flex-direction: column;
}


@media (min-width: 768px){
  .oq-modal{
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .oq-modal__panel{
    margin: 0 auto;
    max-height: 85vh; /* PCはvhで問題なし */
  }
}


/* ===== SP：モーダル“外側”をブラウザUIに被せない（確実版） ===== */
@media (max-width: 767px){

  /* モーダル全体を「表示領域の中で縦中央寄せ」する土台にする */
  .oq-modal{
    display: flex;
    justify-content: center;
    align-items: center;

    /* 上下の安全領域＋ブラウザUI分の“逃げ”を確保 */
    padding-top:  calc(env(safe-area-inset-top, 0px) + 14px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) );
    box-sizing: border-box;
  }

  /* パネルはflex中央寄せなので margin-top は不要 */
  .oq-modal__panel{
    margin: 0 auto;

    /* “実表示高さ”基準でパネルを収める（上下paddingぶんを引く） */
    max-height: calc(
      100dvh
      - (env(safe-area-inset-top, 0px) + 14px)
      - (env(safe-area-inset-bottom, 0px) + 90px)
    );
    height:80%;
  }

  /* dvh非対応ブラウザ用の保険 */
  @supports not (height: 100dvh){
    .oq-modal__panel{
      max-height: calc(
        100vh
        - (env(safe-area-inset-top, 0px) + 14px)
        - (env(safe-area-inset-bottom, 0px) )
      );
    }
  }
}




.oq-modal__inner{
  position: relative;
  background: #dcdcd7;
  /* border: 1px solid #767158; */

  /* border-radius: 12px;*/
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;

}

/* ★追加：スクロールしないヘッダーの“余白” */
.oq-modal__head{
  height: 50px;      /* ×の領域分 */
  flex: 0 0 56px;
}
/* 下部の余白（headと同じ役割） */
.oq-modal__foot{
  height: 50px;      /* ← headと同じでOK */
  flex: 0 0 40px;
}



/* ★ここだけスクロール */
.oq-modal__body{
  margin:0 5%;
  padding:0 4% 0 4%;
  color: #000;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  flex: 1 1 auto;
  min-height: 0;
}





@media (max-width: 767px) {

  .oq-modal__head{
    height: 50px;
    flex: 0 0 30px;
  }  
  .oq-modal__body{
    margin:0 4% 0 4%;
    padding:0 4%;
  }
  .oq-modal__body img{
    width:90%!important
  }
  .oq-modal__foot{
    flex: 0 0 30px;
  }

}
@media (max-width: 380px) {
  .oq-modal__body{
    margin:0 4%;
    padding:0 4%;
  }
}




/* ===== OQ Modal contents (inside .oq-modal__body) ===== */
.oq-modal__body{
  line-height: 1.9;
  letter-spacing: 0.02em;
}

/* 上段：PCは2カラム / SPは縦 */
.oq-modal__top{
  display: grid;

  gap: 22px;
  align-items: stretch;        /* 左右の高さを揃える */
}
@media (min-width: 768px){
  .oq-modal__top{
    grid-template-columns: 1.1fr 0.9fr;
  }
}


/* SP：縦積み */
@media (max-width: 767px){
  .oq-modal__top{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* 左：見出しブロック（縦中央） */
.oq-modal__topText{
  display: flex;
  flex-direction: column;
  justify-content: center;     /* ← 縦位置中央 */
  min-height: 100%;
}

/* 見出し（複数行想定） */
.oq-modal__title{
  margin: 0;
  font-size: clamp(18px, 2.4vw, 27px);
  line-height: 2;
  color: #000;
  font-weight: 700;
}

/* SPのみ：見出しを左右センタリング */
@media (max-width: 767px){
  .oq-modal__title{
    text-align: center;
    line-height: 1.8;
  }
}

/* リード文：仕様「不要」なので非表示（HTMLに残ってても消える） */
.oq-modal__lead{
  display: none;
}

/* ===== oq-modal__topMedia 画像調整 ===== */

/* PC：右寄せ */
@media (min-width: 768px){
  .oq-modal__topMedia{
    display: flex;
    justify-content: flex-end; /* 右寄せ */
  }

  /* ★追加：大きい画像でも崩れない */
  .oq-modal__img{
    max-width: 100%;
    height: auto;
  }
}

/* SP：中央・90% */
@media (max-width: 767px){
  .oq-modal__topMedia{
    display: flex;
    justify-content: center;   /* 中央 */
    margin-top:10px;
  }

  /* ★追加：大きい画像でも崩れない + 90% */
  .oq-modal__img{
    width: 90%!important;
    max-width: 100%;
    height: auto;
  }
}


.oq-modal__img{
  width: 100%;
  height: auto;
  display: block;
  border: none;               /* ← 枠線なし */
  box-shadow: none;           /* ← 影なし */
}

/* 区切り線 */
.oq-modal__divider{
  border: 0;
  border-top: 1px solid rgba(118,112,89,.55);
  margin: 35px 0 30px;
}

/* 本文 */
.oq-modal__article {line-height: 2;}
.oq-modal__article p{
  margin: 0 0 14px 0;
  font-size: clamp(17px, 1.7vw, 18px);
  font-weight: 600;
  padding-bottom:15px;
}

/* 下の閉じる（枠線・背景なし、左右中央） */
.oq-modal__closeRow{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  margin: 34px 0 5px;
  padding: 0;
  border: none;
  background: transparent;

  color: #000;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;

  -webkit-appearance: none;
  appearance: none;

  transition: opacity .25s ease;
}
.oq-modal__closeRow:hover{ opacity: .75; }


/* ===== 下の×：右上×(.oq-modal__close)と同じ見た目（位置決めだけ除外） ===== */
.oq-modal__closeIcon{
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  max-width: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  aspect-ratio: 1 / 1;

  border: 1px solid #777059;
  border-radius: 50%;
  background: #f4f4f3;

  /* ★×の色は currentColor で描くので、ここを変えるだけで反転できる */
  color: #777059;

  display: grid;
  place-items: center;
  box-sizing: border-box;

  -webkit-tap-highlight-color: transparent;
  user-select: none;

  /* 親ボタンにクリックさせる */
  pointer-events: none;
}

/* ×をCSSで描画（色は currentColor） */
.oq-modal__closeIcon::before{
  content: "";
  width: 12px;
  height: 12px;

  background:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);

  background-size: 100% 1.5px, 1.5px 100%;
  background-repeat: no-repeat;
  background-position: center;

  transform: rotate(45deg);
  display: block;
}

/* hover/active：親ボタンhoverで色反転（×も追従） */
.oq-modal__closeRow:hover .oq-modal__closeIcon,
.oq-modal__closeRow:active .oq-modal__closeIcon{
  background: #777059;
  color: #f4f4f3;
  border-color: #777059;
}


/* 「閉じる」テキスト色を指定 */
.oq-modal__closeText{
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Noto Sans JP",
    "Yu Gothic",
    "Yu Gothic Medium",
    "Meiryo",
    system-ui,
    sans-serif;
  font-size:16px;

  color: #777059;
}


@media (max-width: 767px){

  .oq-modal__divider{
    margin: 35px 0 25px;
  }
  .oq-modal__title{ font-size: clamp(19px, 3.5vw, 46px); }
  .oq-modal__article {
    padding:0 1%;
    line-height:1.7;
  }
  .oq-modal__article p{ font-size: 16px; }
}

@media (max-width: 400px){
  .oq-modal__title{ font-size: clamp(18px, 2vw, 19px); }
  .oq-modal__article p{ font-size: 16px; }
}

@media (max-width: 380px){
  .oq-modal__title{ font-size: 17px; }

}








/* ===== モーダル右上 ×（CSS描画・フォント非依存） ===== */
.oq-modal__close{
  position: absolute;
  top: 10px;
  right: 10px;
  transform: translate(50%, -50%);

  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  flex: 0 0 50px;
  aspect-ratio: 1 / 1;

  border: 1px solid #777059;
  border-radius: 50%;
  background: #f4f4f3;

  /* ★ここがポイント：×は currentColor を使う */
  color: #777059;

  display: grid;
  place-items: center;
  box-sizing: border-box;

  cursor: pointer;
  z-index: 10;

  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow: none;

  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ×をCSSで描画（色は currentColor） */
.oq-modal__close::before{
  content: "";
  width: 14px;
  height: 14px;

  background:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);

  background-size: 100% 1.6px, 1.6px 100%;
  background-repeat: no-repeat;
  background-position: center;

  transform: rotate(45deg);
  display: block;
}

/* hover / active：色反転（backgroundはそのまま、colorだけ反転） */
.oq-modal__close:hover,
.oq-modal__close:active{
  background: #777059;
  color: #f4f4f3; /* ←これで×も一緒に白っぽくなる */
}

/* フォーカスリングを完全に消す */
.oq-modal__close:focus,
.oq-modal__close:focus-visible{
  outline: none;
  box-shadow: none;
}



/* 中身はスクロールするが、ネイティブバーは見せない */
.oq-modal__body{
  scrollbar-width: none;          /* Firefox */
}
.oq-modal__body::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* 自作スクロールバー（右側） */
.oq-modal__scrollbar{
  position: absolute;
  top: 56px;              /* ×より下から */
  right: 10px;
  bottom: 56px;
  width: 18px;            /* クリックしやすい幅 */
  pointer-events: auto;   /* ★イベントを取れるようにする */
  z-index: 5;
}

/* レール（細い線） */
.oq-modal__scrollbar::before{
  content:"";
  position:absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(118,112,89,.45);
  border-radius: 999px;
  pointer-events: none;   /* ★レール線自体はイベント不要（親で拾う） */
}

/* つまみ（ドラッグ対象） */
.oq-modal__scrollthumb{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  background: #767059;
  height: 40px;           /* JSで上書き */
  top: 0;                 /* JSで上書き */
  opacity: 0;
  transition: opacity .2s ease;

  pointer-events: auto;   /* ★つまみは必ずイベントを拾う */
  cursor: grab;           /* ★PC */
  touch-action: none;     /* ★スマホ：ドラッグ中にページスクロールさせない */
}
.oq-modal__scrollthumb:active{
  cursor: grabbing;
}

/* ===== iPhone SE: スクロール中は「つまみ消し」＋「レール太く」 ===== */
.is-iphone-se .oq-modal__scrollbar.is-scrolling::before{

  opacity: 0.95;              /* 任意：少し濃く */
}

/* スクロール中はつまみを消す（update()がis-visible付けてもCSSで殺す） */
.is-iphone-se .oq-modal__scrollbar.is-scrolling .oq-modal__scrollthumb{
  opacity: 0 !important;
}



.oq-modal__scrollthumb::before{
  content:"";
  position:absolute;
  inset: -6px;      /* 透明の当たり領域（上下左右に6px拡張） */
}

/* スクロールできる時だけ見せる（JSが .is-visible を付与） */
.oq-modal__scrollthumb.is-visible{
  opacity: 1;
}









/* scroll-lock */
html.oq-modal-open,
body.oq-modal-open{
  overflow: hidden;
}
body.oq-modal-open{
  padding-right: var(--sbw, 0px);
}

/* モーダル中はフローティング/ハンバーガー非表示 */
body.oq-modal-open .floating-btn{
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(10px);
}
body.oq-modal-open .hamburger{
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 低モーション環境 */
@media (prefers-reduced-motion: reduce){
  .oq-modal{ transition: none; }
}

/* ===== fixed要素の右ズレ補正（スクロールバー消失対策） ===== */
body.oq-modal-open .hamburger{
  right: calc(20px + var(--sbw, 0px));
}
body.oq-modal-open .floating-btn{
  right: calc(20px + var(--sbw, 0px));
}
@media (max-width: 767px){
  body.oq-modal-open .floating-btn{
    right: calc(12px + var(--sbw, 0px));
  }
}


/* ===== modal-close ズーム耐性・中央固定（保険） ===== */
@media screen and (min-width: 768px) {
  .modal-close {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    line-height: 1;
  }
}

