/*
 * Car rental guide — presentation layer.
 *
 * /tailwind.min.css is a prebuilt, purged file rather than a JIT build, so any
 * utility the guides do not already use is absent from it. Verified missing at
 * the time of writing: md:text-4xl, lg:text-5xl, bg-orange-700,
 * hover:bg-orange-800, h-14, no-underline, lg:grid, lg:block, top-24,
 * overflow-y-auto, max-h-full. Everything that depends on those lives here
 * instead, under cr- prefixed class names.
 *
 * Applies to: /alquiler-coche-gran-canaria, /en/car-rental-gran-canaria,
 * /de/mietwagen-fuehrer-kanaren, /it/noleggio-auto-gran-canaria
 */

/* ------------------------------------------------------------------ *
 * P0.1 — opt out of browser force-dark
 *
 * There is no dark palette authored for this page. Without the opt-out
 * Chrome and Edge invert it at paint time: white cards go near-black, the
 * shadow separation disappears and the tinted callouts turn muddy.
 * ------------------------------------------------------------------ */
:root {
  color-scheme: light;
}

/* ------------------------------------------------------------------ *
 * P0.3 — anchor targets clear the 76px sticky bar
 * ------------------------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

:target,
section[id],
h2[id],
h3[id] {
  scroll-margin-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ------------------------------------------------------------------ *
 * P1.4 — measure and vertical rhythm
 *
 * Section cards run to 864px; at 16px that is ~95-100 characters per line.
 * Montserrat is a wide face and needs more leading than the default.
 * ------------------------------------------------------------------ */
section p,
section li {
  max-width: 42rem;
}

section p {
  font-size: 1rem;
  line-height: 1.7;
}

