/* TripOverall blog — self-contained, shares tokens with the main site */

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #17263b;
  --ink-soft: #4a5a70;
  --brand: #0f6ef2;
  --brand-ink: #ffffff;
  --accent: #ffb020;
  --line: #e3e9f2;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(23, 38, 59, 0.08);
  --shadow-lift: 0 14px 34px rgba(23, 38, 59, 0.16);
  --measure: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1b2d;
    --surface: #16263c;
    --ink: #eef3fa;
    --ink-soft: #a8b7cb;
    --brand: #4d94ff;
    --brand-ink: #0b1524;
    --line: #24374f;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

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

a { color: var(--brand); }

/* Reading progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 30;
  transition: width 0.1s linear;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: padding 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled { padding: 7px 22px; border-bottom-color: var(--line); box-shadow: 0 2px 14px rgba(0,0,0,0.08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 8px; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--brand); }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none; border-radius: 999px; padding: 9px 20px; transition: transform 0.2s ease, filter 0.2s ease; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Reveal system */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
}

/* Article hero */
.post-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 20px 40px;
  text-align: center;
  isolation: isolate;
}
.post-hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(130deg,
    color-mix(in srgb, var(--brand) 22%, var(--bg)),
    color-mix(in srgb, var(--accent) 18%, var(--bg)) 55%,
    color-mix(in srgb, #ff6a88 16%, var(--bg)));
  background-size: 240% 240%;
  animation: hero-flow 14s ease-in-out infinite alternate;
}
@keyframes hero-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.post-hero .float-emoji { position: absolute; z-index: -1; font-size: 2.4rem; opacity: 0.5; animation: bob 7s ease-in-out infinite; }
.post-hero .fe1 { top: 18%; left: 8%; }
.post-hero .fe2 { top: 30%; right: 10%; animation-delay: -2s; }
.post-hero .fe3 { bottom: 14%; left: 16%; animation-delay: -4s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }

.chip {
  display: inline-block;
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
  color: var(--brand);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.post-hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin: 16px auto 12px; max-width: 860px; }
.post-hero .dek { color: var(--ink-soft); font-size: 1.12rem; max-width: 640px; margin: 0 auto 18px; }
.byline { color: var(--ink-soft); font-size: 0.92rem; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.byline .dot { opacity: 0.5; }

.hero-figure {
  max-width: 900px;
  margin: 26px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.hero-figure img { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; }

/* Article body */
.post-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px 20px 20px;
  font-size: 1.08rem;
}
.post-body h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.post-body h3 { font-size: 1.18rem; margin: 26px 0 8px; }
.post-body p { color: var(--ink-soft); }
.post-body strong { color: var(--ink); }
.post-body ul, .post-body ol { color: var(--ink-soft); padding-left: 22px; }
.post-body li { margin: 6px 0; }

/* Answer-first key-takeaways box (liftable for AI) */
.tldr {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin: 0 0 30px;
}
.tldr h2 { margin: 0 0 8px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); }
.tldr p { margin: 0; color: var(--ink); }

/* Callout */
.callout {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}
.callout p { margin: 0; color: var(--ink); }
.callout strong { color: var(--ink); }

/* Pull quote */
.pull {
  font-size: 1.35rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink);
  border: none;
  margin: 30px 0;
  padding: 0 0 0 20px;
  border-left: 4px solid var(--accent);
}

/* Inline figure */
.figure { margin: 30px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.figure img { display: block; width: 100%; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.figure:hover img { transform: scale(1.04); }
.figure figcaption { font-size: 0.85rem; color: var(--ink-soft); padding: 8px 14px; background: var(--surface); }

/* Steps / checklist */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding: 8px 0 8px 34px; border-bottom: 1px solid var(--line); }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #17263b; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; }

/* Comparison table */
.tbl-wrap { overflow-x: auto; margin: 24px 0; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
table.data th { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--ink); font-weight: 800; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }

/* FAQ */
.faq { max-width: var(--measure); margin: 10px auto 0; padding: 10px 20px 20px; }
.faq h2 { font-size: 1.5rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 13px 28px 13px 0; position: relative; list-style: none; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▾"; position: absolute; right: 2px; top: 50%; translate: 0 -50%; color: var(--brand); transition: rotate 0.35s cubic-bezier(0.22,1,0.36,1); }
.faq details[open] summary::after { rotate: 180deg; }
.faq details[open] .faq-body { animation: faq-open 0.4s cubic-bezier(0.22,1,0.36,1); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.faq p { color: var(--ink-soft); margin-top: 0; }

/* App CTA (only at the very end of a post) */
.app-cta {
  max-width: var(--measure);
  margin: 30px auto 60px;
  padding: 0 20px;
}
.app-cta-inner {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  padding: 34px 28px 38px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.app-cta-inner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: linear-gradient(120deg, var(--brand), var(--accent), #ff6a88, var(--brand));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: border-flow 7s linear infinite; pointer-events: none;
}
@keyframes border-flow { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }
.app-cta h2 { margin: 0 0 6px; font-size: 1.3rem; }
.app-cta p { margin: 0 0 14px; color: var(--ink-soft); }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-buttons img { height: 46px; width: auto; border-radius: 8px; display: block; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.store-buttons a:hover img { transform: translateY(-3px) scale(1.04); }
.app-cta-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }

/* Related posts */
.related { max-width: 1040px; margin: 0 auto; padding: 20px 20px 60px; }
.related h2 { font-size: 1.4rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}
.rcard:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.rcard img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.rcard .rc-body { padding: 14px 16px; }
.rcard .rc-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); font-weight: 700; }
.rcard h3 { margin: 6px 0 0; font-size: 1.02rem; line-height: 1.35; }

/* Blog index */
.index-hero { text-align: center; padding: 60px 20px 20px; position: relative; overflow: hidden; isolation: isolate; }
.index-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(130deg, color-mix(in srgb, var(--brand) 20%, var(--bg)), color-mix(in srgb, var(--accent) 16%, var(--bg)));
  background-size: 220% 220%; animation: hero-flow 14s ease-in-out infinite alternate;
}
.index-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 10px; }
.index-hero p { color: var(--ink-soft); max-width: 620px; margin: 0 auto; }
.post-grid { max-width: 1060px; margin: 0 auto; padding: 34px 20px 70px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.pcard .pc-img { overflow: hidden; aspect-ratio: 3/2; }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.pcard:hover img { transform: scale(1.06); }
.pcard .pc-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.pcard .pc-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); font-weight: 700; }
.pcard h2 { margin: 6px 0 8px; font-size: 1.12rem; line-height: 1.35; }
.pcard p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.pcard .pc-read { margin-top: auto; padding-top: 12px; color: var(--ink-soft); font-size: 0.82rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); text-align: center; padding: 26px 20px 40px; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer a { color: var(--brand); }

@media (max-width: 820px) {
  .related-grid, .post-grid { grid-template-columns: 1fr; }
  .app-cta-inner { grid-template-columns: 1fr; }
  .app-cta-icon { display: none; }
  .post-hero { padding-top: 44px; }
}
