/* ---------------------------------------------------------------------------
   Theme: Toyota Gazoo Racing — rally livery
   Palette: black base, Toyota Racing Red accent, white text.
   Motifs: angular corners, italic bold display type, three-stripe rally bar.
   --------------------------------------------------------------------------- */

:root {
  --gr-red: #E60012;        /* Toyota Racing Red */
  --gr-red-bright: #FF1A2E; /* hover */
  --gr-red-deep: #A8000E;   /* shadow / inner stripe */
  --gr-white: #ffffff;
  --gr-black: #0a0a0a;
  --gr-charcoal: #141414;
  --gr-line: rgba(255, 255, 255, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--gr-black);
  color: #eee;
}

/* Racing-inspired condensed display type for big headings */
h1, h2, .display-3, .display-4, .display-5 {
  font-weight: 800;
  letter-spacing: -0.01em;
  font-style: italic;
  text-transform: uppercase;
}

.py-md-6 { padding-top: 5rem !important; padding-bottom: 5rem !important; }

.accent, .text-accent { color: var(--gr-red) !important; }
.letter-spacing { letter-spacing: 0.2em; }

/* Primary accent button — white on Toyota red, squared-off rally corner */
.btn-accent {
  background-color: var(--gr-red);
  border-color: var(--gr-red);
  color: var(--gr-white) !important;
  border-radius: 2px;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.65rem 1.5rem;
  border-width: 2px;
  box-shadow: 0 4px 20px rgba(230, 0, 18, 0.25);
}
.btn-accent:hover, .btn-accent:focus {
  background-color: var(--gr-red-bright);
  border-color: var(--gr-red-bright);
  color: var(--gr-white) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(230, 0, 18, 0.45);
}

/* GR three-stripe motif — red / white / red (used below navbar & as dividers) */
.rally-stripe {
  height: 6px;
  background:
    linear-gradient(to bottom,
      var(--gr-red) 0 40%,
      var(--gr-white) 40% 60%,
      var(--gr-red-deep) 60% 100%);
  width: 100%;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(10, 10, 10, 0.9) !important;
  border-bottom: 1px solid var(--gr-line) !important;
}
.nav-link { text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.08em; font-weight: 600; }
.nav-link:hover { color: var(--gr-red) !important; }

/* Centre logo */
.navbar-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  pointer-events: auto;
}
.navbar-logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}
.navbar-logo:hover img { transform: scale(1.05); }

/* Give the nav some vertical room so the logo fits */
.gr-nav { padding-top: 0.65rem; padding-bottom: 0.65rem; }

/* Desktop: split nav into left/right around the centred logo */
@media (min-width: 992px) {
  .gr-nav .navbar-collapse {
    display: flex !important;
    justify-content: space-between;
  }
  .gr-nav .nav-left  { margin-right: auto; padding-right: 7rem; }
  .gr-nav .nav-right { margin-left:  auto; padding-left:  7rem; }
}

/* Mobile: stack, logo stays centred, links fall under */
@media (max-width: 991.98px) {
  .navbar-logo { position: static; transform: none; }
  .gr-nav .container { flex-wrap: wrap; justify-content: center; }
  .navbar-toggler { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
}

/* HERO */
.hero {
  min-height: min(90vh, 900px);
  position: relative;
  overflow: hidden;
  background: #000;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 60%, rgba(10,10,10,0.9) 100%),
                    url('./media/other/IMG_9570.jpeg');
  background-size: cover;
  background-position: center;
  filter: saturate(1.1) contrast(1.1);
  z-index: 0;
}
/* Diagonal red slash accent in the hero corner */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 40%;
  background: linear-gradient(to bottom, var(--gr-red), var(--gr-red-deep));
  z-index: 1;
}
.hero .container { z-index: 2; }

/* Shaded panel behind the title block so copy stays legible
   without darkening the image itself */
