/* =============================================================================
   EL REGENTE — Component Styles
   Depends on: tokens.css (must be loaded first)
   ============================================================================= */

/* ── Google Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&family=JetBrains+Mono:wght@400&display=swap');

/* ── Override Blocksy palette → El Regente light-base brand ─────────────── */
:root {
  --theme-palette-color-1: #E53920 !important;
  --theme-palette-color-2: #C0281A !important;
  --theme-palette-color-3: #444444 !important;
  --theme-palette-color-4: #111111 !important;
  --theme-palette-color-5: #F0EFED !important;
  --theme-palette-color-6: #FFFFFF !important;
  --theme-palette-color-7: #FAFAF8 !important;
  --theme-palette-color-8: #FAFAF8 !important;
  --theme-text-color: #444444 !important;
  --theme-headings-color: #111111 !important;
  --theme-link-initial-color: #E53920 !important;
  --theme-link-hover-color: #C0281A !important;
  --theme-border-color: #E2E0DC !important;
  --theme-button-background-initial-color: #E53920 !important;
  --theme-button-background-hover-color: #C0281A !important;
  --theme-font-family: 'Space Grotesk', system-ui, sans-serif !important;
}

/* ── Page base — white newsprint ─────────────────────────────────────────── */
html body,
html body .site,
html body .ct-container,
html body .ct-container-full,
html body [data-prefix],
html body main,
html body #main-content,
html body .er-front,
html body .er-front__hero,
html body .er-front__grid,
html body .er-front__feed,
html body .er-front__newsletter {
  background-color: var(--er-bg-primary, #FAFAF8) !important;
  color: var(--er-text-primary, #111111);
}

/* ── Header always dark (brand anchor) ──────────────────────────────────── */
html body .ct-header,
html body [data-row*="middle"] {
  background-color: #111111;
}

/* ── Footer dark ─────────────────────────────────────────────────────────── */
html body .ct-footer {
  background-color: #111111;
}

html body .ct-footer [data-row*="bottom"] {
  background-color: #0D0D0D;
}

/* ── Dark mode — flip page back to dark ──────────────────────────────────── */
html[data-theme="dark"] body,
html[data-theme="dark"] body .site,
html[data-theme="dark"] body main,
html[data-theme="dark"] body #main-content,
html[data-theme="dark"] body .er-front,
html[data-theme="dark"] body .er-front__hero,
html[data-theme="dark"] body .er-front__grid,
html[data-theme="dark"] body .er-front__feed,
html[data-theme="dark"] body .er-front__newsletter {
  background-color: #1A1A1A !important;
  color: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body,
  html:not([data-theme="light"]) body .site,
  html:not([data-theme="light"]) body main,
  html:not([data-theme="light"]) body #main-content,
  html:not([data-theme="light"]) body .er-front,
  html:not([data-theme="light"]) body .er-front__grid,
  html:not([data-theme="light"]) body .er-front__feed {
    background-color: #1A1A1A !important;
    color: #FFFFFF;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--er-bg-primary);
  color: var(--er-text-primary);
  font-family: var(--er-font-body);
  font-size: var(--er-text-base);
  line-height: var(--er-leading-normal);
  padding-top: var(--er-header-height, 76px) !important;
  transition:
    background-color var(--er-transition-theme),
    color var(--er-transition-theme);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  line-height: var(--er-leading-tight);
  color: var(--er-text-primary);
  letter-spacing: var(--er-tracking-tight);
}

a {
  color: var(--er-text-brand);
  text-decoration: none;
  transition: color var(--er-transition-fast);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

img,
video,
svg {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

::selection {
  background-color: var(--er-color-brand);
  color: #ffffff;
}

/* Body bottom padding when podcast player is active */
body.er-player-active {
  padding-bottom: var(--er-player-height);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.er-container {
  width: 100%;
  max-width: var(--er-container-max);
  margin-inline: auto;
  padding-inline: var(--er-space-6);
}

.er-container--wide {
  max-width: var(--er-container-wide);
}

.er-container--narrow {
  max-width: var(--er-container-narrow);
}

@media (max-width: 768px) {
  .er-container {
    padding-inline: var(--er-space-4);
  }
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.er-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--er-header-height);
  background-color: var(--er-header-bg, #111111); /* always dark — brand anchor */
  border-bottom: 1px solid rgba(255,255,255,0.07);
  z-index: var(--er-z-header);
}

.er-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--er-container-max);
  margin-inline: auto;
  padding-inline: var(--er-space-6);
  padding-top: 15px;
  gap: clamp(var(--er-space-4), 2vw, var(--er-space-8)); /* defensivo: el nav no empuja las acciones fuera del contenedor */
}

.er-header__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
}

.er-header__logo img {
  max-height: 38px;
  width: auto;
}

.er-header__logo-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.er-header__logo-name {
  font-family: var(--er-font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
  transition: color var(--er-transition-fast);
}

.er-header__logo:hover .er-header__logo-name {
  color: #E53920;
}

.er-header__logo-spade {
  color: #E53920;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform var(--er-transition-fast);
}

.er-header__logo:hover .er-header__logo-spade {
  transform: scale(1.2);
}

.er-header__nav {
  display: flex;
  align-items: center;
  gap: var(--er-space-8);
  flex: 1 1 auto;
  min-inline-size: 0; /* permite que el nav ceda espacio en vez de desbordar */
  justify-content: center;
}

/* Nav <ul> rendered by wp_nav_menu */
.er-header__menu {
  display: flex !important;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(var(--er-space-2), .9vw, var(--er-space-6));
  flex-wrap: nowrap;
  min-inline-size: 0;
}

.er-header__menu > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.er-header__menu > li > a {
  color: #ffffff !important;
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s;
  padding: 0.25rem 0;
  display: block;
}

/* Defensivo 1025–1360px: el menú (9 ítems) no cabe con el tracking amplio y pisaba el botón de búsqueda/suscribirse */
@media (min-width: 1025px) and (max-width: 1360px) {
  .er-header__menu > li > a { font-size: 0.65rem; letter-spacing: 0.04em; }
  .er-header__menu { gap: var(--er-space-2); }
}
/* 1025–1180px: letra y huecos mínimos para que el menú quepa junto a búsqueda y Suscribirse (medido: sin solape ni scroll) */
@media (min-width: 1025px) and (max-width: 1180px) {
  .er-header__menu > li > a { font-size: 0.6rem; letter-spacing: 0.02em; }
  .er-header__menu { gap: var(--er-space-1); }
  .er-header__inner { gap: var(--er-space-3); }
}
@media (min-width: 1361px) {
  .er-header__menu > li > a { letter-spacing: 0.05em; }
  .er-header__menu { gap: var(--er-space-2); }
}

.er-header__menu > li > a:hover,
.er-header__menu > li.current-menu-item > a {
  color: var(--er-color-brand-on-dark) !important; /* sobre #111: 5.58:1 (brand daba 4.43) */
}

.er-header__nav a {
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: var(--er-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wide);
  text-decoration: none;
  transition: color var(--er-transition-fast);
  white-space: nowrap;
  position: relative;
}

.er-header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--er-color-brand);
  transform: scaleX(0);
  transition: transform var(--er-transition-fast);
  transform-origin: left;
}

.er-header__nav a:hover {
  color: var(--er-color-brand);
  text-decoration: none;
}

.er-header__nav a:hover::after,
.er-header__nav a.current-menu-item::after {
  transform: scaleX(1);
}

.er-header__nav a.current-menu-item {
  color: var(--er-color-brand-on-dark);
}

/* Submenús (ítems con hijos): botón ▾ + panel desplegable oscuro */
.er-header__menu .menu-item-has-children { position: relative; display: flex; align-items: center; }
.er-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 24px;
  block-size: 24px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 2px;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.15s;
}
.er-submenu-toggle svg { transition: transform var(--er-transition-fast); }
.er-submenu-toggle:hover,
.er-submenu-toggle[aria-expanded="true"] { color: var(--er-color-brand-on-dark); }
.er-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.er-submenu-toggle:focus-visible,
.er-header__menu .sub-menu a:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.er-header__menu .sub-menu a:focus-visible { outline-offset: -2px; }

.er-header__menu .sub-menu { list-style: none; margin: 0; padding: 0; }
.er-header__menu .sub-menu li { list-style: none; margin: 0; padding: 0; }
.er-header__menu .sub-menu a {
  position: relative;
  display: block;
  padding: var(--er-space-3) var(--er-space-5) var(--er-space-3) var(--er-space-6);
  color: var(--er-stage-text);
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em; /* mismo tracking que el nivel superior */
  white-space: nowrap;
  transition: color var(--er-transition-fast), background-color var(--er-transition-fast);
}
/* Indicador de estado: barra roja a la izquierda (mismo gesto que el subrayado del nivel superior) */
.er-header__menu .sub-menu a::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 2px;
  height: auto;
  background-color: var(--er-color-brand);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--er-transition-fast);
}
/* ♠ solo en el ítem actual (motivo de la marca, como en el ticker) */
.er-header__menu .sub-menu .current-menu-item > a::before {
  content: '♠';
  position: absolute;
  inset-inline-start: var(--er-space-2);
  inset-block-start: 50%;
  transform: translateY(-50%);
  font-family: var(--er-font-symbol);
  font-size: 0.6rem;
  line-height: 1;
  color: var(--er-color-brand-on-dark);
}
.er-header__menu .sub-menu a:hover,
.er-header__menu .sub-menu a:focus-visible,
.er-header__menu .sub-menu .current-menu-item > a {
  color: var(--er-color-brand-on-dark);
  background-color: rgba(255,255,255,0.04);
}
.er-header__menu .sub-menu a:hover::after,
.er-header__menu .sub-menu a:focus-visible::after,
.er-header__menu .sub-menu .current-menu-item > a::after { transform: scaleY(1); }
/* Separadores finos como en el menú móvil y el footer */
.er-header__menu .sub-menu li + li { border-top: 1px solid var(--er-stage-line); }
/* El padre queda subrayado mientras su panel está abierto: une botón y panel */
.er-header__menu > li.menu-item-has-children > a::after { transition: transform var(--er-transition-fast); }
/* 3er nivel: sin flyout, se apila con sangría */
.er-header__menu .sub-menu .sub-menu a { padding-inline-start: var(--er-space-8); }

