/* Cabecera nueva (21-nov). Marca con logo, menú propio y panel «Todo Terrassa». Ver includes/cabecera.php y assets/js/menu.js. */
.wp-site-blocks > header,
header.wp-block-template-part { position: sticky; top: 0; z-index: 90; }
html { scroll-padding-top: 5rem; }

.rt-top {
	position: relative;
	background: rgb(255 255 255 / 94%);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid rgb(29 29 31 / 9%);
	color: var(--wp--preset--color--rt-ink);
}
.rt-top__fila {
	display: flex; align-items: center; gap: 1rem 1.25rem;
	max-width: 1360px; margin: 0 auto; min-height: 4.25rem;
	padding: .5rem clamp(1rem, 3vw, 2rem);
	box-sizing: border-box;
}
.rt-top a { color: inherit; }

/* Marca */
.rt-marca { display: inline-flex; align-items: center; gap: .6rem; flex: none; order: 1; text-decoration: none; color: var(--wp--preset--color--rt-ink); }
.rt-marca__logo { flex: none; display: block; }
.rt-marca__texto { font-weight: 800; font-size: 1.35rem; letter-spacing: -.045em; line-height: 1; white-space: nowrap; }

/* Menú */
.rt-nav { order: 2; flex: 1 1 auto; display: flex; align-items: center; min-width: 0; position: static; }
.rt-nav__panel { display: flex; align-items: center; flex: 1; gap: 1rem; justify-content: space-between; min-width: 0; }
.rt-nav__lista { display: flex; align-items: center; gap: .1rem; list-style: none; margin: 0 0 0 .75rem; padding: 0; }
.rt-nav__item { position: static; }
.rt-nav__enlace {
	display: inline-flex; align-items: center; gap: .4rem; position: relative;
	padding: .6rem .85rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
	font: inherit; font-size: .97rem; font-weight: 600; line-height: 1.1; color: var(--wp--preset--color--rt-ink); text-decoration: none; white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.rt-nav__enlace:hover { background: var(--wp--preset--color--rt-soft, #f4f5f6); }
.rt-nav__enlace:focus-visible { outline: 3px solid var(--wp--preset--color--rt-teal, #0e6570); outline-offset: 2px; }
.rt-nav__enlace[aria-current="page"] { color: var(--wp--preset--color--rt-red-accessible, #c9141e); }
.rt-nav__enlace[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: .15rem; width: 1.1rem; height: 3px; margin-left: -.55rem; border-radius: 3px; background: currentColor; }
.rt-nav__chevron { transition: transform .2s ease; flex: none; }
.rt-nav__mega-boton[aria-expanded="true"] { background: var(--wp--preset--color--rt-ink); color: var(--wp--preset--color--rt-white, #fff); }
.rt-nav__mega-boton[aria-expanded="true"] .rt-nav__chevron { transform: rotate(180deg); }

.rt-nav__acciones { display: flex; align-items: center; gap: .85rem; flex: none; }
.rt-top .rt-idioma__item { margin: 0; display: flex; align-items: center; }
.rt-top a.rt-nav__cta {
	display: inline-block; padding: .7rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: .97rem; text-decoration: none; white-space: nowrap;
	background: var(--wp--preset--color--rt-red-accessible, #c9141e); color: #fff;
	box-shadow: 0 6px 16px -8px rgb(201 20 30 / 70%); transition: transform .15s ease, box-shadow .15s ease;
}
.rt-top a.rt-nav__cta:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgb(201 20 30 / 70%); }
.rt-top a.rt-nav__cta:focus-visible { outline: 3px solid var(--wp--preset--color--rt-teal, #0e6570); outline-offset: 3px; }

/* Buscador: botón redondo */
.rt-top__buscar { order: 3; flex: none; margin: 0; width: auto; }
.rt-top__buscar .wp-block-search__inside-wrapper { border: 0 !important; padding: 0 !important; background: none; }
.rt-top__buscar .wp-block-search__button {
	width: 2.75rem; height: 2.75rem; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
	display: grid; place-items: center; background: var(--wp--preset--color--rt-ink); color: #fff !important; fill: #fff;
}
.rt-top__buscar .wp-block-search__button svg { fill: currentColor; width: 1.3rem; height: 1.3rem; }

/* Panel «Todo Terrassa» */
.rt-mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid rgb(29 29 31 / 9%); box-shadow: 0 30px 50px -28px rgb(29 29 31 / 35%); z-index: 5; }
.rt-mega[hidden] { display: none; }
.rt-mega__interior {
	max-width: 1360px; margin: 0 auto; box-sizing: border-box; padding: 1.75rem clamp(1rem, 3vw, 2rem) 2.25rem;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(15rem, 1.15fr); gap: 1.75rem 2rem;
}
.rt-mega__titulo { margin: 0 0 .6rem; padding-bottom: .5rem; border-bottom: 2px solid var(--wp--preset--color--rt-red-accessible, #c9141e); font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.rt-mega__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.rt-mega__enlace { display: block; padding: .55rem .75rem; margin-inline: -.75rem; border-radius: 14px; text-decoration: none; color: var(--wp--preset--color--rt-ink); transition: background-color .15s ease; }
.rt-mega__enlace:hover, .rt-mega__enlace:focus-visible { background: var(--wp--preset--color--rt-soft, #f4f5f6); }
.rt-mega__enlace:focus-visible { outline: 3px solid var(--wp--preset--color--rt-teal, #0e6570); outline-offset: -3px; }
.rt-mega__nombre { display: block; font-weight: 700; }
.rt-mega__ayuda { display: block; margin-top: .1rem; font-size: .85rem; line-height: 1.3; color: #5c5e64; }
.rt-mega__promo { align-self: start; padding: 1.5rem; border-radius: 24px; background: var(--wp--preset--color--rt-red-accessible, #c9141e); color: #fff; }
.rt-mega__promo-titulo { margin: 0 0 .4rem; font-size: 1.35rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.rt-mega__promo-texto { margin: 0 0 1rem; }
.rt-top a.rt-mega__promo-boton { display: inline-block; padding: .65rem 1.2rem; border-radius: 999px; background: #fff; color: var(--wp--preset--color--rt-ink); font-weight: 700; text-decoration: none; }

/* Móvil y tableta */
.rt-nav__hamburguesa { display: none; }
@media (max-width: 1080px) {
	.rt-top__fila { min-height: 3.75rem; gap: .6rem; }
	.rt-marca { flex: 1 1 auto; }
	.rt-marca__texto { font-size: 1.25rem; }
	.rt-nav { flex: none; order: 3; }
	.rt-top__buscar { order: 2; }
	.rt-nav__hamburguesa {
		display: grid; align-content: center; justify-items: center; gap: 5px; width: 2.75rem; height: 2.75rem; padding: 0;
		border: 2px solid var(--wp--preset--color--rt-ink); border-radius: 50%; background: #fff; cursor: pointer;
	}
	.rt-nav__hamburguesa span { display: block; width: 1.15rem; height: 2px; border-radius: 2px; background: var(--wp--preset--color--rt-ink); transition: transform .2s ease, opacity .2s ease; }
	.rt-nav.is-open .rt-nav__hamburguesa span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.rt-nav.is-open .rt-nav__hamburguesa span:nth-child(2) { opacity: 0; }
	.rt-nav.is-open .rt-nav__hamburguesa span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	.rt-nav__panel {
		display: none; position: fixed; left: 0; right: 0; top: var(--rt-alto-cabecera, 4rem); bottom: 0; z-index: 80;
		flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1rem;
		padding: 1rem clamp(1rem, 4vw, 2rem) 6rem; overflow-y: auto; background: #fff;
	}
	.rt-nav.is-open .rt-nav__panel { display: flex; }
	.rt-nav__lista { flex-direction: column; align-items: stretch; margin: 0; gap: .15rem; }
	.rt-nav__enlace { width: 100%; justify-content: space-between; padding: .9rem 1rem; font-size: 1.15rem; border-radius: 16px; }
	.rt-nav__enlace[aria-current="page"]::after { display: none; }
	.rt-nav__acciones { flex-direction: column-reverse; align-items: stretch; gap: 1rem; }
	.rt-top a.rt-nav__cta { text-align: center; padding: .95rem 1.2rem; font-size: 1.1rem; }
	.rt-top .rt-idioma__item { justify-content: center; }
	.rt-mega { position: static; box-shadow: none; border: 0; background: var(--wp--preset--color--rt-soft, #f4f5f6); border-radius: 20px; margin: .25rem 0 .5rem; }
	.rt-mega__interior { grid-template-columns: 1fr; padding: 1rem 1rem 1.25rem; gap: 1.25rem; }
	body.rt-menu-abierto { overflow: hidden; }
}
@media (max-width: 380px) { .rt-marca__texto { font-size: 1.1rem; } .rt-marca__logo { width: 36px; height: 36px; } }

@media (prefers-reduced-motion: reduce) {
	.rt-nav__enlace, .rt-nav__chevron, .rt-mega__enlace, .rt-top a.rt-nav__cta, .rt-nav__hamburguesa span { transition: none !important; }
}

/* Bandas de cabecera de página a todo el ancho de la pantalla, sin hueco con la cabecera (como la portada). */
body { overflow-x: clip; }
.wp-block-post-content > .wp-block-cover:first-child,
.wp-block-post-content > .alignwide.wp-block-cover:first-child,
.rt-ln__cabecera,
.rtq-hero {
	width: 100vw !important; max-width: none !important; margin-inline: calc(50% - 50vw) !important; border-radius: 0 !important; box-sizing: border-box;
}
.rt-ln__cabecera, .rtq-hero { padding-inline: max(1.5rem, calc((100vw - 1360px) / 2)); }
.wp-block-post-content > .wp-block-cover:first-child .wp-block-cover__inner-container { max-width: 1360px; margin-inline: auto; padding-inline: 1.5rem; box-sizing: border-box; }
.wp-block-post-content > .wp-block-cover:first-child { margin-top: 0 !important; }
main:has(> .wp-block-post-content > .wp-block-cover:first-child),
main:has(> .wp-block-post-content > .rt-ln > .rt-ln__cabecera:first-child),
main:has(> .wp-block-post-content > .rtq-hero:first-child),
main:has(> .wp-block-post-content > .rt-quienes > .rtq-hero:first-child) { padding-top: 0 !important; margin-top: 0 !important; }

/* Sin hueco entre cabecera y portada; los hijos de la fila no heredan márgenes del flujo de WordPress. */
.rt-top__fila > * { margin-block: 0 !important; }
main.rt-portada { padding-top: 0 !important; margin-top: 0 !important; }
.wp-site-blocks > main { margin-block-start: 0; }

.rt-ln, .rt-quienes { overflow: visible !important; }

/* El cristal esmerilado de la cabecera haría que el menú del móvil (fixed) midiera solo la cabecera: fuera en pantallas pequeñas. */
@media (max-width: 1080px) {
	.rt-top { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
}

/* El crédito de la foto de portada es un enlace sobre fondo oscuro: hereda el color claro (antes salía rojo). */
.wp-block-cover a { color: inherit; }

/* Agenda: su banda roja también a todo el ancho y pegada a la cabecera. */
.rtag > .hero:first-child {
	width: 100vw; max-width: none; margin: 0 calc(50% - 50vw) 1.75rem !important; border-radius: 0 !important; box-sizing: border-box;
	padding-inline: max(1.5rem, calc((100vw - 1360px) / 2 + 1.5rem)) !important;
	padding-block: clamp(2rem, 5vw, 3.5rem) !important;
}
main:has(> .wp-block-post-content > .rtag > .hero:first-child) { padding-top: 0 !important; }

.rtag:has(> .hero:first-child) { padding-top: 0 !important; }

/* Hero: más aire entre las tarjetas (la de oferta con foto es más alta) */
@media (min-width: 1025px) {
	.rt-hero .rt-cartel--oferta { top: 150px; }
	.rt-hero .rt-cartel--voz { bottom: -60px; }
}

/* Tableta: titulares menos grandes (entre 601 y 1100 px) */
@media (min-width: 601px) and (max-width: 1100px) {
	body h2, .rt-seccion h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1; }
	.rt-seccion.rt-hoy h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
	.rt-hero h1 { font-size: clamp(3rem, 9vw, 5.5rem); }
	body h1.rt-pagina-titulo { font-size: clamp(2rem, 4.8vw, 3.4rem); }
}

/* Franja decorativa de cabecera de sección (includes/banda-seccion.php) */
.rt-banda-seccion { position: relative; width: 100vw !important; max-width: none !important; margin: 0 calc(50% - 50vw) clamp(1.25rem, 3vw, 2rem) !important; height: clamp(9rem, 20vw, 16rem); overflow: hidden; background: #2a2a2e; }
.rt-banda-seccion__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.rt-banda-seccion::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0%) 45%, rgb(0 0 0 / 55%)); pointer-events: none; }
.rt-banda-seccion__credito { position: absolute; z-index: 2; right: max(1rem, calc((100vw - 1360px) / 2)); bottom: .5rem; margin: 0; font-size: .72rem; line-height: 1.3; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 70%); }
.rt-banda-seccion__credito a { color: inherit; }
main:has(> .wp-block-post-content > .rt-banda-seccion:first-child) { padding-top: 0 !important; margin-top: 0 !important; }
main:has(> .rt-banda-seccion:first-child) { padding-top: 0 !important; margin-top: 0 !important; }

/* Hero (escritorio): dos columnas (actividad y noticia a la izquierda, la oferta a la derecha), inclinadas y a la medida de su pieza */
@media (min-width: 1025px) {
	.rt-hero .rt-collage { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 18px; align-items: start; padding: 8px 0; }
	.rt-hero .rt-collage .rt-cartel { position: static; width: auto; }
	.rt-hero .rt-collage .rt-cartel--agenda { grid-column: 1; grid-row: 1; }
	.rt-hero .rt-collage .rt-cartel--voz { grid-column: 1; grid-row: 2; }
	.rt-hero .rt-collage .rt-cartel--oferta { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