section li {
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Tables and grids inside cards should still use the full card width. */
table p,
table li,
.grid p,
.grid li {
  max-width: none;
}

.cr-h1 {
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .cr-h1 {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .cr-h1 {
    font-size: 3rem;
  }
}

/* ------------------------------------------------------------------ *
 * P1.5 — icon system replacing inline emoji
 * ------------------------------------------------------------------ */
.cr-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cr-heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cr-heading .cr-icon {
  width: 1.1em;
  height: 1.1em;
  color: #c2410c; /* orange-700 — 5.15:1 on white */
}

/* Semantic colours for list markers. Each clears 4.5:1 on white. */
.cr-ok {
  color: #047857;
} /* emerald-700  5.30:1 */
.cr-no {
  color: #b91c1c;
} /* red-700      6.24:1 */
.cr-warn {
  color: #b45309;
} /* amber-700    4.76:1 */

/* Icon-led list items: hang the icon rather than indenting the text. */
.cr-list {
  list-style: none;
  padding-left: 0;
}

.cr-list > li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.cr-list > li > .cr-icon {
  margin-top: 0.28em;
}

/* ------------------------------------------------------------------ *
 * P1.6 — sticky sidebar table of contents
 * ------------------------------------------------------------------ */
.cr-toc-rail {
  display: none;
}

@media (min-width: 1024px) {
  .cr-layout {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 2.5rem;
    /* No align-items: start. The aside must stretch to the full row height,
       otherwise it collapses to its own content and the sticky nav inside it
       scrolls away after a few hundred pixels. */
  }

  .cr-toc-rail {
    display: block;
  }
}

.cr-toc-sticky {
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.cr-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563; /* gray-600 */
  margin-bottom: 0.75rem;
}

.cr-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cr-toc-list a {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #374151; /* gray-700 */
  text-decoration: none;
  border-left: 2px solid #e5e7eb;
}

.cr-toc-list a:hover,
.cr-toc-list a:focus-visible {
  color: #c2410c;
  border-left-color: #fdba74;
  background: #fff7ed;
}

.cr-toc-list a[aria-current="location"] {
  color: #c2410c;
  font-weight: 600;
  border-left-color: #c2410c;
  background: #fff7ed;
}

/* Inline TOC below lg: keep it, but drop the blanket underline. */
.cr-toc-inline a {
  text-decoration: none;
  display: inline-block;
  padding: 0.125rem 0;
}

.cr-toc-inline a:hover,
.cr-toc-inline a:focus-visible {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .cr-toc-inline {
    display: none;
  }
}

/* ------------------------------------------------------------------ *
 * P1.7 — provider cards
 * ------------------------------------------------------------------ */
.cr-provider {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.cr-provider:hover {
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Anchored to the card's top edge so the badge reads as part of the card. */
.cr-badge {
  position: absolute;
  top: -0.75rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #c2410c;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
}

.cr-badge--alt {
  background: #1d4ed8;
} /* blue-700  5.17:1 */
.cr-badge--eco {
  background: #047857;
} /* emerald-700 */

.cr-provider-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* A tinted plate behind the logo, so transparent-to-white marks do not
   punch a bare white rectangle out of the card. */
.cr-logo-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 6rem;
  height: 3.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
}

.cr-logo-plate img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

/* ------------------------------------------------------------------ *
 * Buttons and links — orange-600 on white is 3.56:1 and fails.
 * orange-700 (#c2410c) measures 5.15:1.
 * ------------------------------------------------------------------ */
.cr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  background: #c2410c;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s;
}

.cr-btn:hover {
  background: #9a3412; /* orange-800 */
  color: #fff;
  text-decoration: none;
}

.cr-link {
  color: #c2410c;
}

.cr-link:hover {
  color: #9a3412;
}

/* White on bg-green-600 (#16a34a) is 3.3:1 and fails. green-700 is 4.54:1.
   Scoped to anchors so the utility keeps its meaning elsewhere. */
a.bg-green-600 {
  background-color: #15803d;
}

a.bg-green-600:hover {
  background-color: #166534;
}

/* Preflight is disabled, so anchors without a colour class fall back to the
   UA blue. In the dark footer that reads as unstyled default-blue text. */
footer a {
  color: inherit;
}

footer a:hover {
  color: #fff;
}

/* text-orange-600 (#ea580c) on white is 3.56:1 and fails; orange-700 is
   5.15:1. Page-scoped, so the utility keeps its value elsewhere. */
.text-orange-600 {
  color: #c2410c;
}

.hover\:text-orange-800:hover {
  color: #7c2d12;
}

/* text-yellow-600 (#ca8a04) is 3.1:1 on white; amber-700 (#b45309) is 4.76:1.
   text-red-600 (#dc2626) is 4.0:1 on white and fails; red-700 is 6.24:1.
   text-gray-500 on the dark footer is 3.0:1; gray-400 clears it. */
.text-red-600 {
  color: #b91c1c;
}

.text-yellow-600 {
  color: #b45309;
}

footer .text-gray-500 {
  color: #9ca3af;
}

/* Visible focus for every interactive element. */
a:focus-visible,
.cr-toc-list a:focus-visible,
.cr-skip:focus-visible,
.cr-lang a:focus-visible,
nav a:focus-visible {
  outline: 2px solid #c2410c;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ------------------------------------------------------------------ *
 * P2.10 — chrome, skip link, language switcher, breadcrumb
 * ------------------------------------------------------------------ */
.cr-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
}

.cr-skip:focus {
  left: 0.5rem;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #c2410c;
  font-weight: 600;
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
}

.cr-siteheader {
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}

.cr-siteheader-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
}

.cr-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: #1f2937;
  text-decoration: none;
}

.cr-brand:hover {
  color: #c2410c;
}

.cr-sitenav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.cr-sitenav a {
  color: #374151;
  text-decoration: none;
}

.cr-sitenav a:hover {
  color: #c2410c;
  text-decoration: underline;
}

