/*
Theme Name: Japan Train Guide
Theme URI: https://example.com/japan-train-guide
Author: Codex
Description: A diagram-rich guide to riding Japanese conventional trains and Shinkansen with Suica, credit cards, ticket machines, QR tickets, and IC cards.
Version: 1.0.0
Requires at least: 6.0
Text Domain: japan-train-guide
*/

:root {
  --ink: #17212b;
  --muted: #5d6874;
  --paper: #f4f7f8;
  --surface: #ffffff;
  --line: #d7e1e5;
  --rail: #1f6f8b;
  --suica: #36a269;
  --ticket: #d88f28;
  --warn: #c64848;
  --navy: #20314f;
  --shadow: 0 18px 42px rgba(23, 33, 43, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.75;
}
a { color: inherit; }
.tg-page { min-height: 100vh; }
.tg-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 248, 0.96);
  backdrop-filter: blur(12px);
}
.tg-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.tg-brand { text-decoration: none; font-size: 18px; font-weight: 950; letter-spacing: 0; }
.tg-lang {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.tg-lang a {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}
.tg-lang a.is-active { color: #fff; background: var(--ink); }
.tg-main { max-width: 1180px; margin: 0 auto; padding: 42px clamp(18px, 4vw, 56px) 74px; }
.tg-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(330px, 1.05fr);
  gap: 34px;
  align-items: center;
}
.tg-kicker { margin: 0 0 8px; color: var(--rail); font-weight: 950; }
h1 { margin: 0 0 18px; font-size: clamp(34px, 5vw, 64px); line-height: 1.06; letter-spacing: 0; }
h2 { margin: 0 0 16px; font-size: clamp(27px, 3.3vw, 42px); line-height: 1.12; letter-spacing: 0; }
h3 { margin: 0 0 10px; font-size: 21px; line-height: 1.25; letter-spacing: 0; }
.tg-lead { margin: 0; max-width: 690px; color: var(--muted); font-size: 17px; }
.tg-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.tg-quick a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 850;
}
.tg-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.tg-panel, .tg-card, .tg-step, .tg-alert, .tg-source {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 33, 43, 0.07);
}
.tg-panel { padding: clamp(16px, 3vw, 26px); box-shadow: var(--shadow); }
.tg-map { display: block; width: 100%; height: auto; }
.tg-section { margin-top: 54px; }
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tg-card { padding: 18px; }
.tg-card p, .tg-step p { margin: 0; color: var(--muted); }
.tg-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.tg-step { position: relative; padding: 18px; min-height: 170px; overflow: hidden; }
.tg-step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 950;
}
.tg-step svg { width: 100%; height: 92px; margin-bottom: 8px; }
.tg-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.tg-list { padding-left: 1.2em; margin: 10px 0 0; color: var(--muted); }
.tg-list li { margin: 6px 0; }
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9f4ef;
  color: #176144;
  font-size: 13px;
  font-weight: 900;
}
.tg-alert { padding: 18px; border-color: #efc5c5; background: #fff7f7; }
.tg-alert strong { color: var(--warn); }
.tg-machine {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 14px;
  align-items: center;
}
.tg-screen {
  padding: 14px;
  border: 3px solid #26374b;
  border-radius: 8px;
  background: #e9f6ff;
}
.tg-screen div {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  font-weight: 850;
}
.tg-card-slot {
  height: 92px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2f3f52, #17212b);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 900;
}
.tg-transfer {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.tg-transfer div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  font-weight: 900;
  text-align: center;
}
.tg-transfer span { color: var(--rail); font-size: 26px; font-weight: 950; }
.tg-source { margin-top: 54px; padding: 20px; }
.tg-source ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
.tg-source a { color: var(--rail); font-weight: 850; }
.tg-home-link { margin: 34px 0 0; text-align: center; }
.tg-home-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}
.tg-footer { padding: 26px clamp(18px, 4vw, 56px); color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .tg-hero, .tg-two { grid-template-columns: 1fr; }
  .tg-grid, .tg-flow { grid-template-columns: 1fr; }
  .tg-transfer { grid-template-columns: 1fr; }
  .tg-transfer span { transform: rotate(90deg); justify-self: center; }
}

@media (max-width: 560px) {
  .tg-nav { align-items: flex-start; flex-direction: column; }
  .tg-quick { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}
