/* =====================================================
   author.css  ·  Página de autor
   (hero y layout; cards y aside van en sus propios CSS)
   ===================================================== */

/* =====================================================
   VARIABLES DE MARCA
   ===================================================== */
body {
  --grafito:        #34383D;
  --grafito-oscuro: #26292D;
  --grafito-suave:  #5E636A;
  --naranja:        #F26B1D;
  --naranja-hover:  #FF8238;
  --fondo-claro:    #F5F4F2;
  --borde:          #E4E2DF;
  --blanco:         #FFFFFF;
  --texto-claro:    #F3F1EE;
  --texto-claro-suave: #B9BCC0;
  --radio:          20px;
  --ancho:          1200px;
  --pad-x: max(6vw, calc((100% - var(--ancho)) / 2));
  --pad-y: 96px;

  /* Si tu header es fijo (sticky), pon aquí su alto, ej: 80px */
  --alto-header: 0px;
}

/* =====================================================
   BASE
   ===================================================== */
:is(#author-hero, #author-hero-text, .post-layout),
:is(#author-hero, #author-hero-text, .post-layout) *,
:is(#author-hero, #author-hero-text, .post-layout) *::before,
:is(#author-hero, #author-hero-text, .post-layout) *::after {
  box-sizing: border-box;
}

#author-hero-text h1 {
  font-weight: 400;          /* Bebas Neue solo tiene 400 */
  line-height: 1.05;
  letter-spacing: .5px;
}

/* =====================================================
   HERO: la imagen se funde en grafito y el título
   se monta sobre la parte baja de la imagen
   (mismo estilo que las categorías)
   ===================================================== */
#author-hero {
  position: relative;
  overflow: hidden;
  background: var(--grafito);
}
/* Sin imagen, el hero no ocupa espacio */
#author-hero:not(:has(#author-hero-image)) { display: none; }
#author-hero:has(#author-hero-image) { min-height: 62vh; }

#author-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
#author-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    var(--grafito) 0%,
    rgba(52, 56, 61, .75) 30%,
    rgba(52, 56, 61, .15) 75%,
    rgba(52, 56, 61, 0) 100%);
}

/* Título y descripción */
#author-hero-text {
  position: relative;
  z-index: 2;
  padding: 160px var(--pad-x) var(--pad-y);
  background: var(--grafito);
  color: var(--texto-claro);
}
/* Con imagen: sube y se monta sobre la parte baja del hero */
#author-hero:has(#author-hero-image) + #author-hero-text {
  margin-top: -170px;
  padding-top: 0;
  background: linear-gradient(180deg, transparent 0 170px, var(--grafito) 170px);
}

/* Línea naranja a la izquierda (igual que los demás heros) */
#author-hero-info,
#author-hero-description {
  max-width: 820px;
  padding-left: 28px;
  border-left: 4px solid var(--naranja);
}

/* Avatar + nombre en una fila */
#author-hero-info {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
}
#author-hero-info img {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 4px var(--grafito),
    0 0 0 7px var(--naranja);
}
#author-hero-text h1 {
  min-width: 0;
  margin: 0;
  color: var(--blanco);
  overflow-wrap: break-word;
}
#author-hero-description {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--texto-claro-suave);
}
#author-hero-description p {
  margin: 0 0 14px;
  font-weight: 400;
  line-height: 1.75;
}
#author-hero-description p:last-child { margin-bottom: 0; }
#author-hero-description a {
  color: var(--naranja-hover);
  font-weight: 600;
  text-underline-offset: 3px;
}
#author-hero-description strong,
#author-hero-description b { font-weight: 600; color: var(--blanco); }

/* =====================================================
   LAYOUT: posts a la izquierda, aside a la derecha
   ===================================================== */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
  padding: var(--pad-y) var(--pad-x);
  background: var(--blanco);
}
#author-posts { min-width: 0; }
.post-layout > :not(#author-posts) { min-width: 0; }

/* Aside fijo: se queda en su lugar mientras bajas por los posts */
.post-layout > #blog-aside {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--alto-header) + 24px);
  align-self: start;
}

/* El sticky se rompe si algún contenedor de arriba tiene
   overflow: hidden (muchos temas lo ponen en html/body para
   evitar el scroll horizontal). "clip" recorta igual pero
   no rompe el sticky. */
html,
body,
.post-layout {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

#author-posts .blog-card-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

/* =====================================================
   PAGINACIÓN
   ===================================================== */
.mitema-pagination { margin-top: 56px; }
.mitema-pagination .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.mitema-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.mitema-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--grafito);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .25s, border-color .25s, color .25s;
}
.mitema-pagination a.page-numbers:hover {
  border-color: var(--naranja);
  color: var(--naranja);
}
.mitema-pagination .page-numbers.current {
  border-color: var(--grafito);
  background: var(--grafito);
  color: var(--blanco);
}
.mitema-pagination .page-numbers.dots {
  min-width: auto;
  padding: 0 4px;
  border: 0;
  background: none;
}
.mitema-pagination .prev,
.mitema-pagination .next {
  border-color: var(--naranja);
  background: var(--naranja);
  color: var(--blanco);
}
.mitema-pagination a.prev:hover,
.mitema-pagination a.next:hover {
  border-color: var(--grafito);
  background: var(--grafito);
  color: var(--blanco);
}
.mitema-pagination .page-numbers:focus-visible {
  outline: 3px solid var(--naranja-hover);
  outline-offset: 3px;
}

/* =====================================================
   RESPONSIVE: TABLET (hasta 1024px)
   ===================================================== */
@media (max-width: 1024px) {
  body { --pad-y: 72px; }
  #author-hero-text h1 { font-size: 56px; }

  #author-hero:has(#author-hero-image) { min-height: 50vh; }

  /* El aside pasa debajo de los posts y deja de estar fijo */
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }
  .post-layout > #blog-aside { position: static; }
}

/* =====================================================
   RESPONSIVE: MÓVIL (hasta 767px)
   ===================================================== */
@media (max-width: 767px) {
  body { --pad-y: 56px; --pad-x: 20px; }
  #author-hero-text h1 { font-size: 38px; }

  #author-hero:has(#author-hero-image) { min-height: 44vh; }
  #author-hero:has(#author-hero-image) + #author-hero-text {
    margin-top: -120px;
    background: linear-gradient(180deg, transparent 0 120px, var(--grafito) 120px);
  }
  #author-hero:not(:has(#author-hero-image)) + #author-hero-text { padding-top: 96px; }

  #author-hero-info,
  #author-hero-description { padding-left: 18px; }
  #author-hero-info { gap: 16px; padding-bottom: 18px; }
  #author-hero-info img { width: 72px; height: 72px; }

  .post-layout { gap: 40px; }
  #author-posts .blog-card-list { gap: 20px; }

  .mitema-pagination { margin-top: 40px; }
  .mitema-pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-layout * { transition: none !important; }
}