@media (min-width: 1025px) {
  .er-header__menu > li > .sub-menu {
    position: absolute;
    inset-block-start: calc(50% + var(--er-header-height) / 2); /* justo bajo la barra */
    inset-inline-start: 0;
    min-inline-size: 15rem;
    padding: 0;
    background-color: var(--er-stage-bg);
    border-top: 2px solid var(--er-color-brand);
    border-inline: 1px solid var(--er-stage-line);
    border-bottom: 1px solid var(--er-stage-line);
    box-shadow: var(--er-shadow-paper-lift);
    z-index: var(--er-z-dropdown);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
  }
  /* Puente invisible para que el puntero no pierda el hover entre el ítem y el panel */
  .er-header__menu > li > .sub-menu::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    inset-block-end: 100%;
    block-size: calc(var(--er-header-height) / 2);
  }
  .er-header__menu > li.menu-item-has-children:hover > .sub-menu,
  .er-header__menu > li.menu-item-has-children:focus-within > .sub-menu,
  .er-header__menu > li.menu-item-has-children.is-open > .sub-menu {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  /* Subrayado rojo del padre mientras el panel está visible */
  .er-header__menu > li.menu-item-has-children:hover:not(.is-closed) > a::after,
  .er-header__menu > li.menu-item-has-children:focus-within:not(.is-closed) > a::after,
  .er-header__menu > li.menu-item-has-children.is-open > a::after { transform: scaleX(1); }
  /* Esc / segundo clic en el botón: gana sobre hover y foco hasta salir del ítem */
  .er-header__menu > li.menu-item-has-children.is-closed > .sub-menu {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
  .er-header__menu > li > .sub-menu { transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s; }
  .er-header__menu > li.menu-item-has-children:hover > .sub-menu,
  .er-header__menu > li.menu-item-has-children:focus-within > .sub-menu,
  .er-header__menu > li.menu-item-has-children.is-open > .sub-menu { transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .er-submenu-toggle svg,
  .er-header__menu .sub-menu a,
  .er-header__menu .sub-menu a::after { transition: none; }
}

.er-header__actions {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  flex-shrink: 0;
}

/* Subscribe button */
.er-btn-subscribe {
  display: inline-flex;
  align-items: center;
  background-color: var(--er-color-brand);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wide);
  padding: 8px 20px;
  border-radius: var(--er-radius-pill);
  border: none;
  text-decoration: none;
  transition:
    background-color var(--er-transition-fast),
    transform var(--er-transition-fast),
    box-shadow var(--er-transition-fast);
  white-space: nowrap;
}

.er-btn-subscribe:hover {
  background-color: var(--er-color-brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--er-shadow-brand);
  text-decoration: none;
  color: #ffffff;
}

/* Hamburger button */
.er-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--er-radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.er-hamburger__line {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* X state when nav is open */
.er-header__nav.is-open ~ .er-header__actions .er-hamburger .er-hamburger__line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.er-header__nav.is-open ~ .er-header__actions .er-hamburger .er-hamburger__line:nth-child(2) {
  opacity: 0;
}
.er-header__nav.is-open ~ .er-header__actions .er-hamburger .er-hamburger__line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 1024px) {
  .er-header__nav {
    display: none;
  }

  .er-hamburger {
    display: flex;
  }

  .er-header__subscribe,
  .er-header__inner .er-header__subscribe {
    display: none !important;
  }

  .er-header__nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--er-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #111111;
    padding: var(--er-space-8) var(--er-space-6);
    gap: var(--er-space-2);
    border-top: 2px solid var(--er-color-brand);
    z-index: var(--er-z-dropdown);
    justify-content: flex-start;
    align-items: flex-start;
    overflow-y: auto;
  }

  .er-header__nav.is-open .er-header__menu > li > a {
    font-size: var(--er-text-xl);
    font-weight: var(--er-font-bold);
    padding: var(--er-space-3) 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    width: 100%;
    display: block;
  }

  .er-header__nav.is-open .er-header__menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  /* Submenú acordeón: colapsado por defecto, se abre con el botón ▾ */
  .er-header__nav.is-open .er-header__menu > li.menu-item-has-children {
    flex-wrap: wrap;
    align-items: stretch;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .er-header__nav.is-open .er-header__menu > li.menu-item-has-children > a {
    flex: 1 1 auto;
    width: auto;
    border-bottom: 0;
    text-align: center;
    padding-inline-start: 48px; /* compensa el botón ▾ para que el texto quede centrado como los demás ítems */
  }
  .er-header__nav.is-open .er-submenu-toggle {
    inline-size: 48px;
    block-size: auto;
    min-block-size: 44px;
  }
  .er-header__nav.is-open .er-submenu-toggle svg { inline-size: 14px; block-size: 14px; }
  .er-header__nav.is-open .er-header__menu .sub-menu {
    display: none;
    flex: 0 0 100%;
    margin-block-end: var(--er-space-3);
    padding: 0;
    background-color: var(--er-stage-bg-raised);
    border-inline-start: 2px solid var(--er-color-brand); /* hilo rojo: agrupa los hijos bajo su sección */
    text-align: start;
  }
  .er-header__nav.is-open .er-header__menu li.is-open > .sub-menu { display: block; }
  .er-header__nav.is-open .er-header__menu li.is-open > a,
  .er-header__nav.is-open .er-header__menu li.is-open > .er-submenu-toggle { color: var(--er-color-brand-on-dark) !important; }
  .er-header__nav.is-open .er-header__menu .sub-menu a {
    display: flex;
    align-items: center;
    gap: var(--er-space-3);
    min-block-size: 48px;
    padding: var(--er-space-3) var(--er-space-5);
    font-size: var(--er-text-base);
    letter-spacing: 0.06em;
    white-space: normal;
    border-bottom: 0;
  }
  /* ♠ como viñeta (mismo motivo que el ticker); rojo AA sobre #1A1A1A */
  .er-header__nav.is-open .er-header__menu .sub-menu a::before {
    content: '♠';
    flex: none;
    font-family: var(--er-font-symbol);
    font-size: 0.7em;
    color: var(--er-color-brand-on-dark);
  }
  .er-header__nav.is-open .er-header__menu .sub-menu a::after { content: none; }
  .er-header__nav.is-open .er-header__menu .sub-menu a:hover,
  .er-header__nav.is-open .er-header__menu .sub-menu .current-menu-item > a { background-color: transparent; }
  .er-header__nav.is-open .er-header__menu .sub-menu .sub-menu a { padding-inline-start: var(--er-space-8); }
}

/* Additional offset for ticker (body already handles header height) */
.er-page-offset {
  padding-top: var(--er-ticker-height);
}

.er-page-offset--no-ticker {
  padding-top: 0;
}

/* ── BREAKING NEWS TICKER ─────────────────────────────────────────────────── */
.er-ticker {
  display: flex;
  align-items: center;
  background-color: var(--er-color-brand);
  color: #ffffff;
  height: var(--er-ticker-height);
  position: sticky;
  top: var(--er-header-height);
  z-index: var(--er-z-ticker);
  overflow: hidden;
}

.er-ticker.is-hidden {
  display: none;
}

.er-ticker__label {
  display: flex;
  align-items: center;
  gap: var(--er-space-2);
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-widest);
  padding: 0 var(--er-space-4);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
  height: 100%;
}

.er-ticker__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
  animation: er-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.er-ticker__track {
  overflow: hidden;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%);
}

.er-ticker__items {
  display: flex;
  align-items: center;
  animation: er-scroll 40s linear infinite;
  white-space: nowrap;
}

.er-ticker__items:hover {
  animation-play-state: paused;
}

.er-ticker__item {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--er-space-10);
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: var(--er-font-medium);
  white-space: nowrap;
}

.er-ticker__item a {
  color: #ffffff;
  text-decoration: none;
}

.er-ticker__item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.er-ticker__item::before {
  content: '♠';
  margin-right: var(--er-space-3);
  opacity: 0.6;
  font-size: 10px;
}

.er-ticker__close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 var(--er-space-3);
  font-size: 18px;
  line-height: 1;
  height: 100%;
  flex-shrink: 0;
  transition: color var(--er-transition-fast);
}

.er-ticker__close:hover {
  color: #ffffff;
}

@keyframes er-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes er-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ── ARTICLE CARDS ───────────────────────────────────────────────────────── */
.er-card {
  display: flex;
  flex-direction: column;
  background-color: var(--er-bg-secondary);
  border-radius: var(--er-radius-lg);
  overflow: hidden;
  transition:
    transform var(--er-transition-base),
    box-shadow var(--er-transition-base);
  position: relative;
}

.er-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--er-shadow-md);
}

.er-card__image {
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.er-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--er-transition-slow);
}

.er-card:hover .er-card__image img {
  transform: scale(1.03);
}

.er-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--er-space-3);
  padding: var(--er-space-5);
  flex: 1;
}

.er-card__meta {
  display: flex;
  align-items: center;
  gap: var(--er-space-2);
  flex-wrap: wrap;
}

.er-card__title {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  color: var(--er-text-primary);
  line-height: var(--er-leading-snug);
  letter-spacing: var(--er-tracking-tight);
}

.er-card__title a {
  color: inherit;
  text-decoration: none;
}

.er-card__title a:hover {
  color: var(--er-text-brand);
  text-decoration: none;
}

.er-card__excerpt {
  font-family: var(--er-font-body);
  font-size: var(--er-text-base);
  color: var(--er-text-muted);
  line-height: var(--er-leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.er-card__footer {
  margin-top: auto;
  padding-top: var(--er-space-3);
  border-top: 1px solid var(--er-border-subtle);
}

/* ── Card: Hero ─────────────────────────────────────────────────────────── */
.er-card--hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--er-radius-xl);
  background-color: #1A1A1A;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.er-card--hero .er-card__image-wrap {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0;
}

.er-card--hero .er-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.er-card--hero .er-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.90) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0.10) 100%
  );
}

.er-card--hero .er-card__body {
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  flex: 0 0 auto; /* must NOT grow — flex-end only works on natural-height body */
}

.er-card--hero .er-card__title {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1.2;
}

.er-card--hero .er-card__title a {
  color: #ffffff;
  text-decoration: none;
}

.er-card--hero .er-card__title a:hover {
  color: var(--er-color-brand);
}

.er-card--hero .er-card__excerpt {
  font-size: var(--er-text-base);
  color: rgba(255, 255, 255, 0.82);
}

.er-card--hero .er-card__meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--er-text-sm);
  margin-top: 0.25rem;
}

.er-card--hero:hover {
  transform: none;
}

@media (max-width: 768px) {
  .er-card--hero {
    min-height: 320px;
  }

  .er-card--hero .er-card__body {
    padding: 1.25rem;
  }
}

/* ── Card: Standard ─────────────────────────────────────────────────────── */
.er-card--standard .er-card__image {
  aspect-ratio: 16 / 9;
}

.er-card--standard .er-card__title {
  font-size: var(--er-text-xl);
}

/* ── Card: Compact ──────────────────────────────────────────────────────── */
.er-card--compact {
  flex-direction: row;
  align-items: stretch;
}

.er-card--compact .er-card__image {
  width: 40%;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: 0;
}

.er-card--compact .er-card__body {
  padding: var(--er-space-4);
  gap: var(--er-space-2);
}

.er-card--compact .er-card__title {
  font-size: var(--er-text-base);
  font-weight: var(--er-font-semibold);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

/* ── CATEGORY BADGE ──────────────────────────────────────────────────────── */
.er-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--er-color-brand-action);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wider);
  padding: 4px 10px;
  border-radius: var(--er-radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--er-transition-fast);
  line-height: 1.6;
}

.er-badge:hover {
  background-color: var(--er-color-brand-hover);
  color: #ffffff;
  text-decoration: none;
}

.er-badge--outline {
  background-color: transparent;
  border: 1px solid var(--er-color-brand);
  color: var(--er-color-brand);
}

.er-badge--outline:hover {
  background-color: var(--er-color-brand);
  color: #ffffff;
}

.er-badge--dark {
  background-color: var(--er-bg-elevated);
  color: var(--er-text-secondary);
}

.er-badge--dark:hover {
  background-color: var(--er-border-strong);
  color: var(--er-text-primary);
}

/* ── AUTHOR BYLINE ───────────────────────────────────────────────────────── */
.er-byline {
  display: flex;
  align-items: center;
  gap: var(--er-space-2);
  text-decoration: none;
}

.er-byline__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--er-bg-elevated);
}

.er-byline__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.er-byline__name {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-semibold);
  font-size: var(--er-text-sm);
  color: var(--er-text-primary);
  line-height: 1.2;
}

.er-byline__date {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* ══ E2-FE · LA REGENCIA (.er-newsletter*): inicio de región ═══════════════
   Parcial único: template-parts/content/newsletter-cta.php (full | inline | compact). */
.er-newsletter {
  --nl-fg:        var(--er-stage-text);
  --nl-fg-soft:   var(--er-stage-text-soft);
  --nl-fg-dim:    var(--er-stage-text-dim);
  --nl-line:      var(--er-stage-line-strong);
  --nl-accent:    var(--er-color-brand-on-dark);
  --nl-field-bg:  rgba(255,255,255,0.06);
  container: regencia / inline-size;
  position: relative;
  color: var(--nl-fg);
  font-family: var(--er-font-body);
}

.er-newsletter--full,
.er-newsletter--compact {
  background-color: var(--er-stage-bg);
  overflow: hidden;
}

.er-newsletter--full {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  background-image: var(--er-glow-brand);
}

.er-newsletter--full::before {
  content: '♠';
  position: absolute;
  inset-block-end: -3rem;
  inset-inline-end: 4%;
  font-family: var(--er-font-symbol);
  font-size: 22rem;
  line-height: 1;
  color: rgba(255,255,255,0.025);
  pointer-events: none;
  user-select: none;
}

.er-newsletter--compact { padding: var(--er-space-6); border-radius: var(--er-radius-lg); }

/* QA-D02: transparente (hereda el fondo de la página); se centra en una medida cómoda en vez de estirarse. */
.er-newsletter--inline {
  max-inline-size: var(--er-container-max);
  margin-inline: auto;
  padding: var(--er-space-6);
}

.er-newsletter--light {
  --nl-fg:       var(--er-ink);
  --nl-fg-soft:  var(--er-ink-soft);
  --nl-fg-dim:   var(--er-ink-muted);
  --nl-line:     var(--er-ink-muted);
  --nl-accent:   var(--er-color-brand-on-paper);
  --nl-field-bg: rgba(0,0,0,0.04);
  background-color: var(--er-paper);
  background-image: none;
}
.er-newsletter--light::before { color: rgba(0,0,0,0.03); }

.er-newsletter [hidden] { display: none !important; }

.er-newsletter__grid { position: relative; display: grid; gap: var(--er-space-8); }
.er-newsletter--inline .er-newsletter__grid,
.er-newsletter--compact .er-newsletter__grid { gap: 0; }

.er-newsletter__pitch { min-width: 0; }

.er-newsletter__eyebrow {
  margin: 0 0 var(--er-space-3);
  font: 700 var(--er-text-eyebrow)/1.2 var(--er-font-headline);
  letter-spacing: var(--er-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--nl-accent);
}

.er-newsletter__title {
  margin: 0 0 var(--er-space-2);
  font-family: var(--er-font-headline);
  font-weight: 800;
  font-size: var(--er-text-display-sm);
  line-height: var(--er-leading-display);
  letter-spacing: var(--er-tracking-display);
  color: var(--nl-fg);
}
.er-newsletter--compact .er-newsletter__title { font-size: var(--er-text-lg); line-height: 1.2; letter-spacing: -0.01em; }

.er-newsletter__tagline {
  margin: 0 0 var(--er-space-4);
  font-size: var(--er-text-lg);
  font-style: italic;
  color: var(--nl-fg-soft);
}
.er-newsletter--compact .er-newsletter__tagline { display: none; }

.er-newsletter__subtitle {
  margin: 0 0 var(--er-space-5);
  max-width: var(--er-measure-deck);
  font-size: var(--er-text-base);
  line-height: 1.6;
  color: var(--nl-fg-soft);
}
.er-newsletter--compact .er-newsletter__subtitle { font-size: var(--er-text-sm); margin-bottom: var(--er-space-4); }

.er-newsletter__benefits {
  list-style: none;
  margin: 0 0 var(--er-space-6);
  padding: 0;
  display: grid;
  gap: var(--er-space-2);
  font-size: var(--er-text-sm);
  color: var(--nl-fg-soft);
}
.er-newsletter__benefits li { display: flex; gap: var(--er-space-2); }
.er-newsletter__benefits li::before { content: '♠'; flex: none; color: var(--nl-accent); font-family: var(--er-font-symbol); }

/* ── Formulario ─────────────────────────────────────────────────────────── */
.er-newsletter__form { position: relative; margin: 0; }

.er-newsletter__hp {
  position: absolute;
  inset-inline-start: -10000px;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.er-newsletter__label {
  display: block;
  margin-block-end: var(--er-space-2);
  font: 700 var(--er-text-eyebrow)/1.2 var(--er-font-headline);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nl-fg-dim);
}
.er-newsletter--inline .er-newsletter__label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.er-newsletter__row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.25rem;
  min-block-size: var(--er-control-h);
  border: 1px solid var(--nl-line);
  border-radius: var(--er-radius-lg);
  background-color: var(--nl-field-bg);
  transition: border-color var(--er-dur-2) var(--er-ease-out), box-shadow var(--er-dur-2) var(--er-ease-out);
}
.er-newsletter__row:focus-within {
  border-color: var(--nl-fg);
  box-shadow: 0 0 0 4px rgba(229,57,32,0.45);
}
.er-newsletter--inline .er-newsletter__row,
.er-newsletter--compact .er-newsletter__row { min-block-size: 3rem; }

