/* ============================================
   El Circulo de Ajo — Estilo Vampiro: La Mascarada
   Gotico-punk / sangre y sombras
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&display=swap');

/* --- Variables de color --- */
:root {
  --blood: #8b0000;
  --blood-bright: #cc1a1a;
  --bone: #d4c5a9;
  --ash: #1a1a1a;
  --shadow: #0d0d0d;
  --parchment: #c8b89a;
  --mist: rgba(139, 0, 0, 0.15);
}

/* --- Slate (dark mode) overrides --- */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #1a0a0a;
  --md-primary-bg-color: var(--bone);
  --md-accent-fg-color: var(--blood-bright);
  --md-default-bg-color: #121212;
  --md-typeset-a-color: var(--blood-bright);
}

/* --- Default (light mode) overrides --- */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #2a0a0a;
  --md-primary-bg-color: var(--bone);
  --md-accent-fg-color: var(--blood);
  --md-default-bg-color: #f5f0e8;
  --md-typeset-a-color: var(--blood);
}

/* --- Header --- */
.md-header {
  background: linear-gradient(180deg, #1a0505 0%, #0d0d0d 100%) !important;
  border-bottom: 2px solid var(--blood) !important;
}

.md-header__title {
  font-family: 'Cinzel', serif !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* --- Titulos --- */
.md-typeset h1 {
  font-family: 'Cinzel', serif !important;
  font-weight: 900;
  color: var(--blood-bright) !important;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(139, 0, 0, 0.3);
  padding-bottom: 0.3em;
}

.md-typeset h2 {
  font-family: 'Cinzel', serif !important;
  font-weight: 700;
  color: var(--bone) !important;
  letter-spacing: 0.02em;
}

.md-typeset h3 {
  font-family: 'Cinzel', serif !important;
  font-weight: 400;
  color: var(--parchment) !important;
}

/* --- Blockquotes (dialogos) --- */
.md-typeset blockquote {
  border-left: 3px solid var(--blood) !important;
  background: var(--mist) !important;
  padding: 0.8em 1.2em !important;
  margin: 1em 0 !important;
  border-radius: 0 4px 4px 0;
}

.md-typeset blockquote p {
  color: var(--bone) !important;
}

/* --- Links --- */
.md-typeset a {
  color: var(--blood-bright) !important;
  text-decoration: none;
  transition: color 0.2s;
}

.md-typeset a:hover {
  color: #ff3333 !important;
  text-decoration: underline;
}

/* --- Sidebar --- */
.md-sidebar {
  background: rgba(13, 5, 5, 0.4);
}

.md-sidebar__scrollwrap {
  overflow-y: auto !important;
  max-height: calc(100vh - 4rem) !important;
}

/* Scrollbar del sidebar visible */
.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 6px;
}
.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background: rgba(139, 0, 0, 0.5);
  border-radius: 3px;
}
.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
  background: var(--blood-bright);
}

.md-nav__link {
  font-size: 0.82rem;
}

.md-nav__link--active {
  color: var(--blood-bright) !important;
  font-weight: 700;
}

/* --- Tablas --- */
.md-typeset table:not([class]) {
  border: 1px solid rgba(139, 0, 0, 0.3);
}

.md-typeset table:not([class]) th {
  background: rgba(139, 0, 0, 0.2) !important;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--bone) !important;
}

.md-typeset table:not([class]) td {
  border-color: rgba(139, 0, 0, 0.15) !important;
}

/* --- Imagenes centradas --- */
.md-typeset img {
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 0, 0, 0.2);
}

/* --- Separadores --- */
.md-typeset hr {
  border-color: rgba(139, 0, 0, 0.3) !important;
}

/* --- Search bar --- */
.md-search__input {
  background-color: rgba(26, 10, 10, 0.8) !important;
}

/* --- Footer --- */
.md-footer {
  background: var(--shadow) !important;
  border-top: 1px solid rgba(139, 0, 0, 0.3);
}

/* --- Bold text (nombres de personajes, mecanicas) --- */
.md-typeset strong {
  color: var(--parchment);
}

/* --- Metadata blockquote (Video/Lineas principales) --- */
.md-typeset blockquote:first-of-type {
  border-left-color: rgba(139, 0, 0, 0.5) !important;
  background: rgba(26, 10, 10, 0.4) !important;
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--shadow);
}

::-webkit-scrollbar-thumb {
  background: var(--blood);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blood-bright);
}

