/* =========================================================
   Harmonia — Consultores Patrimoniales
   Estilos fieles al diseño real del sitio (colores, tipografía
   y disposición extraídos directamente del sitio original),
   reconstruidos para ser responsivos + menú funcional.
   ========================================================= */

@font-face {
  font-family: "HarmoniaDisplay";
  src: url("../fonts/harmonia-display.woff2") format("woff2"),
       url("../fonts/harmonia-display.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple-dark: #2B193C;   /* fondo de secciones oscuras (header, hero, clientes) */
  --purple-text: #37204D;   /* texto sobre fondo blanco */
  --gold: #E3BB8A;          /* acentos: encabezados, bordes */
  --white: #FFFFFF;
  --divider: #D9D3DC;

  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'HarmoniaDisplay', 'Montserrat', serif;

  --max-width: 980px;
  --header-height: 84px;
  --transition: 220ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; width: 100%; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
em { font-style: italic; }

/* -------------------- Section title style (gold, tracked caps) -------------------- */
.section-title {
  font-family: var(--font-body);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 400;
  font-size: clamp(1.15rem, 1rem + 1.4vw, 2.0625rem); /* ~33px desktop */
  margin: 0 0 0.9em;
  line-height: 1.3;
}
.section-title a { color: inherit; }
.section-title a:hover { text-decoration: underline; }

.section { padding: clamp(2.5rem, 2rem + 2vw, 4rem) 1.25rem; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-inner.center { text-align: center; }

.dark-section {
  background: var(--purple-dark);
  color: var(--white);
}
.dark-section .section-title { color: var(--gold); }

/* -------------------- Gold-bordered boxes -------------------- */
.gold-box {
  border: 2px solid var(--gold);
  padding: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
  background: var(--white);
}
.intro-box { max-width: 100%; }
.intro-box .section-title { color: var(--gold); }
.lead {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.375rem); /* ~22px desktop */
  color: var(--purple-text);
  margin: 0;
}
.lead-plain {
  font-size: 1.05rem;
  color: var(--purple-text);
  margin: 0 auto 1.5rem;
  max-width: 640px;
}

/* Title box used on interior page heroes: straddles the dark hero / white body */
.page-hero { background: var(--purple-dark); padding: clamp(2.5rem, 2rem + 2vw, 4rem) 1.25rem 0; }
.title-box {
  background: var(--purple-dark);
  transform: translateY(50%);
  margin-bottom: 0;
}
.title-box .section-title { margin-bottom: 0; }

/* Manifiesto de Servicio: framed italic body text, same motif as the home intro box */
.manifiesto-box p { font-size: 1.05rem; font-style: italic; }
.manifiesto-box p:last-child { margin-bottom: 0; }

/* -------------------- Hero (home) -------------------- */
.hero {
  background: var(--purple-dark);
  color: var(--white);
  padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 1.25rem clamp(4rem, 3rem + 6vw, 7rem);
}
.wordmark {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: clamp(1.75rem, 1.4rem + 2.5vw, 2.75rem); /* ~44px desktop */
  letter-spacing: 0.25em;
  margin: 0 0 0.4em;
}
.tagline {
  font-family: var(--font-body);
  color: var(--white);
  font-size: clamp(1.4rem, 1.1rem + 2vw, 2.75rem);
  font-weight: 400;
  margin: 0;
  max-width: 720px;
}

.intro-section { margin-top: clamp(-2.5rem, -2.2rem - 1.2vw, -1.5rem); position: relative; z-index: 2; }

/* -------------------- Services (label + list, two columns on desktop) -------------------- */
.service-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem 0;
}
.service-label h2 {
  font-family: var(--font-body);
  color: var(--purple-text);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.375rem); /* ~22px */
  margin: 0;
}
.service-list { display: flex; flex-direction: column; gap: 0.5rem; }
.service-list li {
  font-size: 1rem;
  color: var(--purple-text);
}
.service-list .sub-list { margin-top: 0.4rem; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.divider { border: none; border-top: 1px solid var(--divider); margin: 0; }

/* -------------------- Client list (dark section) -------------------- */
.client-list { display: flex; flex-direction: column; gap: 0.75rem; }
.client-list li { font-size: 1.1rem; color: var(--white); }

/* -------------------- Diagram image -------------------- */
.diagram { margin: 1.5rem auto 0; max-width: 420px; }

/* -------------------- Contact / footer box -------------------- */
.footer-section { background: var(--white); }
.contact-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
.contact-col h3 {
  font-family: var(--font-body);
  color: var(--purple-text);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
.contact-col p { color: var(--purple-text); font-size: 0.98rem; }
.contact-col a { color: var(--purple-text); }
.contact-col a:hover { color: var(--gold); }

.site-footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: 0.8rem;
  color: #8a7f92;
}

/* =========================================================
   Header / Navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--purple-dark);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
}
.brand { display: block; }
.brand-logo { height: 56px; width: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
}
.hamburger { width: 22px; height: 16px; position: relative; display: block; }
.hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition), top var(--transition);
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { top: 14px; }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 15;
}
.nav-overlay[hidden] { display: none; }

/* Mobile nav panel (default) */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(86vw, 340px);
  background: var(--purple-dark);
  border-left: 1px solid rgba(255,255,255,0.15);
  padding: 5rem 1.5rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition);
  z-index: 18;
}
.site-nav.is-open { transform: translateX(0); }