.er-newsletter__form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 calc(var(--er-space-4) - 0.25rem); /* + 0.25rem del marco de la fila = mismo inicio de texto que «Nombre» */
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--nl-fg);
  font: 400 1rem/1.4 var(--er-font-body); /* 16px: evita el zoom de iOS */
}
.er-newsletter__form input[type="email"]::placeholder { color: var(--nl-fg-dim); opacity: 1; }
/* Bug reportado: el texto se ve oscuro justo al escribir. Causa: Blocksy trae
   input:is([type=email],[type=text],...):focus { color: var(--theme-text-color) }
   que empata/gana en especificidad con la regla de arriba y SOLO se activa en :focus
   (el campo se ve bien en reposo y se oscurece al enfocar/teclear). Repetimos :focus
   aquí para subir la especificidad sin !important, igual que .er-newsletter__submit[type="submit"] más abajo. */
.er-newsletter__form input[type="email"]:focus { color: var(--nl-fg); -webkit-text-fill-color: var(--nl-fg); }

/* Nombre: misma caja que la fila del correo, encima de ella */
.er-newsletter__form .er-newsletter__name {
  display: block;
  inline-size: 100%;
  min-block-size: 3rem;
  margin: 0 0 var(--er-space-3);
  padding: 0 var(--er-space-4);
  border: 1px solid var(--nl-line);
  border-radius: var(--er-radius-lg);
  outline: 0;
  background-color: var(--nl-field-bg);
  color: var(--nl-fg);
  font: 400 1rem/1.4 var(--er-font-body); /* 16px: evita el zoom de iOS */
  transition: border-color var(--er-dur-2) var(--er-ease-out), box-shadow var(--er-dur-2) var(--er-ease-out);
}
.er-newsletter__form .er-newsletter__name::placeholder { color: var(--nl-fg-dim); opacity: 1; }
/* Mismo bug que el campo de correo (ver comentario arriba): sin el color explícito en :focus,
   Blocksy gana por especificidad y el nombre se ve gris oscuro mientras se escribe. */
.er-newsletter__form .er-newsletter__name:focus { border-color: var(--nl-fg); box-shadow: 0 0 0 4px rgba(229,57,32,0.45); color: var(--nl-fg); -webkit-text-fill-color: var(--nl-fg); }
.er-newsletter__form .er-newsletter__name[aria-invalid="true"] { border-color: var(--er-color-brand-action); }

.er-newsletter__submit {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-2);
  min-block-size: var(--er-tap);
  padding: 0 var(--er-space-5);
  border: 0;
  border-radius: calc(var(--er-radius-lg) - 4px);
  color: #fff;
  font: 700 var(--er-text-sm)/1.1 var(--er-font-headline);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--er-dur-2) var(--er-ease-out), transform var(--er-dur-1) var(--er-ease-out);
}
/* Blocksy empata en especificidad con [type="submit"] y gana por orden de carga; el atributo sube la especificidad sin !important. */
.er-newsletter__submit[type="submit"] {
  background-color: var(--er-color-brand-action);
}
.er-newsletter__submit-label::after { content: '→'; display: inline-block; margin-inline-start: 0.5em; transition: transform var(--er-dur-3) var(--er-ease-out); }
.er-newsletter__submit:active { transform: scale(0.98); }
.er-newsletter__submit:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.er-newsletter--light .er-newsletter__submit:focus-visible { outline-color: var(--er-ink); }
.er-newsletter__submit:disabled { cursor: progress; opacity: 0.85; }
@media (hover: hover) {
  .er-newsletter__submit:hover:not(:disabled) { background-color: var(--er-color-brand-hover); }
  .er-newsletter__submit:hover:not(:disabled) .er-newsletter__submit-label::after { transform: translateX(4px); }
}

.er-newsletter__spinner { display: none; }
.er-newsletter__form[data-state="loading"] .er-newsletter__submit-label::after { content: none; }
.er-newsletter__form[data-state="loading"] .er-newsletter__spinner {
  display: inline-block;
  inline-size: 1em;
  block-size: 1em;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: er-nl-spin 700ms linear infinite;
}
@keyframes er-nl-spin { to { transform: rotate(360deg); } }

.er-newsletter__form[data-state="error"] .er-newsletter__row { border-color: var(--nl-accent); }

.er-newsletter__error,
.er-newsletter__status[data-status="error"] {
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  margin: var(--er-space-2) 0 0;
  font-size: var(--er-text-sm);
  line-height: 1.4;
  color: var(--nl-accent);
  outline: 0; /* foco programático (QA-D05): el color + icono ya llevan la atención */
}
.er-newsletter__error:empty { display: none; }
.er-newsletter__error::before,
.er-newsletter__status[data-status="error"]::before { content: '!'; flex: none; font-weight: 700; }
.er-newsletter__status:empty { display: none; }
.er-newsletter__status:not([data-status="error"]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Microcopy de consentimiento: 12px/1.4, altura reservada para CLS 0 */
.er-newsletter__hint {
  margin: var(--er-space-2) 0 0;
  min-block-size: 2.8em;
  font: 400 var(--er-text-eyebrow)/1.4 var(--er-font-body);
  color: var(--nl-fg-dim);
}
.er-newsletter__hint a { color: var(--nl-fg-soft); text-decoration: underline; text-underline-offset: 0.15em; }
.er-newsletter__hint a:hover { color: var(--nl-fg); }
.er-newsletter__hint a:focus-visible { outline: 2px solid var(--nl-fg); outline-offset: 2px; }
@container regencia (max-width: 39.99rem) { .er-newsletter__hint { min-block-size: 4.2em; } }

.er-newsletter__check {
  display: flex;
  gap: var(--er-space-3);
  align-items: center;
  min-block-size: var(--er-tap);
  margin-block-start: var(--er-space-2);
  font-size: var(--er-text-sm);
  color: var(--nl-fg-soft);
  cursor: pointer;
}
.er-newsletter__check input { inline-size: 1.25rem; block-size: 1.25rem; flex: none; accent-color: var(--er-color-brand-action); }
.er-newsletter__check input:focus-visible { outline: 3px solid var(--nl-fg); outline-offset: 2px; }

.er-newsletter__success { padding-block: var(--er-space-3); outline: 0; }
.er-newsletter__success-title {
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  margin: 0 0 var(--er-space-2);
  font: 700 var(--er-text-lg)/1.2 var(--er-font-headline);
  color: var(--nl-fg);
}
.er-newsletter__success-title::before { content: '✓'; flex: none; color: #4ADE80; }
.er-newsletter--light .er-newsletter__success-title::before { color: #1B7A3A; }
.er-newsletter__success-msg { margin: 0; color: var(--nl-fg-soft); line-height: 1.5; }

/* Transición de estado (04: --er-dur-3/--er-ease-out) al pasar de campo a éxito. */
@media (prefers-reduced-motion: no-preference) {
  .er-newsletter__success:not([hidden]) { animation: er-nl-rise var(--er-dur-3) var(--er-ease-out); }
}
@keyframes er-nl-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Vista previa: la hoja del correo ───────────────────────────────────── */
.er-newsletter__preview { margin: 0; min-width: 0; }

.er-mail {
  position: relative;
  max-inline-size: 26rem;
  margin-inline: auto;
  padding: var(--er-space-5);
  border-top: 3px solid var(--er-color-brand);
  border-radius: var(--er-radius-sheet);
  background: var(--er-paper);
  color: var(--er-ink);
  box-shadow: var(--er-shadow-paper);
  overflow: hidden;
}

.er-mail__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--er-space-3);
  padding-block-end: var(--er-space-3);
  border-block-end: 1px solid var(--er-paper-edge);
}
.er-mail__brand { font: 700 var(--er-text-sm)/1.2 var(--er-font-headline); letter-spacing: 0.04em; text-transform: uppercase; }
.er-mail__brand span { color: var(--er-color-brand-on-paper); }
.er-mail__date { font: 400 var(--er-text-eyebrow)/1.2 var(--er-font-mono); color: var(--er-ink-muted); }
.er-mail__date::first-letter { text-transform: uppercase; }

.er-mail__hello { margin: var(--er-space-3) 0; font-style: italic; font-size: var(--er-text-sm); line-height: 1.45; color: var(--er-ink-muted); }

.er-mail__list { list-style: none; margin: 0; padding: 0; }
.er-mail__item {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  column-gap: var(--er-space-2);
  padding-block: var(--er-space-3);
  border-block-start: 1px solid var(--er-paper-edge);
}
.er-mail__num { grid-row: 1 / 3; font: 400 var(--er-text-eyebrow)/1.6 var(--er-font-mono); color: var(--er-ink-muted); }
.er-mail__label { font: 700 0.6875rem/1.3 var(--er-font-headline); letter-spacing: 0.12em; text-transform: uppercase; color: var(--er-color-brand-on-paper); }
.er-mail__headline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font: 700 1.0625rem/1.3 var(--er-font-headline);
  color: var(--er-ink);
}

.er-mail__more { margin: 0; padding-block-start: var(--er-space-3); border-block-start: 1px solid var(--er-paper-edge); font: 400 var(--er-text-eyebrow)/1.4 var(--er-font-mono); color: var(--er-ink-muted); }

/* Desvanecido: insinúa que hay más sin scroll interno ni JS */
.er-mail__fade {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 2.6rem;
  block-size: 5rem;
  background: linear-gradient(to bottom, rgba(244,239,230,0), var(--er-paper));
  pointer-events: none;
}

.er-newsletter__preview-cap { margin-block-start: var(--er-space-3); text-align: center; font: 400 var(--er-text-eyebrow)/1.4 var(--er-font-mono); color: var(--nl-fg-dim); }

/* ── Layout por ancho de contenedor ─────────────────────────────────────── */
@container regencia (max-width: 39.99rem) {
  .er-newsletter--full .er-newsletter__row { flex-direction: column; }
  .er-newsletter--full .er-newsletter__form input[type="email"] { min-block-size: 3rem; }
  .er-newsletter--full .er-newsletter__submit { inline-size: 100%; min-block-size: 3rem; }
  .er-newsletter--full .er-mail { max-block-size: 17rem; }
  .er-newsletter--full .er-mail__fade { inset-block-end: 0; block-size: 6rem; }
}
.er-newsletter--compact .er-newsletter__row { flex-direction: column; }
.er-newsletter--compact .er-newsletter__form input[type="email"] { min-block-size: 3rem; }
.er-newsletter--compact .er-newsletter__submit { inline-size: 100%; min-block-size: 3rem; }

/* Apilado (compact siempre; full en contenedor estrecho): el correo es una caja igual a la del nombre
   y el botón una pieza propia a todo el ancho, misma altura y radio. Antes el botón quedaba metido
   dentro del marco del correo. */
.er-newsletter--compact .er-newsletter__row {
  gap: var(--er-space-3);
  min-block-size: 0;
  padding: 0;
  border: 0;
  background: none;
}
.er-newsletter--compact .er-newsletter__row:focus-within { box-shadow: none; }
.er-newsletter--compact .er-newsletter__form input[type="email"] {
  padding: 0 var(--er-space-4);
  border: 1px solid var(--nl-line);
  border-radius: var(--er-radius-lg);
  background-color: var(--nl-field-bg);
  transition: border-color var(--er-dur-2) var(--er-ease-out), box-shadow var(--er-dur-2) var(--er-ease-out);
}
.er-newsletter--compact .er-newsletter__form input[type="email"]:focus { border-color: var(--nl-fg); box-shadow: 0 0 0 4px rgba(229,57,32,0.45); }
.er-newsletter--compact .er-newsletter__form input[type="email"][aria-invalid="true"] { border-color: var(--er-color-brand-action); }
.er-newsletter--compact .er-newsletter__submit { border-radius: var(--er-radius-lg); }
@container regencia (max-width: 39.99rem) {
  .er-newsletter--full .er-newsletter__row { gap: var(--er-space-3); min-block-size: 0; padding: 0; border: 0; background: none; }
  .er-newsletter--full .er-newsletter__row:focus-within { box-shadow: none; }
  .er-newsletter--full .er-newsletter__form input[type="email"] {
    padding: 0 var(--er-space-4);
    border: 1px solid var(--nl-line);
    border-radius: var(--er-radius-lg);
    background-color: var(--nl-field-bg);
  }
  .er-newsletter--full .er-newsletter__form input[type="email"]:focus { border-color: var(--nl-fg); box-shadow: 0 0 0 4px rgba(229,57,32,0.45); }
  .er-newsletter--full .er-newsletter__submit { border-radius: var(--er-radius-lg); }
}

