/* TripAtlas — visual language learned from Nomad List's design system.
   Our own code; tokens and patterns traced from their CSS:
   - font: Nunito (self-hosted variable font, wght 200-1000)
   - brand red #ff4742, good green #2bde73, okay yellow #ffc924, blue #42b4ff
   - ink #0f1115, text #1c1c1c, secondary #686868
   - page bg #fbfaf8 (warm beige), cards #fff, toned #f9f9f9
   - borders #dddddd, hover #f5f5f5, active #ededed
   - radius: 12px (cards, rows, sort pills), 50px (buttons), 100% (round)
   - flat 1px ring, no drop shadow: 0 0 0 1px #dddddd
   No external requests: the font is self-hosted in /assets/fonts/. */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(/assets/fonts/nunito.woff2) format('woff2');
}

:root {
  --brand: #ff4742;
  --brand-light: #ff6b66;
  --green: #2bde73;
  --yellow: #ffc924;
  --blue: #42b4ff;
  --ink: #0f1115;
  --text: #1c1c1c;
  --secondary: #686868;
  --bg: #fbfaf8;
  --card: #ffffff;
  --toned: #f9f9f9;
  --border: #dddddd;
  --hover: #f5f5f5;
  --active: #ededed;
  --radius: 12px;
  --ring: 0 0 0 1px var(--border);
  --font: 'Nunito', -apple-system, "system-ui", "Segoe UI", sans-serif;
  --bold: 800;
  --semibold: 500;
  --normal: 400;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 17px; line-height: 1.5; color: var(--text); background: var(--bg);
  min-height: 100%;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; }

/* Header — brand link near-black with a 1px underline, like theirs */
.site-header { background: var(--card); box-shadow: var(--ring); }
.site-header .wrap {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.logo { font-size: 22px; font-weight: var(--bold); color: var(--ink); letter-spacing: -0.5px; }
.logo span { color: var(--brand); }
.logo:hover { color: var(--ink); border-bottom: 1px solid var(--ink); text-decoration: none; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text); font-size: 15px; font-weight: var(--semibold);
  padding: 6px 10px; border-radius: var(--radius);
}
.main-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--brand); font-weight: var(--bold); }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.article { max-width: 760px; margin: 0 auto; }
main { padding: 32px 0 56px; }

/* Hero */
.hero { padding: 44px 0 36px; }
.hero h1 { font-size: 34px; line-height: 1.25; letter-spacing: -0.5px; margin-bottom: 12px; color: var(--ink); font-weight: var(--bold); }
.hero p.lede { font-size: 19px; color: var(--text); max-width: 720px; }
.hero .sub { margin-top: 14px; font-size: 15px; color: var(--secondary); }

/* Sections */
.section { margin-top: 44px; }
.section h2 { font-size: 24px; margin-bottom: 14px; letter-spacing: -0.3px; color: var(--ink); font-weight: var(--bold); }
.section > p { color: var(--text); margin-bottom: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head a { font-size: 15px; white-space: nowrap; }

/* Inline option links — their .option pattern: red text, dotted red underline */
.section-head a,
.rank-links a {
  display: inline-block; color: var(--brand); border-bottom: 1px dotted var(--brand);
}
.section-head a:hover,
.rank-links a:hover { color: var(--brand); text-decoration: none; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.card {
  display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--brand); box-shadow: var(--ring); text-decoration: none; }
.card h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; font-weight: var(--bold); }
.card p { font-size: 15px; color: var(--secondary); line-height: 1.55; }
.card .tag {
  display: inline-block; font-size: 12px; font-weight: var(--bold); text-transform: uppercase;
  letter-spacing: .4px; color: var(--brand); background: rgba(255, 71, 66, .08); border-radius: var(--radius);
  padding: 2px 8px; margin-bottom: 8px;
}
.card .tag.soon { color: var(--secondary); background: var(--hover); }
.card .meta { margin-top: 10px; font-size: 13px; color: var(--secondary); }

