/* =========================================================
   AiQUOS — Hoja de estilos principal
   Réplica fiel del diseño visual original (colores, tipografía
   Raleway, botones, hero a pantalla completa) con los problemas
   de responsive corregidos: cabeceras que nunca se cortan ni
   desbordan, menú móvil funcional, sin mezcla de idiomas.
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-text: #212121;
  --color-text-soft: #575757;
  --color-heading: #555555;
  --color-primary: #005e75;
  --color-primary-dark: #014c6c;
  --color-footer-bg: #014c6c;
  --color-footer-text: #d7e6ea;
  --color-border: #e6e6e6;
  --color-section-alt: #f3f3f3;
  --color-section-alt-2: #f7f7f7;

  --font-base: "Raleway", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  --container-max: 1200px;
  --header-height: 84px;

  /* Fluid, clamped type scale: matches the desktop sizes on the
     real site (56px h1 / 25.6px h2) but NEVER overflows the
     viewport on small screens — this is the fix for the cut-off
     headings bug on the current WordPress site. */
  --fs-h1: clamp(1.9rem, 1.2rem + 3.2vw, 3.5rem);
  --fs-h2: clamp(1.4rem, 1.15rem + 1.1vw, 1.6rem);
  --fs-h3: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --fs-lead: clamp(1rem, 0.92rem + 0.4vw, 1.35rem);
  --fs-body: 1rem;

  --radius: 4px;
  --transition: 0.25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: var(--fs-body);
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

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

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-heading);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  max-width: 100%;
}
h1 { font-size: var(--fs-h1); letter-spacing: 0.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; color: var(--color-text); }
.lead { font-size: var(--fs-lead); color: var(--color-text-soft); font-weight: 400; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.95em 2.1em;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.97rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 2px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.btn:hover, .btn:focus-visible { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}
.logo img { height: 38px; width: auto; }

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

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block;
  padding: 12px 13px;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 4px;
  color: var(--color-text-soft);
  transition: color var(--transition), background var(--transition);
}
.nav-list > li > a:hover,
.nav-list > li > a:focus-visible,
.nav-list > li.active > a {
  color: var(--color-primary);
}

