/* =====================================================
   Atatter Front Styles
   ===================================================== */

/* ===== 全ページ共通ヘッダー ===== */
.atatter-global-header {
  position: relative;
  text-align: center;
  padding: 0.8em 0;
  border-bottom: 1px solid #d1d5db;
  background: #fff;
  z-index: 5; /* 背景より前面に */
}

/* タイトル（アタッター）を中央固定 */
.atatter-title {
  font-size: 26px;
  font-weight: 700;
  color: #0077cc;
  margin: 0;
  line-height: 1;
  position: relative;
  display: inline-block; /* ← 中央に収める */
}

/* ==============================
   PC表示では共通ヘッダー＆フッターを非表示
   ============================== */
@media (min-width: 1025px) {
  /*.atatter-global-header,*/
  .atatter-footer-nav {
    display: none !important;
  }
}

/* Select2ドロップダウン位置・重なり補正 */
.select2-container {
  z-index: 9999 !important;
}

.select2-dropdown {
  position: absolute !important;
  z-index: 99999 !important;
  top: auto !important;
}

/* フォーム内のoverflow隠れ防止 */
#front-hit-form {
  overflow: visible !important;
}

.atatter-front h2 {
  font-size: 1.4rem;
  margin-bottom: 1em;
}

.atatter-front .field {
  margin-bottom: 1.2em;
}

.atatter-front button {
  padding: 0.5em 1em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  margin-top: 20px;
}

#front-hit-submit[disabled],
#front-hit-image-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ======================
   検索フォーム（全幅・Select2対応版）
   ====================== */
.search-area {
  background-color: #f5fcff;
  padding: 0.8rem 0;
}

