/* ============================================================
   La puerta del sótano — stylesheet
   Fuentes cargadas en HTML vía <link> (Google Fonts)
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Variables */
:root {
  --bg:      #141414;
  --bg-alt:  #1c1c1c;
  --text:    #d4d4d4;
  --muted:   #545454;
  --accent:  #7c6fe0;
  --border:  #272727;
  --mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  --serif:   'Lora', ui-serif, Georgia, serif;
  --width:   680px;
}

/* Base */
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  max-width: var(--width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
  animation: appear 0.45s ease both;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cabecera del sitio ───────────────────────────────────── */

.site-header {
  margin-bottom: 3.5rem;
}

.site-title {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Cursor parpadeante — guiño al "bucle infinito" */
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Tipografía ───────────────────────────────────────────── */

h1 {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 500;
  color: #e8e8e8;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

h2 {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: #dcdcdc;
  line-height: 1.4;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: #c8c8c8;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #a89ef0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

blockquote {
  border-left: 2px solid var(--accent);
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: #909090;
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-alt);
  color: #c4b5fd;
  padding: 0.15em 0.45em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 2rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.84rem;
  color: #c0c0c0;
  line-height: 1.6;
}

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2.25rem 0;
  position: relative;
}

/* Acento morado en el extremo izquierdo del separador */
hr::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  width: 2.5rem;
  background: var(--accent);
}

/* ── Página principal — lista de artículos ────────────────── */

.page-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.post-list {
  list-style: none;
}

.post-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.post-entry:first-child {
  border-top: 1px solid var(--border);
}

/* Barra vertical de acento en hover */
.post-entry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}

.post-entry:hover::before {
  transform: scaleY(1);
}

.post-entry a {
  color: var(--text);
  font-size: 1rem;
  transition: color 0.15s;
}

.post-entry:hover a {
  color: #ffffff;
  text-decoration: none;
}

.post-date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Artículo ─────────────────────────────────────────────── */

.post-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 720px) {
  html { font-size: 17px; }
  body { padding: 2.5rem 1.25rem 4rem; }
  h1   { font-size: 1.3rem; }

  /* La barra lateral no cabe en móvil */
  .post-entry::before { display: none; }
}
