/* Tipografía editorial + paleta alineada con plots/style.py */

:root {
  --jg-ink: #202124;
  --jg-muted: #6b7280;
  --jg-accent: #173a5e;
  --jg-accent-soft: #cbd6e0;
  --jg-up: #0f9d58;
  --jg-down: #d93025;
  --jg-rule: #e7eaee;
  --jg-bg-soft: #f7f8fa;
}

[data-md-color-scheme="default"] {
  --md-default-fg-color: var(--jg-ink);
  --md-default-fg-color--light: #3c4043;
  --md-default-fg-color--lighter: var(--jg-muted);
  --md-default-fg-color--lightest: var(--jg-rule);
  --md-primary-fg-color: var(--jg-accent);
  --md-accent-fg-color: var(--jg-accent);
  --md-typeset-a-color: var(--jg-accent);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #6ea4ff;
  --md-accent-fg-color: #6ea4ff;
  --md-typeset-a-color: #9ec3ff;
}

/* Fuentes (Material carga Google Fonts automáticamente si las declaras en
   theme.font; pero forzamos también via CSS por seguridad). */

body,
.md-typeset {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: 0.84rem;
  line-height: 1.65;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, "Iowan Old Style", "Georgia", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--jg-ink);
}

.md-typeset h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 0 0 1.2rem;
}

.md-typeset h2 {
  font-size: 1.35rem;
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--jg-rule);
}

/* Header sin sombra, más limpio */
.md-header,
.md-tabs {
  box-shadow: none;
  border-bottom: 1px solid var(--jg-rule);
}

.md-header__title {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Anchura del contenido — más legible */
.md-grid {
  max-width: 64rem;
}

/* HERO de la home */
.jg-hero {
  padding: 2.4rem 0 1.6rem;
  border-bottom: 1px solid var(--jg-rule);
  margin-bottom: 2rem;
}

.jg-hero__title {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, serif;
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  color: var(--jg-ink);
}

.jg-hero__lede {
  font-size: 1.05rem;
  color: var(--jg-muted);
  max-width: 42rem;
  margin: 0 0 1.4rem;
}

.jg-hero__count {
  display: inline-block;
  font-family: "Source Serif 4", serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--jg-accent);
  line-height: 1;
  margin-right: 0.4rem;
}

.jg-hero__count-label {
  color: var(--jg-muted);
  font-size: 0.95rem;
}

/* Grid de cards */
.jg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  margin: 1.6rem 0;
}

.jg-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--jg-rule);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.jg-card:hover {
  border-color: var(--jg-accent);
  box-shadow: 0 4px 14px -8px rgba(23, 58, 94, 0.35);
  transform: translateY(-1px);
}

.jg-card a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jg-card__thumb {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--jg-bg-soft);
  border-bottom: 1px solid var(--jg-rule);
}

.jg-card__body {
  padding: 0.85rem 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.jg-card__title {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, serif;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
  margin: 0 0 0.45rem;
  color: var(--jg-ink);
}

.jg-card__meta {
  font-size: 0.72rem;
  color: var(--jg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: auto;
}

.jg-card__tags {
  font-size: 0.72rem;
  color: var(--jg-muted);
  margin-top: 0.3rem;
}

.jg-card__tags span {
  display: inline-block;
  margin-right: 0.4rem;
  background: var(--jg-bg-soft);
  border-radius: 99px;
  padding: 0.05rem 0.55rem;
  font-size: 0.7rem;
  color: var(--jg-ink);
}

/* Ficha individual de chart */
.jg-chart-fig {
  margin: 1.6rem 0 1.4rem;
  text-align: center;
}

.jg-chart-fig img,
.md-typeset .jg-chart-fig img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--jg-rule);
  background: #fff;
  padding: 0;
}

.jg-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.8rem;
  color: var(--jg-muted);
  margin: 0.4rem 0 0;
}

.jg-chart-meta strong {
  color: var(--jg-ink);
  font-weight: 600;
}

.jg-chart-tag {
  display: inline-block;
  background: var(--jg-bg-soft);
  border-radius: 99px;
  padding: 0.1rem 0.6rem;
  font-size: 0.72rem;
  color: var(--jg-ink);
  margin-right: 0.3rem;
}

.jg-chart-note {
  border-left: 3px solid var(--jg-accent);
  background: var(--jg-bg-soft);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--jg-ink);
}

.jg-chart-source {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--jg-rule);
  font-size: 0.85rem;
  color: var(--jg-muted);
}

.jg-chart-source a {
  word-break: break-all;
}

/* Listado por meses / por tag (no-card, lista compacta) */
.md-typeset .jg-month-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--jg-muted);
  font-weight: 600;
  border-top: 1px solid var(--jg-rule);
  padding-top: 1.4rem;
  margin-top: 2rem;
  font-family: "Inter", sans-serif;
}

/* Footer enriquecido con bloque CC */
.md-footer-meta {
  background-color: #0e1620;
}

.md-footer-meta__inner {
  flex-direction: column;
  align-items: flex-start;
  padding: 1.3rem 0.8rem;
}

.md-copyright,
.md-copyright a {
  color: #d3d8de;
}

.md-copyright {
  width: 100%;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
}

.md-copyright__highlight {
  display: block;
  color: #fff;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Admonitions más sobrios */
.md-typeset .admonition {
  border-left-width: 3px;
  border-radius: 2px;
  box-shadow: none;
  font-size: 0.82rem;
}

/* Esconder el "social" empty footer si Material lo añade */
.md-social {
  display: none;
}
