/* =====================================================================
   Algaita — Movies listing page
   Builds on home.css (cards, buttons, colours)
===================================================================== */

/* Breadcrumb */
.mv-crumbs {
  margin-top: 18px;
}

.mv-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--hp-muted);
  font-size: 13px;
}

.mv-crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mv-crumbs .hp-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.mv-crumbs a {
  color: var(--hp-muted);
  text-decoration: none;
}

.mv-crumbs a:hover {
  color: var(--hp-accent);
}

.mv-crumbs [aria-current] {
  color: var(--hp-text);
  font-weight: 600;
}

/* Page heading */
.mv-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Stop old style.css rules from painting text areas white */
.mv-head h1,
.mv-head p,
.mv-head-text {
  background: transparent;
  box-shadow: none;
}

.mv-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3.6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.mv-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--hp-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.mv-count {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  background: var(--hp-surface);
  color: var(--hp-text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mv-count .hp-icon {
  color: var(--hp-accent);
}

/* Filter + sort bar */
.mv-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 0;
  padding: 12px;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-radius-lg);
  background: var(--hp-surface);
}

.mv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mv-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hp-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mv-field label .hp-icon {
  width: 14px;
  height: 14px;
}

.mv-select {
  position: relative;
}

/* 16px stops iPhones zooming in on tap */
.mv-select select {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 32px 0 12px;
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  background: var(--hp-surface-2);
  color: var(--hp-text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mv-select select:focus {
  border-color: rgba(245, 179, 1, 0.6);
  outline: none;
  box-shadow: 0 0 0 4px rgba(245, 179, 1, 0.12);
}

.mv-select select option {
  background: var(--hp-surface-2);
  color: var(--hp-text);
}

.mv-select > .hp-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--hp-muted);
  pointer-events: none;
}

.mv-toolbar noscript,
.mv-clear {
  grid-column: 1 / -1;
}

.mv-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 12px;
  color: var(--hp-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.mv-clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mv-clear .hp-icon {
  width: 16px;
  height: 16px;
}

/* Search note */
.mv-search-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 179, 1, 0.25);
  border-radius: var(--hp-radius);
  background: var(--hp-accent-soft);
  color: var(--hp-text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.mv-search-note strong {
  color: var(--hp-accent);
}

.mv-search-note a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hp-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.mv-search-note a:hover {
  color: var(--hp-accent);
}

.mv-search-note .hp-icon {
  width: 15px;
  height: 15px;
}

/* Results */
.mv-range {
  margin: 20px 0 12px;
  color: var(--hp-muted);
  font-size: 13px;
}

.mv-card-cat {
  display: block;
  margin: 3px 2px 0;
  overflow: hidden;
  color: var(--hp-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.mv-empty {
  margin-top: 22px;
}

.mv-empty h2 {
  margin: 12px 0 6px;
  color: #fff;
  font-size: 18px;
}

.mv-empty .hp-btn {
  margin-top: 18px;
}

.mv-empty .hp-btn .hp-icon {
  width: 18px;
  height: 18px;
  color: inherit;
}

.mv-empty-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.mv-empty-cats a {
  padding: 6px 14px;
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  color: var(--hp-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.mv-empty-cats a:hover {
  border-color: var(--hp-accent);
  color: var(--hp-accent);
}

/* Pagination (styles the HTML made by paginate() in helpers.php) */
.mv-pager {
  margin-top: 32px;
}

.mv-pager .pagination,
.mv-pager ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mv-pager a,
.mv-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  background: var(--hp-surface);
  color: var(--hp-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.mv-pager a:hover {
  border-color: rgba(245, 179, 1, 0.5);
  background: var(--hp-surface-2);
  color: #fff;
}

.mv-pager .current,
.mv-pager .active,
.mv-pager [aria-current] {
  border-color: var(--hp-accent);
  background: var(--hp-accent);
  color: var(--hp-accent-ink);
  font-weight: 800;
}

.mv-pager .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mv-pager .dots {
  min-width: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--hp-muted);
}

/* Inner span inside a list item shouldn't get a second box */
.mv-pager li > a > span,
.mv-pager li > span > span {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
}

/* Responsive: 2 per row on phones */
.mv-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
}

.mv-grid .hp-card-title {
  font-size: 14px;
}

@media (min-width: 600px) {
  .mv-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .mv-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
  }

  .mv-count {
    align-self: auto;
  }

  .mv-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
  }

  .mv-field {
    width: 240px;
  }

  .mv-clear {
    margin-left: auto;
    padding: 0 14px;
  }
}

@media (min-width: 900px) {
  .mv-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .mv-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .mv-pager a,
  .mv-pager span {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }
}
