/* CBA theme — supplementary styles the block editor's UI can't express (clip-path, gradients, overlays). Everything else lives in theme.json. */

@media (max-width: 780px) {
	.cba-header {
		padding-top: 14px !important;
		padding-bottom: 14px !important;
	}
	.cba-header__inner {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}
}

/* Nav links — Sora caps (more character than the body font at this size), color + hover
   feedback the block editor's color picker can't express (underline reveal), and generous
   horizontal breathing room (the block's own default is .5em/side — not enough at this weight). */

.cba-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 18px !important;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.cba-nav .wp-block-navigation-item__content:hover,
.cba-nav .wp-block-navigation-item__content:focus {
	color: var(--wp--preset--color--cba-green-dark) !important;
	border-bottom-color: var(--wp--preset--color--cba-green-dark);
}

/* Mobile menu toggle — recolor the default WP hamburger/close icons to brand blue */

.cba-nav .wp-block-navigation__responsive-container-open svg,
.cba-nav .wp-block-navigation__responsive-container-close svg {
	color: var(--wp--preset--color--cba-blue);
	width: 28px;
	height: 28px;
}

.cba-nav .wp-block-navigation__responsive-container-open:hover svg,
.cba-nav .wp-block-navigation__responsive-container-close:hover svg {
	color: var(--wp--preset--color--cba-green-dark);
}

/* Mobile overlay panel — brand it instead of shipping the WP-default plain white/black sheet */

.cba-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--cba-white);
}

.cba-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 24px;
}

.cba-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: 24px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
	color: var(--wp--preset--color--cba-blue);
	border-bottom: 1px solid #ececec;
	padding: 16px 0 !important;
	width: 100%;
}

.cba-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	border-bottom-color: var(--wp--preset--color--cba-green-dark);
}

.cba-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	gap: 0;
}

/* Divider lines between each desktop nav word */

.cba-nav .wp-block-navigation-item:not(:last-child)::before {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 1.5px;
	height: 18px;
	background: #c7cbe0;
}

@media (max-width: 780px) {
	.cba-nav .wp-block-navigation-item::before {
		content: none;
	}
}

/* Header layout — logo and nav live inside a 1440px-max inner wrapper (.cba-header__inner)
   instead of spreading across the true viewport edge. On a wide monitor the outer .cba-header
   is still full-bleed (for the border/background), but the logo-to-nav distance is capped by
   the wrapper's max-width, not by however wide the screen happens to be — that gap growing
   unbounded on wide screens was the original complaint ("el logo está muy lejano del menú").
   Superseded the earlier 1fr/auto/1fr grid-centering approach, which centered the nav on the
   full viewport and made the problem worse on ultra-wide screens. */

.cba-header__inner {
	max-width: 1440px;
	margin: 0 auto;
	width: 100%;
	align-items: center;
}

.cba-hero {
	position: relative;
	overflow: hidden;
	min-height: 640px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cba-hero__bg {
	position: absolute;
	inset: 0;
	display: flex;
}

.cba-hero__side {
	width: 52%;
	height: 100%;
	overflow: hidden;
}

.cba-hero__side img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cba-hero__side--left {
	clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}

.cba-hero__side--right {
	width: 52%;
	margin-left: -4%;
	clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

.cba-hero__seam {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 6px;
	margin-left: -3px;
	background: linear-gradient(180deg, var(--wp--preset--color--cba-green) 0%, var(--wp--preset--color--cba-green) 48%, var(--wp--preset--color--cba-blue) 52%, var(--wp--preset--color--cba-blue) 100%);
	transform: skewX(-8deg);
	z-index: 1;
}

.cba-hero__panel {
	position: relative;
	z-index: 2;
	max-width: 660px;
	background: rgba(255, 255, 255, 0.96);
	padding: 48px 52px;
	text-align: center;
}

@media (max-width: 780px) {
	.cba-hero {
		flex-direction: column;
		min-height: 0;
		padding: 0 0 32px;
	}
	.cba-hero__bg {
		position: relative;
		flex-direction: row;
		width: 100%;
		height: 280px;
	}
	.cba-hero__side,
	.cba-hero__side--right {
		width: 50%;
		height: 100%;
		margin-left: 0;
		clip-path: none;
	}
	.cba-hero__seam {
		display: none;
	}
	.cba-hero__panel {
		max-width: calc(100% - 32px);
		margin: 0 16px;
		padding: 28px 20px;
	}
}

/* Filmstrip — "¿Qué quiere crear?" */

.cba-filmstrip {
	display: flex;
	gap: 6px;
	height: 420px;
}

.cba-filmstrip__item {
	position: relative;
	overflow: hidden;
	flex: 1;
	display: block;
	text-decoration: none;
}

.cba-filmstrip__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cba-filmstrip__item--wide {
	flex: 1.4;
}

.cba-filmstrip__item--narrow {
	flex: 0.8;
}

.cba-filmstrip__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px 22px;
	background: linear-gradient(180deg, rgba(10, 11, 30, 0) 0%, rgba(10, 11, 30, 0.94) 100%);
	color: #fff;
}

.cba-filmstrip__label .cba-filmstrip__title {
	margin: 0 0 4px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}

.cba-filmstrip__label .cba-filmstrip__meta {
	margin: 0;
	font-size: 12px;
	color: #fff;
}

@media (max-width: 780px) {
	.cba-filmstrip {
		flex-direction: column;
		height: auto;
	}
	.cba-filmstrip__item,
	.cba-filmstrip__item--wide,
	.cba-filmstrip__item--narrow {
		flex: none;
		height: 220px;
	}
}

/* Shared diagonal accent — echoes the two strokes through the logo's "C" */

.cba-diagonal-accent {
	width: 36px;
	height: 3px;
	background: var(--wp--preset--color--cba-green);
}

/* Pillars / editorial rows (used instead of icon+heading+text cards) */

.cba-index-row {
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 26px 0;
	border-top: 1px solid #e1e1da;
}

.cba-index-row:last-child {
	border-bottom: 1px solid #e1e1da;
}

.cba-index-row__thumb {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
	overflow: hidden;
}

.cba-index-row__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Subpage hero — a lighter intro band than Home's split hero, reused across every other page */

.cba-page-hero {
	padding: 72px 56px 48px;
	max-width: 900px;
}

.cba-page-hero__accent {
	width: 36px;
	height: 3px;
	background: var(--wp--preset--color--cba-green);
	margin-bottom: 24px;
}

.cba-page-hero--band {
	background: var(--wp--preset--color--cba-blue-deep);
	max-width: none;
	padding: 72px 56px;
}

.cba-page-hero--band .cba-page-hero__inner {
	max-width: 780px;
}

/* Term/definition grid — a plain two-column list instead of icon+heading+text cards */

.cba-term-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 48px;
}