/* ============================================
   Portada — Cuero y dorado
   ============================================ */

body.portada-page .md-content__inner {
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(139, 0, 0, 0.03) 2px,
      rgba(139, 0, 0, 0.03) 4px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.05) 2px,
      rgba(0, 0, 0, 0.05) 4px
    ),
    linear-gradient(180deg, #1a0505 0%, #0d0505 50%, #1a0505 100%);
  border: 2px solid rgba(139, 0, 0, 0.4);
  border-radius: 8px;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(139, 0, 0, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.6);
  padding: 2em 2.5em !important;
  max-width: 800px;
  margin: 1em auto;
}

/* Titulo principal de portada — dorado relieve */
body.portada-page .md-typeset h1 {
  text-align: center;
  font-size: 2.8em;
  color: #c9a84c !important;
  text-shadow:
    0 1px 0 #7a6530,
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(201, 168, 76, 0.3);
  border-bottom: 2px solid rgba(201, 168, 76, 0.3);
  padding-bottom: 0.4em;
  margin-top: 0.5em;
}

/* Subtitulo de portada */
body.portada-page .md-typeset h2 {
  text-align: center;
  font-size: 1.3em;
  color: var(--parchment) !important;
  font-style: italic;
  letter-spacing: 0.08em;
  margin-bottom: 1.5em;
}

/* Links de portada centrados */
body.portada-page .md-typeset h3 {
  text-align: center;
  color: #c9a84c !important;
  font-size: 1.1em;
}

body.portada-page .md-typeset ul {
  text-align: center;
  list-style: none;
  padding: 0;
}

body.portada-page .md-typeset ul li {
  margin: 0.5em 0;
}

/* Imagen hero de portada — sin borde redondeado */
body.portada-page .portada-hero {
  border-radius: 4px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(139, 0, 0, 0.3);
}

/* Texto footer de portada */
body.portada-page .portada-footer-text {
  font-size: 0.8em;
  color: rgba(200, 184, 154, 0.5);
  text-align: center;
  margin-top: 2em;
}

/* Separadores de portada */
body.portada-page .md-typeset hr {
  border-color: rgba(201, 168, 76, 0.3) !important;
  margin: 1.5em 0;
}

/* ============================================
   Transiciones entre paginas
   ============================================ */

@keyframes pageEnter {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

.md-content.page-enter {
  animation: pageEnter 0.4s ease-out forwards;
}

/* ============================================
   Indicador de capitulo
   ============================================ */

#chapter-indicator {
  position: fixed;
  bottom: 16px;
  right: 16px;
  font-family: 'Cinzel', serif;
  font-size: 0.75em;
  color: rgba(139, 0, 0, 0.5);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s;
}

/* Ocultar en pantallas chicas */
@media (max-width: 768px) {
  #chapter-indicator {
    display: none !important;
  }
}

/* ============================================
   Imagenes flotantes dentro del texto
   ============================================ */

.img-float-right {
  float: right;
  margin: 0.2em 0 1em 1.5em;
  max-width: 280px;
}

.img-float-left {
  float: left;
  margin: 0.2em 1.5em 1em 0;
  max-width: 280px;
}

.img-float-right img,
.img-float-left img {
  width: 100%;
  border-radius: 4px;
}

.img-float-right em,
.img-float-left em {
  display: block;
  text-align: center;
  font-size: 0.8em;
  color: rgba(200, 184, 154, 0.6);
  margin-top: 0.3em;
}

/* Responsive: desflotar en moviles */
@media (max-width: 600px) {
  .img-float-right,
  .img-float-left {
    float: none;
    max-width: 100%;
    margin: 1em auto;
    text-align: center;
  }
}

/* ============================================
   Pagina incompleta — cierre de capitulo abierto
   ============================================ */

.torn-page {
  margin-top: 3em;
  padding-top: 2em;
  text-align: center;
  border-top: 1px solid rgba(139, 0, 0, 0.3);
}

.torn-page p {
  font-family: 'Cinzel', serif;
  font-style: italic;
  color: rgba(200, 184, 154, 0.35) !important;
  font-size: 1.1em;
  letter-spacing: 0.1em;
  margin: 1em 0 0.5em;
}

.torn-page .ornament {
  color: rgba(139, 0, 0, 0.4);
  font-size: 1.4em;
  letter-spacing: 0.5em;
}
