/**
 * El Post Briefings - Estilos del front-end.
 *
 * Implementacion de los design handoffs "Brief en vivo" y "Lo Esencial"
 * en el stack de WordPress. Todo scopeado bajo .elp-br- para no chocar
 * con el tema.
 *
 * Los tokens viven en :root como custom properties. En produccion estos
 * deberian centralizarse en el design system de El Post (colors_and_type.css)
 * y este archivo solo consumirlos.
 */

/* ============================================================
   Tokens del Design System (El Post)
   ============================================================ */
.elp-br-app {
	--ep-blue:       #3B6BE3;
	--ep-blue-deep:  #1C3B7A;
	--ep-red:        #E63B3B;
	--ep-success:    #10B981;
	--ep-text:       #1A1A2E;
	--ep-text-muted: #6B7280;
	--ep-border:     #E5E7EB;
	--ep-surface:    #FFFFFF;
	--ep-surface-2:  #F5F7FA;

	--ep-featured-bg:     #EEF2FB;
	--ep-featured-border: #E0E8F8;
	--ep-chip-text:       #3A4256;
	--ep-chip-border:     #D5DAE5;
	--ep-dot:             #C7CEDE;
	--ep-media-text:      #9AA3B2;

	--ep-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	font-family: var(--ep-font);
	color: var(--ep-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	background: var(--ep-surface-2);
}

.elp-br-app,
.elp-br-app * {
	box-sizing: border-box;
}

/* ============================================================
   Masthead (cabecera de seccion)
   ============================================================ */
.elp-br-masthead {
	padding: 20px 18px 18px;
	background: var(--ep-surface);
	border-bottom: 1px solid var(--ep-border);
	color: var(--ep-text);
}

.elp-br-masthead-identity {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.elp-br-masthead-date {
	font-size: 25px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 18px 0 0;
	color: inherit;
	text-wrap: balance;
}

.elp-br-masthead-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 11px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ep-text-muted);
}

.elp-br-masthead-dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
}

.elp-br-masthead-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

/* ============================================================
   Marca "lo/esencial"
   ============================================================ */

