/**
 * Liceo Cookies – Frontend styles
 *
 * Paleta: tricolor francesa (azul #002395, rojo #ED2939, blanco #FFFFFF).
 * Conforme al sitio lfcyl.org (Lycée Français International Castilla y León).
 *
 * RGPD (Guía AEPD 2024):
 *  - Botones Aceptar/Rechazar con MISMO peso visual (misma clase .lcb-btn--action).
 *  - No se usa ningún "dark pattern" que empuje al usuario a aceptar.
 *
 * @package LiceoCookies
 */

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
	--lcb-blue:       #002395;   /* Azul bandera francesa */
	--lcb-blue-dark:  #001a70;
	--lcb-blue-light: #e8ecf8;
	--lcb-red:        #ED2939;   /* Rojo bandera francesa */
	--lcb-white:      #ffffff;
	--lcb-text:       #1a1a2e;
	--lcb-text-muted: #555566;
	--lcb-border:     #d0d5e8;
	--lcb-shadow:     0 8px 32px rgba(0, 35, 149, 0.18);
	--lcb-radius:     12px;
	--lcb-z:          999999;
	--lcb-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Banner overlay (posición: esquina inferior derecha) ──────────────────── */
.lcb-overlay {
	position:   fixed;
	bottom:     1.5rem;
	right:      1.5rem;
	z-index:    var(--lcb-z);
	max-width:  420px;
	width:      calc(100vw - 3rem);
	font-family: var(--lcb-font);
	line-height: 1.5;
}

.lcb-overlay[hidden] {
	display: none !important;
}

/* ── Banner card ─────────────────────────────────────────────────────────── */
.lcb-banner {
	background:    var(--lcb-white);
	border-radius: var(--lcb-radius);
	box-shadow:    var(--lcb-shadow);
	/* Barra superior azul como señal visual del origen institucional */
	border-top:    4px solid var(--lcb-blue);
	overflow:      hidden;
	animation:     lcbFadeUp 0.28s ease both;
}