.cba-term-grid dt {
	font-family: var(--wp--preset--font-family--display);
	font-size: 16px;
	font-weight: 600;
	color: var(--wp--preset--color--cba-blue);
	margin: 0 0 6px;
}

.cba-term-grid dd {
	font-size: 14px;
	line-height: 1.6;
	color: var(--wp--preset--color--cba-gray);
	margin: 0;
}

@media (max-width: 780px) {
	.cba-term-grid {
		grid-template-columns: 1fr;
	}
}

/* Editorial teaser cards — Innovación hub */

.cba-teaser-row {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	padding-bottom: 8px;
}

.cba-teaser {
	flex: 0 0 300px;
}

.cba-teaser__media {
	height: 180px;
	overflow: hidden;
	margin-bottom: 16px;
}

.cba-teaser__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cba-teaser h3 {
	font-family: var(--wp--preset--font-family--display);
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 8px;
	color: var(--wp--preset--color--cba-ink);
}

.cba-teaser p {
	font-size: 13px;
	line-height: 1.6;
	color: var(--wp--preset--color--cba-gray);
	margin: 0;
}

/* Aplicaciones hub — category tiles, uneven sizes (not uniform cards) */

.cba-category-grid {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr;
	grid-template-rows: 260px 260px;
	gap: 10px;
}

.cba-category-tile {
	position: relative;
	overflow: hidden;
	display: block;
	text-decoration: none;
}

.cba-category-tile--tall {
	grid-row: 1 / 3;
}

.cba-category-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cba-category-tile__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px 22px;
	background: linear-gradient(180deg, rgba(10, 11, 30, 0) 0%, rgba(10, 11, 30, 0.94) 100%);
}

.cba-category-tile__label span {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}

.cba-category-tile__label small {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #fff;
}

@media (max-width: 780px) {
	.cba-category-grid {
		grid-template-columns: 1fr;
		grid-template-rows: none;
	}
	.cba-category-tile,
	.cba-category-tile--tall {
		grid-row: auto;
		height: 220px;
	}
}

/* Contact form — the [cba_contact_form] shortcode's own root, a sibling of the page's
   max-width:1440-wrapped wp:html blocks, not a child of them, so it needs its own
   centering/inset or it sits flush against the true page edge. Centered as its own block
   (not left-aligned with the hero text above it) per user request. */

.cba-form {
	max-width: 640px;
	margin: 0 auto;
	padding: 8px 0 40px;
}

@media (max-width: 780px) {
	.cba-form {
		padding-left: 20px;
		padding-right: 20px;
	}
}

.cba-form__radio-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 32px;
}

.cba-form__radio {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border: 1.5px solid #e1e1da;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cba-form__radio:hover {
	border-color: var(--wp--preset--color--cba-blue);
}

.cba-form__radio input {
	accent-color: var(--wp--preset--color--cba-green-dark);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.cba-form__radio span {
	font-size: 14px;
	color: var(--wp--preset--color--cba-ink);
}

.cba-form__radio:has(input:checked) {
	border-color: var(--wp--preset--color--cba-green-dark);
	background: #f3f8f3;
}

.cba-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.cba-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.cba-form__field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--cba-ink);
}

.cba-form__field input,
.cba-form__field textarea {
	font-family: 'DM Sans', system-ui, sans-serif;
	font-size: 14px;
	padding: 12px 14px;
	border: 1.5px solid #d8dae6;
	background: #fff;
	color: var(--wp--preset--color--cba-ink);
}

.cba-form__field input:focus,
.cba-form__field textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--cba-blue);
}

.cba-form__submit {
	display: inline-flex;
	align-items: center;
	padding: 15px 32px;
	background: var(--wp--preset--color--cba-green-dark);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	border: none;
	cursor: pointer;
	font-family: 'DM Sans', system-ui, sans-serif;
}

.cba-form__submit:hover {
	background: #256428;
}

.cba-form__notice {
	padding: 16px 20px;
	margin-bottom: 24px;
	font-size: 14px;
}

.cba-form__notice--success {
	background: #f3f8f3;
	color: #256428;
	border: 1px solid #c9e4cb;
}

.cba-form__notice--error {
	background: #fdf3f2;
	color: #a8341f;
	border: 1px solid #f0cec8;
}

@media (max-width: 780px) {
	.cba-form__row {
		grid-template-columns: 1fr;
	}
}
