/* =============================================
   AKIRA travels — 閲覧ページ共通スタイル
   ============================================= */

:root {
  --brown:      #4a3000;
  --orange:     #cc6600;
  --gray:       #aaaaaa;
  --bg-fallback:#f0e0c8;
  --font-main:  "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--brown);
  background-color: var(--bg-fallback);
  background-image: url("https://akiratravels.github.io/images/w_brown.jpg");
  background-repeat: repeat;
}

/* =============================================
   管理者リンク（index.html のみ）
   ============================================= */

#admin-link {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 100;
  font-size: 11px;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.6);
  padding: 3px 8px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

#admin-link a {
  color: var(--gray);
  text-decoration: none;
}

/* =============================================
   トップページ
   ============================================= */

.top-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 0 0;
  margin-bottom: 0;
}

.top-logo {
  text-align: center;
  padding: 24px 16px 16px;
}

.top-logo img {
  max-width: 280px;
  height: auto;
}

.top-logo-fallback {
  font-size: 28px;
  font-weight: bold;
  color: var(--brown);
  letter-spacing: 0.1em;
}

/* 国名リスト */
#country-list-wrap {
  padding: 8px 16px;
}

#country-list-wrap table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#country-list-wrap td {
  text-align: center;
  padding: 2px 0;
  vertical-align: middle;
}

.country-cell {
  padding: 6px 4px;
}

.country-name-text {
  font-family: "Hiragino Mincho ProN", "ヒラギノ明朝 ProN", "Hiragino Kaku Gothic ProN",
               "ヒラギノ角ゴ ProN", "游ゴシック", "Yu Gothic", Meiryo, sans-serif;
  font-feature-settings: "palt";
  font-weight: bold;
  font-size: 22px;
  display: block;
}

@media (min-width: 600px) {
  .country-name-text {
    font-size: 26px;
  }
}

.country-subtitle {
  font-family: "Hiragino Mincho ProN", "ヒラギノ明朝 ProN", "Hiragino Kaku Gothic ProN",
               "ヒラギノ角ゴ ProN", "游ゴシック", "Yu Gothic", Meiryo, sans-serif;
  font-feature-settings: "palt";
  font-size: 13px;
  color: #7a5a20;
  display: block;
  margin-top: 2px;
}

.country-name-text.has-posts {
  color: #cc6600;
}

.country-name-text.no-posts {
  color: #aaaaaa;
}

a.country-link {
  text-decoration: none;
  color: inherit;
}

/* =============================================
   国別ページ
   ============================================= */

body.country-page {
  background-attachment: local;
}

.country-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.country-header {
  background: transparent;
  padding: 24px 16px 12px;
  border-bottom: 1px solid rgba(74, 48, 0, 0.15);
}

.country-title {
  text-align: center;
  font-size: 1.4em;
  font-weight: bold;
  color: var(--brown);
}

.country-description {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--brown);
  white-space: pre-wrap;
  padding: 0 4px;
}

/* 代表写真 */
.cover-photo-wrap {
  text-align: center;
  padding: 16px;
}

#cover-photo {
  max-width: 60%;
  height: auto;
  display: inline-block;
  cursor: pointer;
}

@media (max-width: 599px) {
  #cover-photo {
    max-width: 85%;
  }
}

#cover-photo:hover {
  transform: scale(1.01);
  transition: transform 0.2s;
}

/* 投稿チェーン */
.post-chain {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.chain-item {
  text-align: center;
  padding: 4px 0;
}

.chain-link {
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  color: var(--orange);
}

.chain-link:hover {
  text-decoration: underline;
}

.chain-arrow {
  color: var(--brown);
  font-size: 14px;
}

.chain-separator-wrap {
  text-align: center;
  padding: 8px 0;
}

.chain-separator {
  display: inline-block;
  width: 60%;
  border: none;
  border-top: 1px solid var(--brown);
  margin: 0;
}

@media (max-width: 599px) {
  .chain-separator {
    width: 85%;
  }
}

/* =============================================
   詳細モーダル
   ============================================= */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--bg-fallback);
  background-image: url("https://akiratravels.github.io/images/w_brown.jpg");
  background-repeat: repeat;
  background-attachment: local;
  z-index: 500;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.open {
  display: block;
}

@media (min-width: 900px) {
  .modal-body {
    width: 65%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* スティッキーバー */
.modal-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 510;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(74, 48, 0, 0.15);
}

.modal-sticky-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--brown);
}

.modal-sticky-meta {
  font-size: 14px;
  color: #7a5a20;
}

/* キャプション */
.modal-caption {
  font-size: 17px;
  color: var(--brown);
  font-weight: normal;
  line-height: 1.75;
  white-space: pre-wrap;
  padding: 4px 16px 20px;
  border-bottom: 1px solid rgba(74, 48, 0, 0.15);
}

/* メディア */
.media-item img,
.media-item video {
  width: 100%;
  display: block;
}

.media-item video {
  background: #000;
  cursor: pointer;
}

.media-caption {
  font-size: 16px;
  color: #7a5a20;
  padding: 8px 16px 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 下部ナビ */
.modal-footer {
  padding: 24px 16px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: transparent;
}

.modal-footer img {
  height: 36px;
  cursor: pointer;
}

.modal-footer-btn {
  cursor: pointer;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--brown);
  background: rgba(74, 48, 0, 0.08);
  border: 1px solid rgba(74, 48, 0, 0.2);
  border-radius: 4px;
  font-family: var(--font-main);
}

/* 著作権 */
.modal-copyright {
  text-align: center;
  font-size: 13px;
  color: #7a5a20;
  padding: 0 16px 20px;
  background: transparent;
}

/* =============================================
   フッター（共通）
   ============================================= */

.top-footer {
  padding-bottom: 0;
  margin-bottom: 0;
  padding-top: 20px;
  text-align: center;
}

.country-footer {
  padding: 20px 16px 0;
  text-align: center;
}

.footer-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.footer-icons a {
  display: inline-flex;
  align-items: center;
}

.footer-icons img {
  height: 32px;
}

.copyright {
  font-size: 12px;
  color: #7a5a20;
  padding: 8px 0 0;
}

/* =============================================
   ユーティリティ
   ============================================= */

.loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--gray);
  font-size: 15px;
}

.error-msg {
  text-align: center;
  padding: 40px 16px;
  color: #8b2020;
  font-size: 15px;
}
