/* Trip calendar (/calendar). Loaded only on that page; every class starts with tc- so nothing leaks. */
.tc {
  --tc-line: #e2e0d7;
  --tc-card: #fffefa;
  --tc-sage: #dce6d5;
  --tc-forest: #41624b;
  --tc-sand: #f1dfc1;
  --tc-rust: #89612e;
  --tc-gold: #ac864b;
  --tc-holiday: #f7e9ea;
  --tc-program: #b95a26;
  --tc-line-btn: #17824a;
  color: var(--t-navy);
}
.tc button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.tc button:focus-visible, .tc a:focus-visible, .tc select:focus-visible { outline: 3px solid var(--tc-gold); outline-offset: 3px; }
.tc [hidden] { display: none !important; }
.tc-section { display: flex; flex-direction: column; gap: 32px; }

/* Shared calendar */
.tc-central { border: 1px solid var(--tc-line); border-radius: 14px; background: var(--tc-card); padding: 24px; }
.tc-central-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tc-central-title { margin: 0; font: 600 clamp(26px, 3vw, 34px)/1.2 var(--serif), var(--thai); color: var(--t-navy); }
.tc-central-title em { font-style: normal; color: var(--muted); margin-left: 4px; }
.tc-eyebrow { margin: 0 0 6px; font: 700 12px/1.4 var(--latin); letter-spacing: .18em; color: var(--t-navy); }
.tc-arrows { display: flex; gap: 8px; }
.tc-circle { width: 36px; height: 36px; border: 1px solid #c9cabe !important; border-radius: 50%; font-size: 20px !important; display: grid; place-items: center; }
.tc-circle:hover:not(:disabled) { background: #f3eee4; }
.tc-circle:disabled { opacity: .3; cursor: default !important; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.tc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.tc-dot.is-trip { background: #9aaf88; }
.tc-dot.is-explore { background: #cba571; }
.tc-dot.is-holiday { background: #e9bfc4; }
.tc-status { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* Holidays under the month name: a plain list */
.tc-events { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tc-events li { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.7; color: #8a826e; }
.tc-events li.is-holiday { color: #a36575; }
.tc-ev-date { min-width: 52px; white-space: nowrap; font-weight: 500; }
.tc-ev-name { display: flex; align-items: center; gap: 5px; }
.tc-buddha { color: #b3904e; display: inline-flex; width: 15px; height: 17px; flex-shrink: 0; }
.tc-buddha svg { width: 100%; height: 100%; fill: currentColor; }

/* Month grid, shared by the big calendar and the one inside each trip */
.tc-scroll { overflow-x: auto; }
.tc-grid { min-width: 560px; border: 1px solid var(--tc-line); border-radius: 10px; overflow: hidden; background: #fff; }
.tc-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--tc-line); background: #f4f3ed; }
.tc-weekdays span { text-align: center; padding: 9px 0; font-size: 11px; color: var(--muted); }
.tc-wd-short { display: none; }
.tc-weekdays .is-weekend { background: #f0dfe1; color: #96717a; }
.tc-week { position: relative; border-bottom: 1px solid var(--tc-line); min-height: max(118px, calc(90px + var(--lanes) * 30px)); }
.tc-week:last-child { border-bottom: 0; }
.tc-days { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.tc-day { position: relative; border-right: 1px solid var(--tc-line); padding: 8px 10px; font-size: 14px; }
.tc-day:last-child { border-right: 0; }
.tc-day.is-weekend, .tc-day.is-holiday { background: var(--tc-holiday); }
.tc-day.is-outside { color: #c4c7bd; background: #f6f4ef; }
.tc-day > .tc-buddha { position: absolute; right: 6px; top: 8px; }
.tc-moon-note { position: absolute; left: 5px; right: 5px; bottom: 5px; font-size: 8px; line-height: 1.3; color: #9d8454; overflow-wrap: anywhere; }
.tc-bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 26px; gap: 4px 0; padding: 36px 0 40px; pointer-events: none; }
.tc-bar {
  min-width: 0; margin: 0 3px; padding: 3px 7px; border: 1px solid #a9b99c; border-left: 3px solid var(--tc-forest); border-radius: 5px;
  background: var(--tc-sage); color: var(--tc-forest); font-size: 11px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-bar.is-explore { background: var(--tc-sand); border-color: #d1b98f; border-left-color: var(--tc-rust); color: var(--tc-rust); }

/* List: by trip / by month */
.tc-list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tc-list-head h2 { margin: 0; font: 600 clamp(30px, 3.4vw, 42px)/1.1 var(--serif); color: var(--t-navy); }
.tc-summary { margin: 6px 0 0; min-height: 1.6em; font-size: 13px; color: var(--muted); }
.tc-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--tc-card); }
.tc-switch button { padding: 8px 20px; border-radius: 7px; font-size: 14px; white-space: nowrap; }
.tc-switch button[aria-pressed='true'] { background: var(--t-navy); color: #fff; }
.tc-cards, .tc-months { display: flex; flex-direction: column; gap: 8px; }
.tc-months { gap: 14px; }
.tc-card { border: 1px solid var(--tc-line); border-radius: 10px; overflow: hidden; background: var(--tc-card); }
.tc-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 30px; align-items: center; gap: 16px; width: 100%; min-height: 62px; padding: 14px 18px; text-align: left; }
.tc-row:hover { background: #f6f7f0; }
.tc-row[aria-expanded='true'] { background: #eef2e8; }
.tc-card.is-explore > .tc-row[aria-expanded='true'] { background: #fbf0df; }
.tc-badge { justify-self: start; padding: 3px 8px; border-radius: 4px; background: var(--tc-sage); color: var(--tc-forest); font: 700 10px/1.6 var(--latin); letter-spacing: .08em; text-transform: uppercase; }
.tc-badge.is-explore { background: var(--tc-sand); color: var(--tc-rust); }
.tc-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 600; line-height: 1.6; }
.tc-date { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.tc-date small { font-size: 12px; color: var(--tc-gold); }
.tc-date-month { display: none; }
.tc-flag { margin-right: 6px; }
.tc-plus { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #cdd2c5; border-radius: 50%; font-size: 20px; line-height: 1; }
.tc-row[aria-expanded='true'] .tc-plus, .tc-month h3 button[aria-expanded='true'] .tc-plus { background: var(--tc-forest); border-color: var(--tc-forest); color: #fff; }
.tc-card.is-explore > .tc-row[aria-expanded='true'] .tc-plus { background: var(--tc-rust); border-color: var(--tc-rust); }
.tc-empty { padding: 24px 4px; color: var(--muted); }

.tc-chips-months { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tc-chips-months a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border: 1px solid var(--tc-line); border-radius: 7px; background: var(--tc-card); font-size: 13px; color: inherit; text-decoration: none; }
.tc-chips-months a:hover { border-color: var(--tc-gold); }
.tc-chips-months span { padding: 0 5px; border-radius: 4px; background: #e9eade; font-size: 11px; }
.tc-month-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.tc-month-tools button { padding: 8px 14px; border: 1px solid #ccd0c3 !important; border-radius: 7px; font-size: 13px; }
.tc-month-tools button:hover { background: var(--tc-card); }
.tc-month { border: 1px solid var(--tc-line); border-radius: 14px; overflow: hidden; background: var(--tc-card); scroll-margin-top: 90px; }
.tc-month h3 { margin: 0; }
.tc-month h3 button { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 22px; background: #faf8f2; text-align: left; }
.tc-month h3 button > span:first-child { flex: 1; font-size: 20px; font-weight: 600; }
.tc-month h3 em { margin-left: 4px; font-style: normal; color: var(--muted); font-weight: 500; }
.tc-month-count { font-size: 13px; font-weight: 400; color: var(--muted); }
.tc-month-body { padding: 16px 18px; border-top: 1px solid var(--tc-line); }

/* Opened trip: round picker + calendar, every day, nights, price, buttons */
.tc-body { padding: 22px 24px; border-top: 1px solid var(--tc-line); }
.tc-expanded { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tc-local { min-width: 0; }
.tc-local-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tc-local-head h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; margin: 0; font-size: 18px; font-weight: 600; }
/* Full trip name next to the heading: the row above may cut it with an ellipsis. */
.tc-local-trip { min-width: 0; font-size: 18px; font-weight: 700; color: var(--t-navy); }
.tc-departure { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.tc-departure > span { white-space: nowrap; }
.tc-departure small { margin-left: 4px; font-size: 12px; color: var(--muted); }
.tc-departure select { max-width: 100%; padding: 10px 34px 10px 12px; border: 1px solid #cbd3c2; border-radius: 8px; background: #f7f8f2; font: 500 14px var(--thai); color: var(--t-navy); cursor: pointer; }
.tc-inline-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.tc-inline-month { min-width: 0; }
.tc-inline-month h5 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.tc-inline .tc-grid { min-width: 420px; }
.tc-inline .tc-events li { font-size: 11px; }
.tc-inline .tc-day { padding: 6px 8px; font-size: 12px; }
.tc-inline .tc-day > .tc-buddha { width: 12px; height: 14px; top: 6px; right: 5px; }
/* Per-trip calendar: each week only as tall as the date and the trip line (the full-moon note is in the list below). */
.tc-inline .tc-moon-note { display: none; }
.tc-inline .tc-week { min-height: max(52px, calc(36px + var(--lanes) * 28px)); }
.tc-inline .tc-bars { padding: 30px 0 8px; grid-auto-rows: 24px; }
.tc-inline .tc-bar { font-size: 10px; padding: 2px 6px; }
.tc-inline-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.tc-route { padding-top: 22px; border-top: 1px solid var(--tc-line); }
.tc-label { margin: 0 0 6px; font: 700 11px/1.4 var(--latin); letter-spacing: .16em; color: var(--tc-gold); }
.tc-route h4 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.tc-route-days { list-style: none; margin: 0; padding: 0; }
.tc-route-days li { padding: 9px 0; border-bottom: 1px solid #eae8df; font-size: 14px; line-height: 1.8; color: #5d6a62; }
.tc-day-head { display: block; font-weight: 700; color: var(--t-navy); }
.tc-day-label { font-weight: 700; }
.tc-day-sub { display: block; margin-top: 2px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.tc-nights { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--tc-line); border-radius: 8px; background: #f6f5ee; }
.tc-nights h5 { margin: 0 0 4px; font-size: 14px; }
.tc-nights p { margin: 0; font-size: 14px; line-height: 1.8; color: #5d6a62; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tc-chips span { padding: 3px 11px; border: 1px solid var(--tc-line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.tc-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.tc-price span { font-size: 15px; color: var(--muted); }
.tc-price strong { font: 700 28px/1.2 var(--latin); color: var(--t-navy); }
.tc-actions { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--tc-line); }
.tc-actions a { flex: 1; display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.tc-program { background: var(--tc-program); }
.tc-program:hover { background: #a34b1e; }
.tc-line { background: var(--tc-line-btn); }
.tc-line:hover { background: #116a3b; }
.tc-foot { margin: 0; font-size: 12px; color: var(--muted); }
.tc-noscript ul { margin: 0; padding-left: 20px; line-height: 2; }

@media (max-width: 1050px) {
  .tc-central { padding: 16px; }
  .tc-row { grid-template-columns: 64px minmax(0, 1fr) auto 28px; gap: 12px; padding: 13px 15px; }
}
@media (max-width: 700px) {
  .tc-section { gap: 24px; }
  .tc-central { padding: 16px 12px; }
  /* All seven days fit the screen: short weekday names, tighter cells, the full-moon note left to the icon. */
  .tc-grid, .tc-inline .tc-grid { min-width: 0; }
  .tc-wd-long { display: none; }
  .tc-wd-short { display: inline; }
  .tc-weekdays span { font-size: 11px; }
  .tc-week { min-height: max(64px, calc(40px + var(--lanes) * 24px)); }
  .tc-inline .tc-week { min-height: max(46px, calc(32px + var(--lanes) * 24px)); }
  .tc-day, .tc-inline .tc-day { padding: 4px 5px; font-size: 12px; }
  .tc-day > .tc-buddha, .tc-inline .tc-day > .tc-buddha { width: 11px; height: 13px; top: 5px; right: 3px; }
  .tc-moon-note { display: none; }
  .tc-bars { padding: 26px 0 10px; grid-auto-rows: 20px; }
  .tc-inline .tc-bars { padding: 26px 0 6px; grid-auto-rows: 20px; }
  .tc-bar, .tc-inline .tc-bar { margin: 0 1px; padding: 1px 4px; border-left-width: 2px; border-radius: 4px; font-size: 9px; line-height: 16px; }
  .tc-legend { font-size: 11px; gap: 6px 12px; }
  .tc-events li { font-size: 11px; gap: 8px; }
  .tc-ev-date { min-width: 44px; }
  .tc-list-head { align-items: stretch; flex-direction: column; }
  .tc-switch button { flex: 1; }
  /* Phones: flag + name, departure month (ก.พ. 70), +. No badge, dates or day count. */
  .tc-row { grid-template-columns: minmax(0, 1fr) auto 26px; gap: 10px; min-height: 54px; padding: 12px 12px 12px 14px; }
  .tc-badge, .tc-date-full, .tc-date small { display: none; }
  .tc-name { font-size: 15px; }
  .tc-date { font-size: 13px; color: var(--t-navy); }
  .tc-date-month { display: inline; }
  .tc-plus { width: 26px; height: 26px; font-size: 18px; }
  .tc-month h3 button { padding: 14px; gap: 10px; }
  .tc-month h3 button > span:first-child { font-size: 17px; }
  .tc-month-body { padding: 10px; }
  .tc-month-tools button { flex: 1; }
  .tc-body { padding: 18px 12px; }
  .tc-local-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .tc-departure { flex-direction: column; align-items: stretch; gap: 6px; }
  .tc-departure select { width: 100%; }
  .tc-actions { gap: 8px; }
  .tc-actions a { padding: 12px 8px; font-size: 14px; }
  .tc-price strong { font-size: 24px; }
}

/* The calendar keeps its own light "paper" cards in dark mode too (IG redesign 2026-11): text inside them
   stays navy; headings outside the cards follow the page theme. */
.tc-central, .tc-switch, .tc-card, .tc-month, .tc-noscript, .tc-chips-months a { --t-navy: #14213d; --muted: #5d6472; --border: #e2e0d7; color: #14213d; }
/* Small text reaches 4.5:1 on the cream cards. */
.tc-date small { color: #7d5525; }
.tc-badge.is-explore { color: #74501f; }
