/* ============================================
   AURA S. — TEMA PRINCIPAL
   Paleta: casi-negro / gris / blanco / rosa
   Tipografía: Crimson Text (serif, textos) + Inter (sans, UI)
   ============================================ */

/* --- Variables: modo oscuro (por defecto) --- */
:root {
  --bg:        #111110;
  --bg-subtle: #181817;
  --muted:     #4a4a47;
  --dim:       #888884;
  --text:      #e8e6e0;
  --accent:    #e8e6e0;
  --hover:     #d174bb;   /* tono rosa — unifica todos los hovers */

  --font-ui:   'Inter', sans-serif;
  --font-body: 'Crimson Text', serif;

  --nav-h:     3.25rem;
  --max-w:     760px;
  --max-w-wide: 900px;
}

/* --- Modo claro --- */
[data-theme="light"] {
  --bg:        #f5f4f0;
  --bg-subtle: #eceae4;
  --muted:     #b8b5ad;
  --dim:       #888884;
  --text:      #1a1a18;
  --accent:    #1a1a18;
  /* --hover permanece igual en ambos temas */
}

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

/* [1] FOOTER PEGADO AL FONDO
   body como columna flex de altura mínima 100vh;
   main crece para empujar el footer abajo */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.theme-transitions body,
.theme-transitions nav.site-nav,
.theme-transitions .nav-home,
.theme-transitions .nav-link,
.theme-transitions footer.site-footer {
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */

nav.site-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--nav-h);
  background-color: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 400;
  /* nav ocupa todo el ancho de la barra superior */
  width: 100%;
  max-width: var(--max-w);
  /* centrar la barra si la ventana es más ancha */
  align-self: center;
  gap: 1.2rem;
}

/* Breadcrumb izquierda */
.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  letter-spacing: 0.01em;
  min-width: 0;        /* permite que flex recorte el contenido */
  flex: 1;
  overflow: hidden;
}

.nav-breadcrumb {
  color: var(--dim);
  font-weight: 500;
}

.nav-breadcrumb-link {
  display: inline-block;
  /* max-width: 14ch; */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;   /* alinea con el texto circundante */
  transition: color 0.15s;
}

.nav-home {
  color: var(--text);
  font-weight: 600;
  transition: color 0.15s;
  white-space: nowrap;
}
/* [4] hover unificado con --hover */
.nav-home:hover, .nav-breadcrumb-link:hover { color: var(--hover); }

/* Links derecha */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-link {
  color: var(--dim);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
/* [4] hover unificado */
.nav-link:hover { color: var(--hover); }
.nav-link.active { color: var(--text); }

/* Toggle tema */
.theme-toggle {
  background: none;
  border: 1px solid var(--muted);
  border-radius: 999px;
  width: 2.4rem;
  height: 1.3rem;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--hover); }

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: calc(1.3rem - 6px);
  height: calc(1.3rem - 6px);
  border-radius: 50%;
  background-color: var(--dim);
  transition: transform 0.2s ease, background-color 0.2s;
}
[data-theme="light"] .theme-toggle::after {
  transform: translateX(1.1rem);
  background-color: var(--text);
}

/* ============================================
   LAYOUT BASE
   ============================================ */

/* [1] main crece para empujar el footer */
main {
  flex: 1;
  padding-top: calc(var(--nav-h) - 1.5rem);
  padding-bottom: 1.5rem;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   HOMEPAGE
   ============================================ */

.latest-section {
  margin-bottom: 2rem;
}

.section-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 1.25rem;
}

.latest-card {
  margin-left: 0.5rem;
  display: block;
}

