/* ============================================================
   Fundación MATES — Home (diseño «Fundacion MATES Home», opción 1a)
   Tokens tomados de la plantilla; layout adaptado a móvil.
   ============================================================ */
:root {
  --gr-green-50:  #EAF6DF;
  --gr-green-100: #D2EDC2;
  --gr-green-200: #B6E29C;
  --gr-green-300: #9CCC7E;
  --gr-green-500: #76BC4A;
  --gr-green-600: #5FA236;
  --gr-green-700: #4A8327;
  --gr-green-900: #244414;
  --gr-gray-50:  #F6F7F6;
  --gr-gray-100: #ECECEC;
  --gr-gray-200: #D9D9D9;
  --gr-gray-300: #BFBFBF;
  --gr-gray-400: #9A9A9A;
  --gr-gray-500: #717171;
  --gr-gray-700: #3F3F3F;
  --gr-gray-900: #1A1A1A;
  --fg-1: var(--gr-gray-900);
  --fg-2: var(--gr-gray-700);
  --fg-3: var(--gr-gray-500);
  --bg-1: #FFFFFF;
  --bg-2: var(--gr-gray-50);
  --border-1: var(--gr-gray-200);
  --border-2: var(--gr-gray-300);
  --radius-2: 4px;
  --radius-3: 6px;
  --shadow-1: 0 1px 0 rgba(26,26,26,.04), 0 1px 2px rgba(26,26,26,.06);
  --shadow-focus: 0 0 0 3px rgba(118,188,74,.35);
  --font-display: "Space Grotesk", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pad-x: 48px;
  --pad-y: 64px;
}

/* ---------- Base ---------- */
.mt-home, .mt-home *, .mt-home *::before, .mt-home *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body.mt-home {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mt-home h1, .mt-home h2, .mt-home h3, .mt-home h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg-1);
  margin: 0;
  text-wrap: balance;
}
.mt-home p { margin: 0; color: var(--fg-2); text-wrap: pretty; }
.mt-home a { color: var(--gr-green-700); text-decoration: none; transition: color .18s var(--ease-out), background-color .18s var(--ease-out), border-color .18s var(--ease-out); }
.mt-home img { max-width: 100%; height: auto; display: block; }
.mt-home .ic { width: 1em; height: 1em; flex: none; }
.mt-home :focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 12px;
}
.mt-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }
.mt-skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.mt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-2);
  font: 600 14px/1 var(--font-body); cursor: pointer; white-space: nowrap;
}
.mt-btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.mt-home .mt-btn-primary { background: var(--gr-green-500); color: #fff; }
.mt-home .mt-btn-primary:hover { background: var(--gr-green-600); color: #fff; }
.mt-home .mt-btn-ghost { background: #fff; border-color: var(--border-2); color: var(--fg-1); }
.mt-home .mt-btn-ghost:hover { border-color: var(--gr-green-500); color: var(--gr-green-700); }

/* ---------- Nav ---------- */
.mt-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 68px; padding: 0 32px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-1);
}
.admin-bar .mt-nav { top: 32px; }
.mt-brand { display: flex; align-items: center; gap: 12px; color: var(--fg-1); }
.mt-brand img { width: 44px; height: 44px; object-fit: contain; }
.mt-brand > span { display: flex; flex-direction: column; line-height: 1.1; }
.mt-brand-name { font: 700 17px var(--font-display); letter-spacing: -.02em; color: var(--fg-1); }
.mt-brand-sub { font-size: 10px; letter-spacing: .04em; color: var(--fg-3); }
.mt-menu { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; }
.mt-home .mt-menu > a { color: var(--fg-2); }
.mt-home .mt-menu > a:hover { color: var(--gr-green-700); }
.mt-menu-ctas { display: flex; gap: 10px; margin-left: 8px; }
.mt-burger { display: none; background: none; border: 0; padding: 8px; font-size: 26px; color: var(--fg-1); cursor: pointer; }
.mt-burger .ic-close { display: none; }

/* ---------- Hero ---------- */
.mt-hero { display: grid; grid-template-columns: 1.05fr .95fr; border-bottom: 1px solid var(--border-1); background: var(--bg-2); }
.mt-hero-text { padding: var(--pad-y) var(--pad-x) 60px; }
.mt-hero .eyebrow { margin-bottom: 18px; }
.mt-hero h1 { font-size: 52px; line-height: 1.06; margin-bottom: 20px; }
.mt-lead { font-size: 17px; line-height: 1.6; max-width: 520px; margin-bottom: 32px !important; }
.mt-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.mt-legal { display: flex; align-items: flex-start; gap: 10px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border-1); font-size: 13px; color: var(--fg-3); }
.mt-legal .ic { color: var(--gr-green-600); font-size: 18px; }
.mt-hero-img { min-height: 520px; background: var(--gr-green-900) center/cover no-repeat; }

