/* =====================================================================
   VIETNAM BEER TRAIL — styles.css
   Design language: colonial-era beer-label typography meets a Hanoi
   bia hơi street corner after dark. Deep jade night sky, lager-gold
   and lacquer-red accents, bottle-cap badges instead of stamps.
   ===================================================================== */

:root {
  --bg:        #020309;
  --bg-panel:  #14091a;
  --bg-panel2: #190c20;
  --cream:     #f3e8f5;
  --ink:       #170a1e;
  --gold:      #ff2fd0;
  --gold-lt:   #ff8fe0;
  --red:       #b23a9c;
  --line:      rgba(255,143,224,0.16);

  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', 'Noto Sans JP', system-ui, sans-serif;
  --font-mono: 'Rajdhani', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-lt); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- fixed background layer: gate-of-loborca.png, blended low-opacity ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 65% 50% at 50% 12%, rgba(2,3,9,0.1) 0%, rgba(2,3,9,0.92) 70%),
    linear-gradient(180deg, rgba(2,3,9,0.97) 0%, rgba(2,3,9,0.35) 22%, rgba(2,3,9,0.35) 70%, rgba(2,3,9,0.98) 100%),
    url('../../img/gate-of-loborca.png');
  background-size: cover, cover, cover;
  background-position: center, center, center 18%;
  background-repeat: no-repeat, no-repeat, no-repeat;
  filter: saturate(1.05) brightness(0.9);
}

/* ---------- top-left nav: GATEWAY / TMI ARCHIVE ---------- */
.site-nav {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--cream);
  opacity: 0.75;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 47, 208, 0.22);
  background: rgba(20, 9, 26, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.site-nav-link:hover {
  color: #ff2fd0;
  opacity: 1;
  border-color: rgba(255, 47, 208, 0.5);
  background: rgba(255, 47, 208, 0.08);
  box-shadow: 0 0 20px -6px rgba(255, 47, 208, 0.6);
}
.site-nav-link .arrow-back {
  transition: transform 0.25s cubic-bezier(.16,.8,.24,1);
}
.site-nav-link:hover .arrow-back {
  transform: translateX(-3px);
}
@media (max-width: 640px) {
  .site-nav { top: 12px; left: 12px; }
  .site-nav-link { font-size: 0.56rem; padding: 7px 12px; }
}

/* ---------- route divider ---------- */
.route-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  width: min(1100px, 92%);
  color: var(--cream);
  opacity: 0.55;
}
.route-line::before, .route-line::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 2px dotted var(--gold);
  opacity: 0.5;
}
.route-line .dot { font-size: 16px; letter-spacing: 6px; }

/* ---------- hero ---------- */
header.hero {
  padding: 60px 5vw 34px;
  text-align: center;
  position: relative;
  z-index: 1; /* 疑似要素を後ろに敷くための起点 */
}

/* 💡 新設：文字の読みやすさを邪魔せず、画像だけを20%の薄さで裏に敷く設定 */
header.hero::before {
  content: '';
  position: absolute;
  inset: 0; /* ヘッダー全体に広げる */
  z-index: -1; /* 文字の後ろに配置 */
  
  /* 画像の読み込み（※index.htmlから見た画像へのパス） */
  background-image: url('img/vietnam-traditional.png'); 
  background-size: contain; /* 画像が切れないように綺麗に収める（全体に広げたい場合は cover or contain にしてください） */
  background-position: left;
  background-repeat: no-repeat;
  
  /* 💡 ここで透過度（薄さ）を自由に調整できます（0.1〜0.25が文字が読めておすすめです） */
  opacity: 0.18; 
}

.hero-eyebrow {
  font-family: var(--font-mono);
  letter-spacing: 0.35em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold-lt);
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 7.5vw, 78px);
  line-height: 1;
  margin: 0;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.hero h1 .highlight { color: var(--gold); }

.hero p.sub {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.85;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 30px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  opacity: 0.9;
}
.hero-stats span b {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-lt);
}

/* ---------- controls ---------- */
.controls {
  width: min(1100px, 92%);
  margin: 34px auto 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.ticket-search { flex: 1; min-width: 240px; position: relative; }
.ticket-search input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border: 2px solid var(--gold);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cream);
  border-radius: 3px;
}
.ticket-search input::placeholder { color: var(--cream); opacity: 0.45; }
.ticket-search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: var(--cream); opacity: 0.6;
}

/* ---------- legend ---------- */
.legend {
  width: min(1100px, 92%);
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.legend-item { display: flex; align-items: center; gap: 7px; opacity: 0.9; }
.legend-swatch { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* ---------- layout ---------- */
main.layout {
  width: min(1200px, 94vw);
  margin: 30px auto 80px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 26px;
  align-items: start;
}
@media (max-width: 880px) { main.layout { grid-template-columns: 1fr; } }

.map-panel {
  background: var(--bg-panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}
.map-panel h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  margin: 0 0 4px;
  color: var(--cream);
}
.map-panel .map-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream);
  opacity: 0.55;
  margin: 0 0 12px;
}

#viet-map {
  width: 100%;
  height: 520px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0c1a15;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip { background: var(--bg-panel2); color: var(--cream); }
.leaflet-popup-content { font-family: var(--font-body); font-size: 13px; margin: 12px 14px; }
.leaflet-popup-content b { color: var(--gold-lt); font-family: var(--font-display); font-weight: 400; }
.leaflet-container a.leaflet-popup-close-button { color: var(--cream); }

/* ---------- postcard / detail panel ---------- */
.postcard {
  background: var(--bg-panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  position: sticky;
  top: 20px;
  min-height: 460px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}
.postcard.is-empty {
  align-items: center; justify-content: center; text-align: center;
  color: var(--cream); opacity: 0.6;
  font-family: var(--font-mono); font-size: 13px; line-height: 2;
}
.postcard.is-empty .empty-icon { margin-bottom: 14px; opacity: 0.7; }

.postcard-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px dashed var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.postcard-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-lt);
  margin: 0 0 6px;
}
.postcard-top h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  margin: 0;
  line-height: 1.15;
  color: var(--cream);
}

/* bottle-cap badge (signature element) */
.bottlecap {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  position: relative;
}
.bottlecap svg { width: 100%; height: 100%; }
.bottlecap span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
}

.company-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--cream);
  opacity: 0.7;
  margin: 0 0 16px;
  line-height: 1.7;
}
.company-name b { color: var(--gold-lt); opacity: 1; }

.brew-desc {
  font-size: 15px;
  line-height: 1.9;
  color: var(--cream);
  opacity: 0.92;
  margin: 0;
}

.postcard-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 14px;
  border: 2px solid var(--gold);
  border-radius: 20px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.pill-btn:hover { background: var(--gold); color: var(--ink); }

/* ---------- brewery list ---------- */
.state-list-wrap { width: min(1200px, 94vw); margin: 0 auto 60px; }
.state-list-wrap h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 14px;
  color: var(--cream);
}
.state-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.state-list button {
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  background: var(--bg-panel);
  border-radius: 5px;
  cursor: pointer;
  color: var(--cream);
}
.state-list button b {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.state-list button:hover,
.state-list button.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.state-list button:hover b,
.state-list button.is-active b { color: var(--red); }
.state-list button[hidden] { display: none; }

/* ---------- footer ---------- */
footer {
  padding: 30px 5vw 60px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream);
  opacity: 0.55;
}
footer p { max-width: 580px; margin: 14px auto 0; line-height: 1.8; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
