.lea-esq { --lea-ink: #1d2433; --lea-muted: #5d6679; --lea-line: #dfe3ea; --lea-bg: #f5f6f8; --lea-accent: #0E1525; max-width: 1300px; margin: 0 auto; color: var(--lea-ink); font-family: inherit; }
.lea-esq *, .lea-esq *::before, .lea-esq *::after { box-sizing: border-box; }
.lea-esq [hidden] { display: none !important; }
.lea-esq__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lea-esq__toolbar { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--lea-bg); border-radius: 14px; }
.lea-esq__input { width: 100%; height: 56px; padding: 0 20px; font-size: 18px; border: 2px solid var(--lea-line); border-radius: 12px; background: #fff; color: var(--lea-ink); }
.lea-esq__input:focus, .lea-esq__select:focus { outline: 3px solid #7aa7ff; outline-offset: 1px; border-color: var(--lea-accent); }
.lea-esq__selects { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lea-esq__selects .lea-esq__select { width: auto; flex: 0 1 auto; }
.lea-esq__dates { display: contents; }
.lea-esq__selects .lea-esq__date { min-width: 150px; }
.lea-esq__select { width: 100%; height: 48px; padding: 0 12px; font-size: 16px; border: 2px solid var(--lea-line); border-radius: 12px; background: #fff; color: var(--lea-ink); }

.lea-esq__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lea-esq__chip { padding: 8px 16px; font-size: 15px; border: 2px solid var(--lea-line); border-radius: 999px; background: #fff; color: var(--lea-ink); cursor: pointer; }
.lea-esq__chip:hover { border-color: var(--lea-accent); }
.lea-esq__chip.is-active { background: var(--lea-accent); border-color: var(--lea-accent); color: #fff; }

.lea-esq__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 14px 0; }
.lea-esq__count { margin: 0; font-size: 16px; color: var(--lea-muted); }

.lea-esq__btn { display: inline-block; padding: 12px 22px; font-size: 16px; font-weight: 600; text-decoration: none; text-align: center; border: 2px solid var(--lea-accent); border-radius: 999px; background: var(--lea-accent); color: #fff; cursor: pointer; line-height: 1.2; }
.lea-esq__btn:hover { opacity: .88; color: #fff; }
.lea-esq__btn--outline { background: #fff; color: var(--lea-accent); }
.lea-esq__btn--outline:hover { background: var(--lea-bg); color: var(--lea-accent); }
.lea-esq__btn--ghost { padding: 8px 14px; border-color: transparent; background: transparent; color: var(--lea-accent); text-decoration: underline; }
.lea-esq__btn--ghost:hover { background: transparent; color: var(--lea-accent); opacity: .7; }

.lea-esq__grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.lea-esq__grid[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.lea-esq__card { margin: 0; }
.lea-esq__card-btn { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; border: 1px solid var(--lea-line); border-radius: 14px; background: #fff; color: var(--lea-ink); cursor: pointer; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.lea-esq__card-btn:hover { box-shadow: 0 8px 22px rgba(14, 21, 37, .12); transform: translateY(-2px); }
.lea-esq__card-btn:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }
.lea-esq__media { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--lea-bg); overflow: hidden; position: relative; }
/* El recorte de la tarjeta corta el marco rojo de la esquela por abajo: se cierra con una línea del mismo color. */
.lea-esq__media:has(img)::after { content: ""; position: absolute; left: 3%; right: 3%; bottom: 0; height: 3px; background: #8b1c14; pointer-events: none; }
.lea-esq__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.lea-esq__initials { font-size: 44px; font-weight: 700; letter-spacing: 2px; color: var(--lea-muted); }
.lea-esq__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.lea-esq__name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.lea-esq__meta { font-size: 14px; color: var(--lea-muted); }
.lea-esq__meta-l { display: block; }

.lea-esq__empty { padding: 40px 20px; text-align: center; background: var(--lea-bg); border-radius: 14px; }
.lea-esq__empty-title { margin: 0 0 10px; font-size: 22px; }
.lea-esq__more { margin: 28px 0 8px; text-align: center; }

.lea-esq__dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--lea-ink); overflow: auto; }
.lea-esq__dialog::backdrop { background: rgba(14, 21, 37, .65); }
.lea-esq__dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--lea-line); }
.lea-esq__dlg-title { margin: 0; font-size: 22px; line-height: 1.2; }
.lea-esq__close { flex: none; width: 44px; height: 44px; font-size: 28px; line-height: 1; border: 0; border-radius: 50%; background: var(--lea-bg); color: var(--lea-ink); cursor: pointer; }
.lea-esq__dlg-body { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 20px; }
.lea-esq__dlg-img { width: 100%; height: auto; border: 1px solid var(--lea-line); border-radius: 10px; }
.lea-esq__dlg-date { margin: 0 0 12px; }
.lea-esq__meta-l strong, .lea-esq__dlg-date strong { font-weight: 700; }
.lea-esq__dl { margin: 0 0 14px; }
.lea-esq__row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--lea-line); }
.lea-esq__row dt { flex: none; width: 110px; font-weight: 600; color: var(--lea-muted); }
.lea-esq__row dd { margin: 0; }
.lea-esq__texto p { margin: 0 0 12px; }
.lea-esq__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--lea-line); }

@media (min-width: 560px) {
	.lea-esq__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
	.lea-esq__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 760px) {
	.lea-esq__toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
	.lea-esq__input { flex: 1 1 200px; min-width: 0; }
	.lea-esq__selects { flex: 0 1 auto; }
	.lea-esq__dlg-body { grid-template-columns: 1fr 1fr; }
	.lea-esq__dlg-body:has(.lea-esq__dlg-img:only-child) { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.lea-esq__selects .lea-esq__select { flex: 1 1 calc(50% - 6px); }
	.lea-esq__grid { gap: 14px; }
	.lea-esq__name { font-size: 16px; }
	.lea-esq__row { flex-direction: column; gap: 0; }
	.lea-esq__row dt { width: auto; }
}

@media print {
	body.lea-esq-printing * { visibility: hidden; }
	body.lea-esq-printing .lea-esq__dialog, body.lea-esq-printing .lea-esq__dialog * { visibility: visible; }
	body.lea-esq-printing .lea-esq__dialog { position: absolute; left: 0; top: 0; width: 100%; max-height: none; overflow: visible; }
	body.lea-esq-printing .lea-esq__close, body.lea-esq-printing .lea-esq__actions { display: none; }
}

.lea-esq-single { max-width: 900px; margin: 0 auto; }
.lea-esq-single__fecha { font-size: 18px; color: #5d6679; }
.lea-esq-single__datos { margin: 0 0 20px; padding: 0; list-style: none; }
.lea-esq-single__datos li { padding: 6px 0; border-bottom: 1px solid #dfe3ea; }
.lea-esq-single__img { display: block; width: 100%; height: auto; border: 1px solid #dfe3ea; border-radius: 10px; }
.lea-esq-single__volver { margin-top: 24px; }

.lea-esq__datelabel { font-weight: 600; }
.lea-esq__date { width: auto; min-width: 170px; }

.lea-esq__selects .lea-esq__fecha, .lea-esq__selects .lea-esq__range, .lea-esq__selects [data-role="clear-dates"] { order: 1; }
.lea-esq__selects #lea-esq-orden { order: 2; }
.lea-esq__range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }

@media (min-width: 1100px) {
	.lea-esq__toolbar { flex-wrap: nowrap; }
	.lea-esq__selects { flex-wrap: nowrap; }
}

.lea-esq--ultimas .lea-esq__card-btn { text-decoration: none; }
@media (min-width: 560px) {
	.lea-esq--ultimas .lea-esq__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
	.lea-esq--ultimas .lea-esq__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Ventana de la esquela en móvil: ocupa la pantalla visible y no se corta */
.lea-esq__dialog { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overscroll-behavior: contain; }
body:has(.lea-esq__dialog[open]) { overflow: hidden; }
@media (max-width: 560px) {
	.lea-esq__dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border-radius: 0; }
	.lea-esq__dlg-head { padding: 12px 14px; }
	.lea-esq__dlg-title { font-size: 18px; }
	.lea-esq__dlg-body { padding: 14px; gap: 14px; }
	.lea-esq__actions { position: sticky; bottom: 0; z-index: 1; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; gap: 8px; }
	.lea-esq__actions .lea-esq__btn { flex: 1 1 calc(50% - 4px); display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 12px; font-size: 15px; text-align: center; }
	.lea-esq__actions .lea-esq__btn:last-child { flex-basis: 100%; }
}
@media print {
	body.lea-esq-printing .lea-esq__dialog { height: auto; max-height: none; }
}

/* Icono de ampliar en cada tarjeta */
.lea-esq__card-btn--zoom { position: relative; }
.lea-esq__card-btn--zoom .lea-esq__body { padding-right: 64px; }
.lea-esq__zoom { position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--lea-line); background: #fff; color: var(--lea-ink); transition: background .15s, color .15s, border-color .15s; }
.lea-esq__card-btn:hover .lea-esq__zoom, .lea-esq__card-btn:focus-visible .lea-esq__zoom { background: var(--lea-accent); border-color: var(--lea-accent); color: #fff; }
@media print { .lea-esq__zoom { display: none; } }
