/* ==========================================================
   Pallet Town Watch Order — Master List (masterlist.html) only
   Loaded after css/base.css, so rules here can build on it.
   ========================================================== */

/* ---------- Overview (Master List) ----------
   Row 1: overall progress strip. Row 2: navy "Up next" band,
   with the current season's progress on the right. */
.overview { display: flex; flex-direction: column; gap: 12px; }

.overall {
  padding: 16px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overall__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

/* Episodes / movies / specials / shorts, under the overall bar */
.overall__types {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  gap: 12px 28px;
}

.breakdown__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.overall__types .breakdown__label { font-size: 14px; }

.overall__types .breakdown__count { font-size: 13px; }

.overall__types .bar { height: 5px; }

.overall__label { font-weight: 700; }

.overall__bar { flex: 1 1 240px; }   /* height comes from .bar in base.css */

.overall__count { font-family: var(--font-mono); font-size: 14px; color: var(--muted); white-space: nowrap; }

.breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.breakdown__item { display: flex; flex-direction: column; gap: 6px; }

.breakdown__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.breakdown__count {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--muted);
}

/* ---------- List header & toolbar ---------- */
.list-section { display: flex; flex-direction: column; gap: 16px; }

.list-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.list-section__head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.list-section__head p { margin: 4px 0 0; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .list-section__head h1 { font-size: 30px; }
}

.list-controls__expand { display: flex; gap: 2px; }

/* ---------- Master List filters ---------- */
.filters {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.filter {
  position: relative;
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Season names are long, so give that picker more room */
.filter[data-filter="season"] { flex: 2 1 300px; }

.filter__label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* The picker's button: looks like a drop-down, shows the current choice */
.filter__button {
  width: 100%;
  min-height: 44px;
  padding: 8px 40px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  /* down arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234F5B7A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.filter__button:hover { border-color: var(--ink); }

.filter__button[aria-expanded="true"] { border-color: var(--blue); }

.filter__value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A filter that's in use gets a yellow tint so it's easy to see what's applied */
.filter__button.is-active {
  border-color: var(--yellow-dark);
  background-color: var(--row-watched);
}

/* The panel of checkboxes that opens under the button */
.filter__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 25;
  width: max(100%, 280px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(29, 44, 94, 0.18);
  overflow: hidden;
}

.filter__panel[hidden] { display: none; }

.filter__options {
  margin: 0;
  padding: 6px;
  border: 0;
  max-height: 320px;
  overflow-y: auto;
}

.filter__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.filter__option:hover { background: var(--ground); }

.filter__option input { width: 20px; height: 20px; flex: 0 0 auto; cursor: pointer; }

.filter__option:has(input:checked) { background: var(--row-watched); }

.filter__panel-foot {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.filters__status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
}

.filters__count { font-family: var(--font-mono); font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Phones: Season across the full width, Type and Region side by side. */
@media (max-width: 640px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px; }
  .filter[data-filter="season"] { grid-column: 1 / -1; }
  .filters__status { grid-column: 1 / -1; }
  .filter__panel { min-width: min(300px, calc(100vw - 32px)); }
  .filter[data-filter="region"] .filter__panel { left: auto; right: 0; }   /* open toward the left so it stays on screen */
}

.next-band__tip {
  margin: 10px 0 0;
  max-width: 56ch;
  font-size: 15px;
  color: var(--on-dark-muted);
}

.next-band__tip strong { color: var(--on-dark); }