.hero-panel {
  display: inline-block;
  max-width: 900px;
  padding: 1.25rem 2rem 1.4rem;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(230, 0, 18, 0.25);
  border-radius: 3px;
  margin-bottom: 28rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.hero-panel h1 { margin-bottom: 0.75rem; }

@media (max-width: 575px) {
  .hero-panel { padding: 1rem 1.1rem 1.1rem; }
}

.stat {
  padding: 1rem 0.5rem;
  border: 1px solid rgba(230, 0, 18, 0.35);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.65);
  position: relative;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--gr-red);
}
.stat-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--gr-white);
  line-height: 1;
  font-style: italic;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #bbb;
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Section heading decorations — short red bar above the section label */
.text-accent.small.letter-spacing {
  position: relative;
  padding-left: 2.25rem;
  display: inline-block;
}
.text-accent.small.letter-spacing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5rem;
  height: 2px;
  background: var(--gr-red);
}

/* Performance cards */
.perf-card {
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line) !important;
  border-radius: 4px !important;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.perf-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--gr-red) 0 30%, var(--gr-white) 30% 32%, var(--gr-red-deep) 32% 60%, transparent 60%);
}
.perf-card:hover {
  transform: translateY(-4px);
  border-color: var(--gr-red) !important;
}
.perf-card .h2 { font-style: italic; color: var(--gr-red) !important; }
.unit-suffix {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gr-red);
  margin-left: 0.55rem;
  letter-spacing: 0.02em;
  font-style: normal;
  text-transform: uppercase;
}

/* Spec cards */
.spec-card {
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line);
  border-radius: 4px;
  padding: 1.5rem;
  height: 100%;
  border-left: 3px solid var(--gr-red);
}
.spec-card h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gr-red);
  margin-bottom: 0.75rem;
  font-style: italic;
  font-weight: 800;
}
.spec-card .value { font-size: 1.1rem; font-weight: 600; }

/* Chassis / Verkline callout */
.chassis-section {
  background:
    radial-gradient(ellipse at top, rgba(230, 0, 18, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #0d0d0d 0%, var(--gr-charcoal) 100%);
  border-top: 1px solid var(--gr-line);
  border-bottom: 1px solid var(--gr-line);
}

/* One-off acid-green pill — nods to this car's actual powder-coat colour */
.acid-pill {
  display: inline-block;
  background: #c6ff3d;
  color: #111;
  padding: 0.05rem 0.5rem;
  font-weight: 700;
  font-style: italic;
  border-radius: 2px;
  white-space: nowrap;
}

.chassis-stat {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(230, 0, 18, 0.3);
  border-radius: 2px;
  padding: 1.25rem 0.75rem;
  position: relative;
  height: 100%;
}
.chassis-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--gr-red);
}
.chassis-stat-value {
  font-size: 2.6rem;
  font-weight: 900;
  font-style: italic;
  color: var(--gr-white);
  line-height: 1;
}
.chassis-stat-value span {
  font-size: 1.1rem;
  color: var(--gr-red);
  margin-left: 0.15rem;
}
.chassis-stat-value span.prefix {
  margin-left: 0;
  margin-right: 0.35rem;
}
.chassis-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bbb;
  margin-top: 0.5rem;
  font-weight: 600;
}

.chassis-component {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--gr-red);
  border-radius: 2px;
  font-size: 0.9rem;
  color: #ddd;
}
.chassis-component i {
  color: var(--gr-red);
  font-size: 1rem;
  flex-shrink: 0;
}

/* "Never rallied" callout — sits between section intro and stat tiles */
.never-rallied {
  max-width: 520px;
  padding: 0.55rem 1.1rem;
  background: rgba(230, 0, 18, 0.08);
  border: 1px solid rgba(230, 0, 18, 0.35);
  border-radius: 2px;
  color: #ddd;
  font-size: 0.95rem;
}
.never-rallied i { color: var(--gr-red); }
.never-rallied strong { color: var(--gr-white); font-style: italic; letter-spacing: 0.04em; text-transform: uppercase; }

