/*
 * Hellraiser Revival Theme
 * Palette: #191619, #242127, #d9b975, #eee6d6, #bbb3bd, #f3a8aa
 */

:root {
  --bg-dark: #191619;
  --bg-card: #242127;
  --bg-card-hover: #2d2a30;
  --bg-subtle: #2b282e;
  --border: #3b373f;
  --border-highlight: #d9b975;
  --text-main: #eee6d6;
  --text-muted: #bbb3bd;
  --text-dim: #8b858d;
  --accent-cyan: #d9b975;
  --accent-emerald: #d9b975;
  --accent-amber: #d9b975;
  --accent-rose: #f3a8aa;

  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
}

body {
  font-variant-numeric: tabular-nums;
}

/* Base Overrides */
a:hover {
  color: #eed194;
}

.site-header {
  background-color: rgba(25, 22, 25, 0.94);
}

.brand,
.nav-links a:hover {
  color: var(--text-main);
}

/* Hero Section */
.hero-medieval {
  background: var(--bg-dark);
}

.hero-eyebrow {
  background: rgba(217, 185, 117, 0.1);
  border: 1px solid rgba(217, 185, 117, 0.25);
  color: var(--accent-cyan);
}

.hero-title,
.hero-tagline,
.cover-art-title,
.caption-title,
.section-title,
.slot-title,
.card-title,
.article-footer-title,
.guide-card-title,
.callout-title,
.article-title,
.meta-box-val,
.article-content h2,
.ui-column-header,
.sources-section h3,
.home-intent-title,
.home-intent-data h2,
.video-facade-content h3 {
  color: var(--text-main);
}

.hero-title-accent {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: initial;
  color: var(--accent-cyan);
}

/* Buttons */
.btn-primary {
  background: var(--bg-card);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.btn-primary:hover {
  background: var(--bg-subtle);
  border-color: #eed194;
  box-shadow: none;
}

/* Cards & Elements */
.hero-cover-card,
.hero-image-card,
.preview-figure-card,
.video-facade-card,
.ui-breakdown-card,
.schematic-card,
.answer-hero-box,
.recipe-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: none;
}

.answer-hero-box {
  border-color: var(--accent-cyan);
}

.hero-image-wrap,
.preview-figure-img-wrap,
.card-thumb-wrap,
.visual-slot-frame,
.ui-column,
.recipe-item-row,
.recipe-inline-icon {
  background: var(--bg-dark);
}

.hero-image-badge,
.thumb-overlay-badge,
.figure-pin {
  background: rgba(25, 22, 25, 0.92);
  border-color: var(--border);
  box-shadow: none;
}

