/*
Theme Name:        Recupera
Description:       Tema sobrio y accesible pensado para el plugin "Recupera – Control de adicciones con gamificación". Barra de ayuda permanente, portada configurable, plantilla de panel sin distracciones e inicio de sesión con la misma imagen.
Version:           1.0.0
Requires at least: 6.0
Requires PHP:      8.0
Author:            Alberto Pérez Velázquez
License:           GPL-2.0-or-later
Text Domain:       recupera-tema
Tags:              one-column, custom-logo, custom-menu, accessibility-ready, translation-ready
*/

:root {
	--rt-texto: #1f2933;
	--rt-suave: #616e7c;
	--rt-borde: #e4e7eb;
	--rt-fondo: #ffffff;
	--rt-fondo2: #f5f7fa;
	--rt-acento: #2f6f5e;
	--rt-acento-osc: #24574a;
	--rt-acento2: #e3f1ec;
	--rt-alerta: #b54708;
	--rt-ancho: 1080px;
	--rt-lectura: 720px;
	--rt-radio: 8px;
	--rt-fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
	margin: 0;
	font-family: var(--rt-fuente);
	font-size: 17px;
	line-height: 1.65;
	color: var(--rt-texto);
	background: var(--rt-fondo);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

img, video, iframe { max-width: 100%; height: auto; }

a { color: var(--rt-acento); text-underline-offset: 2px; }
a:hover { color: var(--rt-acento-osc); }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p, ul, ol, blockquote, figure { margin: 0 0 1.1em; }

blockquote {
	border-left: 3px solid var(--rt-acento);
	padding: .2em 0 .2em 1.1em;
	color: var(--rt-suave);
	font-style: italic;
}

hr { border: 0; border-top: 1px solid var(--rt-borde); margin: 2rem 0; }

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

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.rt-saltar:focus {
	position: fixed; top: .5rem; left: .5rem; z-index: 100001;
	width: auto; height: auto; clip: auto;
	background: #fff; padding: .6rem 1rem; border-radius: var(--rt-radio);
}

.rt-contenedor { width: 100%; max-width: var(--rt-ancho); margin: 0 auto; padding: 0 1.25rem; }
.rt-lectura { max-width: var(--rt-lectura); }
.rt-main { flex: 1; padding: 2.5rem 0 3.5rem; }

/* ------------------------------------------------------------ Botones */
.rt-btn, .wp-block-button__link, input[type=submit], button[type=submit] {
	display: inline-block;
	background: var(--rt-acento);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: .6rem 1.15rem;
	font: inherit;
	font-size: .95rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.rt-btn:hover, .wp-block-button__link:hover, input[type=submit]:hover, button[type=submit]:hover { background: var(--rt-acento-osc); color: #fff; }
.rt-btn--borde { background: transparent; color: var(--rt-acento); box-shadow: inset 0 0 0 1.5px var(--rt-acento); }
.rt-btn--borde:hover { background: var(--rt-acento2); color: var(--rt-acento-osc); }

/* ------------------------------------------------------ Barra de ayuda */
.rt-ayuda-barra {
	background: var(--rt-fondo2);
	border-bottom: 1px solid var(--rt-borde);
	font-size: .85rem;
	color: var(--rt-suave);
}
.rt-ayuda-barra .rt-contenedor { padding-top: .4rem; padding-bottom: .4rem; }
.rt-ayuda-barra strong { color: var(--rt-texto); }
.rt-ayuda-barra a { font-weight: 600; }

/* ----------------------------------------------------------- Cabecera */
.rt-cabecera { border-bottom: 1px solid var(--rt-borde); background: var(--rt-fondo); }
.rt-cabecera .rt-contenedor { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.rt-marca { display: flex; align-items: center; gap: .6rem; margin-right: auto; text-decoration: none; color: var(--rt-texto); }
.rt-marca:hover { color: var(--rt-texto); }
.rt-marca img { max-height: 44px; width: auto; }
.rt-marca__nombre { font-weight: 700; font-size: 1.15rem; }
.rt-marca__punto { width: 12px; height: 12px; border-radius: 50%; background: var(--rt-acento); flex: none; }

.rt-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; }
.rt-nav a { color: var(--rt-texto); text-decoration: none; font-size: .95rem; font-weight: 500; }
.rt-nav a:hover, .rt-nav .current-menu-item > a, .rt-nav .current_page_item > a { color: var(--rt-acento); }
.rt-nav ul ul { display: none; }

.rt-cuenta { display: flex; gap: .6rem; align-items: center; }
.rt-cuenta .rt-btn { padding: .45rem .9rem; font-size: .9rem; }

.rt-menu-toggle {
	display: none; background: none; border: 1px solid var(--rt-borde); border-radius: 6px;
	padding: .4rem .65rem; font: inherit; font-size: .9rem; cursor: pointer; color: var(--rt-texto);
}

/* ------------------------------------------------------------ Portada */
.rt-hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--rt-borde); }
.rt-hero h1 { margin-top: 0; font-size: 2.6rem; max-width: 14em; }
.rt-hero p { font-size: 1.15rem; color: var(--rt-suave); max-width: 34em; }
.rt-hero__acciones { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.rt-rasgos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding: 3rem 0; }
.rt-rasgo { border: 1px solid var(--rt-borde); border-radius: var(--rt-radio); padding: 1.4rem; }
.rt-rasgo h2 { font-size: 1.1rem; margin: .8rem 0 .4rem; }
.rt-rasgo p { margin: 0; color: var(--rt-suave); font-size: .95rem; }
.rt-rasgo__marca {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--rt-acento2); color: var(--rt-acento);
	font-weight: 700; font-size: .85rem; border: 2px solid var(--rt-acento);
}

