/* ─────────────────────────────────────────────
   Dance Catalogue — shared styles
   Inherits the quiet serif voice of mattnock.com.
   ───────────────────────────────────────────── */

/* ── Reset / base ──────────────────────────────────────────────────────────── */

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

/* ── Page scaffold ─────────────────────────────────────────────────────────── */

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  color: #2c3e50;
  background-color: #f9f8f6;
  margin: 0;
  padding: 0;
}

/* The dance section uses a wider max-width than the main site (780px vs 680px)
   so the video player has room to breathe. */
.page-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Links ─────────────────────────────────────────────────────────────────── */

a {
  color: #2c3e50;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.quiet-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.quiet-link:hover,
.quiet-link:focus {
  border-bottom-color: #2c3e50;
  text-decoration: none;
}

/* ── Site nav header ───────────────────────────────────────────────────────── */

.site-nav {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 36px;
  letter-spacing: 0.01em;
}

.site-nav a {
  color: #888;
  text-decoration: none;
}

.site-nav a:hover {
  color: #2c3e50;
  text-decoration: underline;
}

/* Nav-level search — floated to top-right */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #d8d4cf;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  height: 28px;
}

.nav-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  color: #2c3e50;
  padding: 0 8px;
  width: 140px;
  height: 100%;
  /* Remove browser-default search input decoration */
  -webkit-appearance: none;
  appearance: none;
}

.nav-search-input::placeholder {
  color: #bbb;
}

/* Hide the browser's native clear (×) button on search inputs */
.nav-search-input::-webkit-search-cancel-button {
  display: none;
}

.nav-search-btn {
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  padding: 0 7px;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.1s;
}

.nav-search-btn:hover {
  color: #2c3e50;
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */

.breadcrumb {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumb a {
  color: #888;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #2c3e50;
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #bbb;
  user-select: none;
}

.breadcrumb-current {
  color: #2c3e50;
}

/* ── Page titles ───────────────────────────────────────────────────────────── */

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

/* Collection color accent — a quiet left-border echo of the card the user just
   clicked. Set via --collection-accent on the body by the page's inline script. */
body.has-collection-accent .page-title {
  border-left: 3px solid var(--collection-accent);
  padding-left: 14px;
}

.page-subtitle {
  font-size: 1rem;
  color: #666;
  margin: 0 0 40px;
  font-style: italic;
}

/* ── Section headings ──────────────────────────────────────────────────────── */

.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 20px;
}

/* ── Card grid ─────────────────────────────────────────────────────────────── */

/* Used for collection cards, piece cards, and video cards. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

/* On small phones, full-width cards */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Video card ────────────────────────────────────────────────────────────── */

.video-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #ccc;
  text-decoration: none;
}

.video-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e8e5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card-thumb-placeholder {
  color: #bbb;
  font-size: 2rem;
}

.video-card-body {
  padding: 14px 16px 16px;
}

.video-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}

.video-card-dancers {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-song {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-meta {
  font-size: 0.75rem;
  color: #999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.video-card-comments {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 4px;
}

.video-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* ── Piece card (sub-collection) ───────────────────────────────────────────── */

.piece-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.piece-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #ccc;
  text-decoration: none;
}

.piece-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e8e5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.piece-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.piece-card-thumb-placeholder {
  color: #bbb;
  font-size: 2rem;
}

.piece-card-body {
  padding: 14px 16px 16px;
}

.piece-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}

.piece-card-meta {
  font-size: 0.75rem;
  color: #999;
}

/* ── Collection card (homepage) ────────────────────────────────────────────── */

.collection-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  padding: 20px 20px 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.collection-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #ccc;
  text-decoration: none;
}

/* Earthy solid-color variant */
.collection-card--colored {
  background: var(--card-bg, #b8a898);
  border-color: transparent;
  color: var(--card-color, #fff);
}

.collection-card--colored:hover {
  border-color: transparent;
  filter: brightness(0.93);
}

.collection-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.collection-card-count {
  font-size: 0.8rem;
  color: #999;
}

/* Count text on colored cards: uses --card-count-color set per-card in JS */
.collection-card--colored .collection-card-count {
  color: var(--card-count-color, rgba(255, 255, 255, 0.75));
}

/* ── Tags ──────────────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: Georgia, serif;
  color: #666;
  background: #f0ede8;
  border-radius: 3px;
  padding: 2px 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  border: none;
}

.tag:hover,
.tag.active {
  background: #2c3e50;
  color: #fff;
  text-decoration: none;
}

/* ── Hero video block (homepage) ───────────────────────────────────────────── */

.hero {
  margin-bottom: 44px;
}

.hero-player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.hero-player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.hero-player-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.9rem;
  font-style: italic;
}

/* "Latest" badge — sits in the top-left corner of the hero frame */
.hero-latest-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(44, 62, 80, 0.72);
  border-radius: 3px;
  padding: 3px 8px;
  pointer-events: none;
  user-select: none;
  /* Sits above the iframe */
  z-index: 1;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.2;
}

