/* ═══════════════════════════════════════
   EKI-HAKU (駅泊) — Stylesheet
   Japan editorial minimalism
   ═══════════════════════════════════════ */

:root {
    --bg:       #faf8f4;
    --bg-alt:   #f5f0e8;
    --surface:  #ffffff;
    --text:     #1c1917;
    --text-2:   #57534e;
    --text-3:   #78716c;
    --text-4:   #a8a29e;
    --border:   #e7e5e4;
    --accent:   #b91c1c;
    --accent-bg:#fef2f2;
    --green:    #166534;
    --green-bg: #dcfce7;
    --amber:    #d97706;
    --amber-bg: #fef3c7;
    --mono:     'JetBrains Mono', monospace;
    --serif:    'Noto Serif JP', serif;
    --sans:     'Plus Jakarta Sans', -apple-system, 'Hiragino Sans', sans-serif;
    --radius:   10px;
    --max-w:    740px;
}

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

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Header ──────────────────────────── */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-kanji {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
}

.logo-latin {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-4);
    font-weight: 600;
}

.header-search {
    flex: 1;
    position: relative;
    max-width: 320px;
}

.header-search input {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color .2s;
}

.header-search input:focus {
    border-color: var(--accent);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    margin-top: 4px;
    overflow: hidden;
    z-index: 200;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg); text-decoration: none; }
.search-meta { font-size: 12px; color: var(--text-4); }
.search-empty { padding: 14px; text-align: center; color: var(--text-4); font-size: 13px; }

.lang-switch {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-3);
    text-decoration: none;
    transition: all .15s;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Hero ─────────────────────────────── */