@container regencia (min-width: 56rem) {
  .er-newsletter--full .er-newsletter__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: var(--er-space-12); }
}
@media (prefers-reduced-motion: no-preference) {
  @container regencia (min-width: 56rem) {
    .er-newsletter--full .er-mail { transform: rotate(-1.5deg); transition: transform var(--er-dur-4) var(--er-ease-out); }
    .er-newsletter--full:hover .er-mail,
    .er-newsletter--full:focus-within .er-mail { transform: rotate(-0.5deg) translateY(-4px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .er-newsletter__form[data-state="loading"] .er-newsletter__spinner { animation: none; }
}
@media (forced-colors: active) {
  .er-newsletter__row:focus-within { outline: 2px solid Highlight; }
}
/* ══ E2-FE · LA REGENCIA: fin de región ═════════════════════════════════════ */

/* ── Primary Button ──────────────────────────────────────────────────────── */
.er-btn-primary,
.er-btn-primary[type="submit"] { /* [type=submit]: Blocksy pisaba el fondo con su color de botón (4.25:1) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-2);
  background-color: var(--er-color-brand-action);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-sm);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wide);
  padding: 14px 32px;
  border-radius: var(--er-radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--er-transition-fast),
    transform var(--er-transition-fast),
    box-shadow var(--er-transition-fast);
  white-space: nowrap;
}

.er-btn-primary:hover {
  background-color: var(--er-color-brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--er-shadow-brand);
  color: #ffffff;
  text-decoration: none;
}

.er-btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.er-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-2);
  background-color: transparent;
  color: var(--er-text-primary);
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-sm);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wide);
  padding: 13px 31px;
  border-radius: var(--er-radius-md);
  border: 1px solid var(--er-border-color);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--er-transition-fast), background-color var(--er-transition-fast);
  white-space: nowrap;
}

.er-btn-secondary:hover {
  border-color: var(--er-text-primary);
  background-color: var(--er-bg-secondary);
  color: var(--er-text-primary);
  text-decoration: none;
}

/* Force white on explicitly dark backgrounds */
.er-widget--newsletter .er-btn-secondary,
.er-newsletter-cta .er-btn-secondary,
[style*="background:#111"] .er-btn-secondary,
.er-section-archive__banner .er-btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}
.er-widget--newsletter .er-btn-secondary:hover,
.er-newsletter-cta .er-btn-secondary:hover {
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ── PAYWALL OVERLAY ─────────────────────────────────────────────────────── */
.er-article-wrapper {
  position: relative;
}

.er-paywall {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--er-z-paywall);
}

.er-paywall::before {
  content: '';
  display: block;
  height: 120px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--er-bg-primary) 100%
  );
}

.er-paywall__content {
  background-color: var(--er-bg-primary);
  border-top: 3px solid var(--er-color-brand);
  padding: var(--er-space-12) var(--er-space-8);
  text-align: center;
}

.er-paywall__icon {
  font-size: 48px;
  line-height: 1;
  color: var(--er-color-brand);
  margin-bottom: var(--er-space-4);
  display: block;
}

.er-paywall__eyebrow {
  display: inline-block;
  background-color: var(--er-color-brand);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: var(--er-font-bold);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-widest);
  padding: 4px 12px;
  border-radius: var(--er-radius-pill);
  margin-bottom: var(--er-space-4);
}

.er-paywall__title {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-2xl);
  color: var(--er-text-primary);
  margin-bottom: var(--er-space-2);
}

.er-paywall__subtitle {
  font-family: var(--er-font-body);
  font-size: var(--er-text-base);
  color: var(--er-text-muted);
  margin-bottom: var(--er-space-8);
}

.er-paywall__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-3);
  flex-wrap: wrap;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.er-footer {
  background-color: #1A1A1A; /* always dark */
  padding-top: var(--er-space-16);
  padding-bottom: var(--er-space-8);
  border-top: 1px solid #2A2A2A;
}

.er-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--er-space-12);
  margin-bottom: var(--er-space-12);
}

.er-footer__logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
  margin-bottom: var(--er-space-4);
}

.er-footer__logo img {
  max-height: 32px;
  width: auto;
}

/* Text fallback — matches .er-header__logo-* exactly (same brand mark, header vs footer) */
.er-footer__logo-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.er-footer__logo-name {
  font-family: var(--er-font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
  transition: color var(--er-transition-fast);
}

.er-footer__logo:hover .er-footer__logo-name {
  color: var(--er-color-brand);
}

.er-footer__logo-spade {
  color: var(--er-color-brand);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform var(--er-transition-fast);
}

.er-footer__logo:hover .er-footer__logo-spade {
  transform: scale(1.2);
}

.er-footer__slogan {
  font-family: var(--er-font-body);
  font-style: italic;
  font-size: var(--er-text-sm);
  color: #9A9A9A;
  margin-bottom: var(--er-space-6);
  line-height: var(--er-leading-relaxed);
}

.er-footer__social {
  display: flex;
  gap: var(--er-space-3);
}

.er-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #2A2A2A;
  color: #9A9A9A;
  text-decoration: none;
  font-size: 16px;
  transition:
    background-color var(--er-transition-fast),
    color var(--er-transition-fast);
}

.er-footer__social a:hover {
  background-color: var(--er-color-brand);
  color: #ffffff;
  text-decoration: none;
}

.er-footer__nav-title {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-bold);
  font-size: var(--er-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-widest);
  color: #9A9A9A;
  margin-bottom: var(--er-space-4);
}

.er-footer__nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--er-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.er-footer__nav-list a {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  color: #CCCCCC;
  text-decoration: none;
  transition: color var(--er-transition-fast);
  line-height: var(--er-leading-normal);
}

.er-footer__nav-list a:hover {
  color: #ffffff;
  text-decoration: none;
}

.er-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--er-space-6);
}

.er-footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--er-space-4);
  flex-wrap: wrap;
}

.er-footer__copy {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: #9A9A9A;
}

.er-footer__made-with {
  display: flex;
  align-items: center;
  gap: var(--er-space-4);
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: #9A9A9A;
}

.er-footer__made-with a {
  color: #9A9A9A;
  text-decoration: none;
  transition: color var(--er-transition-fast);
}

.er-footer__made-with a:hover {
  color: #ffffff;
}

@media (max-width: 1024px) {
  .er-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--er-space-8);
  }
}

@media (max-width: 640px) {
  .er-footer__grid {
    grid-template-columns: 1fr;
  }

  .er-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── PODCAST PLAYER (persistent bottom bar) ──────────────────────────────── */
.er-podcast-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--er-player-height);
  background-color: #1A1A1A;
  border-top: 1px solid #2A2A2A;
  z-index: var(--er-z-podcast-player);
  display: none; /* shown via JS when active */
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.er-podcast-player.is-active {
  display: flex;
}

.er-podcast-player__inner {
  display: flex;
  align-items: center;
  gap: var(--er-space-4);
  width: 100%;
  max-width: var(--er-container-max);
  margin-inline: auto;
  padding-inline: var(--er-space-6);
  height: 100%;
}

.er-podcast-player__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--er-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.er-podcast-player__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 0 200px;
}

.er-podcast-player__title {
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-semibold);
  font-size: var(--er-text-sm);
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.er-podcast-player__show {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: #9A9A9A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.er-podcast-player__controls {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  flex-shrink: 0;
}

.er-podcast-player__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9A9A9A;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: color var(--er-transition-fast);
}

.er-podcast-player__btn:hover {
  color: #ffffff;
}

.er-podcast-player__btn--play {
  background-color: var(--er-color-brand);
  color: #ffffff;
  width: 40px;
  height: 40px;
  font-size: 20px;
  transition: background-color var(--er-transition-fast);
}

.er-podcast-player__btn--play:hover {
  background-color: var(--er-color-brand-hover);
  color: #ffffff;
}

.er-podcast-player__progress {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  flex: 1;
  min-width: 0;
}

.er-podcast-player__time {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: #9A9A9A;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.er-podcast-player__bar {
  flex: 1;
  height: 4px;
  background-color: #2A2A2A;
  border-radius: var(--er-radius-pill);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.er-podcast-player__fill {
  height: 100%;
  background-color: var(--er-color-brand);
  border-radius: var(--er-radius-pill);
  transition: width 0.5s linear;
  pointer-events: none;
}

@media (max-width: 768px) {
  .er-podcast-player__info {
    flex: 1;
    min-width: 0;
  }

  .er-podcast-player__progress {
    display: none;
  }
}

/* ── ARTICLE BODY ────────────────────────────────────────────────────────── */
.er-article-body {
  max-width: var(--er-article-max);
  margin-inline: auto;
}

.er-article-body p {
  font-family: var(--er-font-body);
  font-size: var(--er-text-lg);
  line-height: var(--er-leading-loose);
  color: var(--er-text-primary);
}

.er-article-body p + p {
  margin-top: var(--er-space-5);
}

.er-article-body .er-lead {
  font-size: var(--er-text-xl);
  font-weight: var(--er-font-medium);
  color: var(--er-text-secondary);
  line-height: var(--er-leading-relaxed);
  margin-bottom: var(--er-space-8);
}

.er-article-body h2 {
  font-size: var(--er-text-2xl);
  font-weight: var(--er-font-bold);
  margin-top: var(--er-space-12);
  margin-bottom: var(--er-space-4);
  color: var(--er-text-primary);
}

.er-article-body h3 {
  font-size: var(--er-text-xl);
  font-weight: var(--er-font-semibold);
  margin-top: var(--er-space-8);
  margin-bottom: var(--er-space-3);
}

.er-article-body blockquote {
  border-left: 4px solid var(--er-color-brand);
  padding-left: var(--er-space-6);
  margin: var(--er-space-8) 0;
  font-size: var(--er-text-xl);
  font-style: italic;
  color: var(--er-text-secondary);
  line-height: var(--er-leading-relaxed);
}

.er-article-body blockquote cite {
  display: block;
  margin-top: var(--er-space-3);
  font-size: var(--er-text-sm);
  font-style: normal;
  font-family: var(--er-font-headline);
  font-weight: var(--er-font-semibold);
  color: var(--er-text-muted);
}

.er-article-body figure {
  margin: var(--er-space-8) 0;
}

.er-article-body figcaption {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  margin-top: var(--er-space-2);
  font-style: italic;
  line-height: var(--er-leading-normal);
}

.er-article-body ul,
.er-article-body ol {
  padding-left: var(--er-space-6);
  margin: var(--er-space-5) 0;
  list-style: revert;
}

.er-article-body li {
  font-family: var(--er-font-body);
  font-size: var(--er-text-lg);
  line-height: var(--er-leading-relaxed);
  margin-bottom: var(--er-space-2);
}

.er-article-body a {
  color: var(--er-color-brand-action); /* #E53920 daba 4.06:1 en texto de cuerpo */
  text-decoration: underline;
  text-underline-offset: 3px;
}

.er-article-body strong {
  font-weight: var(--er-font-bold);
  color: var(--er-text-primary);
}

/* ── STATIC PAGE (Quiénes somos, Ética editorial, Contacto, etc.) ─────────── */
.er-page-static__banner {
  background-color: #1A1A1A;
  border-bottom: 3px solid var(--er-color-brand);
  padding: var(--er-space-10) 0;
}

.er-page-static__title {
  font-family: var(--er-font-headline);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: var(--er-font-extrabold);
  color: #ffffff;
  line-height: var(--er-leading-tight);
  margin: 0;
}

.er-page-static__content {
  padding-top: var(--er-space-10);
  padding-bottom: var(--er-space-16);
}

.er-page-static__pagination {
  margin-top: var(--er-space-8);
  display: flex;
  gap: var(--er-space-2);
}

.er-page-static__comments {
  margin-top: var(--er-space-12);
  border-top: 1px solid var(--er-border-color);
  padding-top: var(--er-space-10);
}


/* ── "EL AZAR DE LA NOTICIA" Card ────────────────────────────────────────── */
/* ── El Azar de la Noticia ─────────────────────────────────────────────────── */

.er-azar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--er-space-8);
  text-align: center;
}

.er-azar__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--er-space-3);
}

.er-azar__icon {
  font-size: 2.5rem;
  color: var(--er-color-brand);
  line-height: 1;
}

.er-azar__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-3xl);
  font-weight: 900;
  color: var(--er-text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

.er-azar__subtitle {
  font-family: var(--er-font-body);
  font-size: var(--er-text-base);
  color: var(--er-text-muted);
  font-style: italic;
  margin: 0;
}

/* ── Card container ────────────────────────────────────────────── */
.er-azar-card {
  width: 280px;
  border-radius: var(--er-radius-xl);
  overflow: hidden;
  border: 2px solid var(--er-color-brand);
  box-shadow: 0 8px 32px rgba(229, 57, 32, 0.15);
  transition: box-shadow var(--er-transition-base), transform var(--er-transition-base);
}

.er-azar-card.is-flipping {
  animation: er-card-flip 0.6s ease forwards;
}

/* ── Card back (dormant state) ─────────────────────────────────── */
.er-azar-card__back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-4);
  min-height: 340px;
  background: #111111;
  padding: var(--er-space-8);
}

.er-azar-card__back-spade {
  display: block;
  font-size: 4.5rem;
  color: var(--er-color-brand);
  line-height: 1;
}

.er-azar-card__back-name {
  display: block;
  font-family: var(--er-font-headline);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Card front (revealed by JS) ───────────────────────────────── */
.er-azar-card__front {
  text-align: left;
  background: var(--er-bg-secondary);
}

.er-azar-card__front .er-card__image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.er-azar-card__front .er-card__body {
  padding: var(--er-space-4);
}

.er-azar-card__front .er-card__title {
  font-size: var(--er-text-base);
  line-height: var(--er-leading-snug);
  margin: var(--er-space-2) 0 0;
}

.er-azar-card__front .er-card__title a {
  color: var(--er-text-primary);
  text-decoration: none;
}

.er-azar-card__front .er-card__title a:hover {
  color: var(--er-color-brand);
}

/* ── Sacar carta button ─────────────────────────────────────────── */
.er-azar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--er-space-2);
  background: var(--er-color-brand-action);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 28px;
  border-radius: var(--er-radius-pill);
  border: none;
  cursor: pointer;
  transition: background var(--er-transition-fast), box-shadow var(--er-transition-fast), transform var(--er-transition-fast);
}