.latest-meta {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 300;
  margin-bottom: 0.45rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.latest-title {
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.1rem;
  line-height: 1.1;
  transition: color 0.15s;
}
/* [4] hover unificado */
.latest-card:hover .latest-title { color: var(--hover); }

.latest-excerpt {
  font-size: 1.05rem;
  color: var(--dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 300;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
/* [4] hover unificado */
.latest-card:hover .latest-read-more { color: var(--hover); }

/* Sección Writing */
.collection-list {
  border-top: 1px solid var(--muted);
  margin-left: 0.5rem;
}

.collection-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--bg-subtle);
  font-family: var(--font-ui);
  transition: border-color 0.15s;
  line-height: 1;
}
.collection-item:hover { border-bottom-color: var(--muted); }

/* [4] hover unificado */
.collection-item:hover .collection-name { color: var(--hover); }

.collection-name {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
  transition: color 0.15s;
  padding-right: 1rem;
}

.collection-status, .collection-count {
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 300;
}

.collection-status {
  font-style: italic;
}


/* ============================================
   PÁGINA DE ANTOLOGÍA
   ============================================ */

.anthology-header {
  margin-bottom: 2rem;
}

.anthology-title {
  font-family: var(--font-body);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.anthology-subtitle {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 300;
}

/* [2] LISTA DE ENTRADAS — ul/li con flexbox y columnas alineadas */
.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* .writing-list li {
  border-bottom: 1px solid var(--bg-subtle);
  transition: border-color 0.15s;
} */
/* .writing-list li:first-child {
  border-top: 1px solid var(--muted);
} */
.writing-list li:hover {
  border-bottom-color: var(--muted);
}

/* [2] cada entrada: flex con columnas de ancho fijo para fecha y tipo,
   el título ocupa el espacio restante sin verse afectado por los predecesores */
.writing-item {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 0.5rem 0;
  width: 100%;
}

.writing-date, .writing-type {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 300;
  white-space: nowrap;
  line-height: 0.8;
}

.writing-date {
  flex: 0 0 6rem;   /* ancho fijo: todas las fechas alineadas */
}

.writing-type {
  flex: 0 0 4rem;   /* ancho fijo: todos los tipos alineados */
}

.writing-title {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--text);
  /* font-style: italic; */
  transition: color 0.15s;
  line-height: 1.1;
  flex: 1;          /* ocupa el resto sin desplazarse */
}
/* [4] hover unificado */
.writing-list li:hover .writing-title { color: var(--hover); }

/* ============================================
   PÁGINA DE ARTÍCULO/TEXTO
   ============================================ */

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-family: var(--font-body);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.article-meta {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 300;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.article-meta .sep {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Contenido del artículo */
.article-body {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--text);
}

.article-body > * {
  margin-bottom: 1.4rem;
  white-space: pre-wrap;
}

.article-body h1, h2 {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  margin-left: 0.6rem;
}

.article-body h1 {
  font-size: 1.6rem;
}

.article-body h2 {
    font-size: 1.35rem;
}

.article-body .epigrafe {
  /* font-style: italic; */
  color: var(--dim);
  text-align: right;
  font-size: 1.05rem;
  line-height: 1.1;
  max-width: 85%;
  margin-left: auto;
}

/* [5] LISTAS DENTRO DE ARTÍCULOS
   padding-left crea espacio para los bullets sin comerse el padding del container;
   list-style-position: outside es el default, pero lo declaramos explícito */
.article-body ul,
.article-body ol {
  margin-bottom: 1.4em;
  padding-left: 1.4em;   /* espacio para bullets, relativo al texto — no al container */
  list-style-position: outside;
}

.article-body ul li,
.article-body ol li {
  margin-bottom: 0.35em;
  padding-left: 0.2em;
}

/* Verso: preservar saltos de línea */
.article-body.verse p {
  margin-bottom: 1.35rem;
  font-size: 1.16rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article-body em { font-style: italic; }
.article-body strong { font-weight: 800; }

.article-body blockquote {
  border-left: 2px solid var(--muted);
  padding-left: 1.25rem;
  color: var(--dim);
  line-height: 1.22;
  font-size: 1.16rem;
  /* font-style: italic; */
  margin-left: 7px;
}

.article-body .footnotes {
  margin-top: 7rem;
  font-size: 1rem;
}

.article-body .footnotes p {
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

.article-body hr {
  border-color: var(--dim);
  margin-bottom: 1.25rem;
}

.article-body a {
  border-bottom: 1px solid var(--muted);
  transition: border-color 0.15s;
}
/* [4] hover unificado */
.article-body a:hover { border-color: var(--hover); color: var(--hover); }

/* ============================================
   FOOTER
   ============================================ */

footer.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--bg-subtle);
  /* [1] flex-shrink: 0 evita que el footer se comprima */
  flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  nav.site-nav {
    padding: 0 1rem;
  }

  .nav-right {
    gap: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* [2] en móvil: metadatos y título en dos renglones */
  .writing-item {
    /* flex-direction: column-reverse; */
    flex-wrap: wrap-reverse;
    gap: 0.1rem;
    column-gap: 1.2rem;
  }

  .writing-date,
  .writing-type {
    flex: 0 0 auto;
    font-size: 0.72rem;
  }

  .writing-title {
    flex: 0 0 100%;   /* título en su propio renglón */
    padding-left: 0;
  }
}