.has-submenu > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 7px;
  vertical-align: middle;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(1, 76, 108, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.submenu li a {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  color: var(--color-text-soft);
}
.submenu li a:hover, .submenu li a:focus-visible {
  background: var(--color-section-alt);
  color: var(--color-primary);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}
.lang-switch a {
  padding: 6px 9px;
  border-radius: 4px;
  color: var(--color-text-soft);
}
.lang-switch a.active {
  color: var(--color-primary);
  background: var(--color-section-alt);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-primary);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero (full-bleed photo, like the original site) ---------- */
.hero {
  position: relative;
  min-height: clamp(360px, 56vw, 620px);
  display: flex;
  align-items: center;
  color: #fff;
  background: linear-gradient(0deg, rgba(1,20,28,0.28), rgba(1,20,28,0.1)), center/cover no-repeat var(--hero-img, none);
  background-color: var(--color-primary-dark);
  isolation: isolate;
}
.hero .container { width: 100%; }
.hero .hero-inner {
  margin-left: auto;
  max-width: 640px;
  text-align: right;
}
.hero h1 {
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 0.3em;
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
.hero .lead {
  color: #f1f6f7;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.hero-actions { margin-top: 1.4em; display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

.page-hero {
  padding: clamp(56px, 9vw, 90px) 0;
}
.page-hero .hero-inner { max-width: 720px; }

@media (max-width: 700px) {
  .hero .hero-inner { max-width: 100%; text-align: left; margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
}

/* ---------- Sections ---------- */
section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--color-section-alt); }
.section-alt-2 { background: var(--color-section-alt-2); }
.section-head { max-width: 760px; margin: 0 auto 2.4em; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 980px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 28px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: 0 18px 40px rgba(1,76,108,0.08); }
.card img { width: 56px; height: 56px; margin-bottom: 16px; object-fit: contain; }
.card h3 { margin-bottom: 0.4em; font-size: 1.1rem; }
.card p { margin: 0; font-size: 0.95rem; color: var(--color-text-soft); }

.feature-card { text-align: left; }
.feature-card ul { margin: 0; padding-left: 1.1em; color: var(--color-text-soft); font-size: 0.95rem; }
.feature-card li { margin-bottom: 0.4em; }

/* ---------- Sector rows (application-sectors index) ---------- */
/* Alternating full-width rows, like the original site, instead
   of a card grid — text + button on one side, photo on the other. */
.sector-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 340px;
}
.sector-row:nth-child(even) .sector-row-media { order: 2; }
.sector-row-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px);
}
.sector-row-content h3 { font-size: var(--fs-h2); margin-bottom: 0.5em; }
.sector-row-content p { color: var(--color-text-soft); margin-bottom: 1.4em; }
.sector-row-media { position: relative; min-height: 280px; }
.sector-row-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sector-row:nth-child(odd) { background: #ffffff; }
.sector-row:nth-child(even) { background: var(--color-section-alt); }

@media (max-width: 780px) {
  .sector-row { grid-template-columns: 1fr; min-height: 0; }
  .sector-row:nth-child(even) .sector-row-media { order: 0; }
  .sector-row-media { min-height: 240px; }
}

/* ---------- Split content ---------- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.split.reverse .split-media { order: 2; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
}

/* ---------- Sector detail intro (title repeated + lead, above the split section) ---------- */
.sector-intro { padding-bottom: 0; }
.sector-intro h2 { color: var(--color-heading); margin-bottom: 0.5em; }
.sector-intro-lead { color: var(--color-text-soft); font-size: 1.05rem; max-width: 900px; }
.sector-intro-lead em { font-style: italic; }

/* ---------- Values ---------- */
.value-item { display: flex; gap: 16px; align-items: flex-start; }
.value-item img { width: 48px; height: 48px; flex-shrink: 0; }
.value-item h3 { font-size: 1.05rem; margin-bottom: 0.3em; color: var(--color-primary); }
.value-item ul { margin: 0; padding-left: 1.1em; color: var(--color-text-soft); font-size: 0.95rem; }

/* ---------- Team ---------- */
.team-card { text-align: center; }
.team-photo {
  width: 150px; height: 150px; border-radius: 50%; overflow: hidden;
  margin: 0 auto 18px;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-card h3 { margin-bottom: 0.15em; font-size: 1.05rem; color: var(--color-text); }
.team-role { color: var(--color-primary); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6em; }
.team-card p { font-size: 0.92rem; color: var(--color-text-soft); }
.team-linkedin { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--color-primary); margin-top: 0.4em; }

/* ---------- Contact form ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .contact-wrap { grid-template-columns: 1fr; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field.full { grid-column: 1 / -1; }
label { font-size: 0.88rem; font-weight: 700; color: var(--color-text); }
input, textarea {
  font-family: var(--font-base);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
textarea { resize: vertical; min-height: 120px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--color-text-soft); margin-bottom: 12px; }
.checkbox-field input { width: auto; margin-top: 3px; }
.checkbox-field a { color: var(--color-primary); text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 68px 0 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1.6fr 1fr;
  gap: 48px;
  padding-bottom: 44px;
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
}
.footer-brand img { height: 30px; width: auto; margin-bottom: 18px; }
.footer-brand p { color: var(--color-footer-text); opacity: 0.9; margin-bottom: 1.3em; max-width: 340px; }
.footer-follow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-follow span { font-weight: 700; color: #fff; font-size: 0.95rem; }
.footer-social { display: inline-flex; width: 34px; height: 34px; flex: 0 0 auto; }
.footer-social img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.footer-heading { color: #fff; font-size: 1.1rem; margin-bottom: 0.9em; font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.footer-links a { opacity: 0.88; transition: opacity var(--transition); font-size: 0.95rem; }
.footer-links a:hover { opacity: 1; color: #fff; }

/* Thin white divider lines between each footer link, like the original site */
.footer-links-divided li { border-bottom: 1px solid rgba(255,255,255,0.2); padding: 7px 0; }
.footer-links-divided li:last-child { border-bottom: none; }

.footer-links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 560px) {
  .footer-links-grid { grid-template-columns: 1fr; gap: 0; }
}