.cr-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.cr-lang a,
.cr-lang [aria-current="true"] {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.cr-lang a {
  background: #f3f4f6;
  color: #374151;
}

.cr-lang a:hover {
  background: #e5e7eb;
}

.cr-lang [aria-current="true"] {
  background: #fff7ed;
  color: #9a3412;
  border-color: #c2410c;
  font-weight: 600;
}

/* gray-400 separators measure 2.54:1; gray-500 is 4.83:1. */
.cr-crumb-sep {
  color: #6b7280;
}

/* ================================================================== *
 * Dark palette (spec P0.1, the real fix)
 *
 * The pages are built from Tailwind utilities that hard-code a light
 * palette, so the utilities themselves are re-pointed here rather than
 * left to the browser's force-dark guess. Surfaces, text and every
 * tinted callout are re-derived deliberately; the callout tints sit at
 * roughly 12% alpha over the card surface instead of being inverted.
 *
 * This stylesheet is loaded only by the four car rental guides, so
 * overriding utility class names here cannot affect the rest of the site.
 * ================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --cr-page: #0f1115;
    --cr-card: #181b21;
    --cr-raised: #1f232b;
    --cr-text: #e5e7eb;
    --cr-text-dim: #b6bcc7;
    --cr-text-faint: #949cab;
    --cr-line: #2b303a;
    --cr-accent: #fb923c; /* orange-400 — 8.1:1 on the card surface */
  }

  body.bg-gray-50 {
    background-color: var(--cr-page);
  }

  body.text-gray-900,
  .text-gray-900 {
    color: var(--cr-text);
  }

  /* Surfaces ----------------------------------------------------- */
  .bg-white,
  .cr-provider,
  nav.sticky-nav,
  .cr-siteheader {
    background-color: var(--cr-card);
  }

  .bg-gray-50,
  .cr-logo-plate {
    background-color: var(--cr-raised);
  }

  .bg-gray-800 {
    background-color: #12151a;
  }

  .shadow-md,
  .shadow-lg {
    box-shadow: none;
  }

  /* Cards need a visible edge once the shadow separation is gone. */
  .bg-white,
  .cr-provider {
    border: 1px solid var(--cr-line);
  }

  .border-gray-200,
  .border-gray-400,
  .border-gray-700,
  .cr-logo-plate,
  nav.sticky-nav,
  .cr-siteheader {
    border-color: var(--cr-line);
  }

  /* Text --------------------------------------------------------- */
  .text-gray-800,
  .text-gray-700 {
    color: var(--cr-text);
  }

  .text-gray-600,
  .text-gray-500,
  .text-gray-400,
  .text-gray-300 {
    color: var(--cr-text-dim);
  }

  .cr-toc-title {
    color: var(--cr-text-faint);
  }

  .cr-brand {
    color: var(--cr-text);
  }

  .cr-sitenav a {
    color: var(--cr-text-dim);
  }

  .cr-crumb-sep {
    color: var(--cr-text-faint);
  }

  a.bg-green-600 {
    background-color: #166534;
  }

  footer a:hover {
    color: var(--cr-accent);
  }

  /* Accent ------------------------------------------------------- */
  .text-orange-600,
  .text-orange-700,
  .text-orange-800,
  .cr-link,
  .cr-heading .cr-icon,
  .cr-toc-list a[aria-current="location"],
  .cr-brand:hover,
  .cr-sitenav a:hover {
    color: var(--cr-accent);
  }

  .cr-btn,
  .cr-badge {
    background: #9a3412;
    color: #fff;
  }

  .cr-btn:hover {
    background: #7c2d12;
  }

  .cr-badge--alt {
    background: #1e40af;
  }
  .cr-badge--eco {
    background: #065f46;
  }

  .cr-toc-list a {
    color: var(--cr-text-dim);
    border-left-color: var(--cr-line);
  }

  .cr-toc-list a:hover,
  .cr-toc-list a:focus-visible,
  .cr-toc-list a[aria-current="location"] {
    background: rgba(251, 146, 60, 0.12);
    border-left-color: var(--cr-accent);
  }

  a:focus-visible,
  .cr-skip:focus-visible {
    outline-color: var(--cr-accent);
  }

  .cr-skip:focus {
    background: var(--cr-raised);
    color: var(--cr-accent);
  }

  .cr-lang a {
    background: var(--cr-raised);
    color: var(--cr-text-dim);
  }

  .cr-lang a:hover {
    background: #2a2f38;
  }

  .cr-lang [aria-current="true"] {
    background: rgba(251, 146, 60, 0.14);
    color: var(--cr-accent);
    border-color: var(--cr-accent);
  }

  /* Tinted callouts — 12% alpha over the card, not an inversion ---- */
  .bg-green-50,
  .bg-green-100 {
    background-color: rgba(16, 185, 129, 0.12);
  }
  .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.12);
  }
  .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.12);
  }
  .bg-amber-50,
  .bg-amber-100,
  .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.12);
  }
  .bg-purple-50,
  .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.12);
  }
  .bg-orange-50,
  .bg-orange-100 {
    background-color: rgba(251, 146, 60, 0.12);
  }

  .border-green-200,
  .border-green-400,
  .border-green-500 {
    border-color: rgba(16, 185, 129, 0.45);
  }
  .border-blue-200,
  .border-blue-400,
  .border-blue-500 {
    border-color: rgba(59, 130, 246, 0.45);
  }
  .border-red-200,
  .border-red-400,
  .border-red-500 {
    border-color: rgba(239, 68, 68, 0.45);
  }
  .border-amber-200,
  .border-yellow-200,
  .border-yellow-400,
  .border-yellow-500 {
    border-color: rgba(245, 158, 11, 0.45);
  }
  .border-purple-200,
  .border-purple-500 {
    border-color: rgba(168, 85, 247, 0.45);
  }
  .border-orange-200,
  .border-orange-500 {
    border-color: rgba(251, 146, 60, 0.45);
  }

  /* Callout text, lightened to clear 4.5:1 on the tinted surfaces. */
  .text-green-700,
  .text-green-800,
  .text-green-400,
  .cr-ok {
    color: #6ee7b7;
  }
  .text-blue-700,
  .text-blue-800,
  .text-blue-400 {
    color: #93c5fd;
  }
  .text-red-600,
  .text-red-700,
  .text-red-800,
  .cr-no {
    color: #fca5a5;
  }
  .text-amber-800,
  .text-yellow-600,
  .text-yellow-700,
  .text-yellow-800,
  .text-yellow-300,
  .cr-warn {
    color: #fcd34d;
  }
  .text-purple-600,
  .text-purple-700,
  .text-purple-800 {
    color: #d8b4fe;
  }

  /* The hero keeps its bright gradient, so its text stays near-black. */
  header.bg-gradient-to-r .text-gray-900,
  header.bg-gradient-to-r .text-gray-800 {
    color: #111827;
  }
}

