/* Blackties Rentals — The Journal (blog listing + article pages).
   Loaded AFTER css/style.css; leans on its :root tokens and header/footer styles.
   Everything here is blog-only — style.css is never edited. */

/* ---------- shared: nav active state + focus discipline ---------- */
.main-nav a.active { opacity: 1; color: var(--accent-bright); }

.post-card:focus-visible,
.back-link:focus-visible,
.post-body a:focus-visible,
.blog-state a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}
.back-link:focus-visible, .post-body a:focus-visible, .blog-state a:focus-visible { border-radius: 4px; }
.post-card:focus-visible { border-radius: var(--radius); }

/* ---------- listing hero strip ---------- */
/* The fixed header floats over this; the strip owns the top of the page, so it
   carries the header clearance (74px bar + breathing room) inside its padding. */
.blog-hero {
  padding: 132px 0 4px;
  background:
    radial-gradient(60% 120% at 50% -20%, rgba(159, 67, 254, 0.16), transparent 65%),
    linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 85%);
  border-bottom: 1px solid transparent;
}
.blog-hero h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.3em;
}
.blog-sub { color: var(--muted); max-width: 40rem; font-size: 0.95rem; }

/* ---------- search ---------- */
.blog-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 30rem;
  margin-top: 1.5rem;
}
.blog-search-icon,
.blog-search-clear svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.blog-search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s ease;
}
#postSearch {
  width: 100%;
  padding: 0.78rem 2.6rem 0.78rem 2.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#postSearch::placeholder { color: var(--muted); }
#postSearch:focus {
  outline: none;
  border-color: rgba(139, 95, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(159, 67, 254, 0.16);
}
#postSearch:focus + .blog-search-clear,
.blog-search:focus-within .blog-search-icon { color: var(--accent-bright); }
#postSearch:disabled { opacity: 0.5; cursor: default; }
/* Safari paints its own pill-shaped clear button inside type="search". */
#postSearch::-webkit-search-cancel-button { display: none; }

.blog-search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.blog-search-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.blog-count {
  margin-top: 0.85rem;
  min-height: 1.2em;               /* reserved, so results text never nudges the grid */
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.blog-count b { color: var(--text); font-weight: 600; }

/* ---------- listing grid ---------- */
.blog-list { padding-top: 36px; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.post-card[hidden] { display: none; }

/* Card — same physics as .car-card: ink panel, hairline border, lift on hover. */
.post-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--ink-2) 0%, #0d0c16 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 95, 191, 0.5);
  box-shadow: 0 14px 34px -18px rgba(159, 67, 254, 0.55);
}

.post-media {
  aspect-ratio: 16 / 9;
  background: radial-gradient(120% 130% at 30% 20%, #232330 0%, #14141c 55%, #0d0d13 100%);
  position: relative;
  overflow: hidden;
}
.post-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.post-card:hover .post-media img { transform: scale(1.03); }

/* No cover → a quiet branded panel, monogram set in the header's Poppins voice. */
.post-media-ph { display: flex; align-items: center; justify-content: center; }
.post-media-ph::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%;
  background: linear-gradient(transparent, rgba(139, 95, 191, 0.07));
}
.ph-mono {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.14em;
  color: rgba(183, 138, 240, 0.4);
  text-shadow: 0 0 30px rgba(159, 67, 254, 0.25);
  user-select: none;
}

.post-card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.post-card h3 {
  line-height: 1.35;
  margin-bottom: 0.55rem;
  transition: color 0.2s ease;
}
.post-card:hover h3 { color: var(--accent-bright); }
.post-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- empty / not-found state ---------- */
.blog-state {
  text-align: center;
  padding: 56px 24px 40px;
  max-width: 32rem;
  margin: 0 auto;
}
.state-mono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 95, 191, 0.45);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
  margin-bottom: 1.4rem;
  user-select: none;
}
.blog-state h2 { font-size: 1.5rem; }
.blog-state p { color: var(--muted); margin: 0.4rem 0 1.6rem; }

