/* =====================================================================
   PHASE 5.5 — Public listing surfaces (archive / category / search / blog)
   Mobile-first, text-first, namespaced. Loaded last; no !important except
   the Featured Image policy guards, which must not be overridable.
   Never styles ad chrome (.tgl-ad*), the header, or single-song typography.
   ===================================================================== */

.tgl-listing-page {
  --tgl-listing-gutter: 16px;
}

/* --- Page head ----------------------------------------------------- */
.tgl-listing-head {
  margin: 6px 0 14px;
}
.tgl-listing-head__eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--tgl-gold, #D4AF37);
}
.tgl-listing-head__title {
  margin: 4px 0 6px;
  font-size: clamp(22px, 5.2vw, 30px);
  line-height: 1.25;
  word-break: break-word;
}
.tgl-listing-head__count {
  margin: 0 0 8px;
  font-size: 14px;
  opacity: .78;
}
.tgl-listing-head__desc {
  font-size: 15px;
  line-height: 1.7;
}
.tgl-listing-head__desc p:last-child { margin-bottom: 0; }

/* --- Text-first song rows ------------------------------------------ */
.tgl-listing {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  background: var(--tgl-card, #fff);
  border: 1px solid var(--tgl-line, #e6e8ee);
  border-radius: 12px;
  overflow: hidden;
}

.tgl-srow {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 4px 10px;
  padding: 12px var(--tgl-listing-gutter, 16px);
  border-bottom: 1px solid var(--tgl-line, #e6e8ee);
}
.tgl-srow:last-child { border-bottom: 0; }

.tgl-srow__no {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  min-width: 1.8em;
  color: var(--tgl-gold, #D4AF37);
  font-variant-numeric: tabular-nums;
}

.tgl-srow__body { min-width: 0; }

.tgl-srow__title {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
}
.tgl-srow__title a {
  color: var(--tgl-navy, #002147);
  text-decoration: none;
}
.tgl-srow__title a:hover,
.tgl-srow__title a:focus-visible { text-decoration: underline; }

.tgl-srow__translit {
  margin: 2px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: .72;
}

.tgl-srow__meta {
  margin: 5px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
}
.tgl-srow__artist { opacity: .8; }
.tgl-srow__chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--tgl-line, #e6e8ee);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  opacity: .9;
}
.tgl-srow__chip:hover,
.tgl-srow__chip:focus-visible { border-color: var(--tgl-gold, #D4AF37); }

.tgl-srow__cta {
  grid-column: 2 / -1;
  justify-self: start;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--tgl-navy, #002147);
}
.tgl-srow__cta:hover,
.tgl-srow__cta:focus-visible { color: var(--tgl-gold, #D4AF37); text-decoration: underline; }

.tgl-listing-empty {
  padding: 18px var(--tgl-listing-gutter, 16px);
}

/* --- FEATURED IMAGE POLICY (Part 8) ---------------------------------
   Listing surfaces render no media markup at all. These guards catch
   any legacy/plugin-injected thumbnail so it can never reserve space. */
.tgl-listing .tgl-srow img,
.tgl-listing .tgl-srow figure,
.tgl-listing .tgl-srow .post-thumbnail,
.tgl-listing .tgl-srow .wp-post-image {
  display: none !important;
}

/* --- Pagination ------------------------------------------------------ */
.tgl-listing-page .tgl-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 20px;
}
.tgl-listing-page .tgl-pagination .page-numbers {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--tgl-line, #e6e8ee);
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  color: var(--tgl-navy, #002147);
  background: var(--tgl-card, #fff);
}
.tgl-listing-page .tgl-pagination .page-numbers.current {
  border-color: var(--tgl-gold, #D4AF37);
  font-weight: 700;
}

/* --- Mobile gutters / overflow safety (320–430px) -------------------- */
@media (max-width: 860px) {
  .tgl-listing-page { overflow-x: hidden; }
  .tgl-listing-page .tgl-srow { padding-left: 14px; padding-right: 14px; }
  .tgl-srow__title { font-size: 16.5px; }
}

@media (max-width: 360px) {
  .tgl-srow { gap: 3px 8px; }
  .tgl-srow__no { font-size: 12px; min-width: 1.6em; }
  .tgl-srow__title { font-size: 16px; }
}

/* --- Desktop refinement (>=861px) ------------------------------------ */
@media (min-width: 861px) {
  .tgl-srow {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 4px 16px;
    padding: 14px 18px;
  }
  .tgl-srow__cta {
    grid-column: auto;
    justify-self: end;
    margin-top: 0;
    white-space: nowrap;
  }
  .tgl-srow__title { font-size: 18px; }
}

/* --- Footer mobile polish (no redesign; spacing + overflow only) ------ */
@media (max-width: 860px) {
  .tgl-footer--premium .tgl-footer__grid { gap: 22px; }
  .tgl-footer--premium .tgl-footer-col ul { margin: 8px 0 0; }
  .tgl-footer--premium .tgl-footer-col li a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  .tgl-footer--premium .tgl-footer__bottom { padding-bottom: 14px; }
  .tgl-footer--premium * { max-width: 100%; }
}
