﻿/*
Theme Name: MRS Analitica
Theme URI: https://mrsanalitica.com/
Author: MRS Analitica
Author URI: https://mrsanalitica.com/
Description: Child theme of Twenty Twenty-Five for MRS Analitica. MRS brand palette via theme.json. Professional design layer: hero video, service cards, brand row, FAQ accordion, polished header/footer. Core blocks only.
Version: 1.1.0
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mrs-analitica
Template: twentytwentyfive
*/

/* ==========================================================================
   1. Base refinements
   ========================================================================== */

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
	overflow-wrap: break-word;
}

p {
	overflow-wrap: break-word;
}

::selection {
	background: #07529d;
	color: #ffffff;
}

a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 3px solid #0979be;
	outline-offset: 2px;
}

/* ==========================================================================
   2. Header
   ========================================================================== */

.mrs-header {
	position: sticky;
	top: 0;
	z-index: 90;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	box-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
}

.mrs-header .wp-block-site-logo img {
	max-height: 52px;
	width: auto;
	object-fit: contain;
}

.mrs-header .wp-block-site-title {
	line-height: 1.1;
}

.mrs-header .wp-block-navigation ul {
	gap: 0.25rem;
}

.mrs-header .wp-block-navigation-item {
	border-radius: 8px;
	transition: background-color 0.2s ease;
}

.mrs-header .wp-block-navigation-item:hover {
	background: #e8f1fb;
}

.mrs-nav-cta .wp-block-button__link {
	padding-left: 1.25rem;
	padding-right: 1.25rem;
	box-shadow: 0 4px 14px rgba(7, 82, 157, 0.3);
}

/* ==========================================================================
   3. Buttons
   ========================================================================== */

.wp-block-button__link {
	box-shadow: 0 4px 14px rgba(7, 82, 157, 0.22);
	transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(7, 82, 157, 0.34);
	filter: brightness(1.06);
}

.wp-block-buttons .wp-block-button:last-child .wp-block-button__link {
	margin-right: 0;
}

/* ==========================================================================
   4. Hero (cover with video)
   ========================================================================== */

.mrs-hero {
	position: relative;
}

.mrs-hero .wp-block-cover__background {
	opacity: 0.9;
	background-image: linear-gradient(
		115deg,
		rgba(20, 26, 51, 0.94) 0%,
		rgba(7, 82, 157, 0.82) 52%,
		rgba(9, 121, 190, 0.6) 100%
	);
}

.mrs-hero .wp-block-cover__inner-container {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}

.mrs-hero h1 {
	font-size: clamp(2.5rem, 5.4vw, 4.25rem);
	line-height: 1.06;
	letter-spacing: -0.025em;
	color: #ffffff;
	text-shadow: 0 2px 24px rgba(10, 16, 40, 0.45);
}

.mrs-hero p.has-large-font-size,
.mrs-hero .mrs-hero-tagline {
	color: #ffffff;
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	line-height: 1.5;
	text-shadow: 0 1px 12px rgba(10, 16, 40, 0.5);
}

