/* ============================================================================
   /listen — Hawaii audio library
   Scoped to .hg-listen-* — modern CSS, mobile-first, no Foundation grid.
   px font sizes (site base is html { font-size: 62.5% } so 1rem = 10px).
   ============================================================================ */

.hg-listen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 18px 120px; /* extra bottom padding so sticky player never hides last row */
  box-sizing: border-box;
}
.hg-listen * { box-sizing: border-box; }
body.hg-listen-player-open .hg-listen { padding-bottom: 180px; }

/* -- Header ----------------------------------------------------------------- */
.hg-listen-header {
  text-align: center;
  margin: 8px auto 28px;
  max-width: 720px;
}
.hg-listen-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1D9771;
  margin: 0 0 8px;
}
.hg-listen-title {
  font-size: 36px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}
.hg-listen-tagline {
  font-size: 16px;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
}
@media (min-width: 768px) {
  .hg-listen-title { font-size: 44px; }
  .hg-listen-tagline { font-size: 17px; }
}

/* -- Filter controls -------------------------------------------------------- */
.hg-listen-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
  align-items: center;
}
.hg-listen-tabs,
.hg-listen-islands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.hg-listen-tab,
.hg-listen-island {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.hg-listen-tab:hover,
.hg-listen-island:hover {
  background: #f3f4f6;
}
.hg-listen-tab.is-active {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}
.hg-listen-island.is-active {
  background: #1D9771;
  color: #ffffff;
  border-color: #1D9771;
}
.hg-listen-island { font-size: 12px; padding: 6px 12px; }

.hg-listen-count {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin: 4px 0 16px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 600;
}

/* -- Tile grid -------------------------------------------------------------- */
.hg-listen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) {
  .hg-listen-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .hg-listen-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (min-width: 1024px) {
  .hg-listen-grid { grid-template-columns: repeat(4, 1fr); }
}

.hg-listen-tile {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hg-listen-tile[hidden] { display: none !important; }
.hg-listen-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.hg-listen-tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.hg-listen-tile-link:hover { text-decoration: none; color: inherit; }

.hg-listen-tile-art {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  overflow: hidden;
}
.hg-listen-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Type chip (top-left) */
.hg-listen-tile-type {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(31,41,55,0.85);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  z-index: 2;
}

/* Island chip (top-right) — accent color per island */
.hg-listen-tile-island {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(31,41,55,0.85);
  z-index: 2;
}
.hg-listen-tile-island[data-island="oahu"]       { background: #F27A24; }
.hg-listen-tile-island[data-island="maui"]       { background: #1866B4; }
.hg-listen-tile-island[data-island="big-island"] { background: #c3232f; }
.hg-listen-tile-island[data-island="kauai"]      { background: #1D9771; }

/* Play button overlay */
.hg-listen-tile-play {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.96);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, background 0.12s ease;
  z-index: 2;
}
.hg-listen-tile-play:hover {
  background: #ffffff;
  transform: scale(1.06);
}
.hg-listen-tile-play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #1f2937;
  margin-left: 3px; /* visually center the triangle */
}

/* Tile body */
.hg-listen-tile-body {
  padding: 12px 14px 14px;
}
.hg-listen-tile-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hg-listen-tile-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}
.hg-listen-tile-voices { color: #9ca3af; }

/* Empty state */
.hg-listen-empty {
  text-align: center;
  font-size: 15px;
  color: #6b7280;
  padding: 40px 20px;
  background: #f9fafb;
  border-radius: 10px;
  margin: 16px 0;
}

/* About section */
.hg-listen-about {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 24px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.hg-listen-about h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px;
}
.hg-listen-about p {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 12px;
}
.hg-listen-about p:last-child { margin-bottom: 0; }

/* ============================================================================
   Sticky bottom player
   ============================================================================ */

.hg-listen-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1f2937;
  color: #ffffff;
  z-index: 1000;
  border-top: 1px solid #111827;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
  animation: hg-listen-slide 0.22s ease;
}
.hg-listen-player[hidden] { display: none !important; }
@keyframes hg-listen-slide {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.hg-listen-player-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
}

.hg-listen-player-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #374151;
  flex-shrink: 0;
}

.hg-listen-player-info {
  min-width: 0;
}
.hg-listen-player-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hg-listen-player-sub {
  font-size: 12px;
  color: #9ca3af;
  margin: 2px 0 0;
}
.hg-listen-player-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}
.hg-listen-player-link:hover { color: #93c5fd; text-decoration: underline; }

.hg-listen-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Voice toggle */
.hg-listen-player-toggle {
  appearance: none;
  border: 1px solid #4b5563;
  background: #374151;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: background 0.12s ease;
}
.hg-listen-player-toggle:hover { background: #4b5563; }
.hg-listen-player-voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1565c0;
  display: inline-block;
}

/* Play button */
.hg-listen-player-play {
  appearance: none;
  border: none;
  background: #ffffff;
  color: #1f2937;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}
.hg-listen-player-play:hover { transform: scale(1.05); }
.hg-listen-player-play-icon {
  display: block;
  width: 12px;
  height: 14px;
  position: relative;
}
.hg-listen-player-play-icon[data-state="play"] {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #1f2937;
  margin-left: 2px;
}
.hg-listen-player-play-icon[data-state="pause"]::before,
.hg-listen-player-play-icon[data-state="pause"]::after {
  content: "";
  position: absolute;
  top: 0;
  width: 4px;
  height: 14px;
  background: #1f2937;
}
.hg-listen-player-play-icon[data-state="pause"]::before { left: 0; }
.hg-listen-player-play-icon[data-state="pause"]::after { right: 0; }

/* Progress */
.hg-listen-player-progress {
  display: none;
}
.hg-listen-player-scrub {
  width: 180px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #4b5563;
  border-radius: 2px;
  outline: none;
}
.hg-listen-player-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
}
.hg-listen-player-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
}
.hg-listen-player-time {
  font-size: 11px;
  color: #9ca3af;
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
}
.hg-listen-player-time-sep { margin: 0 4px; opacity: 0.5; }

.hg-listen-player-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: color 0.12s ease, background 0.12s ease;
}
.hg-listen-player-close:hover {
  color: #ffffff;
  background: #374151;
}

/* Tablet+: show progress bar inline */
@media (min-width: 640px) {
  .hg-listen-player-progress {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0 4px;
  }
  .hg-listen-player-scrub { width: 220px; }
}
@media (min-width: 900px) {
  .hg-listen-player-scrub { width: 320px; }
}

/* Print: hide everything (audio doesn't print) */
@media print {
  .hg-listen-player,
  .hg-listen-controls { display: none !important; }
  .hg-listen-tile-play { display: none !important; }
}