/* ===== フォーム全体枠 ===== */
.search-form {
  display: block;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #c9d7e8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ===== Select2 ボックス統合スタイル ===== */
.search-form .select2-container--default .select2-selection--single {
  height: 40px !important;
  line-height: 40px !important;
  border: none !important;           /* 外枠はフォーム側で統一 */
  border-radius: 8px !important;     /* 全角丸 */
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: none !important;
  background: transparent;
  width: 100%;
}

/* テキスト・プレースホルダー調整 */
.search-form .select2-selection__rendered {
  line-height: normal !important;
  font-size: 14px;
  padding-left: 10px;
  display: flex;
  align-items: center;
}
.search-form .select2-selection__placeholder {
  color: #999 !important;
}

/* 矢印位置 */
.search-form .select2-selection__arrow {
  height: 40px !important;
  top: 0 !important;
  right: 6px !important;
  display: flex;
  align-items: center;
}

/* フォーカス時の境界線変更 */
.search-form .select2-container--default.select2-container--focus .select2-selection--single,
.search-form .select2-container--default .select2-selection--single:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ===== ドロップダウン（下に自然に展開） ===== */
.select2-container--open .select2-dropdown {
  z-index: 99999 !important;
  border-radius: 0 0 8px 8px !important;
  border: 1px solid #c9d7e8 !important;
  margin-top: -1px;
  position: absolute !important;
}

/* 開いた時は外枠の下角を直角にして、ドロップダウンと一体化 */
.search-form.is-open {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* ドロップダウンの上角を直角に＋隙間を消す */
.select2-dropdown {
  position: absolute !important;
}
.select2-container--open .select2-dropdown {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  margin-top: -1px !important; /* 枠線をつなぐ */
  z-index: 99999 !important;
}

/* メッセージの余白を詰める */
.select2-results__message {
  padding: 6px 10px !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  font-size: 13px !important;
  color: #666;
}

/* 余白が広く見える場合の保険（結果リストの内側余白をゼロに） */
.select2-results { padding: 0 !important; }




/* Astraフッターの背景を白に固定 */
.site-footer,
.site-below-footer-wrap,
.ast-footer-bar {
  background: #ffffff !important;
  position: relative;
  z-index: 5; /* 背景の上に浮かせる */
}

/* Astraテーマのヘッダーを非表示 */
.site-header {
  display: none !important;
}

/* Astra外枠をページ単位で解除 */
.page-id-2 .ast-container {
  max-width: none !important;
  padding: 0 !important;
}

/* ============================
  みんなの当選報告
============================ */
.atatter-hits-gallery {
  width: 100% !important;
  box-sizing: border-box;
  margin: 0 auto;
  padding-right: 0 !important;
  overflow-x: hidden; /* 横スクロール対策 */
}

/* ===== 各キャラブロック ===== */
.character-section {
  border-bottom: 1px solid #eee;
  padding-bottom: 0.8rem;
  margin-bottom: 0.6rem;
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.character-title {
  font-size: 14px;
  color: #000;
  font-weight: 600;
  margin-left: 10px;
  margin-bottom: 0;
}

/* ===== キャラタイトルのリンク化 ===== */
.character-title a {
  text-decoration: none !important;
  color: #000;
  font-weight: 600;
}
.character-title .arrow {
  color: #0077cc;
  margin-left: 0.2em;
  font-size: 1.1em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ===== 画像ギャラリー部分 ===== */
.hit-images {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: nowrap;           /* ← 折り返さない */
  overflow: hidden;            /* はみ出し防止 */
}

.hit-thumb {
  width: calc((100% - 12px) / 3); /* ← 3枚を横に並べる（gap分を引く） */
  aspect-ratio: 1 / 1;           /* 正方形を維持 */
  object-fit: cover;             /* 画像を枠内でトリミング */
  border-radius: 6px;
  transition: transform 0.2s ease;
}

/* ===== 画像リンクとユーザー名オーバーレイ ===== */
.hit-thumb-link {
  display: block;
  position: relative;
  width: calc((100% - 12px) / 3);
  aspect-ratio: 1 / 1;
}

.hit-thumb-link img.hit-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0px;
  display: block;
}

.hit-thumb-link .hit-username {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.2;
  max-width: 60%;          /* ← 画像の幅に対する上限 */
  white-space: nowrap;     /* ← 折り返し禁止 */
  overflow: hidden;        /* ← はみ出した部分を隠す */
  text-overflow: ellipsis; /* ← 「…」を末尾に付ける */
}

/* hoverアニメーション（既存と調和） */
.hit-thumb-link img.hit-thumb:hover {
  transform: scale(1.03);
}

/* ===== 検索結果一覧 ===== */
.atatter-hits-results {
  padding: 0.8rem;
}

.atatter-hits-results .front-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0.5rem 0 0.8rem;
  border-left: 4px solid var(--ast-global-color-0, #3b82f6);
  padding-left: 8px;
}

/* グリッド配置 */
.hits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px; /* ← 隙間最小 */
}

/* 各カード */
.hit-card {
  position: relative;
}

.hit-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.hit-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ユーザー名（画像オーバーレイ） */
.hit-user {
  position: absolute;
  bottom: 3px;
  left: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
}

/* 画像の縦横比を揃える（object-fit対応） */
.hit-image-wrap img,
.hit-card-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

/* ============================
   固定フッター ナビ（アイコン強調版）
============================ */
.atatter-footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 6px;
  z-index: 9999;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* aタグ全体の下線を完全に消す */
.atatter-footer-nav a,
.atatter-footer-nav a:visited,
.atatter-footer-nav a:hover,
.atatter-footer-nav a:active {
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}

/* ボタン全体 */
.atatter-footer-nav .nav-item {
  color: #6b7280;
  text-align: center;
  font-size: 0.65rem; /* ← メニュー名かなり小さく */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.2s ease;
}

/* アイコン部分（強調） */
.atatter-footer-nav .nav-item i {
  font-size: 2.2rem; /* ← ドンと大きく！ */
  line-height: 1;
  margin-bottom: 0;
}

/* アクティブ時・ホバー時 */
.atatter-footer-nav .nav-item.active {
	color: #0077cc;
}

.atatter-footer-nav .nav-item:hover {
  color: inherit !important;
}

/* Astraフッターを固定フッターの上に上げる */
.site-below-footer-wrap {
  margin-bottom: 60px; /* 固定フッターの高さ分だけ上に余白をとる */
}

/* スマホ専用 */
@media (

/* ===============================
   Select2のはみ出し対策（モバイル最適化）
=============================== */

/* 選択フォーム本体を幅いっぱいに */
.select2-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ドロップダウンの外側を強制的に画面内に収める */
.select2-container .select2-dropdown {
  position: fixed !important; /* absolute → fixed に */
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 auto !important;
  box-sizing: border-box;
  z-index: 9999;
}

/* 入力フィールド部分も幅を固定 */
.select2-selection {
  width: 100% !important;
  box-sizing: border-box;
}

/* 横スクロールを完全に無効化 */
html,
body {
  overflow-x: hidden !important;
}

/* AstraやElementorが持つ「overflow:hidden」干渉対策 */
.elementor,
.site-content {
  overflow-x: hidden !important;
}

/* ===============================
   当選投稿フォーム（セレクト共通スタイル）
=============================== */
.atatter-select,
.select2-container {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

.select2-container .select2-selection {
  width: 100% !important;
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* モバイル用補正 */
@media (max-width: 768px) {
  .atatter-select,
  .select2-container {
    width: 100% !important;
  }
}

/* Astraのコンテナ制限を無効化 */
.elementor-page .ast-container {
  max-width: none !important;
  padding: 0 !important;
}

/* ===============================
   会員系
=============================== */
.atatter-login-wrapper, .atatter-register-wrapper {
  max-width: 360px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #c9d7e8;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.atatter-login-wrapper h2,
.atatter-register-wrapper h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.login-field, .register-field {
  margin-bottom: 14px;
}

.login-field label,
.register-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.login-field input,
.register-field input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-submit button,
.register-submit button {
  width: 100%;
  background: #0077cc;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

.login-submit button:hover,
.register-submit button:hover {
  background: #005fa3;
}

p.error { color: red; font-size: 13px; }
p.success { color: green; font-size: 13px; }
.login-note, .register-note {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
}

/* 吹き出し：2行OK＋左に寄せる */
/*
.atatter-bubble {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-160%, -45%);
  background: #eaf3ff;
  color: #0077cc;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 10px;
  line-height: 1.3;
  white-space: normal;
  width: 100px;         
  text-align: center;
  box-sizing: border-box;
}

.atatter-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #eaf3ff;
}
*/