.site-nav ul { display: flex; flex-direction: column; gap: 0.4rem; }
.site-nav > ul > li { border-bottom: 1px solid rgba(255,255,255,0.12); }

.site-nav a {
  display: block;
  padding: 0.85rem 0.25rem;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a.active { color: var(--gold); }
.site-nav a:hover { color: var(--gold); }

.submenu-row { display: flex; align-items: center; justify-content: space-between; }
.submenu-row a { flex: 1; }
.submenu-toggle {
  background: none;
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
}
.submenu-toggle[aria-expanded="true"] .chevron { transform: rotate(-135deg); }

.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
  padding-left: 1rem;
}
.submenu.is-open { max-height: 200px; }
.submenu a { font-size: 0.88rem; font-weight: 400; }

/* =========================================================
   Breakpoints
   ========================================================= */

/* Tablet: two-column contact box, side-by-side services */
@media (min-width: 640px) {
  .contact-box { grid-template-columns: repeat(3, 1fr); }
  .service-group { flex-direction: row; align-items: flex-start; gap: 2rem; }
  .service-label { flex: 0 0 220px; }
  .service-list { flex: 1; }
}

/* Desktop: flat horizontal nav bar with bordered pill items (as in the real site) */
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-overlay { display: none !important; }

  .header-inner { padding: 1.5rem 1.25rem 1rem; }

  .site-header { padding-bottom: 0; }
  .site-nav {
    position: static;
    height: auto;
    width: auto;
    transform: none;
    background: transparent;
    border-left: none;
    overflow: visible;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem 1rem;
  }
  .site-nav > ul {
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
    margin: 0 auto;
  }
  .site-nav > ul > li {
    border: 1px solid rgba(255,255,255,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.25);
    margin-left: -1px;
    flex-shrink: 0;
  }
  .site-nav a { padding: 0.7rem 0.85rem; font-size: 0.8rem; white-space: nowrap; }

  .has-submenu { position: relative; display: flex; }
  .submenu-row { width: 100%; }
  .submenu-toggle { color: var(--white); }
  .submenu {
    position: absolute;
    top: 100%;
    left: -1px;
    background: var(--purple-dark);
    border: 1px solid rgba(255,255,255,0.25);
    min-width: 220px;
    max-height: none;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 30;
  }
  .submenu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .submenu a { padding: 0.75rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
