/* =========================================================
 * e-time map アーカイブ 専用スタイル
 * すべて .ema- プレフィックスで名前空間を分離
 * ======================================================= */
:root {
  --ema-orange: #e8501e;
  --ema-orange-dark: #c73f12;
  --ema-cream: #fdf6e3;
  --ema-ink: #3a2e28;
  --ema-paper: #fffdf8;
}

* { box-sizing: border-box; }

body.ema-body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--ema-cream);
  color: var(--ema-ink);
  line-height: 1.8;
}

/* ---------- ヘッダー ---------- */
.ema-header {
  background: var(--ema-orange);
  color: #fff;
  padding: 40px 20px 32px;
  text-align: center;
}
.ema-header .ema-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 42px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0;
}
.ema-header .ema-brand .ema-brand-sub {
  font-style: normal;
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 6px;
  display: block;
  margin-top: 6px;
  opacity: .95;
}
.ema-header .ema-period {
  margin: 14px 0 0;
  font-size: 14px;
  letter-spacing: 3px;
  opacity: .9;
}

/* ---------- 感謝メッセージ ---------- */
.ema-message {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 8px;
  text-align: center;
}
.ema-message h2 {
  font-size: 20px;
  color: var(--ema-orange-dark);
  letter-spacing: 2px;
  margin: 0 0 20px;
}
.ema-message p {
  font-size: 15px;
  margin: 0 0 1.2em;
  text-align: left;
}
@media (min-width: 600px) {
  .ema-message p { text-align: center; }
}

/* ---------- 号別グリッド ---------- */
.ema-gallery {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}
.ema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
}

/* ---------- 号カード（表紙＋面ボタン） ---------- */
.ema-card {
  background: var(--ema-paper);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(58, 46, 40, .12);
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ema-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(58, 46, 40, .2);
}
.ema-card-cover {
  aspect-ratio: 707 / 1000; /* A判縦の比率 */
  width: 100%;
  object-fit: cover;
  display: block;
  background: #eee;
}
/* 表紙が現存しない号 */
.ema-card-cover--none {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 55%),
    linear-gradient(150deg, var(--ema-orange) 0%, var(--ema-orange-dark) 100%);
  color: #fff;
}
.ema-cover-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: bold;
  font-size: 24px;
}
.ema-cover-year { font-size: 14px; letter-spacing: 2px; opacity: .9; }
.ema-card-label {
  padding: 12px 12px 4px;
  font-size: 15px;
  text-align: center;
}
.ema-side-btns {
  display: flex;
  gap: 8px;
  padding: 8px 12px 14px;
  justify-content: center;
}
.ema-side-btn {
  flex: 1;
  max-width: 110px;
  text-align: center;
  font-size: 13px;
  color: var(--ema-orange-dark);
  border: 1.5px solid var(--ema-orange);
  border-radius: 16px;
  padding: 5px 0;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.ema-side-btn:hover {
  background: var(--ema-orange);
  color: #fff;
}

/* ---------- フッター ---------- */
.ema-footer {
  background: var(--ema-ink);
  color: #f0e9e2;
  text-align: center;
  padding: 36px 20px;
  font-size: 13px;
}
.ema-footer a { color: #ffb08a; text-decoration: none; }
.ema-footer a:hover { text-decoration: underline; }
.ema-footer .ema-footer-name { font-size: 15px; font-weight: bold; margin-bottom: 6px; }

/* ---------- ビューアページ ---------- */
.ema-viewer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ema-orange);
  color: #fff;
  padding: 10px 16px;
}
.ema-viewer-bar h1 { font-size: 16px; margin: 0; flex: 1; }
.ema-viewer-bar .ema-back {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  padding: 4px 14px;
  white-space: nowrap;
}
.ema-viewer-bar .ema-back:hover { background: rgba(255,255,255,.15); }
.ema-viewer-bar .ema-hint { font-size: 12px; opacity: .85; white-space: nowrap; }
.ema-viewer {
  width: 100%;
  height: calc(100vh - 52px);
  background: #333;
}
@media (max-width: 600px) {
  .ema-header .ema-brand { font-size: 30px; }
  .ema-viewer-bar .ema-hint { display: none; }
  .ema-viewer { height: calc(100vh - 48px); }
}
