/* ===================================================================
   UXUARIA — site.css
   New design system tokens and the shared chrome (header, footer).
   Source: Figma uxuaria-Web, Uxuaria Library. See docs/specs/11-home.md
   =================================================================== */

:root {
  /* --- Color --- */
  --ux-color-surface: #FFFFFF;
  --ux-color-ink: #000000;
  --ux-color-text: #111111;
  --ux-color-text-muted: #666666;
  /* .58 keeps small text at 4.5:1 or more on white and on surface-soft (WCAG 1.4.3) */
  --ux-color-text-subtle: rgba(0, 0, 0, .58);
  --ux-color-border-soft: rgba(0, 0, 0, .2);
  --ux-color-surface-soft: #F5F5F2;
  --ux-color-surface-inverse: #111111;
  --ux-color-footer: #0A0A0A;
  --ux-color-text-inverse: #FFFFFF;
  --ux-color-inverse-55: rgba(255, 255, 255, .55);
  --ux-color-inverse-45: rgba(255, 255, 255, .45);
  --ux-color-inverse-40: rgba(255, 255, 255, .4);
  --ux-color-inverse-border: rgba(255, 255, 255, .1);
  --ux-color-inverse-divider: rgba(255, 255, 255, .08);
  --ux-color-inverse-overlay: rgba(255, 255, 255, .06);
  /* Form errors: 4.5:1 or more on white (spec 20-boletin) */
  --ux-color-danger: #B42318;

  /* --- Typography --- */
  --ux-font-display: 'Space Grotesk', sans-serif;
  --ux-font-ui: 'Inter', sans-serif;
  --ux-font-mono: 'Space Mono', monospace;

  /* --- Shape and elevation --- */
  --ux-radius-pill: 57px;
  --ux-radius-card: 13px;
  --ux-radius-badge: 14px;
  --ux-radius-frame: 8px;
  --ux-shadow-button: 0 4px 0 0 var(--ux-color-ink);
  --ux-shadow-card-hover: 0 12px 28px rgba(0, 0, 0, .14);

  /* --- Layout --- */
  --ux-header-height: 87px;

  /* --- Page type scale: 9 roles, fluid from 375px to 1440px (spec 19) --- */
  --ux-size-display: clamp(40px, 31.55px + 2.254vw, 64px);
  --ux-size-title: clamp(32px, 26.37px + 1.502vw, 48px);
  --ux-size-subtitle: clamp(24px, 21.18px + .751vw, 32px);
  --ux-size-heading: clamp(20px, 18.59px + .376vw, 24px);
  --ux-size-lead: clamp(20px, 18.59px + .376vw, 24px);
  --ux-size-body: clamp(18px, 17.3px + .188vw, 20px);
  --ux-size-small: 16px;
  --ux-size-meta: 14px;
  --ux-size-label: 12px;
  --ux-leading-display: 1.05;
  --ux-leading-title: 1.1;
  --ux-leading-subtitle: 1.2;
  --ux-leading-heading: 1.25;
  --ux-track-display: -.033em;
  --ux-track-heading: -.08em;
  --ux-gutter: clamp(16px, 11.32vw, 163px);
}

/* ===== ACCESSIBILITY ===== */

/* Text for screen readers only */
.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;
}

/* First stop for the keyboard: jumps over the header (WCAG 2.4.1) */
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--ux-radius-frame);
  background: var(--ux-color-ink);
  color: var(--ux-color-text-inverse);
  font-family: var(--ux-font-ui);
  font-size: var(--ux-size-small);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Keyboard focus: the element's own text color, already checked against its background (WCAG 2.4.7) */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
/* Targets that only receive focus from script (skip links, in-page anchors) */
[tabindex="-1"]:focus { outline: none; }

/* ===== PILL BUTTON ===== */
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid var(--ux-color-ink);
  border-radius: var(--ux-radius-pill);
  box-shadow: var(--ux-shadow-button);
  background: var(--ux-color-surface);
  color: var(--ux-color-ink);
  font-family: var(--ux-font-display);
  font-size: var(--ux-size-small);
  font-weight: 400;
  line-height: 28.8px;
  text-decoration: none;
  white-space: nowrap;
}

.pill-button { transition: background-color .2s ease, color .2s ease; }

.pill-button:hover,
.pill-button:focus-visible {
  background: var(--ux-color-ink);
  color: var(--ux-color-text-inverse);
}

