/*
Theme Name:   GeneratePress Child - Webcams
Theme URI:    https://tudominio.com
Description:  Child theme de GeneratePress optimizado para webcams de playas. Cero plugins SEO, Modo Oscuro nativo, Core Web Vitals al máximo.
Author:       Tu Nombre
Template:     generatepress
Version:      1.1.0
Text Domain:  gp-webcams
*/

/* =========================================================
   1. VARIABLES (Soporte Light & Dark)
   ========================================================= */
:root {
	/* Tema Claro (Por defecto) */
	--gp-bg: #f8f9fa; /* Gris ultra claro para destacar las tarjetas blancas */
	--gp-text: #1a1a1a;
	--gp-muted: #666666;
	--gp-border: #e7e7e7;
	--gp-card-bg: #ffffff;
	--gp-accent: #1877F2;
	--gp-live: #e00000; /* Rojo alerta para el En Vivo */
	
	/* Medidas Universales */
	--gp-radius: 14px;
	--gp-radius-sm: 10px;
	--gp-shadow: 0 4px 18px rgba(0, 0, 0, .04);
	--gp-shadow-hover: 0 8px 24px rgba(0, 0, 0, .08);
	--gp-maxw: 1280px;
}

/* Magia de Retención: Modo Oscuro Automático */
@media (prefers-color-scheme: dark) {
	:root {
		--gp-bg: #121212;
		--gp-text: #e4e4e4;
		--gp-muted: #a0a0a0;
		--gp-border: #2a2a2a;
		--gp-card-bg: #1e1e1e;
		--gp-shadow: 0 4px 18px rgba(0, 0, 0, .3);
		--gp-shadow-hover: 0 8px 24px rgba(0, 0, 0, .5);
	}
}

/* =========================================================
   2. RESET LIGERO + TIPOGRAFÍA BASE
   ========================================================= */
html {
	scroll-behavior: smooth;
	text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--gp-bg);
	color: var(--gp-text);
	/* Tipografía del sistema operativo del usuario = Carga en 0ms */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	transition: background-color 0.3s ease, color 0.3s ease;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--gp-accent);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

a:hover {
	opacity: 0.85;
	text-decoration: underline;
}

/* =========================================================
   3. ANIMACIÓN "EN DIRECTO" (Cero JS)
   ========================================================= */
.gp-live-indicator {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--gp-live);
	font-weight: 700;
	font-size: 0.85em;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	vertical-align: middle;
}

.gp-live-indicator::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	background-color: var(--gp-live);
	border-radius: 50%;
	animation: gp-pulse 1.5s infinite ease-in-out;
}

@keyframes gp-pulse {
	0% { transform: scale(0.85); opacity: 1; }
	50% { transform: scale(1.3); opacity: 0.4; }
	100% { transform: scale(0.85); opacity: 1; }
}

/* =========================================================
   4. BLOQUE "CÁMARAS RELACIONADAS"
   ========================================================= */
.webcam-related {
	margin: 48px 0 0;
	padding-top: 32px;
	border-top: 1px solid var(--gp-border);
}

.webcam-related__title {
	margin: 0 0 20px;
	font-size: 1.4rem;
	line-height: 1.2;
}

/* =========================================================
   5. ACCESIBILIDAD Y PERFORMANCE
   ========================================================= */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

iframe {
	max-width: 100%;
}

/* Scrollbar minimalista para Desktop */
::-webkit-scrollbar {
	width: 8px;
}
::-webkit-scrollbar-track {
	background: var(--gp-bg); 
}
::-webkit-scrollbar-thumb {
	background: var(--gp-muted); 
	border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
	background: var(--gp-accent); 
}

/* =========================================================
   6. RESPONSIVE Y PRINT
   ========================================================= */
@media (max-width: 600px) {
	body {
		font-size: 16px;
	}
}

@media print {
	.webcam-share,
	.webcam-related,
	.gp-pagination,
	.gp-searchform,
	header,
	footer {
		display: none !important;
	}
}



/* =========================================================
   7. DISEÑO TUBE: REJILLA DE 2 COLUMNAS (CONTENIDO + SIDEBAR)
   ========================================================= */
.gp-two-columns-layout {
	display: grid;
	grid-template-columns: 1fr 300px; /* 300px fijos para el estándar internacional de banners */
	gap: 30px;
	align-items: start;
}

