/* CPD Repositorio — colores del sitio */
:root {
	--cpd-navy: #103070;
	--cpd-blue: #1050a0;
	--cpd-red: #d42030;
	--cpd-yellow: #f0d010;
	--cpd-text: #243041;
	--cpd-muted: #4a5568;
	--cpd-bg: #f4f7fb;
	--cpd-border: #c5d0dc;
	--cpd-white: #fff;
}

.cpd-repo-wrap {
	box-sizing: border-box;
	width: min(100%, 960px);
	max-width: 960px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 1.25rem;
}

/* Astra deja el main estrecho a la izquierda: forzar ancho completo y centrar. */
body.single-cpd_documento .site-content,
body.single-cpd_documento .site-content .ast-container,
body.post-type-archive-cpd_documento .site-content,
body.post-type-archive-cpd_documento .site-content .ast-container {
	display: block;
	width: 100%;
	max-width: none;
	margin-left: auto;
	margin-right: auto;
}

.site-content .cpd-repo-single,
.ast-container > .cpd-repo-single {
	box-sizing: border-box;
	display: block;
	flex: 1 1 100%;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.cpd-repo {
	padding: 1.5rem 0 2.5rem;
}

.cpd-repo__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	align-items: center;
	margin: 0 0 1rem;
	padding: 1rem;
	border: 1px solid var(--cpd-border);
	border-radius: 14px;
	background: var(--cpd-white);
	box-shadow: 0 1px 2px rgba(16, 48, 112, .04);
}

.cpd-repo__search {
	position: relative;
	flex: 1 1 240px;
	min-width: 200px;
}

.cpd-repo__search svg {
	position: absolute;
	top: 50%;
	left: 0.9rem;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: var(--cpd-navy);
	pointer-events: none;
	z-index: 1;
}

.cpd-repo .cpd-repo__search input[type="search"],
.cpd-repo__search input[type="search"],
.cpd-repo__search input {
	width: 100%;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.55rem 0.9rem 0.55rem 2.85rem !important;
	border: 1px solid var(--cpd-border);
	border-radius: 10px;
	font: inherit;
	color: var(--cpd-text);
	background: #fff;
}

.cpd-repo__search input[type="search"]::-webkit-search-decoration,
.cpd-repo__search input[type="search"]::-webkit-search-cancel-button,
.cpd-repo__search input[type="search"]::-webkit-search-results-button,
.cpd-repo__search input[type="search"]::-webkit-search-results-decoration {
	display: none;
}

.cpd-repo__select select,
.cpd-repo__per select {
	min-height: 44px;
	padding: .45rem .8rem;
	border: 1px solid var(--cpd-border);
	border-radius: 10px;
	font: inherit;
	color: var(--cpd-text);
	background: #fff;
}

.cpd-repo__live {
	margin: 0 0 1rem;
	color: var(--cpd-muted);
	font-size: .92rem;
}

.cpd-repo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	min-height: 44px;
	padding: .55rem 1rem;
	border-radius: 10px;
	font-weight: 700;
	font-size: .95rem;
	line-height: 1.2;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
}

.cpd-repo-btn--primary {
	background: var(--cpd-navy);
	color: #fff;
	border-color: var(--cpd-navy);
}

.cpd-repo-btn--primary:hover,
.cpd-repo-btn--primary:focus-visible {
	background: var(--cpd-blue);
	border-color: var(--cpd-blue);
	color: #fff;
}

.cpd-repo-btn--ghost {
	background: transparent;
	color: var(--cpd-navy);
	border-color: var(--cpd-border);
}

.cpd-repo-btn--icon {
	padding-inline: 1.1rem;
}

.cpd-repo-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	border: 1.5px solid var(--cpd-navy);
	background: #fff;
	color: var(--cpd-navy);
	text-decoration: none;
}

.cpd-repo-icon-btn--fill {
	background: var(--cpd-navy);
	color: #fff;
	border-color: var(--cpd-navy);
}