.figure-pin {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.hero-image-caption,
.preview-figure-caption,
.preview-figure-header,
.recipe-box,
.checklist-card,
.item-badge-row,
.step-card,
.topic-pill {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.visual-slot-frame {
  border: 1px dashed var(--border);
}

.schematic-header,
.schematic-footer,
.recipe-dash-header,
.recipe-fuel-bar {
  border-color: var(--border);
}

.ui-column {
  border-color: var(--border);
}

/* Typography & Colors */
.preview-figure-caption strong,
.article-content p,
.article-content li,
.article-content table td,
.answer-summary,
.answer-step-row,
.recipe-item-name,
.recipe-yield-standard,
.recipe-fuel-bar,
.checklist-item,
.step-card-title,
.topic-pill {
  color: var(--text-main);
}

.recipe-box-title,
.step-card-desc {
  color: var(--text-muted);
}

.recipe-dash-title,
.recipe-item-qty,
.recipe-yield-perk,
.checklist-title,
.step-card-action {
  color: var(--accent-cyan);
}

/* Tables */
.article-content table th {
  background: var(--bg-subtle);
  color: var(--accent-cyan);
}

.article-content table td {
  background: var(--bg-card);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(238, 230, 214, 0.02);
}

.data-table tbody tr:hover {
  background: rgba(238, 230, 214, 0.05);
}

.data-table th.calc-col,
.data-table td.calc-col {
  background-color: rgba(217, 185, 117, 0.08);
}

/* Focus */
a:focus-visible {
  outline: 2px solid var(--accent-cyan);
}

/* Badges & Pills */
.status-pill-ready,
.status-pill-draft,
.badge-verified,
.badge-scope,
.card-badge-verified,
.card-badge-emerald,
.card-badge-blue,
.card-badge-preview,
.answer-step-num,
.recipe-item-qty,
.recipe-yield-perk,
.step-card-pill,
.ui-confirm-box,
.ui-step-pill,
.schematic-badge {
  background: rgba(217, 185, 117, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(217, 185, 117, 0.3);
}

.status-pill-candidate,
.badge-candidate {
  background: rgba(187, 179, 189, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(187, 179, 189, 0.3);
}

.callout-amber,
.preview-banner,
.condition-banner {
  background: rgba(217, 185, 117, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.condition-title {
  color: var(--accent-cyan);
}

.answer-badge {
  color: var(--bg-dark);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.checklist-item-icon {
  color: var(--accent-rose);
}

.topic-pill:hover {
  background: rgba(217, 185, 117, 0.15);
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

/* Pin overrides */
.pin-zone-1, .pin-zone-2, .pin-zone-3, .pin-zone-4,
.pin-prep-body, .pin-prep-collar, .pin-prep-liquid, .pin-prep-action,
.pin-cube-recipes, .pin-cube-fuel, .pin-cube-queue, .pin-hud-score {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

/* Editorial headings; preserve the tool's existing typography. */
.article-title,
.article-content :is(h2, h3, h4, h5, h6):not(#crafting-tool *),
.home-intent-title,
.home-intent-data :is(h2, h3, h4, h5, h6) {
  font-family: var(--font-serif);
}

/* Identify prose links without changing cards, pills or buttons. */
.article-content :is(p, li) a:not(.btn-primary, .btn-secondary, .guide-card, .card, .topic-pill),
.home-intent-data :is(p, li) a:not(.btn-primary, .btn-secondary, .guide-card, .card, .topic-pill) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

/* Site-local content figures. */
.hr-editorial-figure {
  margin: 1.5rem 0;
}

.hr-editorial-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.hr-editorial-figure figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Native spoiler disclosures; retain the summary marker and keyboard behavior. */
details.hr-spoilers {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-main);
}

details.hr-spoilers > summary {
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.625rem 0;
  color: var(--accent-cyan);
  cursor: pointer;
}

details.hr-spoilers > summary:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Actual original crafting component; only hardcoded accent colors remapped. */
#crafting-tool {
  color: var(--text-main);
  font-family: var(--font-sans, sans-serif);
  max-width: 100%;
}

#crafting-tool [hidden],
.hr-recipe[hidden] {
  display: none !important;
}

#crafting-tool .hr-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
}

@media (min-width: 768px) {
  #crafting-tool .hr-controls {
    flex-direction: row;
    align-items: flex-end;
  }
  #crafting-tool .hr-controls > label {
    flex: 1;
  }
}

#crafting-tool .hr-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

#crafting-tool input[type="search"],
#crafting-tool select {
  font-size: 16px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

#crafting-tool input[type="search"]:focus-visible,
#crafting-tool select:focus-visible,
#crafting-tool button:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

#crafting-tool button {
  font-size: 16px;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

#crafting-tool button:hover:not(:disabled) {
  background: var(--border);
}

#crafting-tool button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#crafting-tool .hr-summary {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  #crafting-tool .hr-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: baseline;
  }
}

#crafting-tool dl#material-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

#crafting-tool dl#material-items div {
  display: flex;
  flex-direction: column;
}

#crafting-tool dl#material-items dt {
  font-size: 0.875rem;
  color: var(--text-muted);
}

#crafting-tool dl#material-items dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--accent-amber);
}

#crafting-tool #recipe-count,
#crafting-tool #js-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

#crafting-tool #recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hr-recipe {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  word-break: break-word;
}

.hr-recipe.hr-conflict {
  border-left: 4px solid var(--accent-amber);
  background: linear-gradient(to right, rgba(217, 185, 117, 0.05), transparent);
}

.hr-recipe h3 {
  margin: 0 0 8px 0;
  font-size: 1.125rem;
  color: var(--text-main);
  line-height: 1.4;
}

.hr-recipe .hr-acquisition,
.hr-recipe .hr-cost {
  margin: 0 0 8px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hr-recipe details.hr-claims {
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.hr-recipe details.hr-claims summary {
  cursor: pointer;
  color: var(--accent-cyan);
  padding: 4px 0;
}

.hr-recipe .hr-states {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.hr-recipe .hr-states label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  background: var(--bg-subtle);
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.hr-recipe .hr-states label:has(input:checked) {
  border-color: var(--accent-cyan);
  background: rgba(217, 185, 117, 0.1);
}

.hr-recipe .hr-states input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-cyan);
}
#crafting-tool { color-scheme: dark; }
#crafting-tool .hr-controls > * { min-width: 0; }
#crafting-tool #material-items { flex: 1 1 100%; width: 100%; font-variant-numeric: tabular-nums; }
#crafting-tool .hr-states label:focus-within { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
#crafting-tool input, #crafting-tool button, #crafting-tool select { touch-action: manipulation; }