.hero {
    padding: 48px 0 40px;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.hero-title .accent { color: var(--accent); }

.hero-sub {
    font-size: 15px;
    color: var(--text-2);
    margin-top: 12px;
    max-width: 500px;
    line-height: 1.55;
}

.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stat-num {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 600;
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── Sections ─────────────────────────── */

.section { padding: 36px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ── Station Cards ────────────────────── */

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

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

.station-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.station-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    text-decoration: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-kanji {
    font-family: var(--serif);
    font-size: 22px;
}

.card-price {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.card-price small { font-size: 11px; color: var(--text-4); font-weight: 400; }

.card-name {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 2px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-4);
    margin-top: 8px;
}

/* ── Prefecture Grid ──────────────────── */

.pref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.pref-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s;
    background: var(--bg);
}
.pref-card:hover { border-color: var(--accent); text-decoration: none; }
.pref-name-ja { font-family: var(--serif); font-size: 16px; }
.pref-name-en { font-size: 12px; color: var(--text-3); }
.pref-count { font-family: var(--mono); font-size: 12px; color: var(--text-4); margin-top: 4px; }

/* ── Station Detail ───────────────────── */

.breadcrumb {
    padding: 10px 0;
    font-size: 13px;
    color: var(--text-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.breadcrumb a { color: var(--text-3); }

.station-page { padding: 28px 0 48px; }

.station-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.station-kanji {
    font-family: var(--serif);
    font-size: clamp(36px, 6vw, 48px);
    font-weight: 400;
    line-height: 1.1;
}

.station-en {
    font-size: 15px;
    color: var(--text-3);
    margin-top: 4px;
    font-weight: 300;
}

.station-price-badge {
    text-align: right;
    flex-shrink: 0;
}
.price-from { font-size: 12px; color: var(--text-4); display: block; }
.price-val { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.price-unit { font-size: 12px; color: var(--text-4); }

.stats-bar {
    display: flex;
    gap: 24px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item .stat-num { font-size: 18px; }

.station-desc {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.65;
    max-width: 600px;
    margin-bottom: 20px;
}

/* Line tags */
.line-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.line-tag {
    display: inline-flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: #1c1917;
    color: #fff;
    letter-spacing: 0.01em;
    min-height: 38px;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.line-tag small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    margin-top: 1px;
    letter-spacing: 0;
}

/* ── SHŪDEN PANEL ─────────────────────── */

.shuden-panel {
    background: var(--text);
    border-radius: 14px;
    padding: 24px;
    color: #fff;
    margin-bottom: 28px;
}

.shuden-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.shuden-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 4px;
}

.shuden-title {
    font-size: 17px;
    font-weight: 500;
}

.shuden-clock {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 300;
    color: #e7e5e4;
}

.shuden-list { display: flex; flex-direction: column; gap: 6px; }

.shuden-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    transition: opacity .3s;
}
.shuden-row.departed { opacity: .4; }

.shuden-time {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
    min-width: 52px;
}
.departed .shuden-time { text-decoration: line-through; color: #78716c; }

.shuden-info { flex: 1; }
.shuden-line { font-size: 13px; font-weight: 500; display: block; }
.shuden-dest { font-size: 11px; color: #a8a29e; }

.shuden-status {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
    letter-spacing: .02em;
}
.shuden-status.ok     { background: var(--green); color: var(--green-bg); }
.shuden-status.soon   { background: var(--amber); color: #fff; }
.shuden-status.urgent { background: var(--accent); color: #fff; }
.shuden-status.gone   { background: #7f1d1d; color: #fecaca; }

.shuden-tip {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(185,28,28,.12);
    border: 1px solid rgba(185,28,28,.25);
    font-size: 12px;
    color: #fca5a5;
    line-height: 1.5;
}

/* ── Stay22 Widget ────────────────────── */

.stay-section { margin-bottom: 28px; }

.stay22-widget {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.stay22-widget iframe { display: block; }

.price-summary {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-3);
    flex-wrap: wrap;
}
.price-summary strong { color: var(--text); font-family: var(--mono); }

/* ── Attractions ──────────────────────── */

.attraction-list { margin-bottom: 24px; }

.attraction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.attraction-name { font-weight: 500; }
.attraction-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin-left: 8px;
}
.attraction-dist { font-size: 12px; color: var(--text-4); flex-shrink: 0; }

/* ── Weather ──────────────────────────── */

.weather-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 24px;
}

.weather-month {
    text-align: center;
    padding: 8px 2px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 11px;
}
.weather-month.sakura { background: #fce7f3; border-color: #f9a8d4; }
.weather-month.kouyou { background: #fef3c7; border-color: #fbbf24; }
.month-name { display: block; font-weight: 500; color: var(--text-3); font-size: 10px; }
.month-temp { display: block; font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--text); }
.month-low { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-4); }
.month-icon { display: block; font-size: 14px; margin-top: 2px; }

/* ── Photos ───────────────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.photo-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.photo-item figcaption { font-size: 10px; color: var(--text-4); padding: 6px 8px; }

.photo-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
}
.photo-btn img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.photo-btn:hover img { transform: scale(1.04); }

.photo-zoom-icon {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.photo-btn:hover .photo-zoom-icon { opacity: 1; }

/* ── Lightbox ─────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Closed state: invisible and non-interactive */
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.lightbox--closed {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Open = no lightbox--closed class */
.lightbox:not(.lightbox--closed) {
    opacity: 1;
    pointer-events: all;
}

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: zoom-out;
}

.lb-inner {
    position: relative;
    z-index: 2;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

#lb-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lb-caption {
    color: rgba(255,255,255,.6);
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    max-width: 600px;
    line-height: 1.4;
}

.lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.lb-close:hover { background: rgba(255,255,255,.35); }

.lb-prev, .lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 36px;
    width: 48px;
    height: 72px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    line-height: 1;
}
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

@media (max-width: 640px) {
    .lb-prev { left: 4px; }
    .lb-next { right: 4px; }
}

/* ── Nearby Stations ──────────────────── */

.nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.nearby-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s;
}
.nearby-card:hover { border-color: var(--accent); text-decoration: none; }
.nearby-name { font-weight: 500; font-size: 14px; }
.nearby-meta { font-size: 12px; color: var(--text-4); margin-top: 2px; }
.nearby-price { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-top: 4px; }

/* ── Area Info (SEO) ──────────────────── */

.area-info {
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.6;
    margin-top: 24px;
}

/* ── Sort Bar ─────────────────────────── */

.sort-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-3);
    text-decoration: none;
    transition: all .15s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.sort-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Prefecture Header ────────────────── */

.pref-header { padding: 28px 0 20px; }
.pref-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pref-title-ja { font-family: var(--serif); font-size: 36px; font-weight: 400; }
.pref-title-en { font-size: 18px; color: var(--text-3); font-weight: 300; }
.pref-sub { font-size: 14px; color: var(--text-3); margin-top: 4px; }

/* ── Shūden Promo ─────────────────────── */

.shuden-promo {
    text-align: center;
    padding: 40px 20px;
}
.promo-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
}
.promo-title { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.promo-text { font-size: 15px; color: var(--text-2); max-width: 460px; margin: 0 auto; line-height: 1.55; }

/* ── Footer ───────────────────────────── */

.site-footer {
    padding: 36px 0 24px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-brand { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.footer-tagline { font-size: 13px; color: var(--text-3); }
.site-footer h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-3); }
.site-footer a { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }

.footer-legal {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    font-size: 11px;
    color: var(--text-4);
    line-height: 1.6;
}
.footer-legal p { margin-bottom: 4px; }

/* ── Empty State ──────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-4); }

/* ── Responsive ───────────────────────── */

@media (max-width: 640px) {
    .header-search { max-width: none; }
    .hero-stats { gap: 16px; }
    .stats-bar { gap: 14px; }
    .footer-grid { grid-template-columns: 1fr; gap: 16px; }
    .weather-grid { grid-template-columns: repeat(6, 1fr); }
    .station-grid { grid-template-columns: 1fr; }
    .pref-grid { grid-template-columns: repeat(3, 1fr); }
    .shuden-panel { padding: 16px; }
}