/* Estilos de los módulos internos del sidebar */
.sidebar-box {
	background: var(--gp-card-bg);
	border: 1px solid var(--gp-border);
	border-radius: var(--gp-radius);
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: var(--gp-shadow);
}

.sidebar-box__title {
	margin: 0 0 15px;
	font-size: 1.1rem;
	font-weight: 700;
	border-bottom: 2px solid var(--gp-border);
	padding-bottom: 5px;
	color: var(--gp-text);
}

/* Listado de cámaras miniatura */
.sidebar-item {
	display: flex;
	gap: 12px;
	margin-bottom: 14px;
	text-decoration: none;
	color: inherit;
	align-items: center;
}
.sidebar-item:last-child { margin-bottom: 0; }
.sidebar-item:hover .sidebar-item__title { color: var(--gp-accent); text-decoration: underline; }

.sidebar-item__thumb {
	width: 85px;
	aspect-ratio: 16 / 9;
	background: #222;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
}
.sidebar-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-item__placeholder { display:grid; place-items:center; width:100%; height:100%; background:#333; color:#aaa; font-size:0.75rem; }

.sidebar-item__body { flex: 1; }
.sidebar-item__title { margin: 0 0 2px; font-size: 0.88rem; line-height: 1.3; font-weight: 600; color: var(--gp-text); }
.sidebar-item__meta { font-size: 0.78rem; color: var(--gp-muted); display: block; }

/* EL TRUCO DEL DINERO: Banner flotante persistente */
.is-sticky-ad {
	position: -webkit-sticky;
	position: sticky;
	top: 24px; /* Se queda clavado a 24px del borde superior al bajar */
	z-index: 10;
}

/* Responsivo: En tablets o móviles el sidebar cae ordenadamente abajo */
@media (max-width: 992px) {
	.gp-two-columns-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.is-sticky-ad {
		position: static; /* Desactivamos el flotante en móvil para que no estorbe la navegación */
	}
}




/* =========================================================
   8. HEADER Y FOOTER (TUBE STYLE)
   ========================================================= */

/* --- HEADER --- */
.gp-site-header {
	background: var(--gp-card-bg);
	border-bottom: 1px solid var(--gp-border);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.gp-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px !important;
	gap: 20px;
}

/* Logo */
.gp-logo-text { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; color: var(--gp-text); }

/* Menú PC */
.gp-nav-list { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.gp-nav-list a { color: var(--gp-text); font-weight: 600; font-size: 0.95rem; }
.gp-nav-list a:hover { color: var(--gp-accent); text-decoration: none; }

/* Buscador Compacto */
.gp-header-search-compact form { display: flex; position: relative; width: 280px; }
.gp-header-search-compact input { width: 100%; padding: 8px 40px 8px 16px; border-radius: 20px; border: 1px solid var(--gp-border); background: var(--gp-bg); color: var(--gp-text); font-size: 0.95rem; transition: border-color 0.2s; }
.gp-header-search-compact input:focus { outline: none; border-color: var(--gp-accent); }
.gp-header-search-compact button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--gp-muted); cursor: pointer; padding: 4px 8px; }
.gp-header-search-compact button:hover { color: var(--gp-accent); }

/* --- FOOTER --- */
.gp-site-footer {
	background: var(--gp-card-bg);
	border-top: 1px solid var(--gp-border);
	padding: 40px 0;
	margin-top: 40px;
	text-align: center;
}

.gp-footer-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0 0 20px 0; padding: 0; }
.gp-footer-list a { color: var(--gp-text); font-weight: 500; font-size: 0.9rem; }
.gp-footer-list a:hover { color: var(--gp-accent); }
.gp-footer-copy { color: var(--gp-muted); font-size: 0.85rem; line-height: 1.5; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
	/* Ocultamos menú en móvil */
	.gp-header-nav { display: none; }
	
	/* Logo y buscador se reparten el espacio */
	.gp-header-inner { gap: 12px; padding: 10px 16px !important; }
	.gp-logo-text { font-size: 1.25rem; }
	.gp-header-search-compact form { width: 100%; max-width: none; }
	
	/* El Footer se apila en columnas fáciles de tocar */
	.gp-footer-list { flex-direction: column; gap: 12px; }
	.gp-footer-list a { display: block; padding: 10px; background: var(--gp-bg); border-radius: 8px; border: 1px solid var(--gp-border); }
}


