/*
 * Overrides for the scoped Bootstrap 4 stylesheet loaded on CMS pages.
 *
 * The CMS body HTML was authored against the legacy BlueAirportTransfer
 * theme which remaps Bootstrap's --primary and adds custom utility classes.
 * The scoped Bootstrap ships with the default #007bff, so we patch the
 * variables and restore browser defaults that Tailwind's preflight strips.
 */

.cms-bootstrap-scope {
  /*
   * Derive from the brand design tokens (`@theme` in src/styles/global.css,
   * overridden per domain by the `html:root` block in Layout.astro) rather than
   * hardcoding the old BlueAirportTransfer navy. This card was #182c66 while
   * the shell around it rendered the brand's own #050368; on FlickTransfer and
   * BritishRide the mismatch was navy-on-green. Fallbacks keep the card sane if
   * this file is ever loaded without the token stylesheet.
   */
  --primary: var(--color-primary, #050368);
  --primary-text: var(--color-ink-inverse, #ffffff);
  /* No brand token for the legacy red the CMS body uses for urgency CTAs. */
  --secondary: #f50a16;
  --secondary-text: #ffffff;
  --tertiary: var(--color-accent, #ffd107);
  --tertiary-text: var(--color-ink, #000000);
  --body-color: var(--color-ink, #585858);
  --body-bg: var(--color-surface, #fafbfe);
  --cms-line: var(--color-line, #e5dfcd);
  --cms-muted: var(--color-ink-muted, #5e6b62);
  --cms-surface-alt: var(--color-surface-alt, #f2eee1);
  font-family: var(--font-sans, 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  /*
   * Bootstrap's reboot paints this wrapper white (#fff), so it reads as a
   * content card on the ivory page. Without inner padding the CMS body text
   * and card grids sit flush against the card edges. Inset them with
   * responsive padding (floor 20px > Bootstrap's 15px row gutter, so the
   * `.row` negative margins stay inside the card and columns line up with
   * the body paragraphs) and round the corners so it reads as a real card.
   */
  padding: clamp(1.5rem, 4vw, 2.75rem);
  /* Brand radius + the shell's own shadow tokens, which re-tint per domain via
     color-mix. The literals here were FlickTransfer's green (11, 59, 44). */
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  border: 1px solid var(--cms-line);
}

/* ── Tailwind de-reset ────────────────────────────────────────
 * Tailwind's preflight strips margins, list bullets, link colors,
 * and heading weights. Bootstrap 4 expects browser defaults.
 * ───────────────────────────────────────────────────────────── */
.cms-bootstrap-scope h1,
.cms-bootstrap-scope h2,
.cms-bootstrap-scope h3,
.cms-bootstrap-scope h4,
.cms-bootstrap-scope h5,
.cms-bootstrap-scope h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  /* Bootstrap's 500 reads limp beside the shell's bold hero/FAQ headings. */
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-ink, #1a241e);
}
/* Space headings away from the paragraph above so sections separate visually. */
.cms-bootstrap-scope :is(h2, h3, h4):not(:first-child) {
  margin-top: 2rem;
}
/* A short accent rule under h2s gives the long body copy scannable landmarks. */
.cms-bootstrap-scope h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.cms-bootstrap-scope h1, .cms-bootstrap-scope .h1 { font-size: 2rem; }
.cms-bootstrap-scope h2, .cms-bootstrap-scope .h2 { font-size: 1.6rem; }
.cms-bootstrap-scope h3, .cms-bootstrap-scope .h3 { font-size: 1.4rem; }
.cms-bootstrap-scope h4, .cms-bootstrap-scope .h4 { font-size: 1.25rem; }
.cms-bootstrap-scope h5, .cms-bootstrap-scope .h5 { font-size: 1.1rem; }
.cms-bootstrap-scope h6, .cms-bootstrap-scope .h6 { font-size: 1rem; }
.cms-bootstrap-scope p {
  margin-top: 0;
  margin-bottom: 1.1rem;
  line-height: 1.7;
}
/* Bootstrap's default #007bff is off-brand; underline body links for scanning
   but leave buttons and the icon/checkmark blocks alone (handled below). */
.cms-bootstrap-scope a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.cms-bootstrap-scope a:hover {
  color: var(--color-accent-dark, #b5832c);
  text-decoration-color: currentColor;
}
.cms-bootstrap-scope ul, .cms-bootstrap-scope ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}
.cms-bootstrap-scope ul { list-style: disc; }
.cms-bootstrap-scope ol { list-style: decimal; }
.cms-bootstrap-scope li { display: list-item; }
.cms-bootstrap-scope hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.cms-bootstrap-scope strong { font-weight: 700; }
.cms-bootstrap-scope img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-style: none;
}
.cms-bootstrap-scope label { display: inline-block; margin-bottom: 0.5rem; }
.cms-bootstrap-scope button, .cms-bootstrap-scope input,
.cms-bootstrap-scope select, .cms-bootstrap-scope textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* ── Background overrides ─────────────────────────────────── */
.cms-bootstrap-scope .bg-primary {
  background-color: var(--primary) !important;
}
.cms-bootstrap-scope .bg-tertiary {
  background-color: var(--tertiary) !important;
}

/* ── Text overrides ───────────────────────────────────────── */
.cms-bootstrap-scope .text-primary {
  color: var(--primary) !important;
}
.cms-bootstrap-scope .text-primary-text {
  color: var(--primary-text) !important;
}
.cms-bootstrap-scope .text-secondary-text {
  color: var(--secondary-text) !important;
}
.cms-bootstrap-scope .text-tertiary {
  color: var(--tertiary) !important;
}
.cms-bootstrap-scope .text-dark2 {
  color: #343a40b3 !important;
}

/* ── Button overrides ─────────────────────────────────────── */
.cms-bootstrap-scope .btn {
  text-decoration: none;
}
.cms-bootstrap-scope .btn:hover {
  text-decoration: none;
}
.cms-bootstrap-scope a.btn {
  text-decoration: none;
}
.cms-bootstrap-scope .btn-primary {
  color: var(--primary-text);
  background-color: var(--primary);
  border-color: var(--primary);
}
.cms-bootstrap-scope .btn-primary:hover {
  color: var(--primary-text);
  background-color: #0f1e47;
  border-color: #0f1e47;
}
.cms-bootstrap-scope .btn-secondary {
  color: var(--secondary-text);
  background-color: var(--secondary);
  border-color: var(--secondary);
}
.cms-bootstrap-scope .btn-secondary:hover {
  color: #fff;
  background-color: #c30812;
  border-color: #c30812;
}
.cms-bootstrap-scope .btn-tertiary {
  color: var(--tertiary-text);
  background-color: var(--tertiary);
  border-color: var(--tertiary);
}

/* ── Badge overrides ──────────────────────────────────────── */
.cms-bootstrap-scope .badge-primary {
  color: var(--primary-text);
  background-color: var(--primary);
}

/* ── Responsive container fix ─────────────────────────────────
 * The scoped Bootstrap ships a patched `.container { min-width: 992px }`
 * which forces the CMS body to 992px on every viewport, overflowing the
 * screen on phones/tablets so the text runs to (and past) the edges.
 * Restore Bootstrap 4's responsive container: full-width with 15px
 * gutters, capped per breakpoint so it never exceeds the page shell.
 * ───────────────────────────────────────────────────────────── */
.cms-bootstrap-scope .container {
  min-width: 0 !important;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 576px) {
  .cms-bootstrap-scope .container { max-width: 540px; }
}
@media (min-width: 768px) {
  .cms-bootstrap-scope .container { max-width: 720px; }
}
@media (min-width: 992px) {
  .cms-bootstrap-scope .container { max-width: 960px; }
}
@media (min-width: 1200px) {
  .cms-bootstrap-scope .container { max-width: 1140px; }
}

/* ── Width utilities (legacy) ─────────────────────────────── */
.cms-bootstrap-scope .w-20 { width: 20% !important; }
.cms-bootstrap-scope .w-30 { width: 30% !important; }

/* ── Card enhancements ────────────────────────────────────── */
.cms-bootstrap-scope .rounded-3 {
  border-radius: 0.75rem !important;
}
.cms-bootstrap-scope .card {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── CTA sections from CMS content ────────────────────────── */
.cms-bootstrap-scope .updated_cta_get_instant_quote .bg-primary {
  background-color: var(--primary) !important;
}
.cms-bootstrap-scope .updated_cta_get_instant_quote .btn-light {
  color: var(--primary);
  font-weight: 700;
}

/* ── Booking steps / info cards ───────────────────────────── */
.cms-bootstrap-scope .book_for_london_airport_transfer_today {
  background-color: var(--primary);
}
.cms-bootstrap-scope .book-in-advance-container {
  background-color: var(--primary);
}

/* ── Review carousel ──────────────────────────────────────── */
.cms-bootstrap-scope .car-card {
  padding: 1rem;
}
.cms-bootstrap-scope .fleet-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.cms-bootstrap-scope .fee-inclusion {
  font-weight: 600;
  color: var(--primary);
}
.cms-bootstrap-scope .fixed-height-container {
  max-height: 110px;
  min-height: 110px;
  max-width: 550px;
  padding: 10px;
  overflow: hidden;
}

/* ── Carousel control visibility (dark controls on white bg) ─ */
.cms-bootstrap-scope .carousel-control-prev-icon,
.cms-bootstrap-scope .carousel-control-next-icon {
  filter: invert(1) grayscale(100);
}

/* ── Contact page ─────────────────────────────────────────── */
.cms-bootstrap-scope .contact_list li {
  margin-bottom: 0.5rem;
}
.cms-bootstrap-scope .li {
  list-style: none;
  padding-left: 0;
}
.cms-bootstrap-scope .li li {
  margin-bottom: 0.5rem;
}
.cms-bootstrap-scope .phone_icon {
  margin-right: 0.25rem;
}
.cms-bootstrap-scope .contact-form .form-control {
  width: 100%;
}
.cms-bootstrap-scope .info-column,
.cms-bootstrap-scope .form-column {
  padding: 0 15px;
}
.cms-bootstrap-scope .inner-column {
  padding: 0;
}

/* ── {call_to_action} buttons ─────────────────────────────────
 * The CMS expands {call_to_action} into
 *   <div class="text-center text-white"><a class="stylish-button call">…
 * (Call / WhatsApp / Get Quote), and route pages also get a single
 * "Book … from X to Y" `.stylish-button.get-quote`. Styled to match the
 * shell's <Button> (pill, semibold, brand tokens) instead of the legacy
 * hardcoded greens/navy. Selectors are `a.stylish-button` so they outrank
 * the underlined body-link rules above (`.cms-bootstrap-scope a:hover`
 * otherwise turned the label gold on hover). */
.cms-bootstrap-scope div:has(> .stylish-button) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0;
  font-size: 0; /* swallow the whitespace text nodes between the links */
}
/* A group of buttons (the real {call_to_action}) reads as one panel. */
.cms-bootstrap-scope div:has(> .stylish-button + .stylish-button) {
  padding: 1.25rem;
  background: var(--cms-surface-alt);
  border: 1px solid var(--cms-line);
  border-radius: var(--radius-lg, 18px);
}
.cms-bootstrap-scope a.stylish-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  margin: 0;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-pill, 999px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.cms-bootstrap-scope a.stylish-button i {
  margin: 0;
  font-size: 1.05em;
}
.cms-bootstrap-scope a.stylish-button:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cms-bootstrap-scope a.stylish-button:active {
  transform: none;
}
.cms-bootstrap-scope a.stylish-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 45%, transparent);
}
.cms-bootstrap-scope a.stylish-button.call,
.cms-bootstrap-scope a.stylish-button.call:hover {
  color: var(--color-ink-inverse, #fff);
}
.cms-bootstrap-scope a.stylish-button.call {
  background-color: var(--color-primary);
}
.cms-bootstrap-scope a.stylish-button.call:hover {
  background-color: var(--color-primary-light);
}
.cms-bootstrap-scope a.stylish-button.whatsapp,
.cms-bootstrap-scope a.stylish-button.whatsapp:hover {
  color: #fff;
}
.cms-bootstrap-scope a.stylish-button.whatsapp {
  background-color: #117f40; /* WhatsApp green, darkened to 5:1 against the white label */
}
.cms-bootstrap-scope a.stylish-button.whatsapp:hover {
  background-color: #0d6b35;
}
/* Get Quote is the primary action, so it takes the accent like the hero CTA. */
.cms-bootstrap-scope a.stylish-button.get-quote,
.cms-bootstrap-scope a.stylish-button.get-quote:hover {
  color: var(--color-primary-dark);
}
.cms-bootstrap-scope a.stylish-button.get-quote {
  background-color: var(--color-accent);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--color-accent-dark) 70%, transparent);
}
.cms-bootstrap-scope a.stylish-button.get-quote:hover {
  background-color: var(--color-accent-dark);
  color: var(--color-ink-inverse, #fff);
}
@media (max-width: 575.98px) {
  /* Stack full-width on phones instead of a ragged 2 + 1 wrap. */
  .cms-bootstrap-scope div:has(> .stylish-button) {
    flex-direction: column;
    align-items: stretch;
  }
  .cms-bootstrap-scope div:has(> .stylish-button + .stylish-button) {
    padding: 1rem;
  }
}

/* ── Misc legacy utilities ────────────────────────────────── */
.cms-bootstrap-scope .sm-link {
  font-size: 0.85rem;
}
.cms-bootstrap-scope .rbtn {
  border-radius: 0.25rem;
  font-weight: 700;
}
.cms-bootstrap-scope .text-bold,
.cms-bootstrap-scope .font-weight-bold {
  font-weight: 700 !important;
}
.cms-bootstrap-scope .exo {
  font-family: "Exo", sans-serif;
}
.cms-bootstrap-scope .border-animated4 {
  border-bottom: 4px solid var(--primary);
}
.cms-bootstrap-scope .footer-attr-title {
  font-size: 1.2rem;
  font-weight: 600 !important;
}
.cms-bootstrap-scope .listings {
  color: blue !important;
  font-weight: 700;
}
.cms-bootstrap-scope .listings a {
  color: blue;
}

/* ── Section reset (prevent Tailwind margin on <section>) ─── */
.cms-bootstrap-scope section {
  margin: 0;
  padding: 0;
}

/* ── Divider from inline styles in CMS content ────────────── */
.cms-bootstrap-scope div[style*="height: 1px"] {
  border: 0;
  height: 1px;
  /* A full-strength primary rule reads as a heavy bar at 1px; tint it so it
     separates sections without competing with the h2 underlines. */
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  margin: 2rem 0;
}

/* ── Plain tables ──────────────────────────────────────────────
 * Tables pasted into the editor (from ChatGPT, Word, Docs...) arrive with
 * no class or inline style, and Tailwind's preflight strips table borders
 * and cell padding, so they rendered as unruled columns of text. Style only
 * those: Bootstrap `.table`s and the inline-styled route tables keep their
 * own look. Pasted wrappers (ChatGPT's `w-fit` flex box) are reset so the
 * table can use the full width, and scroll sideways if it can't fit.
 * ───────────────────────────────────────────────────────────── */
.cms-bootstrap-scope div:has(> table:not(.table):not([style])) {
  display: block;
  width: auto;
  max-width: 100%;
  overflow-x: auto;
}
.cms-bootstrap-scope table:not(.table):not([style]) {
  width: 100%;
  min-width: 0;
  margin: 1.25rem 0 1.75rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--cms-line);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--body-color);
}
.cms-bootstrap-scope table:not(.table):not([style]) :is(th, td) {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--cms-line);
  overflow-wrap: break-word;
}
.cms-bootstrap-scope table:not(.table):not([style]) th {
  font-weight: 600;
  color: var(--color-ink, #111827);
}
.cms-bootstrap-scope table:not(.table):not([style]) thead th {
  background: var(--primary);
  color: var(--primary-text);
  border-bottom: 0;
}
.cms-bootstrap-scope table:not(.table):not([style]) tbody tr:nth-child(even) > * {
  background: color-mix(in srgb, var(--cms-surface-alt) 55%, #fff);
}
.cms-bootstrap-scope table:not(.table):not([style]) tbody tr:last-child > * {
  border-bottom: 0;
}
@media (max-width: 575px) {
  .cms-bootstrap-scope table:not(.table):not([style]) :is(th, td) {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* ── Legacy icon wrappers ──────────────────────────────────────
 * The CMS body marks icons up as `<img class="w-100">` inside wrappers the
 * legacy theme sized -- `.icon-container` (284 pages) and
 * `.checkmark-container` (662) -- neither of which was ported here. With no
 * width on the wrapper, Bootstrap's `.w-100 { width: 100% !important }`
 * resolves against the column instead, so feature icons rendered ~300px wide
 * and inline checkmarks as wide as the card.
 *
 * Size the wrappers rather than overriding `.w-100`: CMS bodies also use it
 * on `.row` (`<div class="row w-100 bodysection">`), where 100% is correct.
 * `.icon-container` can therefore stay `!important`-free, since the image at
 * 100% of a 64px box is 64px. The inline checkmark sits beside its label, so
 * that one has to be sized on the image itself and needs `!important` to
 * outrank Bootstrap's own.
 * ───────────────────────────────────────────────────────────── */
/*
 * The icon tile mirrors the shell's TrustBar treatment (a tinted rounded square
 * behind the glyph) so the CMS feature grid and the Tailwind trust row read as
 * the same design. Bootstrap sets `box-sizing: border-box`, so the 64px box
 * less its padding leaves the image at 40px.
 */
.cms-bootstrap-scope .icon-container {
  width: 64px;
  height: 64px;
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 12px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md, 12px);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  line-height: 0;
}

/* Feature blocks become real cards, so the 3-up grid has structure instead of
   floating text. `height: 100%` keeps the three columns even when the copy
   wraps to different line counts. */
.cms-bootstrap-scope .service-feature {
  height: 100%;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.25rem;
  background: #fff;
  border: 1px solid var(--cms-line);
  border-radius: var(--radius-md, 12px);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.cms-bootstrap-scope .service-feature:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  box-shadow: var(--shadow-md);
}
@media (prefers-reduced-motion: reduce) {
  .cms-bootstrap-scope .service-feature {
    transition: none;
  }
  .cms-bootstrap-scope .service-feature:hover {
    transform: none;
  }
}
.cms-bootstrap-scope .service-feature h5 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}
.cms-bootstrap-scope .service-feature p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--cms-muted);
}

/* Inline checkmark rows become chips, so a row of them reads as a set of
   guarantees rather than loose text. The label carries Bootstrap's `.ml-2`,
   so no `gap` here -- that would double-space it. */
.cms-bootstrap-scope .checkmark-container {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem 0.45rem 0.65rem;
  background: var(--cms-surface-alt);
  border: 1px solid var(--cms-line);
  border-radius: var(--radius-pill, 999px);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.cms-bootstrap-scope .checkmark-container > img {
  width: 1.25rem !important;
  height: auto;
  flex: 0 0 auto;
}
/* The chips sit in `.col-md-3.review-tab` columns; even out their vertical
   rhythm when the row wraps on tablet and phone. */
.cms-bootstrap-scope .review-tab {
  margin-bottom: 0.75rem;
}
