/* ============================================================
   Siam Companion · เที่ยวกรุงเทพ — โทนนิตยสาร (ต่อยอดจาก mockups/a-magazine.html)
   ============================================================ */
:root {
  --paper: #FAF6EF; --paper2: #F2EADC; --paper3: #E9DFCC;
  --ink: #2A241E; --ink2: #6B6157; --line: #DCD2C1;
  --accent: #B4543A; --gold: #A98B4F; --green: #4A6B57;
  --serif: 'Noto Serif Thai', Georgia, 'Angsana New', serif;
  --sans: 'Noto Sans Thai', system-ui, 'Leelawadee UI', sans-serif;
  --mast-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--mast-h) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-weight: 300; font-size: 15px; line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--serif); margin: 0; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 44px 20px 0; }
.scene { width: 100%; height: 100%; display: block; }

/* ---- rules & headings ---- */
.rule { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink2); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule--tight { margin-bottom: 10px; }
.sec { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.sec__sub { max-width: 60ch; color: var(--ink2); margin-bottom: 26px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; font-family: var(--serif); font-size: 15px; letter-spacing: .04em; text-decoration: none; border: 1px solid var(--ink); transition: background .15s ease, color .15s ease, transform .15s ease; }
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--accent); border-color: var(--accent); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--paper2); }
.btn--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--paper-line { background: transparent; color: var(--paper); border-color: rgba(250, 246, 239, 0.5); }
.btn--paper-line:hover { border-color: var(--paper); }

/* ---- masthead ---- */
.mast { position: sticky; top: 0; z-index: 1100; background: rgba(250, 246, 239, 0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.mast__in { max-width: 1140px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--mast-h); }
.word { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: .18em; text-transform: uppercase; line-height: 1.1; white-space: nowrap; }
.word img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.word small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; color: var(--ink2); font-weight: 400; text-transform: none; margin-top: 2px; }
.mast__nav { display: none; gap: 22px; font-size: 13.5px; letter-spacing: .05em; color: var(--ink2); }
.mast__nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.mast__nav a:hover { border-color: var(--accent); color: var(--accent); }
.mast__cta { font-family: var(--serif); font-size: 13px; letter-spacing: .1em; border: 1px solid var(--ink); padding: 9px 16px; text-decoration: none; white-space: nowrap; }
.mast__cta:hover { background: var(--ink); color: var(--paper); }

/* ---- hero ---- */
.hero { position: relative; min-height: min(82vh, 640px); overflow: hidden; border-bottom: 1px solid var(--line); background: var(--ink); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 12, 8, 0.15) 0%, rgba(20, 12, 8, 0.5) 60%, rgba(20, 12, 8, 0.78) 100%); }
.hero__in { position: relative; min-height: inherit; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 80px; padding-bottom: 44px; color: #FFF9EF; }
.kicker { font-size: 12px; letter-spacing: .4em; text-transform: uppercase; opacity: .9; margin-bottom: 16px; }
.hero h1 { font-weight: 700; font-size: clamp(36px, 7vw, 80px); line-height: 1.08; margin: 0 0 14px; max-width: 22ch; white-space: pre-line; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3); }
.hero p { max-width: 52ch; font-size: 16px; opacity: .94; margin: 0 0 24px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 14px 0; border-top: 1px solid rgba(255, 249, 239, 0.35); padding-top: 14px; }
.hero__meta div { padding-right: 26px; margin-right: 26px; border-right: 1px solid rgba(255, 249, 239, 0.28); }
.hero__meta div:last-child { border: 0; margin: 0; padding: 0; }
.hero__meta b { display: block; font-family: var(--serif); font-size: 17px; }
.hero__meta span { font-size: 13px; opacity: .85; }

/* ---- intro ---- */
.intro__grid { display: grid; gap: 26px; }
.lead { font-family: var(--serif); font-size: 18px; line-height: 1.75; }
.pull { margin: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 22px; font-size: 13px; color: var(--ink2); }
.facts b { font-weight: 500; color: var(--ink); }

