/* ==========================================================================
   Aomori Trip 4N5D Web App - Mobile-First Responsive Design System
   Optimized for iPhone, Android & Desktop
   ========================================================================== */

:root {
  --bg-body: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #059669;
  --accent-light: #ecfdf5;
  --accent-border: #a7f3d0;

  --gold: #d97706;
  --gold-light: #fefce8;
  --gold-border: #fef08a;

  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 2px 4px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   Header & Mobile Scrollable Nav
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary-dark);
}
.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-border);
}

/* Mobile Scrollable Menu Bar */
.nav-scroll-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px 0;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}
.nav-scroll-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.nav-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-pill:active, .nav-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-xs);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

/* ==========================================================================
   Hero Section (Compact for Mobile)
   ========================================================================== */
.hero-section {
  padding: 24px 0 20px 0;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
  border: 1px solid var(--primary-border);
}
.hero-title {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0c192c;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.hero-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Compact Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}
.stat-box-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.stat-box-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1px 0;
}
.stat-box-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

/* ==========================================================================
   Section Common
   ========================================================================== */
section {
  padding: 32px 0;
}
.section-head {
  margin-bottom: 16px;
}
.section-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0c192c;
  letter-spacing: -0.01em;
}
.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   3 Routes Comparison (Mobile Segment Control)
   ========================================================================== */
.routes-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tab-bar {
  display: flex;
  overflow-x: auto;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  flex: 1;
  min-width: 110px;
  padding: 12px 10px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}
.badge-crown { background: #fef08a; color: #854d0e; }
.badge-star { background: #dcfce7; color: #166534; }
.badge-cross { background: #fee2e2; color: #991b1b; }

.route-content {
  padding: 16px;
}
.route-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.route-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0c192c;
}
.route-score {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  align-self: flex-start;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.spec-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.spec-item-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-subtle);
}
.spec-item-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 1px;
}

.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.pro-card, .con-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.pro-card {
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  color: #065f46;
}
.con-card {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: #991b1b;
}
.pro-con-title {
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pro-con-list {
  padding-left: 16px;
}

/* ==========================================================================
   Ferry Alert Box
   ========================================================================== */
.ferry-alert-card {
  background: var(--gold-light);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.ferry-alert-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ferry-alert-text {
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.ferry-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.ferry-table th, .ferry-table td {
  padding: 8px 10px;
  border: 1px solid #fde68a;
  text-align: left;
}
.ferry-table th {
  background: #fef08a;
  font-weight: 800;
  color: #78350f;
}

/* ==========================================================================
   S-Rank Spots Grid (Mobile Touch Targets)
   ========================================================================== */
.spots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.spot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.spot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.spot-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0c192c;
}
.spot-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.spot-tag-s { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.spot-tag-food { background: var(--gold-light); color: var(--gold); border: 1px solid var(--gold-border); }
.spot-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.spot-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.spot-tips {
  background: var(--bg-subtle);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: var(--text-main);
  margin-bottom: 12px;
}
.spot-actions {
  display: flex;
  gap: 8px;
}
.btn-action-sm {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
}
.btn-action-sm:active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* ==========================================================================
   Day-by-Day Timeline (Mobile Optimized)
   ========================================================================== */
.day-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.day-head {
  background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.day-head-title {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.day-head-stats {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.day-content {
  padding: 14px;
}
.timeline-events {
  list-style: none;
  position: relative;
  padding-left: 20px;
}
.timeline-events::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}
.event-row {
  position: relative;
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.event-row:last-child {
  margin-bottom: 0;
}
.event-row::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px var(--primary-light);
}
.event-time {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  color: var(--primary);
  margin-right: 6px;
}
.stay-banner {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

/* Full-width Map Navigation Button for Mobile */
.btn-day-map {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
}
.btn-day-map:active {
  background: #dbeafe;
  transform: scale(0.99);
}

/* ==========================================================================
   Budget & Checklist
   ========================================================================== */
.checklist-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  box-shadow: var(--shadow-xs);
}
.check-row {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.check-row:last-child {
  border-bottom: none;
}
.check-input {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  margin-top: 1px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.check-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}
.check-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.progress-wrap {
  margin-bottom: 12px;
}
.progress-bar-bg {
  background: #e2e8f0;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 30px 0;
  font-size: 0.8rem;
  margin-top: 40px;
}
.footer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

/* Desktop Breakpoints */
@media (min-width: 768px) {
  .hero-section { padding: 40px 0 30px 0; }
  .hero-title { font-size: 2.1rem; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .pros-cons-grid { grid-template-columns: 1fr 1fr; }
  .spots-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .footer-wrap { flex-direction: row; justify-content: space-between; }
}

@media print {
  .site-header, .btn-primary, .tab-bar, .site-footer, .nav-scroll-bar { display: none !important; }
  body { background: #fff; font-size: 8.5pt; padding: 0; }
  .container { max-width: 100%; padding: 0; }
  .day-block { break-inside: avoid; }
}