.pill-button--on-dark:hover,
.pill-button--on-dark:focus-visible { border-color: var(--ux-color-text-inverse); }

/* The button inverts on focus, so the ring keeps the color of the surface around it */
.pill-button:focus-visible { outline-color: var(--ux-color-ink); }
.pill-button--on-dark:focus-visible { outline-color: var(--ux-color-text-inverse); }

/* ===== ARROW LINK ===== */
.arrow-link {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--ux-color-ink);
  font-size: var(--ux-size-small);
  line-height: 28.8px;
  text-decoration: none;
}

.arrow-link--end { justify-content: flex-end; }
.arrow-link--start { justify-content: flex-start; }
a.arrow-link:hover { text-decoration: underline; }

/* On dark surfaces */
.arrow-link--inverse { color: var(--ux-color-text-inverse); }
.arrow-link--inverse img { filter: invert(1); }

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 14px;
  border: 1px solid var(--ux-color-border-soft);
  border-radius: var(--ux-radius-badge);
  color: var(--ux-color-text-subtle);
  font-family: var(--ux-font-mono);
  font-size: var(--ux-size-label);
  font-weight: 700;
  line-height: 17.6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: var(--ux-color-surface);
  border-bottom: 1px solid var(--ux-color-ink);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--ux-header-height);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(16px, 11.32vw, 163px);
}

