/* =========================================================
   common.css（全ページ共通の“土台”／最小・堅牢構成）
   ---------------------------------------------------------
   ※ 既存コメント・設計思想は一切変更せず、
      パスワード保護フォームのUI調整のみを追加
   ========================================================= */


/* ---------------------------------------------------------
 * 0) デザイントークン（必要最小限）
 * ------------------------------------------------------ */
:root{
  --pageBg: #e6e5df;
  --text:   #333;
  --pageSide: clamp(16px, 4vw, 40px);
  --sbw: calc(100vw - 100%);
  --stickyTop: 0px;
  --focusColor: #111;
}


/* ---------------------------------------------------------
 * 1) ベースリセット
 * ------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html{
  background: var(--pageBg);
  -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
          text-size-adjust: 100%;
}

html, body{ min-height: 100%; }

body{
  margin: 0;
  color: var(--text);
  background: var(--pageBg);
  line-height: 1.7;
  overflow-x: clip;
  min-width: 320px;
}
@supports not (overflow: clip){
  body{ overflow-x: hidden; }
}

img, video, canvas, svg{
  display: block;
  max-width: 100%;
  height: auto;
}

figure{ margin: 0; }

:where(a, button, [role="button"], input, textarea, select):focus-visible{
  outline: 2px solid var(--focusColor);
  outline-offset: 2px;
}

.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


/* ---------------------------------------------------------
 * 1.25) Lenis 連携（省略：既存そのまま）
 * ------------------------------------------------------ */
html.lenis{ height: auto; }
.lenis.lenis-smooth{ scroll-behavior: auto !important; }
.lenis.lenis-stopped{ overflow: hidden; }
.lenis.lenis-smooth [data-lenis-prevent]{ overscroll-behavior: contain; }


/* ---------------------------------------------------------
 * 1.5) Sticky Footer
 * ------------------------------------------------------ */
.site-shell{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@supports (min-height: 100dvh){
  .site-shell{ min-height: 100dvh; }
}
.site-main{ flex: 1 0 auto; }
.site-footer{ margin-top: auto; }


/* ---------------------------------------------------------
 * 2) 100vw ズレ防止ユーティリティ
 * ------------------------------------------------------ */
.fullbleed{
  width: calc(100vw - var(--sbw, var(--sbw-js, 0px)));
  max-width: none;
}


/* ---------------------------------------------------------
 * 4.5) パスワード保護フォーム（UI調整）
 * ---------------------------------------------------------
 * functions-a-utilities.php の the_password_form 差し替えに対応
 * - 中央配置
 * - 入力＋確定を一体型（検索バー風）
 * - サイズは「少し小さめ」に抑制
 * ------------------------------------------------------ */
.aleg-pwgate{
  padding-block: clamp(24px, 6vh, 56px);
  padding-inline: var(--pageSide);
  display: grid;
  justify-items: center;
}

.aleg-pwgate__desc{
  width: min(640px, 100%);
  margin: 0 0 16px;
  text-align: center;
  color: var(--text);
}

.aleg-pwgate__form{
  width: min(680px, 100%);
  margin: 0;
}

.aleg-pwgate__row{
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  width: 100%;
}

/* 入力欄（左） */
.aleg-pwgate__input{
  flex: 1 1 auto;
  min-width: 0;

  font-size: 1.25rem;       /* ★少し小さく */
  line-height: 1.2;
  padding: 12px 16px;

  border: 1px solid #d0d0d0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: inherit;

  appearance: none;
  outline: none;
}

/* 確定ボタン（右） */
.aleg-pwgate__submit{
  font-size: 1.25rem;       /* ★少し小さく */
  line-height: 1.2;
  padding: 12px 22px;

  border: 1px solid #222;
  border-radius: 0 8px 8px 0;
  background: #222;
  color: #fff;

  cursor: pointer;
  white-space: nowrap;
}

@media (hover:hover){
  .aleg-pwgate__submit:hover{
    filter: brightness(1.05);
  }
}

.aleg-pwgate__input:focus{
  border-color: #b5b5b5;
}

/* 狭小画面では縦積み */
@media (max-width: 520px){
  .aleg-pwgate__row{
    flex-wrap: wrap;
  }
  .aleg-pwgate__input{
    flex-basis: 100%;
    border-right: 1px solid #d0d0d0;
    border-radius: 8px;
  }
  .aleg-pwgate__submit{
    width: 100%;
    border-radius: 8px;
  }
}


/* ---------------------------------------------------------
 * 4.75) タイトル横 SVG アイコン微調整
 * ------------------------------------------------------ */
.bs-title__icon,
.gal-title__icon,
.app-title__icon{
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.12em;
  margin-right: .35em;
}


/* ---------------------------------------------------------
 * 5) モーション配慮
 * ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  html{ scroll-behavior: auto !important; }
}


/* ---------------------------------------------------------
 * 6) 印刷時
 * ------------------------------------------------------ */
@media print{
  body{ background: #fff; }
}
