/*
Theme Name: RR Agenda App Shell
Theme URI: https://tuapp.click
Author: RR Digital / Rafa
Description: Tema liviano tipo app-shell para Agenda Ministerial. Minimalista, responsive, compatible con satélites WordPress/PHP y orientado a Android/iPhone.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rr-agenda-app-shell
*/

/* Base segura */
:root{
	--rr-bg:#f6f7f6;
	--rr-card:#ffffff;
	--rr-text:#101828;
	--rr-muted:#667085;
	--rr-line:#e6e8eb;
	--rr-green:#0B5F33;
	--rr-green-soft:#e8f5ee;
	--rr-radius:20px;
	--rr-safe-bottom:env(safe-area-inset-bottom,0px);
	--rr-safe-top:env(safe-area-inset-top,0px);
}

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

html{
	margin:0;
	padding:0;
	min-height:100%;
	background:var(--rr-bg);
	-webkit-text-size-adjust:100%;
	text-size-adjust:100%;
	overflow-x:hidden;
}

body{
	margin:0;
	padding:0;
	min-height:100%;
	background:var(--rr-bg);
	color:var(--rr-text);
	font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
	font-size:16px;
	line-height:1.5;
	overflow-x:hidden;
	-webkit-font-smoothing:antialiased;
	text-rendering:optimizeLegibility;
}

a{
	color:var(--rr-green);
	text-decoration:none;
}

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

button,
input,
select,
textarea{
	font:inherit;
	max-width:100%;
}

button,
a,
input,
select,
textarea{
	-webkit-tap-highlight-color:transparent;
}

button,
input[type="button"],
input[type="submit"]{
	touch-action:manipulation;
}

.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;
}

/* Sitio normal, por si el tema se usa en páginas externas */
.rr-theme-site{
	min-height:100vh;
	background:var(--rr-bg);
}

.rr-theme-header{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:16px;
	padding:22px clamp(18px,4vw,48px);
	background:#fff;
	border-bottom:1px solid var(--rr-line);
}

.rr-theme-brand{
	color:var(--rr-text);
	font-size:18px;
	font-weight:800;
	letter-spacing:-.01em;
}

.rr-theme-main{
	width:min(1120px,100%);
	margin:0 auto;
	padding:clamp(18px,4vw,48px);
}

.rr-theme-article{
	background:#fff;
	border:1px solid var(--rr-line);
	border-radius:var(--rr-radius);
	padding:clamp(18px,4vw,38px);
	box-shadow:0 8px 26px rgba(16,24,40,.04);
}

.rr-theme-title{
	margin:0 0 14px;
	font-size:clamp(28px,4vw,44px);
	line-height:1.12;
	letter-spacing:-.03em;
}

.rr-theme-content > *:first-child{
	margin-top:0;
}

.rr-theme-content > *:last-child{
	margin-bottom:0;
}

.rr-theme-footer{
	padding:24px clamp(18px,4vw,48px);
	color:var(--rr-muted);
	font-size:13px;
	text-align:center;
}

/* App Shell: página limpia para satélites */
html.rr-app-html,
body.rr-theme-app-shell{
	width:100%;
	min-width:0;
	min-height:100svh;
	background:var(--rr-bg);
	overflow:hidden;
	overscroll-behavior:none;
}

body.rr-theme-app-shell{
	position:relative;
	padding:0;
	margin:0;
	color:var(--rr-text);
}

/* Nada de chrome del tema en modo app */
body.rr-theme-app-shell .rr-theme-header,
body.rr-theme-app-shell .rr-theme-footer,
body.rr-theme-app-shell .rr-theme-title,
body.rr-theme-app-shell .edit-link,
body.rr-theme-app-shell .post-edit-link,
body.rr-theme-app-shell #wpadminbar{
	display:none!important;
}

body.rr-theme-app-shell.admin-bar{
	margin-top:0!important;
	padding-top:0!important;
}

body.rr-theme-app-shell .rr-theme-site,
body.rr-theme-app-shell .rr-theme-main,
body.rr-theme-app-shell .rr-theme-article,
body.rr-theme-app-shell .rr-theme-content,
body.rr-theme-app-shell .entry-content{
	width:100vw!important;
	max-width:100vw!important;
	min-width:0!important;
	min-height:100svh;
	margin:0!important;
	padding:0!important;
	border:0!important;
	border-radius:0!important;
	box-shadow:none!important;
	background:var(--rr-bg)!important;
	overflow:hidden!important;
}

body.rr-theme-app-shell .rr-theme-content > *{
	max-width:none!important;
	margin-left:0!important;
	margin-right:0!important;
}

/* Área de plugins: evita corte lateral sin pelear con los plugins */
body.rr-theme-app-shell #rr-mps-app{
	width:100vw;
	max-width:100vw;
	min-height:100svh;
	overflow-x:hidden;
}

body.rr-theme-app-shell #rr-maf-app{
	position:fixed!important;
	width:0!important;
	height:0!important;
	inset:0 auto auto 0!important;
	overflow:visible!important;
	pointer-events:none!important;
	z-index:99980!important;
}

/* Controles táctiles globales para satélites */
body.rr-theme-app-shell #rr-mps-app button,
body.rr-theme-app-shell #rr-mps-app a,
body.rr-theme-app-shell #rr-mps-app input,
body.rr-theme-app-shell #rr-mps-app select,
body.rr-theme-app-shell #rr-mps-app textarea{
	font-size:16px;
}

body.rr-theme-app-shell #rr-mps-app button,
body.rr-theme-app-shell #rr-mps-app a{
	min-height:44px;
}

/* iPhone/Android: estabilidad de viewport y scroll */
@supports(height:100dvh){
	html.rr-app-html,
	body.rr-theme-app-shell,
	body.rr-theme-app-shell .rr-theme-main,
	body.rr-theme-app-shell .rr-theme-content,
	body.rr-theme-app-shell #rr-mps-app{
		min-height:100dvh;
	}
}

@media(max-width:900px),(pointer:coarse){
	body.rr-theme-app-shell{
		height:100svh;
	}

	body.rr-theme-app-shell .rr-theme-main,
	body.rr-theme-app-shell .rr-theme-content{
		height:100svh;
	}

	body.rr-theme-app-shell #rr-mps-app{
		height:100svh;
		touch-action:manipulation;
	}

	body.rr-theme-app-shell input,
	body.rr-theme-app-shell select,
	body.rr-theme-app-shell textarea{
		font-size:16px!important;
	}
}

/* Página sin plugin: fallback claro */
.rr-theme-empty-app{
	min-height:100svh;
	display:grid;
	place-items:center;
	padding:24px;
	background:var(--rr-bg);
}

.rr-theme-empty-card{
	width:min(520px,100%);
	background:#fff;
	border:1px solid var(--rr-line);
	border-radius:24px;
	padding:28px;
	box-shadow:0 12px 34px rgba(16,24,40,.08);
}

.rr-theme-empty-card h1{
	margin:0 0 8px;
	font-size:28px;
	line-height:1.15;
}

.rr-theme-empty-card p{
	margin:0;
	color:var(--rr-muted);
}
