/* LIMap 読み物記事用スタイル。
   アプリ本体（DotGothic16のドットフォント）とは意図的に切り離し、
   長文でも読み疲れしにくい可読性重視のタイポグラフィにしている。 */

:root {
  --bg: #16130f;
  --surface: #211c16;
  --surface-alt: #2a241c;
  --border: #3a3226;
  --text-primary: #f4efe4;
  --text-secondary: #cdc3ae;
  --text-muted: #948a76;
  --accent: #dece32;
  --accent-text: #2a2a2a;
  --max-width: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-lang] {
  display: none;
}
[data-lang].lang-active {
  display: block;
}
span[data-lang].lang-active {
  display: inline;
}

/* --- iOS向けApp Store誘導バナー ---------------------------------------
   アプリ本体(src/components/AppStoreBanner.tsx)と同じ構成のバナー。
   配色は記事ページのパレットに合わせ、文字だけはApple純正UIに寄せた
   システムフォントで表示する(本文のNoto Sans JPとは意図的に変えている)。
   既定はhiddenで、article.js側がiOS端末のときだけ表示する。
   ページ最上部に通常フローで置くため、スクロールすると流れて消える
   (sticky指定の .site-header はその後もページ上部に残る)。 */
.app-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  /* スタンドアロン表示のときのノッチ分。ブラウザ表示では0になる */
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(62px + env(safe-area-inset-top, 0px));
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Hiragino Sans", sans-serif;
}

/* display:flex が hidden属性より強いため、明示的に打ち消す */
.app-banner[hidden] {
  display: none;
}

.app-banner-close {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.app-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
}

.app-banner-text {
  flex: 1;
  min-width: 0;
}

.app-banner-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: -0.1px;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-action {
  flex-shrink: 0;
  background-color: var(--accent);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1.2;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  /* ホーム画面に追加してスタンドアロン表示にした際、ステータスバー(時計・電池等)の
     領域にヘッダーが被らないよう、ノッチ/ステータスバー分の余白を追加で確保する */
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: rgba(22, 19, 15, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.site-header a.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header a.brand img.brand-logo {
  width: 72px;
  height: auto;
  display: block;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-switch button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
}

.lang-switch button.active {
  background-color: var(--accent);
  color: var(--accent-text);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 0;
}

.article-category {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

h1.article-title {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  font-size: 28px;
  line-height: 1.5;
  margin: 0 0 12px;
  font-weight: 700;
}

.article-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 28px;
}

.article-lead {
  font-size: 16px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 0 0 40px;
}

figure.article-hero {
  margin: 0 0 36px;
}

figure.article-inline {
  margin: 8px 0 32px;
}

figure.article-inline img {
  max-height: 340px;
}

figure.article-hero img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background-color: var(--surface);
}

figure.article-hero figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

figure.article-hero .hero-caption-text {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

figure.article-hero .hero-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

figure.article-hero .hero-credit a:hover {
  color: var(--text-secondary);
}

article section.article-section {
  margin-bottom: 36px;
}

h2.section-heading {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  font-size: 20px;
  line-height: 1.6;
  margin: 0 0 14px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.article-section p {
  font-size: 15.5px;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.spot-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 4px 0 24px;
}

@media (max-width: 520px) {
  .spot-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.spot-cards-label {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.spot-card {
  display: block;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
}

.spot-card:hover {
  border-color: var(--accent);
}

.spot-card-thumb {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  background-color: var(--surface-alt);
}

.spot-card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.55;
}

.spot-card-title {
  display: block;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

.cta-block {
  margin: 48px 0;
  padding: 28px 24px;
  background-color: var(--accent);
  border-radius: 16px;
  text-align: center;
}

.cta-block h2 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  color: var(--accent-text);
  font-size: 19px;
  margin: 0 0 8px;
}

.cta-block p {
  color: var(--accent-text);
  opacity: 0.85;
  font-size: 14px;
  margin: 0 0 18px;
}

.cta-block a.cta-button {
  display: inline-block;
  background-color: var(--accent-text);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 28px;
  border-radius: 999px;
  text-decoration: none;
}

.support-note {
  margin: -24px 0 48px;
  text-align: center;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.support-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.related-block {
  margin: 48px 0 60px;
}

.related-block h2 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  font-size: 18px;
  margin: 0 0 16px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 520px) {
  .related-list {
    grid-template-columns: 1fr;
  }
}

.related-list a {
  display: block;
  overflow: hidden;
  padding: 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.6;
}

.related-list a:hover {
  border-color: var(--accent);
}

.related-list img.card-thumb {
  display: block;
  width: calc(100% + 32px);
  height: 120px;
  object-fit: cover;
  margin: -16px -16px 12px;
  background-color: var(--surface-alt);
}

.related-list .related-category {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px 40px;
  text-align: center;
}

footer.site-footer a {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  margin: 0 10px;
}

footer.site-footer a:hover {
  color: var(--text-secondary);
}

/* 記事一覧ページ（/articles/）用 */
.hub-lead {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.hub-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 60px;
}

.hub-list a {
  display: block;
  overflow: hidden;
  padding: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
}

.hub-list a:hover {
  border-color: var(--accent);
}

.hub-list img.card-thumb {
  display: block;
  width: calc(100% + 40px);
  height: 160px;
  object-fit: cover;
  margin: -20px -20px 14px;
  background-color: var(--surface-alt);
}

.hub-list .hub-item-title {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  font-size: 17px;
  margin: 4px 0 8px;
}

.hub-list .hub-item-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