.er-azar-btn:hover {
  background: var(--er-color-brand-hover);
  box-shadow: 0 4px 16px rgba(229, 57, 32, 0.4);
  transform: translateY(-1px);
}

.er-azar-btn:active {
  transform: translateY(0);
}

@keyframes er-card-flip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ── SECTION HEADERS (único sistema: "editorial stamp" más abajo) ─────────── */
.er-section-header__link {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: var(--er-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--er-tracking-wide);
  color: var(--er-color-brand-hover);
  text-decoration: none;
}

.er-section-header__link:hover {
  text-decoration: underline;
}

/* ── Series Navigation ────────────────────────────────────────────────────── */
.er-series-nav {
  border: 1px solid var(--er-border-color);
  border-left: 4px solid var(--er-color-brand);
  border-radius: var(--er-radius-md);
  padding: var(--er-space-6);
  margin: var(--er-space-12) 0;
  background: var(--er-bg-secondary);
}
.er-series-nav__header {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  margin-bottom: var(--er-space-4);
}
.er-series-nav__name {
  font: 700 0.875rem 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--er-text-muted);
}
.er-series-nav__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--er-space-4);
}
.er-series-nav__prev,
.er-series-nav__next {
  display: flex;
  flex-direction: column;
  gap: var(--er-space-1);
  padding: var(--er-space-3);
  background: var(--er-bg-elevated);
  border-radius: var(--er-radius-sm);
  transition: background var(--er-transition-fast);
  text-decoration: none;
}
.er-series-nav__prev:hover,
.er-series-nav__next:hover {
  background: rgba(229, 57, 32, 0.08);
}
.er-series-nav__next { text-align: right; }
.er-series-nav__direction {
  font: 500 0.75rem 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--er-color-brand);
}
.er-series-nav__title {
  font: 600 0.875rem/1.3 'Space Grotesk', sans-serif;
  color: var(--er-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 640px) {
  .er-series-nav__links { grid-template-columns: 1fr; }
  .er-series-nav__next { text-align: left; }
}

/* ── Author Box ───────────────────────────────────────────────────────────── */
.er-author-box {
  border-top: 3px solid var(--er-color-brand);
  padding: var(--er-space-8) 0;
  margin-top: var(--er-space-12);
}
.er-author-box__inner {
  display: flex;
  gap: var(--er-space-6);
  align-items: flex-start;
}
.er-author-box__photo-link { flex-shrink: 0; }
.er-author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.er-author-box__avatar-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--er-color-brand);
  color: #fff;
  font: 800 2rem 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.er-author-box__content { flex: 1; min-width: 0; }
.er-author-box__header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.er-author-box__name {
  font: 700 1.1rem 'Space Grotesk', sans-serif;
  color: var(--er-text-primary);
  text-decoration: none;
}
.er-author-box__name:hover { color: var(--er-color-brand); }
.er-author-box__cargo {
  font: 500 0.75rem 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--er-color-brand);
}
.er-author-box__bio {
  font: 400 0.9rem/1.6 'Source Serif 4', serif;
  color: var(--er-text-secondary);
  margin-top: var(--er-space-2);
}
.er-author-box__social {
  display: flex;
  gap: var(--er-space-3);
  margin-top: var(--er-space-3);
  flex-wrap: wrap;
}
.er-author-box__social-link {
  font: 600 0.75rem 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--er-color-brand);
  border: 1px solid var(--er-color-brand);
  padding: 4px 12px;
  border-radius: var(--er-radius-pill);
  text-decoration: none;
  transition: all var(--er-transition-fast);
}
.er-author-box__social-link:hover {
  background: var(--er-color-brand);
  color: #fff;
}
@media (max-width: 480px) {
  .er-author-box__inner { flex-direction: column; }
}

/* ── Front Page Layout ───────────────────────────────────────────────────── */
.er-front__hero {
  padding: var(--er-space-8) 0 0;
}

.er-front__hero--carousel {
  padding-bottom: var(--er-space-10);
}

.er-front__grid {
  padding: 3rem 0 0;
}

.er-front__feed {
  padding: 3rem 0;
}

.er-front__newsletter {
  padding: 3rem 0 4rem;
}

/* ── Hero Slider (front-page.php) ───────────────────────────────────────── */
.er-hero-slider {
  position: relative;
  overflow: hidden;
  padding: 0 0 var(--er-space-10);
}
.er-hero-slider__track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.er-hero-slider__slide {
  flex: 0 0 100%;
  min-width: 0;
}
/* Hero card inside slider: remove border-radius, taller height */
.er-hero-slider .er-card--hero {
  border-radius: 0;
  min-height: clamp(480px, 68vh, 760px);
}
/* Wrap the hero card in the container for proper margin */
.er-hero-slider .er-container {
  height: 100%;
}
.er-hero-slider__slide > .er-card--hero {
  max-width: var(--er-container-max, 1240px);
  margin-inline: auto;
  border-radius: var(--er-radius-xl);
}
.er-hero-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--er-transition-fast), border-color var(--er-transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.er-hero-slider__btn:hover {
  background: var(--er-color-brand-action);
  border-color: var(--er-color-brand-action);
}
.er-hero-slider__btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}
.er-hero-slider__btn--prev { left: var(--er-space-4); }
.er-hero-slider__btn--next { right: var(--er-space-4); }

/* Below ~768px the wrapped title/excerpt grow tall enough from the bottom
   (.er-card--hero uses justify-content:flex-end) to reach the vertical
   center, so the arrows overlap the badge/title there — pin them to the
   top of the image instead, clear of the text block. */
@media (max-width: 768px) {
  .er-hero-slider__btn {
    top: var(--er-space-4);
    transform: none;
    width: 40px;
    height: 40px;
  }
}

.er-hero-slider__dots {
  position: absolute;
  bottom: var(--er-space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--er-space-2);
  z-index: 10;
}
.er-hero-slider__dot {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.er-hero-slider__dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background var(--er-transition-fast), transform var(--er-transition-fast);
}
.er-hero-slider__dot.is-active::before {
  background: #fff;
  transform: scale(1.35);
}

/* ── Editorial Home Layout (front-page.php) ──────────────────────────────── */
.er-home__hero {
  padding: var(--er-space-8) 0;
}

.er-section {
  padding: var(--er-space-16) 0;
}

.er-section--dark {
  background-color: #111111;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.er-section--dark .er-section-header__title {
  color: #FFFFFF;
}

.er-section--dark .er-section-header__link {
  color: rgba(255, 255, 255, 0.6);
}

.er-section--dark .er-section-header__link:hover {
  color: #FFFFFF;
}

.er-section--light {
  background-color: var(--er-bg-secondary);
}

.er-section__watermark {
  position: absolute;
  right: -0.1em;
  bottom: -0.15em;
  font-size: clamp(8rem, 15vw, 14rem);
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  font-family: var(--er-font-headline);
}

/* ── Front page news feed (vertical list) ──────────────────────────────────── */
.er-front-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.er-front-feed__item {
  display: flex;
  gap: var(--er-space-5);
  align-items: flex-start;
  padding: var(--er-space-5) 0;
  border-bottom: 1px solid var(--er-border-color);
}

.er-front-feed__item:first-child {
  border-top: 1px solid var(--er-border-color);
}

.er-front-feed__thumb-link {
  flex-shrink: 0;
  display: block;
  width: 120px;
}

.er-front-feed__thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--er-radius-sm);
  display: block;
}

.er-front-feed__body {
  flex: 1;
  min-width: 0;
}

.er-front-feed__section {
  display: inline-block;
  margin-bottom: var(--er-space-1);
  font-size: var(--er-text-xs);
}

.er-front-feed__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-lg);
  font-weight: 700;
  line-height: var(--er-leading-tight);
  margin: 0 0 var(--er-space-2);
  color: var(--er-text-primary);
}

.er-front-feed__link {
  color: inherit;
  text-decoration: none;
}

.er-front-feed__link:hover {
  color: var(--er-color-brand);
}

.er-front-feed__excerpt {
  font-family: var(--er-font-body);
  font-size: var(--er-text-sm);
  color: var(--er-text-secondary);
  line-height: var(--er-leading-relaxed);
  margin: 0 0 var(--er-space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.er-front-feed__meta {
  font-family: var(--er-font-body);
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--er-space-2);
}

.er-front-feed__more {
  display: flex;
  justify-content: center;
  padding: var(--er-space-8) 0 var(--er-space-4);
}

@media (max-width: 640px) {
  .er-front-feed__thumb-link,
  .er-front-feed__thumb {
    width: 88px;
    height: 60px;
  }

  .er-front-feed__title {
    font-size: var(--er-text-base);
  }

  .er-front-feed__excerpt {
    display: none;
  }
}

/* ── Latest news carousel (front page) ────────────────────────────────────── */
.er-carousel__nav {
  display: flex;
  gap: var(--er-space-2);
  flex-shrink: 0;
}

.er-carousel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--er-border-color);
  background-color: var(--er-bg-primary);
  color: var(--er-text-primary);
  font-size: var(--er-text-lg);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--er-transition-fast),
    border-color var(--er-transition-fast),
    color var(--er-transition-fast);
}

.er-carousel__btn:hover {
  background-color: var(--er-color-brand);
  border-color: var(--er-color-brand);
  color: #ffffff;
}

.er-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.er-carousel {
  position: relative;
  margin-inline: calc(var(--er-space-6) * -1);
}

.er-carousel__track {
  display: flex;
  gap: var(--er-space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--er-space-6);
  padding-inline: var(--er-space-6);
  padding-bottom: var(--er-space-2);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.er-carousel__track::-webkit-scrollbar {
  display: none;
}

.er-carousel__slide {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  .er-carousel__slide {
    flex-basis: 78vw;
  }
}

/* Landing variant — wider slides, this carousel IS the hero */
.er-carousel__slide--landing {
  flex-basis: 420px;
}

.er-carousel__slide--landing .er-card--standard .er-card__image-wrap {
  aspect-ratio: 16 / 10;
}

@media (max-width: 640px) {
  .er-carousel__slide--landing {
    flex-basis: 88vw;
  }
}

/* ── Section header — editorial stamp style ──────────────────────────────── */
.er-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--er-border-color);
  position: relative;
}

.er-section-header::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--er-color-brand);
}

.er-section-header__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--er-color-brand-action); /* 12px: brand daba 4.06–4.25:1; action 4.77–4.99:1 */
  white-space: nowrap;
}

.er-section-header__rule {
  display: block;
  flex: 1;
  height: 2px;
  background: var(--er-color-brand);
}

/* (hero card CSS is defined above at .er-card--hero) */

/* ── Standard card — image placeholder when no thumbnail ────────────────── */
.er-card--standard .er-card__image-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #F0EFED 0%, #E6E4E0 100%);
}

.er-card--standard .er-card__image-wrap::before {
  content: "♠";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(229,57,32,.10);
}

