/*
Theme Name: COJASA
Theme URI: https://cojasa.com
Description: Tema a la medida para COJASA, Ingeniería & Construcción. Portada de una página y portafolio de proyectos.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: cojasa
*/

:root {
	/* Colores del manual de identidad: no agregar otros */
	--navy: #0B1F40;      /* Azul institucional */
	--navy-deep: #0B1F40;
	--navy-line: #0F2A51; /* Azul medio */
	--teal: #008B8A;      /* Turquesa profundo */
	--teal-soft: #E3E4E3;
	--concrete: #E3E4E3;  /* Neutro */
	--steel: #0F2A51;
	--ink: #0B1F40;
	--white: #FFFFFF;
	--cut: 26px;
	--wrap: 1200px;
	--gutter: clamp(20px, 4vw, 48px);
	--f: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--fh: "Montserrat", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
	margin: 0;
	font-family: var(--f);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--ink);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2 { font-family: var(--fh); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; line-height: 1.18; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin-bottom: .2em; }
h3 { font-family: var(--fh); font-weight: 500; font-size: 1.15rem; line-height: 1.3; margin: 0 0 .5em; }
.sub { font-family: var(--fh); font-weight: 500; font-size: clamp(1.15rem, 1.8vw, 1.45rem); color: var(--teal); margin: 0 0 1.2em; }
p { margin: 0 0 1em; max-width: 68ch; }
@media (max-width: 520px) { h1 { font-size: 1.6rem; letter-spacing: .06em; } h2 { font-size: 1.45rem; } }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }

/* Botones */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 50px; padding: 0 26px;
	font: 600 1rem/1 var(--fh);
	text-decoration: none; border: 2px solid transparent; cursor: pointer;
	clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
	transition: background-color .15s, color .15s, border-color .15s;
}
.btn--solid { background: var(--teal); color: var(--white); }
.btn--solid:hover { background: var(--white); color: var(--navy); }
.btn--ghost { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--navy); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--teal); color: var(--white); }

/* Encabezado */
.site-header {
	position: fixed; inset: 0 0 auto; z-index: 50;
	transition: background-color .25s, box-shadow .25s;
}
.site-header.is-solid, .site-header--solid { background: var(--navy); box-shadow: 0 1px 0 var(--navy-line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.site-header__logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--white); text-decoration: none; font-family: var(--fh); font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--teal); }
.nav .btn { min-height: 42px; padding: 0 20px; color: var(--white); }
.nav .btn:hover { color: var(--navy); }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: currentColor; margin: 5px 0; }

@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.nav {
		position: fixed; inset: 76px 0 auto; flex-direction: column; align-items: stretch; gap: 0;
		background: var(--navy); padding: 8px var(--gutter) 24px; display: none;
	}
	.nav.is-open { display: flex; }
	.nav a { padding: 14px 0; border-bottom: 1px solid var(--navy-line); font-size: 1.1rem; }
	.nav .btn { margin-top: 16px; border-bottom: 0; }
}

/* Hero */
.hero {
	position: relative; min-height: min(92vh, 860px);
	display: flex; align-items: flex-end;
	color: var(--white); background: var(--navy-deep);
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 64px), 0 100%);
	padding: 140px 0 140px;
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(7,21,44,.92) 0%, rgba(7,21,44,.72) 45%, rgba(7,21,44,.15) 100%),
	            linear-gradient(0deg, rgba(7,21,44,.6) 0%, rgba(7,21,44,0) 40%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 22ch; margin-bottom: .45em; }
.hero p { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgba(255,255,255,.88); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__credit {
	position: absolute; right: var(--gutter); bottom: 92px; z-index: 1;
	font-size: .8rem; color: rgba(255,255,255,.72); max-width: 32ch; text-align: right;
}
@media (max-width: 700px) { .hero__credit { display: none; } .hero { padding-bottom: 110px; } }

/* Secciones */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--concrete { background: var(--concrete); }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy a:not(.btn) { color: var(--teal-soft); }
.section__head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: 48px; }
.section__head p { color: var(--steel); margin: 0; }
.section--navy .section__head p { color: rgba(255,255,255,.75); }
@media (max-width: 800px) { .section__head { grid-template-columns: 1fr; } }

