/* ============================================================
   Auto Duda — Homepage (draft)
   Built on the autoduda-design.pen design system.
   ============================================================ */

:root {
  /* Brand — red sampled from the Audi RS6 (autoduda-design.pen) */
  --brand-red: #CE181F;
  --brand-red-dark: #991015;
  --brand-red-hover: #B5141A;
  --brand-gray: #5f6062;
  /* Logo keeps its own original ink (matches auto-duda-logo.svg) */
  --logo-red: #b94a37;

  /* Surfaces & text (light theme) */
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f2f2f2;
  --border: #dedede;
  --text-primary: #2b2b2b;
  --text-secondary: #6f6f6f;
  --text-on-brand: #ffffff;

  /* Type */
  --font-heading: 'Goldman', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Spacing scale (from tokens) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 10px 30px rgba(0,0,0,.08);
  --container: 1180px;
  --header-h: 76px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --bg-muted: #1e1e1e;
    --surface: #242424;
    --surface-alt: #2c2c2c;
    --border: #3a3a3a;
    --text-primary: #f2f2f2;
    --text-secondary: #a8a8a8;
    --shadow-md: 0 10px 30px rgba(0,0,0,.4);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---------- Icons ---------- */
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
/* The [hidden] attribute must win over component display values like .btn's
   inline-flex, otherwise hidden buttons (e.g. "Načíst další vozy") still show. */
[hidden] { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 15px 30px; font-size: 16px; }

.btn-primary { background: var(--brand-red); color: #fff; }
.btn-primary:hover { background: var(--brand-red-hover); }

.btn-secondary { background: transparent; color: var(--brand-red); border-color: var(--brand-red); }
.btn-secondary:hover { background: var(--brand-red); color: #fff; }

.btn-on-dark { color: #fff; border-color: rgba(255,255,255,.7); }
.btn-on-dark:hover { background: #fff; color: var(--brand-red); border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color .25s ease, box-shadow .25s ease, border-color .25s ease;
  border-bottom: 1px solid transparent;
}
.site-header.solid {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  width: 100%;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 40px; width: auto; }
/* Swap logo variants by header state: white car silhouette over the dark hero,
   original dark logo once the header turns solid on a light background. */
.brand-logo--light { display: none; }
.site-header.solid .brand-logo--light { display: none; }
.site-header:not(.solid) .brand-logo--dark { display: none; }
.site-header:not(.solid) .brand-logo--light { display: block; }
/* keep the red wordmark readable over the hero before the header turns solid */
.site-header:not(.solid) .brand-logo { filter: drop-shadow(0 1px 6px rgba(0,0,0,.45)); }

.main-nav { display: flex; align-items: center; gap: var(--space-6); }
.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 6px 2px;
  position: relative;
  transition: color .18s ease;
}
.site-header:not(.solid) .nav-link { color: #fff; }
.nav-link:hover { color: var(--brand-red); }
.site-header:not(.solid) .nav-link:hover { color: #fff; opacity: .8; }
.nav-link.is-active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--brand-red); border-radius: 2px;
}
.site-header:not(.solid) .nav-link.is-active::after { background: #fff; }
.nav-cta { margin-left: var(--space-2); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: transform .25s ease, opacity .2s ease, background .2s ease;
}
.site-header:not(.solid) .nav-toggle span { background: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(20,18,18,.86) 0%, rgba(20,18,18,.55) 45%, rgba(20,18,18,.25) 100%),
    linear-gradient(0deg, rgba(153,16,21,.35), rgba(95,96,98,.15));
}
.hero-content { max-width: 640px; color: #fff; padding-block: var(--space-12); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 3px;
  color: #fff;
  background: color-mix(in srgb, var(--brand-red) 90%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: var(--space-6);
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.hero-title .accent { color: #ff8a80; }
.hero-lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(255,255,255,.9);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-muted { background: var(--bg-muted); }

.section-head { max-width: 620px; margin-bottom: var(--space-12); }
.section-kicker {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: var(--space-3);
}
.section-kicker .bar { width: 26px; height: 3px; background: var(--brand-red); border-radius: 3px; }
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: .5px;
  color: var(--text-primary);
}
.section-sub { margin-top: var(--space-4); color: var(--text-secondary); font-size: 1.05rem; }

/* ---------- Service cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-bg {
  position: absolute;
  right: -32px;
  bottom: -32px;
  width: 240px;
  height: 240px;
  color: var(--brand-red);
  opacity: .045;
  transform: rotate(-8deg);
  pointer-events: none;
}
.card-bg-alt {
  right: -18px;
  bottom: auto;
  top: -18px;
  width: 150px;
  height: 150px;
  transform: rotate(12deg);
}
.card > :not(.card-bg) { position: relative; z-index: 1; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand-red) 40%, var(--border)); }
.icon-circle {
  width: 72px; height: 72px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-alt);
  color: var(--brand-red);
  border-radius: 50%;
}
.icon-circle .ico { width: 32px; height: 32px; }
.icon-circle.sm { width: 40px; height: 40px; }
.icon-circle.sm .ico { width: 18px; height: 18px; }
.card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .3px;
  color: var(--text-primary);
}
.card-text { color: var(--text-secondary); }
.card-text a { color: var(--brand-red); font-weight: 600; }
.card-text a:hover { text-decoration: underline; }
.card-list { display: flex; flex-direction: column; gap: var(--space-2); color: var(--text-secondary); }
.card-list li { position: relative; padding-left: 22px; }
.card-list li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--brand-red);
}
/* highlighted list item (e.g. electric vehicles support) */
.card-list li.accent { color: var(--text-primary); }
.card-list li.accent strong { color: var(--brand-red); font-weight: 700; }
.card-list li.accent::before {
  background: var(--brand-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-red) 18%, transparent);
}
.card-link {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-red); font-weight: 700; font-size: .95rem;
}
.card-link .ico { transition: transform .18s ease; }
.card-link:hover .ico { transform: translateX(4px); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.about-copy p { margin-top: var(--space-4); color: var(--text-secondary); }
.about-copy p strong { color: var(--text-primary); }
.about-copy .section-title { margin-top: var(--space-2); }
.about-stats { display: grid; gap: var(--space-4); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
.stat-num {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  color: var(--brand-red);
  letter-spacing: 1px;
}
.stat-label { color: var(--text-secondary); font-size: .95rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-8);
  align-items: stretch;
}
.contact-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.contact-row {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color .18s ease, transform .18s ease;
}
a.contact-row:hover { border-color: var(--brand-red); transform: translateX(3px); }
.contact-text { display: flex; flex-direction: column; }
.contact-text small { color: var(--text-secondary); font-size: 12px; }
.contact-text strong { color: var(--text-primary); font-size: 1.05rem; }
.hours-extra { color: var(--text-secondary); font-size: .9rem; }
.map-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
}
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
.contact-legal {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: .65rem;
  line-height: 1.7;
}

/* ---------- Vehicles offer (feed cards) ---------- */
.offer-status {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.offer-status--error { color: var(--brand-red); }
.offer-status--error a { color: var(--brand-red); font-weight: 600; text-decoration: underline; }
.offer-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: offer-spin .7s linear infinite;
  flex: none;
}
@keyframes offer-spin { to { transform: rotate(360deg); } }

.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.car-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand-red) 40%, var(--border));
}
.car-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
}
.car-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.car-card:hover .car-img { transform: scale(1.04); }
.car-media--empty::after {
  content: 'Bez fotografie';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: .85rem;
}
.car-badge {
  position: absolute;
  top: var(--space-3); left: var(--space-3);
  background: var(--brand-red);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.car-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  flex: 1 1 auto;
}
.car-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .3px;
  color: var(--text-primary);
}
.car-subtitle {
  color: var(--text-secondary);
  font-size: .9rem;
  margin-top: -2px;
}
.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.car-specs li {
  font-size: .8rem;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
}
.car-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
}
.car-price { display: flex; flex-direction: column; line-height: 1.2; }
.car-price strong {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
}
.car-price-note { font-size: .72rem; color: var(--text-secondary); }
.car-link {
  color: var(--brand-red);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.car-link:hover { text-decoration: underline; }

.offer-cta { margin-top: var(--space-12); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.offer-count { color: var(--text-secondary); font-size: .95rem; }

@media (max-width: 900px) {
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .offer-grid { grid-template-columns: 1fr; }
}

/* ---------- Nav social icon ---------- */
.nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-primary);
  border-radius: 50%;
  transition: color .18s ease, background-color .18s ease;
}
.nav-social:hover { color: var(--brand-red); background: var(--surface-alt); }
.site-header:not(.solid) .nav-social { color: #fff; }
.site-header:not(.solid) .nav-social:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-gray); color: rgba(255,255,255,.82); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  align-items: start;
  gap: var(--space-8) var(--space-12);
  padding-block: var(--space-12);
}
.footer-logo { height: 44px; margin-bottom: var(--space-4); }
.footer-brand { max-width: 34ch; }
.footer-brand p { color: rgba(255,255,255,.7); line-height: 1.6; }
.footer-col h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--space-4);
}
.footer-col p { margin-top: var(--space-2); }
.footer-col a { transition: color .15s ease; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-fb { display: inline-flex; align-items: center; gap: var(--space-2); }
.footer-bottom {
  background: rgba(0,0,0,.22);
  padding-block: var(--space-4);
  font-size: .85rem;
  color: rgba(255,255,255,.7);
}
.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-6);
}
.footer-credit a { color: #fff; font-weight: 600; }
.footer-credit a:hover { text-decoration: underline; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-red); color: #fff;
  border: 0; border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .18s ease;
  z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--brand-red-hover); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-6) var(--space-6);
    box-shadow: var(--shadow-md);
    transform: translateY(-140%);
    transition: transform .3s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav .nav-link { color: var(--text-primary); padding: 14px 0; border-bottom: 1px solid var(--border); }
  .site-header:not(.solid) .main-nav .nav-link { color: var(--text-primary); }
  .main-nav .nav-link.is-active::after { display: none; }
  .nav-cta { margin: var(--space-4) 0 0; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .about-stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ---------- Interior pages (no hero) ---------- */
/* Pages without the dark hero keep the header in its "solid" look from the top
   and offset content below the fixed header. */
.page-interior { padding-top: var(--header-h); }
.page-interior .site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.page-interior .site-header .brand-logo--dark { display: block; }
.page-interior .site-header .brand-logo--light { display: none; }
.page-interior .site-header .brand-logo { filter: none; }
.page-interior .site-header .nav-link { color: var(--text-primary); }
.page-interior .site-header .nav-link:hover { color: var(--brand-red); }
.page-interior .site-header .nav-link.is-active::after { background: var(--brand-red); }
.page-interior .site-header .nav-social { color: var(--text-primary); }
.page-interior .site-header .nav-social:hover { color: var(--brand-red); background: var(--surface-alt); }
.page-interior .site-header .nav-toggle span { background: var(--text-primary); }