.cpd-repo-icon-btn:hover,
.cpd-repo-icon-btn:focus-visible {
	background: var(--cpd-blue);
	border-color: var(--cpd-blue);
	color: #fff;
}

.cpd-repo__cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.25rem;
}

@media (max-width: 1100px) {
	.cpd-repo__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
	.cpd-repo__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.cpd-repo__cards { grid-template-columns: 1fr; }
}

.cpd-repo-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--cpd-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(16, 48, 112, .05);
}

.cpd-repo-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: #e8eef6;
	overflow: hidden;
}

.cpd-repo-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cpd-repo-card__media img.cpd-repo-card__ph {
	object-fit: contain;
	object-position: center;
	padding: 1.1rem 1.25rem;
	background: #e8eef5;
	box-sizing: border-box;
}

.cpd-repo-card__body {
	display: flex;
	flex-direction: column;
	gap: .45rem;
	padding: .95rem 1rem 1.05rem;
	flex: 1;
}

.cpd-repo-card__meta {
	margin: 0;
	color: var(--cpd-muted);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.cpd-repo-card__title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
}

.cpd-repo-card__title a {
	color: var(--cpd-navy);
	text-decoration: none;
	font-weight: 800;
}

.cpd-repo-card__title a:hover,
.cpd-repo-card__title a:focus-visible {
	color: var(--cpd-blue);
}

.cpd-repo-card__excerpt {
	margin: 0;
	color: var(--cpd-muted);
	font-size: .9rem;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cpd-repo-card__actions {
	display: flex;
	gap: .45rem;
	margin-top: auto;
	padding-top: .55rem;
}

.cpd-repo__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.5rem;
}

.cpd-repo__per {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	color: var(--cpd-text);
	font-size: .92rem;
	font-weight: 600;
}

.cpd-repo__empty {
	background: #fff;
	border: 1px dashed var(--cpd-border);
	border-radius: 12px;
	padding: 1.5rem;
	color: var(--cpd-muted);
}

.cpd-repo__pager ul {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.cpd-repo__pager a,
.cpd-repo__pager span {
	display: inline-block;
	min-width: 2rem;
	text-align: center;
	padding: .35rem .55rem;
	border-radius: 8px;
	border: 1px solid var(--cpd-border);
	background: #fff;
	text-decoration: none;
	color: var(--cpd-navy);
}

.cpd-repo__pager .current {
	background: var(--cpd-navy);
	color: #fff;
	border-color: var(--cpd-navy);
}

/* Ficha de descarga */
.cpd-repo-single {
	padding: 2rem 0 3.25rem;
	background: #fff;
}

.cpd-repo-doc {
	width: 100%;
	max-width: 1100px;
	margin-left: auto;
	margin-right: auto;
}

.cpd-repo-doc__head {
	padding-bottom: .85rem;
	margin-bottom: 1.35rem;
	border-bottom: 1px solid var(--cpd-border);
}

.cpd-repo-doc__title {
	margin: 0;
	color: var(--cpd-navy);
	font-size: clamp(1.55rem, 2.8vw, 2rem);
	line-height: 1.25;
	font-weight: 800;
}

.cpd-repo-doc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr);
	gap: 1.75rem 2.25rem;
	align-items: start;
}

.cpd-repo-doc__side {
	padding-left: 1.75rem;
	border-left: 1px solid var(--cpd-border);
}

@media (max-width: 860px) {
	.cpd-repo-doc__grid {
		grid-template-columns: 1fr;
	}
	.cpd-repo-doc__side {
		padding-left: 0;
		border-left: 0;
		padding-top: 1rem;
		border-top: 1px solid var(--cpd-border);
	}
}

.cpd-repo-doc__lead {
	margin: 0 0 1rem;
	color: var(--cpd-muted);
	font-size: 1.05rem;
	line-height: 1.55;
}

