/* ==========================================================================
   Homepage verejneho Radaru — scrollovaci landing.
   Navazuje na promenne z app.css (barvy, radius, stiny), ale ma vlastni
   layout: app.css resi celoobrazovkovy nastroj (detail nemovitosti),
   tohle je stranka, ktera se cte shora dolu.
   ========================================================================== */

/* app.css nastavuje html, body { height: 100% } kvuli celoobrazovkovemu
   nastroji - scrollovaci stranka to potrebuje zpatky na auto. */
body.home {
  height: auto;
  min-height: 100%;
  line-height: 1.55;
  position: relative;
  isolation: isolate;
  /* Radarový displej v hero úmyslně přetéká za pravý okraj — clip ho ořízne,
     aniž by (na rozdíl od overflow:hidden) rozbil position:sticky uvnitř. */
  overflow-x: clip;
}

/* ==========================================================================
   Pozadi — vse ciste CSS, zadne obrazky (stranka nema build a nechceme
   tahat kilobajty kvuli dekoraci). Tri vrstvy nad sebou, vsechny za obsahem:
   1) jemna mapova mrizka pres celou stranku
   2) dva mekke svetelne zdroje nahore, aby hero nebyl plocha seda plocha
   3) radarovy displej vpravo v hero (kruhy + otacejici se vysec)
   ========================================================================== */

body.home::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, currentColor 1px, transparent 1px),
    linear-gradient(to bottom, currentColor 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text);
  opacity: 0.035;
  /* Mrizka se smerem dolu vytraci, aby nekonkurovala obsahu sekci. */
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 92%);
}

body.home::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 900px;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60rem 32rem at 12% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(46rem 26rem at 88% 2%, color-mix(in srgb, var(--top) 12%, transparent), transparent 70%);
}

/* Radarovy displej v hero — navazuje na favicon, aby mel web jeden motiv. */
.hero { position: relative; }

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  top: -3rem;
  right: -6rem;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

/* Kruhy dosahu + osy */
.hero::before {
  background:
    repeating-radial-gradient(circle at center, transparent 0 4.2rem, color-mix(in srgb, var(--accent) 42%, transparent) 4.2rem calc(4.2rem + 1px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), color-mix(in srgb, var(--accent) 26%, transparent) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), color-mix(in srgb, var(--accent) 26%, transparent) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, #000 55%, transparent 78%);
}

/* Otacejici se vysec "sweepu" */
.hero::after {
  background: conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--accent) 26%, transparent) 0deg,
    transparent 55deg,
    transparent 360deg
  );
  mask-image: radial-gradient(circle at center, #000 55%, transparent 76%);
  animation: radar-sweep 9s linear infinite;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

/* Klidovy rezim: zadne otaceni, displej zustava staticky. */
@media (prefers-reduced-motion: reduce) {
  .hero::after { animation: none; }
}

@media (max-width: 860px) {
  /* Na uzkem displeji by radar lezl pod text — zmensime a posuneme nad nej. */
  .hero::before,
  .hero::after {
    width: 22rem;
    height: 22rem;
    top: -6rem;
    right: -9rem;
  }

  body.home::before { background-size: 40px 40px; }
}

body.home a { color: inherit; text-decoration: none; }

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.section-head { margin: 3.5rem 0 1.25rem; }
.section-head h2 { font-size: 1.6rem; margin: 0 0 0.25rem; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---- Hlavicka ---- */
.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-header .logo { font-weight: 800; letter-spacing: 0.06em; font-size: 1rem; }
.site-header .logo span { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; gap: 1.4rem; font-size: 0.9rem; }
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }

/* ---- Hero ---- */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
}

.hero-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-lead {
  margin: 0 0 2rem;
  max-width: 46rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-muted);
}

.funnel {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.funnel-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  min-width: 9.5rem;
}

.funnel-step b { display: block; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; }
.funnel-step span { font-size: 0.8rem; color: var(--text-muted); }