/* Nosotros */
.about { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.about__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__text p { color: #2A3A52; }
.about__mv { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 36px 0 32px; padding-top: 28px; border-top: 1px solid #D5DAD8; }
.about__mv h3 { font-size: 1.05rem; color: var(--teal); font-weight: 600; margin-bottom: .4em; }
.about__mv p { font-size: .97rem; margin: 0; }
.values { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.values li { padding: 6px 14px; background: var(--concrete); font-size: .92rem; font-weight: 500; }
@media (max-width: 860px) {
	.about { grid-template-columns: 1fr; }
	.about__img { order: -1; }
	.about__img img { aspect-ratio: 16 / 10; }
	.about__mv { grid-template-columns: 1fr; }
}

/* Servicios */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 28px; }
.service img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 18px; }
.service h3 { margin-bottom: .45em; }
.service p { font-size: .95rem; color: var(--steel); margin: 0; }
@media (max-width: 1000px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } }

/* Tarjetas de proyecto (portada y página) */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.projects--feature .project:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.projects--feature .project:nth-child(1) .project__img img { aspect-ratio: auto; height: 100%; }
.projects--feature .project:nth-child(1) .project__img { height: calc(100% - 104px); }
.project { display: block; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; text-align: left; font: inherit; cursor: pointer; width: 100%; }
.project__img { display: block; overflow: hidden; background: var(--navy-line); margin-bottom: 16px; }
.project__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.project:hover .project__img img, .project:focus-visible .project__img img { transform: scale(1.04); }
.project__year { display: block; font-family: var(--fh); font-weight: 600; letter-spacing: .1em; font-size: 1.3rem; line-height: 1; color: var(--teal); }
.section--navy .project__year { color: var(--teal); }
.project__title { display: block; font-family: var(--fh); font-size: 1.08rem; font-weight: 500; line-height: 1.3; margin: 6px 0 4px; }
.project__meta { display: block; font-size: .9rem; color: var(--steel); }
.section--navy .project__meta { color: rgba(255,255,255,.7); }
.projects__more { margin-top: 48px; }
@media (max-width: 960px) {
	.projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.projects--feature .project:nth-child(1) { grid-row: auto; }
	.projects--feature .project:nth-child(1) .project__img { height: auto; }
	.projects--feature .project:nth-child(1) .project__img img { aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
	.projects { grid-template-columns: 1fr; }
	.projects--feature .project:nth-child(1) { grid-column: auto; }
}

/* Experiencia */
.experience { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); }
.list-hex { list-style: none; margin: 0; padding: 0; }
.list-hex li { position: relative; padding: 12px 0 12px 30px; border-bottom: 1px solid #D5DAD8; font-weight: 500; }
.list-hex li::before {
	content: ""; position: absolute; left: 0; top: 19px; width: 13px; height: 14px; background: var(--teal);
	clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.experience h3 { font-size: 1.05rem; color: var(--teal); margin: 0 0 8px; }
@media (max-width: 800px) { .experience { grid-template-columns: 1fr; } }

/* Clientes */
.clients { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 56px; list-style: none; margin: 0; padding: 0; }
.clients img { height: 64px; width: auto; max-width: 180px; object-fit: contain; filter: grayscale(1); opacity: .8; mix-blend-mode: multiply; transition: filter .2s, opacity .2s; }
.clients li:hover img { filter: none; opacity: 1; }

/* Contacto */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 88px); }
.contact__data { list-style: none; padding: 0; margin: 28px 0 0; }
.contact__data li { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.15); }
.contact__data span { display: block; font-size: .85rem; color: rgba(255,255,255,.6); }
.contact__data a { color: var(--white); text-decoration: none; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: block; font-size: .9rem; margin-bottom: 6px; color: rgba(255,255,255,.8); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
	width: 100%; font: inherit; color: var(--white); background: var(--navy-line);
	border: 1px solid rgba(255,255,255,.2); padding: 13px 14px; border-radius: 0;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--teal-soft); outline: none; }