/* ---- plans ---- */
.plans { display: grid; gap: 20px; }
.plan { background: var(--paper2); border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.plan.is-on { box-shadow: 0 0 0 2px var(--accent); }
.plan__top { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper3); }
.plan__top img { width: 100%; height: 100%; object-fit: cover; }
.plan__badge { position: absolute; top: 14px; left: 14px; background: var(--paper); font-family: var(--serif); font-size: 13px; letter-spacing: .12em; padding: 6px 12px; border: 1px solid var(--ink); }
.plan__body { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan__name { font-size: 22px; font-weight: 700; }
.plan__short { color: var(--ink2); font-size: 14px; }
.plan__price { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.plan__price b { font-family: var(--serif); font-size: 30px; font-weight: 700; white-space: nowrap; }
.plan__price span { font-size: 12px; color: var(--ink2); }
.plan__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 12px; color: var(--ink2); }
.plan__stats b { display: block; font-weight: 500; color: var(--ink); font-size: 14px; }
.plan__hl { display: flex; flex-wrap: wrap; gap: 6px; }
.plan__hl span { font-size: 12px; border: 1px solid var(--line); padding: 3px 10px; background: var(--paper); }
.plan__pick { margin-top: auto; }
.plan.is-on .plan__pick { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* ---- timeline ---- */
.daytabs { display: flex; gap: 8px; margin-bottom: 14px; }
.daytab { flex: 1; min-height: 44px; border: 1px solid var(--ink); font-family: var(--serif); font-size: 14px; letter-spacing: .04em; background: var(--paper); }
.daytab.is-on { background: var(--ink); color: var(--paper); }
.days { display: grid; gap: 14px; }
.day[hidden] { display: none; }
.day { background: var(--paper2); border: 1px solid var(--line); padding: 20px 18px; }
.day__head { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.day__n { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.day__title { font-size: 21px; font-weight: 700; }
.day__sub { font-size: 13px; color: var(--ink2); }
.stop { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px 12px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); text-align: left; width: 100%; }
.stop:last-child { border-bottom: 0; }
.stop:hover .stop__title { color: var(--accent); }
.stop__time { font-family: var(--serif); font-size: 14px; font-weight: 600; padding-top: 2px; }
.stop__title { font-weight: 500; font-size: 15px; line-height: 1.4; }
.stop__place { font-size: 12px; color: var(--ink2); }
.stop__cost { font-family: var(--serif); font-size: 13px; color: var(--ink2); white-space: nowrap; padding-top: 3px; }
.stop__thumb { grid-column: 1; grid-row: 1 / 3; width: 52px; height: 52px; overflow: hidden; border-radius: 4px; background: var(--paper3); }
.stop__thumb img { width: 100%; height: 100%; object-fit: cover; }
.stop--pic { grid-template-columns: 52px 1fr auto; }
.stop--pic .stop__time { grid-column: 2; }
.stop--pic .stop__title, .stop--pic .stop__place { grid-column: 2; }
.stop--pic .stop__cost { grid-column: 3; grid-row: 1; }
.day__total { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.day__total b { font-family: var(--serif); color: var(--ink); }

/* ---- map ---- */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--ink); background: var(--paper); font-size: 12.5px; opacity: .45; }
.chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--ink)); }
.chip.is-on { opacity: 1; background: var(--paper2); }
.chip--hotel::before { border-radius: 2px; }
.map-box { position: relative; z-index: 0; isolation: isolate; border: 1px solid var(--ink); background: var(--paper3); }
#map-canvas { height: 380px; width: 100%; }
.leaflet-container { font-family: var(--sans); }
.pin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--paper); background: var(--c, var(--ink)); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 12px; line-height: 22px; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.pin--hotel { background: var(--paper); color: var(--ink); border-color: var(--ink); border-radius: 4px; display: grid; place-items: center; font-size: 14px; }
.leaflet-popup-content-wrapper { border-radius: 4px; border: 1px solid var(--ink); box-shadow: none; }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; line-height: 1.45; }
.leaflet-popup-content b { display: block; font-family: var(--serif); font-size: 14px; }
.leaflet-popup-tip { border: 1px solid var(--ink); }