.hero-song {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 4px;
}

.hero-meta {
  font-size: 0.85rem;
  color: #999;
  margin: 0 0 10px;
}

/* Breadcrumb line: "Collection · Sub-collection" */
.hero-breadcrumb {
  font-size: 0.85rem;
  color: #999;
  margin: 0 0 4px;
}

.hero-breadcrumb-link {
  color: inherit;
  text-decoration: none;
}

.hero-breadcrumb-link:hover {
  text-decoration: underline;
}

/* Date line below breadcrumb */
.hero-date {
  font-size: 0.85rem;
  color: #999;
  margin: 0 0 10px;
}

/* Collection link inside hero meta — inherits the muted #999 tone */
.hero-collection {
  color: inherit;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Video player page ─────────────────────────────────────────────────────── */

.player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.player-wrap-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.video-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.2;
}

.video-song {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 4px;
}

.video-dancers {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 4px;
}

.video-date {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 4px;
}

.video-location {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.video-location a {
  color: #888;
}

.video-location a:hover {
  color: #2c3e50;
  text-decoration: underline;
}

.location-sep {
  color: #bbb;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.video-description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e8e5e0;
}

/* ── Comments ──────────────────────────────────────────────────────────────── */

.comments-section {
  margin-top: 8px;
}

.comments-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.comments-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.comments-count {
  font-size: 0.85rem;
  color: #999;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.comment-item {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  padding: 14px 16px;
  position: relative;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-timestamp-link {
  font-size: 0.8rem;
  color: #2c7bb6;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8rem;
}

.comment-timestamp-link:hover {
  text-decoration: underline;
}

.comment-age {
  font-size: 0.75rem;
  color: #bbb;
  margin-left: auto;
}

.comment-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #2c3e50;
  margin: 0;
}

.comment-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}

.comment-delete-btn:hover {
  color: #c0392b;
  background: #fef5f4;
}

/* Skeleton loading */
.comment-skeleton {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  padding: 14px 16px;
}

.skel-line {
  height: 12px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skel-line.short  { width: 35%; }
.skel-line.medium { width: 60%; }
.skel-line.wide   { width: 85%; }
.skel-line.full   { width: 100%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Comment form ──────────────────────────────────────────────────────────── */

.comment-form {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 6px;
  padding: 20px;
  margin-top: 8px;
}

.comment-form-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #aaa;
  margin: 0 0 12px;
}

.form-row {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  border: 1px solid #d8d4cf;
  border-radius: 4px;
  background: #fafaf9;
  color: #2c3e50;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: #2c3e50;
  background: #fff;
}

.form-textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  border: 1px solid #d8d4cf;
  border-radius: 4px;
  background: #fafaf9;
  color: #2c3e50;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s;
  outline: none;
}

.form-textarea:focus {
  border-color: #2c3e50;
  background: #fff;
}

/* Timestamp capture display */
.timestamp-capture {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #888;
  min-height: 22px;
}

.timestamp-capture .ts-value {
  font-weight: 600;
  color: #2c7bb6;
  font-variant-numeric: tabular-nums;
}

.timestamp-capture .ts-clear {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 2px;
  font-family: inherit;
  transition: color 0.1s;
}

.timestamp-capture .ts-clear:hover {
  color: #888;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.form-error {
  font-size: 0.8rem;
  color: #c0392b;
  flex: 1;
  margin: 0;
}

.btn-post {
  background: #2c3e50;
  color: #fff;
  border: none;
  padding: 9px 22px;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-post:hover {
  background: #1a252f;
}

.btn-post:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* Spinner inside post button */
.btn-post .spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Empty / error states ──────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #aaa;
  font-style: italic;
  font-size: 0.95rem;
}

.error-state {
  text-align: center;
  padding: 24px;
  color: #888;
  font-size: 0.9rem;
}

