/**
 * Blog index (journal): grid Nº / Entrada / Etiquetas / Año + cursor preview + newsletter.
 * Mobile-first; breakpoint desktop: 48rem.
 */

/* -------------------------------------------------------------------------
 * Block
 * ------------------------------------------------------------------------- */

.mwm-blog {
  position: relative;
  padding: 0 1rem calc(6rem + env(safe-area-inset-bottom, 0));
  color: var(--mwm--color-white, #fff);
  font-family: var(--mwm--font-family, "Xanh Mono", monospace);
  font-weight: var(--mwm--font-weight-regular, 400);
}

/* -------------------------------------------------------------------------
 * Intro
 * ------------------------------------------------------------------------- */

.mwm-blog__intro {
  margin-bottom: 3rem;
}

.mwm-blog__page-title {
  margin: 0;
  font-size: var(--mwm--font-size-d100, 2rem);
  line-height: 1.2;
  font-weight: var(--mwm--font-weight-regular, 400);
  color: var(--mwm--color-white, #fff);
}

.mwm-blog__page-title-sup {
  position: relative;
  top: 0;
  margin-right: 0.25rem;
  font-size: 1em;
  line-height: 1.2;
  vertical-align: baseline;
}

.mwm-blog__page-title-text {
  font-size: 1em;
  line-height: 1.2;
}

.mwm-blog__page-description {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: var(--mwm--font-weight-regular, 400);
  color: var(--mwm--color-white, #fff);
}

.mwm-blog__page-description > p {
  margin: 0 0 0.75rem;
}

.mwm-blog__page-description > p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------
 * Table / grid
 * ------------------------------------------------------------------------- */

.mwm-blog__table {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 0;
}

.mwm-blog__head.mwm-blog__row {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  opacity: 1;
}

.mwm-blog__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mwm-blog__head,
.mwm-blog__body .mwm-blog__row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: flex-start;
  gap: 0.5rem;
}

.mwm-blog__cell--num {
  box-sizing: content-box;
  min-width: 1.5rem;
  padding-right: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  text-align: justify;
}

.mwm-blog__cell--entry {
  min-width: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.mwm-blog__cell--tags {
  box-sizing: border-box;
  min-width: 0;
  padding-left: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.mwm-blog__cell--year {
  box-sizing: content-box;
  padding-left: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  text-align: justify;
  white-space: nowrap;
}

.mwm-blog__cell--year-head {
  opacity: 0.15;
}

/* -------------------------------------------------------------------------
 * Entry title
 * ------------------------------------------------------------------------- */

.mwm-blog__title {
  margin: 0;
  font-size: inherit;
  font-weight: var(--mwm--font-weight-regular, 400);
  line-height: inherit;
}

.mwm-blog__title-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mwm-blog__title-link:hover,
.mwm-blog__title-link:focus-visible {
  opacity: 0.7;
}

/* -------------------------------------------------------------------------
 * Tags
 * ------------------------------------------------------------------------- */

.mwm-blog__tags-heading {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.mwm-blog__tags-heading-text {
  text-align: justify;
}

.mwm-blog__tags-heading-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 1.333rem;
  height: 1rem;
}

.mwm-blog__tags-heading-icon svg {
  display: block;
  width: 100%;
  height: auto;
  /* icon-bottom.php: caret up; rotate to match “down” (mismo criterio que acordeón cerrado). */
  transform: rotate(180deg);
  transform-origin: center;
}

.mwm-blog__tags-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem;
}

.mwm-blog__tag {
  text-align: justify;
}

/* -------------------------------------------------------------------------
 * Body rows
 * ------------------------------------------------------------------------- */

.mwm-blog__body .mwm-blog__row {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  opacity: 0.8;
}

/* -------------------------------------------------------------------------
 * Cursor image preview
 * ------------------------------------------------------------------------- */

.mwm-blog__cursor-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: min(22rem, 42vw);
  max-height: min(18rem, 50vh);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  will-change: transform;
}

.mwm-blog__cursor-img {
  display: block;
  width: 100%;
  max-height: min(18rem, 50vh);
  height: auto;
  object-fit: cover;
}

/* -------------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------------- */

.mwm-blog .site-pagination {
  margin-top: 3rem;
}

/* -------------------------------------------------------------------------
 * Newsletter (shortcode): mobile = barra inferior fija, ancho contenido
 * ------------------------------------------------------------------------- */

.mwm-blog__newsletter-floating {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  max-width: none;
  padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0));
  pointer-events: none;
}

.mwm-blog__newsletter-floating .mwm-newsletter {
  pointer-events: auto;
  max-width: 28rem;
  margin-right: auto;
  margin-left: auto;
}

/* -------------------------------------------------------------------------
 * Media: desktop (min-width 48rem)
 * ------------------------------------------------------------------------- */

@media (min-width: 48rem) {
  .mwm-blog {
    padding: 0 1.25rem 5rem;
  }

  .mwm-blog__intro {
    margin-bottom: 5rem;
  }

  .mwm-blog__table {
    gap: 5rem;
    min-height: 40.5rem;
  }

  .mwm-blog__head,
  .mwm-blog__body .mwm-blog__row {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
  }

  .mwm-blog__cell--num {
    padding-right: 7.5rem;
  }

  .mwm-blog__cell--tags {
    padding-left: 7.5rem;
  }

  .mwm-blog__cell--year {
    padding-left: 5rem;
  }

  .mwm-blog__cell--year-head {
    opacity: 0.02;
  }

  .mwm-blog .site-pagination {
    margin-top: 5rem;
  }

  .mwm-blog__newsletter-floating {
    position: absolute;
    right: 20px;
    bottom: 80px;
    left: auto;
    padding: 0;
    max-width: calc(100vw - 40px);
  }

  .mwm-blog__newsletter-floating .mwm-newsletter {
    margin-left: auto;
    margin-right: 0;
    max-width: none;
  }
}
