/* ==========================================
   LISTING — UNIWERSALNY LAYOUT (MOBILE FIRST)
========================================== */

/* link całej karty */
.ads-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* layout listy */
.listing-layout {
  max-width: 1200px;
  margin: 0px auto 80px;
  padding: 0 16px;
}

.listing-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================
   KARTA OGŁOSZENIA — MOBILE (DEFAULT)
========================================== */

.ads-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;

  transition: transform .15s ease, box-shadow .15s ease;
}

/* hover jako bonus */
.ads-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* ==========================================
   ZDJĘCIE — MOBILE
========================================== */

.ads-card .listing-image {
  width: 100%;
 /* aspect-ratio: 4 / 3; */
  border-radius: 10px;
  overflow: hidden;
}

.ads-card .listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   TREŚĆ — MOBILE
========================================== */

.ads-card .listing-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 8px;
  position: relative;
}

/* TYTUŁ */
.ads-card .listing-body h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

/* ==========================================
   META ROW — TYP + FULFILLMENT
========================================== */

.ads-card .listing-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

/* typ — badge */
.ads-card .listing-type {
  background: #2563eb;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* fulfillment — badge */
.ads-card .listing-operator {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}

/* ==========================================
   LOKALIZACJA — 1 LINIA (ELLIPSIS)
========================================== */

.ads-card .listing-body {
  min-width: 0;
}

.ads-card .listing-region {
  margin: 0;

  font-size: 13px;
  color: #374151;
  font-weight: 600;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   OPIS — LISTING (MOBILE FIRST)
========================================== */

.ads-card .listing-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==========================================
   POZOSTAŁE DANE (JEŚLI WYSTĘPUJĄ)
========================================== */

.ad-price,
.ad-phone,
.ad-gps {
  font-size: 13px;
  color: #333333;
}

.muted {
  color: #777777;
}






/* =========================================
   LISTING HEADER — WYNIKI
========================================= */

.listing-header {
  display: flex;
  flex-direction: column;
  align-items: left;
  gap: 6px;
}

/* REGION — NAJWAŻNIEJSZY */
.listing-region {
  font-size: 20px;
  font-weight: 600;
  color: #e5e7eb; /* jasny, nie biały */
}

/* LICZBA WYNIKÓW — ŚREDNIA WAGA */
.listing-count {
  font-size: 16px;
  font-weight: 500;
  color: #d1d5db;
}

/* ZAPYTANIE / FALLBACK — NAJMNIEJSZE */
.listing-query {
  font-size: 14px;
  font-weight: 400;
  color: #9ca3af;
}

/* =========================================
   LISTING HEADER + LOGO (MOBILE → DESKTOP)
========================================= */

.listing-header-wrap {
  display: flex;
  flex-direction: row;   /* ← 🔑 TO JEST KLUCZ */
  align-items: center;        /* 🔑 KLUCZ */
  justify-content: center;
  gap: 25px;

  margin-bottom: 18px;
}

/* LOGO */
.listing-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.listing-logo img {
  height: 40px;        /* mobile */
  width: auto;
  display: block;
  opacity: 0.9;
}



/* ==========================================
   TABLET — 2 KARTY OBOK SIEBIE
   (od 768px do desktopu)
========================================== */

@media (min-width: 768px) and (max-width: 1023px) {

  .listing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  /* karta przestaje być "pionowym kolosem" */
  .ads-card {
    height: 100%;
  }

  .listing-logo img {
    height: 40px;
  }
  
}


/* ==========================================
   DESKTOP
   (karta pozioma TYLKO na desktopie)
========================================== */

@media (min-width: 1024px) {

  .listing-grid {
    gap: 22px;
  }

  .ads-card {
    grid-template-columns: 260px 1fr;
    padding: 16px;
  }

  .ads-card .listing-image {
    height: 180px;
  }

  .ads-card .listing-body h3 {
    font-size: 18px;
  }
  
  .listing-logo img {
    height: 44px;
  }  

  .ads-card .listing-desc {
    white-space: normal;        /* pozwól na łamanie */
    text-overflow: unset;

    display: -webkit-box;
    -webkit-line-clamp: 3;      /* ← TU JEST LIMIT (zmień na 3 jeśli chcesz) */
    -webkit-box-orient: vertical;
    overflow: hidden;           /* MUSI zostać */
  }
  
}