.error-state button {
  margin-top: 10px;
  background: none;
  border: 1px solid #ccc;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #666;
  transition: border-color 0.15s;
}

.error-state button:hover {
  border-color: #2c3e50;
  color: #2c3e50;
}

/* ── Delete confirm overlay ─────────────────────────────────────────────────── */

.delete-confirm {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  font-size: 0.85rem;
  color: #555;
}

.delete-confirm.visible {
  display: flex;
}

.delete-confirm button {
  background: none;
  border: 1px solid #ccc;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 0.8rem;
  color: #555;
  transition: border-color 0.15s, color 0.15s;
}

.delete-confirm .btn-confirm-delete {
  border-color: #c0392b;
  color: #c0392b;
}

.delete-confirm .btn-confirm-delete:hover {
  background: #c0392b;
  color: #fff;
}

/* ── Sort control ──────────────────────────────────────────────────────────── */

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: #888;
}

.sort-control select {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  color: #555;
  border: 1px solid #d8d4cf;
  background: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
}

.sort-control select:focus {
  border-color: #2c3e50;
}

/* ── Search page ───────────────────────────────────────────────────────────── */

.search-input-wrap {
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  font-family: Georgia, serif;
  font-size: 1rem;
  border: 1px solid #d8d4cf;
  border-radius: 6px;
  background: #fff;
  color: #2c3e50;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: #2c3e50;
}

.search-tags-wrap {
  margin-bottom: 28px;
}

.search-tags-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 10px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-results-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8e5e0;
}

/* ── Homepage search CTA ───────────────────────────────────────────────────── */

.search-cta {
  border-top: 1px solid #e8e5e0;
  padding-top: 24px;
  margin-top: 8px;
}

.search-cta a {
  display: inline-block;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  padding: 10px 0;
}

.search-cta a:hover {
  color: #2c3e50;
  text-decoration: underline;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid #e8e5e0;
  margin: 32px 0;
}

/* ── Video detail page: wide page-wrap ─────────────────────────────────────── */

/* The detail page uses a two-column layout that needs more horizontal room
   than the default 780px reading width used elsewhere in the dance section. */
.page-wrap--wide {
  max-width: 1100px;
}

/* ── Video detail page: two-column grid layout ──────────────────────────────── */

/*
  Three named grid areas across two columns:

    [player ] [meta]
    [notes  ] [meta]

  The video dominates the left column; metadata fills the right column top to
  bottom. Notes sit under the video in the left column.
*/
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "player meta"
    "notes  meta";
  column-gap: 48px;
  row-gap: 0;
  align-items: start;
}

.detail-player {
  grid-area: player;
}

.detail-right {
  grid-area: meta;
  /* Stick to the top while the left column scrolls */
  position: sticky;
  top: 24px;
  /* Align to the top of its grid area regardless of left-column height */
  align-self: start;
}

.detail-notes {
  grid-area: notes;
}

/* ── Player: remove default margin-bottom (notes follow immediately) ─────────── */

.detail-player .player-wrap {
  margin-bottom: 0;
}

/* ── Notes section: form on top, notes below ────────────────────────────────── */

/* The form sits directly below the video. A quiet top border separates it from
   the player frame without adding a heading or extra visual weight. */
.detail-notes .comment-form {
  background: transparent;
  border: none;
  border-top: 1px solid #e8e5e0;
  border-radius: 0;
  padding: 20px 0 0;
  margin-top: 0;
}

/* Submitted notes have a small gap above them after the form */
.detail-notes .comment-list {
  margin-top: 20px;
  margin-bottom: 0;
}

/* ── Right column metadata ───────────────────────────────────────────────────── */

/* .detail-meta-disclosure is a plain <div> — not a <details> element.
   This means the browser UA stylesheet never hides its contents.
   Desktop: body always visible; toggle button hidden via CSS.
   Mobile: body hidden by default, shown when .is-open is toggled by JS. */
.detail-meta-disclosure {
  display: block;
}

/* Toggle button: visible on mobile only */
.detail-meta-summary {
  display: none;
}

/* Body is always block — no UA-stylesheet interference */
.detail-meta-body {
  display: block;
  padding: 0;
}

/* The video description in the right column doesn't need the heavy
   border-bottom that separated it from the notes in the old single-column
   layout. Remove it so it reads as a natural end to the metadata block. */