.footer-partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 44px 0 12px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.footer-partners-label { font-size: 0.9rem; opacity: 0.9; }
.footer-partner-logo { height: 34px; width: auto; }
.footer-partner-logo-uzh { height: 46px; }

.footer-gov { display: flex; justify-content: center; padding: 22px 0 6px; }
.footer-gov img { width: 100%; max-width: 320px; height: auto; }

.footer-eu { display: flex; justify-content: center; align-items: center; gap: 32px; flex-wrap: wrap; padding: 6px 0 38px; }
.footer-eu img { height: 44px; width: auto; max-width: 160px; }

.footer-legal-row {
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.18);
  padding: 26px 0;
}
.footer-legal {
  display: flex;
  gap: 18px 36px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  text-align: center;
}

.footer-bottom-bar { background: #0a0a0a; margin-top: 8px; }
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 16px 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}
.footer-copyright { color: #fff; font-weight: 700; }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(1,76,108,0.55);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  z-index: 40;
  transition: background var(--transition), border-color var(--transition);
}
.back-to-top:hover { background: rgba(1,76,108,0.9); border-color: #fff; }
@media (max-width: 560px) {
  .back-to-top { right: 14px; bottom: 14px; width: 38px; height: 38px; font-size: 1.05rem; }
  .footer-bottom-inner { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 0 60px; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-consent {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 380px;
  width: calc(100% - 40px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.cookie-consent.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner {
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid #f4f4f4;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 20px 22px;
}
.cookie-consent-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 8px; color: var(--color-text); }
.cookie-consent-desc { font-size: 0.88rem; line-height: 1.55; color: var(--color-text-soft); margin: 0 0 16px; }
.cookie-consent-desc a { color: #1863dc; text-decoration: underline; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid #1863dc;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.cookie-btn-outline { background: transparent; color: #1863dc; }
.cookie-btn-outline:hover { background: rgba(24,99,220,0.08); }
.cookie-btn-solid { background: #1863dc; color: #fff; }
.cookie-btn-solid:hover { background: #124ead; }
@media (max-width: 480px) {
  .cookie-consent { left: 12px; right: 12px; bottom: 12px; max-width: none; width: calc(100% - 24px); }
  .cookie-consent-actions { flex-direction: column; }
  .cookie-btn { width: 100%; }
}

/* ---------- Responsive nav (mobile) ---------- */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 999;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; width: 100%; gap: 0; }
  .nav-list > li > a { padding: 16px 8px; font-size: 1rem; border-bottom: 1px solid var(--color-border); border-radius: 0; }
  .submenu {
    position: static; box-shadow: none; border: none; opacity: 1; visibility: visible;
    transform: none; display: none; padding: 0 0 8px 16px; min-width: 0;
  }
  .has-submenu.submenu-open .submenu { display: block; }
  .has-submenu > a::after { float: right; margin-top: 6px; }
  .lang-switch { justify-content: center; padding: 16px 8px; border-bottom: 1px solid var(--color-border); margin-left: 0; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 2.4em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Private preview gate ---------- */
/* While html has .gate-locked, hide the whole site and show only the password screen. */
html.gate-locked body > *:not(.preview-gate) { display: none !important; }
html.gate-locked { overflow: hidden; }

.preview-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-footer-bg);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
html.gate-locked .preview-gate { display: flex; }

.preview-gate-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.preview-gate-logo { height: 30px; width: auto; margin: 0 auto 24px; }
.preview-gate-title { font-size: 1.2rem; font-weight: 700; color: var(--color-text); margin: 0 0 10px; }
.preview-gate-desc { font-size: 0.9rem; color: var(--color-text-soft); margin: 0 0 20px; line-height: 1.5; }
.preview-gate-label { display: block; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.preview-gate-box input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-bottom: 16px;
}
.preview-gate-btn { width: 100%; border: none; }
.preview-gate-error { color: #b3261e; font-size: 0.85rem; margin: 12px 0 0; }
.preview-gate-box.is-shake { animation: preview-gate-shake 0.35s; }
@keyframes preview-gate-shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