/* Buttons — their .button: 50px pill, 1px border, 16px bold, min-height 40px */
.button {
  display: inline-block; cursor: pointer; text-align: center; user-select: none;
  font-size: 16px; font-weight: var(--bold); line-height: 16px; min-height: 40px;
  padding: 12px 14px; margin: 7px; border-radius: 50px;
  color: var(--text); background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1);
}
.button:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.button:active { background: var(--active); opacity: .5; }
.button.red { border-color: var(--brand); color: var(--brand); background: none; box-shadow: none; }
.button.red:hover { background-color: var(--brand); border-color: var(--brand); color: #fff; }
.button.green { border-color: var(--green); color: var(--green); background: none; box-shadow: none; }
.button.green:hover { background-color: var(--green); border-color: var(--green); color: #fff; }

/* Service list */
.service-list { list-style: none; margin-top: 8px; }
.service-list li { border-bottom: 1px solid var(--border); padding: 14px 0; }
.service-list li:last-child { border-bottom: 0; }
.service-list a { font-size: 18px; font-weight: var(--bold); color: var(--ink); }
.service-list a:hover { color: var(--brand); }
.service-list p { font-size: 15px; color: var(--secondary); margin-top: 2px; }

/* Article */
.article h1 { font-size: 32px; line-height: 1.3; letter-spacing: -0.5px; margin-bottom: 10px; color: var(--ink); font-weight: var(--bold); }
.article .byline { font-size: 14px; color: var(--secondary); margin-bottom: 24px; }
.article h2 { font-size: 24px; margin: 36px 0 12px; letter-spacing: -0.3px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--ink); font-weight: var(--bold); }
.article h2:first-of-type { border-top: 0; }
.article h3 { font-size: 19px; margin: 22px 0 8px; color: var(--ink); font-weight: var(--bold); }
.article p { margin-bottom: 14px; color: var(--text); }
.article ul, .article ol { margin: 0 0 14px 22px; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--ink); }
.article a { text-decoration: underline; }
.article a:hover { color: var(--brand); }
.article blockquote {
  border-left: 3px solid var(--brand); background: var(--toned); padding: 12px 16px;
  margin: 16px 0; font-size: 15px; color: var(--text);
}
/* Article tables — their list pattern: 1px borders, zebra rows, hover state */
.article table { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 15px; }
.article th, .article td { text-align: left; padding: 9px 10px; border: 1px solid var(--border); vertical-align: top; }
.article th { background: var(--toned); font-weight: var(--bold); color: var(--ink); }
.article tbody tr:nth-of-type(odd) { background-color: var(--toned); }
.article tbody tr:hover td { background-color: var(--border); }
.article .toc { background: var(--toned); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0 8px; }
.article .toc h2 { border: 0; margin: 0 0 8px; padding: 0; font-size: 17px; }
.article .toc ol { margin: 0 0 0 20px; }
.article .toc li { margin-bottom: 3px; }
.article .toc a { font-size: 15px; }
.faq h3 { margin-top: 18px; }
.faq p { margin-bottom: 10px; }
.next-steps { background: var(--toned); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-top: 32px; }
.next-steps h2 { border: 0; margin: 0 0 8px; padding: 0; }
.next-steps p { margin-bottom: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--toned); padding: 28px 0 36px; font-size: 14px; color: var(--secondary); }
.site-footer .wrap { display: flex; flex-direction: column; gap: 14px; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--text); }
.footer-nav a:hover { color: var(--brand); }
.disclosure { font-size: 13px; color: var(--secondary); line-height: 1.6; max-width: 760px; }

/* Breadcrumb */
.breadcrumb { font-size: 14px; color: var(--secondary); margin-bottom: 18px; }
.breadcrumb a { color: var(--secondary); }
.breadcrumb a:hover { color: var(--brand); }

/* ---- City ranking: Nomad List grid-item DNA, our own layout ----
   Their pattern: photo fills the card (object-fit cover, 12px radius),
   name overlaid bottom-left in white bold 26px with a text shadow,
   a bottom gradient for readability, score/attributes as white bold
   corner elements over the photo, legend colours (good #2bde73,
   okay #ffc924, bad #ff4742). */

