/* ==================================================================
   car_list_page.css
   ------------------------------------------------------------------
   Styles specific to the generic list/ranking page.
   Loads AFTER car_detail_page.css so it inherits design tokens
   (--bg, --paper, --accent, --line, etc.).
   ================================================================== */

/* ——— PAGE HEAD ——— */
.list-head {
  padding: 48px 0 28px;
}
.list-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.list-sub {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
  margin: 14px 0 0;
  max-width: 720px;
}
.list-meta {
  margin-top: 22px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.list-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-rankby {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-rankby b {
  color: var(--accent);
  font-weight: 600;
}

/* ——— FILTER BAR (list mode only) ——— */
.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.list-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}
.list-filter label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  font-weight: 600;
}
.list-filter select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 34px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%238e867a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.15s, background-color 0.15s;
}
.list-filter select:hover {
  border-color: var(--accent-soft);
}
.list-filter select:focus {
  outline: none;
  border-color: var(--accent);
}
.list-filter-reset {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  align-self: flex-end;
  margin-bottom: 0;
  flex-shrink: 0;
}
.list-filter-reset:hover {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.list-filter-status {
  font-size: 13px;
  color: var(--ink-soft);
  align-self: flex-end;
  margin-bottom: 10px;
  min-width: 120px;
}

/* ——— NEW COLUMNS: Family, Engine ——— */
.col-family {
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
}
.col-engine {
  color: var(--ink-soft);
  text-transform: capitalize;
  white-space: nowrap;
}

/* ——— TABLE ——— */
.list-table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.list-table thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  font-weight: 600;
  padding: 16px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.list-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.list-table tbody tr:last-child td {
  border-bottom: none;
}
.list-table tbody tr:hover {
  background: var(--bg-soft);
}

.col-rank {
  width: 56px;
  text-align: center;
}
.col-model {
  font-weight: 500;
}
.model-link {
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.model-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.col-body {
  color: var(--ink-soft);
  text-transform: capitalize;
}
.col-power, .col-price, .col-metric {
  color: var(--ink-soft);
  white-space: nowrap;
}
.col-metric b {
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
}
.col-open {
  width: 110px;
  text-align: right;
  white-space: nowrap;
}
.btn-ghost-sm {
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* ——— MEDALS (top 3) ——— */
.rank-num {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  color: var(--mute);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
}
.medal {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  color: #fff;
  font-family: 'Fraunces', serif;
  box-shadow: 0 2px 6px rgba(28,26,23,0.15);
}
.medal-1 {
  background: linear-gradient(135deg, #d4a340, #b78428);
}
.medal-2 {
  background: linear-gradient(135deg, #b5b5b5, #888888);
}
.medal-3 {
  background: linear-gradient(135deg, #c07d4a, #8d5530);
}

/* Row tints for top 3 */
.list-table tbody tr.medal-gold   { background: linear-gradient(90deg, rgba(212,163,64,0.08), transparent 40%); }
.list-table tbody tr.medal-silver { background: linear-gradient(90deg, rgba(181,181,181,0.08), transparent 40%); }
.list-table tbody tr.medal-bronze { background: linear-gradient(90deg, rgba(192,125,74,0.08), transparent 40%); }
.list-table tbody tr.medal-gold:hover,
.list-table tbody tr.medal-silver:hover,
.list-table tbody tr.medal-bronze:hover {
  background: var(--bg-soft);
}

/* ——— "See all" CTA ——— */
.list-seeall {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}
.list-seeall .btn-primary {
  padding: 14px 28px;
  font-size: 15px;
}

/* ——— EMPTY STATE ——— */
.list-empty {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: var(--mute);
  font-style: italic;
  font-family: 'Fraunces', serif;
  font-size: 17px;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 760px) {
  .list-table thead { display: none; }
  .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; width: 100%; }
  .list-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .list-table td {
    padding: 4px 0;
    border-bottom: none;
  }
  .list-table td.col-rank {
    display: inline-block;
    width: auto;
    margin-right: 10px;
  }
  .list-table td.col-model {
    display: inline-block;
    width: calc(100% - 60px);
  }
  .list-table td.col-family::before { content: "Family — "; color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-body::before  { content: "Body — ";   color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-engine::before { content: "Engine — "; color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-power::before { content: "Power — ";  color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-price::before { content: "Price — ";  color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-metric::before { content: attr(data-label) " — "; color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
  .list-table td.col-open {
    width: 100%;
    text-align: left;
    margin-top: 8px;
  }
}
