/* ============================================================
   OMAR HUANTE — Multi-page Authority Site · System layer
   Builds on colors_and_type.css (tokens). Semantic classes only.
   Mobile-first; breakpoint at 860px (--bp).
   ============================================================ */
@import url('../colors_and_type.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg-dark); color: var(--fg-on-dark); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-500); color: #1A1408; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 860px) { .wrap { padding: 0 48px; } }
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); }
.section { padding: 72px 0; }
@media (min-width: 860px) { .section { padding: 110px 0; } }
.light { background: var(--paper); color: var(--ink); }
.light .eyebrow { color: var(--gold-700); }
.serif { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.04; }
.lede { font-size: 17px; line-height: 1.64; color: var(--fg-on-dark-muted); }
.light .lede { color: var(--n-600); }

/* ---------------- NAVBAR ---------------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; transition: all 320ms var(--ease); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; transition: padding 320ms var(--ease); }
@media (min-width: 860px) { .nav-inner { padding: 20px 48px; } }
.nav.scrolled { background: rgba(0,0,0,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-dark); }
.nav.scrolled .nav-inner { padding-top: 13px; padding-bottom: 13px; }
.nav.light-page { background: rgba(255,255,255,.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; }
.brand b { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--fg-on-dark); letter-spacing: .01em; white-space: nowrap; }
.light-page .brand b { color: var(--ink); }
.nav-links { display: none; align-items: center; gap: 28px; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-link { font-size: 14px; color: var(--fg-on-dark-muted); cursor: pointer; background: none; border: none; font-family: var(--font-sans); white-space: nowrap; transition: color 180ms var(--ease); display: inline-flex; align-items: center; gap: 5px; }
.light-page .nav-link { color: var(--n-600); }
.nav-link:hover, .nav-link.active { color: var(--gold-400); }
.light-page .nav-link:hover, .light-page .nav-link.active { color: var(--gold-700); }
.nav-link .caret { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; transition: transform 200ms var(--ease); }
.has-mega:hover .caret { transform: rotate(-135deg) translateY(-1px); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang { display: inline-flex; border: 1px solid var(--border-dark-strong); border-radius: var(--r-pill); overflow: hidden; }
.light-page .lang { border-color: var(--border-strong); }
.lang button { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 11px; border: none; cursor: pointer; background: transparent; color: var(--fg-on-dark-muted); transition: all 160ms var(--ease); }
.light-page .lang button { color: var(--n-500); }
.lang button.on { background: var(--gold-500); color: var(--on-accent); }
.btn { font-family: var(--font-sans); font-weight: 500; font-size: 14px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: all 180ms var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.btn-gold { background: var(--gold-500); color: var(--on-accent); padding: 11px 18px; }
.btn-gold:hover { background: var(--gold-400); }
.btn-gold.lg { padding: 14px 26px; font-size: 15px; box-shadow: var(--shadow-gold); }
.btn-ghost { background: transparent; color: var(--fg-on-dark); border-color: var(--border-dark-strong); padding: 13px 24px; font-size: 15px; }
.btn-ghost:hover { border-color: var(--gold-400); }
.light .btn-ghost, .light-page .btn-ghost { color: var(--ink); border-color: var(--border-strong); }
.light .btn-ghost:hover { border-color: var(--ink); }
.nav-cta { display: none; }
@media (min-width: 700px) { .nav-cta { display: inline-flex; } }
.burger { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
@media (min-width: 1024px) { .burger { display: none; } }
.burger span { width: 22px; height: 2px; background: var(--fg-on-dark); transition: all 200ms var(--ease); }
.light-page .burger span { background: var(--ink); }

/* mega-menu */
.mega { position: absolute; top: 100%; left: 0; right: 0; background: rgba(8,8,7,.97); backdrop-filter: blur(16px); border-top: 1px solid var(--hairline-gold); border-bottom: 1px solid var(--border-dark); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 220ms var(--ease); }
.has-mega:hover .mega, .mega:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.mega-item { padding: 26px 22px; border-right: 1px solid var(--border-dark); transition: background 180ms var(--ease); }
.mega-item:last-child { border-right: none; }
.mega-item:hover { background: rgba(199,151,46,.06); }
.mega-item .n { font-family: var(--font-mono); font-size: 11px; color: var(--gold-600); }
.mega-item .t { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--fg-on-dark); margin-top: 8px; line-height: 1.15; }
.mega-item .d { font-size: 12.5px; color: var(--fg-on-dark-faint); margin-top: 8px; line-height: 1.5; }

/* mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.97); backdrop-filter: blur(10px); display: flex; flex-direction: column; padding: 90px 28px 32px; transform: translateX(100%); transition: transform 320ms var(--ease); }
.drawer.open { transform: translateX(0); }
.drawer a, .drawer button.dl { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--fg-on-dark); padding: 14px 0; border-bottom: 1px solid var(--border-dark); background: none; border-left: none; border-right: none; border-top: none; text-align: left; cursor: pointer; }
.drawer-close { position: absolute; top: 26px; right: 24px; background: none; border: none; color: var(--fg-on-dark); font-size: 30px; cursor: pointer; line-height: 1; }
.drawer-foot { margin-top: auto; display: flex; align-items: center; gap: 16px; }

/* ---------------- HERO ---------------- */
.hero { position: relative; overflow: hidden; background: var(--bg-dark); }
.hero .mark-wm { position: absolute; pointer-events: none; opacity: .06; }
.hero h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; color: var(--fg-on-dark); }
.hero em { font-style: italic; color: var(--gold-400); font-weight: 500; }
.gold-rule { width: 1px; background: linear-gradient(180deg, transparent, var(--hairline-gold), transparent); }

/* ---------------- BREADCRUMB ---------------- */
.crumb { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-on-dark-faint); flex-wrap: wrap; }
.light .crumb, .crumb.on-light { color: var(--n-500); }
.crumb a:hover { color: var(--gold-500); }
.crumb .sep { opacity: .5; }
.crumb .cur { color: var(--gold-600); }

/* ---------------- DIRECT-ANSWER block ---------------- */
.answer { border-left: 2px solid var(--gold-500); padding: 4px 0 4px 22px; }
.answer p { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.32; color: var(--ink); }
@media (min-width: 860px){ .answer p { font-size: 30px; } }

/* ---------------- PRACTICE MODULE ---------------- */
.parea { display: flex; gap: 18px; align-items: baseline; padding: 30px 0; border-top: 1px solid var(--border); }
.parea .n { font-family: var(--font-mono); font-size: 12px; color: var(--gold-600); letter-spacing: .1em; flex: none; }
.parea h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.12; }
.parea p { font-size: 15px; line-height: 1.6; color: var(--fg-muted); margin-top: 10px; max-width: 560px; }
.subtags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.subtag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--n-600); border: 1px solid var(--border-strong); border-radius: var(--r-pill); padding: 5px 11px; }

/* ---------------- AUTHORITY STRIP ---------------- */
.authority { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border-dark); border: 1px solid var(--border-dark); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 760px){ .authority { grid-template-columns: repeat(4, 1fr); } }
.authority .cell { background: var(--bg-dark); padding: 26px 22px; }
.authority .v { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--gold-400); line-height: .95; }
.authority .k { font-size: 13px; color: var(--fg-on-dark-muted); margin-top: 10px; line-height: 1.4; }

/* ---------------- FAQ accordion ---------------- */
.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; background: none; border: none; cursor: pointer; padding: 22px 0; font-family: var(--font-sans); font-size: 18px; font-weight: 500; color: var(--ink); }
.faq-q .pm { position: relative; width: 16px; height: 16px; flex: none; }
.faq-q .pm::before, .faq-q .pm::after { content: ""; position: absolute; background: var(--gold-600); transition: transform 220ms var(--ease); }
.faq-q .pm::before { top: 7px; left: 0; width: 16px; height: 2px; }
.faq-q .pm::after { left: 7px; top: 0; width: 2px; height: 16px; }
.faq-item.open .pm::after { transform: scaleY(0); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 300ms var(--ease); }
.faq-a p { font-size: 15.5px; line-height: 1.66; color: var(--fg-muted); padding-bottom: 24px; max-width: 660px; }

