
.broadcast-cite-container{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.cite-icon {
  width: 20px;
  height: 20px;
}

.broadcast-hidden-content {
  position: relative;
  padding-right: 30px; /* reserve space for expand arrow */
}


.broadcast-item {
  position: relative;
  padding-right: 56px; /* reserve space for expand arrow */
}

.broadcast-expand-button {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2; /* keep arrow above content */
}

/* Inline citation chooser and container */
.inline-cite-bar {
  display: none;
  gap: 8px;
  margin-top: 8px;
}
.inline-cite-bar.show { 
  display: flex; 
  justify-content: flex-start;
  width: 15%;
  margin: 0 auto;
  margin-top: 1em;
  gap: 20px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-4px);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cite-choice-btn { 
  font-size: 16px; 
  padding: 6px 8px; 
  background-color: white; 
  color: var(--primary-color); 
  border: 1px solid var(--primary-color); 
  border-radius: 4px;
  width: fit-content;  }


.cite-choice-btn:hover { background-color: var(--primary-color); color: white; }
.inline-citation-container {
  display: none;
  margin-top: 8px;
  border: 1px solid #e2e4ea;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 10px;
}
.inline-citation-container.show { display: block; }
.inline-citation-raw {
  margin: 0 0 8px 0;
  white-space: pre-wrap;  
  word-break: break-word;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #1f2937;
}
/* Removed copy action styles (no longer used) */

/* Inline share field */
/* Inline share UI removed in favor of copy-to-clipboard + toast */

/* Citation Modal Styles */
.citation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.citation-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

.citation-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
}

.citation-modal-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 18px;
}

.citation-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.citation-modal-close:hover {
  background-color: #e5e7eb;
}

.citation-modal-body {
  padding: 20px;
}

.citation-modal-body p {
  margin: 0 0 15px 0;
  color: #374151;
}

.citation-preview {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 15px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
}

.citation-modal-footer {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  text-align: right;
  background: #f8f9fa;
}

/* Episode actions layout */
.episode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 6px 0;
}

.episode-actions-left {
  flex: 0 0 auto;
}

.episode-actions-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}

/* Consistent small action buttons */
.episode-actions .btn {
  background-color: #f6f7f9;
  color: #1f2937;
  border: 1px solid #e2e4ea;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.episode-actions .btn:hover {
  background-color: #ffffff;
  border-color: #cfd4dd;
}

/* Transcript button hover - match cite/share exactly */
.transcript-toggle:hover {
  background-color: #ffffff !important;
  border-color: #cfd4dd;
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.action-icon {
  width: 1.4em;
  height: 1.4em;
  position: relative;
}

.action-btn {
  position: relative;
}

.action-btn:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.action-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.action-btn::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.action-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

.cite-select {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--primary-color);
  background-color: whitesmoke;
}

.cite-select:hover{ filter: brightness(1.06); }
.cite-select:active{ transform: translateY(1px); }

/* Cite controls styling */
.cite-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f6f7f9;
  border: 1px solid #e2e4ea;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  height: 32px; /* Match button height */
  box-sizing: border-box;
  margin: 0;
  vertical-align: top;
}

.cite-label {
  color: #1f2937 !important;
  font-weight: 600 !important;
  margin: 0 !important;
  font-size: 12px;
  white-space: nowrap;
  line-height: 1.2;
}

.cite-select {
  appearance: none;
  border: 1px solid #d1d5db;
  cursor: pointer;
  font-weight: 500;
  border-radius: 4px;
  padding: 4px 8px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 12px;
  min-width: 80px;
  height: 20px; /* Match button content height */
  line-height: 1.2;
}

.cite-select:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.cite-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0,56,184,0.1);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Reset, simple and spacious mobile layout */
  .broadcast-item-container {
    margin: 12px 0;
    border-radius: 8px;
    position: relative;
    padding: 15px 2px;
    min-height: 10em;
    overflow: visible; 
    display: block;
  }

  .broadcast-expand-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
  }

  .inline-cite-bar { margin-left: 0  !important;}

  .expand-arrow { width: 20px; height: 20px; opacity: 0.8; }

  .broadcast-item {
    padding: 16px !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .broadcast-item h4 { font-size: 18px; line-height: 1.3; margin: 0 0 6px 0; }
  .broadcast-item p { margin: 0 0 10px 0; }
  .guest-subheading { margin-bottom: 10px; font-size: 14px; }

  .episode-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 10px 0;
    padding-right: 40px; /* space for expand button */
  }
  .episode-actions-left { width: 100%; }
  .episode-actions-right { width: 100%; display: flex; gap: 8px; justify-content: center; }
  .episode-actions .btn { padding: 8px 10px; font-size: 12px; min-width: 0; }

  .transcript-toggle { width: 100%; padding: 10px 12px; justify-content: center; white-space: nowrap; }
  .transcript-toggle .action-icon { margin-right: 6px; }

  .transcript-content { padding: 12px; font-size: 14px; line-height: 1.5; margin-top: 8px; }

  .broadcast-item audio { width: 100%; max-width: 100%; margin-bottom: 10px; }
  .inline-audio-card { padding: 12px; border-radius: 10px; width: 100%; }