.rt-seccion-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1rem 0 1.25rem; }
.rt-seccion-titulo h2 { margin: 0; }

/* -------------------------------------------------------- Entradas */
.rt-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.rt-tarjeta { border: 1px solid var(--rt-borde); border-radius: var(--rt-radio); overflow: hidden; display: flex; flex-direction: column; }
.rt-tarjeta__img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.rt-tarjeta__cuerpo { padding: 1.1rem 1.25rem 1.3rem; }
.rt-tarjeta h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
.rt-tarjeta h2 a { color: var(--rt-texto); text-decoration: none; }
.rt-tarjeta h2 a:hover { color: var(--rt-acento); }
.rt-tarjeta p { color: var(--rt-suave); font-size: .95rem; margin: 0; }

.rt-meta { color: var(--rt-suave); font-size: .85rem; margin-bottom: .4rem; }

.rt-encabezado { margin-bottom: 2rem; }
.rt-encabezado h1 { margin: 0 0 .4rem; }
.rt-encabezado p { color: var(--rt-suave); margin: 0; }

.rt-destacada { margin: 0 0 2rem; }
.rt-destacada img { border-radius: var(--rt-radio); display: block; }

.rt-contenido > *:first-child { margin-top: 0; }
.rt-contenido .alignwide { max-width: calc(var(--rt-lectura) + 240px); }
.rt-contenido .alignleft { float: left; margin: .3em 1.5em 1em 0; }
.rt-contenido .alignright { float: right; margin: .3em 0 1em 1.5em; }
.rt-contenido .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-caption-text, figcaption { color: var(--rt-suave); font-size: .85rem; margin-top: .4rem; }

.rt-etiquetas { margin-top: 2rem; font-size: .9rem; color: var(--rt-suave); }

.rt-navegacion, .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rt-borde); font-size: .95rem; }
.page-numbers { padding: .3rem .65rem; border-radius: 6px; text-decoration: none; }
.page-numbers.current { background: var(--rt-acento); color: #fff; }

/* ------------------------------------------------------ Formularios */
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password], textarea, select {
	font: inherit; font-size: .95rem; padding: .5rem .7rem;
	border: 1px solid var(--rt-borde); border-radius: 6px; background: #fff; color: var(--rt-texto); max-width: 100%;
}
.rt-busqueda { display: flex; gap: .5rem; max-width: 480px; }
.rt-busqueda input[type=search] { flex: 1; }

/* -------------------------------------------------------- Comentarios */
.rt-comentarios { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rt-borde); }
.rt-comentarios ol { list-style: none; padding: 0; }
.rt-comentarios ol ol { padding-left: 1.5rem; }
.rt-comentarios .comment-body { border-bottom: 1px solid var(--rt-borde); padding: 1rem 0; }
.rt-comentarios .avatar { border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.rt-comentarios .comment-meta { font-size: .85rem; color: var(--rt-suave); }
.comment-form p { display: grid; gap: .25rem; }
.comment-form textarea { width: 100%; }

/* ------------------------------------------------- Plantilla de panel */
.rt-panel-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.rt-panel-cabecera h1 { margin: 0; font-size: 1.5rem; }
.rt-panel-cabecera p { margin: 0; color: var(--rt-suave); font-size: .9rem; }

/* -------------------------------------------------------------- Pie */
.rt-pie { background: var(--rt-fondo2); border-top: 1px solid var(--rt-borde); font-size: .9rem; color: var(--rt-suave); }
.rt-pie .rt-contenedor { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.rt-pie__cols { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.rt-pie h2, .rt-pie .widget-title { font-size: .95rem; color: var(--rt-texto); margin: 0 0 .6rem; }
.rt-pie ul { list-style: none; padding: 0; margin: 0; }
.rt-pie li { margin-bottom: .3rem; }
.rt-pie__aviso { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rt-borde); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rt-pie__aviso p { margin: 0; }
.rt-pie-menu ul { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------------------------------------------------------- 404 */
.rt-404 { text-align: center; padding: 3rem 0; }
.rt-404 .rt-busqueda { margin: 1.5rem auto; }

/* ---------------------------------------------------------- Móvil */
@media (max-width: 820px) {
	.rt-menu-toggle { display: inline-block; }
	.rt-cabecera .rt-contenedor { flex-wrap: wrap; gap: .75rem; padding-top: .6rem; padding-bottom: .6rem; }
	.rt-nav { display: none; order: 3; width: 100%; }
	.rt-nav.abierto { display: block; }
	.rt-nav ul { flex-direction: column; gap: 0; padding: .5rem 0; }
	.rt-nav a { display: block; padding: .55rem 0; border-top: 1px solid var(--rt-borde); }
	.rt-cuenta { order: 2; }
	.rt-hero { padding: 2.5rem 0 2rem; }
	.rt-hero h1 { font-size: 2rem; }
	.rt-rasgos { grid-template-columns: 1fr; }
	.rt-pie__cols { grid-template-columns: 1fr; }
	.rt-panel-cabecera { flex-direction: column; align-items: flex-start; }
}

@media print {
	.rt-ayuda-barra, .rt-cabecera, .rt-pie, .rcp-sos { display: none; }
}