/* Section-tinted placeholders */
.er-card--standard:has(.er-badge) .er-card__image-wrap {
  background: linear-gradient(135deg, #F7F3F0 0%, #EDE6E0 100%);
}

/* Standard card */
.er-card--standard {
  background: var(--er-bg-secondary, #FFFFFF);
  border-radius: var(--er-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 0 0 1px var(--er-border-color);
}

.er-card--standard:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(0,0,0,.12), 0 0 0 1px rgba(229,57,32,.25);
}

.er-card--standard .er-card__image-link {
  display: block;
  overflow: hidden;
}

.er-card--standard .er-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.42s ease;
}

.er-card--standard:hover .er-card__image {
  transform: scale(1.06);
}

.er-card--standard .er-card__body {
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.er-card__body {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Badge stays compact — only the badge, not the title/excerpt */
.er-card__body .er-badge {
  align-self: flex-start;
}

.er-card__title {
  font-size: var(--er-text-lg);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.er-card__title a {
  color: var(--er-text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.er-card__title a:hover {
  color: var(--er-color-brand);
}

.er-card__excerpt {
  font-size: var(--er-text-sm);
  color: var(--er-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.er-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--er-text-xs);
  color: var(--er-text-muted, #888);
  flex-wrap: wrap;
  margin-top: auto;
}

.er-card__meta-sep {
  opacity: .35;
}

.er-byline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--er-text-secondary);
  text-decoration: none;
}

.er-byline__avatar {
  border-radius: 50%;
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.er-byline__name {
  font-weight: 500;
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.er-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  background: var(--er-color-brand-action);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
  text-decoration: none;
  line-height: 1.5;
}

.er-badge:hover {
  background: var(--er-color-brand-dark, #C0281A);
  color: #fff;
}

/* ── Newsletter CTA inline ───────────────────────────────────────────────── */
.er-front__newsletter {
  background-color: #111111 !important; /* override the white base rule */
  padding: 5rem 0;
}

.er-newsletter-cta {
  background: transparent;
  padding: 0;
  text-align: center;
  position: relative;
}

.er-newsletter-cta__icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--er-color-brand);
}

.er-newsletter-cta__title {
  font-size: var(--er-text-2xl);
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
}

.er-newsletter-cta__sub {
  color: var(--er-text-secondary);
  margin-bottom: 1.5rem;
  font-size: var(--er-text-base);
}

.er-newsletter-cta__form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.er-newsletter-cta__input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #111;
  border: 1px solid #333;
  border-radius: var(--er-radius-md);
  color: #fff;
  font-size: var(--er-text-base);
  font-family: var(--er-font-body);
  outline: none;
  transition: border-color 0.2s;
}

.er-newsletter-cta__input:focus {
  border-color: var(--er-color-brand);
}

.er-newsletter-cta__btn {
  padding: 0.75rem 1.5rem;
  background: var(--er-color-brand);
  color: #fff;
  border: none;
  border-radius: var(--er-radius-md);
  font-family: var(--er-font-body);
  font-size: var(--er-text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.er-newsletter-cta__btn:hover {
  background: var(--er-color-brand-dark, #C0281A);
}

.er-newsletter-cta__privacy {
  margin-top: 0.75rem;
  font-size: var(--er-text-xs);
  color: var(--er-text-muted, #666);
}

@media (max-width: 480px) {
  .er-newsletter-cta__form { flex-direction: column; }
  .er-newsletter-cta { padding: 2rem 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE POST — Layout, Header, Byline, Body, Sidebar
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reading progress bar ─────────────────────────────────────────────────── */
.er-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--er-color-brand);
  z-index: calc(var(--er-z-header) + 10);
  transition: width 100ms linear;
  pointer-events: none;
}

/* ── Single wrapper ───────────────────────────────────────────────────────── */
.er-single {
  padding-top: var(--er-space-10);
  padding-bottom: var(--er-space-20);
  background-color: var(--er-bg-primary);
  min-height: 60vh;
}

/* ── Two-column grid ──────────────────────────────────────────────────────── */
.er-single__layout {
  display: grid;
  grid-template-columns: 1fr var(--er-sidebar-width);
  gap: var(--er-space-16);
  align-items: start;
}

@media (max-width: 1024px) {
  .er-single__layout {
    grid-template-columns: 1fr 260px;
    gap: var(--er-space-10);
  }
}

@media (max-width: 768px) {
  .er-single__layout {
    grid-template-columns: 1fr;
    gap: var(--er-space-12);
  }
}

/* ── Article column ───────────────────────────────────────────────────────── */
.er-single__article {
  min-width: 0; /* prevent grid blowout */
}

/* ── Meta top (section badge + breaking) ─────────────────────────────────── */
.er-single__meta-top {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  margin-bottom: var(--er-space-5);
}

/* ── Article header ───────────────────────────────────────────────────────── */
.er-single__header {
  margin-bottom: 0;
}

.er-single__title {
  font-family: var(--er-font-headline);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: var(--er-font-extrabold);
  line-height: var(--er-leading-tight);
  letter-spacing: var(--er-tracking-tight);
  color: var(--er-text-primary);
  margin: 0 0 var(--er-space-5);
}

.er-single__subtitle {
  font-family: var(--er-font-body);
  font-size: var(--er-text-xl);
  font-weight: var(--er-font-normal);
  color: var(--er-text-secondary);
  line-height: var(--er-leading-relaxed);
  margin: 0 0 var(--er-space-6);
  border-left: 3px solid var(--er-color-brand);
  padding-left: var(--er-space-5);
}

/* ── Byline — article version (larger than card byline) ──────────────────── */
.er-single__byline.er-byline {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  padding: var(--er-space-4) 0;
  border-top: 1px solid var(--er-border-color);
  border-bottom: 1px solid var(--er-border-color);
  margin-bottom: 0;
}

.er-single__byline .er-byline__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--er-border-color);
}

.er-single__byline .er-byline__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.er-single__byline .er-byline__name {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: var(--er-font-semibold);
  color: var(--er-text-primary);
  text-decoration: none;
  transition: color var(--er-transition-fast);
}

.er-single__byline .er-byline__name:hover {
  color: var(--er-color-brand);
}

.er-single__byline .er-byline__date {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  letter-spacing: 0.02em;
}

/* ── Featured image ───────────────────────────────────────────────────────── */
.er-single__featured-image {
  margin: var(--er-space-8) 0 0;
  border-radius: var(--er-radius-lg);
  overflow: hidden;
}

.er-single__image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 560px;
}

.er-single__caption {
  font-family: var(--er-font-mono);
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  margin-top: var(--er-space-2);
  padding: var(--er-space-2) var(--er-space-3);
  background: var(--er-bg-elevated);
  border-radius: 0 0 var(--er-radius-md) var(--er-radius-md);
  font-style: italic;
  line-height: 1.5;
}

/* ── Tags footer ──────────────────────────────────────────────────────────── */
.er-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-space-2);
  padding-top: var(--er-space-8);
  border-top: 1px solid var(--er-border-color);
}

.er-badge--outline {
  background: transparent;
  color: var(--er-text-secondary);
  border: 1px solid var(--er-border-color);
}

.er-badge--outline:hover {
  background: var(--er-bg-elevated);
  color: var(--er-text-primary);
  border-color: var(--er-border-strong);
}

/* ── Author box — single.php structure ───────────────────────────────────── */
.er-author-box {
  display: flex;
  align-items: flex-start;
  gap: var(--er-space-5);
  padding: var(--er-space-8);
  border-top: 3px solid var(--er-color-brand);
  background: var(--er-bg-secondary);
  border-radius: var(--er-radius-lg);
}

.er-author-box__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--er-border-color);
}

.er-author-box__info {
  flex: 1;
  min-width: 0;
}

.er-author-box__name {
  display: block;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-base);
  font-weight: var(--er-font-bold);
  color: var(--er-text-primary);
  text-decoration: none;
  margin-bottom: var(--er-space-2);
}

.er-author-box__name:hover {
  color: var(--er-color-brand);
}

.er-author-box__bio {
  font-family: var(--er-font-body);
  font-size: var(--er-text-sm);
  color: var(--er-text-secondary);
  line-height: var(--er-leading-relaxed);
  margin: 0;
}

@media (max-width: 480px) {
  .er-author-box {
    flex-direction: column;
  }
}

/* ── Related articles section ─────────────────────────────────────────────── */
.er-related {
  padding-top: var(--er-space-12);
  border-top: 1px solid var(--er-border-color);
}

.er-related__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: var(--er-font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--er-color-brand-action);
  margin-bottom: var(--er-space-6);
  padding-bottom: var(--er-space-3);
  border-bottom: 2px solid var(--er-border-color);
  position: relative;
}

.er-related__title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--er-color-brand);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.er-single__sidebar {
  position: sticky;
  top: calc(var(--er-header-height) + var(--er-space-6));
}

@media (max-width: 768px) {
  .er-single__sidebar {
    position: static;
  }
}

/* ── Sidebar widgets ──────────────────────────────────────────────────────── */
.er-widget {
  background: var(--er-bg-secondary);
  border: 1px solid var(--er-border-color);
  border-radius: var(--er-radius-lg);
  padding: var(--er-space-6);
  margin-bottom: var(--er-space-6);
}

.er-widget + .er-widget {
  margin-top: 0;
}

.er-widget__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: var(--er-font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--er-color-brand);
  margin-bottom: var(--er-space-4);
  padding-bottom: var(--er-space-3);
  border-bottom: 2px solid var(--er-border-color);
  position: relative;
}

.er-widget__title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--er-color-brand);
}

.er-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: trending;
}

.er-widget__item {
  counter-increment: trending;
  padding: var(--er-space-3) 0;
  border-bottom: 1px solid var(--er-border-color);
  position: relative;
  padding-left: var(--er-space-8);
  display: flex;
  align-items: flex-start;
}

.er-widget__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.er-widget__item::before {
  content: counter(trending, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: var(--er-space-3);
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  font-weight: var(--er-font-extrabold);
  color: var(--er-color-brand);
  opacity: 0.7;
  line-height: 1.6;
}

.er-widget__item a {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: var(--er-font-semibold);
  color: var(--er-text-primary);
  text-decoration: none;
  line-height: var(--er-leading-snug);
  transition: color var(--er-transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.er-widget__item a:hover {
  color: var(--er-color-brand);
}

/* Newsletter widget in sidebar — compact dark card */
.er-widget--newsletter {
  background: #111111;
  border-color: #222222;
  color: #fff;
  padding: 0;
  overflow: hidden;
}

.er-widget--newsletter .er-newsletter {
  background-color: transparent;
  padding: var(--er-space-6);
}

.er-widget--newsletter .er-newsletter__icon {
  font-size: var(--er-text-lg);
  margin-bottom: var(--er-space-2);
}

.er-widget--newsletter .er-newsletter__title {
  font-size: var(--er-text-lg);
  margin-bottom: var(--er-space-2);
}

.er-widget--newsletter .er-newsletter__title-sub {
  font-size: var(--er-text-sm);
}

.er-widget--newsletter .er-newsletter__subtitle {
  font-size: var(--er-text-sm);
  color: #aaa;
  margin-bottom: var(--er-space-4);
}

.er-widget--newsletter .er-newsletter__input-wrap {
  flex-direction: column;
}

.er-widget--newsletter .er-newsletter__form input[type="email"] {
  min-width: 0;
  width: 100%;
}

.er-widget--newsletter .er-btn-primary {
  width: 100%;
}

/* ── Page multi-page links ────────────────────────────────────────────────── */
.er-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-space-2);
  align-items: center;
  padding: var(--er-space-6) 0;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  color: var(--er-text-muted);
}

.er-page-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--er-border-color);
  border-radius: var(--er-radius-sm);
  font-weight: var(--er-font-semibold);
  color: var(--er-text-secondary);
  text-decoration: none;
  transition: all var(--er-transition-fast);
}

.er-page-links a:hover {
  background: var(--er-color-brand);
  border-color: var(--er-color-brand);
  color: #fff;
}

/* ── Premium badge ────────────────────────────────────────────────────────── */
.u-premium-badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  background: linear-gradient(135deg, #B8860B, #FFD700);
  color: #111;
  font-family: var(--er-font-headline);
  font-size: 0.6rem;
  font-weight: var(--er-font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: var(--er-radius-sm);
  vertical-align: middle;
}

/* ── Breaking news dot ────────────────────────────────────────────────────── */
.u-breaking-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  animation: er-pulse 1.2s ease-in-out infinite;
}

@keyframes er-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.er-badge--breaking {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  animation: none;
}

/* ── Paywall overlay ──────────────────────────────────────────────────────── */
.er-paywall {
  position: relative;
  margin-top: var(--er-space-8);
  padding: var(--er-space-12) var(--er-space-8);
  background: var(--er-bg-secondary);
  border: 1px solid var(--er-border-color);
  border-radius: var(--er-radius-xl);
  text-align: center;
  z-index: var(--er-z-paywall);
}

.er-paywall[hidden] {
  display: none !important;
}

.er-article-body.is-blurred {
  position: relative;
  max-height: 400px;
  overflow: hidden;
}

.er-article-body.is-blurred::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--er-bg-primary));
  pointer-events: none;
}

.has-paywall {
  overflow: hidden;
  max-height: 100vh;
}

/* ── Dark mode overrides for single ──────────────────────────────────────── */
[data-theme="dark"] .er-single__title,
[data-theme="dark"] .er-single__subtitle {
  color: var(--er-text-primary);
}

[data-theme="dark"] .er-widget {
  background: var(--er-bg-secondary);
  border-color: var(--er-border-color);
}

[data-theme="dark"] .er-author-box {
  background: var(--er-bg-secondary);
  border-color: var(--er-border-color);
}

/* ── Hide default WP block widgets from article sidebar ──────────────────── */
/* WordPress 5.8+ registers all widgets as widget_block; hide them.          */
/* Our custom sidebar content (.er-widget) is injected directly via PHP.     */
.er-single__sidebar .widget_block {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION ARCHIVE — taxonomy-er_seccion.php
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Archive wrapper ──────────────────────────────────────────────────────── */
.er-section-archive {
  background-color: var(--er-bg-primary);
  min-height: 60vh;
}

/* ── Section banner (dark editorial header) ───────────────────────────────── */
.er-section-archive__banner {
  background: #111111;
  border-bottom: 4px solid var(--er-color-brand);
  padding: var(--er-space-10) 0;
}

.er-section-archive__breadcrumb {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: var(--er-font-medium);
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--er-space-4);
}

.er-section-archive__breadcrumb a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color var(--er-transition-fast);
}

.er-section-archive__breadcrumb a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.er-section-archive__breadcrumb span[aria-hidden] {
  margin: 0 var(--er-space-2);
  color: var(--er-color-brand);
}

.er-section-archive__title {
  font-family: var(--er-font-headline);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: var(--er-font-extrabold);
  color: #FFFFFF;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--er-space-3);
}

.er-section-archive__desc {
  font-family: var(--er-font-body);
  font-size: var(--er-text-lg);
  color: rgba(255, 255, 255, 0.6);
  max-width: 560px;
  margin: 0 0 var(--er-space-4);
  line-height: var(--er-leading-relaxed);
}

