/*
Theme Name: Crea Docente Blog
Theme URI: https://blog.creadocente.com
Description: Tema del blog Crea Docente, con el mismo estilo de la tienda (cuaderno, crayones, letras redondeadas). Tema hijo de Twenty Twenty-Five.
Author: Crea Docente
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: creadocente-blog
*/

/* ---------- base: hoja de cuaderno ---------- */
body {
	background-color: var(--wp--preset--color--base);
	background-image: repeating-linear-gradient(180deg, transparent 0 35px, var(--wp--preset--color--accent-6) 35px 36px);
	-webkit-font-smoothing: antialiased;
}

/* ---------- encabezado ---------- */
.cd-header {
	position: relative;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}
.cd-logo {
	display: inline-flex;
	gap: 4px;
	text-decoration: none !important;
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 700;
	font-size: 19px;
	color: #fff !important;
}
.cd-logo span {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
}
.cd-logo span:nth-child(1) { background: var(--wp--preset--color--accent-2); transform: rotate(-6deg); }
.cd-logo span:nth-child(2) { background: var(--wp--preset--color--accent-3); transform: rotate(5deg); }
.cd-header .wp-block-site-title a { text-decoration: none; }
.cd-header .wp-block-navigation a { font-family: var(--wp--preset--font-family--fredoka); font-weight: 600; }
.cd-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent-3); }

/* franja de crayones */
.cd-crayons { height: 10px; display: flex; margin: 0 !important; }
.cd-crayons i { flex: 1; }
.cd-crayons i:nth-child(1) { background: var(--wp--preset--color--accent-2); }
.cd-crayons i:nth-child(2) { background: var(--wp--preset--color--orange); }
.cd-crayons i:nth-child(3) { background: var(--wp--preset--color--accent-1); }
.cd-crayons i:nth-child(4) { background: var(--wp--preset--color--green); }
.cd-crayons i:nth-child(5) { background: var(--wp--preset--color--accent-3); }
.cd-crayons i:nth-child(6) { background: var(--wp--preset--color--purple); }

/* ---------- botones tipo juguete ---------- */
.wp-element-button,
.wp-block-button__link,
.wc-block-components-button:not(.is-link),
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	border: 2px solid var(--wp--preset--color--contrast) !important;
	box-shadow: 0 4px 0 var(--wp--preset--color--contrast);
	transition: transform .12s ease, box-shadow .12s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover,
.wc-block-components-button:not(.is-link):hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 0 var(--wp--preset--color--contrast);
}
.wp-element-button:active,
.wp-block-button__link:active,
.wc-block-components-button:not(.is-link):active {
	transform: translateY(3px);
	box-shadow: 0 1px 0 var(--wp--preset--color--contrast);
}
.is-style-outline .wp-block-button__link { background: var(--wp--preset--color--accent-5) !important; color: var(--wp--preset--color--contrast) !important; }
:where(a, button, .wp-element-button):focus-visible { outline: 3px dashed var(--wp--preset--color--accent-3); outline-offset: 3px; }

/* ---------- tarjetas ---------- */
.cd-card {
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 20px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
}
.cd-card .wp-block-heading { margin-top: 0; }
.cd-tilt-l { transform: rotate(-1.2deg); }
.cd-tilt-r { transform: rotate(1.2deg); }

.cd-badge {
	display: inline-block;
	border: 2px solid var(--wp--preset--color--contrast);
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 4px 14px;
	transform: rotate(-2deg);
}

/* palabra arcoíris */
.cd-rainbow { display: inline-block; white-space: nowrap; }
.cd-rainbow span { display: inline-block; }
.cd-rainbow span:nth-child(5n+1) { color: var(--wp--preset--color--accent-2); transform: rotate(-4deg); }
.cd-rainbow span:nth-child(5n+2) { color: var(--wp--preset--color--orange); transform: translateY(-3px); }
.cd-rainbow span:nth-child(5n+3) { color: var(--wp--preset--color--green); transform: rotate(3deg); }
.cd-rainbow span:nth-child(5n+4) { color: var(--wp--preset--color--accent-3); transform: translateY(2px); }
.cd-rainbow span:nth-child(5n+5) { color: var(--wp--preset--color--purple); transform: rotate(-3deg); }