.site-header__logo {
  color: var(--ux-color-text);
  font-family: var(--ux-font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 44.8px;
  letter-spacing: -1.1px;
  text-decoration: none;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header__item {
  color: var(--ux-color-text-muted);
  font-family: var(--ux-font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 22.4px;
  text-decoration: none;
  white-space: nowrap;
}

a.site-header__item:hover { color: var(--ux-color-text); }
.site-header__item[aria-current='page'] { color: var(--ux-color-text); text-decoration: underline; }
.site-header__item--padded { padding: 0 16px; }
.site-header__item--active { color: var(--ux-color-text); }
.site-header__item--inactive { color: var(--ux-color-text-subtle); }

/* ===== SERVICIOS MENU (spec 16-servicios-ia) =====
   The wrapper fills the header height, so the pointer reaches the panel
   without leaving it. Without JavaScript it opens on hover and focus. */
.site-header__actions,
.site-header__nav,
.site-header__services { align-self: stretch; }

.site-header__services { display: flex; align-items: center; }

.site-header__services-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.site-header__services-toggle svg { transition: transform .2s ease; }
.site-header__services-toggle:hover,
.site-header__services-toggle.is-current,
.site-header__services.is-open .site-header__services-toggle { color: var(--ux-color-text); }
.site-header__services-toggle.is-current { text-decoration: underline; }
.site-header__services.is-open .site-header__services-toggle svg { transform: rotate(180deg); }

.site-mega {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  border-top: 1px solid var(--ux-color-ink);
  border-bottom: 1px solid var(--ux-color-ink);
  background: var(--ux-color-surface);
  opacity: 0;
  visibility: hidden;
  translate: 0 -8px;
  transition: opacity .2s ease, translate .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s;
}

.site-header__services:not(.is-enhanced):is(:hover, :focus-within) .site-mega,
.site-header__services.is-open .site-mega {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition-delay: 0s;
}

.site-mega__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px clamp(16px, 11.32vw, 163px) 40px;
}

.site-mega__eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--ux-color-text-muted);
  font-family: var(--ux-font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 17.6px;
  text-transform: uppercase;
}

.site-mega__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.site-mega__link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px 20px 52px;
  border: 1px solid var(--ux-color-border-soft);
  border-radius: var(--ux-radius-card);
  color: var(--ux-color-text);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.site-mega__name {
  font-family: var(--ux-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
}

.site-mega__summary {
  color: var(--ux-color-text-muted);
  font-size: 14px;
  line-height: 22.4px;
}

.site-mega__arrow { position: absolute; bottom: 20px; left: 20px; transition: translate .25s cubic-bezier(.2, .8, .2, 1); }

.site-mega__link:hover,
.site-mega__link:focus-visible,
.site-mega__link[aria-current='page'] { border-color: var(--ux-color-ink); background: var(--ux-color-surface-soft); }

.site-mega__link:hover .site-mega__arrow { translate: 4px -4px; }
.site-mega__link:focus-visible { outline: 2px solid var(--ux-color-ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .site-mega,
  .site-mega__arrow,
  .site-header__services-toggle svg { transition: none; }
}

/* Mobile menu: services as their own group */
.site-header__menu-label {
  text-decoration: none;
  color: var(--ux-color-text-muted);
  font-family: var(--ux-font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 17.6px;
  text-transform: uppercase;
}

.site-header__item--sub { padding-left: 12px !important; }
.site-header__item--sub + .site-header__item:not(.site-header__item--sub) { margin-top: 8px; }

.site-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
  cursor: pointer;
}

.site-header__hamburger span {
  display: block;
  height: 2px;
  background: var(--ux-color-text);
}

.site-header__compact { display: none; }
.site-header__menu { display: none; }

.site-header__menu.open {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--ux-color-ink);
}

/* Provisional until the mobile frame exists (spec 11-home) */
@media (max-width: 1100px) {
  :root { --ux-header-height: 68px; }

  .site-header__actions { display: none; }
  .site-header__compact { display: flex; gap: 16px; align-items: center; }
  .site-header__hamburger { display: flex; margin-right: -10px; }
  .site-header__logo { font-size: 28px; }
  .site-header__menu .site-header__item { padding: 8px 0; font-size: 16px; }
}

/* Figma: Home — Mobile 390 (130:3845) */
@media (max-width: 640px) {
  :root { --ux-header-height: 71px; }

  .site-header__inner { padding: 0 24px; }
  .site-header__logo { font-size: 34px; line-height: 38.1px; letter-spacing: -.94px; }
}

/* ===== FOOTER ===== */
.site-footer {
  padding-top: 72px;
  background: var(--ux-color-footer);
  font-family: var(--ux-font-ui);
}

.site-footer__inner {
  display: flex;
  gap: 80px;
  max-width: 1160px;
  min-height: 259.2px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-footer__brand { flex: 0 1 442.3px; }

.site-footer__wordmark {
  display: block;
  color: var(--ux-color-text-inverse);
  font-size: 28px;
  font-weight: 700;
  line-height: 44.8px;
  letter-spacing: -1.1px;
}

.site-footer__tagline {
  max-width: 221px;
  margin-top: 12px;
  color: var(--ux-color-inverse-55);
  font-size: 14px;
  line-height: 22.4px;
}

.site-footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 28px;
  border: 1px solid var(--ux-color-inverse-border);
  border-radius: var(--ux-radius-frame);
  background: var(--ux-color-inverse-overlay);
}

.site-footer__links {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 169.9px));
  gap: 40px;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

a.site-mega__eyebrow:hover,
a.site-header__menu-label:hover,
a.site-footer__col-title:hover { text-decoration: underline; }

.site-footer__col-title {
  display: block;
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--ux-color-inverse-55);
  font-size: 12px;
  font-weight: 600;
  line-height: 19.2px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.site-footer__item {
  color: var(--ux-color-inverse-55);
  font-size: 14px;
  line-height: 22.4px;
  text-decoration: none;
}

a.site-footer__item:hover { color: var(--ux-color-text-inverse); }

.site-footer__bottom {
  padding: 24px 16px;
  border-top: 1px solid var(--ux-color-inverse-divider);
  color: var(--ux-color-inverse-55);
  font-size: 13px;
  line-height: 20.8px;
  text-align: center;
}

/* Privacy link and cookie preferences (cookies.js) */
.site-footer__legal {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.site-footer__legal:hover { color: var(--ux-color-text-inverse); }

/* Provisional until the mobile frame exists (spec 11-home) */
@media (max-width: 900px) {
  .site-footer__inner { flex-direction: column; gap: 48px; padding: 0 16px 48px; }
  .site-footer__brand { flex: none; }
  .site-footer__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Figma: Home — Mobile 390 (130:4087) */
@media (max-width: 640px) {
  .site-footer { padding-top: 48px; }
  .site-footer__inner { gap: 36px; padding: 0 24px 36px; }
}

/* ===== NEWSLETTER (spec 20-boletin) ===== */
.newsletter {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--ux-font-ui);
}

.newsletter__copy { flex: 1 1 340px; }
.newsletter__form { flex: 1 1 380px; }

.newsletter__row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.newsletter__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ux-color-ink);
  border-radius: var(--ux-radius-pill);
  background: var(--ux-color-surface);
  color: var(--ux-color-text);
  font: inherit;
  font-size: var(--ux-size-small);
}

.newsletter__input[aria-invalid="true"] { border-color: var(--ux-color-danger); }

.newsletter__button { flex: none; padding-inline: 20px; }
.newsletter__button:disabled { opacity: .6; cursor: progress; }

