/* ==========================================
   WAKEY 横浜市内ステーション案内 - Style
   ========================================== */

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

:root {
  --navy: #0a1a33;
  --navy-mid: #112244;
  --navy-light: #1a3366;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --blue-hover: #1d4ed8;
  --red: #ef4444;
  --red-hover: #dc2626;
  --accent: #60a5fa;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(10, 26, 51, 0.12);
  --shadow-lg: 0 8px 32px rgba(10, 26, 51, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-train-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.header-brand {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.header-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
}

.btn-blue:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.btn-red:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 0.9rem;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--navy-mid);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.mobile-nav.open {
  max-height: 200px;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #0d3a8c 100%);
  color: #fff;
  padding: 56px 20px 64px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-lead {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
}

/* ---- Main Layout ---- */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ---- Search Bar ---- */
.search-bar-wrapper {
  margin-bottom: 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  font-size: 1.1rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  padding: 14px 0;
  background: transparent;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: none;
}

.search-clear.visible {
  display: block;
}

.search-clear:hover {
  background: var(--bg);
  color: var(--text);
}

.search-results-count {
  margin-top: 8px;
  padding: 0 8px;
  font-size: 0.82rem;
  color: var(--text-mid);
  min-height: 20px;
}

/* ---- Content Layout ---- */
.content-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.sidebar-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}

.sidebar-icon {
  font-size: 1rem;
}

.line-list {
  list-style: none;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.line-list li {
  border-bottom: 1px solid var(--border);
}

.line-list li:last-child {
  border-bottom: none;
}

.line-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.line-btn:hover {
  background: var(--bg);
  color: var(--blue);
}

.line-btn.active {
  background: #eff6ff;
  color: var(--blue);
  font-weight: 700;
  border-left: 3px solid var(--blue);
}

.line-btn .line-count {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-mid);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.line-btn.active .line-count {
  background: var(--blue);
  color: #fff;
}

/* ---- Station Grid ---- */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.station-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.station-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-light);
}

.station-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.station-card-name-suffix {
  font-size: 0.75rem;
  color: var(--text-mid);
  font-weight: 400;
}

.station-card-catchcopy {
  font-size: 0.73rem;
  color: var(--text-mid);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.station-card-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.line-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Line tag colors */
.line-tag-jr {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.line-tag-tokyu {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.line-tag-keikyu {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.line-tag-sotetsu {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.line-tag-minatomirai {
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #a5f3fc;
}

.line-tag-subway-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.line-tag-subway-green {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.line-tag-seaside {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.line-tag-other {
  background: var(--bg);
  color: var(--text-mid);
  border: 1px solid var(--border);
}

/* No results */
.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mid);
}

.no-results-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.no-results p {
  font-size: 1rem;
  font-weight: 600;
}

.no-results-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 400;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 51, 0.65);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s;
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  z-index: 1;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.modal-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 28px 28px 24px;
}

.modal-station-name-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.modal-station-name {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.2;
}

.modal-station-suffix {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.modal-catchcopy {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

.modal-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-line-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.modal-overview {
  padding: 24px 28px;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.modal-details {
  padding: 20px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-label-icon {
  font-size: 0.9rem;
}

.detail-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.65;
}

.modal-footer {
  padding: 16px 28px 24px;
  text-align: center;
}

.modal-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 500px) {
  .modal-action-buttons {
    flex-direction: row;
    gap: 12px;
  }
}

.btn-modal-timetable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s;
  width: 100%;
}

.btn-modal-timetable:hover {
  background: rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-modal-inquiry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  width: 100%;
}

.btn-modal-inquiry:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

@media (min-width: 500px) {

  .btn-modal-timetable,
  .btn-modal-inquiry {
    width: auto;
  }
}

/* ---- Footer ---- */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 20px;
  text-align: center;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer-brand {
  color: #fff;
  font-weight: 700;
}

.footer-note {
  font-size: 0.78rem;
  margin-bottom: 14px;
  line-height: 1.7;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .line-list {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .line-list li {
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .header-buttons {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: block;
  }

  .station-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 10px;
  }

  .modal-details {
    grid-template-columns: 1fr;
  }

  .modal-header {
    padding: 24px 20px 20px;
  }

  .modal-overview {
    padding: 20px;
  }

  .modal-details {
    padding: 16px 20px;
  }

  .modal-footer {
    padding: 14px 20px 20px;
  }

  .modal-station-name {
    font-size: 1.5rem;
  }
}

@media (max-width: 400px) {
  .station-grid {
    grid-template-columns: 1fr 1fr;
  }
}