/*
 * Páginas de captura de Detrás del Bar (/c/<slug>). Misma dirección que detrasdelbar.com,
 * "Barra de competencia": base #1E1D24, dorado como único acento, Barlow Condensed en mayúsculas,
 * radio 0, líneas de 1 px y la comanda del curso como momento firma. Móvil primero.
 *
 * Las clases lp-* se ponen en los bloques desde el editor (Avanzado → Clases CSS adicionales).
 * Diseño aprobado: herramientas/dd-crm/diseno/ (mockup).
 */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400-latin-v2.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600-latin-v2.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600-latin-v2.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700-latin-v2.woff2") format("woff2"); }

:root {
	--lp-base: #1E1D24;
	--lp-surface: #2B2A32;
	--lp-steel: #3A3846;
	--lp-cream: #F2EDE8;
	--lp-muted: #B9B2AB;
	--lp-gold: #D4A54B;
	--lp-risk: #C8452D;
	--lp-display: "Barlow Condensed", "Arial Narrow", sans-serif;
	--lp-text: "Barlow", system-ui, sans-serif;
	--lp-gutter: clamp(1rem, 4vw, 3rem);
	--lp-ease: cubic-bezier(.2, .7, .1, 1);
	--lp-gap: clamp(3rem, 2rem + 4vw, 5rem);
}

