/* ==========================================================================
   Dirección de Evaluación de la Investigación y los Estudios Avanzados
   Sitio temporal — paleta e identidad UAEMéx / Secretaría de Ciencia
   ========================================================================== */

:root {
	--color-primary: #526855;   /* verde institucional */
	--color-secondary: #CA9E52; /* dorado */
	--color-accent: #BC944D;    /* dorado acento / enlaces */
	--color-text: #333333;
	--color-text-soft: #505050;
	--color-gray: #818181;
	--color-gray-light: #F5F4F4;
	--color-brown: #342414;     /* café oscuro — botones de acordeón */
	--color-departments-bg: #EDEDED;
	--color-white: #FFFFFF;

	--font-heading: "DM Sans", sans-serif;
	--font-body: "Titillium Web", sans-serif;

	--wrap-width: 1200px;
	--transition: 0.3s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-white);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary); }

.wrap {
	max-width: var(--wrap-width);
	margin: 0 auto;
	padding: 0 24px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--color-primary);
	color: #fff;
	padding: 10px 16px;
	z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: var(--color-white);
	box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.top-bar {
	background: var(--color-primary);
	color: #fff;
	font-size: 13px;
}

.top-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-top: 8px;
	padding-bottom: 8px;
	flex-wrap: wrap;
}

.top-bar-item {
	color: #fff;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	opacity: 0.92;
}
.top-bar-item:hover { color: var(--color-secondary); opacity: 1; }

.icon { width: 14px; height: 14px; display: inline-block; }
.icon-mail::before { content: "\2709"; }
.icon-phone::before { content: "\260E"; }

.top-bar-social {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
}
.top-bar-social a { display: inline-flex; }
.top-bar-social svg {
	width: 16px;
	height: 16px;
	fill: #fff;
	transition: fill var(--transition), transform var(--transition);
}
.top-bar-social a:hover svg {
	fill: var(--color-secondary);
	transform: translateY(-2px);
}

.main-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-top: 14px;
	padding-bottom: 14px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-shrink: 0;
}
.brand-logo img { height: 56px; width: auto; }

.main-nav { display: flex; align-items: center; }

.nav-list {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 36px;
	margin: 0;
	padding: 0;
}

.nav-link {
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
	position: relative;
	padding: 6px 2px;
}

.nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 100%;
	bottom: 0;
	height: 2px;
	background: var(--color-secondary);
	transition: right var(--transition);
}
.nav-link:hover::after,
.nav-link--active::after { right: 0; }

.nav-link--active {
	color: var(--color-primary);
}

.nav-break { display: block; }

.nav-toggle {
	position: relative;
	z-index: 2;
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 34px;
	height: 34px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}
.nav-toggle span {
	display: block;
	height: 2px;
	background: var(--color-primary);
	border-radius: 2px;
	transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.is-open span { background: #fff; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
	position: relative;
	min-height: 460px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: url("../img/hero-bg.jpg") center bottom / cover no-repeat;
}

.hero-overlay {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0.4;
}

.hero-inner {
	position: relative;
	z-index: 1;
	padding: 60px 24px;
}

.hero-title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 45px;
	line-height: 1.15;
	color: #fff;
	text-align: center;
	margin: 0;
	text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

@media (max-width: 768px) {
	.hero-title { font-size: 28px; }
	.hero { min-height: 320px; }
}

.contact-line {
	display: flex;
	justify-content: flex-end;
}

.contact-line p {
	margin: -10px 24px 0 0;
	background: var(--color-gray);
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 14px;
	text-align: center;
	width: 280px;
	max-width: 90vw;
	padding: 10px 16px;
	border-radius: 0 0 30px 30px;
	position: relative;
	z-index: 2;
}
.contact-line .dot { color: #fff; margin: 0 6px; }
.contact-line a { color: #fff; }
.contact-line a:hover { color: var(--color-secondary); }

@media (max-width: 600px) {
	.contact-line { justify-content: center; }
	.contact-line p { margin-right: 0; }
}

/* ---------- Acerca de ---------- */

.section-kicker {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 20px;
	color: var(--color-secondary);
	margin: 0 0 10px;
	letter-spacing: 1px;
}
.section-kicker--light {
	color: var(--color-brown);
	font-weight: 600;
	font-size: 22px;
	text-align: center;
	margin-bottom: 16px;
}

.about { padding: 64px 0; }

.about-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
}

.about-text p {
	color: var(--color-text-soft);
	font-family: var(--font-heading);
	font-size: 18px;
	line-height: 22px;
	text-align: justify;
}

.about-image img {
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

@media (max-width: 860px) {
	.about-grid { grid-template-columns: 1fr; gap: 28px; }
	.about-image { order: -1; }
}

/* ---------- Departamentos / Accordion ---------- */

.departments {
	background: var(--color-departments-bg);
	padding: 56px 0 64px;
}

.accordion {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 24px;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}

.accordion-item {
	border-radius: 10px;
	overflow: hidden;
}

.accordion-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: var(--color-brown);
	border: none;
	border-bottom: 1px solid #fff;
	cursor: pointer;
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 20px;
	line-height: 1.2;
	text-align: left;
	padding: 20px;
	border-radius: 10px;
	transition: background var(--transition), border-radius var(--transition);
}
.accordion-item.is-active .accordion-trigger {
	background: var(--color-gray);
	border-bottom: none;
	border-radius: 10px 10px 0 0;
}

.accordion-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	position: relative;
}
.accordion-icon::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 12px;
	height: 12px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-45deg);
}
.accordion-item.is-active .accordion-icon::before {
	transform: rotate(45deg);
}

.accordion-panel {
	max-height: 0;
	overflow: hidden;
	background: #fff;
	transition: max-height 0.35s ease;
}
.accordion-item.is-active .accordion-panel {
	padding: 0;
}

.accordion-panel p {
	margin: 0;
	color: #444444;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.4;
	padding: 20px;
}

/* ---------- Footer ---------- */

.site-footer {
	background: var(--color-white);
	position: relative;
	overflow: hidden;
}

.footer-deco { width: 100%; height: auto; }
.footer-deco--top { margin-bottom: -1px; }
.footer-deco--bottom { margin-top: -1px; }

.footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
	padding: 32px 24px;
}

.footer-logo { height: 40px; width: auto; }

.footer-address {
	text-align: right;
	color: var(--color-text);
	font-size: 14px;
}
.footer-address p { margin: 2px 0; }

@media (max-width: 600px) {
	.footer-inner { flex-direction: column; text-align: center; }
	.footer-address { text-align: center; }
}

/* ---------- Reveal-on-scroll animations ---------- */

.reveal {
	opacity: 0;
	transition: opacity 0.7s ease, transform 0.7s ease;
	will-change: opacity, transform;
}
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-down  { transform: translateY(-30px); }
.reveal-up    { transform: translateY(30px); }

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive nav ---------- */

@media (max-width: 900px) {
	.nav-toggle { display: flex; }

	.nav-list {
		position: fixed;
		top: 0;
		right: 0;
		height: 100vh;
		width: min(320px, 82vw);
		background: var(--color-primary);
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 6px;
		padding: 90px 28px 28px;
		transform: translateX(100%);
		transition: transform var(--transition);
		z-index: 1;
	}
	.nav-list.is-open { transform: translateX(0); }

	.nav-link { color: #fff; text-align: left; padding: 12px 0; width: 100%; }
	.nav-link--active { color: var(--color-secondary); }
	.nav-link::after { display: none; }

	.top-bar-inner { justify-content: center; text-align: center; }
	.top-bar-social { margin-left: 0; }
}