/* Condition / freshness cards */
.condition-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line);
  border-left: 3px solid var(--gr-red);
  border-radius: 2px;
  padding: 1rem 1.15rem;
  height: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.condition-card:hover {
  border-color: var(--gr-red);
  transform: translateY(-2px);
}
.condition-card > i {
  color: var(--gr-red);
  font-size: 1.75rem;
  flex-shrink: 0;
}
.condition-title {
  color: var(--gr-white);
  font-weight: 700;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.condition-desc {
  color: #aaa;
  font-size: 0.82rem;
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* Labour / workshop cards */
.labour-card {
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line);
  border-left: 3px solid var(--gr-red);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.3;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.labour-card:hover {
  border-color: var(--gr-red);
  transform: translateY(-2px);
}
.labour-card i {
  color: var(--gr-red);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Cost summary cards */
.cost-card {
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid var(--gr-red);
}
.cost-card .cost-label {
  font-size: 0.75rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cost-card .cost-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  color: var(--gr-white);
  margin-top: 0.5rem;
}
.cost-card.credit {
  border-top-color: var(--gr-white);
}
.cost-card.credit .cost-value { color: var(--gr-white); }

/* Accordion — GR flavored dark */
.accordion-button {
  background: var(--gr-charcoal);
  color: var(--gr-white);
  font-weight: 700;
  border-radius: 0 !important;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-style: italic;
}
.accordion-button:not(.collapsed) {
  background: #1c1c1c;
  color: var(--gr-red);
  box-shadow: inset 4px 0 0 var(--gr-red);
}
.accordion-button:focus { box-shadow: none; }
.accordion-button::after {
  filter: invert(1);
}
.accordion-button:not(.collapsed)::after {
  filter: invert(18%) sepia(98%) saturate(7492%) hue-rotate(355deg) brightness(95%) contrast(115%);
}
.accordion-item {
  background: var(--gr-charcoal);
  border-color: var(--gr-line);
  border-radius: 0 !important;
  margin-bottom: 2px;
}
.accordion-body { background: #0d0d0d; }

.part-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 0.95rem;
}
.part-row:last-child { border-bottom: none; }
.part-row .part-name { color: #ccc; flex: 1; }
.part-row .part-price { color: var(--gr-red); font-weight: 700; white-space: nowrap; font-style: italic; }

/* Click-to-copy email button in the Contact section */
.email-copy-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #bbb;
  padding: 0.5rem 1rem;
  border-radius: 2px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
}
.email-copy-btn:hover {
  color: var(--gr-white);
  border-color: var(--gr-red);
  background: rgba(230, 0, 18, 0.08);
}
.email-copy-btn i { color: var(--gr-red); }
.email-copy-btn .email-copied {
  display: none;
  color: var(--gr-white);
}
.email-copy-btn.copied .email-text { display: none; }
.email-copy-btn.copied .email-copied { display: inline; }
.email-copy-btn.copied i.bi-clipboard { display: none; }

/* Location line in the Contact section */
.location-line {
  color: var(--gr-white);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.location-line i { color: var(--gr-red); font-size: 1.1rem; }
.location-line .letter-spacing { letter-spacing: 0.15em; }

/* Gallery — "For Sale" note callout */
.sale-note {
  max-width: 620px;
  background: rgba(230, 0, 18, 0.08);
  border: 1px solid rgba(230, 0, 18, 0.35);
  border-left: 3px solid var(--gr-red);
  border-radius: 2px;
  padding: 0.75rem 1.1rem;
  color: #ddd;
  font-size: 0.92rem;
}
.sale-note i { color: var(--gr-red); }
.sale-note strong { color: var(--gr-white); font-style: italic; letter-spacing: 0.02em; }

/* Brands / links */
.brand-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  background: var(--gr-charcoal);
  border: 1px solid var(--gr-line);
  border-left: 3px solid var(--gr-red);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  height: 100%;
  text-decoration: none;
  color: var(--gr-white);
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
/* Brand logo — shown on a light chip because most brand logos
   assume a white/light background. Gracefully removed if the
   Clearbit + favicon chain both fail. */
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
  padding: 3px;
  flex-shrink: 0;
}
/* Wide wordmark logos (e.g., Pirelli) — let them breathe horizontally */
.brand-logo.wide {
  width: 64px;
  height: 28px;
  padding: 2px 4px;
}
/* Dark chip for logos designed for dark backgrounds (white wordmarks etc.) */
.brand-logo.dark {
  background: #000;
}
.brand-card:hover:not(.brand-unlinked) {
  background: #1a1a1a;
  border-color: var(--gr-red);
  transform: translateY(-2px);
  color: var(--gr-white);
}
.brand-card .brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.01em;
}
.brand-card .brand-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
}
.brand-card .brand-arrow {
  color: var(--gr-red);
  font-size: 0.85rem;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.brand-card:hover .brand-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}
.brand-card.brand-unlinked {
  border-left-color: rgba(230, 0, 18, 0.3);
  cursor: default;
}
.brand-card.brand-unlinked .brand-name { color: #ccc; }

/* Gallery */
#gallery-tabs .nav-link {
  color: #bbb;
  border-radius: 2px;
  padding: 0.55rem 1.35rem;
  text-transform: uppercase;
  font-weight: 700;
  font-style: italic;
  border: 1px solid transparent;
  margin: 0 0.2rem;
}
#gallery-tabs .nav-link:hover {
  border-color: var(--gr-red);
  color: var(--gr-white) !important;
}
#gallery-tabs .nav-link.active {
  background: var(--gr-red);
  color: var(--gr-white);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  background: var(--gr-charcoal);
  position: relative;
}
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}
.gallery-item:hover::after { border-color: var(--gr-red); }
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}
.gallery-item:hover img,
.gallery-item:hover video { transform: scale(1.05); }

