:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;  /* スクロールバー常設 */
  width: 100%;
  margin: 0;
}


body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #FFFAF0;
  color: #333333;
  line-height: 1.7;
  min-height: 100vh;
  margin: 0;
  padding: 0; 
}

/* ===== 全共通ラッパ ===== */
/* ===== 幅640以下は420px 絵的にこの幅が良い===== */

.page {
  padding: 0;
  max-width: 420px;
  margin: 0 auto;
}


/* 画面幅650pxより大きい場合（タブレット〜PC） 中央寄せ */
@media (min-width: 641px) {
  .page {
    max-width: 650px;
    margin: 0 auto;
  }
}




header {
  position: relative;    /* 追加：lang-switch / top-menu の基準 */
  display: flex;
  flex-direction: column;
  align-items: center;   /* タイトルやサブテキストは中央 */
  margin-bottom: 4px;
  min-height: 120px;     /* 追加：ロゴ＋タイトル分の高さを確保 */
}

/* 変更：ロゴだけ左寄せ（headerの左端＝.pageのpadding位置） */
header .logo-link{
  align-self: flex-start;
  display: inline-block;
  width: fit-content;      /* 中身の幅に合わせる */
  line-height: 0;          /* 余計な行ボックスを消す（当たり判定安定） */
  margin-right: auto;    /* 左に寄せて固定 */
  margin-left: 6px;
}


header .logo {
  width: clamp(200px, 60vw, 280px); /* ← 画面幅に応じてサイズ可変 */
  height: auto;
  display: block;
  border-radius: 30px;
  aspect-ratio: 400 / 128;
}


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: 10px;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  min-height: 80px;
}

footer p {
  text-align: center;
  font-size: 0.75rem;
  min-height: 1.7em;
}

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

footer a:hover {
  text-decoration: underline;
}

/* ヘッダー内のサブテキスト*/
header p {
  margin: 2px 0 0;
  line-height: 1.4;
  font-size: 0.75rem;   /* .text-xs 相当 */
  color: #6b7280;       /* .text-gray-500 相当 */
  min-height: 1.2rem;
}


/* ===== 汎用ユーティリティ ===== */
.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: 420px;
  margin: 0 auto;
  background-color: #FFFAF0;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
  padding: 20px 28px;
  min-height: 80vh; 
}

/* ===== 言語切替（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;
  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;
  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;
  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;
  margin-bottom: 1.5rem;
}


/* ===== 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;
}

.entry-btn2{
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  background-color: #eff6ff;
  color: #1d4ed8;
  max-width: 100%;
  padding: 4px 10px;                  /* .entry-btn と一致 */
  line-height: 1.4;
  white-space: normal;                /* 折り返し許可 */
  overflow-wrap: anywhere;            /* 長い単語も折る */
  min-height: calc(1.2em * 2 + 8px);  /* 2行+上下padding(4px*2=8px) */
}

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

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

.waypoint-intro{
  min-height: 480px;
  margin-bottom: 1rem;
  display: block;        /* 念のため明示 */
}



/* 画像ラップ */
.img-wrap {
  position: relative;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin: 6px 0 6px;
  max-width: 360px;
  max-height: 360px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 4 / 3;    /*  ここで箱を 4:3 に固定 */
}

/* 画像本体 */
.img-wrap img {
  display: block;
  max-width: 95%;    /* 親より大きければ縮む。小さいときはそのまま */
  max-height: 80%;   /* 箱(4:3)より高ければ縮む */
  width: auto;
  height: auto;
  margin: 2px;
  margin-left: auto;
  margin-right: auto;
  background-color: #f3f4f6;    /* ロード前のプレースホルダー */
  object-fit: contain;          /* はみ出し防止 */
  transition: opacity 0.4s ease;
  opacity: 0;                   /* ロード前非表示 */
}

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

.img-wrap figcaption {
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 3px;
  text-align: left;   /* 左寄せにしたいなら */
}


/* ===== 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;    /* 左に少しインデントを確保 */
  line-height: 1.7;
  min-height: 150px;
}

.list-card{
  margin: 1px 0;
  padding: 0px;
  border-radius: 4px;
  min-height: 180px; 
}

ul.list-disc li{
  margin: 0.35em 0;            /* 項目間の余白 */
}


/* ===== 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;
  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: 4px;
  width: 100%;
  height: 300px;
  max-width: 160px;
  text-align: center;
  align-self: flex-start;   /* 縦に伸びるのを防ぐ */
  display: flex;
  flex-direction: column;    /* 画像＋テキストを縦並びにする */
  overflow: hidden;           /* それ以上は非表示 */
}

/* ギャラリー画像 */
.gallery-img {
  display: block;
  margin: 0 auto 0.25rem;
  width: 100%;
  height: 160px;          /* 先に領域を確保（CLS対策） */
  object-fit: contain;    /* 切り取りなし */
  object-position: center;
  border-radius: 0.375rem;
  aspect-ratio: 1 / 1;
}

/* キャプションと都市名 */
.gallery-caption {
  font-size: 0.75rem;
  color: #374151;
  margin: 0;
  padding: 0;
  max-width: 130px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;      /* 最大3行 */
  -webkit-box-orient: vertical;
  overflow: hidden;           /* それ以上は非表示 */
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  min-height: 520px;  /* ここだけで“画像ゾーン”の高さを予約する */
}


.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;
}



/* 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語も折り返し */
  }
}


/* 🚩＋地名の行 */
.gallery-meta {
  text-align: left;
  margin: 2px 0;
}

/* 🚩ボタンを小さく・背景なし */
.btn-report {
  padding: 0;
  margin-right: 4px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.btn-report:hover {
  opacity: 0.7;
}

.report-msg {
  display: block;
  font-size: 0.7rem;
  color: #d97706;  /* 濃い黄色（ダークイエロー系） */
  margin-top: 2px;
  min-height: 1rem;
}