.cpd-repo-doc__body {
	color: var(--cpd-text);
	line-height: 1.65;
	font-size: 1.02rem;
}

.cpd-repo-doc__body > *:first-child { margin-top: 0; }
.cpd-repo-doc__body > *:last-child { margin-bottom: 0; }

.cpd-repo-doc__viewer {
	margin-top: 1.35rem;
}

.cpd-repo-embed {
	display: grid;
	gap: .75rem;
}

.cpd-repo-embed__title {
	margin: 0;
	color: var(--cpd-navy);
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.3;
}

.cpd-repo-embed__frame-wrap {
	position: relative;
	width: 100%;
	height: var(--cpd-embed-h, 720px);
	min-height: 280px;
	border: 1px solid var(--cpd-border);
	border-radius: 14px;
	overflow: hidden;
	background: #f4f7fb;
	box-shadow: 0 1px 2px rgba(16, 48, 112, 0.04);
}

.cpd-repo-embed__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.cpd-repo-embed__load {
	appearance: none;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #e8eef6;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	font: inherit;
	color: #fff;
}

.cpd-repo-embed__poster,
.cpd-repo-embed__poster-ph {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.cpd-repo-embed__poster-ph {
	background:
		linear-gradient(180deg, rgba(16, 48, 112, .08), rgba(16, 48, 112, .28)),
		repeating-linear-gradient(
			-12deg,
			#d7e1ef,
			#d7e1ef 12px,
			#e8eef6 12px,
			#e8eef6 24px
		);
}

.cpd-repo-embed__load::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(16, 48, 112, .18), rgba(16, 48, 112, .55));
}

.cpd-repo-embed__load-label {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	padding: .7rem 1.05rem;
	border-radius: 999px;
	background: rgba(16, 48, 112, .92);
	font-weight: 700;
	font-size: .95rem;
	box-shadow: 0 8px 24px rgba(16, 48, 112, .28);
}

.cpd-repo-embed__load-ico {
	display: inline-grid;
	place-items: center;
}

.cpd-repo-embed__load:hover .cpd-repo-embed__load-label,
.cpd-repo-embed__load:focus-visible .cpd-repo-embed__load-label {
	background: var(--cpd-blue);
}

.cpd-repo-embed__frame-wrap.is-loading::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: rgba(244, 247, 251, .72);
	pointer-events: none;
}

.cpd-repo-embed__fallback {
	margin: 0;
	color: var(--cpd-muted);
	font-size: .9rem;
	line-height: 1.45;
}

.cpd-repo-embed__fallback a {
	color: var(--cpd-blue);
	font-weight: 700;
	text-decoration: none;
}

.cpd-repo-embed__fallback a:hover,
.cpd-repo-embed__fallback a:focus-visible {
	text-decoration: underline;
}

.cpd-repo-embed__missing {
	margin: 0;
	padding: .85rem 1rem;
	border-radius: 12px;
	border: 1px dashed var(--cpd-border);
	background: var(--cpd-bg);
	color: var(--cpd-muted);
	font-size: .95rem;
	font-weight: 600;
}

.cpd-repo-embed__actions {
	margin: 0;
}

@media (max-width: 700px) {
	.cpd-repo-embed__frame-wrap {
		height: min(70vh, var(--cpd-embed-h, 720px));
		border-radius: 10px;
	}
}

.cpd-repo-doc__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .55rem;
	margin-bottom: 1.25rem;
}

.cpd-repo-doc__missing {
	display: inline-flex;
	align-items: center;
	padding: .55rem .85rem;
	border-radius: 10px;
	border: 1px dashed var(--cpd-border);
	background: var(--cpd-bg);
	color: var(--cpd-muted);
	font-size: .92rem;
	font-weight: 600;
}

.cpd-repo-doc__meta {
	display: grid;
	gap: .7rem;
	margin: 0 0 1.25rem;
}

