*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  color: #111;
  margin: 0;
  padding: 0;
}

/* ── Layout ── */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Header ── */
.site-header {
  border-bottom: 2px solid #111;
  padding-bottom: 10px;
  margin-bottom: 28px;
}
.site-header h1 {
  font-size: 1em;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin: 0;
}
.site-header .meta {
  color: #666;
  font-size: 0.9em;
}

/* ── Month sections ── */
.month {
  margin-bottom: 36px;
}
.month-heading-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 2px solid #111;
  margin-bottom: 6px;
}
.month-heading {
  font-weight: bold;
  font-size: 1em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* month cover art grid — 6 per row, fills remaining header space */
.month-art {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}
.month-art a {
  display: block;
  background: none;
  padding: 0;
  margin: 0;
}
.month-art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border: none;
  outline: none;
}

/* ── Release table ── */
table {
  width: 100%;
  border-collapse: collapse;
}
td {
  padding: 3px 8px 3px 0;
  vertical-align: top;
}


/* date column */
td.date {
  white-space: nowrap;
  color: #555;
  width: 56px;
  padding-right: 12px;
}

/* artists + title */
td.release {
  width: 100%;
}
.artists {
  font-weight: bold;
}
.title a {
  text-decoration: none;
  color: #111;
  background: #f2f2f2;
}
.title a:hover {
  background: #ff0;
}
.title-plain {
  color: #111;
}