/* ---------- Cifras ---------- */
.mt-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg-1); border-bottom: 1px solid var(--border-1); }
.mt-stats > div { padding: 36px 32px; border-right: 1px solid var(--border-1); }
.mt-stats > div:last-child { border-right: 0; }
.mt-stats strong { display: block; font: 700 40px/1 var(--font-display); color: var(--gr-green-600); }
.mt-stats span { display: block; font-size: 13px; color: var(--fg-2); margin-top: 6px; }

/* ---------- Sobre nosotros ---------- */
.mt-about { display: grid; grid-template-columns: .9fr 1.1fr; background: var(--bg-2); border-bottom: 1px solid var(--border-1); }
.mt-about-title { padding: var(--pad-y) var(--pad-x); border-right: 1px solid var(--border-1); }
.mt-about-title h2 { font-size: 30px; line-height: 1.1; }
.mt-about-logo { width: 200px; margin-top: 36px; }
.mt-about-body { padding: var(--pad-y) var(--pad-x); display: flex; flex-direction: column; justify-content: center; }
.mt-home .mt-about-main { font-size: 17px; line-height: 1.65; color: var(--fg-1); margin-bottom: 16px; }
.mt-about-body p { line-height: 1.65; }
.mt-about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.mt-about-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-3); border: 1px solid var(--border-1); }

/* ---------- Secciones genéricas ---------- */
.mt-section { padding: var(--pad-y) var(--pad-x); background: var(--bg-2); }
.mt-section h2 { font-size: 32px; margin-bottom: 8px; }
.mt-bg-white { background: var(--bg-1); border-top: 1px solid var(--border-1); }
.mt-intro { max-width: 640px; margin-bottom: 36px !important; }
.mt-head-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; }
.mt-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.mt-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mt-card { background: #fff; border: 1px solid var(--border-1); border-radius: var(--radius-3); padding: 28px; box-shadow: var(--shadow-1); }
.mt-card h3 { font-size: 19px; margin-bottom: 8px; }
.mt-card p { font-size: 14px; }
.mt-card-ic { display: inline-flex; width: 46px; height: 46px; align-items: center; justify-content: center; background: var(--gr-green-50); border-radius: var(--radius-2); color: var(--gr-green-700); font-size: 24px; margin-bottom: 16px; }
.mt-card-img { padding: 0; overflow: hidden; }
.mt-card-photo { height: 160px; background: center/cover; }
.mt-card-pad { padding: 20px; }
.mt-tag { display: inline-block; font: 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--gr-green-700); background: var(--gr-green-50); padding: 3px 8px; border-radius: 2px; margin-bottom: 10px; }
.mt-news { display: block; }
.mt-news-meta { font: 11px var(--font-mono); color: var(--fg-3); letter-spacing: .05em; margin-bottom: 8px; }
.mt-news h4 { font-size: 17px; margin-bottom: 8px; }
.mt-allies { padding: 48px; background: var(--bg-1); border-top: 1px solid var(--border-1); border-bottom: 1px solid var(--border-1); text-align: center; }

