/*
Theme Name: Capirunners
Theme URI: https://angelperezweb.com
Author: Ángel Pérez
Author URI: https://angelperezweb.com
Description: Tema para páginas web de runners, rápido y optimizado para SEO.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: capirunners
Domain Path: /languages
Tags: blog, custom-menu, featured-images, translation-ready, accessibility-ready, threaded-comments, full-width-template
*/

/* ==========================================================================
   Fuente local Teko
   --------------------------------------------------------------------------
   'Teko Light' (peso 300) es la versión estática que usa el encabezado.
   Se declara como familia propia para que, si el archivo aún no se ha
   subido a /assets/fonts, el navegador caiga en la Teko variable y no en
   una fuente del sistema. La Teko variable (300-700) sigue siendo la base
   del resto de la web.
   ========================================================================== */

@font-face {
	font-family: 'Teko Light';
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url('assets/fonts/Teko-Light.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Teko';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('assets/fonts/teko-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Teko';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url('assets/fonts/teko-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Poppins local para los textos descriptivos (no se precarga). */
@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/Poppins-Regular.woff2') format('woff2');
}

@font-face {
	font-family: 'Poppins';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('assets/fonts/Poppins-Medium.woff2') format('woff2');
}

/* ==========================================================================
   Variables y base
   ========================================================================== */

:root {
	--color-principal: #e63946;
	--color-secundario: #1d3557;
	--color-texto: #333333;
	--fuente-principal: 'Teko', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--fuente-parrafos: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	/* El encabezado usa Teko Light; inc/enqueue.php la reemplaza si se elige otra fuente. */
	--fuente-encabezado: 'Teko Light', var(--fuente-principal);
	/* Peso y espaciado de todos los textos del encabezado. */
	--peso-encabezado: 400;
	--espaciado-letras: 0.06em;
	--ancho-contenedor: 1160px;
	--ancho-lectura: 760px;
	--espaciado: clamp(1rem, 2.5vw, 2rem);
	/* Radio único de la web: todos los bordes redondeados usan esta variable. */
	--radio: 5px;
	/* Fondo del pie de página. */
	--color-footer: #000000;
	/* Opacidad de los logos del carrusel de aliados en reposo. */
	--opacidad-aliado: 0.6;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	background: #ffffff;
	color: var(--color-texto);
	font-family: var(--fuente-principal);
	font-size: 1.125rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	color: var(--color-secundario);
	font-family: var(--fuente-principal);
	font-weight: 700;
	line-height: 1.15;
}

h1 {
	font-size: clamp(2rem, 4.5vw, 3rem);
}

h2 {
	font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

h3 {
	font-size: clamp(1.35rem, 2.8vw, 1.75rem);
}

p {
	margin: 0 0 1.25em;
}

a {
	color: var(--color-principal);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--color-secundario);
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

figure {
	margin: 0 0 1.5em;
}

ul,
ol {
	margin: 0 0 1.25em;
	padding-left: 1.4em;
}

blockquote {
	margin: 0 0 1.5em;
	padding: 0.5em 0 0.5em 1.25em;
	border-left: 4px solid var(--color-principal);
	color: var(--color-secundario);
	font-size: 1.1em;
}

code,
kbd,
pre {
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow: auto;
	padding: 1rem;
	background: #f6f7f9;
	border-radius: var(--radio);
}

table {
	width: 100%;
	margin-bottom: 1.5em;
	border-collapse: collapse;
}

th,
td {
	padding: 0.6em 0.75em;
	border: 1px solid #dcdfe4;
	text-align: left;
}

/* ==========================================================================
   Utilidades
   ========================================================================== */

.contenedor {
	width: min(100% - 2rem, var(--ancho-contenedor));
	margin-inline: auto;
}

.contenedor--estrecho {
	width: min(100% - 2rem, var(--ancho-lectura));
}

/* Textos descriptivos: párrafos y descripciones que acompañan a un título.
   Nunca se aplica a títulos, botones, enlaces, menús ni etiquetas, que usan
   siempre la fuente principal del body. */
.texto-descriptivo {
	font-family: var(--fuente-parrafos);
	color: var(--color-texto);
}

/* Contenedor del contenido largo (the_content) de páginas y entradas. */
.contenido-texto {
	max-width: var(--ancho-lectura);
}

.contenido-texto > *:last-child {
	margin-bottom: 0;
}

.sitio-principal {
	/* Empuja el pie al fondo en páginas cortas (body es flex column). */
	flex: 1 0 auto;
}

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

.skip-link {
	position: absolute;
	top: -100px;
	left: 1rem;
	z-index: 999999;
	padding: 0.75rem 1rem;
	background: var(--color-secundario);
	color: #ffffff;
	font-weight: 700;
	text-decoration: none;
	border-radius: var(--radio);
}

.skip-link:focus {
	top: 1rem;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	color: #ffffff;
}

:focus-visible {
	outline: 3px solid var(--color-principal);
	outline-offset: 2px;
}

.boton,
button,
input[type='submit'] {
	display: inline-block;
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: var(--radio);
	background: var(--color-principal);
	color: #ffffff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.boton:hover,
.boton:focus,
button:hover,
button:focus,
input[type='submit']:hover,
input[type='submit']:focus {
	background: var(--color-secundario);
	color: #ffffff;
}

/* ==========================================================================
   Cabecera
   ========================================================================== */

.titulo-sitio {
	margin: 0;
	font-family: var(--fuente-principal);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
}

.titulo-sitio a {
	color: var(--color-secundario);
	text-decoration: none;
}

.logo-sitio {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.logo-sitio picture {
	display: block;
}

.logo-sitio img {
	width: auto;
	max-height: 64px;
}

.menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu a {
	display: inline-block;
	padding: 0.35rem 0;
	color: var(--color-secundario);
	font-weight: 600;
	text-decoration: none;
}

.menu a:hover,
.menu a:focus,
.menu .current-menu-item > a,
.menu .current_page_item > a {
	color: var(--color-principal);
}

/* ==========================================================================
   Migas de pan
   ========================================================================== */

.migas-de-pan {
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
}

.migas-de-pan ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.migas-de-pan li {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.migas-de-pan a {
	color: var(--color-secundario);
	text-decoration: none;
}

.migas-de-pan a:hover,
.migas-de-pan a:focus {
	color: var(--color-principal);
	text-decoration: underline;
}

.migas-de-pan [aria-current='page'] {
	color: #5c6673;
}

.migas-de-pan__separador {
	color: #9aa3ad;
}

/* ==========================================================================
   Entradas y archivos
   ========================================================================== */

.cabecera-archivo {
	margin-bottom: 2rem;
	margin-top: 2rem;
}

.titulo-archivo,
.titulo-entrada {
	margin-bottom: 0.75rem;
	overflow-wrap: anywhere;
}

.descripcion-archivo {
	max-width: var(--ancho-lectura);
	color: #555f6b;
}

.listado-entradas {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 2rem;
	padding-bottom: 20px;
	padding-top: 20px;
}

.entrada {
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #e6e8eb;
}

.entrada__miniatura {
	display: block;
	margin-bottom: 1rem;
	overflow: hidden;
	border-radius: var(--radio);
	background: #f2f3f5;
}

.entrada__miniatura img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.entrada__miniatura:hover img,
.entrada__miniatura:focus img {
	transform: scale(1.03);
}

.entrada__titulo {
	margin-bottom: 0.35rem;
}

.entrada__titulo a {
	color: var(--color-secundario);
	text-decoration: none;
}

.entrada__titulo a:hover,
.entrada__titulo a:focus {
	color: var(--color-principal);
}

.entrada__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.5rem;
	margin-bottom: 0.75rem;
	color: #5c6673;
	font-size: 0.9rem;
}

.entrada__meta a {
	color: inherit;
	text-decoration: none;
}

.entrada__meta a:hover,
.entrada__meta a:focus {
	color: var(--color-principal);
	text-decoration: underline;
}

.entrada__resumen p:last-child {
	margin-bottom: 0;
}

.entrada__destacada {
	margin-bottom: 2rem;
}

.entrada__destacada img {
	width: 100%;
	border-radius: var(--radio);
}

.entrada__contenido {
	color: var(--color-texto);
}

.entrada__contenido > *:first-child {
	margin-top: 0;
}

.entrada__contenido h2,
.entrada__contenido h3,
.entrada__contenido h4 {
	margin-top: 1.75em;
}

.entrada__contenido a {
	text-decoration: underline;
}

.entrada__pie {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid #e6e8eb;
	font-size: 0.95rem;
}

.entrada__etiquetas a {
	color: var(--color-secundario);
}

.nav-entrada__etiqueta {
	display: block;
	color: #5c6673;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.nav-entrada__titulo {
	display: block;
	font-family: var(--fuente-principal);
	font-size: 1.15rem;
	font-weight: 700;
}

.post-navigation .nav-links {
	display: grid;
	gap: 1rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e6e8eb;
}

.post-navigation a {
	color: var(--color-secundario);
	text-decoration: none;
}

.post-navigation a:hover,
.post-navigation a:focus {
	color: var(--color-principal);
}

/* ==========================================================================
   Paginación
   ========================================================================== */

.pagination,
.paginacion-enlaces {
	margin-top: 2.5rem;
	font-size: 0.95rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0.35rem 0.6rem;
	border: 1px solid #d7dbe0;
	border-radius: var(--radio);
	color: var(--color-secundario);
	text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers:focus,
.pagination .current {
	border-color: var(--color-principal);
	background: var(--color-principal);
	color: #ffffff;
}

.screen-reader-text.pagination {
	margin: 0;
}

/* ==========================================================================
   Formularios
   ========================================================================== */

input[type='text'],
input[type='email'],
input[type='url'],
input[type='search'],
input[type='password'],
input[type='tel'],
input[type='number'],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 0.65rem 0.8rem;
	border: 1px solid #c9ced4;
	border-radius: var(--radio);
	background: #ffffff;
	color: var(--color-texto);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
}

textarea {
	min-height: 140px;
	resize: vertical;
}

label {
	font-weight: 600;
}

.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 560px;
	margin-bottom: 2rem;
}

.search-form label {
	flex: 1 1 auto;
	margin: 0;
}

.search-form .search-field {
	width: 100%;
}

.search-form .search-submit {
	flex: 0 0 auto;
}

/* ==========================================================================
   Comentarios
   ========================================================================== */

.comments-area {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid #e6e8eb;
}

.comment-list {
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	margin: 1rem 0 0;
	padding-left: 1.25rem;
	list-style: none;
}

.comment-body {
	margin-bottom: 1.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #e6e8eb;
}

.comment-meta {
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
}

.comment-author img {
	display: inline-block;
	margin-right: 0.5rem;
	border-radius: 50%;
	vertical-align: middle;
}

.comment-form p {
	margin-bottom: 1rem;
}

/* ==========================================================================
   Página 404
   ========================================================================== */

.pagina-404 {
	padding-block: 2rem;
}

.pagina-404 .search-form {
	margin-top: 1.5rem;
}

/* ==========================================================================
   Alineaciones y bloques básicos
   ========================================================================== */

.alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	color: #5c6673;
	font-size: 0.9rem;
	text-align: center;
}

.sticky {
	position: relative;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
	.listado-entradas {
		gap: 1.5rem;
	}

	.search-form {
		flex-direction: column;
	}

	.pie-sitio__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.entrada__miniatura:hover img,
	.entrada__miniatura:focus img {
		transform: none;
	}
}