/* ---------- loading skeletons ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}
.skel::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: skel-sweep 1.5s ease-in-out infinite;
}
@keyframes skel-sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }

.skel-card { pointer-events: none; }
.skel-card .post-media { border-radius: 0; }
.skel-line { height: 0.85rem; margin-bottom: 0.8rem; }
.skel-meta { width: 45%; }
.skel-title { height: 1.15rem; width: 85%; }
.skel-short { width: 60%; }
.skel-h1 { height: 2.2rem; margin-bottom: 1rem; }
.skel-cover { aspect-ratio: 16 / 9; border-radius: var(--radius); margin: 1.6rem 0 2.2rem; }

/* ---------- article page ---------- */
.post-page { padding: 168px 0 96px; }
.post-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2.2rem;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--accent-bright); }
.back-link span { margin-right: 0.35rem; }

.post-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 1.4rem;
}
#postContent .post-meta { margin-bottom: 0.9em; }

.post-cover-wrap { margin: 0.4rem 0 2.4rem; }
/* The cover shows WHOLE, at its own ratio. It used to be forced into a 16/9 box with
   object-fit: cover, which is fine for a photograph and destructive for the infographics
   we actually publish — a checklist with prices on it lost half its width.
   height: auto is load-bearing: build_blog.py writes real width/height attributes on the
   <img> (so the browser reserves the right space and nothing jumps), and those attributes
   arrive as a presentational `height`, which makes the height definite and silently
   defeats any aspect-ratio set here. Letting height follow the width restores the
   image's own proportions whatever gets uploaded. */
.post-cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* ---------- article body typography ---------- */
/* body_html is server-rendered markdown: give it a book-quality reading column. */
.post-body {
  color: #d4d6e0;
  font-size: 1.04rem;
  line-height: 1.8;
}
.post-body > * + * { margin-top: 1.15em; }
.post-body h2, .post-body h3, .post-body h4 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 2em;
}
.post-body h2 { font-size: 1.55rem; }
.post-body h3 { font-size: 1.2rem; }
.post-body h4 { font-size: 1.02rem; color: var(--accent-bright); }
.post-body a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-decoration-color: rgba(183, 138, 240, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.post-body a:hover { text-decoration-color: var(--accent-bright); }
.post-body strong { color: var(--text); }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li { margin-top: 0.45em; }
.post-body li::marker { color: var(--accent); }
.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.4rem;
  font-style: italic;
  color: #d4d6e0;
}
.post-body blockquote cite { display: block; margin-top: 0.8rem; font-style: normal; font-size: 0.85rem; color: var(--muted); }
.post-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}
.post-body pre {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
}
.post-body pre code { background: none; border: 0; padding: 0; font-size: 0.86rem; line-height: 1.6; }
.post-body > :first-child { margin-top: 0; }

/* Comparison tables. Wrapped in their own scroller so a wide table scrolls itself
   rather than pushing the whole page sideways on a phone. */