.mrs-hero p:not(.has-large-font-size) {
	color: rgba(255, 255, 255, 0.92);
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

.mrs-hero .wp-block-buttons {
	margin-top: 2.25rem;
}

/* ==========================================================================
   5. Sections & cards
   ========================================================================== */

.mrs-section-white,
.mrs-section-tint {
	padding-top: 6rem;
	padding-bottom: 6rem;
}

@media (max-width: 781px) {
	.mrs-section-white,
	.mrs-section-tint {
		padding-top: 4rem;
		padding-bottom: 4rem;
	}
}

/* Generic white-rounded card (used on Catálogos and any legacy card markup) */
.wp-block-group[style*="border-radius:8px"],
.mrs-service-card {
	border: 1px solid #e6ebf2;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
	transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.wp-block-group[style*="border-radius:8px"]:hover,
.mrs-service-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 38px rgba(7, 82, 157, 0.16);
	border-color: #c9ddf3;
}

/* Stacked service cards size to their content, with buttons at the bottom. */
.mrs-service-card {
	height: auto;
	display: flex;
	flex-direction: column;
	border-radius: 14px;
}

.wp-block-column > .mrs-service-card {
	height: auto;
	margin-block-start: 0;
}
.wp-block-column:has(> .mrs-service-card) {
	display: grid;
	grid-template-rows: repeat(2, 1fr);
	gap: 1.5rem;
}

.mrs-service-card .wp-block-heading {
	margin-top: 0;
}

.mrs-service-card .wp-block-buttons {
	margin-top: auto;
	padding-top: 1.25rem;
}

.mrs-service-card .wp-block-button__link {
	box-shadow: none;
}

/* Reasons: small gradient bar above each heading */
.mrs-reasons .wp-block-column {
	text-align: center;
}

.mrs-reasons h3 {
	padding-top: 1rem;
}

.mrs-reasons h3::before {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, #07529d, #0979be);
	margin: 0 auto 0.9rem;
}

/* ==========================================================================
   6. Orthodyne feature section
   ========================================================================== */

.mrs-orthodyne .wp-block-heading {
	color: #07529d;
}

.mrs-orthodyne p {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   7. Stats band
   ========================================================================== */

.mrs-stats {
	background-image: linear-gradient(120deg, #053f7c 0%, #07529d 60%, #0979be 100%);
}

.mrs-stats .wp-block-column {
	border-radius: 14px;
	padding: 1.75rem 1.25rem;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.16);
	transition: transform 0.25s ease, background 0.3s ease;
}

.mrs-stats .wp-block-column:hover {
	transform: translateY(-4px);
	background: rgba(255, 255, 255, 0.12);
}

.mrs-stats h3 {
	color: #ffffff;
	font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.mrs-stats p {
	color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   8. Industries — chips
   ========================================================================== */

.mrs-industries {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.9rem;
}

.mrs-industry-chip {
	background: #e8f1fb;
	border: 1px solid #d3e3f5;
	border-radius: 999px;
	padding: 0.65rem 1.6rem;
	transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.mrs-industry-chip:hover {
	background: #d9eef9;
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(7, 82, 157, 0.18);
}

.mrs-industry-chip p {
	white-space: nowrap;
	font-weight: 600;
	color: #07529d;
	margin: 0;
}

/* ==========================================================================
   9. FAQ — accordion (core details)
   ========================================================================== */

.mrs-faq {
	max-width: 820px;
	margin-left: auto;
	margin-right: auto;
}

.wp-block-details.mrs-faq-item {
	border: 1px solid #e0e7ef;
	border-radius: 12px;
	background: #ffffff;
	padding: 0;
	margin-bottom: 0.9rem;
	box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.wp-block-details.mrs-faq-item:hover {
	border-color: #c9ddf3;
	box-shadow: 0 8px 22px rgba(7, 82, 157, 0.12);
}

.wp-block-details.mrs-faq-item[open] {
	border-color: #0979be;
}

.wp-block-details.mrs-faq-item summary {
	cursor: pointer;
	list-style: none;
	font-weight: 600;
	color: #1f2647;
	padding: 1.1rem 1.4rem;
	border-radius: 12px;
	position: relative;
	transition: color 0.2s ease;
}

.wp-block-details.mrs-faq-item summary::-webkit-details-marker {
	display: none;
}

.wp-block-details.mrs-faq-item summary::after {
	content: "+";
	position: absolute;
	right: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.4rem;
	font-weight: 500;
	color: #07529d;
	transition: transform 0.25s ease;
}

.wp-block-details.mrs-faq-item[open] summary::after {
	transform: translateY(-50%) rotate(45deg);
	color: #0979be;
}

.wp-block-details.mrs-faq-item summary:hover {
	color: #07529d;
}

.wp-block-details.mrs-faq-item > .wp-block-paragraph {
	padding: 0 1.4rem 1.15rem;
	margin: 0;
}

/* ==========================================================================
   10. Brand logos row
   ========================================================================== */

.mrs-brand-row .wp-block-column {
	display: flex;
	align-items: center;
	justify-content: center;
}

.mrs-brand-row figure.wp-block-image {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
}

.mrs-brand-row figure.wp-block-image img {
	height: 52px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	filter: grayscale(1) opacity(0.65);
	transition: filter 0.3s ease, transform 0.3s ease;
}

.mrs-brand-row figure.wp-block-image:hover img {
	filter: grayscale(0) opacity(1);
	transform: scale(1.08);
}

/* ==========================================================================
   11. FAQ / CTA / section helpers
   ========================================================================== */

.mrs-cta-final .wp-block-button__link {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   12. Footer
   ========================================================================== */

.mrs-footer h4 {
	text-transform: uppercase;
	letter-spacing: 0.09em;
	font-size: 0.85rem !important;
	color: #9fb6cd;
	margin-bottom: 1rem;
}

.mrs-footer p {
	color: rgba(255, 255, 255, 0.85);
}

.mrs-footer a {
	color: rgba(255, 255, 255, 0.85);
	transition: color 0.2s ease;
}

.mrs-footer a:hover {
	color: #ffffff;
}

.mrs-footer .wp-block-navigation a {
	color: rgba(255, 255, 255, 0.85);
}

.mrs-footer .wp-block-navigation a:hover {
	color: #ffffff;
	text-decoration: underline;
}

.mrs-footer .wp-block-button__link {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.mrs-footer .wp-block-separator {
	max-width: 100%;
}

/* ==========================================================================
   13. Responsive polish
   ========================================================================== */

@media (max-width: 781px) {
	.mrs-header .wp-block-button__link {
		padding-left: 0.9rem;
		padding-right: 0.9rem;
		font-size: 0.9rem;
	}

	.mrs-hero h1 {
		/* S3 hero-crop fix: the 2.1rem/9vw floor rendered ~35px at 390px, and
		   text-wrap:balance packed the last line edge-to-edge (right-edge crop
		   look, zero headroom for cross-device font metrics). Smaller fluid
		   size keeps clear margins on narrow viewports; desktop untouched. */
		font-size: clamp(1.55rem, 7.2vw, 2.3rem);
	}

	.mrs-brand-row figure.wp-block-image img {
		height: 40px;
	}

	.mrs-industry-chip p {
		white-space: normal;
		text-align: center;
	}
}

@media (max-width: 400px) {
	.mrs-header .wp-block-site-logo img {
		max-height: 40px;
	}

	.mrs-header .wp-block-site-title {
		font-size: 1rem !important;
	}
}

/* ==========================================================================
   14. Content / product photos (M2.6)
   ========================================================================== */

.mrs-content-image {
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.mrs-content-image img {
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.mrs-content-image figcaption {
	margin-top: 0.75rem;
	font-size: 0.85rem;
	color: #5b6b7f;
	text-align: center;
}

/* Layout repair: retain block alignment controls and readable dark sections. */
.mrs-footer h3,
.mrs-cta-final .wp-block-heading {
	color: #ffffff;
}
.mrs-footer .wp-block-button__link {
	color: #1f2647 !important;
}
.wp-block-post-content > .alignfull {
	padding-inline: 1.5rem;
}
@media (max-width: 781px) {
	.wp-block-post-content > .wp-block-group.alignfull,
	.mrs-hero {
		padding-top: 3rem !important;
		padding-bottom: 3rem !important;
	}
	.wp-block-column:has(> .mrs-service-card) {
		grid-template-rows: none;
	}
	.mrs-header > .wp-block-group {
		flex-wrap: wrap;
		gap: 1rem;
	}
	.mrs-header > .wp-block-group > .wp-block-group {
		justify-content: space-between;
		width: 100%;
	}
}

/* ==========================================================================
   15. Sober motion + quote-flow helpers (Slice A1)
   Uniform 200-300ms ease; transform/opacity only (no layout shift).
   ========================================================================== */

:root {
	--mrs-motion-fast: 200ms;
	--mrs-motion-base: 250ms;
	--mrs-motion-slow: 300ms;
	--mrs-motion-ease: ease;
}

/* Scroll reveal as progressive enhancement: content is fully visible by
   default (no-JS safe); the hidden state applies only when JS runs. */
.mrs-reveal {
	opacity: 1;
	transform: none;
}
html.js .mrs-reveal {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity var(--mrs-motion-slow) var(--mrs-motion-ease),
		transform var(--mrs-motion-slow) var(--mrs-motion-ease);
	will-change: opacity, transform;
}
html.js .mrs-reveal.is-visible {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/* Active nav item: underline ink for aria-current="page". */
.mrs-header .wp-block-navigation-item__content[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

/* Response promise next to the quote form (editor-editable paragraph). */
.mrs-promise {
	font-weight: 600;
	color: var(--wp--preset--color--mrs-navy, #1f2647);
	margin-bottom: 1rem;
}

/* Touch devices: no lift, no sticky hover states. */
@media (hover: none) {
	.wp-block-button__link:hover,
	.mrs-service-card:hover,
	.mrs-stats .wp-block-column:hover,
	.mrs-industry-chip:hover {
		transform: none;
		box-shadow: none;
	}
}

/* Reduced motion: static page, reveal shown immediately. */
@media (prefers-reduced-motion: reduce) {
	html.js .mrs-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.mrs-whatsapp-float .wp-block-button__link {
		transition: none;
		transform: none;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ==========================================================================
   16. Floating WhatsApp button (Slice S2, site-wide via footer part)
   Normal Button block + reusable class: stays editable in Site Editor.
   Fixed bottom-right, 56px target, below sticky header (z-index 90).
   ========================================================================== */

.mrs-whatsapp-float {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right, 0px) + 1rem);
	bottom: max(1rem, env(safe-area-inset-bottom, 0px) + 1rem);
	z-index: 60;
	margin: 0;
	max-width: calc(100vw - 2rem);
}

.mrs-whatsapp-float .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 56px;
	min-height: 56px;
	padding: 0.9rem 1.4rem;
	border-radius: 999px;
	background-color: #25d366;
	color: #ffffff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.mrs-whatsapp-float .wp-block-button__link:hover {
	transform: translateY(-2px);
	filter: brightness(1.06);
}

.mrs-whatsapp-float .wp-block-button__link:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px #07529d, 0 8px 24px rgba(0, 0, 0, 0.28);
}

@media (hover: none) {
	.mrs-whatsapp-float .wp-block-button__link:hover {
		transform: none;
		filter: none;
	}
}

/* ==========================================================================
   17. Header nav separation (S8): small even gap between top-level links.
   Desktop only; mobile overlay and Cotización CTA untouched.
   ========================================================================== */
@media (min-width: 782px) {
	.mrs-header .wp-block-navigation ul {
		gap: 0.65rem;
	}
}

@media (max-width: 400px) {
	.mrs-whatsapp-float .wp-block-button__link {
		padding: 0.8rem 1.1rem;
	}
}

/* 18. Smart sticky header (S9) + CTA fade (S11): template part is the true
   sticky carrier; desktop-only fade of nav links AND Cotización CTA
   (mobile hamburger kept); html.js gate = full header without JS.
   visibility drops hidden links/CTA from tab order; ul nowrap keeps
   header height stable so page content never shifts. */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 90;
}
@media (min-width: 782px) {
	html.js .mrs-header .wp-block-navigation,
	html.js .mrs-header .wp-block-buttons {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 220ms ease, transform 220ms ease;
	}
	html.js .mrs-header.is-compact .wp-block-navigation,
	html.js .mrs-header.is-compact .wp-block-buttons {
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		max-width: 0;
		overflow: hidden;
		transition: opacity 220ms ease, transform 220ms ease,
			visibility 0s linear 220ms, max-width 0s linear 220ms;
	}
	html.js .mrs-header.is-compact .wp-block-navigation ul {
		flex-wrap: nowrap;
	}
	/* S11: keep the collapsing CTA on one line so its text cannot wrap
	   into a tall column and stretch the compact bar; the max-width:0
	   container above clips it while opacity fades it out. */
	html.js .mrs-header.is-compact .wp-block-buttons {
		flex-wrap: nowrap;
	}
	html.js .mrs-header.is-compact .wp-block-buttons .wp-block-button__link {
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.js .mrs-header .wp-block-navigation,
	html.js .mrs-header.is-compact .wp-block-navigation,
	html.js .mrs-header .wp-block-buttons,
	html.js .mrs-header.is-compact .wp-block-buttons {
		transition: none;
		transform: none;
	}
}