.cpd-repo-doc__meta div {
	display: grid;
	grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr);
	gap: .35rem .75rem;
	align-items: baseline;
}

.cpd-repo-doc__meta dt {
	margin: 0;
	font-weight: 800;
	color: var(--cpd-navy);
	font-size: .95rem;
}

.cpd-repo-doc__meta dt::after {
	content: ":";
}

.cpd-repo-doc__meta dd {
	margin: 0;
	color: var(--cpd-muted);
	font-size: .95rem;
}

.cpd-repo-doc__cover {
	margin: 0;
}

.cpd-repo-doc__cover img {
	display: block;
	width: 100%;
	border-radius: 12px;
	border: 1px solid var(--cpd-border);
	object-fit: cover;
	aspect-ratio: 4 / 3;
	background: var(--cpd-bg);
}

.cpd-repo-doc__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	margin: 2rem 0 0;
	padding-top: 1.1rem;
	border-top: 1px solid var(--cpd-border);
}

.cpd-repo-doc__nav a {
	color: var(--cpd-blue);
	font-weight: 700;
	text-decoration: none;
	max-width: 46%;
	line-height: 1.35;
}

.cpd-repo-doc__nav a:hover,
.cpd-repo-doc__nav a:focus-visible {
	color: var(--cpd-navy);
	text-decoration: underline;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Admin editor */
.cpd-doc-wrap { max-width: 1180px; }
.cpd-doc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-top: 16px; }
.cpd-doc__title { width: 100%; font-size: 1.7rem; line-height: 1.3; padding: 12px 14px; margin: 0 0 12px; border: 1px solid #d5deea; border-radius: 12px; box-shadow: none; }
.cpd-doc__main .wp-editor-wrap { border-radius: 12px; overflow: hidden; border: 1px solid #d5deea; }
.cpd-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 48, 112, 0.04); margin: 0 0 14px; }
.cpd-card__head { padding: 12px 16px; border-bottom: 1px solid #eef2f6; }
.cpd-card__head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; color: #103070; }
.cpd-card__body { padding: 14px 16px 16px; }

/* Admin import — full admin content width */
.cpd-repo-admin.cpd-repo-import,
.cpd-repo-import {
	max-width: none;
	width: 100%;
	box-sizing: border-box;
}
.cpd-repo-import__hero { margin: 0 0 1.25rem; }
.cpd-repo-import__hero h1 { margin: 0 0 .35rem; color: #103070; }
.cpd-repo-import__hero p { margin: 0; color: #5c6b80; font-size: 14px; line-height: 1.5; max-width: 54rem; }
.cpd-repo-import__card { margin-bottom: 1rem; width: 100%; }
.cpd-repo-import__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
}
.cpd-repo-import__option--wide {
	grid-column: 1 / -1;
}
@media (max-width: 782px) {
	.cpd-repo-import__options { grid-template-columns: 1fr; }
}
.cpd-repo-import__option {
	display: grid;
	gap: 10px;
	align-content: start;
	padding: 16px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #f8fafc;
	min-width: 0;
	overflow: hidden;
	box-sizing: border-box;
}
.cpd-repo-import__option--recommended {
	border-color: #b7c9e6;
	background: #f3f7fc;
}
.cpd-repo-import__option-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.cpd-repo-import__badge {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 3px 10px;
	border-radius: 999px;
	background: #103070;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
}
.cpd-repo-import__option h3 {
	margin: 0;
	color: #103070;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}
.cpd-repo-import__option p {
	margin: 0;
	color: #5c6b80;
	font-size: 13px;
	line-height: 1.5;
}
.cpd-repo-import__option input[type="text"],
.cpd-repo-import__option input.large-text,
.cpd-repo-import__option input.regular-text {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}
.cpd-repo-import__option input[type="file"] {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.cpd-repo-import__path {
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cpd-repo-import__path code {
	display: inline;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-all;
}
.cpd-repo-import__csv p { margin: 0 0 12px; color: #3d4d66; font-size: 14px; line-height: 1.5; }
.cpd-repo-import__csv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 8px;
}
.cpd-repo-import__file { display: inline-flex; position: relative; overflow: hidden; margin: 0; }
.cpd-repo-import__file input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}
.cpd-repo-import__run {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 4px 0 1.1rem;
}
.cpd-repo-import__run--compact { margin: 10px 0 0; }
.cpd-repo-import__status { color: #3d4d66; font-size: 13px; font-weight: 600; }
.cpd-repo-import__progress { width: 100%; max-width: 720px; margin: 0 0 1.25rem; }
.cpd-repo-import__bar-track {
	height: 10px;
	background: #e8eef6;
	border-radius: 999px;
	overflow: hidden;
}
.cpd-repo-import__bar {
	display: block;
	height: 100%;
	width: 0;
	background: #2271b1;
	transition: width .2s ease;
}
.cpd-repo-import__errors {
	margin: .5rem 0 0;
	padding-left: 1.1rem;
	color: #b32d2e;
}
.cpd-badge { display: inline-flex; align-items: center; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cpd-badge.is-live { background: #e5f6ea; color: #0d6b32; }
.cpd-badge.is-draft { background: #f3f0e4; color: #7a5b00; }
.cpd-hint { margin: 8px 0 0; color: #5c6b80; font-size: 12px; line-height: 1.45; }
.cpd-actions { display: grid; gap: 8px; margin-top: 14px; }
.cpd-actions .button { width: 100%; justify-content: center; text-align: center; min-height: 40px; border-radius: 8px; }
.cpd-view { margin: 12px 0 0; }
.cpd-field { margin: 0 0 12px; }
.cpd-field:last-child { margin-bottom: 0; }
.cpd-field label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: #3d4d66; }
.cpd-field input,
.cpd-field select,
.cpd-field textarea { width: 100%; max-width: 100%; min-height: 38px; border-radius: 8px; border-color: #d5deea; }
.cpd-field textarea { min-height: 88px; resize: vertical; }
.cpd-media__pick { display: flex; flex-direction: column; width: 100%; margin: 0; padding: 0; border: 1.5px dashed #b7c4d6; border-radius: 12px; background: #f7f9fc; cursor: pointer; overflow: hidden; text-align: left; }
.cpd-media__pick:hover, .cpd-media__pick:focus { border-color: #103070; background: #f3f7fc; outline: none; box-shadow: 0 0 0 3px rgba(16, 48, 112, 0.12); }
.cpd-media__preview { display: block; min-height: 148px; background: #e8eef6; }
.cpd-media__preview img { display: block; width: 100%; height: 168px; object-fit: cover; }
.cpd-media__empty { display: flex; align-items: center; justify-content: center; min-height: 148px; }
.cpd-media__empty::before { content: ""; width: 42px; height: 34px; border: 2px solid #8aa0bb; border-radius: 6px; background: linear-gradient(#8aa0bb, #8aa0bb) center 60% / 18px 2px no-repeat, linear-gradient(#8aa0bb, #8aa0bb) center 60% / 2px 18px no-repeat; }
.cpd-media.has-image .cpd-media__empty { display: none; }
.cpd-media__cta { display: block; padding: 10px 12px; font-size: 13px; font-weight: 700; color: #103070; }
.cpd-media__cta::before { content: attr(data-empty); }
.cpd-media.has-image .cpd-media__cta::before { content: attr(data-filled); }
.cpd-media__remove { margin-top: 8px; color: #8a3040; }
.cpd-file { display: grid; gap: 8px; }
.cpd-file__name { margin: 0; font-size: 13px; color: #3d4d66; word-break: break-all; }
@media (max-width: 960px) {
	.cpd-doc { grid-template-columns: 1fr; }
}