.post-body table {
  width: 100%; border-collapse: collapse; display: block; overflow-x: auto;
  font-size: 0.94rem;
}
.post-body thead { background: rgba(255, 255, 255, 0.04); }
.post-body th, .post-body td {
  border: 1px solid var(--line); padding: 0.7rem 0.9rem;
  text-align: left; vertical-align: top;
}
.post-body th {
  font-family: "Poppins", sans-serif; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.post-body tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.post-body hr { border: 0; height: 1px; background: var(--line); margin: 2.4rem 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 0.92rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.55rem 0.85rem; text-align: left; }
.post-body th { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.post-end { margin-top: 3.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.post-end .back-link { margin-bottom: 0; }

/* ---------- responsive (mirrors style.css breakpoints) ---------- */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Phones keep two cards per row rather than dropping to one. A single column turns
   thirteen articles into a very long scroll and hides the covers, which are the whole
   reason the cards work; two-up keeps the shelf scannable. Everything inside the card
   steps down to suit roughly a 160px column. */
@media (max-width: 760px) {
  .blog-hero { padding: 104px 0 0; }
  .blog-list { padding-top: 26px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .blog-search { margin-top: 1.15rem; }
  #postSearch { padding: 0.68rem 2.4rem 0.68rem 2.5rem; font-size: 0.9rem; }
  .post-card-body { padding: 0.85rem 0.9rem 1rem; }
  .post-meta { font-size: 0.62rem; letter-spacing: 0.06em; margin-bottom: 0.45rem; }
  .post-card h3 { font-size: 0.94rem; line-height: 1.3; margin-bottom: 0.4rem; }
  .post-excerpt { font-size: 0.8rem; -webkit-line-clamp: 2; }
  .post-page { padding: 118px 0 68px; }
  .post-body { font-size: 1rem; }
}
/* Below this the column is too narrow to carry an excerpt as well as a title, so the
   title gets the room instead of both being squeezed. */
@media (max-width: 520px) {
  .post-grid { gap: 0.7rem; }
  .post-excerpt { display: none; }
  .post-card-body { padding: 0.75rem 0.8rem 0.9rem; }
  .post-card h3 { font-size: 0.88rem; -webkit-line-clamp: 3; display: -webkit-box;
                  -webkit-box-orient: vertical; overflow: hidden; }
  .blog-sub { font-size: 0.9rem; }
}

/* ---------- in-article table search ----------
   Injected by js/blog.js above any article table with 8+ body rows. The input is
   deliberately full-width and obvious: the car-list tables are the reason people
   arrive on those pages, and a filter nobody notices is a filter that doesn't exist. */
.table-search {
  display: flex; align-items: center; gap: 0.8rem;
  margin: 1.2rem 0 0.6rem;
}
.table-search input[type="search"] {
  flex: 1;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.table-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}
.table-search-count {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.table-search-empty {
  color: var(--muted);
  font-style: italic;
  margin: 0.8rem 0;
}

/* Yes/No cells are swapped for a tick or a cross by js/blog.js, which keeps the word in
   aria-label and title so nothing is lost to a screen reader or on hover. Centred and
   sized up, because the whole point is scanning a wide grid at a glance. */
.cell-flag {
  text-align: center;
  font-size: 1.15rem;
  line-height: 1;
}
.cell-yes { color: #34d399; }
.cell-no  { color: #6b7280; }

/* ---------- Uber vehicle explorer ----------
   Mounted by js/blog.js over a [[uber-vehicle-explorer]] marker. Brand-first, the way
   Uber presents its own eligible-vehicle list: pick a make, the models unfold beneath it.
   Models are built only when a brand opens, so 8k+ rows never all sit in the DOM. */
.vx {
  margin: 1.4rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 1rem;
}
.vx-loading { color: var(--muted); margin: 0; font-style: italic; }
.vx-controls { display: flex; gap: 0.8rem; align-items: center; }
.vx-controls input[type="search"] {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.vx-controls input[type="search"]:focus { outline: none; border-color: var(--accent); }
.vx-toggle {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin: 0.75rem 0 0.35rem;
  color: var(--muted); font-size: 0.85rem; line-height: 1.4; cursor: pointer;
}
.vx-toggle input { margin-top: 0.2rem; flex: none; accent-color: var(--accent-deep); }
.vx-count { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.6rem; }

/* Scroll the makes rather than the page: the list is long and the article continues below. */
.vx-list { max-height: 30rem; overflow-y: auto; border-top: 1px solid var(--line); }
.vx-brand { border-bottom: 1px solid var(--line); }
.vx-brand-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: 0;
  padding: 0.7rem 0.4rem;
  color: var(--text); font: inherit; font-size: 0.95rem;
  text-align: left; cursor: pointer;
}
.vx-brand-head:hover { background: var(--accent-soft); }
.vx-brand-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.vx-brand-name { font-weight: 600; }
.vx-brand-name::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.vx-brand-head[aria-expanded="true"] .vx-brand-name::before { transform: rotate(90deg); }
.vx-brand-count { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.vx-panel { padding: 0 0.4rem 0.7rem; }
.vx-panel table { width: 100%; border-collapse: collapse; margin: 0; }
.vx-panel td { padding: 0.4rem 0.3rem; border-top: 1px solid var(--line); vertical-align: top; }
.vx-model { white-space: nowrap; color: var(--text); font-size: 0.9rem; padding-right: 0.8rem; }
.vx-chip {
  display: inline-block;
  margin: 0.1rem 0.25rem 0.1rem 0;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}
/* Selective tiers are the ones a model list actually gates — mark them out from the
   universal UberX/Assist/Pet chips, which nearly every listed vehicle carries. */
.vx-chip-sel {
  color: var(--accent-bright);
  border-color: rgba(183, 138, 240, 0.4);
  background: var(--accent-soft);
}
@media (max-width: 560px) {
  .vx { padding: 0.75rem; }
  .vx-model { white-space: normal; }
}

/* A year raised to the TfL 10-year floor rather than Uber's own (older) figure. Dotted
   underline marks it as annotated, and the chip's title carries Uber's raw number. */
.vx-chip-tfl {
  border-style: dashed;
  text-decoration: underline dotted currentColor 1px;
  text-underline-offset: 2px;
}

/* ---------- registration checker ----------
   Injected by js/blog.js in place of the [[vehicle-check]] marker. It sits directly above
   the model table, so it is deliberately compact: the table is what people came for, and
   this is the shortcut past it, not a competing hero. */
.vc {
  margin: 1.6rem 0 2rem;
  padding: 1.4rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, var(--ink-2) 0%, #0d0c16 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.vc-title { font-size: 1.15rem; margin: 0 0 0.35rem; }
.vc-lede { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }

.vc-form { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
/* Yellow-on-black reads as a UK plate without anyone having to be told what to type. */
.vc-plate {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-family: "Poppins", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: #111;
  background: #f5d000;
  border: 1px solid #c8a900;
  border-radius: 8px;
}
.vc-plate::placeholder { color: rgba(0, 0, 0, 0.38); font-weight: 600; }
.vc-plate:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(159, 67, 254, 0.35);
}
.vc-form button { flex: 0 0 auto; }
.vc-form button[disabled] { opacity: 0.55; cursor: default; }

.vc-out:empty { display: none; }
.vc-out { margin-top: 1.1rem; }
.vc-vehicle { font-weight: 600; margin: 0 0 0.2rem; }
.vc-sub { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.5rem; }
.vc-error { color: #fca5a5; font-size: 0.9rem; margin: 0; }

.vc-list { list-style: none; margin: 0.9rem 0 0.8rem; padding: 0; }
.vc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.8rem;
  padding: 0.6rem 0 0.6rem 0.85rem;
  border-top: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.vc-row:last-child { border-bottom: 1px solid var(--line); }
.vc-name { font-weight: 600; font-size: 0.95rem; }
.vc-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
          text-transform: uppercase; align-self: center; }
.vc-why { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }

.vc-eligible { border-left-color: #4ade80; }
.vc-eligible .vc-tag { color: #86efac; }
.vc-conditional { border-left-color: #fbbf24; }
.vc-conditional .vc-tag { color: #fcd34d; }
.vc-not_eligible { border-left-color: #f87171; }
.vc-not_eligible .vc-tag { color: #fca5a5; }
.vc-unpublished { border-left-color: rgba(255, 255, 255, 0.2); }
.vc-unpublished .vc-tag { color: var(--muted); }

@media (max-width: 560px) {
  .vc { padding: 1.1rem 1rem 1.2rem; }
  .vc-form { gap: 0.55rem; }
  .vc-plate { flex: 1 1 100%; font-size: 1.1rem; }
  .vc-form button { width: 100%; }
}
