/*
Theme Name: Lean Tracks
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 {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 460px;
}
.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;
}

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

.track {
  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;
}
.track:last-child { border-bottom: 0; }
.track:hover { background: var(--row-hover); }

/* 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 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.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 {
  max-width: 760px;
  margin: 0 auto 80px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--row);
}

/* Featured image bleeds to the card's top edges */
.entry-featured {
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.entry-featured img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.entry-inner {
  padding: 40px 48px 52px;
}

.entry-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.entry-meta {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.entry-header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

.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-header h1 { font-size: 26px; }
  .entry-content { font-size: 16px; }
}

/* ---------- 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: 760px; 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; }

  .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; }
}