/* ---------------- ARTICLE CARD ---------------- */
.acard { display: flex; flex-direction: column; background: var(--bg-dark-elev); border: 1px solid var(--border-dark); border-radius: var(--r-lg); overflow: hidden; transition: border-color 200ms var(--ease), transform 200ms var(--ease); }
.acard:hover { border-color: var(--hairline-gold); transform: translateY(-3px); }
.acard .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #1a1813, #0b0b0a); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border-dark); }
.acard .thumb img { height: 54px; opacity: .5; }
.acard .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.acard .cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400); }
.acard h3 { font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--fg-on-dark); line-height: 1.16; }
.acard .meta { margin-top: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-on-dark-faint); padding-top: 14px; border-top: 1px solid var(--border-dark); }

/* ---------------- CTA block ---------------- */
.cta-block { background: var(--bg-dark); border: 1px solid var(--hairline-gold); border-radius: var(--r-xl); padding: 48px 36px; text-align: center; position: relative; overflow: hidden; }
.cta-block h2 { font-family: var(--font-display); font-size: 42px; font-weight: 600; color: var(--fg-on-dark); letter-spacing: -.01em; }
.cta-block .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ---------------- RELATED LINKS ---------------- */
.related { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 760px){ .related { grid-template-columns: repeat(3, 1fr); } }
.related a { display: block; padding: 24px 0; border-top: 1px solid var(--border-dark); transition: padding-left 180ms var(--ease); }
@media (min-width: 760px){ .related a { padding: 24px 22px; border-top: none; border-left: 1px solid var(--border-dark); } .related a:first-child { border-left: none; padding-left: 0; } }
.related a:hover { padding-left: 10px; }
.related .rk { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); }
.related .rt { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--fg-on-dark); margin-top: 8px; }
.related .arrow { color: var(--gold-500); margin-top: 12px; font-family: var(--font-mono); font-size: 14px; }
/* On the light práctica pages (.pb) the related block needs ink text + light hairlines for contrast */
.pb .related a { border-color: var(--border-strong); }
.pb .related .rt { color: var(--ink); }

/* ---------------- FOOTER ---------------- */
.foot { background: var(--bg-dark); padding: 60px 0 36px; border-top: 1px solid var(--border-dark); }
.foot-top { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; padding-bottom: 36px; border-bottom: 1px solid var(--border-dark); }
.foot-brand { display: flex; align-items: flex-start; gap: 16px; }
.foot-brand img { height: 46px; }
.foot-brand .fn { font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--fg-on-dark); }
.foot-brand .fr { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-400); margin-top: 4px; }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-on-dark-faint); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 14px; color: var(--fg-on-dark-muted); padding: 5px 0; }
.foot-col a:hover { color: var(--gold-400); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-top: 26px; }
.foot-bottom span, .foot-bottom a { font-family: var(--font-mono); font-size: 11px; color: var(--fg-on-dark-faint); }
.socials { display: flex; gap: 18px; }
.socials a:hover { color: var(--gold-400); }

/* utility */
.hide-mobile { display: none; }
@media (min-width: 860px){ .hide-mobile { display: initial; } .hide-desktop { display: none; } }
.tag-rec { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; background: var(--gold-500); color: var(--on-accent); border-radius: var(--r-pill); padding: 4px 10px; }

/* ── Bug fixes (mobile) — added post-handoff, no visual change on desktop ── */
/* 1) Prevent the brand wordmark from overlapping the ES/EN toggle on phones */
@media (max-width: 600px) {
  .nav-inner { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .brand { min-width: 0; gap: 10px; }
  .brand img { height: 26px; }
  .brand b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .nav-right { flex: none; gap: 10px; }
  .lang button { padding: 6px 9px; }
}
/* 2) Mobile drawer "Práctica" accordion → reveals the 4 practice areas */
.drawer .dl { display: inline-flex; align-items: center; }
.drawer .dl .caret { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); display: inline-block; margin-left: 12px; opacity: .55; transition: transform 200ms var(--ease); }
.drawer .dl.open .caret { transform: rotate(-135deg); }
.drawer-sub { display: flex; flex-direction: column; }
.drawer-sub[hidden] { display: none; }
.drawer-sub a { font-family: var(--font-sans); font-size: 18px; font-weight: 500; color: var(--fg-on-dark-muted); padding: 11px 0 11px 16px; border-bottom: 1px solid var(--border-dark); }
.drawer-sub a:hover { color: var(--gold-400); }