.er-section-archive__count {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  color: rgba(255, 255, 255, 0.62); /* 0.35 daba 3.19:1 sobre #111; 0.62 ≈ 6.6:1 */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

/* ── Hero card strip ──────────────────────────────────────────────────────── */
.er-section-archive__hero {
  padding: var(--er-space-8) 0 0;
}

/* ── Article grid + sidebar ───────────────────────────────────────────────── */
.er-section-archive__grid-wrap {
  padding: var(--er-space-8) 0 var(--er-space-16);
}

.er-section-archive__layout {
  display: grid;
  grid-template-columns: 1fr var(--er-sidebar-width);
  gap: var(--er-space-10);
  align-items: start;
}

@media (max-width: 1024px) {
  .er-section-archive__layout {
    grid-template-columns: 1fr 260px;
    gap: var(--er-space-8);
  }
}

@media (max-width: 768px) {
  .er-section-archive__layout {
    grid-template-columns: 1fr;
  }
}

.er-section-archive__main {
  min-width: 0;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.er-section-archive__sidebar {
  position: sticky;
  top: calc(var(--er-header-height) + var(--er-space-6));
}

@media (max-width: 768px) {
  .er-section-archive__sidebar {
    position: static;
  }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.er-section-archive__pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-space-2);
  justify-content: center;
  margin-top: var(--er-space-10);
  padding-top: var(--er-space-8);
  border-top: 1px solid var(--er-border-color);
}

.er-section-archive__pagination .page-numbers {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--er-space-3);
  border: 1px solid var(--er-border-color);
  border-radius: var(--er-radius-sm);
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: var(--er-font-semibold);
  color: var(--er-text-secondary);
  text-decoration: none;
  transition: all var(--er-transition-fast);
}

.er-section-archive__pagination .page-numbers:hover,
.er-section-archive__pagination .page-numbers.current {
  background: var(--er-color-brand);
  border-color: var(--er-color-brand);
  color: #fff;
}

.er-section-archive__pagination .page-numbers.dots {
  border-color: transparent;
  pointer-events: none;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.er-section-archive__empty {
  padding: var(--er-space-20) 0;
}

.er-section-archive__empty-inner {
  text-align: center;
  max-width: 400px;
  margin-inline: auto;
}

.er-section-archive__empty-icon {
  display: block;
  font-size: 4rem;
  color: var(--er-color-brand);
  margin-bottom: var(--er-space-4);
}

.er-section-archive__empty h2 {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-2xl);
  font-weight: var(--er-font-bold);
  color: var(--er-text-primary);
  margin-bottom: var(--er-space-3);
}

.er-section-archive__empty p {
  font-family: var(--er-font-body);
  color: var(--er-text-muted);
  font-size: var(--er-text-base);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OFFLINE PAGE — template-offline.php
   ═══════════════════════════════════════════════════════════════════════════ */

/* Force dark on offline page — must beat html body #main-content !important above */
html body.page-template-template-offline-php,
html body.page-template-template-offline-php #main-content,
html body.page-template-template-offline-php .er-offline {
  background-color: #0e0e0e !important;
  color: #ffffff;
}

/* Force reset Blocksy inherited styles */
.er-offline h1,
.er-offline p,
.er-offline em {
  background-color: transparent !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
}

.er-offline {
  background-color: #0e0e0e;
  min-height: calc(100vh - var(--er-header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle red top accent bar */
.er-offline::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--er-color-brand);
}

/* Decorative large background character */
.er-offline::after {
  content: '♠';
  position: absolute;
  font-size: 60vw;
  color: #ffffff;
  opacity: 0.015;
  line-height: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.er-offline .er-container {
  position: relative;
  z-index: 1;
}

.er-offline__inner {
  max-width: 580px;
  margin-inline: auto;
  text-align: center;
  padding: var(--er-space-16) 0;
}

.er-offline__badge {
  display: inline-block;
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--er-color-brand);
  border: 1px solid var(--er-color-brand);
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: var(--er-space-8);
}

.er-offline__icon {
  font-size: 4rem;
  color: var(--er-color-brand);
  line-height: 1;
  margin-bottom: var(--er-space-6);
  display: block;
  opacity: 0.7;
}

.er-offline__title {
  font-family: var(--er-font-headline);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 var(--er-space-6);
  background-color: transparent !important;
}

.er-offline__rule {
  width: 48px;
  height: 2px;
  background: var(--er-color-brand);
  margin: 0 auto var(--er-space-6);
  border: none;
}

.er-offline__subtitle {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xl);
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  margin: 0 0 var(--er-space-3);
  background-color: transparent !important;
}

.er-offline__body {
  font-family: var(--er-font-body);
  font-size: var(--er-text-base);
  color: rgba(255,255,255,0.45);
  line-height: var(--er-leading-relaxed);
  margin: 0 0 var(--er-space-10);
  background-color: transparent !important;
}

.er-offline__actions {
  display: flex;
  gap: var(--er-space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--er-space-12);
}

/* Override btn styles for dark offline bg */
.er-offline .er-btn-primary {
  background-color: var(--er-color-brand);
  color: #ffffff;
  border-color: var(--er-color-brand);
}
.er-offline .er-btn-secondary {
  color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.2);
  background-color: transparent;
}
.er-offline .er-btn-secondary:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.6);
  background-color: rgba(255,255,255,0.06);
}

.er-offline__divider {
  font-family: var(--er-font-headline);
  color: var(--er-color-brand);
  font-size: var(--er-text-sm);
  letter-spacing: 0.3em;
  opacity: 0.6;
  margin-bottom: var(--er-space-4);
  background-color: transparent !important;
}

.er-offline__slogan {
  font-family: var(--er-font-body);
  font-size: var(--er-text-sm);
  color: rgba(255,255,255,0.3);
  font-style: italic;
  margin: 0;
  background-color: transparent !important;
}

/* ── Search Panel ────────────────────────────────────────────────────────── */
/* Always dark — drops down from the always-dark header, same brand anchor treatment */
.er-search-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: #111111;
  border-bottom: 3px solid var(--er-color-brand);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: var(--er-space-4) 0;
}
.er-search-panel .er-container {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
}
.er-search-panel__form {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
  border: 1.5px solid #2A2A2A;
  border-radius: var(--er-radius-pill);
  overflow: hidden;
  background: #1A1A1A;
  transition: border-color var(--er-transition-fast);
  padding-left: var(--er-space-4);
}
.er-search-panel__form:focus-within {
  border-color: var(--er-color-brand);
}
.er-search-panel__form > svg {
  flex-shrink: 0;
  margin-right: var(--er-space-3);
  color: #9A9A9A;
}
/* !important: Blocksy's input:is([type=search],...) selector outspecifies a single
   class here and forces the light-theme text color back on, making typed text invisible */
.er-search-panel__input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--er-space-3) var(--er-space-3);
  font: 400 var(--er-text-base) / 1 var(--er-font-body);
  color: #ffffff !important;
  outline: none;
  min-width: 0;
}
.er-search-panel__input::placeholder {
  color: #9A9A9A;
  opacity: 1;
}
.er-search-panel__submit {
  flex-shrink: 0;
  background: var(--er-color-brand);
  border: none;
  color: #fff;
  padding: var(--er-space-3) var(--er-space-5);
  font: 700 0.75rem/1 var(--er-font-headline);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background var(--er-transition-fast);
  height: 100%;
}
.er-search-panel__submit:hover {
  background: #c22e18;
}
.er-search-panel__close {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid #2A2A2A;
  color: #9A9A9A;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--er-transition-fast), color var(--er-transition-fast);
}
.er-search-panel__close:hover {
  border-color: var(--er-color-brand);
  color: var(--er-color-brand);
}

@media (max-width: 640px) {
  .er-search-panel .er-container {
    gap: var(--er-space-2);
  }
  .er-search-panel__form {
    padding-left: var(--er-space-3);
  }
  .er-search-panel__form > svg {
    margin-right: var(--er-space-2);
  }
  .er-search-panel__submit {
    padding: 0 var(--er-space-3);
    font-size: 0.7rem;
  }
  .er-search-panel__close {
    width: 32px;
    height: 32px;
  }
}

/* ── Header search toggle — lupa redonda ─────────────────────────────────── */
.er-header__search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition:
    background var(--er-transition-fast),
    border-color var(--er-transition-fast),
    color var(--er-transition-fast);
  flex-shrink: 0;
}
.er-header__search-toggle:hover,
.er-header__search-toggle[aria-expanded="true"] {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.er-header__search-label {
  display: none;
}

/* ── Subscribe button — rojo de la línea gráfica ─────────────────────────── */
.er-header__subscribe {
  display: inline-flex;
  align-items: center;
  background: var(--er-color-brand-action);
  border: 1.5px solid var(--er-color-brand-action);
  color: #ffffff;
  font: 700 0.75rem/1 var(--er-font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  border-radius: var(--er-radius-pill);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--er-transition-fast),
    border-color var(--er-transition-fast),
    color var(--er-transition-fast),
    box-shadow var(--er-transition-fast);
}
.er-header__subscribe:hover {
  background: #c22e18;
  border-color: #c22e18;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(229, 57, 32, 0.45);
}

/* =============================================================================
   AD SLOTS
   ============================================================================= */

/* ── Base container ───────────────────────────────────────────────────────── */
.er-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.er-ad__label {
  font-family: var(--er-font-headline);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--er-text-muted);
  margin: 0 0 4px;
  text-align: center;
}

/* ── Leaderboard — full-width horizontal strip ────────────────────────────── */
.er-ad--leaderboard {
  margin: var(--er-space-6) auto;
}

/* ── In-feed — between grid rows ─────────────────────────────────────────── */
.er-ad--infeed {
  margin: var(--er-space-8) 0;
}

/* ── Sidebar ads ──────────────────────────────────────────────────────────── */
.er-ad--sidebar-top,
.er-ad--sidebar-mid {
  margin: var(--er-space-6) 0;
}

/* ── Placeholder (shown when no widget is configured) ────────────────────── */
.er-ad__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-1);
  width: 100%;
  min-height: 90px;
  background: repeating-linear-gradient(
    -45deg,
    #ebebeb 0px,
    #ebebeb 4px,
    #f5f5f5 4px,
    #f5f5f5 14px
  );
  border: 1.5px dashed #b0aca6;
  border-radius: var(--er-radius-md);
  padding: var(--er-space-4);
}

.er-ad--sidebar-top .er-ad__placeholder,
.er-ad--sidebar-mid .er-ad__placeholder {
  min-height: 250px;
}

.er-ad__placeholder-tag {
  font-family: var(--er-font-headline);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--er-text-muted);
  background: var(--er-bg-elevated);
  border: 1px solid var(--er-border-color);
  padding: 2px 8px;
  border-radius: var(--er-radius-pill);
}

.er-ad__placeholder-name {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 600;
  color: var(--er-text-secondary);
}

.er-ad__placeholder-size {
  font-family: var(--er-font-mono);
  font-size: 0.7rem;
  color: var(--er-text-muted);
}

/* ── Article ads ──────────────────────────────────────────────────────────── */
.er-ad--article-top,
.er-ad--article-bottom {
  margin: var(--er-space-8) 0;
}

/* =============================================================================
   AZAR WIDGET — floating trigger + modal
   ============================================================================= */

/* ── Floating trigger ────────────────────────────────────────────────────── */
.er-azar-trigger {
  position: fixed;
  bottom: var(--er-space-6);
  left: var(--er-space-6);
  z-index: var(--er-z-toast);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--er-color-brand);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(229, 57, 32, 0.45);
  transition: transform var(--er-transition-fast), box-shadow var(--er-transition-fast);
  line-height: 1;
}