/* Wordmark corto /esencial (masthead y banner) */
.elp-br-brand {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: var(--ep-font, 'Montserrat', system-ui, sans-serif);
	font-weight: 600;
	font-size: 25px;
	letter-spacing: -0.02em;
	line-height: 1;
	color: var(--ep-text, #1A1A2E);
}

.elp-br-brand-bar {
	display: inline-block;
	width: 0.15em;
	height: 0.96em;
	background: var(--ep-blue, #3B6BE3);
	transform: skewX(-16deg);
	border-radius: 1px;
	margin-right: 0.12em;
}

.elp-br-brand--xl {
	font-size: 40px;
}

/* Logotipo completo lo/esencial. El punto rojo late (halo) con el
   estado is-live (edicion abierta); sin el, queda estatico. El margen
   derecho compensa el punto, que sobresale del contenedor. */
.elp-br-logo {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	white-space: nowrap;
	text-decoration: none;
	font-family: var(--ep-font, 'Montserrat', system-ui, sans-serif);
	font-weight: 600;
	font-size: 25px;
	letter-spacing: -0.02em;
	line-height: 1;
	color: var(--ep-text, #1A1A2E);
	margin-right: 0.35em;
}

.elp-br-logo-lo {
	color: var(--ep-blue, #3B6BE3);
}

.elp-br-logo-bar {
	display: inline-block;
	width: 0.15em;
	height: 0.96em;
	background: var(--ep-blue, #3B6BE3);
	transform: skewX(-16deg);
	border-radius: 1px;
	margin: 0 0.13em;
}

.elp-br-logo-dot {
	position: absolute;
	top: 0.07em;
	right: -0.31em;
	width: 0.15em;
	height: 0.15em;
	border-radius: 50%;
	background: var(--ep-red, #E63B3B);
}

.elp-br-logo--xl {
	font-size: 32px;
}

@media (min-width: 480px) {
	.elp-br-logo--xl {
		font-size: 40px;
	}
}

@keyframes elp-br-dot-halo {
	0%   { transform: scale(0.82); box-shadow: 0 0 0 0 rgba(230, 59, 59, 0.5); }
	50%  { transform: scale(1.12); box-shadow: 0 0 0 0.42em rgba(230, 59, 59, 0); }
	100% { transform: scale(0.82); box-shadow: 0 0 0 0 rgba(230, 59, 59, 0); }
}

.elp-br-logo.is-live .elp-br-logo-dot {
	animation: elp-br-dot-halo 1.8s ease-in-out infinite;
}

/* Badge "Lo ultimo" (efecto halo con is-live). Utilidad de marca:
   por ahora no se usa en el front — el estado en vivo lo comunica el
   punto del logotipo. */
@keyframes elp-br-live-pulse {
	0%        { transform: scale(1);   opacity: 0.55; }
	70%, 100% { transform: scale(2.8); opacity: 0; }
}

@keyframes elp-br-pulse-box {
	0%        { box-shadow: 0 0 0 0 rgba(230, 59, 59, 0.45); }
	70%, 100% { box-shadow: 0 0 0 14px rgba(230, 59, 59, 0); }
}

.elp-br-ultimo {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	background: var(--ep-red, #E63B3B);
	color: #FFFFFF;
	border-radius: 999px;
	padding: 5px 10px;
	font-family: var(--ep-font, 'Montserrat', system-ui, sans-serif);
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	white-space: nowrap;
}

.elp-br-ultimo.is-live {
	animation: elp-br-pulse-box 1.6s ease-out infinite;
}

.elp-br-ultimo-dot {
	position: relative;
	display: inline-flex;
	width: 6px;
	height: 6px;
}

.elp-br-ultimo-ring,
.elp-br-ultimo-core {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #FFFFFF;
}

.elp-br-ultimo-ring {
	opacity: 0;
}

.elp-br-ultimo.is-live .elp-br-ultimo-ring {
	animation: elp-br-live-pulse 1.8s ease-out infinite;
}

/* ============================================================
   Filtro de categorias (sticky, variante Contorno por default)
   ============================================================ */
.elp-br-filter {
	position: sticky;
	top: 0;
	z-index: 5;
	background: var(--ep-surface-2);
	padding: 11px 18px 12px;
	border-bottom: 1px solid var(--ep-border);
}

.elp-br-chips {
	display: flex;
	gap: 7px;
	align-items: center;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.elp-br-chips::-webkit-scrollbar {
	display: none;
}

.elp-br-chip {
	flex: 0 0 auto;
	background: var(--ep-surface);
	color: var(--ep-text);
	border: 1px solid var(--ep-border);
	border-radius: 999px;
	padding: 5px 12px;
	cursor: pointer;
	font-family: inherit;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.45;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	white-space: nowrap;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.elp-br-chip:hover {
	border-color: var(--ep-blue);
	color: var(--ep-blue);
}

.elp-br-chip.is-active {
	background: var(--ep-blue);
	color: #FFFFFF;
	border-color: var(--ep-blue);
	font-weight: 600;
}

/* ============================================================
   Feed
   ============================================================ */
.elp-br-feed {
	padding: 16px 18px 8px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.elp-br-empty {
	text-align: center;
	padding: 40px 0;
	color: var(--ep-text-muted);
	font-size: 14px;
}

/* ============================================================
   "Ver mas notas" (a partir de la nota 11)
   ============================================================ */
.elp-br-item--more {
	display: none;
}

/* Con un filtro de categoria activo, el limite no aplica: se ven
   todas las notas de esa categoria (menos las que oculta el filtro). */
.elp-br-feed.is-filtered .elp-br-item--more:not(.is-hidden) {
	display: block;
}

.elp-br-more {
	display: flex;
	justify-content: center;
	padding: 2px 0 6px;
}

.elp-br-more.is-hidden {
	display: none;
}

.elp-br-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--ep-surface);
	border: 1px solid var(--ep-border);
	border-radius: 999px;
	padding: 9px 18px;
	cursor: pointer;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--ep-text);
	transition: border-color 150ms ease, color 150ms ease;
}

.elp-br-more-btn:hover {
	border-color: var(--ep-blue);
	color: var(--ep-blue);
}

/* ============================================================
   Card (forma comun a todas las notas)
   ============================================================ */
.elp-br-item {
	background: var(--ep-surface);
	border: 1px solid var(--ep-border);
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	transition: opacity 0.2s ease;
}

.elp-br-item.is-hidden {
	display: none;
}

.elp-br-item-inner {
	padding: 16px;
}

.elp-br-note-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 9px;
}

.elp-br-note-header-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1;
}

.elp-br-destacado-marker {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--ep-blue);
}

.elp-br-cat-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--ep-blue);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1;
}

.elp-br-header-dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--ep-dot);
	flex-shrink: 0;
}

.elp-br-item-time {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--ep-text-muted);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.elp-br-item-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.28;
	margin: 0 0 9px;
	color: var(--ep-text);
	letter-spacing: 0;
	text-wrap: balance;
}

.elp-br-item-image {
	margin: 0 0 12px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--ep-border);
}

.elp-br-item-image img {
	display: block;
	width: 100%;
	height: auto;
}

.elp-br-item-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.elp-br-item-text p {
	font-size: 15px;
	line-height: 1.6;
	color: var(--ep-text);
	margin: 0;
	text-wrap: pretty;
}

.elp-br-item-foot {
	display: flex;
	justify-content: flex-end;
	margin-top: 14px;
}

