/* O404 Widgets: theme builder y blog. Valores neutros, se ajustan desde Elementor. */

.o404-tb-main { display: block; }
.o404-editor-notice { padding: 10px 12px; border: 1px dashed #b5bcc7; color: #4b5563; font-size: 13px; background: #f8fafc; }

/* ---------- Etiqueta de categoría ---------- */
.o404-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--o404-term-color, var(--o404-badge-default, #1f4e8c));
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .02em;
	text-decoration: none;
	transition: filter .2s ease;
}
a.o404-badge:hover, a.o404-badge:focus-visible { color: #fff; filter: brightness(1.12); text-decoration: none; }

/* ---------- Rejilla de entradas ---------- */
.o404-posts { --o404-cols: 3; --o404-gap: 28px; }
.o404-posts__grid {
	display: grid;
	grid-template-columns: repeat(var(--o404-cols), minmax(0, 1fr));
	gap: var(--o404-gap);
}
.o404-posts--list .o404-posts__grid { grid-template-columns: 1fr; }
.o404-posts__grid.is-loading { opacity: .5; pointer-events: none; transition: opacity .2s; }
.o404-posts__empty { grid-column: 1 / -1; }

.o404-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
	transition: transform .25s ease, box-shadow .25s ease;
}
.o404-posts--lift-yes .o404-card:hover { transform: translateY(-4px); box-shadow: 0 2px 6px rgba(15, 23, 42, .1), 0 16px 36px rgba(15, 23, 42, .1); }
.o404-card__media { position: relative; display: block; flex-shrink: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #e8edf3; }
/* !important: algunos temas (p. ej. Twenty Twenty-One) ponen width/height en línea a las imágenes destacadas. */
.o404-card__media .o404-card__img { position: absolute; inset: 0; display: block; width: 100% !important; max-width: none !important; height: 100% !important; object-fit: cover; transition: transform .5s ease; }
.o404-card:hover .o404-card__img { transform: scale(1.04); }
.o404-card__body { display: flex; flex-direction: column; flex-grow: 1; gap: 10px; padding: 22px 24px 24px; }
.o404-card__terms { display: flex; flex-wrap: wrap; gap: 6px; }
.o404-card__title { margin: 0; font-size: 1.2em; line-height: 1.3; }
.o404-card__title a { color: inherit; text-decoration: none; }
.o404-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.o404-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: #64748b; }
.o404-sep::before { content: "\00b7"; }
.o404-card__excerpt { margin: 0; color: #475569; }
.o404-card__more { margin-top: auto; padding-top: 4px; font-weight: 600; text-decoration: none; }
.o404-card__more::after { content: " \2192"; }

/* Primera entrada destacada */
.o404-card--featured { grid-column: 1 / -1; }
@media (min-width: 768px) {
	.o404-card--featured { flex-direction: row; }
	.o404-card--featured .o404-card__media { flex: 0 0 58%; aspect-ratio: auto; min-height: 340px; }
	.o404-card--featured .o404-card__body { justify-content: center; padding: 36px 40px; }
	.o404-card--featured .o404-card__title { font-size: 1.7em; }
	.o404-posts--list .o404-card { flex-direction: row; }
	.o404-posts--list .o404-card__media { flex: 0 0 36%; aspect-ratio: auto; min-height: 200px; }
}

/* Filtro */
.o404-posts__filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.o404-posts__filter-item {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	color: #1e293b;
	background: transparent;
	font-size: 14px;
	text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.o404-posts__filter-item:hover,
.o404-posts__filter-item.is-active {
	background: var(--o404-term-color, #0f2a4a);
	border-color: var(--o404-term-color, #0f2a4a);
	color: #fff;
	text-decoration: none;
}

/* Paginación y cargar más */
.o404-posts__pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 36px; }
.o404-posts__pagination .page-numbers { display: inline-block; min-width: 40px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center; text-decoration: none; color: inherit; }
.o404-posts__pagination .page-numbers.current { background: #0f2a4a; border-color: #0f2a4a; color: #fff; }
.o404-posts__more-wrap { display: flex; justify-content: center; margin-top: 36px; }
.o404-posts__more {
	padding: 12px 28px;
	border: 1px solid #0f2a4a;
	border-radius: 6px;
	background: #0f2a4a;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.o404-posts__more:hover { background: transparent; color: #0f2a4a; }
.o404-posts__more[aria-busy="true"] { opacity: .6; cursor: progress; }

/* ---------- Elementos de la entrada ---------- */
.o404-logo img { display: inline-block; height: auto; vertical-align: middle; }
.o404-logo a { display: inline-block; }
.o404-logo__text { font-weight: 700; font-size: 1.4em; }
.o404-post-title { margin: 0; }
.o404-post-title a { color: inherit; text-decoration: none; }
.o404-post-content { line-height: 1.75; }
.o404-post-content > :first-child { margin-top: 0; }
.o404-post-content img { max-width: 100%; height: auto; }
.o404-post-content :is(h2, h3, h4) { scroll-margin-top: 100px; }
.o404-featured { margin: 0; }
.o404-featured img { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; }
.o404-featured__caption { margin-top: 8px; font-size: 13px; color: #64748b; }

.o404-post-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: #64748b; }
.o404-post-info--stacked { flex-direction: column; align-items: flex-start; gap: 6px; }
.o404-post-info a:not(.o404-badge) { color: inherit; }
.o404-post-info--inline .o404-post-info__item + .o404-post-info__item::before { content: "\00b7"; margin-right: 16px; }
.o404-post-info--inline .o404-post-info__item--categories + .o404-post-info__item::before { content: none; margin: 0; }
.o404-post-info__item--categories { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.o404-archive-title__heading { margin: 0 0 12px; }
.o404-archive-title__desc { margin: 0; max-width: 760px; }
.o404-archive-title[style*="center"] .o404-archive-title__desc { margin-inline: auto; }

.o404-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.o404-post-nav__item { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.o404-post-nav__item--next { text-align: right; align-items: flex-end; }
.o404-post-nav__label { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.o404-post-nav__item--prev .o404-post-nav__label::before { content: "\2190  "; }
.o404-post-nav__item--next .o404-post-nav__label::after { content: "  \2192"; }
.o404-post-nav__title { font-weight: 600; line-height: 1.35; }
@media (max-width: 600px) { .o404-post-nav { grid-template-columns: 1fr; } .o404-post-nav__item--next { text-align: left; align-items: flex-start; } }

.o404-breadcrumbs { font-size: 14px; }
.o404-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.o404-breadcrumbs li { display: inline-flex; gap: 6px; }
.o404-breadcrumbs a { color: inherit; }
.o404-breadcrumbs__sep { opacity: .6; }

/* Índice */
.o404-toc { --o404-toc-active: #1f4e8c; padding: 20px 22px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.o404-toc__title { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; text-align: left; color: inherit; }
.o404-toc__toggle { cursor: pointer; position: relative; padding-right: 24px; }
.o404-toc__toggle::after { content: "\2212"; position: absolute; right: 0; top: 0; }
.o404-toc__toggle[aria-expanded="false"]::after { content: "+"; }
.o404-toc__toggle[aria-expanded="false"] { margin-bottom: 0; }
.o404-toc__list, .o404-toc__list ol { margin: 0; padding-left: 18px; }
.o404-toc__list li { margin: 6px 0; }
.o404-toc__list a { color: inherit; text-decoration: none; }
.o404-toc__list a:hover, .o404-toc__list a.is-active { color: var(--o404-toc-active); text-decoration: underline; }
.o404-toc--sticky-yes { position: sticky; top: 100px; align-self: flex-start; }
.o404-toc--sticky-yes .o404-toc { max-height: calc(100vh - 140px); overflow: auto; }

/* Buscador */
.o404-search { --o404-search-border: #cbd5e1; --o404-search-radius: 6px; display: flex; }
.o404-search__input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--o404-search-border); border-right: 0; border-radius: var(--o404-search-radius) 0 0 var(--o404-search-radius); font: inherit; background: #fff; }
.o404-search__button { padding: 10px 18px; border: 1px solid #0f2a4a; border-radius: 0 var(--o404-search-radius) var(--o404-search-radius) 0; background: #0f2a4a; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Lista de categorías */
.o404-terms { margin: 0; padding: 0; list-style: none; }
.o404-terms--list li { border-bottom: 1px solid #e2e8f0; }
.o404-terms--list .o404-terms__link { display: flex; justify-content: space-between; padding: 10px 0; color: inherit; text-decoration: none; }
.o404-terms--list .o404-terms__link[aria-current] { font-weight: 700; }
.o404-terms--badges { display: flex; flex-wrap: wrap; gap: 8px; }
.o404-terms__count { opacity: .7; font-weight: 400; }
.o404-terms--badges .o404-terms__count::before { content: "("; }
.o404-terms--badges .o404-terms__count::after { content: ")"; }

/* Accesibilidad */
.o404-skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100000; clip: auto; width: auto; height: auto; padding: 10px 14px; background: #fff; color: #000; }
