@lit-roa/hero 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hero.js CHANGED
@@ -23,14 +23,23 @@ import '@lit-roa/carrusel';
23
23
  * - `escaparate`: la portada desenfocada, la imagen nítida en una tarjeta y
24
24
  * pestañas con el título de cada diapositiva y barra de avance.
25
25
  *
26
+ * Con `ancho-completo` va de orilla a orilla (sin redondeo) y el contenido
27
+ * queda alineado con el ancho del sitio; se combina con cualquier disposición.
28
+ *
26
29
  * @fires clic-hero - Al tocar un botón. `detail`: `{ id, href }`. El sitio navega.
27
- * @cssprop --lr-hero-alto - Alto mínimo en escritorio (30rem).
30
+ * @cssprop --lr-hero-alto - Alto mínimo en escritorio (30rem; 34rem con `ancho-completo`).
31
+ * @cssprop --lr-hero-ancho-contenido - Ancho del contenido con `ancho-completo` (1160px).
28
32
  * @cssprop --lr-hero-alto-celular - Alto mínimo en celular (32rem).
29
33
  * @cssprop --lr-hero-acento - Color de la etiqueta de los anuncios (#facc15).
30
34
  */
31
35
  let LrHero = class LrHero extends LitElement {
32
36
  constructor() {
33
37
  super(...arguments);
38
+ /**
39
+ * A todo lo ancho de la pantalla, sin esquinas redondeadas; el contenido se
40
+ * alinea con `--lr-hero-ancho-contenido`. El sitio lo pone fuera de su contenedor.
41
+ */
42
+ this.anchoCompleto = false;
34
43
  this.disposicion = 'portada';
35
44
  /** Portada de la tienda: fondo fijo de todo el carrusel. */
36
45
  this.portada = '';
@@ -55,439 +64,460 @@ let LrHero = class LrHero extends LitElement {
55
64
  static { this.styles = [
56
65
  tokens,
57
66
  estilosBase,
58
- css `
59
- :host {
60
- display: block;
61
- --_oscuro: color-mix(in srgb, var(--_color-primario), #000 50%);
62
- --_acento: var(--lr-hero-acento, #facc15);
63
- --_alto: var(--lr-hero-alto, 30rem);
64
- }
65
- .marco {
66
- position: relative;
67
- isolation: isolate;
68
- overflow: hidden;
69
- border-radius: var(--_radio);
70
- background: linear-gradient(135deg, var(--_oscuro), var(--_color-primario));
71
- color: #fff;
72
- }
73
- .fondo,
74
- .tinte,
75
- .tinte::before,
76
- .tinte::after {
77
- position: absolute;
78
- inset: 0;
79
- z-index: -1;
80
- }
81
- .fondo img {
82
- width: 100%;
83
- height: 100%;
84
- object-fit: cover;
85
- display: block;
86
- }
87
- :host([disposicion='dividido']) .fondo,
88
- :host([disposicion='escaparate']) .fondo {
89
- inset: -3rem;
90
- filter: blur(32px) saturate(1.25);
91
- }
92
- .tinte::before,
93
- .tinte::after {
94
- content: '';
95
- transition: opacity 0.6s;
96
- }
97
- .tinte::after {
98
- opacity: 0;
99
- }
100
- .marco[data-activa='anuncio'] .tinte::before {
101
- opacity: 0;
102
- }
103
- .marco[data-activa='anuncio'] .tinte::after {
104
- opacity: 1;
105
- }
106
- /* Portada: velo oscuro del lado del texto en la bienvenida, color de la marca en los anuncios. */
107
- .tinte::before {
108
- background: linear-gradient(90deg, rgb(10 12 30 / 0.82) 0%, rgb(10 12 30 / 0.55) 45%, rgb(10 12 30 / 0) 80%);
109
- }
110
- .tinte::after {
111
- background: linear-gradient(
112
- 105deg,
113
- color-mix(in srgb, var(--_oscuro) 94%, transparent) 0%,
114
- color-mix(in srgb, var(--_color-primario) 82%, transparent) 45%,
115
- color-mix(in srgb, var(--_oscuro) 50%, transparent) 100%
116
- );
117
- }
118
- :host([disposicion='dividido']) .tinte::before,
119
- :host([disposicion='dividido']) .tinte::after,
120
- :host([disposicion='escaparate']) .tinte::before,
121
- :host([disposicion='escaparate']) .tinte::after {
122
- background: rgb(10 12 30 / 0.45);
123
- }
124
- lr-carrusel {
125
- --lr-carrusel-radio: 0;
126
- --lr-carrusel-avance: var(--_acento);
127
- /* El carrusel pone el color de texto del sitio; aquí manda el del hero. */
128
- color: inherit;
129
- }
130
-
131
- /* ---- Diapositivas ---- */
132
- .diapositiva {
133
- position: relative;
134
- display: flex;
135
- min-height: var(--_alto);
136
- padding: clamp(1.5rem, 5vw, 4rem);
137
- padding-bottom: max(clamp(1.5rem, 5vw, 4rem), var(--lr-carrusel-reserva-abajo, 0px));
138
- gap: 3rem;
139
- align-items: center;
140
- }
141
- .texto {
142
- display: flex;
143
- flex-direction: column;
144
- align-items: flex-start;
145
- gap: 1rem;
146
- max-width: 36rem;
147
- min-width: 0;
148
- }
149
- .antetitulo {
150
- font-size: 0.8125rem;
151
- font-weight: 800;
152
- letter-spacing: 0.08em;
153
- text-transform: uppercase;
154
- color: var(--_acento);
155
- }
156
- .etiqueta {
157
- display: inline-flex;
158
- padding: 0.375rem 0.75rem;
159
- border-radius: 999px;
160
- background: var(--_acento);
161
- color: #1f2937;
162
- font-size: 0.8125rem;
163
- font-weight: 700;
164
- }
165
- h2 {
166
- margin: 0;
167
- font-size: clamp(1.875rem, 4.5vw, 3.25rem);
168
- line-height: 1.06;
169
- font-weight: 800;
170
- letter-spacing: -0.02em;
171
- text-wrap: balance;
172
- }
173
- .anuncio h2 {
174
- font-size: clamp(1.75rem, 4vw, 2.875rem);
175
- }
176
- p {
177
- margin: 0;
178
- font-size: clamp(1rem, 1.8vw, 1.1875rem);
179
- line-height: 1.5;
180
- opacity: 0.92;
181
- }
182
- .botones {
183
- display: flex;
184
- flex-wrap: wrap;
185
- gap: 0.75rem;
186
- margin-top: 0.5rem;
187
- }
188
- .boton {
189
- display: inline-flex;
190
- align-items: center;
191
- justify-content: center;
192
- height: 3rem;
193
- padding: 0 1.375rem;
194
- border-radius: calc(var(--_radio) / 1.5);
195
- font-weight: 700;
196
- text-decoration: none;
197
- white-space: nowrap;
198
- background: var(--_color-primario);
199
- color: var(--_color-sobre-primario);
200
- border: 1.5px solid transparent;
201
- }
202
- .boton.secundario {
203
- background: transparent;
204
- color: #fff;
205
- border-color: rgb(255 255 255 / 0.85);
206
- }
207
- .anuncio .boton {
208
- background: #fff;
209
- color: #111827;
210
- }
211
- .boton:hover {
212
- filter: brightness(0.94);
213
- }
214
- .boton:focus-visible {
215
- outline: 2px solid #fff;
216
- outline-offset: 3px;
217
- }
218
- .imagen {
219
- position: relative;
220
- flex: 1 1 0;
221
- align-self: stretch;
222
- min-width: 0;
223
- max-height: calc(var(--_alto) - 5rem);
224
- border-radius: calc(var(--_radio) * 1.25);
225
- overflow: hidden;
226
- box-shadow: 0 24px 60px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.15);
227
- }
228
- .imagen img:not(.logo) {
229
- position: absolute;
230
- inset: 0;
231
- width: 100%;
232
- height: 100%;
233
- object-fit: cover;
234
- }
235
- .anuncio .texto {
236
- flex: 1 1 0;
237
- }
238
- .logo {
239
- width: 5.25rem;
240
- height: 5.25rem;
241
- border-radius: 1.25rem;
242
- object-fit: contain;
243
- background: #fff;
244
- box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
245
- }
246
-
247
- /* ---- Dividido ---- */
248
- :host([disposicion='dividido']) .diapositiva {
249
- padding: 1.75rem;
250
- padding-bottom: max(1.75rem, var(--lr-carrusel-reserva-abajo, 0px));
251
- gap: 1.5rem;
252
- align-items: stretch;
253
- }
254
- :host([disposicion='dividido']) .texto {
255
- flex: 1 1 0;
256
- max-width: none;
257
- justify-content: center;
258
- padding: clamp(1.5rem, 4vw, 3rem);
259
- border-radius: calc(var(--_radio) * 1.25);
260
- background: #fff;
261
- color: var(--_color-texto);
262
- box-shadow: 0 20px 50px rgb(0 0 0 / 0.3);
263
- }
264
- :host([disposicion='dividido']) .antetitulo {
265
- color: var(--_color-primario);
266
- }
267
- :host([disposicion='dividido']) p {
268
- color: var(--_color-texto-suave);
269
- opacity: 1;
270
- }
271
- :host([disposicion='dividido']) .boton.secundario {
272
- color: var(--_color-primario);
273
- border-color: var(--_color-primario);
274
- }
275
- :host([disposicion='dividido']) .anuncio .boton {
276
- background: var(--_color-primario);
277
- color: var(--_color-sobre-primario);
278
- }
279
- :host([disposicion='dividido']) .imagen {
280
- max-height: none;
281
- box-shadow: 0 20px 50px rgb(0 0 0 / 0.35);
282
- }
283
- :host([disposicion='dividido']) .imagen.sin-imagen {
284
- background: linear-gradient(135deg, var(--_oscuro), var(--_color-primario));
285
- }
286
- :host([disposicion='dividido']) .imagen .logo {
287
- position: absolute;
288
- left: 1.5rem;
289
- bottom: 1.5rem;
290
- }
291
- :host([disposicion='dividido']) .imagen.sin-imagen .logo {
292
- left: calc(50% - 2.625rem);
293
- bottom: calc(50% - 2.625rem);
294
- }
295
-
296
- /* ---- Escaparate ---- */
297
- :host([disposicion='escaparate']) .bienvenida {
298
- justify-content: center;
299
- text-align: center;
300
- }
301
- :host([disposicion='escaparate']) .bienvenida .texto {
302
- align-items: center;
303
- max-width: 40rem;
304
- }
305
- :host([disposicion='escaparate']) .bienvenida .botones {
306
- justify-content: center;
307
- }
308
- :host([disposicion='escaparate']) .bienvenida .boton.principal {
309
- background: #fff;
310
- color: #111827;
311
- }
312
- :host([disposicion='escaparate']) .imagen {
313
- flex: 0 1 46%;
314
- align-self: center;
315
- aspect-ratio: 3 / 2;
316
- }
317
-
318
- @media (max-width: 640px) {
319
- :host {
320
- --_alto: var(--lr-hero-alto-celular, 32rem);
321
- }
322
- .diapositiva {
323
- flex-direction: column;
324
- justify-content: flex-end;
325
- align-items: stretch;
326
- gap: 1.25rem;
327
- padding: 1.5rem 1.375rem;
328
- padding-bottom: max(1.5rem, var(--lr-carrusel-reserva-abajo, 0px));
329
- }
330
- .tinte::before {
331
- background: linear-gradient(0deg, rgb(10 12 30 / 0.92) 0%, rgb(10 12 30 / 0.6) 45%, rgb(10 12 30 / 0.05) 85%);
332
- }
333
- .tinte::after {
334
- background: linear-gradient(
335
- 0deg,
336
- color-mix(in srgb, var(--_oscuro) 96%, transparent) 0%,
337
- color-mix(in srgb, var(--_color-primario) 85%, transparent) 50%,
338
- color-mix(in srgb, var(--_oscuro) 55%, transparent) 100%
339
- );
340
- }
341
- .texto,
342
- .anuncio .texto {
343
- flex: none;
344
- }
345
- .botones {
346
- flex-direction: column;
347
- align-self: stretch;
348
- }
349
- .boton {
350
- width: 100%;
351
- }
352
- /* Portada: los anuncios no muestran imagen en celular. */
353
- :host(:not([disposicion])) .anuncio .imagen,
354
- :host([disposicion='portada']) .anuncio .imagen,
355
- :host([ocultar-imagen-celular]) .anuncio .imagen {
356
- display: none;
357
- }
358
- .imagen {
359
- flex: none;
360
- order: -1;
361
- height: 9.5rem;
362
- max-height: none;
363
- }
364
- :host([disposicion='escaparate']) .diapositiva {
365
- justify-content: center;
366
- text-align: center;
367
- }
368
- :host([disposicion='escaparate']) .texto {
369
- align-items: center;
370
- align-self: center;
371
- }
372
- :host([disposicion='escaparate']) .imagen {
373
- flex: none;
374
- aspect-ratio: auto;
375
- align-self: stretch;
376
- }
377
- :host([disposicion='dividido']) .diapositiva {
378
- gap: 0;
379
- padding: 0.875rem;
380
- padding-bottom: max(0.875rem, var(--lr-carrusel-reserva-abajo, 0px));
381
- justify-content: flex-start;
382
- }
383
- :host([disposicion='dividido']) .texto {
384
- flex: 1 0 auto;
385
- justify-content: flex-start;
386
- padding: 1.25rem;
387
- }
388
- :host([disposicion='dividido']) .anuncio:not(:has(.imagen)) .texto,
389
- :host([ocultar-imagen-celular][disposicion='dividido']) .anuncio .texto {
390
- justify-content: center;
391
- }
392
- :host([disposicion='dividido']) .imagen {
393
- height: 11rem;
394
- border-radius: calc(var(--_radio) * 1.25) calc(var(--_radio) * 1.25) 0 0;
395
- box-shadow: none;
396
- }
397
- :host([disposicion='dividido']) .imagen + .texto,
398
- :host([disposicion='dividido']) .texto:has(+ .imagen) {
399
- border-radius: 0 0 calc(var(--_radio) * 1.25) calc(var(--_radio) * 1.25);
400
- }
401
- :host([ocultar-imagen-celular][disposicion='dividido']) .anuncio .texto {
402
- border-radius: calc(var(--_radio) * 1.25);
403
- }
404
- :host([disposicion='dividido']) .imagen .logo {
405
- width: 4rem;
406
- height: 4rem;
407
- border-radius: 0.875rem;
408
- left: 1rem;
409
- bottom: 1rem;
410
- }
411
- :host([disposicion='dividido']) .imagen.sin-imagen .logo {
412
- left: calc(50% - 2rem);
413
- bottom: calc(50% - 2rem);
414
- }
415
- }
67
+ css `
68
+ :host {
69
+ display: block;
70
+ --_oscuro: color-mix(in srgb, var(--_color-primario), #000 50%);
71
+ --_acento: var(--lr-hero-acento, #facc15);
72
+ --_alto: var(--lr-hero-alto, 30rem);
73
+ }
74
+ .marco {
75
+ position: relative;
76
+ isolation: isolate;
77
+ overflow: hidden;
78
+ border-radius: var(--_radio);
79
+ background: linear-gradient(135deg, var(--_oscuro), var(--_color-primario));
80
+ color: #fff;
81
+ }
82
+ .fondo,
83
+ .tinte,
84
+ .tinte::before,
85
+ .tinte::after {
86
+ position: absolute;
87
+ inset: 0;
88
+ z-index: -1;
89
+ }
90
+ .fondo img {
91
+ width: 100%;
92
+ height: 100%;
93
+ object-fit: cover;
94
+ display: block;
95
+ }
96
+ :host([disposicion='dividido']) .fondo,
97
+ :host([disposicion='escaparate']) .fondo {
98
+ inset: -3rem;
99
+ filter: blur(32px) saturate(1.25);
100
+ }
101
+ .tinte::before,
102
+ .tinte::after {
103
+ content: '';
104
+ transition: opacity 0.6s;
105
+ }
106
+ .tinte::after {
107
+ opacity: 0;
108
+ }
109
+ .marco[data-activa='anuncio'] .tinte::before {
110
+ opacity: 0;
111
+ }
112
+ .marco[data-activa='anuncio'] .tinte::after {
113
+ opacity: 1;
114
+ }
115
+ /* Portada: velo oscuro del lado del texto en la bienvenida, color de la marca en los anuncios. */
116
+ .tinte::before {
117
+ background: linear-gradient(90deg, rgb(10 12 30 / 0.82) 0%, rgb(10 12 30 / 0.55) 45%, rgb(10 12 30 / 0) 80%);
118
+ }
119
+ .tinte::after {
120
+ background: linear-gradient(
121
+ 105deg,
122
+ color-mix(in srgb, var(--_oscuro) 94%, transparent) 0%,
123
+ color-mix(in srgb, var(--_color-primario) 82%, transparent) 45%,
124
+ color-mix(in srgb, var(--_oscuro) 50%, transparent) 100%
125
+ );
126
+ }
127
+ :host([disposicion='dividido']) .tinte::before,
128
+ :host([disposicion='dividido']) .tinte::after,
129
+ :host([disposicion='escaparate']) .tinte::before,
130
+ :host([disposicion='escaparate']) .tinte::after {
131
+ background: rgb(10 12 30 / 0.45);
132
+ }
133
+ lr-carrusel {
134
+ --lr-carrusel-radio: 0;
135
+ --lr-carrusel-avance: var(--_acento);
136
+ /* El carrusel pone el color de texto del sitio; aquí manda el del hero. */
137
+ color: inherit;
138
+ }
139
+
140
+ /* ---- Diapositivas ---- */
141
+ .diapositiva {
142
+ position: relative;
143
+ display: flex;
144
+ min-height: var(--_alto);
145
+ padding: clamp(1.5rem, 5vw, 4rem);
146
+ padding-bottom: max(clamp(1.5rem, 5vw, 4rem), var(--lr-carrusel-reserva-abajo, 0px));
147
+ gap: 3rem;
148
+ align-items: center;
149
+ }
150
+ .texto {
151
+ display: flex;
152
+ flex-direction: column;
153
+ align-items: flex-start;
154
+ gap: 1rem;
155
+ max-width: 36rem;
156
+ min-width: 0;
157
+ }
158
+ .antetitulo {
159
+ font-size: 0.8125rem;
160
+ font-weight: 800;
161
+ letter-spacing: 0.08em;
162
+ text-transform: uppercase;
163
+ color: var(--_acento);
164
+ }
165
+ .etiqueta {
166
+ display: inline-flex;
167
+ padding: 0.375rem 0.75rem;
168
+ border-radius: 999px;
169
+ background: var(--_acento);
170
+ color: #1f2937;
171
+ font-size: 0.8125rem;
172
+ font-weight: 700;
173
+ }
174
+ h2 {
175
+ margin: 0;
176
+ font-size: clamp(1.875rem, 4.5vw, 3.25rem);
177
+ line-height: 1.06;
178
+ font-weight: 800;
179
+ letter-spacing: -0.02em;
180
+ text-wrap: balance;
181
+ }
182
+ .anuncio h2 {
183
+ font-size: clamp(1.75rem, 4vw, 2.875rem);
184
+ }
185
+ p {
186
+ margin: 0;
187
+ font-size: clamp(1rem, 1.8vw, 1.1875rem);
188
+ line-height: 1.5;
189
+ opacity: 0.92;
190
+ }
191
+ .botones {
192
+ display: flex;
193
+ flex-wrap: wrap;
194
+ gap: 0.75rem;
195
+ margin-top: 0.5rem;
196
+ }
197
+ .boton {
198
+ display: inline-flex;
199
+ align-items: center;
200
+ justify-content: center;
201
+ height: 3rem;
202
+ padding: 0 1.375rem;
203
+ border-radius: calc(var(--_radio) / 1.5);
204
+ font-weight: 700;
205
+ text-decoration: none;
206
+ white-space: nowrap;
207
+ background: var(--_color-primario);
208
+ color: var(--_color-sobre-primario);
209
+ border: 1.5px solid transparent;
210
+ }
211
+ .boton.secundario {
212
+ background: transparent;
213
+ color: #fff;
214
+ border-color: rgb(255 255 255 / 0.85);
215
+ }
216
+ .anuncio .boton {
217
+ background: #fff;
218
+ color: #111827;
219
+ }
220
+ .boton:hover {
221
+ filter: brightness(0.94);
222
+ }
223
+ .boton:focus-visible {
224
+ outline: 2px solid #fff;
225
+ outline-offset: 3px;
226
+ }
227
+ .imagen {
228
+ position: relative;
229
+ flex: 1 1 0;
230
+ align-self: stretch;
231
+ min-width: 0;
232
+ max-height: calc(var(--_alto) - 5rem);
233
+ border-radius: calc(var(--_radio) * 1.25);
234
+ overflow: hidden;
235
+ box-shadow: 0 24px 60px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.15);
236
+ }
237
+ .imagen img:not(.logo) {
238
+ position: absolute;
239
+ inset: 0;
240
+ width: 100%;
241
+ height: 100%;
242
+ object-fit: cover;
243
+ }
244
+ .anuncio .texto {
245
+ flex: 1 1 0;
246
+ }
247
+ .logo {
248
+ width: 5.25rem;
249
+ height: 5.25rem;
250
+ border-radius: 1.25rem;
251
+ object-fit: contain;
252
+ background: #fff;
253
+ box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
254
+ }
255
+
256
+ /* ---- Dividido ---- */
257
+ :host([disposicion='dividido']) .diapositiva {
258
+ padding: 1.75rem;
259
+ padding-bottom: max(1.75rem, var(--lr-carrusel-reserva-abajo, 0px));
260
+ gap: 1.5rem;
261
+ align-items: stretch;
262
+ }
263
+ :host([disposicion='dividido']) .texto {
264
+ flex: 1 1 0;
265
+ max-width: none;
266
+ justify-content: center;
267
+ padding: clamp(1.5rem, 4vw, 3rem);
268
+ border-radius: calc(var(--_radio) * 1.25);
269
+ background: #fff;
270
+ color: var(--_color-texto);
271
+ box-shadow: 0 20px 50px rgb(0 0 0 / 0.3);
272
+ }
273
+ :host([disposicion='dividido']) .antetitulo {
274
+ color: var(--_color-primario);
275
+ }
276
+ :host([disposicion='dividido']) p {
277
+ color: var(--_color-texto-suave);
278
+ opacity: 1;
279
+ }
280
+ :host([disposicion='dividido']) .boton.secundario {
281
+ color: var(--_color-primario);
282
+ border-color: var(--_color-primario);
283
+ }
284
+ :host([disposicion='dividido']) .anuncio .boton {
285
+ background: var(--_color-primario);
286
+ color: var(--_color-sobre-primario);
287
+ }
288
+ :host([disposicion='dividido']) .imagen {
289
+ max-height: none;
290
+ box-shadow: 0 20px 50px rgb(0 0 0 / 0.35);
291
+ }
292
+ :host([disposicion='dividido']) .imagen.sin-imagen {
293
+ background: linear-gradient(135deg, var(--_oscuro), var(--_color-primario));
294
+ }
295
+ :host([disposicion='dividido']) .imagen .logo {
296
+ position: absolute;
297
+ left: 1.5rem;
298
+ bottom: 1.5rem;
299
+ }
300
+ :host([disposicion='dividido']) .imagen.sin-imagen .logo {
301
+ left: calc(50% - 2.625rem);
302
+ bottom: calc(50% - 2.625rem);
303
+ }
304
+
305
+ /* ---- Escaparate ---- */
306
+ :host([disposicion='escaparate']) .bienvenida {
307
+ justify-content: center;
308
+ text-align: center;
309
+ }
310
+ :host([disposicion='escaparate']) .bienvenida .texto {
311
+ align-items: center;
312
+ max-width: 40rem;
313
+ }
314
+ :host([disposicion='escaparate']) .bienvenida .botones {
315
+ justify-content: center;
316
+ }
317
+ :host([disposicion='escaparate']) .bienvenida .boton.principal {
318
+ background: #fff;
319
+ color: #111827;
320
+ }
321
+ :host([disposicion='escaparate']) .imagen {
322
+ flex: 0 1 46%;
323
+ align-self: center;
324
+ aspect-ratio: 3 / 2;
325
+ }
326
+
327
+ /* ---- Ancho completo ---- */
328
+ :host([ancho-completo]) {
329
+ --_alto: var(--lr-hero-alto, 34rem);
330
+ --_lateral: max(0px, calc((100% - var(--lr-hero-ancho-contenido, 1160px)) / 2));
331
+ }
332
+ :host([ancho-completo]) .marco {
333
+ border-radius: 0;
334
+ }
335
+ :host([ancho-completo]) lr-carrusel {
336
+ --lr-carrusel-pestanas-relleno: var(--_lateral);
337
+ }
338
+ @media (min-width: 641px) {
339
+ /* El contenido se alinea con el ancho del sitio; el fondo llega a las orillas. */
340
+ :host([ancho-completo]) .diapositiva {
341
+ padding-inline: max(clamp(1.5rem, 5vw, 4rem), calc(var(--_lateral) + 1rem));
342
+ }
343
+ :host([ancho-completo][disposicion='dividido']) .diapositiva {
344
+ padding-inline: max(1.75rem, calc(var(--_lateral) + 1rem));
345
+ }
346
+ }
347
+
348
+ @media (max-width: 640px) {
349
+ :host {
350
+ --_alto: var(--lr-hero-alto-celular, 32rem);
351
+ }
352
+ .diapositiva {
353
+ flex-direction: column;
354
+ justify-content: flex-end;
355
+ align-items: stretch;
356
+ gap: 1.25rem;
357
+ padding: 1.5rem 1.375rem;
358
+ padding-bottom: max(1.5rem, var(--lr-carrusel-reserva-abajo, 0px));
359
+ }
360
+ .tinte::before {
361
+ background: linear-gradient(0deg, rgb(10 12 30 / 0.92) 0%, rgb(10 12 30 / 0.6) 45%, rgb(10 12 30 / 0.05) 85%);
362
+ }
363
+ .tinte::after {
364
+ background: linear-gradient(
365
+ 0deg,
366
+ color-mix(in srgb, var(--_oscuro) 96%, transparent) 0%,
367
+ color-mix(in srgb, var(--_color-primario) 85%, transparent) 50%,
368
+ color-mix(in srgb, var(--_oscuro) 55%, transparent) 100%
369
+ );
370
+ }
371
+ .texto,
372
+ .anuncio .texto {
373
+ flex: none;
374
+ }
375
+ .botones {
376
+ flex-direction: column;
377
+ align-self: stretch;
378
+ }
379
+ .boton {
380
+ width: 100%;
381
+ }
382
+ /* Portada: los anuncios no muestran imagen en celular. */
383
+ :host(:not([disposicion])) .anuncio .imagen,
384
+ :host([disposicion='portada']) .anuncio .imagen,
385
+ :host([ocultar-imagen-celular]) .anuncio .imagen {
386
+ display: none;
387
+ }
388
+ .imagen {
389
+ flex: none;
390
+ order: -1;
391
+ height: 9.5rem;
392
+ max-height: none;
393
+ }
394
+ :host([disposicion='escaparate']) .diapositiva {
395
+ justify-content: center;
396
+ text-align: center;
397
+ }
398
+ :host([disposicion='escaparate']) .texto {
399
+ align-items: center;
400
+ align-self: center;
401
+ }
402
+ :host([disposicion='escaparate']) .imagen {
403
+ flex: none;
404
+ aspect-ratio: auto;
405
+ align-self: stretch;
406
+ }
407
+ :host([disposicion='dividido']) .diapositiva {
408
+ gap: 0;
409
+ padding: 0.875rem;
410
+ padding-bottom: max(0.875rem, var(--lr-carrusel-reserva-abajo, 0px));
411
+ justify-content: flex-start;
412
+ }
413
+ :host([disposicion='dividido']) .texto {
414
+ flex: 1 0 auto;
415
+ justify-content: flex-start;
416
+ padding: 1.25rem;
417
+ }
418
+ :host([disposicion='dividido']) .anuncio:not(:has(.imagen)) .texto,
419
+ :host([ocultar-imagen-celular][disposicion='dividido']) .anuncio .texto {
420
+ justify-content: center;
421
+ }
422
+ :host([disposicion='dividido']) .imagen {
423
+ height: 11rem;
424
+ border-radius: calc(var(--_radio) * 1.25) calc(var(--_radio) * 1.25) 0 0;
425
+ box-shadow: none;
426
+ }
427
+ :host([disposicion='dividido']) .imagen + .texto,
428
+ :host([disposicion='dividido']) .texto:has(+ .imagen) {
429
+ border-radius: 0 0 calc(var(--_radio) * 1.25) calc(var(--_radio) * 1.25);
430
+ }
431
+ :host([ocultar-imagen-celular][disposicion='dividido']) .anuncio .texto {
432
+ border-radius: calc(var(--_radio) * 1.25);
433
+ }
434
+ :host([disposicion='dividido']) .imagen .logo {
435
+ width: 4rem;
436
+ height: 4rem;
437
+ border-radius: 0.875rem;
438
+ left: 1rem;
439
+ bottom: 1rem;
440
+ }
441
+ :host([disposicion='dividido']) .imagen.sin-imagen .logo {
442
+ left: calc(50% - 2rem);
443
+ bottom: calc(50% - 2rem);
444
+ }
445
+ }
416
446
  `,
417
447
  ]; }
418
448
  render() {
419
449
  const escaparate = this.disposicion === 'escaparate';
420
- return html `
421
- <div class="marco" data-activa=${this.activa === 0 ? 'bienvenida' : 'anuncio'}>
450
+ return html `
451
+ <div class="marco" data-activa=${this.activa === 0 ? 'bienvenida' : 'anuncio'}>
422
452
  ${this.portada
423
- ? html `<picture class="fondo" aria-hidden="true">
424
- ${this.portadaCelular ? html `<source media="(max-width: 640px)" srcset=${this.portadaCelular} />` : nothing}
425
- <img src=${this.portada} alt="" fetchpriority="high" />
453
+ ? html `<picture class="fondo" aria-hidden="true">
454
+ ${this.portadaCelular ? html `<source media="(max-width: 640px)" srcset=${this.portadaCelular} />` : nothing}
455
+ <img src=${this.portada} alt="" fetchpriority="high" />
426
456
  </picture>`
427
- : nothing}
428
- <div class="tinte" aria-hidden="true"></div>
429
- <lr-carrusel
430
- etiqueta=${this.etiqueta}
431
- intervalo=${this.intervalo}
432
- ?puntos-encima=${!escaparate}
433
- ?pestanas=${escaparate}
434
- efecto=${escaparate ? 'desvanecer' : 'deslizar'}
435
- @cambio-diapositiva=${this.alCambiar}
436
- >
437
- ${this.bienvenida()} ${this.anuncios.map((a) => this.anuncio(a))}
438
- </lr-carrusel>
439
- </div>
457
+ : nothing}
458
+ <div class="tinte" aria-hidden="true"></div>
459
+ <lr-carrusel
460
+ etiqueta=${this.etiqueta}
461
+ intervalo=${this.intervalo}
462
+ ?puntos-encima=${!escaparate}
463
+ ?pestanas=${escaparate}
464
+ efecto=${escaparate ? 'desvanecer' : 'deslizar'}
465
+ @cambio-diapositiva=${this.alCambiar}
466
+ >
467
+ ${this.bienvenida()} ${this.anuncios.map((a) => this.anuncio(a))}
468
+ </lr-carrusel>
469
+ </div>
440
470
  `;
441
471
  }
442
472
  bienvenida() {
443
473
  const dividido = this.disposicion === 'dividido';
444
474
  const logo = this.logo ? html `<img class="logo" src=${this.logo} alt=${this.logoAlt} />` : nothing;
445
475
  const botones = this.botones.slice(0, 2);
446
- return html `<article class="diapositiva bienvenida" data-pestana=${this.titulo || 'Bienvenida'} data-pestana-detalle="Inicio">
447
- <div class="texto">
448
- ${this.disposicion === 'escaparate' ? logo : nothing}
449
- ${this.antetitulo ? html `<span class="antetitulo">${this.antetitulo}</span>` : nothing}
450
- ${this.titulo ? html `<h2>${this.titulo}</h2>` : nothing}
451
- ${this.texto ? html `<p>${this.texto}</p>` : nothing}
476
+ return html `<article class="diapositiva bienvenida" data-pestana=${this.titulo || 'Bienvenida'} data-pestana-detalle="Inicio">
477
+ <div class="texto">
478
+ ${this.disposicion === 'escaparate' ? logo : nothing}
479
+ ${this.antetitulo ? html `<span class="antetitulo">${this.antetitulo}</span>` : nothing}
480
+ ${this.titulo ? html `<h2>${this.titulo}</h2>` : nothing}
481
+ ${this.texto ? html `<p>${this.texto}</p>` : nothing}
452
482
  ${botones.length
453
- ? html `<div class="botones">
454
- ${botones.map((b, i) => html `<a
455
- class="boton ${b.variante ?? (i === 0 ? 'principal' : 'secundario')}"
456
- href=${b.href}
457
- @click=${(e) => this.alClic(e, b.href)}
458
- >${b.texto}</a
459
- >`)}
483
+ ? html `<div class="botones">
484
+ ${botones.map((b, i) => html `<a
485
+ class="boton ${b.variante ?? (i === 0 ? 'principal' : 'secundario')}"
486
+ href=${b.href}
487
+ @click=${(e) => this.alClic(e, b.href)}
488
+ >${b.texto}</a
489
+ >`)}
460
490
  </div>`
461
- : nothing}
462
- </div>
491
+ : nothing}
492
+ </div>
463
493
  ${dividido
464
- ? html `<div class="imagen ${this.portada ? '' : 'sin-imagen'}">
465
- ${this.portada ? html `<img src=${this.portadaCelular || this.portada} alt="" />` : nothing} ${logo}
494
+ ? html `<div class="imagen ${this.portada ? '' : 'sin-imagen'}">
495
+ ${this.portada ? html `<img src=${this.portadaCelular || this.portada} alt="" />` : nothing} ${logo}
466
496
  </div>`
467
- : nothing}
497
+ : nothing}
468
498
  </article>`;
469
499
  }
470
500
  anuncio(a) {
471
- return html `<article class="diapositiva anuncio" data-pestana=${a.titulo} data-pestana-detalle=${a.etiqueta || a.antetitulo || 'Anuncio'}>
472
- <div class="texto">
473
- ${a.etiqueta ? html `<span class="etiqueta">${a.etiqueta}</span>` : nothing}
474
- ${a.antetitulo ? html `<span class="antetitulo">${a.antetitulo}</span>` : nothing}
475
- <h2>${a.titulo}</h2>
476
- ${a.texto ? html `<p>${a.texto}</p>` : nothing}
501
+ return html `<article class="diapositiva anuncio" data-pestana=${a.titulo} data-pestana-detalle=${a.etiqueta || a.antetitulo || 'Anuncio'}>
502
+ <div class="texto">
503
+ ${a.etiqueta ? html `<span class="etiqueta">${a.etiqueta}</span>` : nothing}
504
+ ${a.antetitulo ? html `<span class="antetitulo">${a.antetitulo}</span>` : nothing}
505
+ <h2>${a.titulo}</h2>
506
+ ${a.texto ? html `<p>${a.texto}</p>` : nothing}
477
507
  ${a.boton && a.href
478
- ? html `<div class="botones">
479
- <a class="boton" href=${a.href} @click=${(e) => this.alClic(e, a.href, a.id)}>${a.boton}</a>
508
+ ? html `<div class="botones">
509
+ <a class="boton" href=${a.href} @click=${(e) => this.alClic(e, a.href, a.id)}>${a.boton}</a>
480
510
  </div>`
481
- : nothing}
482
- </div>
511
+ : nothing}
512
+ </div>
483
513
  ${a.imagen
484
- ? html `<div class="imagen">
485
- <picture>
486
- ${a.imagenCelular ? html `<source media="(max-width: 640px)" srcset=${a.imagenCelular} />` : nothing}
487
- <img src=${a.imagen} alt=${a.imagenAlt ?? ''} loading="lazy" />
488
- </picture>
514
+ ? html `<div class="imagen">
515
+ <picture>
516
+ ${a.imagenCelular ? html `<source media="(max-width: 640px)" srcset=${a.imagenCelular} />` : nothing}
517
+ <img src=${a.imagen} alt=${a.imagenAlt ?? ''} loading="lazy" />
518
+ </picture>
489
519
  </div>`
490
- : nothing}
520
+ : nothing}
491
521
  </article>`;
492
522
  }
493
523
  alCambiar(evento) {
@@ -501,6 +531,9 @@ let LrHero = class LrHero extends LitElement {
501
531
  emitir(this, 'clic-hero', { id, href });
502
532
  }
503
533
  };
534
+ __decorate([
535
+ property({ type: Boolean, reflect: true, attribute: 'ancho-completo' })
536
+ ], LrHero.prototype, "anchoCompleto", void 0);
504
537
  __decorate([
505
538
  property({ reflect: true })
506
539
  ], LrHero.prototype, "disposicion", void 0);