.funnel-step.is-highlight {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.funnel-step.is-highlight span { color: rgba(255, 255, 255, 0.85); }

.funnel-arrow { align-self: center; color: var(--text-muted); }

/* Ukazatel aktuálnosti — kdy Radar naposledy načítal z Bazoše a jak staré
   jsou samotné inzeráty. Tečka barví podle stáří načtení, aby bylo na první
   pohled vidět, jestli data nezestarala. */
.freshness {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.freshness b { color: var(--text); font-weight: 600; }
.freshness a { color: var(--accent); text-decoration: underline; }
.freshness-sep { opacity: 0.5; }
.freshness-age { opacity: 0.8; }

.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.freshness-dot.is-fresh { background: var(--zajimave); }
.freshness-dot.is-aging { background: var(--proverit); }
.freshness-dot.is-stale { background: var(--nezajimave); }

.signal.is-new { color: var(--top); border-color: var(--top); }

/* ---- Piktogramy typů nemovitostí ---- */
.type-icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  vertical-align: -0.15em;
  color: var(--text-muted);
}

.type-icon-lg { width: 1.5rem; height: 1.5rem; color: var(--accent); }

.deal-card-title { display: flex; align-items: center; gap: 0.4rem; }
.deal-hero-main h2 { display: flex; align-items: center; gap: 0.55rem; }

/* Přepínač typu s piktogramy — nahrazuje rozbalovací seznam, protože
   ikona typu je čitelnější na první pohled než položka v selectu. */
.type-switch {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.type-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.type-btn:hover { color: var(--text); }

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

.type-btn.active .type-icon { color: #fff; }

@media (max-width: 600px) {
  /* Na mobilu zůstane jen ikona, popisek by přetekl. */
  .type-btn span { display: none; }
  .type-btn { padding: 0.35rem 0.6rem; }
  .type-btn:first-child span { display: inline; }
}

/* ---- TOP deal dne ---- */
.deal-hero {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.deal-hero:hover { border-color: var(--top); transform: translateY(-2px); }

.deal-hero-badge {
  background: linear-gradient(90deg, var(--top), #fb923c);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.4rem;
}

.deal-hero-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.4rem 1.4rem 1rem;
}

.deal-hero-main { flex: 1; min-width: 0; }
.deal-hero-main h2 { margin: 0 0 0.35rem; font-size: 1.75rem; letter-spacing: -0.02em; }

.deal-hero-price { margin: 0 0 0.75rem; display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.deal-hero-price b { font-size: 1.35rem; }
.deal-hero-price span { color: var(--text-muted); font-size: 0.9rem; }

.deal-hero-why {
  margin: 0 0 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 40rem;
}

/* Kruhovy ukazatel skore — conic-gradient, zadna knihovna */
.deal-hero-score { text-align: center; flex-shrink: 0; }

.score-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.score-ring-inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  align-content: center;
}

.score-ring-inner b { font-size: 1.9rem; line-height: 1; letter-spacing: -0.03em; }
.score-ring-inner span { font-size: 0.7rem; color: var(--text-muted); }
.score-ring-label { margin: 0.4rem 0 0; font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.04em; }

.deal-hero-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.deal-hero-numbers > div { background: var(--surface); padding: 0.9rem 1.4rem; }
.deal-hero-numbers .label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.deal-hero-numbers b { display: block; font-size: 1.3rem; letter-spacing: -0.02em; }
.deal-hero-numbers small { color: var(--text-muted); font-size: 0.75rem; }

.deal-hero-cta {
  display: block;
  padding: 0.85rem 1.4rem;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.is-good { color: var(--zajimave); }
.is-bad { color: var(--danger); }

/* ---- Signaly (novinka / zlevneno / …) ---- */
.signal-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.signal {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.signal.is-drop { color: var(--zajimave); border-color: var(--zajimave); }
.signal.is-muted { border-style: dashed; }

/* ---- Mrizka dalsich nabidek ---- */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.9rem;
}

.deal-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.deal-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.deal-card-top { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.85rem; }

.deal-card-score {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.deal-card-score.cat-top { background: var(--top); }
.deal-card-score.cat-zajimave { background: var(--zajimave); }

.deal-card-title { margin: 0; font-weight: 700; }
.deal-card-price { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.deal-card-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.deal-card-numbers .label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.deal-card-numbers b { font-size: 1rem; }

/* ---- Sber e-mailu ---- */
.lead-strip {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
}

.lead-strip-text { flex: 1 1 22rem; }
.lead-strip-form { flex: 0 1 22rem; }
.lead-title { margin: 0 0 0.2rem; font-weight: 700; }
.lead-sub { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.lead-row { display: flex; gap: 0.4rem; }
.lead-input { flex: 1; min-width: 0; }

.lead-btn {
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.lead-btn:hover { filter: brightness(1.08); }
.lead-btn:disabled { opacity: 0.6; cursor: default; }
.lead-msg { margin: 0.4rem 0 0; font-size: 0.85rem; font-weight: 600; }
.lead-note { margin: 0.4rem 0 0; font-size: 0.72rem; color: var(--text-muted); }

/* ---- Mapa a filtry ---- */
.section-map { max-width: 1180px; }

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.8rem 0.9rem;
  border-bottom: none;
}

.filter-panel .text-input,
.filter-panel .select-input { max-width: 11rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip-toggle { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.chip-toggle input { margin: 0; }

.filter-panel .count-label { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); }

.map-shell {
  position: relative;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.map-shell #map { width: 100%; height: 100%; }

/* ---- Metodika ---- */
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  align-items: start;
}

.method-weights {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.weight-row {
  display: grid;
  grid-template-columns: 10rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.weight-label { font-size: 0.9rem; font-weight: 600; }

.weight-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.weight-bar { height: 100%; background: var(--accent); border-radius: 999px; }
.weight-points { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.weight-note {
  grid-column: 1 / -1;
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.method-notes { display: grid; gap: 0.9rem; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.note-card h3 { margin: 0 0 0.45rem; font-size: 1rem; }
.note-card p { margin: 0 0 0.6rem; font-size: 0.88rem; color: var(--text-muted); }
.note-card p:last-child { margin-bottom: 0; }

.note-caveat {
  border-left: 3px solid var(--proverit);
  padding-left: 0.7rem;
}

/* ---- Paticka ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0 0 0.35rem; }
.footer-disclaimer { font-size: 0.78rem; }

/* ---- Mobil ---- */
@media (max-width: 860px) {
  .method-grid { grid-template-columns: 1fr; }
  .deal-hero-body { flex-direction: column-reverse; align-items: stretch; }
  .deal-hero-score { align-self: flex-start; }
  .weight-row { grid-template-columns: 1fr auto; }
  .weight-track { grid-column: 1 / -1; order: 3; }
  .weight-note { order: 4; }
  .site-nav { display: none; }
  .map-shell { height: 420px; }
  .filter-panel .count-label { margin-left: 0; width: 100%; }
}

/* ---- Zamčené nálezy (odemknou se e-mailem) ---- */
.locked-teaser {
  position: relative;
  margin-top: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: hidden;
}

.locked-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.9rem;
  filter: blur(5px);
  opacity: 0.5;
  user-select: none;
}

.locked-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  height: 5.5rem;
}

.locked-score {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--nezajimave);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.locked-line {
  height: 0.7rem;
  border-radius: 4px;
  background: var(--border);
  flex: 1;
}

.locked-line.is-short { flex: 0 0 25%; }

.locked-text {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
