/*
Theme Name: BC&O
Description: Tema propio de Bazán, Cambre & Orts. Reproduce el diseño del sitio anterior (Joomla) con bloques nativos, sin dependencias de terceros.
Version: 1.1.0
Requires at least: 7.0
Requires PHP: 8.1
Author: VTG Consultores
Text Domain: bco
License: GNU General Public License v2 or later
*/

/* Medidas y colores tomados del sitio de Joomla (tema Gusto, estilo "bakery" + custom.css):
   contenedor 1200px con 25px de margen, franjas de 60px, Roboto 14/22 #666, títulos Yanone Kaffeesatz en mayúsculas. */

.wp-site-blocks > * + * { margin-block-start: 0; }
p { margin: 0 0 15px; }

/* ---------- Cabecera ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 0px); }
.bco-header {
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
	transition: background-color .2s;
}
.bco-header__bar { min-height: 100px; gap: 20px; }
.bco-logo { display: block; flex: 0 1 auto; }
.bco-logo img { display: block; height: auto; width: 378px; max-width: 100%; }
.bco-logo .bco-logo__white { display: none; }

.bco-header .wp-block-navigation {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 19px;
	line-height: 19px;
	letter-spacing: 1px;
	text-transform: uppercase;
}
.bco-header .wp-block-navigation-item__content,
.bco-header .bco-lang {
	display: block;
	padding: 0 10px;
	color: #666;
	text-decoration: none;
	transition: color .15s;
}
.bco-header .wp-block-navigation-item__label span,
.bco-header .bco-lang span { display: block; }
.bco-header .wp-block-navigation-item__content:hover,
.bco-header .bco-lang:hover { color: #222; }
.bco-header .wp-block-navigation .current-menu-item > a,
.bco-header .wp-block-navigation .current-menu-ancestor > a,
.bco-header .wp-block-navigation .current-menu-ancestor > button { color: var(--wp--preset--color--primary-light); }
.bco-header .bco-lang {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 19px;
	line-height: 19px;
	letter-spacing: 1px;
	text-transform: uppercase;
}
.bco-header .wp-block-navigation__submenu-icon { display: none; }
.bco-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 0 !important;
	background: rgba(255, 255, 255, .95) !important;
	box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
	padding: 15px 0;
	min-width: 220px !important;
	top: calc(100% + 30px);
	color: #666 !important;
}
.bco-header .wp-block-navigation .wp-block-navigation__submenu-container::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -30px;
	height: 30px;
}
.bco-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 3px 25px; line-height: 26px; }

.bco-search { margin: 0 0 0 10px; }
.bco-search .wp-block-search__inside-wrapper { border: 0; padding: 0; }
.bco-search .wp-block-search__button {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #e9e9ec;
	color: #222;
	display: grid;
	place-items: center;
}
.bco-search .wp-block-search__button svg { width: 20px; height: 20px; fill: currentColor; }
.bco-search .wp-block-search__input { border: 1px solid #e9e9e9; height: 40px; padding: 0 10px; font: inherit; }

/* Portada: cabecera transparente sobre el slideshow; al pasarlo vuelve fija y blanca. */
.home .wp-site-blocks > header.wp-block-template-part { position: absolute; left: 0; right: 0; }
.home .wp-site-blocks > header.wp-block-template-part.is-stuck {
	position: fixed;
	animation: bco-slide-down .3s ease-out;
}
.home header:not(.is-stuck) .bco-header { background: transparent; box-shadow: none; }
.home header:not(.is-stuck) .bco-logo__color { display: none; }
.home header:not(.is-stuck) .bco-logo .bco-logo__white { display: block; }
.home header:not(.is-stuck) .wp-block-navigation-item__content,
.home header:not(.is-stuck) .bco-lang { color: rgba(255, 255, 255, .7); }
.home header:not(.is-stuck) .wp-block-navigation-item__content:hover,
.home header:not(.is-stuck) .bco-lang:hover,
.home header:not(.is-stuck) .current-menu-item > a { color: #fff; }
.home header:not(.is-stuck) .wp-block-navigation__submenu-container .wp-block-navigation-item__content { color: #666; }
.home header:not(.is-stuck) .wp-block-navigation__responsive-container-open { color: #fff; }
@keyframes bco-slide-down { from { transform: translateY(-100%); } to { transform: none; } }

@media (max-width: 1099px) {
	.bco-header .wp-block-navigation,
	.bco-header .bco-lang { font-size: 16px; line-height: 16px; letter-spacing: .5px; }
	.bco-logo img { width: 260px; }
}
@media (max-width: 599px) {
	.bco-header__bar { min-height: 70px; }
	.bco-logo img { width: 180px; }
	.bco-header .bco-lang { padding: 0 6px; font-size: 14px; line-height: 14px; }
}

/* ---------- Encabezado de sección (imagen + título) ---------- */
.bco-hero {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 250px;
	padding: 20px 25px;
	box-sizing: border-box;
	background: #cecdd3 center / cover no-repeat;
	text-align: center;
}
.bco-hero--plain { background-color: var(--wp--preset--color--accent); }
.bco-hero__title {
	margin: 0;
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: 48px;
	line-height: 52px;
	text-transform: uppercase;
}
@media (min-width: 1000px) {
	.bco-hero__title { font-size: 100px; line-height: 110px; }
}

/* ---------- Contenido ---------- */
.bco-main { padding-top: 60px; padding-bottom: 60px; }
.bco-main-home { margin: 0; }
.bco-article-title { font-size: 48px; line-height: 52px; letter-spacing: 1px; margin-bottom: 25px; }
.bco-panel-title,
.wp-block-post-title.bco-panel-title { font-size: 22px; line-height: 22px; color: #222; margin: 0 0 25px; }
.bco-panel-title a { color: inherit; }

.wp-block-button.is-style-small .wp-block-button__link,
.bco-btn-more,
a.uk-buttonCV,
.bco-member .wp-block-button__link {
	display: inline-block;
	line-height: 30px;
	padding: 0 33px;
	border-radius: 30px;
	background: var(--wp--preset--color--button-gray);
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	text-transform: uppercase;
	text-decoration: none;
}
.bco-btn-more { padding: 0 20px; }
.bco-btn-more::before { content: "\203A\00a0"; }
.bco-btn-more:hover,
a.uk-buttonCV:hover,
.bco-member .wp-block-button__link:hover { background: var(--wp--preset--color--primary); color: #fff; }

/* Menú lateral (Institucional y CV del equipo) */
.bco-with-sidebar { gap: 40px; }
.bco-sidenav {
	padding: 25px;
	border: 1px solid var(--wp--preset--color--light);
	border-radius: 3px;
	background: #fff;
}
.bco-sidenav ul { list-style: none; margin: 0 -25px; padding: 0; }
.bco-sidenav a {
	display: block;
	margin-bottom: 2px;
	padding: 5px 25px;
	border-radius: 3px;
	color: #666;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 18px;
	line-height: 22px;
	letter-spacing: 1px;
	text-transform: uppercase;
	transition: all .15s ease-in-out;
}
.bco-sidenav a:hover { background: #cecdd3; color: #666; }
.bco-sidenav .is-active a { background: var(--wp--preset--color--primary); color: #fff; }
.bco-sidenav__header {
	padding: 15px 25px 5px;
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 20px;
	letter-spacing: 1px;
	text-transform: uppercase;
}
.bco-sidenav__header:first-child { padding-top: 0; }
@media (max-width: 781px) {
	.bco-with-sidebar .bco-sidebar { order: 2; }
}

/* ---------- Portada ---------- */
.bco-hero-slides {
	position: relative;
	height: 100vh;
	min-height: 420px;
	overflow: hidden;
	background: var(--wp--preset--color--accent);
	margin: 0 !important;
}
.bco-hero-slides > .wp-block-cover {
	position: absolute !important;
	inset: 0;
	min-height: 100% !important;
	margin: 0 !important;
	padding: 100px 25px 80px;
	opacity: 0;
	transition: opacity .8s;
}
/* bco.js marca la diapositiva visible con is-active; sin JavaScript se ve la primera. */
.bco-hero-slides:not(.is-ready) > .wp-block-cover:first-child,
.bco-hero-slides > .wp-block-cover.is-active { opacity: 1; }
.bco-hero-slides .wp-block-cover__image-background { transform: scale(1); transition: transform 0s .8s; }
.bco-hero-slides > .is-active .wp-block-cover__image-background { transform: scale(1.08); transition: transform 5s linear; }
.bco-slide-text {
	max-width: 1150px;
	margin: 0 auto;
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 48px;
	line-height: 52px;
	letter-spacing: 1px;
	text-align: center;
	text-transform: uppercase;
}
@media (max-width: 767px) {
	.bco-slide-text { font-size: 30px; line-height: 34px; }
}
/* Puntos de los slideshows (los crea bco.js según la cantidad de diapositivas). */
.bco-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 40px;
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 !important;
}
.bco-dots button {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .5);
	cursor: pointer;
}
.bco-dots button.is-active,
.bco-dots button:hover { background: #fff; }
.bco-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Franjas */
.bco-main-home > .wp-block-post-content { padding-left: 0 !important; padding-right: 0 !important; }
.bco-main-home > .wp-block-post-content > .alignfull { margin-left: 0 !important; margin-right: 0 !important; max-width: none !important; width: 100%; }
.bco-band { padding-left: 25px !important; padding-right: 25px !important; box-sizing: border-box; }
.bco-band > .alignwide { max-width: 1150px; margin-left: auto !important; margin-right: auto !important; }
.bco-band > .bco-years { margin-left: -25px !important; margin-right: -25px !important; max-width: none; }
.bco-band { padding: 60px 0; margin: 0 !important; }
.bco-band h2 { text-align: center; margin-bottom: 25px; }
.bco-band--blue { background: var(--wp--preset--color--accent); }
.bco-band--blue h2,
.bco-band--gray h2 { color: #fff; }
.bco-band--gray { background: var(--wp--preset--color--button-gray); }

/* Equipo: carrusel de fotos */
.bco-carousel { position: relative; overflow: hidden; }
.bco-track {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	transform: translateX(calc(var(--bco-slide, 0) * -100%));
	transition: transform .6s ease;
}
.bco-track > .wp-block-image { flex: 0 0 100%; margin: 0 !important; }
.bco-track img { display: block; width: 100%; aspect-ratio: 1280 / 593; object-fit: cover; }
.bco-carousel .bco-dots { bottom: 20px; }

/* Áreas de práctica: tarjetas de portada */
.bco-area-cards { width: 95%; margin-left: auto !important; margin-right: auto !important; }
.bco-area-card {
	display: flex;
	flex-direction: column;
	padding: 0 25px 25px;
	border: 1px solid #3d516a;
	border-radius: 3px;
	background: var(--wp--preset--color--primary);
	color: #fff;
	text-align: center;
	overflow: hidden;
}
.bco-area-card > .wp-block-image { margin: 0 -25px 25px !important; overflow: hidden; }
.bco-area-card > .wp-block-image img { display: block; width: 100%; aspect-ratio: 550 / 310; object-fit: cover; transition: transform .3s; }
.bco-area-card:hover > .wp-block-image img { transform: scale(1.1); }
.bco-area-card h3 { margin: 0 0 25px; color: #fff; font-size: 22px; line-height: 22px; }
.bco-area-card h3 a { color: inherit; }
.bco-area-card > .wp-block-buttons { margin-top: auto; justify-content: center; }
.bco-area-card .wp-block-button__link { background: #fff; color: var(--wp--preset--color--primary); }
.bco-area-card .wp-block-button__link:hover { background: #fff; color: #212c39; }

/* "Más de 50 años": paneles a todo el ancho con el texto al pasar el mouse */
.bco-band--years { padding: 40px 0 0; }
.bco-years {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: 0 !important;
}
.bco-years > .wp-block-cover {
	min-height: 500px !important;
	margin: 0 !important;
	padding: 25px;
	text-align: center;
}
.bco-years .wp-block-cover__background,
.bco-years .wp-block-cover__inner-container { opacity: 0 !important; transition: opacity .3s; }
.bco-years > .wp-block-cover:hover .wp-block-cover__background,
.bco-years > .wp-block-cover:focus-within .wp-block-cover__background { opacity: .5 !important; }
.bco-years > .wp-block-cover:hover .wp-block-cover__inner-container,
.bco-years > .wp-block-cover:focus-within .wp-block-cover__inner-container { opacity: 1 !important; }
.bco-years h3 { color: #fff; font-size: 28px; line-height: 32px; margin: 0 0 15px; }
.bco-years h3 a { color: inherit; }
.bco-years p { color: #fff; }
.bco-years .wp-block-buttons { justify-content: center; }
.bco-years .wp-block-button__link { background: #fff; color: var(--wp--preset--color--primary-light); }
.bco-years .wp-block-button__link:hover { background: rgba(255, 255, 255, .9); color: var(--wp--preset--color--primary-light); }
@media (hover: none) {
	.bco-years .wp-block-cover__background { opacity: .5 !important; }
	.bco-years .wp-block-cover__inner-container { opacity: 1 !important; }
}
@media (max-width: 959px) { .bco-years { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .bco-years { grid-template-columns: 1fr; } .bco-years > .wp-block-cover { min-height: 360px !important; } }

/* Noticias destacadas */
.bco-news-head { justify-content: center; gap: 15px 30px; margin-bottom: 40px !important; }
.bco-news-head h2 { margin: 0; }
.bco-news-cards .wp-block-post-featured-image { margin: 0 0 25px; }
.bco-news-cards .wp-block-post-featured-image img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.bco-news-cards .wp-block-post-title { margin-bottom: 15px; }

/* Listado de noticias */
.bco-news-list .wp-block-post-template { gap: 40px; }
.bco-news-row { gap: 35px; }
.bco-news-row .wp-block-post-featured-image { margin: 0; }
.bco-news-row .wp-block-post-featured-image img { display: block; width: 100%; height: auto; }
.bco-news-row .wp-block-post-title { margin-bottom: 15px; }
.bco-news-list .wp-block-query-pagination { margin-top: 40px; font-family: var(--wp--preset--font-family--heading); font-size: 18px; }

/* ---------- Equipo ---------- */
.bco-member > .wp-block-image { margin: 0 0 25px !important; }
.bco-member > .wp-block-image img { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; }
.bco-member h3 { font-size: 22px; line-height: 22px; margin: 0 0 15px; color: #222; }
.bco-member .bco-contact { margin: 0 0 15px; font-size: 13px; line-height: 20px; word-break: break-word; }
.bco-member .bco-contact strong { color: var(--wp--preset--color--accent); }
.bco-member .bco-contact a::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 10px;
	margin-right: 5px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M0 0h24v2.2L12 10 0 2.2zM0 4.6l12 7.8 12-7.8V18H0z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M0 0h24v2.2L12 10 0 2.2zM0 4.6l12 7.8 12-7.8V18H0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bco-member .wp-block-buttons { margin: 0; }

/* ---------- Áreas de práctica (solapas verticales) ---------- */
.bco-areas > details > summary {
	cursor: pointer;
	padding: 10px 0;
	border-bottom: 1px solid var(--wp--preset--color--light);
	color: #222;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 18px;
	text-transform: uppercase;
}
.bco-areas > details > *:not(summary) { margin-top: 20px; }
.bco-areas.is-tabs {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 0 35px;
	align-items: start;
}
.bco-areas.is-tabs > * { margin: 0 !important; }
.bco-areas.is-tabs > details { grid-column: 2; grid-row: 1; }
.bco-areas.is-tabs > details > summary { display: none; }
.bco-areas.is-tabs > details:not([open]) { display: none; }
.bco-areas.is-tabs > details > *:not(summary) { margin-top: 0; }
.bco-tabs { grid-column: 1; grid-row: 1; list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--wp--preset--color--light); }
.bco-tabs button {
	display: block;
	width: 100%;
	margin: 0 0 2px;
	padding: 8px 15px;
	border: 0;
	border-radius: 3px 0 0 3px;
	background: none;
	color: #666;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	line-height: 20px;
	letter-spacing: 1px;
	text-align: left;
	text-transform: uppercase;
	transition: all .15s ease-in-out;
}
.bco-tabs button:hover { background: #f5f5f5; color: #222; }
.bco-tabs .is-active button { background: var(--wp--preset--color--primary); color: #fff; }
.bco-areas h3 { font-size: 18px; line-height: 20px; }
.bco-areas .wp-block-columns { gap: 35px; }
.bco-areas .wp-block-image img { display: block; width: 100%; height: auto; }
@media (max-width: 767px) {
	.bco-areas.is-tabs { grid-template-columns: 1fr; gap: 25px; }
	.bco-areas.is-tabs > details { grid-column: 1; grid-row: auto; }
	.bco-tabs { grid-row: auto; border-right: 0; }
}

/* ---------- Pie ---------- */
.bco-footer {
	padding: 60px 0;
	background: var(--wp--preset--color--accent);
	color: rgba(215, 227, 243, .5);
}
.bco-footer__cols { gap: 35px; }
.bco-footer a:not(.wp-block-button__link) { color: #d7e3f3; }
.bco-footer a:not(.wp-block-button__link):hover { color: #fff; }
.bco-panel-title { position: relative; }
.bco-footer .bco-panel-title { color: #d7e3f3; padding-bottom: 20px; }
.bco-footer .bco-panel-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 120px;
	border-bottom: 1px solid rgba(215, 227, 243, .15);
}
.bco-footer__list { list-style: none; margin: 0; padding: 0; }
.bco-footer__list li + li { margin-top: 7px; }
.bco-btn-footer .wp-block-button__link { background: #0c72ab; color: #d7e3f3; }
.bco-btn-footer .wp-block-button__link:hover { background: #0e8cd1; color: #fff; }
.bco-members .wp-block-image { margin: 0; }
.bco-members img { display: block; width: 100%; height: auto; }
.bco-copyright {
	padding: 40px 0;
	background: var(--wp--preset--color--accent-dark);
	color: #fff;
}
.bco-copyright p { margin: 0; }
.bco-copyright a { color: rgba(215, 227, 243, .5); }
.bco-copyright a:hover { color: #d7e3f3; }

/* ---------- Formulario de contacto ---------- */
.bco-form { display: grid; gap: 15px; max-width: 640px; }
.bco-form p { margin: 0; }
.bco-form label { display: block; margin-bottom: 5px; color: #222; }
.bco-form input[type=text],
.bco-form input[type=email],
.bco-form input[type=tel],
.bco-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--wp--preset--color--light);
	border-radius: 3px;
	color: #444;
	font: inherit;
}
.bco-form textarea { min-height: 160px; }
.bco-form .bco-hp { position: absolute; left: -9999px; }
.bco-form button {
	justify-self: start;
	min-height: 40px;
	padding: 0 33px;
	border: 0;
	border-radius: 40px;
	background: var(--wp--preset--color--button-gray);
	color: #fff;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	line-height: 40px;
	text-transform: uppercase;
}
.bco-form button:hover { background: var(--wp--preset--color--primary); }
.bco-notice { padding: 10px 15px; border-radius: 3px; }
.bco-notice.ok { background: #e7f3e4; color: #24521b; }
.bco-notice.error { background: #fbe9e7; color: #8a2a1f; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	.bco-hero-slides > .wp-block-cover,
	.bco-hero-slides .wp-block-cover__image-background,
	.bco-track { transition: none !important; }
	.bco-hero-slides > .is-active .wp-block-cover__image-background { transform: none; }
	.home .wp-site-blocks > header.is-stuck { animation: none !important; }
}

/* Compatibilidad con clases de UIkit que trae el contenido migrado de Joomla. */
.uk-margin-large { margin-top: 40px; margin-bottom: 40px; }
.uk-text-left { text-align: left; }
.uk-float-right { float: right; margin: 0 0 15px 25px; }
.uk-float-left { float: left; margin: 0 25px 15px 0; }
a.uk-button {
	display: inline-block;
	min-height: 40px;
	padding: 0 33px;
	border-radius: 40px;
	background: var(--wp--preset--color--button-gray);
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	line-height: 40px;
	text-transform: uppercase;
	text-decoration: none;
}
a.uk-button:hover { background: var(--wp--preset--color--primary); color: #fff; }
a.uk-button-mini { min-height: 30px; line-height: 30px; padding: 0 20px; }

/* Contenido migrado de Joomla: imágenes con ancho fijo no deben desbordar en móvil. */
.wp-block-post-content img { max-width: 100%; height: auto; }
.wp-block-post-content iframe { max-width: 100%; }