@keyframes lcbFadeUp {
	from { transform: translateY(16px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* ── Banner header ────────────────────────────────────────────────────────── */
.lcb-banner__header {
	display:         flex;
	align-items:     center;
	gap:             .5rem;
	padding:         1rem 1.25rem .5rem;
	color:           var(--lcb-blue);
	font-weight:     700;
	font-size:       .95rem;
	letter-spacing:  .01em;
}

.lcb-icon {
	width:  18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--lcb-red);
}

/* ── Banner body ─────────────────────────────────────────────────────────── */
.lcb-banner__body {
	padding:    0 1.25rem .75rem;
	font-size:  .855rem;
	color:      var(--lcb-text-muted);
}

.lcb-banner__body a {
	color:           var(--lcb-blue);
	text-decoration: underline;
}

.lcb-banner__body a:hover {
	color: var(--lcb-blue-dark);
}

/* ── Separador decorativo tricolor ──────────────────────────────────────────
   Guiño visual al Lycée Français. Delgada línea azul-blanco-rojo.          */
.lcb-banner__actions {
	border-top:  1px solid var(--lcb-border);
	padding:     .875rem 1.25rem 1.125rem;
	display:     flex;
	gap:         .5rem;
	flex-wrap:   wrap;
	align-items: center;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.lcb-btn {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	padding:         .45rem 1rem;
	border-radius:   6px;
	font-family:     var(--lcb-font);
	font-size:       .82rem;
	font-weight:     600;
	cursor:          pointer;
	text-decoration: none;
	white-space:     nowrap;
	transition:      background 0.15s, color 0.15s, box-shadow 0.15s;
	line-height:     1.3;
	border:          2px solid transparent;
}

/*
 * .lcb-btn--action: clase compartida por Aceptar Y Rechazar.
 * Igual color, igual tamaño, igual contraste.
 * RGPD Guía AEPD: "el color o contraste de los botones no podrá ser
 * obviamente engañoso para los usuarios".
 */
.lcb-btn--action {
	background:   var(--lcb-blue);
	color:        var(--lcb-white);
	border-color: var(--lcb-blue);
}

.lcb-btn--action:hover,
.lcb-btn--action:focus-visible {
	background:   var(--lcb-blue-dark);
	border-color: var(--lcb-blue-dark);
	outline:      none;
	box-shadow:   0 0 0 3px rgba(0, 35, 149, .25);
}

/* Enlace "Más información" – sutil, no compite con los botones de acción */
.lcb-btn--link {
	background:   transparent;
	color:        var(--lcb-text-muted);
	border-color: transparent;
	font-weight:  500;
	font-size:    .78rem;
	padding-left: .25rem;
	text-decoration: underline;
}

.lcb-btn--link:hover {
	color: var(--lcb-blue);
}

/* ── Pestaña flotante (esquina inferior izquierda) ───────────────────────── */
.lcb-tab {
	position:    fixed;
	bottom:      1.5rem;
	left:        1.5rem;
	z-index:     var(--lcb-z);
	background:  var(--lcb-blue);
	color:       var(--lcb-white);
	border:      none;
	border-radius: 50px;
	padding:     .45rem .9rem;
	font-family: var(--lcb-font);
	font-size:   .78rem;
	font-weight: 600;
	cursor:      pointer;
	display:     flex;
	align-items: center;
	gap:         .35rem;
	box-shadow:  0 4px 14px rgba(0, 35, 149, .35);
	transition:  transform 0.15s, box-shadow 0.15s;
	line-height: 1;
}

.lcb-tab:hover,
.lcb-tab:focus-visible {
	transform:  translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 35, 149, .45);
	outline:    none;
}

.lcb-tab[hidden] {
	display: none !important;
}

/* ── Placeholders de embeds bloqueados (RGPD) ────────────────────────────
   Sustituyen a los iframes de YouTube/Maps hasta obtener consentimiento.
   El JS los convierte en iframes reales al aceptar cookies.              */

.lcb-embed-placeholder {
	position:      relative;
	display:       block;
	overflow:      hidden;
	border-radius: 6px;
	background:    #0d0d0d;
	max-width:     100%;
}

/* WPBakery envuelve los vídeos en .wpb_video_wrapper con height:0 +
   padding-bottom:56.25% y espera que el iframe sea position:absolute.
   Sin esto, el placeholder desborda la columna con su ancho fijo. */
.wpb_video_wrapper .lcb-embed-placeholder {
	position:      absolute !important;
	inset:         0 !important;
	width:         100% !important;
	height:        100% !important;
	border-radius: 0;
}

.lcb-embed-youtube .lcb-embed-thumb {
	position:   absolute;
	inset:      0;
	width:      100%;
	height:     100%;
	object-fit: cover;
	opacity:    .45;
}

.lcb-embed-maps {
	background: var(--lcb-blue-light);
}

.lcb-embed-overlay {
	position:        absolute;
	inset:           0;
	display:         flex;
	align-items:     center;
	justify-content: center;
}

.lcb-embed-youtube .lcb-embed-overlay {
	background: rgba( 0, 0, 0, 0.55 );
}

.lcb-embed-maps .lcb-embed-overlay {
	background: rgba( 0, 35, 149, 0.12 );
}

.lcb-embed-message {
	text-align:  center;
	padding:     1.5rem;
	max-width:   320px;
	font-family: var( --lcb-font );
}

.lcb-embed-youtube .lcb-embed-message {
	color: var( --lcb-white );
}

.lcb-embed-maps .lcb-embed-message {
	color: var( --lcb-blue );
}

.lcb-embed-message svg {
	display:       block;
	margin:        0 auto .75rem;
	opacity:       .9;
}

.lcb-embed-youtube .lcb-embed-message svg {
	color: #ff0000;
}

.lcb-embed-maps .lcb-embed-message svg {
	color: var( --lcb-blue );
}

.lcb-embed-message p {
	margin:      0 0 1rem;
	font-size:   .85rem;
	line-height: 1.5;
}

.lcb-embed-consent-btn {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	padding:         .5rem 1.25rem;
	border:          none;
	border-radius:   6px;
	font-family:     var( --lcb-font );
	font-size:       .82rem;
	font-weight:     600;
	cursor:          pointer;
	transition:      background 0.15s, box-shadow 0.15s;
	line-height:     1.3;
	background:      var( --lcb-blue );
	color:           var( --lcb-white );
}

.lcb-embed-consent-btn:hover,
.lcb-embed-consent-btn:focus-visible {
	background: var( --lcb-blue-dark );
	box-shadow: 0 0 0 3px rgba( 0, 35, 149, .3 );
	outline:    none;
}


/* ── Contenido legal embebido via shortcode ─────────────────────────────── */
.lcb-legal-content {
	font-size:   .95rem;
	line-height: 1.7;
	color:       #333;
}

.lcb-legal-content table {
	width:           100%;
	border-collapse: collapse;
	margin:          1.25em 0;
	font-size:       .88rem;
}

.lcb-legal-content th,
.lcb-legal-content td {
	padding:     .65rem .9rem;
	text-align:  left;
	vertical-align: top;
	border-bottom: 1px solid #e0e4f0;
}

.lcb-legal-content th {
	background:  var(--lcb-blue);
	color:       var(--lcb-white);
	font-weight: 600;
}

.lcb-legal-content tr:nth-child(odd) td {
	background: #f4f6fb;
}

.lcb-legal-content tr:nth-child(even) td {
	background: #ffffff;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
	.lcb-overlay {
		bottom:    0;
		right:     0;
		left:      0;
		max-width: 100%;
		width:     100%;
	}

	.lcb-banner {
		border-radius: var(--lcb-radius) var(--lcb-radius) 0 0;
	}

	.lcb-banner__actions {
		flex-direction: column;
	}

	.lcb-btn--action {
		width: 100%;
		justify-content: center;
	}
}

/* ── Accesibilidad: reducción de movimiento ─────────────────────────────── */
@media ( prefers-reduced-motion: reduce ) {
	.lcb-banner {
		animation: none;
	}
	.lcb-tab {
		transition: none;
	}
}