/* ---------- Misión / visión ---------- */
.mt-mv { display: grid; grid-template-columns: 1fr 1fr; background: var(--gr-gray-900); }
.mt-mv > div { padding: 56px var(--pad-x); }
.mt-mv > div:first-child { border-right: 1px solid rgba(255,255,255,.1); }
.mt-mv .eyebrow { color: var(--gr-green-300); margin-bottom: 14px; }
.mt-home .mt-mv p { font: 500 22px/1.45 var(--font-display); color: #fff; }

/* ---------- Colaborar ---------- */
.mt-help { padding: var(--pad-y) var(--pad-x); background: var(--gr-green-500); }
.mt-help-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.mt-help-head .eyebrow { color: rgba(255,255,255,.85); }
.mt-home .mt-help-head h2 { font-size: 34px; color: #fff; margin-bottom: 12px; }
.mt-home .mt-help-head p { color: rgba(255,255,255,.92); font-size: 16px; }
.mt-help-grid { max-width: 960px; margin: 0 auto; }
.mt-help-card { background: #fff; border-radius: var(--radius-3); padding: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.mt-help-card h4 { font-size: 17px; margin-bottom: 8px; }
.mt-help-card p { font-size: 13px; margin-bottom: 16px; flex: 1; }
.mt-help-ic { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; background: var(--gr-green-50); border-radius: 50%; color: var(--gr-green-700); font-size: 24px; margin-bottom: 14px; }

/* ---------- Contacto ---------- */
.mt-contact { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-1); }
.mt-contact-form { padding: var(--pad-y) var(--pad-x); border-right: 1px solid var(--border-1); }
.mt-contact-form h2 { font-size: 30px; margin-bottom: 24px; }
#mt-form { display: flex; flex-direction: column; gap: 14px; }
.mt-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#mt-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--fg-2); }
#mt-form input, #mt-form textarea {
  font: 400 15px var(--font-body); color: var(--fg-1);
  border: 1px solid var(--border-1); border-radius: var(--radius-2); background: #fff;
  padding: 10px 12px; min-height: 42px; width: 100%; resize: vertical;
}
#mt-form input:focus, #mt-form textarea:focus { outline: none; border-color: var(--gr-green-500); box-shadow: var(--shadow-focus); }
#mt-form button { width: fit-content; }
.mt-form-note { font-size: 12px; color: var(--fg-3) !important; }
.mt-contact-info { padding: var(--pad-y) var(--pad-x); background: var(--bg-2); display: flex; flex-direction: column; gap: 22px; }
.mt-info { display: flex; gap: 14px; align-items: flex-start; }
.mt-info > .ic { color: var(--gr-green-600); font-size: 20px; margin-top: 2px; }
.mt-info > div { display: flex; flex-direction: column; font-size: 14px; color: var(--fg-2); }
.mt-info b { color: var(--fg-1); font-weight: 600; }
.mt-home .mt-info a { color: var(--fg-2); }
.mt-home .mt-info a:hover { color: var(--gr-green-700); }

/* ---------- Footer ---------- */
.mt-footer { background: var(--gr-gray-900); color: rgba(255,255,255,.7); padding: 44px var(--pad-x); }
.mt-footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.mt-footer-brand { max-width: 360px; }
.mt-footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font: 700 16px var(--font-display); color: #fff; }
.mt-footer-logo img { width: 42px; height: 42px; }
.mt-home .mt-footer p { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.6; }
.mt-footer-cols { display: flex; gap: 56px; }
.mt-footer-cols > div { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.mt-footer-cols b { color: #fff; font-weight: 600; margin-bottom: 4px; }
.mt-home .mt-footer-cols a { color: rgba(255,255,255,.65); }
.mt-home .mt-footer-cols a:hover { color: #fff; }
.mt-footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; color: rgba(255,255,255,.45); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .mt-menu { gap: 18px; }
  .mt-menu-ctas .mt-btn-ghost { display: none; }
}
@media (max-width: 960px) {
  :root { --pad-x: 24px; --pad-y: 48px; }
  .mt-nav { padding: 0 16px; }
  .mt-burger { display: inline-flex; }
  .mt-menu {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border-1);
    box-shadow: 0 12px 24px rgba(26,26,26,.08);
    padding: 8px 16px 16px;
    display: none;
  }
  .mt-nav.is-open .mt-menu { display: flex; }
  .mt-nav.is-open .ic-open { display: none; }
  .mt-nav.is-open .ic-close { display: block; }
  .mt-menu > a { padding: 14px 4px; border-bottom: 1px solid var(--border-1); font-size: 16px; }
  .mt-menu-ctas { margin: 16px 0 0; }
  .mt-menu-ctas .mt-btn, .mt-menu-ctas .mt-btn-ghost { display: inline-flex; flex: 1; height: 46px; }
  .mt-hero, .mt-about, .mt-mv, .mt-contact { grid-template-columns: 1fr; }
  .mt-hero-img { min-height: 300px; order: -1; }
  .mt-hero h1 { font-size: 38px; }
  .mt-about-title, .mt-contact-form, .mt-mv > div:first-child { border-right: 0; }
  .mt-about-title { padding-bottom: 0; }
  .mt-about-logo { width: 140px; margin-top: 24px; }
  .mt-mv > div:first-child { border-bottom: 1px solid rgba(255,255,255,.1); }
  .mt-mv > div { padding: 44px var(--pad-x); }
  .mt-home .mt-mv p { font-size: 19px; }
  .mt-stats { grid-template-columns: repeat(2, 1fr); }
  .mt-stats > div:nth-child(2) { border-right: 0; }
  .mt-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-1); }
  .mt-grid-3 { grid-template-columns: 1fr; }
  .mt-help-grid { max-width: 480px; }
}
@media (max-width: 782px) {
  .admin-bar .mt-nav { top: 46px; }
}
@media (max-width: 640px) {
  :root { --pad-x: 16px; --pad-y: 40px; }
  .mt-brand-sub { display: none; }
  .mt-hero h1 { font-size: 30px; }
  .mt-lead { font-size: 16px; }
  .mt-actions .mt-btn { flex: 1 1 100%; }
  .mt-section h2, .mt-about-title h2, .mt-contact-form h2 { font-size: 26px; }
  .mt-home .mt-help-head h2 { font-size: 28px; }
  .mt-grid-2, .mt-row-2 { grid-template-columns: 1fr; }
  .mt-card { padding: 22px; }
  .mt-about-photos { gap: 10px; }
  #mt-form button { width: 100%; }
  .mt-footer-cols { gap: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