/* ============================================================
   Item destacado - tratamiento "Sutil" (default del brief)
   Mismo card shape, solo cambia fondo + border + pin marker + titulo mas grande.
   ============================================================ */
.elp-br-item--featured {
	background: var(--ep-featured-bg);
	border-color: var(--ep-featured-border);
}

.elp-br-item--featured .elp-br-item-title {
	font-size: 21px;
	letter-spacing: -0.01em;
}

/* ============================================================
   Boton Compartir (pequeno pill mayuscula)
   ============================================================ */
.elp-br-share,
.elp-br-item-share {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: transparent;
	border: 1px solid var(--ep-border);
	color: var(--ep-text-muted);
	border-radius: 999px;
	padding: 4px 9px;
	cursor: pointer;
	font-family: inherit;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.elp-br-share:hover,
.elp-br-item-share:hover {
	border-color: var(--ep-blue);
	color: var(--ep-blue);
}

.elp-br-share.is-copied,
.elp-br-item-share.is-copied {
	background: rgba(16, 185, 129, 0.10);
	border-color: rgba(16, 185, 129, 0.35);
	color: var(--ep-success);
}

/* ============================================================
   Cierre + share general del masthead
   ============================================================ */
.elp-br-cierre {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--ep-text-muted);
	font-weight: 500;
}

.elp-br-masthead-share {
	display: inline-flex;
	margin-top: 16px;
}

/* Variante rectangular del handoff para el share del masthead. */
.elp-br-masthead-share .elp-br-share {
	background: var(--ep-surface);
	border-radius: 8px;
	padding: 9px 14px;
	gap: 7px;
	font-size: 11px;
	letter-spacing: 0.5px;
	color: var(--ep-text);
}

/* ============================================================
   Footer editorial
   ============================================================ */
.elp-br-foot {
	padding: 14px 18px 34px;
	text-align: center;
}

.elp-br-foot-mark {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--ep-text-muted);
	font-size: 12px;
	font-weight: 500;
}

.elp-br-foot-note {
	color: var(--ep-text-muted);
	font-size: 11px;
	margin-top: 6px;
	opacity: 0.85;
}

.elp-br-foot-link {
	color: var(--ep-blue);
	font-weight: 600;
	text-decoration: none;
}

.elp-br-foot-link:hover {
	text-decoration: underline;
}

/* Wordmark e/POST inline */
.elp-br-wordmark {
	display: inline-flex;
	align-items: baseline;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: -0.01em;
	line-height: 1;
}

.elp-br-wordmark-e,
.elp-br-wordmark-slash {
	color: var(--ep-blue);
}

.elp-br-wordmark-slash {
	font-weight: 500;
	margin: 0 -0.02em;
}

.elp-br-wordmark-post {
	color: #000000;
}

/* ============================================================
   Archivo de ediciones (/esencial/archivo/)
   ============================================================ */
.elp-br-archivo {
	padding: 16px 18px 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.elp-br-archivo-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--ep-surface);
	border: 1px solid var(--ep-border);
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--ep-text);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: border-color 150ms ease, background 150ms ease;
}

.elp-br-archivo-item:hover {
	border-color: var(--ep-blue);
	background: #F1F5FF;
}

.elp-br-archivo-fecha {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.elp-br-archivo-meta {
	font-size: 12px;
	font-weight: 500;
	color: var(--ep-text-muted);
	white-space: nowrap;
}

.elp-br-archivo-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 18px 4px;
}

.elp-br-archivo-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--ep-surface);
	border: 1px solid var(--ep-border);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ep-text);
	transition: border-color 150ms ease, color 150ms ease;
}

.elp-br-archivo-nav-link:hover {
	border-color: var(--ep-blue);
	color: var(--ep-blue);
}

/* ============================================================
   Flash al cargar con #nota-X
   ============================================================ */
.elp-br-flash {
	animation: elp-br-flash 2.5s ease-out;
}

@keyframes elp-br-flash {
	0%   { box-shadow: 0 0 0 4px rgba(59, 107, 227, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08); }
	40%  { box-shadow: 0 0 0 4px rgba(59, 107, 227, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08); }
	100% { box-shadow: 0 0 0 0 rgba(59, 107, 227, 0), 0 2px 8px rgba(0, 0, 0, 0.08); }
}

/* ============================================================
   Toast (confirmacion de compartir)
   ============================================================ */
.elp-br-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 16px);
	background: var(--ep-text);
	color: #FFFFFF;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--ep-font);
	font-size: 13px;
	font-weight: 600;
	padding: 11px 18px;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	z-index: 60;
	transition: opacity 200ms ease, transform 200ms ease;
}

.elp-br-toast.is-on {
	opacity: 1;
	transform: translate(-50%, 0);
}

.elp-br-toast-check {
	color: #4ade80;
	display: inline-flex;
}