/* ---- paper cards / forms ---- */
.paper { background: var(--paper2); border: 1px solid var(--line); padding: 20px 18px; }
.paper--soft { background: transparent; }
.paper h3 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld__label, .fld label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); }
.fld--row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fld--row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld input, .fld select, .fld textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--ink); }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--ink); }
.fld textarea { resize: vertical; }
.seg { display: flex; border: 1px solid var(--ink); }
.seg__btn { flex: 1; min-height: 44px; padding: 0 10px; font-size: 13.5px; background: var(--paper); border-right: 1px solid var(--ink); }
.seg__btn:last-child { border-right: 0; }
.seg__btn.is-on { background: var(--ink); color: var(--paper); }
.stepper { display: flex; align-items: center; border: 1px solid var(--ink); }
.stepper button { width: 44px; min-height: 44px; font-family: var(--serif); font-size: 20px; background: var(--paper); }
.stepper button:hover { background: var(--paper2); }
.stepper output { flex: 1; text-align: center; font-family: var(--serif); font-size: 18px; border-inline: 1px solid var(--ink); align-self: stretch; display: grid; place-items: center; }
.price { display: grid; gap: 14px; }
.price__calc { display: flex; flex-direction: column; gap: 16px; }
.price__big { display: flex; align-items: baseline; gap: 8px; }
.price__big span { font-family: var(--serif); font-size: 46px; font-weight: 700; line-height: 1; }
.price__big small { font-size: 13px; color: var(--ink2); }
.price__meta { font-size: 13px; color: var(--ink2); }
.price__actions { display: flex; flex-direction: column; gap: 10px; }
.price__side { display: grid; gap: 14px; }
.ticks, .dashes { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.ticks li, .dashes li { display: flex; gap: 10px; align-items: flex-start; }
.ticks li::before { content: "✓"; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.dashes li::before { content: "—"; color: var(--gold); flex-shrink: 0; }
.fine { font-size: 12px; color: var(--ink2); margin-top: 12px; line-height: 1.55; }
.book { display: flex; flex-direction: column; gap: 14px; }
.book__total { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border: 1px solid var(--line); padding: 12px 14px; }
.book__total span { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.book__total small { font-size: 12px; color: var(--ink2); }
.book__total b { font-family: var(--serif); font-size: 24px; white-space: nowrap; }
.book__err { color: var(--accent); font-size: 13px; }
.book__err[hidden], .book__done[hidden] { display: none; }
.book__summary { margin: 0; white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.7; background: var(--paper); border: 1px solid var(--line); padding: 14px 16px; }

/* ---- policy ---- */
.policy { display: grid; gap: 14px; }
.refund { display: flex; flex-direction: column; gap: 8px; }
.refund__row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "when pct" "note note"; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: var(--paper); }
.refund__row--full { border-color: var(--accent); }
.refund__row--none { background: var(--paper3); }
.refund__when { grid-area: when; font-weight: 500; font-size: 14px; }
.refund__pct { grid-area: pct; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--accent); white-space: nowrap; }
.refund__row--none .refund__pct { font-size: 14px; color: var(--ink); }
.refund__note { grid-area: note; font-size: 12px; color: var(--ink2); line-height: 1.45; }
.policy__extra { display: grid; gap: 12px; }
.policy__extra h3 { font-size: 17px; margin-bottom: 6px; }
.policy__extra p { font-size: 13.5px; color: var(--ink2); }

/* ---- faq ---- */
.faq { display: flex; flex-direction: column; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 0; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 22px; color: var(--accent); flex-shrink: 0; transition: transform .2s ease; }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { padding: 0 0 16px; color: var(--ink2); font-size: 14.5px; }

/* ---- footer ---- */
.foot { margin-top: 56px; background: var(--ink); color: var(--paper); padding: 44px 0 40px; }
.foot h2 { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.foot p { max-width: 56ch; opacity: .85; margin-bottom: 22px; }
.foot__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.foot__bot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(250, 246, 239, 0.2); padding-top: 18px; font-size: 12px; opacity: .8; }
.credits summary { cursor: pointer; }
.credits p { margin: 8px 0 6px; font-size: 11px; opacity: .8; }
.credits ul { display: flex; flex-direction: column; gap: 3px; font-size: 11px; opacity: .8; }
.credits a { color: var(--paper); }
.foot .wrap { padding-top: 0; }

/* ---- sheet / toast ---- */
.sheet { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(42, 36, 30, 0.6); }
.sheet__panel { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--paper); animation: slideup .28s cubic-bezier(.2, .8, .2, 1); }
.sheet__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; background: var(--paper); border: 1px solid var(--ink); font-size: 22px; line-height: 1; }
.sheet__media { height: 230px; background: var(--paper3); }
.sheet__media img, .sheet__media .scene { width: 100%; height: 100%; object-fit: cover; }
.sheet__body { padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sheet__kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.sheet__body h3 { font-size: 24px; font-weight: 700; }
.sheet__body p { color: var(--ink2); }
.sheet__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink2); }
.sheet__facts b { color: var(--ink); font-weight: 500; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1300; background: var(--ink); color: var(--paper); padding: 10px 18px; font-size: 14px; }
.toast[hidden] { display: none; }

/* ============================================================ */
@media (min-width: 640px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price__actions, .foot__actions { flex-direction: row; }
  .foot__bot { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}
@media (min-width: 960px) {
  .wrap { padding-top: 64px; }
  .mast__nav { display: flex; }
  .sec { font-size: 38px; }
  .intro__grid { grid-template-columns: 1.4fr 1fr; gap: 48px; }
  .lead { font-size: 20px; }
  .daytabs { display: none; }
  .days { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 18px; }
  .day[hidden] { display: block; }
  #map-canvas { height: 500px; }
  .price { grid-template-columns: 1.1fr 1fr; align-items: start; gap: 18px; }
  .price__calc { padding: 26px 24px; }
  .price__big span { font-size: 58px; }
  .policy { grid-template-columns: 1.15fr 1fr; align-items: start; gap: 18px; }
  .refund__row { grid-template-areas: "when pct" "note pct"; }
  .book { padding: 26px 24px; }
  .faq { max-width: 820px; }
  .sheet { align-items: center; padding: 20px; }
  .sheet__panel { max-height: 84vh; }
  .sheet__media { height: 280px; }
}