.detail-right .video-description {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ── Metadata field hierarchy (right column) ─────────────────────────────────── */

/*
  Visual hierarchy without labels — each field reads as a distinct type of
  information through size, weight, colour, and spacing alone.

  Field order and visual register:
    Title      — large, bold, primary ink: the named subject
    Song       — italic, mid-tone: music register, self-evident
    Dancers    — semibold, primary ink: named people carry weight
    Date       — small, muted: timestamp, clearly secondary
    Location   — small, quieter link colour: navigational breadcrumb
    Tags       — pill chips: already visually self-contained
    Description — body prose, below a hairline rule when present
*/
.meta-field {
  margin-bottom: 14px;
}

.meta-field:last-of-type {
  margin-bottom: 0;
}

/* Inner field values: zero out their own margins — spacing comes from .meta-field */
.meta-field .video-song,
.meta-field .video-dancers,
.meta-field .video-date,
.meta-field .video-location,
.meta-field .video-tags {
  margin: 0;
}

/* Title: primary heading — scaled for the narrower right column */
.detail-meta-body .video-title {
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 16px;
}

/* Song: italic signals music without a label */
.detail-meta-body .video-song {
  font-style: italic;
  font-size: 0.9rem;
  color: #555;
}

/* Dancers: named people — slightly heavier than metadata fields */
.detail-meta-body .video-dancers {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c3e50;
}

/* Date: small, clearly secondary — reads as a timestamp */
.detail-meta-body .video-date {
  font-size: 0.8rem;
  color: #999;
}

/* Location/breadcrumb: navigational, slightly smaller than body */
.detail-meta-body .video-location {
  font-size: 0.82rem;
  color: #888;
}

/* Tags: already chip-styled via .tag — just ensure no extra margin */
.detail-meta-body .video-tags {
  margin-bottom: 0;
}

/* Description: sits after a natural gap below the last field */
.detail-meta-body .video-description {
  margin-top: 16px;
}

/* ── Responsive: narrow / mobile layout ─────────────────────────────────────── */

/*
  On narrow screens, collapse to a single column with natural DOM order:
    1. Player
    2. Video details (collapsible)
    3. Note form
    4. Submitted notes

  The three grid children are in exactly this order in the HTML:
  detail-player → detail-right → detail-notes
  so on mobile we just need a single-column stack with no reordering.
*/
@media (max-width: 720px) {
  /* Switch to flex column; all children go full width by default */
  .detail-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Explicit full width on every child — belt-and-suspenders against any
     inherited sizing from the grid context above the breakpoint. */
  .detail-player,
  .detail-right,
  .detail-notes {
    width: 100%;
    min-width: 0;
  }

  /* Right column: no longer sticky */
  .detail-right {
    position: static;
  }

  /* ── Mobile disclosure toggle ─────────────────────────── */

  /* "› Details" button — compact, inline chevron + text.
     Only a top border: separator below comes from the note form's border-top
     or (when open) from the description's border-bottom. Nothing orphans. */
  .detail-meta-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    cursor: pointer;
    background: none;
    border: none;
    border-top: 1px solid #e8e5e0;
    border-radius: 0;
    padding: 9px 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.8rem;
    color: #aaa;
    text-align: left;
    user-select: none;
  }

  /* Rotating chevron sits before the "Details" text */
  .detail-meta-summary::before {
    content: '›';
    font-size: 1rem;
    color: #bbb;
    transition: transform 0.15s;
    display: inline-block;
    line-height: 1;
  }

  /* Chevron rotates when disclosure is open */
  .detail-meta-disclosure.is-open .detail-meta-summary::before {
    transform: rotate(90deg);
  }

  /* Body hidden by default on mobile; shown when .is-open is added by JS */
  .detail-meta-body {
    display: none;
    padding: 16px 0 4px;
  }

  .detail-meta-disclosure.is-open .detail-meta-body {
    display: block;
  }

  /* On mobile the description sits above the note form.
     Restore a bottom separator so there's a clean edge before the note field. */
  .detail-right .video-description {
    border-bottom: 1px solid #e8e5e0;
    margin-bottom: 0;
    padding-bottom: 20px;
  }

  /* Remove the note form's top border on mobile — the summary's border-top
     already marks the boundary between player and the detail/notes block.
     When collapsed, nothing orphans. When open, the description's border-bottom
     provides the separator before the note field. */
  .detail-notes .comment-form {
    border-top: none;
  }
}