/* ilustración */
.cd-art svg { width: 100%; height: auto; display: block; }
.cd-float { animation: cd-float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cd-float.d2 { animation-delay: -1.3s; }
.cd-float.d3 { animation-delay: -2.6s; }
.cd-spin { animation: cd-wobble 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cd-float { 50% { transform: translateY(-10px); } }
@keyframes cd-wobble { 50% { transform: rotate(14deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .cd-float, .cd-spin { animation: none; } }

/* ---------- productos (listas, tienda, relacionados) ---------- */
.wc-block-product-template > li,
.wp-block-woocommerce-product-template > li,
ul.products li.product {
	background: var(--wp--preset--color--accent-5);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 18px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
	padding: 12px 12px 18px !important;
	transition: transform .15s ease;
}
.wc-block-product-template > li:hover,
.wp-block-woocommerce-product-template > li:hover { transform: translateY(-4px) rotate(-.5deg); }
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image img { border-radius: 12px; }
.wc-block-components-product-price,
.wp-block-woocommerce-product-price {
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 700;
	color: var(--wp--preset--color--accent-3);
}
.wc-block-components-product-sale-badge,
.wp-block-woocommerce-product-sale-badge {
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 2px solid var(--wp--preset--color--contrast) !important;
	border-radius: 999px !important;
	font-family: var(--wp--preset--font-family--fredoka);
}
.wc-block-product-template .wp-block-post-title a,
.wp-block-woocommerce-product-template .wp-block-post-title a { text-decoration: none; }

/* producto individual */
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery .flex-viewport { border-radius: 18px; }
.single-product .woocommerce-product-gallery img {
	border-radius: 18px;
	border: 2px solid var(--wp--preset--color--contrast);
	box-sizing: border-box;
	max-width: 100%;
}
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 2px solid var(--wp--preset--color--contrast);
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	transform: rotate(-8deg);
}
/* la navegación ya muestra nivel y tipo; ocultamos "Categoría / Etiquetas" */
.single-product .product_meta,
.single-product .wp-block-woocommerce-product-meta { display: none; }
.single-product .wp-block-woocommerce-product-price { font-size: var(--wp--preset--font-size--x-large); }

/* tienda: filtros y contadores */
.wc-block-mini-cart__badge { background: var(--wp--preset--color--accent-2) !important; color: #fff !important; }

/* carrito y pago */
.wc-block-cart, .wc-block-checkout { font-family: var(--wp--preset--font-family--nunito); }
.wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wp-block-woocommerce-checkout-order-summary-block {
	background: var(--wp--preset--color--accent-5);
}
.wc-block-components-text-input input,
.wc-block-components-combobox input,
.wc-block-components-form .wc-block-components-text-input input { border-radius: 10px !important; }

/* aviso de licencia en producto */
.cd-license {
	border: 2px dashed var(--wp--preset--color--accent-4);
	border-radius: 14px;
	padding: 12px 16px;
	font-size: .95em;
}

/* ---------- pie ---------- */
.cd-footer a { text-decoration: none; }
.cd-footer a:hover { text-decoration: underline; }

/* =====================================================================
   BLOG
   ===================================================================== */

/* etiqueta "Blog" junto al nombre */
.cd-blog-tag {
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	font-size: 13px;
	background: var(--wp--preset--color--accent-1);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 1px 10px;
	transform: rotate(-4deg);
	display: inline-block;
	margin: 0 !important;
}
.cd-header .wp-block-search__input { border-radius: 12px; border: 2px solid var(--wp--preset--color--contrast); }
.cd-header .wp-block-search__button { border-radius: 12px; }

/* buscador grande del encabezado de la portada */
.cd-hero-search .wp-block-search__inside-wrapper {
	background: var(--wp--preset--color--accent-5);
	border: 2px solid var(--wp--preset--color--contrast) !important;
	border-radius: 16px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
	padding: 6px;
}
.cd-hero-search .wp-block-search__input { border: 0 !important; font-size: 1.05rem; padding-left: 12px; background: transparent; }

/* chips de categorías */
.cd-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.cd-chips a {
	display: inline-block;
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent-5);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 6px 14px;
	box-shadow: 0 3px 0 var(--wp--preset--color--contrast);
	transition: transform .12s ease;
}
.cd-chips a:hover { transform: translateY(-2px); color: var(--wp--preset--color--contrast); }
.cd-chips a:nth-child(6n+1) { background: var(--wp--preset--color--pink); }
.cd-chips a:nth-child(6n+2) { background: var(--wp--preset--color--sky); }
.cd-chips a:nth-child(6n+3) { background: var(--wp--preset--color--mint); }
.cd-chips a:nth-child(6n+4) { background: var(--wp--preset--color--sun); }
.cd-chips a:nth-child(6n+5) { background: #efe6ff; }
.cd-chips a:nth-child(6n+6) { background: #ffe8d6; }

/* tarjetas de entradas */

.cd-posts .wp-block-post {
	background: var(--wp--preset--color--accent-5);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 20px;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .15s ease;
}
.cd-posts .wp-block-post:hover { transform: translateY(-4px) rotate(-.4deg); }
.cd-posts .wp-block-post-featured-image { margin: 0 !important; border-bottom: 2px solid var(--wp--preset--color--contrast); }
.cd-posts .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; width: 100%; height: auto; }
.cd-post-body { padding: 16px 20px 22px !important; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.cd-post-body .wp-block-post-title { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.cd-post-body .wp-block-post-title a { text-decoration: none; }
.cd-post-body .wp-block-post-excerpt { color: var(--wp--preset--color--accent-4); font-size: .98rem; margin: 0; }
.cd-post-body .wp-block-post-excerpt__more-text { margin-top: auto; }
.cd-post-body .wp-block-read-more,
.cd-post-body .wp-block-post-excerpt__more-link { font-family: var(--wp--preset--font-family--fredoka); font-weight: 600; text-decoration: none; }

/* categoría como etiqueta */
.cd-cat-badge a,
.wp-block-post-terms.cd-cat-badge a {
	display: inline-block;
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent-1);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 2px 10px;
	margin: 0 4px 4px 0;
}
.cd-cat-badge .wp-block-post-terms__separator { display: none; }

/* portada de respaldo para entradas sin imagen destacada */
.cd-thumb-fallback {
	margin: 0 !important;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	aspect-ratio: 16/10;
	display: grid;
	place-items: center;
	background-color: var(--cd-c, #fff1c7);
	background-image:
		radial-gradient(circle at 15% 20%, rgba(255,255,255,.7) 0 10px, transparent 11px),
		radial-gradient(circle at 85% 75%, rgba(255,255,255,.6) 0 14px, transparent 15px),
		repeating-linear-gradient(180deg, transparent 0 27px, rgba(43,45,66,.08) 27px 28px);
}
.cd-thumb-fallback a { display: grid; place-items: center; width: 100%; height: 100%; text-decoration: none; }
.cd-thumb-fallback span {
	font-size: clamp(42px, 6vw, 64px);
	line-height: 1;
	background: #fff;
	border: 2px solid var(--wp--preset--color--contrast);
	box-shadow: 0 4px 0 var(--wp--preset--color--contrast);
	border-radius: 22px;
	padding: 14px 18px;
	transform: rotate(-4deg);
}

/* paginación */
.wp-block-query-pagination { gap: 8px; }
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	text-decoration: none;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 12px;
	padding: 4px 12px;
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
}
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--accent-1); }

/* entrada individual */
.single .cd-article { background: var(--wp--preset--color--accent-5); }
.single .cd-article .wp-block-post-featured-image img { border-radius: 18px; border: 2px solid var(--wp--preset--color--contrast); }
.cd-article .wp-block-post-content > * + * { margin-top: 1.1em; }
.cd-article .wp-block-post-content img { border-radius: 14px; height: auto; }
.cd-article .wp-block-post-content h2,
.cd-article .wp-block-post-content h3 { margin-top: 1.8em; }
.cd-article .wp-block-post-content a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cd-article .wp-block-post-content blockquote {
	border-left: 6px solid var(--wp--preset--color--accent-1);
	background: var(--wp--preset--color--sun);
	border-radius: 0 14px 14px 0;
	padding: 12px 18px;
	margin-left: 0;
}
.cd-meta { color: var(--wp--preset--color--accent-4); font-size: .95rem; }

/* comentarios */
.wp-block-comments .wp-block-comment-template li { list-style: none; }
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),
.wp-block-post-comments-form textarea {
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 12px;
	background: #fff;
}

/* foro (bbPress) */
#bbpress-forums { font-size: 1rem; }
#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies,
#bbpress-forums ul.bbp-lead-topic {
	border: 2px solid var(--wp--preset--color--contrast) !important;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 5px 0 var(--wp--preset--color--contrast);
}
#bbpress-forums li.bbp-header {
	background: var(--wp--preset--color--accent-1) !important;
	border-color: var(--wp--preset--color--contrast) !important;
	font-family: var(--wp--preset--font-family--fredoka);
}
#bbpress-forums li.bbp-footer { background: var(--wp--preset--color--sun) !important; }
#bbpress-forums div.odd, #bbpress-forums ul.odd { background: #fffdf6; }
#bbpress-forums .bbp-topic-permalink,
#bbpress-forums .bbp-forum-title { font-family: var(--wp--preset--font-family--fredoka); font-weight: 600; }
#bbpress-forums fieldset.bbp-form { border: 2px solid var(--wp--preset--color--contrast); border-radius: 16px; background: #fff; }
#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span.current {
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 10px;
	padding: 2px 9px;
	text-decoration: none;
}
#bbpress-forums .bbp-pagination-links span.current { background: var(--wp--preset--color--accent-1); }

/* máximo 2 categorías por tarjeta */
.cd-posts .cd-cat-badge a:nth-of-type(n+3) { display: none; }
.cd-chips { margin-top: 0 !important; }

/* celular: encabezado compacto e ilustración más pequeña */
@media (max-width: 600px) {
	.cd-header .wp-block-site-title { font-size: 1.1rem !important; line-height: 1.15; }
	.cd-header .wp-block-button__link { padding: .45rem .7rem !important; font-size: .9rem !important; white-space: nowrap; }
	.cd-header .wp-block-search__button { padding: .45rem !important; }
	.cd-header > .wp-block-group > .wp-block-group:last-child { gap: 10px !important; }
	.cd-art { max-width: 240px; margin: 0 auto; }
}
