/* ==========================================================================
   mazda6.kefitax.hu — temporary car listing page
   Mobile-first, no framework. Breakpoints: 576 / 768 / 992 px.
   ========================================================================== */

/* --- tokens --------------------------------------------------------------- */
:root {
  --bg: #0d0f11;
  --bg-soft: #14181b;
  --card: #191d21;
  --card-2: #1f242a;
  --line: #2a3138;
  --fg: #f1f4f6;
  --fg-dim: #aab4bd;
  --fg-faint: #7d878f;
  --accent: #c8102e;
  --accent-soft: #ff4a5e;
  --ok: #4fbf8b;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --pad: 16px;
  --maxw: 1040px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* height:auto is required: the width/height attributes on <img>/<video> are
   presentational hints that would otherwise beat the aspect-ratio boxes below. */
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-soft); }
h1, h2, h3, p, ul, ol { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--card);
  padding: 10px 14px;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* --- shell ---------------------------------------------------------------- */
.app { max-width: var(--maxw); margin: 0 auto; }

.state {
  padding: 48px var(--pad);
  color: var(--fg-dim);
  text-align: center;
}

.section {
  padding: 28px var(--pad) 0;
}

.section__title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 12px;
}

/* --- hero ---------------------------------------------------------------- */
.hero { position: relative; background: var(--bg-soft); }

/* no photos yet: the title block is a plain header, not an overlay */
.hero--plain .hero__title { text-shadow: none; }
.hero--plain .head { padding-bottom: 0; }

.hero__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--card);
}

.hero__grad {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(8, 10, 11, .96) 2%, rgba(8, 10, 11, .5) 48%, transparent);
  pointer-events: none;
}

.hero__txt {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 var(--pad) 16px;
}

.hero__badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 99px;
  padding: 4px 11px;
  margin-bottom: 10px;
}

.hero__title {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

.hero__count {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--fg-dim);
}

/* --- call to action ------------------------------------------------------ */
.head { padding: var(--pad); }

.head__note {
  margin-top: 10px;
  text-align: center;
  font-size: .85rem;
  color: var(--fg-faint);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:active { background: #a60d26; }

/* --- gallery ------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.grid__cell {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--card);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.grid__cell img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: opacity .2s;
}

.grid__cell:active img { opacity: .7; }

/* --- videos -------------------------------------------------------------- */
.videos { display: grid; gap: 18px; }

.video {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 13px;
  font-size: .82rem;
  color: var(--fg-dim);
}


/* --- footer -------------------------------------------------------------- */
.foot {
  margin-top: 34px;
  padding: 22px var(--pad) 28px;
  border-top: 1px solid var(--line);
  color: var(--fg-faint);
  font-size: .82rem;
  text-align: center;
}

.foot p + p { margin-top: 5px; }

/* --- lightbox ------------------------------------------------------------ */
.lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #07080a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb[hidden] { display: none; }

.lb__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* horizontal swipe is handled in JS; pinch-zoom must stay native */
  touch-action: pan-y pinch-zoom;
}

/* one layer per photo - the outgoing and the incoming one move together */
.lb__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}

.lb__bar {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent);
}

.lb__counter {
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

.lb__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .1);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lb__close { width: 42px; height: 42px; font-size: 1.05rem; }

.lb__nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 1.1rem;
  /* touch devices get swipe instead; arrows appear from 768px up */
  display: none;
}

.lb__nav--prev { left: 10px; }
.lb__nav--next { right: 10px; }
.lb__nav:disabled { opacity: .25; cursor: default; }

.lb__hint {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: .8rem;
  color: rgba(255, 255, 255, .72);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  transition: opacity .4s;
}

.lb__hint[hidden] { display: none; }
.lb--hide-hint .lb__hint { opacity: 0; }

body.lb-open { overflow: hidden; }

/* --- 576px + ------------------------------------------------------------- */
@media (min-width: 576px) {
  :root { --pad: 22px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero__title { font-size: 1.85rem; }
}

/* --- 768px + (tablet / desktop) ------------------------------------------ */
@media (min-width: 768px) {
  .hero__img { aspect-ratio: 16 / 9; max-height: 68vh; }
  .hero__title { font-size: 2.15rem; }
  .section { padding-top: 38px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb__nav { display: flex; }
  .lb__hint { display: none; }
}

/* --- 992px + ------------------------------------------------------------- */
@media (min-width: 992px) {
  .app { padding: 0 8px; }
  .head { max-width: 620px; margin: 0 auto; }
}

/* --- motion / contrast preferences -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0s !important; }
}