@media (prefers-reduced-motion: reduce) {
	.elp-br-masthead,
	.elp-br-chip,
	.elp-br-share,
	.elp-br-item-share,
	.elp-br-toast {
		transition: none;
	}
	.elp-br-flash,
	.elp-br-ultimo.is-live,
	.elp-br-ultimo.is-live .elp-br-ultimo-ring,
	.elp-br-logo.is-live .elp-br-logo-dot {
		animation: none;
	}
	.elp-br-banner-linea {
		display: none;
	}
}

/* ============================================================
   Wrap exterior (centrado del contenido en desktop)
   ============================================================ */
.elp-br-wrap {
	max-width: 720px;
	margin: 0 auto;
	background: var(--ep-surface-2);
}

@media (min-width: 768px) {
	.elp-br-wrap {
		box-shadow: 0 0 0 1px var(--ep-border);
	}
	.elp-br-masthead-date {
		font-size: 30px;
	}
	/* El logo del masthead acompana el tamano del titulo. */
	.elp-br-masthead-identity .elp-br-logo {
		font-size: 30px;
	}
}

/* ============================================================
   Shortcode [elpost_esencial] - banner de portada
   ============================================================ */
.elp-br-card {
	font-family: var(--ep-font, 'Montserrat', system-ui, sans-serif);
	display: flex;
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: #1A1A2E;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 160ms ease;
	margin-bottom: 12px;
	max-width: 720px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.elp-br-card:hover {
	background: #F5F7FA;
	border-color: #3B6BE3;
	box-shadow: 0 4px 14px rgba(59, 107, 227, 0.15);
}

.elp-br-banner {
	flex-direction: column;
	gap: 16px;
	padding: 18px;
	background: #F1F5FF;
}

.elp-br-banner:hover {
	background: #E6EDFE;
}

.elp-br-banner-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 12px;
}

.elp-br-banner-updated {
	position: relative;
	font-size: 11px;
	font-weight: 500;
	line-height: 1;
	color: #6B7280;
	white-space: nowrap;
	padding-bottom: 7px;
}

/* Linea roja indeterminada bajo la hora: un segmento entra por la
   izquierda, cruza y sale por la derecha, en loop infinito. */
.elp-br-banner-linea {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	overflow: hidden;
}

.elp-br-banner-linea::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 40%;
	border-radius: 2px;
	background: #E63B3B;
	animation: elp-br-linea 1.8s ease-in-out infinite;
}

@keyframes elp-br-linea {
	0%   { transform: translateX(-110%); }
	100% { transform: translateX(260%); }
}

.elp-br-banner-bottom {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}

.elp-br-banner-tagline {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	color: #6B7280;
	max-width: 232px;
}

.elp-br-banner-cta {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #3B6BE3;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Variante oscura: fondo negro, "lo/" azul, "esencial" blanco. */
.elp-br-banner--oscuro {
	background: #13131F;
	border-color: #13131F;
}

.elp-br-banner--oscuro:hover {
	background: #1B1B2A;
	border-color: #1B1B2A;
}

.elp-br-banner--oscuro .elp-br-logo {
	color: #FFFFFF;
}

.elp-br-banner--oscuro .elp-br-logo-dot {
	background: #FF5A5A;
}

.elp-br-banner--oscuro .elp-br-banner-updated,
.elp-br-banner--oscuro .elp-br-banner-tagline {
	color: #9CA3AF;
}

.elp-br-banner--oscuro .elp-br-banner-linea::before {
	background: #FF5A5A;
}

/* Variante azul: fondo azul de marca, todas las letras blancas. */
.elp-br-banner--azul {
	background: #3B6BE3;
	border-color: #3B6BE3;
}

.elp-br-banner--azul:hover {
	background: #3260D1;
	border-color: #3260D1;
}

.elp-br-banner--azul .elp-br-logo,
.elp-br-banner--azul .elp-br-logo-lo {
	color: #FFFFFF;
}

.elp-br-banner--azul .elp-br-logo-bar {
	background: #FFFFFF;
}

.elp-br-banner--azul .elp-br-logo-dot {
	background: #FF5A5A;
}

.elp-br-banner--azul .elp-br-banner-updated {
	color: rgba(255, 255, 255, 0.75);
}

.elp-br-banner--azul .elp-br-banner-linea::before {
	background: #FF5A5A;
}

.elp-br-banner--azul .elp-br-banner-tagline {
	color: rgba(255, 255, 255, 0.90);
}

.elp-br-banner--azul .elp-br-banner-cta {
	background: #FFFFFF;
	color: #3B6BE3;
}

.elp-br-card--mini {
	display: inline-flex;
	align-items: center;
	width: auto;
	margin-bottom: 0;
	padding: 10px 14px;
	gap: 10px;
}

.elp-br-card--mini .elp-br-logo {
	font-size: 16px;
}

.elp-br-card-mini-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1A1A2E;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