/* Honeypot */
.newsletter__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.newsletter__legal {
  margin-top: 12px;
  color: var(--ux-color-text-subtle);
  font-size: var(--ux-size-label);
  line-height: 1.5;
}

.newsletter__legal a { color: inherit; text-underline-offset: 3px; }

.newsletter__status:empty { display: none; }

.newsletter__status {
  margin-top: 8px;
  color: var(--ux-color-text);
  font-size: var(--ux-size-meta);
  font-weight: 600;
  line-height: 1.5;
}

.newsletter__form[data-state="error"] .newsletter__status { color: var(--ux-color-danger); }

/* Blog listing and below each article */
.newsletter {
  padding: 40px;
  border: 1px solid var(--ux-color-border-soft);
  border-radius: var(--ux-radius-card);
  background: var(--ux-color-surface-soft);
}

.newsletter__title {
  color: var(--ux-color-text);
  font-size: var(--ux-size-heading);
  font-weight: 700;
  line-height: var(--ux-leading-heading);
}

.newsletter__text {
  margin-top: 8px;
  color: var(--ux-color-text-muted);
  font-size: var(--ux-size-small);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .newsletter { padding: 24px; }
  .newsletter__row { flex-direction: column; align-items: stretch; }
  .newsletter__input { flex: none; }
}

/* ===== PAGE SHELL ===== */
.page-shell { padding-top: var(--ux-header-height); }

.page-container {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: var(--ux-gutter);
}

/* ===== BREADCRUMB ===== */
.page-breadcrumb {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.page-breadcrumb__item {
  color: var(--ux-color-text-muted);
  font-family: var(--ux-font-display);
  font-size: var(--ux-size-meta);
  font-weight: 500;
  line-height: 22.4px;
  text-decoration: none;
}

.page-breadcrumb__item:hover { color: var(--ux-color-text); }

.page-breadcrumb__separator {
  color: var(--ux-color-text-muted);
  font-size: var(--ux-size-small);
  line-height: 25.6px;
}

.page-breadcrumb__current {
  overflow: hidden;
  max-width: 232px;
  color: var(--ux-color-text-muted);
  font-family: var(--ux-font-mono);
  font-size: var(--ux-size-label);
  font-weight: 700;
  line-height: 17.6px;
  letter-spacing: .3px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== LISTING INTRO ===== */
.page-intro {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--ux-color-border-soft);
}

.page-intro__title {
  margin-top: 24px;
  color: var(--ux-color-text);
  font-size: var(--ux-size-display);
  font-weight: 700;
  line-height: var(--ux-leading-display);
  letter-spacing: var(--ux-track-display);
}

.page-intro__lead {
  margin-top: 24px;
  color: var(--ux-color-text-muted);
  font-size: var(--ux-size-lead);
  line-height: 28.8px;
}

/* ===== CLOSING CTA ===== */
.closing-cta {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  padding: 100px 16px;
  background: var(--ux-color-footer);
  text-align: center;
}

.closing-cta__status {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ux-color-inverse-55);
  font-family: var(--ux-font-mono);
  font-size: var(--ux-size-label);
  font-weight: 700;
  line-height: 17.6px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.closing-cta__title {
  max-width: 760px;
  color: var(--ux-color-text-inverse);
  font-size: var(--ux-size-title);
  font-weight: 700;
  line-height: var(--ux-leading-title);
  letter-spacing: -3.2px;
}

.closing-cta__text {
  max-width: 620px;
  color: var(--ux-color-inverse-55);
  font-size: var(--ux-size-body);
  line-height: 28.8px;
}

.closing-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.closing-cta__link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: var(--ux-color-text-inverse);
  font-size: var(--ux-size-small);
  line-height: 28.8px;
  text-decoration: none;
}

.closing-cta__link img { filter: invert(1); }
.closing-cta__link:hover { text-decoration: underline; }

/* Provisional until the mobile frames exist */
@media (max-width: 768px) {
  .closing-cta { padding-block: 72px; }
  .closing-cta__title { letter-spacing: -.04em; }
}

/* ===== CAL.COM EMBED ===== */
.cal-embed {
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* "Saltar la agenda": hidden until focused, then shown in place above the calendar */
.cal-embed__skip {
  position: absolute;
  top: auto;
  left: auto;
}
.cal-embed__skip:not(:focus) { clip: rect(0, 0, 0, 0); }
.cal-embed:focus-visible { outline-offset: -2px; }