/* Video thumbnail overlay */
.gallery-item.video::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
  pointer-events: none;
  transition: background 0.2s ease;
}
.gallery-item.video:hover::before { background: rgba(0, 0, 0, 0.15); }
.gallery-item .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gr-white);
  font-size: 3.25rem;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, color 0.2s ease;
}
.gallery-item.video:hover .play-overlay {
  transform: scale(1.1);
  color: var(--gr-red);
}
/* YouTube play icon sits in a red rounded rectangle like the real YouTube UI */
.play-overlay.youtube-play {
  font-size: 3.75rem;
  color: #ff0000;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}
.gallery-item.video.youtube:hover .play-overlay { color: #ff0000; }

/* Lightbox video sizing */
#lightbox video { max-height: 85vh; width: 100%; }

/* "Show more" gallery button */
.btn-gallery-more {
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-style: italic;
  padding: 0.55rem 1.5rem;
  border-width: 2px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-gallery-more:hover {
  background: var(--gr-red);
  border-color: var(--gr-red);
  color: var(--gr-white);
}
.btn-gallery-more .badge { font-style: normal; }

/* Badges */
.badge.text-bg-success {
  background-color: var(--gr-red) !important;
  color: var(--gr-white) !important;
}

/* Utility: override default bootstrap tertiary background to keep black theme */
.bg-body-tertiary { background-color: #0f0f0f !important; }

/* Lightbox */
#lightbox .modal-content { background: transparent !important; }

/* Footer */
footer {
  background: var(--gr-black);
}
.footer-brand {
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gr-white);
  font-size: 1rem;
}
.footer-brand .accent {
  background: var(--gr-red);
  color: var(--gr-white) !important;
  padding: 0 0.4rem;
  margin-right: 0.2rem;
}

@media (max-width: 575px) {
  .stat-value { font-size: 1.6rem; }
  h1.display-3 { font-size: 2.5rem; }
}