.er-azar-trigger:hover {
  transform: scale(1.1) rotate(-8deg);
  box-shadow: 0 6px 28px rgba(229, 57, 32, 0.6);
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.er-azar-widget {
  position: fixed;
  inset: 0;
  z-index: var(--er-z-modal);
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--er-space-4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Inner panel ─────────────────────────────────────────────────────────── */
.er-azar-widget__inner {
  position: relative;
  background: #FAFAF8;
  border-radius: var(--er-radius-2xl);
  /* Extra top padding gives the absolute close button room without crowding headline */
  padding: calc(var(--er-space-8) + 8px) var(--er-space-6) var(--er-space-6);
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Clean 1rem gap between every stacked item — no negative-margin hacks */
  gap: var(--er-space-4);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

/* ── Close button ────────────────────────────────────────────────────────── */
.er-azar-close {
  position: absolute;
  top: var(--er-space-4);
  right: var(--er-space-4);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  /* Concrete fallback colour; --er-bg-elevated may be undefined in some Blocksy builds */
  background: #eeece7;
  border: 1px solid var(--er-border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--er-text-muted);
  transition: background var(--er-transition-fast), color var(--er-transition-fast);
}

.er-azar-close:hover {
  background: var(--er-border-color);
  color: var(--er-text-primary);
}

/* ── Headline ────────────────────────────────────────────────────────────── */
.er-azar-widget__headline {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-lg);
  font-weight: 900;
  /* !important overrides any Blocksy dark-mode colour token on this element */
  color: #111111 !important;
  margin: 0;
  text-align: center;
  line-height: 1.2;
}

/* ── Subtitle — pulled 8px closer to the headline above it ──────────────── */
.er-azar-widget__sub {
  font-family: var(--er-font-body);
  font-size: var(--er-text-sm);
  color: var(--er-text-muted);
  font-style: italic;
  /* Negative top margin reduces the gap between headline and sub without
     breaking the outer gap value for the remaining siblings              */
  margin: -8px 0 0;
  text-align: center;
}

/* ── Playing card — scoped to widget context ─────────────────────────────── */
.er-azar-widget .er-azar-card {
  position: relative;
  width: 180px;
  height: 290px;
  border: 2px solid var(--er-color-brand);
  /* 14px keeps the radius tight and card-like */
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(229, 57, 32, 0.2);
  /* Prevent the card from shrinking inside the flex column on small panels */
  flex-shrink: 0;
}

/* Card inner fills the fixed dimensions exactly */
.er-azar-widget .er-azar-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Both faces stack absolutely — opacity + z-index control the active face */
.er-azar-widget .er-azar-card__back,
.er-azar-widget .er-azar-card__front {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s ease;
}

/* ── Back face: dark, centered ♠, subtle brand name below ───────────────── */
.er-azar-widget .er-azar-card__back {
  background: #111111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--er-space-3);
  opacity: 1;
  z-index: 2;
}

/* ♠ glyph */
.er-azar-widget .er-azar-card__back span {
  font-size: 4rem;
  color: var(--er-color-brand);
  line-height: 1;
  display: block;
}

/* "EL REGENTE" label injected via CSS so the PHP need not be touched */
.er-azar-widget .er-azar-card__back::after {
  content: 'EL REGENTE';
  display: block;
  font-family: var(--er-font-headline);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* ── Front face: white, article content stacked top-to-bottom ────────────── */
.er-azar-widget .er-azar-card__front {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* clips thumb image to card's border-radius */
  opacity: 0;
  z-index: 1;
}

/* ── Revealed state: swap visible face ───────────────────────────────────── */
.er-azar-widget .er-azar-card.is-revealed .er-azar-card__back  { opacity: 0; z-index: 1; }
.er-azar-widget .er-azar-card.is-revealed .er-azar-card__front { opacity: 1; z-index: 2; }

/* ── Flip animation: pure scale pulse — no rotateY (avoids compositing quirks) */
.er-azar-widget .er-azar-card.is-flipping {
  animation: er-card-scale 0.5s ease;
}

@keyframes er-card-scale {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.88); }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── Front card content — scoped to widget to prevent global style leakage ── */
.er-azar-widget .er-azar-card__thumb {
  width: 100%;
  height: 76px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.er-azar-widget .er-azar-card__section {
  display: block;
  font-family: var(--er-font-headline);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--er-color-brand);
  padding: var(--er-space-3) var(--er-space-3) 0;
}

.er-azar-widget .er-azar-card__title {
  display: -webkit-box !important;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--er-font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  color: #111111;
  line-height: 1.35;
  margin: 4px 0 0;
  padding: 0 var(--er-space-3);
}

.er-azar-widget .er-azar-card__author {
  font-size: 0.65rem;
  color: var(--er-text-muted);
  margin: 4px 0 0;
  padding: 0 var(--er-space-3);
}

/* margin-top: auto pushes the "Leer →" link to the bottom of the flex column */
.er-azar-widget .er-azar-card__read {
  display: inline-block;
  margin-top: auto;
  margin-bottom: var(--er-space-3);
  padding: 4px 14px;
  background: var(--er-color-brand-action);
  color: #ffffff !important;
  border-radius: 4px;
  font-family: var(--er-font-headline);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.er-azar-widget .er-azar-card__read:hover { opacity: 0.85; text-decoration: none; }

.er-azar-widget .er-azar-error {
  font-size: var(--er-text-xs);
  color: var(--er-text-muted);
  padding: var(--er-space-3);
  text-align: center;
  margin: auto 0;   /* vertically centres error message when read link is absent */
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.er-azar-draw {
  width: 100%;
  padding: 12px var(--er-space-4);
  background: var(--er-color-brand);
  color: #ffffff;
  border: none;
  border-radius: var(--er-radius-pill);
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  transition: background var(--er-transition-fast), box-shadow var(--er-transition-fast);
}

.er-azar-draw:hover {
  background: var(--er-color-brand-hover);
  box-shadow: 0 4px 16px rgba(229, 57, 32, 0.4);
}

.er-azar-share {
  width: 100%;
  padding: 10px var(--er-space-4);
  background: transparent;
  color: var(--er-text-secondary);
  border: 1.5px solid var(--er-border-color);
  border-radius: var(--er-radius-pill);
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--er-transition-fast), color var(--er-transition-fast);
}

.er-azar-share:hover:not(:disabled) { border-color: var(--er-color-brand); color: var(--er-color-brand); }
.er-azar-share:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Responsive: narrower placeholder on small screens ───────────────────── */
@media (max-width: 640px) {
  .er-ad--leaderboard .er-ad__placeholder,
  .er-ad--infeed .er-ad__placeholder,
  .er-ad--article-top .er-ad__placeholder,
  .er-ad--article-bottom .er-ad__placeholder {
    min-height: 60px;
  }
}

/* ==========================================================================
   SOCIAL MEDIA
   ========================================================================== */

/* ── Footer social icons ─────────────────────────────────────────────────── */
.er-footer__social { display: flex; gap: var(--er-space-3); margin-top: var(--er-space-4); flex-wrap: wrap; }
.er-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  transition: background var(--er-transition-fast), color var(--er-transition-fast);
}
.er-footer__social-link:hover { background: var(--er-color-brand); color: #ffffff; }
.er-footer__social-link svg { width: 16px; height: 16px; }

/* ── Header social icons (desktop only) ─────────────────────────────────── */
.er-header__social { display: none; gap: var(--er-space-2); align-items: center; }
@media (min-width: 1024px) {
  .er-header__social { display: flex; }
}
.er-header__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--er-text-secondary);
  transition: color var(--er-transition-fast);
}
.er-header__social-link:hover { color: var(--er-color-brand); }
.er-header__social-link svg { width: 15px; height: 15px; }

/* ── Home: Síguenos en redes ─────────────────────────────────────────────── */
.er-social-follow {
  display: flex;
  align-items: center;
  gap: var(--er-space-8);
  flex-wrap: wrap;
}
.er-social-follow__title {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-xl);
  font-weight: 700;
  color: var(--er-text-primary);
  margin: 0 0 var(--er-space-2);
}
.er-social-follow__sub {
  color: var(--er-text-muted);
  font-size: var(--er-text-sm);
  margin: 0;
}
.er-social-follow__links {
  display: flex;
  gap: var(--er-space-3);
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}
.er-social-follow__card {
  display: inline-flex;
  align-items: center;
  gap: var(--er-space-2);
  padding: var(--er-space-3) var(--er-space-4);
  border-radius: var(--er-radius-xl);
  border: 1.5px solid var(--er-border-color);
  color: var(--er-text-primary);
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--er-transition-fast), background var(--er-transition-fast), color var(--er-transition-fast);
}
.er-social-follow__card:hover { border-color: currentColor; }
.er-social-follow__card svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Per-network hover colors */
.er-social-follow__card--instagram:hover { color: #E1306C; }
.er-social-follow__card--twitter:hover   { color: #000000; }
.er-social-follow__card--facebook:hover  { color: #1877F2; }
.er-social-follow__card--youtube:hover   { color: #FF0000; }
.er-social-follow__card--whatsapp:hover  { color: #25D366; }
@media (max-width: 768px) {
  .er-social-follow { flex-direction: column; align-items: flex-start; }
  .er-social-follow__links { justify-content: flex-start; }
}

/* ── Article share buttons ───────────────────────────────────────────────── */
.er-article-share {
  display: flex;
  align-items: center;
  gap: var(--er-space-4);
  padding: var(--er-space-5) 0;
  border-top: 1px solid var(--er-border-color);
  border-bottom: 1px solid var(--er-border-color);
  margin: var(--er-space-6) 0;
  flex-wrap: wrap;
}
.er-article-share__label {
  font-family: var(--er-font-headline);
  font-size: var(--er-text-sm);
  font-weight: 700;
  color: var(--er-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.er-article-share__buttons {
  display: flex;
  gap: var(--er-space-2);
  flex-wrap: wrap;
}
.er-article-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--er-radius-pill);
  border: 1.5px solid var(--er-border-color);
  background: transparent;
  color: var(--er-text-secondary);
  font-family: var(--er-font-headline);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--er-transition-fast), color var(--er-transition-fast), background var(--er-transition-fast);
}
.er-article-share__btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.er-article-share__btn:hover { color: #ffffff; border-color: transparent; }
.er-article-share__btn--facebook:hover { background: #1877F2; }
.er-article-share__btn--twitter:hover  { background: #000000; }
.er-article-share__btn--whatsapp:hover { background: #25D366; }
.er-article-share__btn--copy:hover     { background: var(--er-color-brand); }
@media (max-width: 480px) {
  .er-article-share__btn span { display: none; }
  .er-article-share__btn { padding: 8px; }
}

/* =============================================================================
   PODCAST ARCHIVE
   ============================================================================= */

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.er-podcast-hero-archive {
  background: #111111;
  padding: var(--er-space-16) 0;
  position: relative;
  overflow: hidden;
}
.er-podcast-hero-archive::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(229,57,32,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.er-podcast-hero-archive__inner {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--er-space-10);
  align-items: center;
  position: relative;
  z-index: 1;
}
@media (max-width: 600px) {
  .er-podcast-hero-archive__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .er-podcast-cover { margin: 0 auto; }
  .er-podcast-platforms { justify-content: center; }
}

/* Cover art */
.er-podcast-cover {
  width: 180px;
  height: 180px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a0a06 100%);
  border: 1px solid rgba(229,57,32,0.3);
  border-radius: var(--er-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(229,57,32,0.2);
}
.er-podcast-cover__spade {
  font-size: 5rem;
  color: var(--er-color-brand);
  line-height: 1;
}
.er-podcast-cover__label {
  font-family: var(--er-font-headline);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

/* Info */
.er-podcast-hero-archive__eyebrow {
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--er-color-brand);
  margin-bottom: var(--er-space-2);
}
.er-podcast-hero-archive__title {
  font-family: var(--er-font-headline);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--er-space-4);
}
.er-podcast-hero-archive__desc {
  font-size: var(--er-text-base);
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: var(--er-space-6);
}
.er-podcast-hero-archive__count {
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  margin-top: var(--er-space-4);
  letter-spacing: 0.05em;
}

/* Platform badges */
.er-podcast-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--er-space-3);
}
.er-podcast-platform {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--er-radius-pill);
  font-family: var(--er-font-headline);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  border: 1.5px solid transparent;
}
.er-podcast-platform:hover { opacity: 0.85; transform: translateY(-1px); }
.er-podcast-platform--spotify { background: #1DB954; color: #000; }
.er-podcast-platform--apple   { background: #fc3c44; color: #fff; }
.er-podcast-platform--youtube { background: #FF0000; color: #fff; }

/* ── Episodes list ────────────────────────────────────────────────────────── */
.er-podcast-episodes { padding: var(--er-space-12) 0; }

.er-podcast-episodes__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.er-podcast-ep {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--er-space-6);
  align-items: start;
  padding: var(--er-space-6) 0;
  border-bottom: 1px solid var(--er-border-color);
  transition: background 0.15s;
}
.er-podcast-ep:first-child { border-top: 1px solid var(--er-border-color); }
@media (max-width: 480px) {
  .er-podcast-ep { grid-template-columns: 80px 1fr; gap: var(--er-space-4); }
}

/* Thumbnail */
.er-podcast-ep__thumb {
  display: block;
  position: relative;
  flex-shrink: 0;
  border-radius: var(--er-radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: #1a1a1a;
}
.er-podcast-ep__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.er-podcast-ep:hover .er-podcast-ep__thumb img { transform: scale(1.04); }
.er-podcast-ep__thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  color: var(--er-color-brand);
  position: absolute;
  inset: 0;
}
.er-podcast-ep__duration {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-family: var(--er-font-headline);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.03em;
}

/* Content */
.er-podcast-ep__meta {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  margin-bottom: var(--er-space-2);
  flex-wrap: wrap;
}
.er-podcast-ep__badge {
  font-family: var(--er-font-headline);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--er-color-brand-deep); /* brand-action sobre este fondo tintado da solo 4.29:1 (medido en vivo); brand-deep llega a ≈6.5:1 */
  background: rgba(210,50,25,0.1);
  padding: 2px 8px;
  border-radius: var(--er-radius-sm);
  border: 1px solid rgba(210,50,25,0.2);
}
.er-podcast-ep__date {
  font-family: var(--er-font-headline);
  font-size: 0.65rem;
  color: var(--er-text-muted);
  letter-spacing: 0.03em;
}
.er-podcast-ep__title {
  font-family: var(--er-font-headline);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--er-space-2);
}
.er-podcast-ep__title a {
  color: var(--er-text-primary);
  text-decoration: none;
}
.er-podcast-ep__title a:hover { color: var(--er-color-brand-hover); }
.er-podcast-ep__excerpt {
  font-size: var(--er-text-sm);
  color: var(--er-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--er-space-4);
}
.er-podcast-ep__actions {
  display: flex;
  align-items: center;
  gap: var(--er-space-3);
  flex-wrap: wrap;
}
.er-podcast-ep__listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--er-color-brand-action);
  color: #ffffff;
  font-family: var(--er-font-headline);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 7px 14px;
  border-radius: var(--er-radius-pill);
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}
.er-podcast-ep__listen:hover { opacity: 0.85; transform: translateY(-1px); }
.er-podcast-ep__ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--er-border-color);
  color: var(--er-text-secondary);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.er-podcast-ep__ext:hover { border-color: var(--er-color-brand); color: var(--er-color-brand); }

.er-podcast-episodes__empty {
  text-align: center;
  color: var(--er-text-muted);
  font-size: var(--er-text-lg);
  padding: var(--er-space-16) 0;
}

/* YouTube play overlay in podcast archive */
.er-podcast-ep__yt-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  transition: background 0.2s;
}
.er-podcast-ep__yt-play svg {
  width: 40px;
  height: 40px;
  background: var(--er-color-brand);
  color: #fff;
  border-radius: 50%;
  padding: 10px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
  transition: transform 0.2s;
}
.er-podcast-ep__thumb:hover .er-podcast-ep__yt-play { background: rgba(0,0,0,0.15); }
.er-podcast-ep__thumb:hover .er-podcast-ep__yt-play svg { transform: scale(1.1); }
