/* Scoped styling for hacker-news-top-stories-reader */
.hntr-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text, #1e293b);
}

.hntr-header {
  margin-bottom: 1.5rem;
}

.hntr-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  background-color: #ffedd5;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.hntr-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: var(--color-heading, #0f172a);
}

.hntr-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted, #64748b);
  line-height: 1.5;
}

/* Ad slots */
.hntr-ad-slot {
  margin: 1.5rem 0;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle, #f8fafc);
  border: 1px dashed var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
}

/* Controls Card */
.hntr-controls-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.25rem;
}

.hntr-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.hntr-search-wrap {
  flex: 1;
  min-width: 240px;
}

.hntr-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  outline: none;
}

.hntr-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.hntr-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hntr-sort-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.hntr-select-sm {
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #ffffff;
  color: #1e293b;
}

.hntr-btn-refresh {
  background: #f97316;
  color: #ffffff;
  border: 1px solid #ea580c;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.hntr-btn-refresh:hover {
  background: #ea580c;
}

/* Category Pills */
.hntr-categories-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hntr-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hntr-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.hntr-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Feed Status */
.hntr-feed-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.hntr-count-text {
  font-weight: 600;
}

.hntr-source-badge {
  padding: 0.2rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
  font-weight: 600;
}

/* Stories List */
.hntr-stories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hntr-story-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.65rem;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease;
}

.hntr-story-card:hover {
  border-color: #cbd5e1;
}

.hntr-story-score-col {
  min-width: 58px;
  text-align: center;
}

.hntr-score-box {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 0.4rem;
  padding: 0.4rem 0.25rem;
  display: flex;
  flex-direction: column;
}

.hntr-score-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ea580c;
  line-height: 1;
}

.hntr-score-lbl {
  font-size: 0.65rem;
  color: #9a3412;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.hntr-story-content {
  flex: 1;
}

.hntr-story-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  line-height: 1.35;
}

.hntr-story-title a {
  color: #0f172a;
  text-decoration: none;
}

.hntr-story-title a:hover {
  color: #ea580c;
  text-decoration: underline;
}

.hntr-domain {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  margin-left: 0.35rem;
}

.hntr-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #64748b;
}

.hntr-comments-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.hntr-comments-btn:hover {
  color: #1d4ed8;
}

.hntr-btn-bookmark {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
  cursor: pointer;
  margin-left: auto;
}

.hntr-btn-bookmark:hover {
  background: #e2e8f0;
}

.hntr-bookmarked {
  background: #fef08a;
  border-color: #eab308;
  color: #854d0e;
}

/* Modal */
.hntr-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  box-sizing: border-box;
}

.hntr-modal-card {
  background: #ffffff;
  border-radius: 0.75rem;
  max-width: 650px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hntr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.hntr-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.hntr-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.hntr-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hntr-comment-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.85rem;
}

.hntr-comment-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.hntr-comment-text {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.45;
}

.hntr-loading {
  opacity: 0.6;
  pointer-events: none;
}
