/* health ダッシュボード（style_main.css）の書式に準拠：黒背景・Arial・白文字・中央寄せ */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: black;
  font-family: Arial, sans-serif;
  color: white;
  padding: 16px;
  font-size: 16px;
}

h1, h2, h3 {
  font-family: Arial, sans-serif;
  color: white;
  margin-top: 0;
  line-height: 1.3;
}
h1 { font-size: 1.8rem; text-align: center; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }

.portal-link {
  text-align: center;
  margin: -4px 0 12px;
  font-size: 0.85rem;
}
.portal-link a {
  color: #6db3ff;
  text-decoration: none;
  opacity: 0.7;
}
.portal-link a:hover { opacity: 1; }

/* health の text-block / center-text に合わせる */
.text-block { margin-bottom: 24px; }
.center-text { text-align: center; }

/* 更新履歴の Markdown 描画（health の .markdown-body に準拠）*/
.markdown-body {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  line-height: 1.6;
}
.markdown-body h1 { font-size: 1.4rem;  margin: 0 0 8px;    text-align: center; }
.markdown-body h2 { font-size: 1.15rem; margin: 18px 0 6px; text-align: center; }
.markdown-body h3 { font-size: 1rem; opacity: 0.9; margin: 10px 0 2px; text-align: left; }
.markdown-body ul { margin: 4px 0 4px; padding-left: 20px; text-align: left; }
.markdown-body li { margin: 2px 0; }
.markdown-body a { color: #6db3ff; }

/* health の .site-footer に合わせる */
.site-footer {
  margin: 24px 0 8px;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

/* iframe 埋め込み時はヘッダ/フッタを畳んで地図主体に */
body.embed { padding: 0; }
body.embed > h1,
body.embed > .site-footer { display: none; }

/* ---- レイアウト ---- */
.loc {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .loc { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}

.loc__map-wrap {
  position: relative;
  background: #141414;
  border: 1px solid #333;
  border-radius: 10px;
  overflow: hidden;
  /* 横長の固定アスペクト（縦に伸びすぎないようにする）*/
  height: clamp(300px, 50vh, 460px);
}

.loc__map { width: 100%; height: 100%; }

.loc__current {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 500;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  max-width: calc(100% - 20px);
}
.loc__current[hidden] { display: none; }
.loc__current strong { color: #4ea1ff; }
.loc__current .when { color: #9aa0aa; font-size: 12px; display: block; }

/* 非表示地点マスク：地図全体をグレーで覆い「HIDDEN」を中央表示 */
.loc__mask {
  position: absolute;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3a3a3a;
  color: #d0d0d0;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.35em;
}
.loc__mask[hidden] { display: none; }

.loc__feed-wrap {
  background: #141414;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px;
  overflow-y: auto;
  max-height: 70vh;
}

.loc__feed-title { margin: 0 0 8px; font-size: 14px; color: #9aa0aa; font-weight: 600; }

.loc__feed { list-style: none; margin: 0; padding: 0; }

.loc__feed li {
  padding: 8px 4px;
  border-bottom: 1px solid #2a2a2a;
}
.loc__feed .label { font-size: 14px; }
.loc__feed .when { color: #9aa0aa; font-size: 12px; }
.loc__feed .src { color: #6b7280; font-size: 11px; }

/* PC では画面幅いっぱいに使い、地図と履歴の縦幅を揃える（モバイルは base 値のまま）。
   base のレイアウト規則より後に置くこと（同詳細度・後勝ちで base の高さ指定を上書きする）。*/
@media (min-width: 701px) {
  .loc {
    max-width: none;                       /* 画面サイズ依存（width:100% でほぼ全幅）*/
    grid-template-columns: 1fr 340px;      /* 地図は伸縮・履歴は固定幅 */
    --panel-h: clamp(440px, 70vh, 820px);  /* 地図・履歴 共通の縦幅 */
  }
  .loc__map-wrap { height: var(--panel-h); }
  .loc__feed-wrap { height: var(--panel-h); max-height: none; }  /* 縦幅を地図に揃え内部スクロール */
}
