/* P8: Sesli Dinle — homepage module + /dinle/ page + sticky player */
/* ===== SHARED TOKENS ===== */
.dinle-module,
.dinle-page-head,
.custom-dinle-template {
  --dinle-accent: var(--color-brand, #b9422e);
  --dinle-heading: #211c18;
  --dinle-body: #403832;
  --dinle-muted: #73685e;
  --dinle-surface: var(--dragonomi-surface, #fff9f1);
  --dinle-divider: var(--dragonomi-divider, #dccdbd);
}
html[data-color-scheme="dark"] .dinle-module,
html[data-color-scheme="dark"] .dinle-page-head,
html[data-color-scheme="dark"] .custom-dinle-template {
  --dinle-heading: #f4e9da;
  --dinle-body: #e2d7ca;
  --dinle-muted: #a79a8d;
  --dinle-surface: #2e2721;
  --dinle-divider: #403832;
}
@media (prefers-color-scheme: dark) {
  html[data-color-scheme="system"] .dinle-module,
  html[data-color-scheme="system"] .dinle-page-head,
  html[data-color-scheme="system"] .custom-dinle-template {
    --dinle-heading: #f4e9da;
    --dinle-body: #e2d7ca;
    --dinle-muted: #a79a8d;
    --dinle-surface: #2e2721;
    --dinle-divider: #403832;
  }
}

/* ===== SHARED SVG ICONS ===== */
.dinle-play-icon,
.dinle-pause-icon { width: 100%; height: 100%; }

/* ===== HOMEPAGE MODULE ===== */
.dinle-module {
  max-width: 1304px;
  margin: 0 auto;
  padding: 0 32px 40px;
}
.dinle-card {
  background: var(--dinle-surface);
  border-top: 3px solid var(--dinle-accent);
  border-bottom: 1px solid var(--dinle-divider);
  padding: 20px 28px 22px;
}
.dinle-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.dinle-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dinle-icon {
  width: 28px;
  height: 28px;
  color: var(--dinle-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dinle-icon svg { width: 22px; height: 22px; }
.dinle-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--dinle-heading);
  line-height: 1;
  margin: 0;
}
.dinle-subtitle {
  font-size: 13px;
  color: var(--dinle-muted);
}
.dinle-all-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dinle-accent);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
  transition: opacity 0.12s;
}
.dinle-all-link:hover { opacity: 0.7; }

/* Episode list */
.dinle-list { display: flex; flex-direction: column; }
.dinle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--dinle-divider);
  cursor: pointer;
  transition: background 0.1s;
}
.dinle-item:first-child { border-top: 0; }
.dinle-item:hover { background: rgba(185,66,46,0.04); }
.dinle-item.playing { background: rgba(185,66,46,0.06); }
.dinle-play-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--dinle-accent);
  border-radius: 50%;
  background: transparent;
  color: var(--dinle-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
}
.dinle-play-btn:hover { background: var(--dinle-accent); color: #fff; }
.dinle-item.playing .dinle-play-btn { background: var(--dinle-accent); color: #fff; }
.dinle-play-btn svg { width: 11px; height: 11px; }
.dinle-item-info { flex: 1; min-width: 0; }
.dinle-item-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dinle-accent);
  margin-bottom: 1px;
}
.dinle-item-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--dinle-heading);
  line-height: 1.3;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}
a.dinle-item-title:hover { color: var(--dinle-accent); }
.dinle-item.playing .dinle-item-title { color: var(--dinle-accent); }
.dinle-item-meta {
  font-size: 12px;
  color: var(--dinle-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mini inline player (homepage module) */
.dinle-mini-player {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--dinle-divider);
}
.dinle-mini-player.active { display: flex; }
.dinle-mini-play {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--dinle-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.dinle-mini-play svg { width: 13px; height: 13px; }
.dinle-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dinle-heading);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dinle-mini-progress {
  width: 80px;
  height: 3px;
  background: var(--dinle-divider);
  border-radius: 2px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.dinle-mini-fill {
  height: 100%;
  background: var(--dinle-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}
.dinle-mini-time {
  font-size: 11px;
  color: var(--dinle-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ===== /dinle/ PAGE ===== */
.dinle-page-head {
  text-align: center;
  padding: 32px 20px 24px;
}
.dinle-page-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dinle-page-icon {
  width: 32px;
  height: 32px;
  color: var(--dinle-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dinle-page-icon svg { width: 26px; height: 26px; }
.dinle-page-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--dinle-heading);
  margin: 0;
}
.dinle-page-subtitle {
  color: var(--dinle-muted);
  font-size: 15px;
}

/* Filter chips */
.dinle-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 0 20px 24px;
  flex-wrap: wrap;
}
.dinle-chip {
  padding: 6px 14px;
  border: 1px solid var(--dinle-divider);
  border-radius: 2px;
  background: var(--dinle-surface);
  color: var(--dinle-muted);
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.dinle-chip.active {
  background: var(--dinle-accent);
  color: #fff;
  border-color: var(--dinle-accent);
}
.dinle-chip:hover:not(.active) {
  border-color: var(--dinle-accent);
  color: var(--dinle-accent);
}

/* Page episode list (wider) */
.dinle-page-list {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
}
.dinle-page-list .dinle-item-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Load more */
.dinle-load-more {
  text-align: center;
  padding: 24px 0;
}

/* ===== STICKY BOTTOM PLAYER ===== */
.dinle-sticky-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dinle-heading);
  border-top: 3px solid var(--dinle-accent);
  z-index: 9999;
  display: none;
  padding-bottom: env(safe-area-inset-bottom);
}
html[data-color-scheme="dark"] .dinle-sticky-player { background: #1a1612; }
@media (prefers-color-scheme: dark) {
  html[data-color-scheme="system"] .dinle-sticky-player { background: #1a1612; }
}
.dinle-sticky-player.active { display: block; }
.dinle-sticky-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dinle-sticky-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dinle-sp-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: rgba(255,249,241,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.12s;
  padding: 0;
}
.dinle-sp-btn:hover { color: #fff9f1; background: rgba(255,255,255,0.1); }
.dinle-sp-btn.dinle-sp-main {
  width: 44px;
  height: 44px;
  background: var(--dinle-accent);
  color: #fff;
}
.dinle-sp-btn.dinle-sp-main:hover { background: #d4543c; }
.dinle-sp-btn svg { width: 16px; height: 16px; }
.dinle-sp-btn.dinle-sp-main svg { width: 20px; height: 20px; }
.dinle-sticky-info {
  flex: 1;
  min-width: 0;
}
.dinle-sticky-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff9f1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 4px;
}
.dinle-sticky-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dinle-sticky-time {
  font-size: 11px;
  color: rgba(255,249,241,0.6);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 34px;
}
.dinle-sticky-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.dinle-sticky-fill {
  height: 100%;
  background: var(--dinle-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}
.dinle-sticky-speed {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,249,241,0.8);
  background: rgba(255,255,255,0.1);
  border: none;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.dinle-sticky-speed:hover { background: rgba(255,255,255,0.2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .dinle-module { padding: 0 16px 28px; }
  .dinle-card { padding: 16px 18px 18px; }
  .dinle-title { font-size: 18px; }
  .dinle-item-title { font-size: 14px; }
  .dinle-item-meta { display: none; }
  .dinle-mini-progress { width: 50px; }
  .dinle-sticky-inner { padding: 10px 16px; gap: 10px; }
  .dinle-sticky-speed { display: none; }
  .dinle-page-title { font-size: 24px; }
  .dinle-filters { padding: 0 16px 20px; }
}
