/* ===================================== */
/* LIST */
/* ===================================== */

/* ===================================== */
/* WALK TABLE */
/* ===================================== */

:root {

  --trailq-navy: #16324F;
  --trailq-green: #708B47;

  --trailq-bg: #F8FAF8;
  --trailq-panel: #FFFFFF;

  --trailq-border: #DCE3DC;

  --trailq-text: #24313F;
  --trailq-muted: #6B7280;

--walk-grid:
  54px
  24px
  26px
  minmax(0, 1fr)
  58px
  58px
  44px
  52px;
}

/* ===================================== */
/* HEADER */
/* ===================================== */

.walkHeader {

  position: sticky;
  top: 0;

  z-index: 5;

  display: grid;

  grid-template-columns:
    var(--walk-grid);

  align-items: center;

  gap: 4px;

  height: 32px;

  padding: 0 10px;

  background: #f8fafc;

  border-bottom:
    1px solid #dbe2ea;

  box-sizing: border-box;
}

.headerCell {

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.03em;

  color: #52627a;

  cursor: pointer;

  user-select: none;
}

.headerCell:hover {
  color: #111827;
}

.centerHeader {

  display: flex;
  align-items: center;
  justify-content: center;

  padding-top: 1px;
}

.metricHeader {

  justify-self: start;

  text-align: left;
}

/* ===================================== */
/* LIST */
/* ===================================== */

.walkList {
  display: flex;
  flex-direction: column;

  padding: 0;

  box-sizing: border-box;
}

/* ===================================== */
/* ROW */
/* ===================================== */

.walkRow {

  display: grid;

  grid-template-columns:
    var(--walk-grid);

  align-items: center;

  gap: 4px;

  height: 36px;

  padding: 0 10px;

  border-bottom:
    1px solid #eef2f7;

  background: white;

  cursor: pointer;

  transition:
    background 0.1s ease;

  box-sizing: border-box;
}

/* an own walk (UI-EXP-07) */
.walkRow.ownRow {

  background: #d9ecfb;
}

.walkRow:hover {

  background: #f8fbff;
}

.walkRow.selectedRow {

  background:
    rgba(22,50,79,0.10);

  border-left:
    4px solid
    var(--trailq-navy);
}

/* ===================================== */
/* SCORE */
/* ===================================== */

.walkScoreCell {

  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  font-weight: 700;

  color: #111;
}

/* ===================================== */
/* LOOP + DIFFICULTY */
/* ===================================== */

.walkLoop,
.walkDifficulty {

  display: flex;
  align-items: center;
  justify-content: center;
}

.walkDifficulty {
  padding-left: 4px;
}

/* ===================================== */
/* DIFFICULTY DOTS */
/* ===================================== */

.difficultyEasy,
.difficultyMedium,
.difficultyHard {

  width: 10px;
  height: 10px;

  border-radius: 50%;

  display: inline-block;
}

.difficultyEasy {
  background: #2563eb;
}

.difficultyMedium {
  background: #dc2626;
}

.difficultyHard {
  background: #111111;
}

/* ===================================== */
/* NAME */
/* ===================================== */

.walkName {

  min-width: 0;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  padding-right: 6px;

  font-size: 14px;
  font-weight: 500;

  color: #111;
}

/* ===================================== */
/* METRICS */
/* ===================================== */

.walkMetric {

  justify-self: start;

  font-size: 13px;
  font-weight: 500;

  color: #111;
}

#routeList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* walked more than once, or the same route in another dataset (ROUTE-SAME-02) */
.sameRouteBadge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 8px;
    background: #e3f1e6;
    color: #1f5130;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: 1px;
}


/* ===================================== */
/* MOBILE LIST */
/* ===================================== */

@media (max-width: 700px) and (orientation: portrait) {

    /* the loop column is hidden; score, difficulty, name, distance,
       elevation, duration and caches fit next to each other */
    #routeList {

        --walk-grid:
            40px
            12px
            minmax(0, 1fr)
            44px
            44px
            38px
            44px;

    }

    .walkHeader > :nth-child(2),
    .walkRow > :nth-child(2) {
        display: none;
    }

    .walkHeader,
    .walkRow {
        gap: 3px;
        padding: 0 6px;
    }

}

/* with the kcal column (UI-KCAL-02): one column more */
#routeList.withKcal {
    --walk-grid:
        54px
        24px
        26px
        minmax(0, 1fr)
        58px
        58px
        44px
        48px
        52px;
}

/* the phone has no room for it */
@media (max-width: 700px) and (orientation: portrait) {

    #routeList .kcalCell {
        display: none;
    }

    #routeList.withKcal {
        --walk-grid:
            40px
            12px
            minmax(0, 1fr)
            44px
            44px
            38px
            44px;
    }
}
