/* ==========================================================================
   The Godfather Wiki — theme overrides
   A restrained palette: parchment and ink in light mode, sepia-on-black in
   dark mode, with the single amber accent that the films use for lamplight.
   ========================================================================== */

:root {
  --gf-gold: #c8992e;
  --gf-gold-bright: #e0b44a;
  --gf-blood: #7d1d1d;
  --gf-parchment: #f6f1e6;
  --gf-ink: #1a1714;
}

/* ---- Light scheme ---- */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #17130f;
  --md-accent-fg-color: #8a6a12;
  --md-typeset-a-color: #8a6a12;
  --md-default-bg-color: var(--gf-parchment);
  --md-typeset-color: var(--gf-ink);
  --md-code-bg-color: #ebe3d3;
}

/* ---- Dark scheme ---- */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #0b0a09;
  --md-accent-fg-color: var(--gf-gold-bright);
  --md-typeset-a-color: var(--gf-gold-bright);
  --md-default-bg-color: #12100e;
  --md-default-fg-color: #e8e0d2;
  --md-typeset-color: #ded5c5;
  --md-code-bg-color: #1d1a16;
}

/* ---- Typography ---- */
.md-typeset h1,
.md-typeset h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.md-typeset h1 {
  color: var(--md-typeset-color);
  border-bottom: 1px solid rgba(200, 153, 46, 0.35);
  padding-bottom: 0.3em;
}

.md-typeset h2 {
  margin-top: 2em;
}

/* ---- Epigraph: a pull-quote used at the top of major pages ---- */
.md-typeset .epigraph {
  border-left: 3px solid var(--gf-gold);
  padding: 0.2rem 0 0.2rem 1.1rem;
  margin: 1.4rem 0 2rem;
  font-style: italic;
  font-size: 1.05em;
  line-height: 1.55;
  opacity: 0.92;
}

.md-typeset .epigraph cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.8em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
}

/* ---- Infobox: the film/book/person fact panel ---- */
.md-typeset .infobox {
  float: right;
  clear: right;
  width: 20rem;
  max-width: 100%;
  margin: 0 0 1.2rem 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(200, 153, 46, 0.4);
  border-radius: 3px;
  background: rgba(200, 153, 46, 0.06);
  font-size: 0.72rem;
  line-height: 1.5;
}

.md-typeset .infobox h4 {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-accent-fg-color);
}

.md-typeset .infobox dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr;
  gap: 0.25rem 0.7rem;
}

.md-typeset .infobox dt {
  font-weight: 600;
  opacity: 0.7;
  margin: 0;
}

.md-typeset .infobox dd {
  margin: 0;
}

@media screen and (max-width: 60em) {
  .md-typeset .infobox {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }
}

/* ---- Tables: keep wide data scrollable, never the page ---- */
.md-typeset__table {
  min-width: 0;
}

.md-typeset table:not([class]) {
  font-size: 0.72rem;
}

.md-typeset table:not([class]) th {
  background: rgba(200, 153, 46, 0.12);
  font-weight: 600;
}

/* ---- Bar charts built from plain HTML (no external JS) ---- */
.md-typeset .chart {
  margin: 1.5rem 0;
  font-size: 0.74rem;
}

.md-typeset .chart-row {
  display: grid;
  grid-template-columns: minmax(6rem, 11rem) 1fr minmax(4.5rem, auto);
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.42rem;
}

.md-typeset .chart-label {
  text-align: right;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-typeset .chart-track {
  background: rgba(128, 128, 128, 0.14);
  border-radius: 2px;
  overflow: hidden;
  height: 1.05rem;
}

.md-typeset .chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gf-gold) 0%, var(--gf-gold-bright) 100%);
  border-radius: 2px;
}

.md-typeset .chart-bar.alt {
  background: linear-gradient(90deg, #6d4f7e 0%, #9a76ab 100%);
}

.md-typeset .chart-bar.warn {
  background: linear-gradient(90deg, #7d1d1d 0%, #b64444 100%);
}

.md-typeset .chart-value {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.md-typeset .chart-caption {
  margin-top: 0.7rem;
  font-size: 0.68rem;
  opacity: 0.6;
}

/* ---- Card grid used on index pages ---- */
.md-typeset .grid.cards > ul > li {
  border-color: rgba(200, 153, 46, 0.3);
}

/* ---- Spoiler-safe styling for the "fate" line in character boxes ---- */
.md-typeset .fate {
  color: var(--gf-blood);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset .fate {
  color: #d97a7a;
}

/* ---- Embedded video (YouTube), responsive and self-contained ---- */
.md-typeset .video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.4rem 0 0.6rem;
  border: 1px solid rgba(200, 153, 46, 0.35);
  border-radius: 3px;
  overflow: hidden;
  background: #000;
}

.md-typeset .video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.md-typeset .video-caption {
  margin: 0 0 1.6rem;
  font-size: 0.7rem;
  line-height: 1.5;
  opacity: 0.7;
}

.md-typeset .video-caption strong {
  opacity: 0.95;
}

/* Two-up video grid on wide screens */
.md-typeset .video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0 1.2rem;
  margin: 1rem 0;
}

.md-typeset .video-grid .video {
  margin-top: 0.8rem;
}

/* ---- Mermaid diagrams: give them room and a neutral frame ---- */
.md-typeset .mermaid {
  overflow-x: auto;
  margin: 1.5rem 0;
}
