Files
Bkk1234 14e7ec524f navbar: finish pixel parity with the Next header
- .mu-brand-title 1rem (was 1.05rem in index.html + responsive.css)
- .mu-logo-img radius var(--radius) (8px) and brand gap 8px like Next
- .mu-nav a colour var(--c-info) (Next uses --c-info, mock had --c-ink-2)
- measured at 1600px: credits 1083-1132, CTA 1150-1279, tools 1297-1405 —
  identical to web-at-transit; nav/CTA/tools positions now match exactly
- VERSION 2026.09.27.126
2026-11-04 02:08:13 +07:00

287 lines
15 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ============================================================
Atroute — Mobile-first responsive layer
------------------------------------------------------------
base = มือถือ (จอเล็กสุด iPhone 8 = 375px, รองรับ SE 320px)
ขยายขึ้นด้วย min-width:
≥480px มือถือใหญ่
≥640px มือถือใหญ่ / แท็บเล็ตเล็ก
≥768px iPad แนวตั้ง / แท็บเล็ต
≥1024px iPad แนวนอน / แล็ปท็อป
≥1280px คอม 19.5"–24"
≥1600px คอม 27" / 1440p+
หมายเหตุ: component ที่ router inject จาก partial (อยู่ใน #view)
ต้องใช้ prefix `#view` — เพราะ <style> ของ partial ถูก inject
ทีหลัง จึงต้องชนะด้วย specificity (ID > class)
============================================================ */
/* ---------- base: มือถือ ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-size: 16px; }
/* --- ขยายขนาด component บนมือถือ (desktop-oriented เดิมเล็กเกิน) --- */
/* topbar อยู่ใน section ด้านล่าง — content ใน #view ใช้ prefix ชนะ partial style */
#view .mu-btn { font-size: .95rem; min-height: 48px; }
#view .mu-badge { font-size: 1.05rem; }
#view .mu-zone-tag { font-size: 1rem; }
#view .mu-zone-desc, #view .mu-zone-sub { font-size: 1.05rem; }
#view .mu-route-name { font-size: 1.2rem; }
#view .mu-next-trip { font-size: .95rem; }
#view .mu-meta-pill { font-size: .95rem; }
#view .mu-route-type-badge { font-size: .85rem; }
#view .mu-stop-summary-meta { font-size: .85rem; }
#view .mu-time-chip { font-size: .95rem; min-height: 40px; }
#view .mu-info-card .label { font-size: .85rem; }
#view .mu-info-card .value { font-size: 1.1rem; }
#view .mu-stat p { font-size: .9rem; }
#view .mu-hero-lead { font-size: 1rem; }
#view .mu-select-box select { font-size: 1rem; }
/* --- กัน overflow พื้นฐาน (padding/รูป/grid/ข้อความยาว ไม่ให้ล้นจอมือถือ) --- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video { max-width: 100%; height: auto; }
/* grid/flex child ต้อง shrink ได้ (กัน min-width:auto ล้น container) */
#view .mu-hero-panel > *,
#view .mu-layout-grid > *,
#view .mu-hero-metric-grid > *,
#view .mu-stop-summary-main { min-width: 0; }
/* ข้อความยาวไม่ break (เช่น mock state query string / ชื่อยาว) */
#view .mu-inline-context strong,
#view .mu-stop-hero-title,
#view .mu-stop-hero-sub { overflow-wrap: anywhere; }
.mu-container { padding: 0 16px; }
main.mu-container { padding-top: 24px; padding-bottom: 24px; }
/* --- topbar: hamburger menu บนมือถือ (brand + lang + ☰ บรรทัดเดียว) --- */
.mu-topbar-inner { gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.mu-logo-img { width: 36px; height: 36px; }
.mu-brand { gap: 8px; flex-shrink: 0; }
.mu-brand-title { font-size: 1rem; white-space: nowrap; }
.mu-brand-subtitle { display: none; } /* กันล้น — โผล่กลับ ≥768px */
.mu-nav { display: none; } /* ซ่อน nav — ใช้ hamburger แทน */
.mu-lang-switch { order: 3; margin-left: auto; padding: 2px; }
.mu-lang-btn { font-size: .8rem; padding: 8px 12px; min-height: 40px; min-width: 40px; } /* tap target */
.mu-action-btn { display: none; } /* กันล้นบนจอเล็ก — โผล่กลับ ≥1024px */
/* hamburger menu (ขวาสุด) */
.mu-menu { display: block; position: relative; order: 4; margin-left: 2px; }
.mu-menu-btn {
display: flex; align-items: center; justify-content: center;
width: 44px; height: 44px;
border: none; background: transparent; cursor: pointer;
color: var(--c-ink); list-style: none;
border-radius: 10px;
}
.mu-menu-btn::-webkit-details-marker { display: none; }
.mu-menu-btn svg { width: 26px; height: 26px; }
.mu-menu-panel {
position: absolute; top: calc(100% + 8px); right: 0;
min-width: 220px;
background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
box-shadow: 0 12px 28px rgba(20, 40, 90, .16);
padding: 8px;
z-index: 60;
display: flex; flex-direction: column; gap: 2px;
}
.mu-menu-panel a {
display: flex; align-items: center;
min-height: 48px; padding: 10px 14px;
border-radius: 10px;
color: var(--c-ink); text-decoration: none;
font-size: 1.05rem; font-weight: 600;
}
.mu-menu-panel a:hover, .mu-menu-panel a:active { background: #f5efff; }
/* --- hero (หน้าแรก) — ช่องว่าง + ตัวหนังสือใหญ่ขึ้น --- */
.mu-hero { padding: 30px 0 34px; }
.mu-hero h1 { font-size: clamp(1.9rem, 8vw, 2.9rem); margin-bottom: 14px; line-height: 1.28; }
.mu-badge { margin-bottom: 10px; padding: 5px 14px; }
.mu-hero-lead { margin: 0 0 8px; }
.mu-hero-actions { flex-direction: column; align-items: stretch; padding: 0 6px; margin-top: 10px; gap: 8px; }
.mu-pill-link { justify-content: center; padding: 11px 18px; font-size: .9rem; }
/* --- ตัวเลือกจังหวัด/สถานี (หน้าแรก) --- */
#view .mu-route-selector { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; }
#view .mu-route-selector select,
#view .mu-route-selector .mu-select-arrow { width: 100%; }
/* flex-basis 250px (จาก index.html) กลายเป็นความสูงตอน column — reset เป็น content height */
#view .mu-route-selector .mu-select-field { width: 100%; flex: 0 0 auto; }
#view .mu-select-arrow { transform: rotate(90deg); justify-content: center; }
/* --- marquee (สปอนเซอร์) — การ์ดเล็กลงบนมือถือ --- */
.mu-marquee-track { padding: 2px 0 10px; }
.mu-marquee-tile { width: 132px; height: 68px; margin-right: 10px; border-radius: 10px; }
/* --- โซนเส้นทาง + การ์ด — ระยะห่างกระชับ --- */
main.mu-container { padding-top: 14px; padding-bottom: 14px; }
.mu-zone { margin-bottom: 20px; }
.mu-zone-head { margin-bottom: 10px; gap: 4px 10px; }
/* --- หัวโซน: ป้ายหัวข้อ + บรรทัดข้อมูล (มือถือ = เรียงลงมาเต็มความกว้าง) ---
ใช้ #view เพื่อชนะ <style> ของ partial ที่ inject ทีหลัง */
#view .mu-zone-head .mu-zone-desc { flex-basis: 100%; min-width: 0; line-height: 1.65; }
#view .mu-zone-meta { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
#view .mu-zone-seg { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
#view .mu-zone-seg:not(:last-child)::after { content: "\00b7"; color: #c4bcd8; margin-left: 8px; } /* คั่นท้ายชิ้น → ตัดบรรทัดแล้วจุดไม่ไปอยู่ต้นบรรทัด */
#view .mu-zone-seg .ic { align-self: center; flex: none; }
#view .mu-zone-now b { color: var(--c-ink); font-variant-numeric: tabular-nums; }
#view .mu-zone-at { color: var(--c-ink-3); } /* ชื่อสถานีในวงเล็บ — จางกว่ารอบรถ */
#view .mu-zone-updated { color: #8a7aa8; font-size: .95rem; }
.mu-grid { gap: 12px; }
.mu-route-info { padding: 16px 16px 18px; }
.mu-route-name { margin-bottom: 6px; }
.mu-route-chip-wrap { gap: 6px; }
.mu-next-trip { padding: 3px 10px; font-size: .74rem; }
/* --- busStop --- */
#view .mu-hero-panel { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
#view .mu-hero-title { font-size: 1.35rem; }
#view .mu-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-toolbar { flex-direction: column; align-items: stretch; }
#view .mu-toolbar select,
#view .mu-toolbar .mu-btn { width: 100%; min-height: 44px; }
#view .mu-search-field { width: 100%; min-width: 0; }
#view .mu-search-field input { min-height: 44px; }
#view .mu-stop-grid { grid-template-columns: 1fr; gap: 12px; }
#view .mu-hero-map { min-height: 200px; }
/* --- busDetail / expanded --- */
#view .mu-layout-grid { grid-template-columns: 1fr; gap: 12px; }
#view .mu-page-title { font-size: 1.45rem; }
#view .mu-route-hero { padding: 16px; }
#view .mu-info-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-panel,
#view .mu-card-panel { padding: 14px; }
#view .mu-photo-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-quickpick { display: flex; flex-wrap: wrap; gap: 8px; }
#view .mu-inline-actions { flex-wrap: wrap; }
#view .mu-back-btn { width: 100%; justify-content: center; padding: 10px; min-height: 44px; }
#view .mu-schedule-note { font-size: .82rem; }
/* --- stopDetail --- */
#view .mu-hero-metric-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-live-clock-card { padding: 14px; }
#view .mu-stop-summary-rail { flex-wrap: wrap; }
#view .mu-time-chip { min-width: 0; }
#view .mu-contact-row { flex-wrap: wrap; }
/* --- credits --- */
#view .mu-credit-wrap { padding: 24px 16px 40px; }
#view .mu-credit-hero h1 { font-size: 1.5rem; }
#view .mu-credit-section { padding: 16px; }
/* --- footer --- */
.mu-site-footer { margin-top: 24px; padding: 28px 0 0; }
.mu-site-footer .mu-container { padding: 0 16px; }
.mu-footer-grid { grid-template-columns: 1fr; gap: 16px; }
.mu-footer-col ul a { padding: 5px 0; min-height: 34px; } /* tap target (กดได้ ≥34px) */
.mu-footer-contact a { min-height: 34px; } /* tap target */
.mu-sponsor-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* ============================================================
≥480px — มือถือใหญ่
============================================================ */
@media (min-width: 480px) {
.mu-topbar-inner { padding: 12px 18px; }
.mu-hero-actions { flex-direction: row; justify-content: center; }
.mu-pill-link { width: auto; }
#view .mu-stop-grid { grid-template-columns: repeat(2, 1fr); }
#view .mu-photo-strip { grid-template-columns: repeat(3, 1fr); }
.mu-sponsor-strip { grid-template-columns: repeat(3, 1fr); }
}
/* ============================================================
≥640px — มือถือใหญ่ / แท็บเล็ตเล็ก
============================================================ */
@media (min-width: 640px) {
body { font-size: 16px; }
.mu-container { padding: 0 28px; }
.mu-brand-title { font-size: 1rem; }
.mu-topbar-inner { gap: 18px; padding: 14px 28px; flex-wrap: nowrap; }
.mu-logo-img { width: 44px; height: 44px; }
.mu-nav { order: 0; width: auto; margin-left: auto; justify-content: flex-start; gap: 24px; display: flex; }
.mu-nav a { font-size: .95rem; }
.mu-menu { display: none; }
.mu-hero { padding: 44px 0 52px; }
.mu-hero-actions { margin-top: 14px; }
.mu-marquee-tile { width: 170px; height: 96px; margin-right: 16px; }
#view .mu-route-selector { flex-direction: row; align-items: flex-end; justify-content: center; }
#view .mu-route-selector select,
#view .mu-route-selector .mu-select-field { width: auto; }
#view .mu-select-arrow { transform: none; }
#view .mu-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
#view .mu-toolbar select,
#view .mu-toolbar .mu-btn { width: auto; }
#view .mu-search-field { flex: 1; min-width: 200px; }
#view .mu-back-btn { width: auto; }
.mu-footer-grid { grid-template-columns: 1fr 1fr; }
}
/* ============================================================
≥768px — iPad แนวตั้ง / แท็บเล็ต
============================================================ */
@media (min-width: 768px) {
.mu-brand-subtitle { display: block; font-size: .72rem; }
#view .mu-kpi-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-info-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-hero-metric-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-photo-strip { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#view .mu-hero-panel { grid-template-columns: 1.1fr .9fr; padding: 18px; }
.mu-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.1fr; }
.mu-sponsor-strip { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
/* หัวโซนบนจอใหญ่: ป้ายหัวข้ออยู่ซ้าย · บรรทัดข้อมูลเป็นคอลัมน์ขวา
(อ่านง่ายกว่าเดิมที่ข้อความยืดเต็มความกว้างจอ ~1144px) */
#view .mu-zone-head { display: grid; grid-template-columns: auto minmax(0, 1fr);
align-items: start; column-gap: 14px; row-gap: 5px; }
#view .mu-zone-head .mu-zone-desc { grid-column: 2; max-width: 82ch; }
}
/* ============================================================
≥1024px — iPad แนวนอน / แล็ปท็อป
============================================================ */
@media (min-width: 1024px) {
.mu-hero { padding: 56px 0 64px; }
.mu-action-btn { display: inline-flex; }
.mu-hero h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
.mu-hero-actions { padding: 0; }
#view .mu-layout-grid { grid-template-columns: 1.35fr .9fr; gap: 16px; }
#view .mu-hero-title { font-size: 1.8rem; }
#view .mu-hero-map { min-height: auto; }
#view .mu-photo-strip { gap: 10px; }
}
/* ============================================================
≥1280px — คอม 19.5"–24"
============================================================ */
@media (min-width: 1280px) {
.mu-container { max-width: 1200px; }
#view .mu-stop-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
#view .mu-credit-wrap { padding: 40px 28px 56px; }
}
/* ============================================================
≥1600px — คอม 27" / 1440p+
============================================================ */
@media (min-width: 1600px) {
body { font-size: 17px; }
.mu-container { max-width: 1280px; }
#view .mu-photo-strip { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
#view .mu-stop-grid { grid-template-columns: repeat(4, 1fr); }
}
/* เวลาที่ "คำนวณจากต้นทาง" (ไม่ใช่ตารางจริงของผู้ประกอบการ) — ทำเครื่องหมายให้ผู้ใช้รู้ ไม่ให้เข้าใจผิด */
.mu-time-grid.is-est .mu-time-chip {
border: 1px dashed #a892d4;
background: var(--c-surface-2);
color: #6b5a8e;
font-style: italic;
}
.mu-est-note {
margin: 6px 0 0;
font-size: .78rem;
color: #6b5a8e;
}