/* type badge */
td.type {
  white-space: nowrap;
}
.badge {
  font-size: 0.8em;
  padding: 1px 4px;
  border: 1px solid #aaa;
  color: #444;
  white-space: nowrap;
}
.badge-EP     { border-color: #888; }
.badge-Deluxe { border-color: #888; font-style: italic; }
.badge-Mixtape{ border-color: #888; }
.badge-nodsps { border-color: #c00; color: #c00; }
.btn-nodsps-active { border-color: #c00; color: #c00; background: #fff0f0; }

/* genres */
td.genres {
  white-space: nowrap;
  color: #555;
  font-size: 0.88em;
}
.genre-tag + .genre-tag::before {
  content: " · ";
  color: #bbb;
}

/* label */
td.label {
  color: #888;
  font-size: 0.88em;
  font-style: italic;
  white-space: nowrap;
}

/* features */
.features {
  font-size: 0.88em;
  color: #666;
}
.features::before { content: "w/ "; }

/* date group separator */
tr.day-gap td {
  padding-top: 8px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid #ccc;
  margin-top: 40px;
  padding-top: 10px;
  color: #999;
  font-size: 0.85em;
}

/* ── Admin ── */
.admin-section {
  margin-bottom: 40px;
}
.admin-heading {
  font-size: 0.9em;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.admin-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}
.admin-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-form label {
  font-size: 0.82em;
  color: #666;
}
.admin-form .hint {
  font-size: 0.85em;
  color: #aaa;
}
.admin-form input,
.admin-form select {
  font-family: inherit;
  font-size: 0.9em;
  border: 1px solid #ccc;
  padding: 3px 6px;
  background: #fff;
  color: #111;
}
.admin-form input:focus,
.admin-form select:focus {
  outline: 1px solid #111;
}
.form-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* buttons */
.btn {
  font-family: inherit;
  font-size: 0.85em;
  padding: 4px 10px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #333; }
.btn-sm {
  font-family: inherit;
  font-size: 0.78em;
  padding: 2px 6px;
  border: 1px solid #aaa;
  background: none;
  color: #444;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-sm:hover { border-color: #111; color: #111; }
.btn-danger { border-color: #c00; color: #c00; }
.btn-danger:hover { background: #c00; color: #fff; }

/* flash messages */
.flash {
  border: 1px solid #aaa;
  padding: 6px 10px;
  margin-bottom: 14px;
  font-size: 0.88em;
  background: #fffbe6;
}
.flash-error {
  border: 1px solid #c00;
  padding: 6px 10px;
  margin-bottom: 14px;
  font-size: 0.88em;
  background: #fff0f0;
  color: #c00;
}

/* admin release table */
.admin-table {
  font-size: 0.88em;
}
.admin-table th {
  text-align: left;
  padding: 2px 8px 4px 0;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  white-space: nowrap;
}
td.admin-actions {
  white-space: nowrap;
  padding-left: 8px;
}
td.listeners {
  white-space: nowrap;
  color: #888;
  font-size: 0.85em;
  padding-left: 8px;
}

/* admin table cover art column */
th.th-art, td.td-art {
  width: 32px;
  padding-right: 6px;
}
.admin-thumb {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid #ddd;
}
.no-art-dot {
  display: block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  font-size: 1.4em;
  color: #ddd;
}
tr.no-art td {
  background: #fffaf5;
}

/* cover preview in edit form */
.cover-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.cover-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid #ccc;
}
.remove-label {
  font-size: 0.82em;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Friday links on calendar */
a.friday-link {
  color: #111;
  text-decoration: none;
  border-bottom: 1px dashed #aaa;
}
a.friday-link:hover {
  background: #ff0;
  border-bottom-color: transparent;
}

/* ── Listener editing ── */
.listener-row, .listener-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.listener-name {
  font-size: 0.85em;
  min-width: 140px;
  flex-shrink: 0;
}
.listener-input {
  font-family: inherit;
  font-size: 0.85em;
  border: 1px solid #ccc;
  padding: 2px 6px;
  width: 130px;
}
.listener-input:focus {
  outline: 1px solid #111;
}

/* expandable listener count on draft page */
details.listener-popout {
  display: inline;
}
details.listener-popout summary {
  cursor: pointer;
  list-style: none;
  color: #888;
  font-size: 0.85em;
}
details.listener-popout summary::-webkit-details-marker { display: none; }
details.listener-popout summary::after { content: " ✎"; font-size: 0.75em; color: #ccc; }
details.listener-popout[open] summary::after { content: ""; }
.listener-forms {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 10px;
  z-index: 10;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
td.listeners {
  position: relative;
  white-space: nowrap;
}

/* ── Draft page ── */
.draft-input-section {
  margin-bottom: 28px;
}
.draft-header-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.draft-header-row .hint {
  font-size: 0.78em;
  color: #aaa;
}
.draft-textarea {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
  width: 100%;
  min-height: 160px;
  border: 1px solid #ccc;
  padding: 10px 12px;
  background: #fafafa;
  color: #111;
  resize: vertical;
  line-height: 1.6;
}
.draft-textarea:focus {
  outline: 1px solid #111;
  background: #fff;
}
.preview-type-heading {
  font-size: 0.82em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 14px 0 4px;
}
tr.draft-row td {
  background: #f5f8ff;
}
.draft-badge {
  font-size: 0.75em;
  color: #aaa;
  border: 1px solid #ddd;
  padding: 1px 4px;
}

/* preview sections */
.preview-section {
  margin-bottom: 36px;
}
.preview-heading {
  font-size: 0.9em;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.markdown-wrap {
  position: relative;
}
.markdown-wrap .btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.78em;
  padding: 2px 8px;
}
#markdown-output {
  background: #f7f7f7;
  border: 1px solid #ddd;
  padding: 14px 16px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85em;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ── Artist links ── */
a.artist-link {
  color: #111;
  text-decoration: none;
  border-bottom: 1px dotted #bbb;
}
a.artist-link:hover {
  background: #ff0;
  border-bottom-color: transparent;
}

/* ── From-release indicator on draft song rows ── */
.from-release {
  font-size: 0.82em;
  color: #888;
  font-style: italic;
}

/* ── Release link popout on draft songs ── */
details.release-link-popout {
  display: inline;
  position: relative;
}
details.release-link-popout > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
}
details.release-link-popout > summary::-webkit-details-marker { display: none; }
.release-link-list {
  position: absolute;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 10px;
  z-index: 20;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}
.release-link-form {
  display: block;
}
.release-link-none {
  font-size: 0.82em;
  color: #aaa;
  font-style: italic;
}
.btn-linked {
  border-color: #111;
  color: #111;
  font-weight: bold;
}

/* ── Artist page ── */
.artist-meta {
  margin-bottom: 20px;
  font-size: 0.9em;
  color: #555;
}
.artist-detail {
  margin-bottom: 4px;
}
.artist-detail-label {
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
  font-size: 0.82em;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.artist-releases-section {
  margin-bottom: 32px;
}
.artist-none {
  color: #aaa;
  font-size: 0.88em;
  font-style: italic;
}
.artist-edit-details > summary {
  margin-bottom: 6px;
}