.form .hp { position: absolute; left: -9999px; }
.notice { grid-column: 1 / -1; padding: 14px 16px; font-weight: 500; }
.notice--ok { background: var(--teal); border-left: 4px solid var(--white); }
.notice--err { background: var(--navy-line); border-left: 4px solid var(--white); }
@media (max-width: 860px) { .contact, .form { grid-template-columns: 1fr; } }

/* Pie */
.site-footer { background: var(--navy-line); color: rgba(255,255,255,.7); padding: 56px 0 32px; font-size: .92rem; }
.site-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; align-items: flex-start; }
.site-footer img { height: 92px; width: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--teal-soft); }
.site-footer__legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); }

/* Página de proyectos */
.page-hero { background: var(--navy); color: var(--white); padding: 150px 0 72px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%); }
.page-hero p { color: rgba(255,255,255,.8); font-size: 1.15rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filters button {
	font: 500 .95rem/1 var(--fh); padding: 11px 16px; cursor: pointer;
	background: var(--concrete); color: var(--ink); border: 0;
}
.filters button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.filters button:hover { background: var(--teal); color: var(--white); }
.filters small { opacity: .65; margin-left: 4px; }
.project[hidden] { display: none; }
.project__count { display: block; margin-top: 4px; font-size: .85rem; color: var(--teal); font-weight: 600; }

/* Visor de fotos */
.lightbox { position: fixed; inset: 0; z-index: 100; background: var(--navy); color: var(--white); display: none; }
.lightbox.is-open { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__top { display: flex; justify-content: space-between; gap: 20px; padding: 18px var(--gutter); align-items: flex-start; }
.lightbox__top h2 { font-size: 1.1rem; margin: 0 0 4px; }
.lightbox__top p { margin: 0; color: rgba(255,255,255,.75); font-size: .95rem; }
.lightbox__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 72px; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { background: none; border: 0; color: var(--white); cursor: pointer; font: inherit; }
.lightbox .lightbox__close { font-size: 2.2rem; line-height: 1; width: 44px; height: 44px; }
.lightbox__nav { position: absolute; top: 50%; translate: 0 -50%; width: 56px; height: 72px; font-size: 2.4rem !important; background: rgba(255,255,255,.06) !important; }
.lightbox__nav:hover { background: var(--teal) !important; }
.lightbox__prev { left: 8px; } .lightbox__next { right: 8px; }
.lightbox__bottom { padding: 14px var(--gutter) 20px; text-align: center; font-size: .9rem; color: rgba(255,255,255,.7); }
@media (max-width: 600px) { .lightbox__stage { padding: 0 8px; } .lightbox__nav { top: auto; bottom: -64px; translate: none; height: 48px; } }

/* Proyecto individual */
.single-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.single-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 700px) { .single-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.entry { max-width: 760px; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; }
}

/* Palabra de fondo, como en el manual de marca */
[data-fondo] { position: relative; }
[data-fondo]::before {
	content: attr(data-fondo); position: absolute; left: -.04em; top: -.62em; z-index: 0; pointer-events: none;
	font-family: var(--fh); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; line-height: 1;
	font-size: clamp(3.6rem, 10vw, 8.5rem); color: var(--navy); opacity: .05; white-space: nowrap;
}
.section--navy [data-fondo]::before, .page-hero [data-fondo]::before { color: var(--white); opacity: .06; }
[data-fondo] > * { position: relative; z-index: 1; }
.section, .page-hero { overflow: hidden; }
.section__head .sub { margin-bottom: 0; }
.section__intro p { color: var(--steel); }
.section--navy .sub { color: var(--teal); }
.section__head .sub, .about__text .sub { color: var(--teal); }
.section--navy .section__head .sub, .section--navy .sub { color: var(--teal); }
[data-fondo]::before { top: -.5em; }
.project { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.projects--feature .project:nth-child(1) .project__img { flex: 1 1 auto; height: auto; min-height: 320px; position: relative; }
.projects--feature .project:nth-child(1) .project__img img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
@media (max-width: 960px) {
	.projects--feature .project:nth-child(1) .project__img { min-height: 0; position: static; }
	.projects--feature .project:nth-child(1) .project__img img { position: static; aspect-ratio: 16 / 9; }
}
