:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

/* 追加：縦スクロールバーを常に確保して横幅の変化をなくす */
html {
  overflow-y: scroll;
}
/* ===== ベース ===== */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #111827;
  line-height: 1.7;
}

 
/* ===== 全共通（全ページで共有）===== */
.page {
  padding: 16px 8px;
}

header {
  position: relative;    /* 追加：lang-switch / top-menu の基準 */
  text-align: center;
  margin-bottom: 4px;
  min-height: 100px;     /* 追加：ロゴ＋タイトル分の高さを確保 */
}

header .logo-link {
  display: inline-block;
}

header .logo {
  width: 200px;          /* 好きな横幅に変えてOK */
  height: 60px;          /* アスペクトに合わせて調整 */
  display: block;
}

@media (min-width: 640px) {
  header .logo {
    max-width: 260px;
  }
}

@media (min-width: 1024px) {
  header .logo {
    max-width: 300px;
  }
}

h1 {
  font-size: 1.5rem;
  margin: 0;
  line-height: 1.2;
  color: #1d4ed8;
  font-weight: 700;
}

h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: #2563eb;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #2563eb;
  font-weight: 600;
}

p {
  margin: 4px 0 8px;
  font-size: 0.96rem;
}

section {
  margin-bottom: 28px;
}

section:last-of-type {
  margin-bottom: 0;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0 12px;
}

footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ===== 汎用ユーティリティ ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: #6b7280; }

.small-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}

.contact {
  margin-top: 8px;
  font-size: 0.9rem;
}

/* ===== カード共通レイアウト ===== */
.card {
  max-width: 768px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
  padding: 20px 28px;
}

/* ===== 言語切替（privacy / terms / gallery）===== */
.lang-switch {
  position: absolute;
  top: 1.0rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column; 
  align-items: center;
  gap: 0.4rem;
}

.lang-select {
  appearance: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  font-size: 0.8rem;
  padding: 4px 6px;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ===== ボタン共通 ===== */
.btn-primary {
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-primary:hover { background-color: #1d4ed8; }

.btn-secondary {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #fff;
  color: #111827;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
}
.btn-secondary:hover { background-color: #f9fafb; }

.btn-secondary-sm {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #fff;
  color: #111827;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}
.btn-secondary-sm:hover { background-color: #f9fafb; }

/* ===== 汎用レイアウト補助 ===== */
.center-block {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.row-space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.section-sep {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.hidden {
  display: none;
}

/* ===== テキスト補助 ===== */
.notice-text {
  font-size: 0.75rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.count-text {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}



/* ヘッダー内のサブテキスト（"price-tag image archive & quiz project" 用） */
header p {
  margin: 2px 0 0;
  line-height: 1.4;
  font-size: 0.75rem;   /* .text-xs 相当 */
  color: #6b7280;       /* .text-gray-500 相当 */
}


/* ===== index.html 専用 ===== */

/* メインサイトへのボタン行 */
.entry-link {
  margin-top: 0;
  margin-bottom: 5px;
}

.entry-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.entry-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ===============================
   CLS対策 + 遅延読み込み統合版
   =============================== */

/* 画像ラップ */
.img-wrap {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin: 12px 0 8px;
}

/* 画像本体 */
.img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  background-color: #f3f4f6;    /* ロード前のプレースホルダー */
  object-fit: contain;          /* はみ出し防止 */
  transition: opacity 0.4s ease;
  opacity: 0;                   /* ロード前非表示 */
}

/* ロード完了後にフェードイン */
.img-wrap img:is([loading="lazy"]):not([src=""]) {
  opacity: 1;
}



/* ===== site_map terms.html 専用 ===== */
/* 箇条書き */
ul.list-disc {
  list-style-type: disc;
  list-style-position: inside;
  margin: 0.5em 0;      /* 上下に0.5emの余白（左右0） */
  padding-left: 0.1em;    /* 左に少しインデントを確保 */
}



/* ===== gallery: main.css 相当のレイアウトを再現 ===== */



/* 640px 以上で 3 列（sm:grid-cols-3） */
@media (min-width: 640px) {
  #gallery-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== Notice Bar（告知バー） ===== */
#notice-bar {
  display: none; /* JSで切り替え前提 */
  background-color: #fef3c7; /* 淡い黄色 */
  color: #92400e;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #fcd34d;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ===== Post Logs（consent-log）専用レイアウト ===== */

/* 全体の文字サイズ・行間 */
#consent-log {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #4b5563;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
               Consolas, "Liberation Mono", "Courier New", monospace;
}

#consent-log ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.consent-log-item {
  font-size: 0.7rem;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
  padding: 2px 0;
}

.consent-log-item:last-child {
  border-bottom: none;
}



/* ===== JS連携 ===== */

/* 国選択セレクト（#country-select） */
#country-select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 4px 6px;
  background-color: #fff;
  font-size: 0.85rem;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  appearance: none;
}

/* 空メッセージ (#empty-msg) */
#empty-msg {
  color: #6b7280;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
}

/* 同意ログ更新ボタン (#refresh-consent-log) */
#refresh-consent-log {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #fff;
  color: #111827;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}
#refresh-consent-log:hover {
  background-color: #f9fafb;
}





/* 長い image_key を末尾「…」で切る（truncate 相当） */
#consent-log .truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* ギャラリー用カード（Tailwind依存削除） */
.card-gallery {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 8px;
  text-align: center;
}

/* ギャラリー画像 */
.gallery-img {
  display: block;
  margin: 0 auto 0.5rem;
  max-height: 12rem;
  width: 100%;
  object-fit: cover;
  border-radius: 0.375rem;
}

/* キャプションと都市名 */
.gallery-caption {
  font-size: 0.9rem;
  color: #374151;
}

.gallery-city {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}



.wallet {
  font-family: monospace;
}

.image-key {
  margin-left: 0.5rem;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  vertical-align: bottom;
}

.consent-type, .timestamp {
  margin-left: 0.5rem;
}

/* 追加 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* menu bar */

.top-bar {
  display: flex;
  justify-content: flex-end;
  padding: 6px 10px;
}

.menu-toggle {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  padding: 4px 8px;
  cursor: pointer;

}
.top-menu[hidden] {
  display: none;
}

.top-menu {
  position: absolute;
  right: 10px;
  top: 90px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 6px 8px;
  display: flex;   
  flex-direction: column;   /* ← 縦並び */
  align-items: flex-end;
  gap: 4px;
  z-index: 50;
}

.top-menu a {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: #4b5563;
  display: block;
}

.top-menu a:hover {
  background: #f3f4f6;
  padding: 2px 2px;
}

@media (max-width: 640px) {
  .section-sep pre code {
    white-space: pre-wrap;   /* 改行を維持しつつ折り返し */
    word-wrap: break-word;   /* 長い1語も折り返し */
  }
}