/* ------------------------------------------------------------------ *
 * Inline data chart (Italian pricing section)
 *
 * The English infographics carry their labels baked into the raster, so
 * they cannot be reused on another locale. This is drawn as SVG instead:
 * the text stays translatable, selectable and legible at any size, and it
 * follows the colour scheme rather than shipping a second asset.
 * ------------------------------------------------------------------ */
.cr-figure {
  margin: 1.5rem 0 0;
}

.cr-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.cr-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #4b5563;
  max-width: 42rem;
}

.cr-chart-title {
  font-size: 14px;
  font-weight: 700;
  fill: #1f2937;
}

.cr-chart-label {
  font-size: 12px;
  fill: #374151;
}

.cr-chart-value {
  font-size: 12px;
  font-weight: 600;
  fill: #374151;
}

.cr-chart-axis {
  font-size: 11px;
  fill: #6b7280;
}

.cr-chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.cr-bar {
  fill: #fb923c;
}

.cr-bar--best {
  fill: #047857;
}

.cr-bar--worst {
  fill: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  .cr-figure figcaption {
    color: var(--cr-text-dim);
  }

  .cr-chart-title {
    fill: var(--cr-text);
  }

  .cr-chart-label,
  .cr-chart-value {
    fill: var(--cr-text);
  }

  .cr-chart-axis {
    fill: var(--cr-text-faint);
  }

  .cr-chart-grid {
    stroke: var(--cr-line);
  }

  .cr-bar {
    fill: #fb923c;
  }

  .cr-bar--best {
    fill: #34d399;
  }

  .cr-bar--worst {
    fill: #f87171;
  }
}