/* Sort pills — their .filter-as-text .sort: bordered pill, 12px radius */
.sort-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 20px; font-size: 15px; }
.sort-label { font-size: 15px; font-weight: var(--bold); color: var(--ink); margin-right: 2px; }
.sort-btn {
  display: inline-block; color: var(--ink); background: var(--card);
  padding: 0.5em 0.9em; border: 1px solid var(--ink); border-radius: var(--radius);
  margin-left: 0.25em; margin-right: 0.25em; font-weight: var(--bold); font-size: 15px;
}
.sort-btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.sort-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.rank-list { list-style: none; margin-top: 4px; }
.rank-row {
  display: grid; grid-template-columns: 34px 220px 1fr 250px; gap: 18px; align-items: start;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
  background: var(--card);
}
.rank-row:hover { border-color: var(--brand); box-shadow: var(--ring); }
.rank-num {
  font-size: 26px; font-weight: var(--bold); color: #c8ccd2; line-height: 1.1; padding-top: 2px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.rank-row:nth-child(-n+3) .rank-num { color: var(--brand); }

/* Photo card: the Nomad List item. Name + country overlaid on the photo,
   score badge in the top-right corner — white bold text over the image. */
.rank-photo {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; line-height: 0;
  background: var(--ink);
}
.rank-photo img { width: 220px; height: 150px; object-fit: cover; display: block; }
.rank-photo .photo-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 30%);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.rank-photo .rank-caption {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  padding: 0.5em; padding-bottom: 0.6em;
}
.rank-photo .rank-name {
  display: block;
  color: #fff; font-weight: var(--bold); font-size: 26px; line-height: 1.125;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35), 1px 1px 5px rgba(0, 0, 0, 0.5);
}
.rank-photo .rank-name:hover { color: #fff; border-bottom: 1px solid #fff; text-decoration: none; }
.rank-photo .rank-sub {
  display: block; margin-top: 0.2em;
  color: #fff; font-weight: var(--semibold); font-size: 16px; line-height: 1;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35), 1px 1px 5px rgba(0, 0, 0, 0.5);
}
.rank-photo .score-badge {
  position: absolute; top: 0; right: 0; z-index: 2;
  margin: 0.75em 1em; padding: 0.25em 0.6em; border-radius: var(--radius);
  color: #fff; font-weight: var(--bold); font-size: 16px; line-height: 1.4;
  font-variant-numeric: tabular-nums; text-align: center;
}
.rank-photo .score-badge.good { background-color: var(--green); }
.rank-photo .score-badge.ok { background-color: var(--yellow); }
.rank-photo .score-badge.low { background-color: var(--brand); }
.rank-photo .score-badge .score-out-of { font-size: 0.65em; font-weight: var(--semibold); opacity: 0.85; }

.rank-main p { font-size: 15px; color: var(--secondary); line-height: 1.55; margin-bottom: 8px; }
.rank-links { font-size: 14px !important; color: var(--secondary); }
.rank-links a { font-weight: var(--bold); }

.rank-stats { border-left: 1px solid var(--border); padding-left: 18px; }
.stat { margin-bottom: 8px; }
.stat .stat-label { display: block; font-size: 12px; font-weight: var(--bold); text-transform: uppercase; letter-spacing: .4px; color: var(--secondary); }
.stat strong { font-size: 15px; color: var(--ink); }
.stat .bar { display: block; height: 6px; background: var(--hover); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.stat .bar span { display: block; height: 100%; border-radius: 3px; }
/* Cost bar coloured by the legend: cheap = green, mid = yellow, pricey = red */
.stat .bar span.bar-good { background: var(--green); }
.stat .bar span.bar-ok { background: var(--yellow); }
.stat .bar span.bar-low { background: var(--brand); }
.stat .bar-net span { background: var(--green); }
.stat-plain { margin-bottom: 4px; }
.stat-plain strong { font-weight: var(--semibold); color: var(--secondary); }

.rank-note { font-size: 13px; color: var(--secondary); line-height: 1.6; margin: 6px 0 18px; max-width: 860px; }
.rank-note a { text-decoration: underline; }
.rank-note a:hover { color: var(--brand); }
.score-explainer {
  background: var(--toned); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 8px; max-width: 860px;
}
.score-explainer h3 { font-size: 17px; margin-bottom: 6px; color: var(--ink); font-weight: var(--bold); }
.score-explainer p { font-size: 15px; color: var(--text); line-height: 1.6; }

@media (max-width: 800px) {
  .rank-photo .rank-name { font-size: 20px; }
  .rank-photo .rank-sub { font-size: 13px; }
}
@media (max-width: 860px) {
  .rank-row { grid-template-columns: 28px 1fr; gap: 12px; padding: 14px; }
  .rank-photo { grid-column: 2; }
  .rank-photo img { width: 100%; height: 150px; }
  .rank-main { grid-column: 2; }
  .rank-stats { grid-column: 2; border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .rank-num { grid-row: 1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 27px; }
  .article h1 { font-size: 26px; }
  .article h2 { font-size: 21px; }
  main { padding: 24px 0 44px; }
  .main-nav a { padding: 6px 8px; font-size: 14px; }
  .article table { font-size: 14px; }
}

/* ---- HyperAir-style homepage (our own code, same tokens) ---- */

/* Category strip under the site header */
.ha-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 12px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.ha-nav a {
  font-size: 15px; font-weight: var(--semibold); color: var(--text);
  padding: 6px 12px; border-radius: var(--radius);
}
.ha-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.ha-nav a:first-child { color: var(--brand); font-weight: var(--bold); }

/* Hero search */
.ha-hero {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px 20px; margin-top: 20px;
}
.ha-hero h1 { font-size: 30px; line-height: 1.3; letter-spacing: -0.5px; color: var(--ink); font-weight: var(--bold); margin-bottom: 8px; }
.ha-hero-sub { font-size: 17px; color: var(--text); margin-bottom: 18px; }
.ha-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.ha-tab {
  font-family: var(--font); font-size: 16px; font-weight: var(--semibold);
  color: var(--secondary); background: none; border: 0; cursor: pointer;
  padding: 8px 14px 10px; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.ha-tab:hover { color: var(--ink); }
.ha-tab.active { color: var(--brand); font-weight: var(--bold); border-bottom-color: var(--brand); }
.ha-tab-panel { padding: 4px 0 8px; }
.ha-search { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ha-search-field { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.ha-search-field span { font-size: 14px; color: var(--secondary); }
.ha-search-field input {
  font-family: var(--font); font-size: 16px; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); width: 100%;
}
.ha-search-field input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.ha-search .button { margin: 0; }
.ha-search-note { font-size: 14px; color: var(--secondary); margin-top: 10px; }
.ha-disclaimer { font-size: 13px; color: var(--secondary); margin-top: 14px; }

/* Destination tiles — photo cards reuse the ranking photo pattern */
.ha-dest-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px;
}
.ha-dest-tile {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  line-height: 0; background: var(--ink); border: 1px solid var(--border);
  min-height: 150px;
}
.ha-dest-tile img { width: 100%; height: 150px; object-fit: cover; display: block; }
.ha-dest-tile::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 45%);
  border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
  pointer-events: none;
}
.ha-dest-tile:hover { border-color: var(--brand); }
.ha-dest-name {
  position: absolute; left: 0; bottom: 0; z-index: 2; padding: 0.5em; padding-left: 16px;
  color: #fff; font-weight: var(--bold); font-size: 22px; line-height: 1.125;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35), 1px 1px 5px rgba(0, 0, 0, 0.5);
}
.ha-dest-sub {
  position: absolute; left: 0; bottom: 0; z-index: 2; padding: 0.5em; padding-left: 16px; padding-bottom: 2.6em;
  color: #fff; font-weight: var(--semibold); font-size: 14px; line-height: 1;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35), 1px 1px 5px rgba(0, 0, 0, 0.5);
}
/* Gradient tiles (no photo yet): coloured card, white overlay text like photo tiles */
.ha-dest-grad--hk { background: linear-gradient(135deg, #c0392b, #7b241c); }
.ha-dest-grad--kyoto { background: linear-gradient(135deg, #5b4a8a, #2e2450); }
.ha-dest-grad--kaohsiung { background: linear-gradient(135deg, #0f766e, #134e4a); }
.ha-dest-grad--macau { background: linear-gradient(135deg, #7c5a10, #3a2c04); }

/* Price-comparison cards */
.ha-deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.ha-deal-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; background: var(--card);
}
.ha-deal-card:hover { border-color: var(--brand); }
.ha-deal-card h3 { font-size: 18px; color: var(--ink); font-weight: var(--bold); margin-bottom: 10px; }
.ha-price-list { list-style: none; }
.ha-price-list li {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.ha-price-list li:last-child { border-bottom: 0; }
.ha-price-list span { color: var(--text); }
.ha-price-list strong { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ha-cheapest {
  font-style: normal; font-size: 12px; font-weight: var(--bold); color: var(--brand);
  background: rgba(255, 71, 66, .08); border-radius: var(--radius); padding: 2px 8px;
}
.ha-price-note { font-size: 13px; color: var(--secondary); margin-top: 10px; line-height: 1.6; }
.ha-deal-blurb { font-size: 15px; color: var(--secondary); line-height: 1.55; margin-bottom: 10px; }
.ha-deal-card p a { color: var(--brand); border-bottom: 1px dotted var(--brand); }
.ha-deal-card p a:hover { text-decoration: none; }

/* Partner platforms */
.ha-partners h2 { margin-bottom: 14px; }
.ha-partner-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
}
.ha-partner-list li {
  font-size: 15px; font-weight: var(--semibold); color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 14px;
}

/* Footer link columns */
.ha-footlinks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px;
  border-top: 1px solid var(--border); padding-top: 28px;
}
.ha-footlink-col h3 { font-size: 16px; color: var(--ink); font-weight: var(--bold); margin-bottom: 10px; }
.ha-footlink-col ul { list-style: none; }
.ha-footlink-col li { margin-bottom: 6px; }
.ha-footlink-col a { font-size: 15px; color: var(--text); }
.ha-footlink-col a:hover { color: var(--brand); }
.ha-about-note { font-size: 14px; color: var(--secondary); line-height: 1.6; margin-top: 12px; }

@media (max-width: 640px) {
  .ha-hero { padding: 20px 16px 16px; }
  .ha-hero h1 { font-size: 24px; }
  .ha-dest-name { font-size: 19px; }
  .ha-search .button { width: 100%; }
}