/* Custom audio player (CAP) styles - compact and simple */
/* Defaults: use CAP everywhere; hide native */
.cap-player { display: grid; }
.mobile-audio-ui { display: none !important; }
.inline-audio-card audio.cap-audio { display: none !important; }
/* Use custom player on mobile, native on desktop */
@media (max-width: 768px) {
  .inline-audio-card .cap-player { max-width: 560px; }
}
@media (min-width: 769px) {
  .inline-audio-card .cap-player { max-width: 960px; }
}

.cap-player {
  height: 60px;
  width: 100%;
  max-width: 720px; /* wider on desktop */
  background: #ffffff; /* white background */
  border: 1px solid #e5e7eb; /* light grey border */
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  font-family: var(--font-family);
  color: var(--text-alt);
  font-size: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 6px auto;
  border-radius: 8px;
}
.cap-timeline {
  background: #fff;
  width: 100%;
  position: relative;
  cursor: pointer;
  box-shadow: 0 2px 10px 0 #00000014;
}
.cap-progress { background: var(--primary-color); width: 0%; height: 100%; transition: 0.25s; }
.cap-controls { display: flex; justify-content: space-between; align-items: stretch; padding: 0 16px; }
.cap-name { display: block; font-weight: 500; color: var(--text-alt); }
.cap-controls > * { display: flex; justify-content: center; align-items: center; }
.cap-toggle-play.cap-play {
  cursor: pointer; position: relative; left: 0; height: 0; width: 0;
  border: 7px solid transparent; border-left: 13px solid #111;
}
.cap-toggle-play.cap-play:hover { transform: scale(1.05); }
.cap-toggle-play.cap-pause { height: 15px; width: 20px; cursor: pointer; position: relative; }
.cap-toggle-play.cap-pause:before,
.cap-toggle-play.cap-pause:after {
  position: absolute; top: 0; content: ""; height: 15px; width: 3px; background: #111;
}
.cap-toggle-play.cap-pause:before { left: 0; }
.cap-toggle-play.cap-pause:after { right: 8px; }
.cap-time { display: flex; gap: 4px; align-items: center; }
.cap-name { display: none; }
.cap-volume-container { position: relative; cursor: pointer; }
.cap-volume-button { height: 26px; display: flex; align-items: center; }
.cap-volume { transform: scale(0.7); width: 14px; height: 14px; position: relative; }
.cap-volume-medium { background: transparent; }
.cap-volume-slider {
  position: absolute; left: -3px; top: 15px; z-index: 1; width: 0; height: 15px;
  background: #111; box-shadow: 0 0 20px #0000001a; transition: .25s;
}
.cap-volume-percentage { background: var(--primary-color); height: 100%; width: 75%; }
.cap-volume-container:hover .cap-volume-slider { left: -123px; width: 120px; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .episode-actions {
    margin: 10px 0 6px 0;
  }
  
  .episode-actions .btn {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .cite-controls {
    padding: 6px 8px;
  }
  
  .broadcast-item {
    padding: 10px 12px;
  }
  
  .broadcast-item h3 {
    font-size: 15px;
  }
  
  .action-icon {
    width: 1.1em;
    height: 1.1em;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Architectural, crisp card overrides */
.broadcast-item-container {
  border-radius: 4px;
  border: 1px solid #e2e4ea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}

/* Keep the expanded episode visible at the top while scrolling */
.broadcast-item-container.active {
  position: static;
  top: auto;
  z-index: auto;
  background: #ffffff;
  margin-bottom: 0.75em;
}

/* When sticking to bottom (overrides top) */
.broadcast-item-container.active.stick-bottom { bottom: auto; }

/* When the floating player is active, give sticky cards extra bottom margin
   so they don't sit flush against the player */
body.has-floating-player .broadcast-item-container.active { margin-bottom: 0.75em; }

/* Primary color accent bar on the left */
.broadcast-item-container::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-color);
  opacity: 0.85;
}

/* Title styling without underline */
.broadcast-item h4 {
  margin: 0 0 6px 0;
  display: inline-block;
}

/* Highlight targeted episode heading */
h4:target {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  background: rgba(0,56,184,0.06);
  border-radius: 4px;
  padding: 2px 4px;
}

/* Unified action bar */
.episode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.episode-actions-left,
.episode-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Consistent small action buttons */
.episode-actions .btn {
  background-color: #f6f7f9;
  color: #1f2937;
  border: 1px solid #e2e4ea;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.episode-actions .btn:hover {
  background-color: #ffffff;
  border-color: #cfd4dd;
}

/* Transcript button hover - match cite/share exactly */
.transcript-toggle:hover {
  background-color: #ffffff !important;
  border-color: #cfd4dd;
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.action-icon {
  width: 1.4em;
  height: 1.4em;
  position: relative;
}

.action-btn {
  position: relative;
}

.action-btn:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.action-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.action-btn::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.action-btn:hover::before {
  opacity: 1;
  visibility: visible;
}




/* Tighter spacing for a structured feel */
.broadcast-item {
  padding-top: 14px;
  padding-bottom: 14px;
  min-height: 160px;
}

/* Hover/active refinements */
.broadcast-item-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
  border-color: #d7dbe3;
}

.broadcast-item-container.active {
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(0,56,184,0.18);
}

/* Audio player - crisp, white, sharp corners */
.broadcast-item audio {
  width: 98%;
  max-width: 98%;
  max-height: 44px;
  background: #ffffff;
  border: 1px solid #e2e4ea;
  border-radius: 4px;
  padding: 6px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: block;
}


/* Always allow full width on narrow screens */
@media (max-width: 640px) {
  .broadcast-item audio {
    max-width: 100%;
  }
}

/* WebKit controls theming (Chrome/Safari) */
.broadcast-item audio::-webkit-media-controls-enclosure {
  background: #ffffff;
  border-radius: 4px;
}

.broadcast-item audio::-webkit-media-controls-panel {
  background: #ffffff;
  border-radius: 4px;
}

/* Subtle hover feedback on play button */
.broadcast-item audio::-webkit-media-controls-play-button:hover,
.broadcast-item audio::-webkit-media-controls-pause-button:hover {
  filter: brightness(0.92);
}

/* Text elements inside controls - darker ink */
.broadcast-item audio::-webkit-media-controls-current-time-display,
.broadcast-item audio::-webkit-media-controls-time-remaining-display,
.broadcast-item audio::-webkit-media-controls-timeline-container {
  color: #1f2937;
}

/* Progress bar (limited support) */
.broadcast-item audio::-webkit-media-controls-timeline {
  border-radius: 2px;
}

/* Make volume slider and timeline corners sharper */
.broadcast-item audio::-webkit-media-controls-volume-slider,
.broadcast-item audio::-webkit-media-controls-timeline {
  border-radius: 2px;
}

/* Tag chips in the top-right of the card */
.broadcast-tags {
  position: absolute;
  top: 14px;
  right: 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 50%;
}

.broadcast-tag-chip {
  background: #f3f4f6;
  color: #374151;
  font-size: 10px;
  font-style: italic;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 4px; /* sharper */
  white-space: nowrap;
}

@media (max-width: 768px) {
  .broadcast-tags {
    position: static;
    margin-bottom: 6px;
    justify-content: flex-start;
    max-width: 100%;
  }
}

/* Search and Filter Base Styles */
.search-and-filter {
  margin-bottom: 20px;
}


.search-bar input {
  width: 100%;
  max-width: 600px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0,56,184,0.1);
}

.sort-and-items-per-page {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.sort-dropdown,
.items-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-dropdown select,
.items-per-page select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  font-size: 13px;
  cursor: pointer;
}

.items-per-page label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

/* Search and Filter Mobile Styles */
@media (max-width: 768px) {
  .search-and-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .search-bar {
    width: 100%;
  }
  
  .search-bar input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-sizing: border-box;
  }
  
  .search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,56,184,0.1);
  }
  
  .sort-and-items-per-page {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  
  .sort-dropdown select,
  .items-per-page select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
  }
  
  .items-per-page label {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
  }
  
  /* Card container mobile alignment */
  .broadcast-item-container {
    margin: 8px 0;
    width: 100%;
    display: block !important;
  }
  
  /* Episodes container mobile spacing */
  #episodes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .search-bar input {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
  }
  
  .sort-dropdown select,
  .items-per-page select {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .items-per-page label {
    font-size: 13px;
  }
  
  .broadcast-item-container {
    margin: 6px 0;
  }
  
  #episodes-container {
    gap: 8px;
  }
}



/* 1) Tag uses Helvetica-family */
.broadcast-tag-chip,
.broadcast-tags .broadcast-tag-chip,
.broadcast-tags span,
.broadcast-tag {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* 2) Hide guest names on the card entirely */
.broadcast-item .guests,
.broadcast-item .guest-name,
.episode-card .guests,
.episode-card .guest-name,
.broadcast-guest,
.broadcast-meta .guests {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: hidden !important;
}

/* 3) Style for the broadcast number */
.episode-title .broadcast-number {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  margin-right: 0.6rem;
  color: var(--primary-color, #0b57d0);
  display: inline-block;
}