/* La plantilla (front) y el lienzo del editor comparten el aspecto. */
body.ddcrm-landing, .editor-styles-wrapper {
	margin: 0;
	background: var(--lp-base);
	color: var(--lp-cream);
	font: 400 1.0625rem/1.6 var(--lp-text);
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
body.ddcrm-landing { overflow-x: clip; }
@media (prefers-reduced-motion: no-preference) { html:has(body.ddcrm-landing) { scroll-behavior: smooth; } }
.ddcrm-landing *, .ddcrm-landing *::before, .ddcrm-landing *::after { box-sizing: border-box; }
.ddcrm-landing img, .ddcrm-landing iframe { max-width: 100%; height: auto; }
.ddcrm-landing :focus-visible { outline: 2px solid var(--lp-gold); outline-offset: 3px; }
:is(.ddcrm-landing, .editor-styles-wrapper) :where(h1, h2, h3) { text-wrap: balance; margin: 0; color: var(--lp-cream); }
:is(.ddcrm-landing, .editor-styles-wrapper) :where(p, li) { text-wrap: pretty; overflow-wrap: break-word; }
:is(.ddcrm-landing, .editor-styles-wrapper) a:not(.wp-element-button) { color: var(--lp-cream); text-decoration: underline 2px var(--lp-gold); text-underline-offset: .25em; }
@media (hover: hover) and (pointer: fine) { .ddcrm-landing a:not(.wp-element-button):hover { color: var(--lp-gold); } }

/* ---------- Cabecera y pie (plantilla) ---------- */
.lp-head {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: max(.85rem, env(safe-area-inset-top)) var(--lp-gutter) .85rem;
	border-bottom: 1px solid var(--lp-steel);
}
.lp-head img { display: block; width: 128px; height: auto; }
.lp-head span { font: 600 .85rem/1 var(--lp-display); letter-spacing: .06em; text-transform: uppercase; color: var(--lp-muted); }
.lp-main { max-width: 72rem; margin-inline: auto; padding: 0 var(--lp-gutter) 1rem; }
.lp-main > * { margin-block: 0; }
.lp-main > * + * { margin-top: var(--lp-gap); }
.lp-foot {
	margin-top: var(--lp-gap);
	padding: 1.25rem var(--lp-gutter) max(1.25rem, env(safe-area-inset-bottom));
	border-top: 1px solid var(--lp-steel);
	font-size: .8rem; color: var(--lp-muted);
	display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between;
}
.lp-foot a { color: var(--lp-muted) !important; }

/* ---------- Tipografía ---------- */
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-tag { margin: 0 0 .9rem; font: 600 .95rem/1.2 var(--lp-display); letter-spacing: .06em; text-transform: uppercase; color: var(--lp-gold); }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-h1 { font: 700 clamp(2.6rem, 1.6rem + 5.2vw, 5.4rem)/.92 var(--lp-display); text-transform: uppercase; letter-spacing: .005em; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-h1 :is(em, mark, strong) { font-style: normal; font-weight: inherit; color: var(--lp-gold); background: none; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-h2 { font: 700 clamp(1.9rem, 1.4rem + 2.4vw, 3rem)/.95 var(--lp-display); text-transform: uppercase; max-width: 16ch; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-h3 { font: 700 1.6rem/1 var(--lp-display); text-transform: uppercase; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-lead { margin: 1.1rem 0 0; max-width: 38ch; color: var(--lp-muted); font-size: 1.125rem; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-lead strong { color: var(--lp-cream); font-weight: 600; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-muted { color: var(--lp-muted); }

/* ---------- Hero ---------- */
.lp-hero { padding-top: clamp(1.75rem, 1rem + 4vw, 4rem); }
.lp-hero > * { margin-block: 0; }

/* ---------- Doble marco dorado (bloque del curso y del formulario) ---------- */
.lp-frame { margin-top: 2rem; padding: 6px; border: 1px solid var(--lp-gold); }
.lp-frame > .lp-frame-in, .lp-frame-in { padding: 1.5rem 1.1rem 1.4rem; background: var(--lp-surface); border: 1px solid var(--lp-gold); }
.lp-frame-in > * { margin-block: 0; }
.lp-frame-in > * + * { margin-top: 1.25rem; }

/* ---------- Comanda: sale de la impresora al cargar ---------- */
.lp-impresora { max-width: 340px; margin-inline: auto; }
.lp-impresora::before { content: ""; display: block; height: 14px; position: relative; z-index: 2; border-top: 1px solid var(--lp-gold); background: var(--lp-base); }
.lp-salida { overflow: clip; margin: 0 10px; padding-bottom: 16px; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-ticket {
	padding: 1rem 1rem 1.4rem;
	background: var(--lp-cream); color: var(--lp-base);
	font-size: .95rem; font-variant-numeric: tabular-nums;
	-webkit-mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 8px repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat;
	mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 8px repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat;
}
.lp-ticket > * { margin: 0; color: inherit; }
.lp-ticket .lp-ticket-title { text-align: center; font: 700 1.5rem/1 var(--lp-display); letter-spacing: .08em; text-transform: uppercase; }
.lp-ticket .lp-ticket-sub { text-align: center; font-size: .8rem; color: #55525C; padding: .3rem 0 .7rem; border-bottom: 1px dashed #8E8A91; }
.lp-ticket figure, .lp-ticket .wp-block-table { margin: 0; overflow: visible; }
.lp-ticket .wp-block-table table, .lp-ticket table { width: 100%; border-collapse: collapse; border: 0; }
.lp-ticket .wp-block-table thead, .lp-ticket thead { border: 0; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lp-ticket .wp-block-table :is(td, th), .lp-ticket :is(td, th) { border: 0; padding: .2rem 0; }
.lp-ticket .wp-block-table td:first-child { width: 1.6rem; }
.lp-ticket .wp-block-table td:last-child { text-align: right; }
.lp-ticket .wp-block-table tbody tr:first-child td { padding-top: .7rem; }
.lp-ticket .wp-block-table tbody tr:last-child td { padding-bottom: .7rem; }
.lp-ticket .wp-block-table tfoot, .lp-ticket tfoot { border-bottom: 0; border-top: 1px dashed #8E8A91; }
.lp-ticket .wp-block-table tfoot td, .lp-ticket tfoot td { padding-top: .7rem; font-weight: 600; }
.lp-ticket tfoot td:last-child { font: 700 1.5rem/1 var(--lp-display); text-transform: uppercase; }
@media (prefers-reduced-motion: no-preference) {
	.ddcrm-landing .lp-ticket { animation: lp-print 1.1s var(--lp-ease) .35s both; }
}
@keyframes lp-print { from { transform: translateY(-101%); } }

/* ---------- Botones (bloque Botones de WordPress) ---------- */
:is(.ddcrm-landing, .editor-styles-wrapper) .wp-block-button__link, .ddcrm-landing .wp-element-button {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: .8rem 1.4rem;
	font: 700 1.1rem/1 var(--lp-display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
	background: var(--lp-gold); color: var(--lp-base); border: 1px solid var(--lp-gold); border-radius: 0;
	transition: background-color .2s, color .2s;
}
:is(.ddcrm-landing, .editor-styles-wrapper) .is-style-outline .wp-block-button__link { background: transparent; color: var(--lp-gold); }
@media (hover: hover) and (pointer: fine) {
	.ddcrm-landing .wp-block-button__link:hover { background: transparent; color: var(--lp-gold); }
	.ddcrm-landing .is-style-outline .wp-block-button__link:hover { background: var(--lp-gold); color: var(--lp-base); }
}
.ddcrm-landing .wp-block-button__link:active { transform: translateY(1px); }
.ddcrm-landing .wp-block-buttons { margin-top: 1.25rem; }

/* ---------- Cita ---------- */
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-quote, :is(.ddcrm-landing, .editor-styles-wrapper) .wp-block-quote.lp-quote { margin: var(--lp-gap) 0 0; padding: 0 0 0 1rem; border: 0; border-left: 1px solid var(--lp-gold); }
.lp-quote p { margin: 0; font: 600 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.02 var(--lp-display); text-transform: uppercase; max-width: 20ch; }
.lp-quote cite { display: block; margin-top: .6rem; font: 600 .85rem/1 var(--lp-display); letter-spacing: .06em; text-transform: uppercase; color: var(--lp-gold); font-style: normal; }

/* ---------- Lista numerada con líneas ---------- */
:is(.ddcrm-landing, .editor-styles-wrapper) ol.lp-steps { list-style: none; margin: 1.4rem 0 0; padding: 0; counter-reset: paso; border-top: 1px solid var(--lp-steel); }
.lp-steps li { counter-increment: paso; position: relative; margin: 0; padding: 1rem 0 1rem 3.5rem; border-bottom: 1px solid var(--lp-steel); color: var(--lp-muted); }
.lp-steps li::before { content: counter(paso, decimal-leading-zero); position: absolute; left: 0; top: 1rem; font: 700 1.6rem/1 var(--lp-display); color: var(--lp-gold); }
.lp-steps li > strong:first-child { display: block; color: var(--lp-cream); font-weight: 600; }

/* ---------- Secciones ---------- */
.lp-section > * { margin-block: 0; }
.lp-section > * + * { margin-top: 1.4rem; }

/* ---------- Filas con etiqueta de formato (plantillas) ---------- */
.lp-tools { display: grid; gap: .75rem; margin-top: 1.4rem; }
.lp-tools > * { margin: 0 !important; }
.lp-tool { padding: 1rem; background: var(--lp-surface); border-left: 3px solid var(--lp-gold); }
.lp-tool:nth-child(even) { background: var(--lp-steel); }
.lp-tool > * { margin: 0; }
.lp-tool > * + * { margin-top: .4rem; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-chip { display: inline-block; padding: .3rem .5rem; font: 600 .8rem/1 var(--lp-display); letter-spacing: .08em; text-transform: uppercase; color: var(--lp-gold); border: 1px solid var(--lp-gold); }
.lp-tool p:not(.lp-chip) { color: var(--lp-muted); }
.lp-tool :is(h2, h3) { font: 700 1.3rem/1.05 var(--lp-display); text-transform: uppercase; }

/* ---------- Autor + marcador ---------- */
.lp-author { display: grid; gap: 1.25rem; align-items: start; }
.lp-author > * { margin: 0; }
.lp-author figure { margin: 0; }
.lp-author > .wp-block-group > * { margin-block: 0; }
.lp-author > .wp-block-group > * + * { margin-top: 1rem; }
.lp-author img { display: block; height: auto !important; width: 100%; max-width: 22rem; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); border: 1px solid var(--lp-steel); }
.lp-author p { color: var(--lp-muted); max-width: 42ch; }
:is(.ddcrm-landing, .editor-styles-wrapper) ul.lp-score { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.lp-score li { display: grid; gap: .2rem; font-size: .8rem; color: var(--lp-muted); max-width: 9ch; line-height: 1.2; }
.lp-score strong { font: 700 2.4rem/1 var(--lp-display); color: var(--lp-gold); font-variant-numeric: tabular-nums; }

/* ---------- Vídeo de YouTube: miniatura propia y carga al pulsar ---------- */
.lp-video-wrap { margin: 0; }
.lp-video { position: relative; margin: 0; aspect-ratio: 16 / 9; background: var(--lp-surface); border: 1px solid var(--lp-gold); padding: 6px; }
.lp-video button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: var(--lp-base); overflow: hidden; }
.lp-video img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.lp-video .lp-play {
	position: absolute; inset: 50% auto auto 50%; translate: -50% -50%;
	display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; white-space: nowrap;
	font: 700 1rem/1 var(--lp-display); letter-spacing: .06em; text-transform: uppercase;
	background: var(--lp-gold); color: var(--lp-base);
}
.lp-video .lp-play::before { content: ""; border-left: 12px solid currentColor; border-block: 7px solid transparent; }
.lp-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.lp-video-note { margin: .5rem 0 0; font-size: .8rem; color: var(--lp-muted); }

/* ---------- Página de gracias ---------- */
.lp-download { padding: 1.2rem 1.1rem; background: var(--lp-surface); border: 1px solid var(--lp-steel); border-top: 3px solid var(--lp-gold); }
.lp-download > * { margin: 0; }
.lp-download > * + * { margin-top: .9rem; }
.lp-download p:not(.lp-chip) { color: var(--lp-muted); }
.lp-download .wp-block-button, .lp-download .wp-block-button__link { width: 100%; }
.lp-classes { margin-top: 1.4rem; border-top: 1px solid var(--lp-steel); }
.lp-classes > * { margin: 0; }
.lp-classes :is(h2, h3) { padding-top: 1.1rem; font: 700 1.35rem/1 var(--lp-display); text-transform: uppercase; }
.lp-classes :is(h2, h3) em { font-style: normal; color: var(--lp-gold); font-size: .95rem; letter-spacing: .06em; margin-right: .75rem; }
:is(.ddcrm-landing, .editor-styles-wrapper) .lp-classes ul { margin: .6rem 0 0; padding: 0 0 1.1rem 1.1rem; color: var(--lp-muted); border-bottom: 1px solid var(--lp-steel); }
.lp-classes li::marker { color: var(--lp-gold); }
.lp-community { padding: 1.5rem 1.1rem; border: 1px solid var(--lp-gold); }
.lp-community > * { margin: 0; }
.lp-community > * + * { margin-top: .75rem; }
.lp-community p { color: var(--lp-muted); }

/* ---------- Tablet y escritorio ---------- */
@media (min-width: 900px) {
	.lp-hero.is-layout-flow, .lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-rows: auto auto 1fr; column-gap: 3.5rem; row-gap: 0; align-items: start; }
	.lp-hero > .lp-frame { margin-top: 0; position: sticky; top: 1.5rem; }
	.lp-hero > :not(.lp-frame) { grid-column: 1; }
	.lp-hero > .lp-frame { grid-column: 2; grid-row: 1 / span 3; }
	.lp-hero > .lp-lead { margin-top: 1.1rem; }
	.lp-hero.lp-hero--solo { display: block; }
	.lp-frame-in { padding: 1.75rem 1.75rem 1.5rem; }
	.lp-tools { grid-template-columns: 1fr 1fr; }
	.lp-author { grid-template-columns: 18rem 1fr; gap: 2.5rem; }
	.lp-thanks { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 3rem; align-items: start; }
	.lp-thanks > * { margin: 0 !important; }
}

/* ---------- Un vídeo por clase (páginas de curso) ---------- */
.lp-classes :is(h2, h3) { scroll-margin-top: 1rem; }
.lp-classes :is(.lp-video-wrap, .wp-block-embed) { margin: .9rem 0 0; }
.lp-classes .wp-block-embed figcaption { display: none; }
.lp-tools > .lp-download { height: 100%; }

/* Con miniatura, el botón va abajo a la izquierda para no tapar el título del vídeo. */
.lp-video button:has(img) .lp-play { inset: auto auto 10px 10px; translate: none; }
.lp-video button:has(img) img { opacity: .92; }

/* ---------- Aviso de cookies (solo si hay Google Analytics en los ajustes) ---------- */
.lp-consent {
	position: fixed; z-index: 50;
	inset-inline: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom));
	max-width: 34rem; margin-inline: auto;
	padding: 1rem 1.1rem;
	background: var(--lp-surface); color: var(--lp-cream);
	border: 1px solid var(--lp-steel); border-top: 3px solid var(--lp-gold); border-radius: 4px;
	box-shadow: 0 12px 32px rgb(0 0 0 / .45);
	font-size: .9rem; line-height: 1.5;
}
.lp-consent[hidden], .lp-foot [hidden] { display: none; }
.lp-consent p { margin: 0; }
.lp-consent__btns { display: flex; gap: .6rem; margin-top: .85rem; }
.lp-consent__btns button {
	flex: 1; min-height: 44px; padding: .55rem 1rem;
	font: 700 1rem/1 var(--lp-display); letter-spacing: .05em; text-transform: uppercase;
	border-radius: 2px; cursor: pointer;
	background: transparent; color: var(--lp-cream); border: 1px solid var(--lp-muted);
}
.lp-consent__btns button[data-v="granted"] { background: var(--lp-gold); color: var(--lp-base); border-color: var(--lp-gold); }
@media (hover: hover) and (pointer: fine) {
	.lp-consent__btns button:hover { filter: brightness(1.1); }
}
@media (prefers-reduced-motion: no-preference) {
	.lp-consent { animation: lp-consent-in .35s var(--lp-ease); }
	@keyframes lp-consent-in { from { opacity: 0; translate: 0 1rem; } }
}
