/* MGV Abogados · sitio estático (HTML, CSS y JS) */
:root {
  --navy: #0e0720;
  --navy-2: #1a1336;
  --gold: #b8965a;
  --gold-dark: #8a6a35;   /* dorado legible sobre fondo claro */
  --cream: #faf8f3;
  --sand: #f1ede4;
  --ink: #1b1a24;
  --muted: #545260;
  --line: #e4dfd3;
  --white: #ffffff;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 4px;
  --shadow: 0 10px 30px rgba(14, 7, 32, 0.10);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--gold-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); font-weight: 600; line-height: 1.15; margin: 0 0 0.6em; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.8rem); }
h2 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.8rem); }
h2::after { content: ""; display: block; width: 48px; height: 2px; background: var(--gold); margin-top: 0.45em; }
h3 { font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 75ch; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--navy); color: #fff; padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { top: 1rem; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- cabecera ---------- */
.site-header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; transition: box-shadow 0.2s; }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(14, 7, 32, 0.08); }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 1.25rem; padding-top: 0.5rem; }
.langs { display: flex; gap: 0.35rem; }
.langs a { font-size: 0.78rem; font-weight: 600; color: var(--navy); text-decoration: none; border: 1px solid var(--navy); padding: 0.18rem 0.6rem; border-radius: 2px; }
.langs a[aria-current] { background: var(--navy); color: #fff; }
.langs a:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.social { list-style: none; display: flex; gap: 0.4rem; margin: 0; padding: 0; }
.social li { margin: 0; }
.social a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; transition: background 0.2s, transform 0.2s; }
.social a:hover { background: var(--gold); transform: translateY(-2px); }
.social svg { width: 15px; height: 15px; fill: currentColor; }
.mainbar { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 0.6rem 0.9rem; }
.brand { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--navy); line-height: 1; }
.brand-name { font-family: var(--serif); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.brand-sub { font-family: var(--serif); font-size: 0.72rem; letter-spacing: 0.45em; text-transform: uppercase; margin-top: 0.35rem; padding-top: 0.3rem; border-top: 1px solid currentColor; }
.menu ul { list-style: none; display: flex; gap: 0; margin: 0; padding: 0; align-items: center; }
.menu li { margin: 0; display: flex; align-items: center; }
.menu li + li::before { content: ""; width: 1px; height: 14px; background: var(--navy); opacity: 0.6; }
.menu a { display: block; padding: 0.55rem 1rem; color: var(--navy); text-decoration: none; font-size: 0.88rem; font-weight: 500; position: relative; }
.menu a::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 0.2rem; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform 0.2s; }
.menu a:hover::after, .menu a[aria-current]::after { transform: scaleX(1); }
.menu a[aria-current] { font-weight: 600; }
.menu-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.menu-toggle span:not(.sr-only) { display: block; height: 2px; background: var(--navy); margin: 5px 0; transition: transform 0.2s, opacity 0.2s; }
.menu-toggle[aria-expanded=true] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded=true] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded=true] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- bloques de contenido ---------- */
.page > .container.flow { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.flow > * + * { margin-top: 0; }
.box { position: relative; }
.box.band { padding-block: clamp(3rem, 7vw, 5.5rem); }
.box.band + .box.band.plain, .box.band.plain + .box.band.plain { padding-top: clamp(1rem, 3vw, 2rem); }
.box:not(.band) { padding: clamp(1.2rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.box.plain:not(.band) { padding: 0; }
.box.rounded { border-radius: 8px; }
.box:not(.band):not(.plain):not(.dark) { box-shadow: var(--shadow); }
.box.has-img { background-size: cover; background-position: center; }
.box.dark { color: #ece9f3; }
.box.dark h1, .box.dark h2, .box.dark h3, .box.dark h4 { color: #fff; }
.box.dark a:not(.btn) { color: #e6cf9f; }
.box.dark p, .box.dark li { color: #e4e1ec; }
.box.hero { min-height: min(78vh, 720px); display: flex; align-items: center; overflow: hidden; }
.box.hero > .container { position: relative; z-index: 1; }
.box.hero > .container > * { max-width: 560px; }
.box.hero h1 { font-size: clamp(2.2rem, 1.4rem + 2.8vw, 3.6rem) !important; }
.box.hero h1 { color: #fff; max-width: 22ch; font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.2rem); }
.box.hero h1::after { content: ""; display: block; width: 64px; height: 2px; background: var(--gold); margin-top: 0.5em; }
.bgvid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; opacity: 0.35; }
.vid-toggle { position: absolute; right: 1.5rem; bottom: 1.5rem; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); background: rgba(14,7,32,.4); color: #fff; font-size: 0.8rem; cursor: pointer; }
.vid-toggle:hover { background: var(--gold); color: var(--navy); }

.cols { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; margin-bottom: 1.5rem; }
.cols-ratio { grid-template-columns: var(--cols); }
.cols:last-child { margin-bottom: 0; }
.col > :last-child { margin-bottom: 0; }
.col > img:not(.logo-img), .flow > img:not(.logo-img) { width: 100%; border-radius: var(--radius); object-fit: cover; }
.col > img:only-child { height: 100%; min-height: 260px; }
.logo-img { max-height: 70px; width: auto; object-fit: contain; }
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; background: #fff; padding: 1rem 1.5rem; border-radius: 6px; margin-bottom: 1.25rem; }
.logos img, .logos .logo-img { max-height: 56px; max-width: 140px; width: auto; height: auto; object-fit: contain; filter: grayscale(0.2); transition: transform .2s; }
.logos img:hover { transform: scale(1.05); }
.crumbs { font-size: 0.85rem; color: var(--muted); }
.dark .crumbs { color: #cfc9dc; }
.crumbs a { color: inherit; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px; padding: 0.7rem 1.5rem; background: var(--gold); color: var(--navy); border: 1px solid var(--gold); font-family: var(--sans); font-weight: 600; font-size: 0.88rem; text-decoration: none; border-radius: 2px; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s; }
.btn::after { content: "→"; transition: transform 0.2s; }
.btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn:hover::after { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.dark .btn-outline { color: #fff; border-color: #fff; }
.dark .btn:hover { background: #fff; color: var(--navy); border-color: #fff; }
.link-arrow { font-weight: 600; text-decoration: none; color: var(--gold-dark); }
.link-arrow:hover { text-decoration: underline; }
.dark .link-arrow { color: #e6cf9f; }

.card { display: block; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem; margin-bottom: 1rem; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); color: inherit; }
.card img { border-radius: 4px; margin-bottom: 0.75rem; width: 100%; object-fit: cover; }
.card h3, .card h4 { margin-bottom: 0.3em; }
.card h2::after { display: none; }
.card p { margin-bottom: 0.4em; }
.card p:first-child:not(:only-child) { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-dark); }
.dark .card { background: var(--navy-2); border-color: #2d2550; }
.imglink { display: inline-block; }
.imglink img { transition: transform 0.2s, filter 0.2s; }
.imglink:hover img { transform: scale(1.03); }

.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand); color: var(--navy); }
blockquote { margin: 1.5rem 0; padding: 1.25rem 1.5rem; background: var(--cream); border-radius: 6px; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--navy); }
details { border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem 1.1rem; margin-bottom: 0.75rem; background: #fff; }
details summary { cursor: pointer; font-weight: 600; color: var(--navy); }
details[open] summary { margin-bottom: 0.6rem; }
.embed { position: relative; aspect-ratio: 16 / 9; margin-bottom: 1.5rem; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.embed-li { aspect-ratio: auto; }
.embed-li iframe { position: static; height: 460px; background: #fff; }
video { width: 100%; border-radius: 6px; }

/* rejilla de tarjetas */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.cardgrid .card { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; min-height: 150px; border-top: 3px solid var(--gold); }
.cardgrid .card h3 { font-size: 1.35rem; margin: 0; }
.cardgrid .card p { font-size: 0.92rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.cardgrid .card .link-arrow { margin-top: auto; font-size: 1.2rem; }

/* página sin hero propio */
.page-title { background: var(--cream); }
.page-title h1 { margin: 0; }

/* ---------- formularios ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; background: #fff; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1.5rem; color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-full, .form .check, .form-actions, .form-status { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.req { color: #b3261e; }
.field input, .field select, .field textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--cream); border: 1px solid #cfc8b8; border-radius: 3px; padding: 0.7rem 0.85rem; min-height: 46px; width: 100%; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); background: #fff; }
.field [aria-invalid=true] { border-color: #b3261e; background: #fdf3f2; }
.field .err { font-size: 0.8rem; color: #b3261e; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; line-height: 1.5; }
.check input { margin-top: 0.25rem; width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.hint { color: var(--muted); font-size: 0.8rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.form-status { margin: 0; font-weight: 600; }
.form-status.ok { color: #1e6b3a; }
.form-status.bad { color: #b3261e; }
.dark .form { color: var(--ink); }
.dark .form p, .dark .form li { color: var(--ink); }
.receipt { grid-column: 1 / -1; background: var(--cream); border: 1px dashed var(--gold); padding: 1rem 1.25rem; border-radius: 6px; }
.receipt h3 { font-size: 1.2rem; }

/* ---------- buscador de Niza ---------- */
.niza { background: var(--navy); color: #fff; border-radius: 8px; padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 0 0 2rem; }
.niza h2 { color: #fff; }
.niza p { color: #e4e1ec; }
.niza input { width: 100%; font: inherit; font-size: 1rem; padding: 0.8rem 1rem; border: 0; border-radius: 3px; min-height: 48px; }
.niza .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.niza .chips button { font: inherit; font-size: 0.85rem; background: var(--navy-2); color: #fff; border: 1px solid #3a3160; border-radius: 2px; padding: 0.4rem 0.8rem; cursor: pointer; }
.niza .chips button:hover { background: var(--gold); color: var(--navy); }
.niza-num { font-family: var(--serif); font-size: clamp(5rem, 3rem + 7vw, 9rem); line-height: 0.85; color: var(--gold); font-weight: 700; margin: 0; }
.niza-kind { color: var(--gold) !important; font-weight: 600; margin: 0.6rem 0 0.2rem; }

/* ---------- pie ---------- */
.site-footer { background: var(--navy); color: #d9d5e4; margin-top: 0; padding-top: clamp(3rem, 6vw, 4.5rem); font-size: 0.9rem; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 0.8fr; gap: 2rem; padding-bottom: 2.5rem; }
.foot-h { font-family: var(--serif); color: #fff; font-size: 1.3rem; margin-bottom: 0.8rem; }
.foot-h::after { display: none; }
.brand-light { color: #fff; margin-bottom: 1rem; }
.site-footer a { color: #d9d5e4; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.foot-links, .foot-contact { list-style: none; padding: 0; margin: 0; }
.foot-links li, .foot-contact li { margin-bottom: 0.7rem; }
.foot-contact strong { color: #fff; }
.libro { display: inline-flex; align-items: center; gap: 0.6rem; }
.libro img { background: #fff; border-radius: 3px; width: 64px; height: auto; }
.social-foot a { background: transparent; border: 1px solid #d9d5e4; width: 36px; height: 36px; }
.foot-legal { border-top: 1px solid #2b2448; padding-block: 1.25rem 1.5rem; text-align: center; font-size: 0.78rem; color: #bdb7cd; }
.foot-legal p { max-width: none; margin: 0 0 0.3rem; }
.to-top { position: fixed; right: 1rem; bottom: 1rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--gold); color: var(--navy); text-decoration: none; border-radius: 50%; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 40; box-shadow: var(--shadow); }
.to-top.on { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); color: var(--navy); }

/* ---------- aparición suave ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- responsivo ---------- */
@media (max-width: 1024px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: repeat(min(var(--n, 2), 2), minmax(0, 1fr)); }
  .cols-ratio { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .menu { position: fixed; inset: var(--hh, 112px) 0 0 0; background: var(--cream); transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; visibility: hidden; }
  .menu.open { transform: none; visibility: visible; }
  .menu ul { flex-direction: column; align-items: stretch; padding: 1rem var(--gutter); }
  .menu li + li::before { display: none; }
  .menu li { border-bottom: 1px solid var(--line); }
  .menu a { padding: 1rem 0.25rem; font-size: 1.05rem; }
  .menu a::after { left: 0.25rem; right: auto; width: 40px; bottom: 0.6rem; }
  .niza { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .cols, .cols-ratio { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .topbar .social-top { display: none; }
  .topbar { justify-content: center; }
  .box.hero { min-height: 72vh; }
  .bgvid { opacity: 0.18; }
  .col > img:only-child { min-height: 200px; }
}
@media print {
  .site-header, .site-footer, .to-top, .vid-toggle, .bgvid { display: none !important; }
  body { color: #000; }
}
