/*
Theme Name: Lean Tracks 5
Theme URI: https://example.com/lean-tracks
Author: Custom
Author URI: https://example.com
Description: A lean, white, minimalistic theme that lists posts on the homepage like tracks in a music player — wide, short rows with a left thumbnail, title, excerpt, and a Learn More action.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lean-tracks
*/

:root {
  --bg: #ffffff;
  --row: #ffffff;
  --row-hover: #fafafa;
  --line: #ececec;
  --ink: #161616;
  --muted: #8a8a8a;
  --accent: #161616;
  --radius: 10px;
  --maxw: 1240px;
  --thumb: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 12px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}
.site-branding { flex: 0 0 auto; }
.main-nav { flex: 0 0 auto; }
.site-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-title .dot { color: var(--muted); }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
}
.main-nav a {
  font-size: 14px;
  color: var(--muted);
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--ink); }

/* ---------- Header search ---------- */
.header-search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 560px;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}
/* Label dropdown in the search bar */
.lt-label-select--search {
  flex: 0 0 auto;
  height: 42px;
  max-width: 150px;
  padding: 0 30px 0 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background-color: #f6f6f6;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' 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;
  transition: background-color .15s ease, border-color .15s ease;
}
.lt-label-select--search:hover { background-color: #f1f1f1; }
.lt-label-select--search:focus { border-color: var(--line); background-color: #fff; }

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search-field {
  width: 100%;
  height: 42px;
  padding: 0 92px 0 42px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #f6f6f6;
  border: 1px solid transparent;
  border-radius: 999px;
  outline: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.search-field::placeholder { color: var(--muted); }
.search-field:hover { background: #f1f1f1; }
.search-field:focus {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 0 0 4px rgba(22,22,22,0.05);
}
.search-submit {
  position: absolute;
  right: 5px;
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.search-submit:hover { opacity: 0.85; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page intro ---------- */
.page-intro {
  padding: 56px 0 28px;
}
.page-intro h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Spacer where the homepage title used to be */
.list-spacer { height: 24px; }

/* Homepage custom header (title + blurb) — aligns to the track rows */
.home-header {
  padding: 40px 18px 8px;
}
.home-header-title {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.home-header-blurb {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 760px;
}
.home-header-blurb p { margin: 0 0 12px; }
.home-header-blurb p:last-child { margin-bottom: 0; }

/* Static-page content shown below the library — same width as the rows */
.front-page-content {
  margin: 56px 0 80px;
  padding: 0 18px;
}
.front-page-content .entry-content {
  font-size: 17px;
  line-height: 1.75;
}

/* ---------- Library filter bar ---------- */
.library-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 14px;
  padding: 0 6px;
}
.lt-label-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lt-label-filter-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.lt-label-select {
  height: 40px;
  min-width: 160px;
  padding: 0 34px 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background-color: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' 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 14px center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lt-label-select:hover { border-color: #d6d6d6; }
.lt-label-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22,22,22,0.05);
}
.lt-label-filter-go {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- Track list ---------- */
.tracklist {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.track {
  position: relative;
  display: grid;
  grid-template-columns: var(--thumb) 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: var(--row);
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
  cursor: pointer;
}
.track:last-child { border-bottom: 0; }
.track:hover { background: var(--row-hover); }

/* Whole-row click target via stretched title link */
.track-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.track-link { text-decoration: none; }

/* Keep thumbnail and button above the stretched overlay */
.track-thumb-link { position: relative; z-index: 2; }
.track-action { position: relative; z-index: 2; }

/* Learn more button — on the RIGHT */
.track-action .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.track:hover .btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.track-thumb {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
  flex: none;
}
.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.track-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfcfcf;
}

.track-body { min-width: 0; }
.track-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 2px;
}
.track-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

/* Inline labels next to the row title */
.track-title-row .entry-labels {
  margin-top: 0;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}
.track-title-row .entry-label {
  padding: 3px 9px 3px 6px;
  font-size: 11px;
  gap: 5px;
}
.track-title-row .entry-label--instrument,
.track-title-row .entry-label--free,
.track-title-row .entry-label--price,
.track-title-row .entry-label--size {
  padding-left: 9px;
}
.track-title-row .entry-label-icon {
  width: 14px;
  height: 14px;
}
.track-excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Pagination ---------- */
.pagination {
  margin: 32px 0 80px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Single / Page (card) ---------- */
.back-link {
  display: inline-block;
  margin: 36px 0 18px;
  font-size: 14px;
  color: var(--muted);
}
.back-link:hover { color: var(--ink); }

.entry-card {
  margin: 0 auto 80px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--row);
}

/* ----- Download card hero ----- */
.download-card {
  display: grid;
  grid-template-columns: 360px 1fr;
  border-bottom: 1px solid var(--line);
}
.download-card.no-thumb {
  grid-template-columns: 1fr;
}
.download-card-media {
  border-right: 1px solid var(--line);
  background: #f6f6f6;
}
.download-card-media img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  display: block;
}
.download-card-info {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.entry-meta {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.entry-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

/* Fallback header (page with no card) */
.entry-top {
  padding: 36px 40px 28px;
  border-bottom: 1px solid var(--line);
}
.entry-top .entry-title { font-size: 34px; }

/* ----- Labels ----- */
.entry-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.entry-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: #f4f4f4;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.entry-label-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.entry-label-text { line-height: 1; }

/* Pills with no icon get symmetric padding */
.entry-label--instrument,
.entry-label--free,
.entry-label--price,
.entry-label--size {
  padding-left: 12px;
}

/* Instrument — distinct color (indigo/blue) */
.entry-label--instrument {
  color: #3730a3;
  background: #eef0fb;
  border-color: #dadcf6;
}

/* Price: Free — green */
.entry-label--free {
  color: #166534;
  background: #e7f6ec;
  border-color: #cbecd6;
}

/* Price: Custom — red */
.entry-label--price {
  color: #b42318;
  background: #fdeceb;
  border-color: #f7d4d1;
}

/* Size — dark gray */
.entry-label--size {
  color: #f3f3f3;
  background: #3a3a3a;
  border-color: #3a3a3a;
}

/* ----- Download buttons ----- */
.entry-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: opacity .15s ease, transform .05s ease;
}
.download-btn:hover { opacity: 0.88; }
.download-btn:active { transform: translateY(1px); }
.download-btn svg { flex: none; }

/* ----- Body ----- */
.entry-inner {
  padding: 44px 40px 52px;
  max-width: 820px;
  margin: 0 auto;
}


.entry-content {
  font-size: 17px;
  line-height: 1.75;
}
.entry-content > :first-child { margin-top: 0; }
.entry-content h2 { font-size: 24px; letter-spacing: -0.02em; margin: 36px 0 12px; }
.entry-content h3 { font-size: 20px; margin: 28px 0 10px; }
.entry-content p { margin: 0 0 20px; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: 8px; margin: 24px 0; }
.entry-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 680px) {
  .entry-inner { padding: 28px 22px 36px; }
  .entry-top { padding: 26px 22px 22px; }
  .entry-title { font-size: 24px; }
  .entry-top .entry-title { font-size: 26px; }
  .entry-content { font-size: 16px; }

  .download-card { grid-template-columns: 1fr; }
  .download-card-media {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .download-card-info { padding: 26px 22px; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Comments (minimal) ---------- */
.comments-area { max-width: 820px; margin: 0 auto; padding-bottom: 80px; }
.comments-area h2 { font-size: 20px; margin-bottom: 20px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { padding: 16px 0; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .track {
    grid-template-columns: var(--thumb) 1fr;
    gap: 14px;
    padding: 12px 14px;
  }
  .track-action { grid-column: 1 / -1; }
  .track-action .btn { width: 100%; justify-content: center; }
  .main-nav { display: none; }
  .track-title, .track-excerpt { white-space: normal; }
  .track-title-row { flex-wrap: wrap; gap: 6px; }

  .home-header { padding: 30px 14px 6px; }
  .home-header-title { font-size: 24px; }
  .front-page-content { padding: 0 14px; }

  .library-bar { justify-content: stretch; padding: 0 2px; }
  .lt-label-filter { width: 100%; justify-content: space-between; }

  .site-header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }
  .header-search {
    order: 3;
    flex: 1 1 100%;
    justify-content: stretch;
  }
  .search-form { max-width: none; }
  .lt-label-select--search { max-width: 130px; }
}
