/* ==========================================================================
   Best Solutions Travel — shared luxury stylesheet (FEAT-001)
   Single shared stylesheet consumed by the ES (/), EN (/en/) and ZH (/zh/)
   pages. Pure CSS, no build step. Root-relative asset references.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Refined dark / elegant palette with champagne-gold accents */
  --bg: #0e0e0f;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --gold: #c9a96a;
  --gold-soft: #e4cfa8;
  --gold-deep: #a8884d;
  --text: #f2efe9;
  --muted: #b9b3a7;
  --line: rgba(201, 169, 106, 0.22);
  --overlay: linear-gradient(180deg, rgba(10, 10, 11, 0.45) 0%, rgba(10, 10, 11, 0.72) 55%, rgba(10, 10, 11, 0.94) 100%);

  /* Typography */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* CJK-safe fallback stack appended so the /zh/ page renders cleanly */
  --font-cjk: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;

  /* Rhythm */
  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-pad: clamp(4rem, 9vw, 8rem);
  --radius: 4px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The ZH page sets lang="zh" on <html>; swap to the CJK-safe body stack */
html[lang="zh"] body {
  font-family: var(--font-cjk);
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.005em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
}

p {
  margin: 0 0 1.1em;
  color: var(--muted);
}

/* ---------- Accessibility helpers ---------- */
:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--gold);
  color: #16130c;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
  position: relative;
}

.section--alt {
  background: var(--surface);
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section__head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section__head p {
  font-size: 1.1rem;
}

/* Gold divider accent */
.divider {
  width: 64px;
  height: 2px;
  border: 0;
  margin: 1.5rem 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.divider--center {
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #16130c;
  border: 1px solid var(--gold);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

/* ---------- Top navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}

/* Solidifies on scroll (class toggled from JS) */
.nav.is-scrolled {
  background: rgba(14, 14, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.nav__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
}

.nav__brand span {
  color: var(--gold);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.25s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--gold-soft);
}

.nav__link.is-active::after {
  width: 100%;
}

/* Language switcher */
.nav__right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switch li {
  display: flex;
  align-items: center;
}

.lang-switch li + li::before {
  content: "/";
  color: var(--line);
  margin-right: 0.35rem;
}

.lang-switch a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.lang-switch a:hover {
  color: var(--gold-soft);
}

.lang-switch a.is-active {
  color: var(--gold);
  pointer-events: none;
}

/* Hamburger (hidden on desktop) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gold-soft);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.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 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--nav-h) + 2rem) 4rem;
  background-image: var(--overlay), url("/assets/images/hero.jpg");
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}

.hero__inner {
  max-width: 54rem;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}

.hero h1 {
  color: var(--text);
  margin-bottom: 0.6em;
}

.hero__lead {
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--text);
  opacity: 0.9;
  max-width: 42rem;
  margin-bottom: 2.2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Generic content + media ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

/* Fallback gradient blocks for any image slot that could not be fetched.
   Pages add .media--fallback (and omit <img>) when FEAT-001 findings note it. */
.media--fallback {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface-2), var(--gold-deep) 160%);
}

/* ---------- Card grids ---------- */
.grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

/* 5 activity-area cards */
.grid--areas {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* 3 case-study cards */
.grid--cases {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.card__media {
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--surface-2), var(--gold-deep) 160%);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  padding: 1.6rem 1.5rem 1.8rem;
}

.card__body h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card__body p {
  margin-bottom: 0;
  font-size: 0.97rem;
}

.card__index {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.4rem;
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact__list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.2rem;
}

.contact__list li {
  display: grid;
  gap: 0.2rem;
}

.contact__label {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.contact__value {
  color: var(--text);
  font-size: 1.05rem;
}

.contact__card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.5rem);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: 3rem 2.5rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.footer__brand span {
  color: var(--gold);
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__nav a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.footer__nav a:hover {
  color: var(--gold-soft);
}

/* ---------- Scroll-reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

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

/* ---------- Responsive: mobile breakpoint + hamburger menu ---------- */
@media (max-width: 860px) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem var(--gutter) 1.5rem;
    background: rgba(14, 14, 15, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }

  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__menu li {
    width: 100%;
  }

  .nav__link {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }

  .split,
  .contact {
    grid-template-columns: 1fr;
  }

  .split .media {
    order: -1;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Reduced-motion guard ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Footer ampliado (contacto + legal) y paginas legales
   ========================================================================== */
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.footer__col h4 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.footer__col p,
.footer__col address {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.6;
}

.footer__col a {
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.footer__col a:hover {
  color: var(--gold-soft);
}

.footer__contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.footer__contact li {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer__contact .k {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__legal a {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.footer__legal a:hover {
  color: var(--gold-soft);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 860px) {
  .footer__top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ---------- Legal pages ---------- */
.legal {
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 6rem));
  padding-bottom: var(--section-pad);
}

.legal__inner {
  max-width: 820px;
  margin-inline: auto;
}

.legal h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.legal h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin-top: 2.5rem;
  color: var(--text);
}

.legal h3 {
  color: var(--gold-soft);
  margin-top: 1.75rem;
}

.legal p,
.legal li {
  color: var(--muted);
}

.legal ul,
.legal ol {
  padding-left: 1.25rem;
  margin: 0 0 1.1em;
}

.legal li {
  margin-bottom: 0.4rem;
}

.legal a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal .legal__updated {
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

.legal th,
.legal td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

.legal th {
  color: var(--text);
  background: var(--surface-2);
  font-family: var(--font-body);
  font-weight: 600;
}
