/* Shared chrome for /blog/. The app landing page at /apps/rural-shipping/
   inlines its CSS because it is a single entry point. Blog readers move
   between posts, so one cached stylesheet beats re-sending 300 lines each
   time. The .htaccess rule caches .css for a year, so bump the ?v= query on
   the <link> when this file changes. */

:root,
[data-theme='dark'] {
  --background-color: #24292e;
  --color: #edf0f1;
  --card-color: #1f2428;
  --card-text: #edf0f1;
  --border: #333b42;
  --muted: rgba(237, 240, 241, 0.72);
  --code-bg: #1a1e22;
}

[data-theme='light'] {
  --background-color: #ffffff;
  --color: #1f2428;
  --card-color: #f3f3f3;
  --card-text: #1f2428;
  --border: #e3e3e3;
  --muted: rgba(31, 36, 40, 0.74);
  --code-bg: #f0f1f2;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--background-color);
  color: var(--color);
  transition: background-color 0.4s ease, color 0.4s ease;
}

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid #209cee;
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(90%, 1180px); margin: 0 auto; }

/* ── Site header (matches /apps/rural-shipping/) ── */
.site-header { display: flex; justify-content: center; }

.site-header > div {
  width: min(90%, 1180px);
  padding: 30px 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header a {
  font-weight: bold;
  font-size: 17px;
  color: var(--color);
  text-decoration: none;
  transition: color 0.4s ease;
}

.site-header a:hover { color: #209cee; }
.site-header .brand { margin-right: auto; display: flex; align-items: center; }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card-color);
  color: var(--color);
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 10;
}

.skip-link:focus { left: 12px; top: 12px; }

/* ── Post header ── */
.post-head {
  width: min(90%, 46rem);
  margin: 0 auto;
  padding: 30px 0 8px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: #209cee; }

.post-head h1 {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

/* The gradient underline from the home page. `clone` gives every wrapped
   line its own underline instead of one bar across the whole block. */
.post-head h1 .hl {
  display: inline;
  background-image: linear-gradient(120deg, #f093fb 0%, #209cee 100%);
  background-repeat: no-repeat;
  background-size: 100% 0.16em;
  background-position: 0 92%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.post-meta {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

.post-standfirst {
  margin-top: 20px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Prose ── */
/* Capped at 46rem rather than the 1180px used elsewhere on the site. These
   posts run 2,000 words and a full-width measure is unreadable. */
.prose {
  width: min(90%, 46rem);
  margin: 0 auto;
  padding: 20px 0 40px;
  font-size: 1.05rem;
  line-height: 1.72;
}

.prose > * + * { margin-top: 1.15em; }

.prose h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2.2em;
  padding-top: 0.6em;
  border-top: 1px solid var(--border);
}

.prose h3 {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.9em;
}

.prose p { color: var(--color); }

.prose a { color: #209cee; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { text-decoration-thickness: 2px; }

[data-theme='light'] .prose a { color: #136ba6; }

.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--muted); }

.prose strong { font-weight: 700; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.prose blockquote {
  border-left: 3px solid #95bf47;
  padding: 4px 0 4px 18px;
  color: var(--muted);
  font-style: italic;
}

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }

/* ── Tables ── */
/* Rate tables are wide on a phone, so the wrapper scrolls rather than the
   page. Without this the whole body scrolls sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.prose table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.94rem;
}

.prose th, .prose td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.prose th {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Callouts ── */
.note {
  background: var(--card-color);
  border-radius: 14px;
  border-left: 3px solid #209cee;
  padding: 18px 20px;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--muted);
  transition: background-color 0.4s ease;
}

.note.disclosure { border-left-color: #95bf47; }
.note p + p { margin-top: 0.8em; }
.note strong { color: var(--card-text); }

/* ── Figure / caption ── */
.prose figure { margin: 0; }

.prose figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* ── Post CTA ── */
.post-cta {
  width: min(90%, 46rem);
  margin: 0 auto 20px;
  background: var(--card-color);
  border-radius: 20px;
  border-top: 3px solid #95bf47;
  padding: 28px 26px;
  transition: background-color 0.4s ease;
}

.post-cta h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }

.post-cta p {
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--muted);
  max-width: 34rem;
}

.post-cta .cta-row { margin-top: 20px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.cta-btn, .cta-ghost {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.cta-btn {
  background: #95bf47;
  color: #1a2e1a;
  border: 1.6px solid #95bf47;
}

.cta-btn:hover { background: #82a83d; border-color: #82a83d; }

.cta-ghost { color: var(--color); border: 1.6px solid var(--color); }
.cta-ghost:hover { color: #209cee; border-color: #209cee; }

.pricing-note { margin-top: 14px; font-size: 0.86rem; color: var(--muted); }

/* ── Related posts ── */
.related {
  width: min(90%, 46rem);
  margin: 0 auto;
  padding: 30px 0 50px;
}

.related h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.related ul { list-style: none; display: grid; gap: 12px; }

.related a {
  display: block;
  background: var(--card-color);
  border-radius: 14px;
  border-left: 3px solid transparent;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--card-text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.45;
  transition: background-color 0.4s ease, border-color 0.25s ease;
}

.related a:hover { border-left-color: #95bf47; }
.related a span { display: block; font-weight: 400; font-size: 0.9rem; color: var(--muted); margin-top: 5px; }

/* ── Blog index ── */
.index-head {
  width: min(90%, 46rem);
  margin: 0 auto;
  padding: 40px 0 10px;
}

.index-head h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.index-head p {
  margin-top: 20px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted);
}

.post-list {
  width: min(90%, 46rem);
  margin: 0 auto;
  padding: 30px 0 50px;
  list-style: none;
  display: grid;
  gap: 18px;
}

.post-list li {
  background: var(--card-color);
  border-radius: 20px;
  border-top: 3px solid #95bf47;
  padding: 24px 24px 26px;
  transition: background-color 0.4s ease, transform 0.3s ease;
}

.post-list li:hover { transform: translateY(-3px); }

.post-list h2 { font-size: 1.24rem; font-weight: 700; line-height: 1.32; }

.post-list h2 a { color: var(--card-text); text-decoration: none; }
.post-list h2 a:hover { color: #209cee; }

.post-list .kicker {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.post-list p { margin-top: 10px; font-size: 0.96rem; line-height: 1.6; color: var(--muted); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 44px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  transition: border-color 0.4s ease;
}

footer a { color: var(--color); text-decoration: none; }
footer a:hover { color: #209cee; }

@media (max-width: 48rem) {
  .post-head h1 { font-size: 1.8rem; }
  .index-head h1 { font-size: 1.9rem; }
  .prose { font-size: 1.02rem; }
  .prose h2 { font-size: 1.38rem; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-btn, .cta-ghost { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .post-list li:hover { transform: none; }
}
