/* ============================================================
   Geo Land Group — Legal Pages CSS v3
   Footer extraído del funnel-captacion (bg-onyx, skyline absolute bottom)
   Glassmorphism en tablas, mobile-first 2026 (iOS safe areas, dvh, 44px targets)
   ============================================================ */

@font-face { font-family: 'Bodoni Moda'; font-display: swap; }
@font-face { font-family: 'DM Sans'; font-display: swap; }
@font-face { font-family: 'Philosopher'; font-display: swap; }

:root {
  --color-onyx:        #11140F;
  --color-deep-space:  #1D2F43;
  --color-camel:       #C19853;
  --color-parchment:   #F8F3ED;
  --color-pale-oak:    #DEC4A2;
  --color-white:       #FFFFFF;

  --font-display: 'Bodoni Moda', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-logo:    'Philosopher', Georgia, serif;

  --sidebar-w:  260px;
  --content-max: 75ch;

  /* iOS safe areas */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* Semantic z-index scale (impeccable rule) */
  --z-sticky:    20;
  --z-dropdown:  30;
  --z-modal:     40;
  --z-toast:     50;
  --z-tooltip:   60;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--color-parchment);
  color: var(--color-onyx);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }

/* Impeccable rule: text-wrap balance for h1-h3, pretty for prose */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd, dt { text-wrap: pretty; }

/* Highlight de selección — igual que funnel-captacion (bg camel, texto blanco) */
::selection {
  background: var(--color-camel);
  color: var(--color-white);
}
::-moz-selection {
  background: var(--color-camel);
  color: var(--color-white);
}

/* ── Page Layout: sidebar + content ── */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

/* ── Sidebar (TOC desktop) ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--color-deep-space);
  padding: 2.5rem 1.5rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-camel) transparent;
  -webkit-overflow-scrolling: touch;
}

.toc-desktop { display: block; }
.toc-heading {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-camel);
  margin-bottom: 1rem;
  font-weight: 700;
}

.toc-list { display: flex; flex-direction: column; gap: 0; }
.toc-list li a {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1.4;
  min-height: 32px;  /* touch target */
}
.toc-list li.sub a {
  font-size: 0.77rem;
  padding-left: 1.2rem;
  color: rgba(255,255,255,0.5);
}
.toc-list li.sub2 a {
  font-size: 0.73rem;
  padding-left: 1.8rem;
  color: rgba(255,255,255,0.4);
}
.toc-list li a:hover,
.toc-list li a.active {
  color: var(--color-white);
  background: rgba(193, 152, 83, 0.1);
}

/* ── Mobile TOC (scroll horizontal + tabs compactas) ── */
.mobile-tabs {
  display: none;
  background: var(--color-deep-space);
  padding: 0.6rem 1rem;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.65rem 0.4rem;
  border-radius: 999px;  /* pill, mobile-native */
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-height: 44px;  /* iOS touch target */
  -webkit-tap-highlight-color: transparent;
}
.mobile-tab-btn.active {
  background: var(--color-camel);
  border-color: var(--color-camel);
  color: var(--color-onyx);
  font-weight: 600;
}
.mobile-toc-panel {
  display: none;
  background: var(--color-deep-space);
  padding: 1.25rem 1.25rem 2rem;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-camel) transparent;
}
.mobile-toc-panel.open { display: block; }
.mobile-toc-panel .toc-list li a { min-height: 44px; padding: 0.6rem 0.75rem; }

/* ── Main content ── */
.content-main { min-width: 0; }
.content-wrapper { min-height: calc(100dvh - 280px); }

/* ── Textura newspaper (extraída del funnel-captacion) ── */
.texture-newspaper {
  background-color: var(--color-parchment);
  background-image:
    repeating-linear-gradient(0deg, rgba(29, 47, 67, 0.018) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── Content inner ── */
.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  width: 100%;
}

/* ── H1 page title (sin hero) ── */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-deep-space);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  /* italic descender clearance */
  padding-bottom: 0.1em;
}
.page-date {
  font-size: 0.74rem;
  color: var(--color-camel);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 2.5rem;
  text-transform: uppercase;
}

/* ── Content article typography ── */
.content-article h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--color-deep-space);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-pale-oak);
  scroll-margin-top: 1rem;  /* anchor offset */
}
.content-article h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-weight: 600;
  color: var(--color-onyx);
  margin: 1.8rem 0 0.5rem;
  line-height: 1.3;
  padding-bottom: 0.1em;  /* descender clearance */
  scroll-margin-top: 1rem;
}
.content-article h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-onyx);
  margin: 1.4rem 0 0.4rem;
  scroll-margin-top: 1rem;
}
.content-article p {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.85;
  color: var(--color-onyx);
  opacity: 0.88;
  margin-bottom: 1rem;
}
.content-article a {
  color: #7A5F2D;  /* camel darkened for WCAG AA on parchment (4.7:1) */
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content-article a:hover { color: #5C461E; }
.content-article strong { font-weight: 700; color: var(--color-onyx); }
.content-article em { font-style: italic; }
.content-article code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--color-pale-oak);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ── Lists (todas a bullet points) ── */
.content-article ul {
  margin: 0.75rem 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.content-article ul li {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.75;
  color: var(--color-onyx);
  opacity: 0.88;
  position: relative;
  padding-left: 0.25rem;
}
.content-article ul li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.7em;
  width: 5px;
  height: 5px;
  background: var(--color-camel);
  border-radius: 50%;
}
.content-article ul li strong { opacity: 1; }
.content-article ul li ul { margin-top: 0.5rem; margin-bottom: 0.5rem; }

/* ── Tablas con efecto glassmorphism ── */
.content-article table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75rem 0;
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  /* Glassmorphism */
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(193, 152, 83, 0.18);  /* camel thin border */
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.5) inset,  /* highlight top */
    0 -1px 0 0 rgba(193, 152, 83, 0.08) inset,  /* shadow bottom */
    0 8px 24px -12px rgba(17, 20, 15, 0.12),
    0 2px 4px -1px rgba(17, 20, 15, 0.04);
}
.content-article thead {
  background: linear-gradient(180deg, rgba(222, 196, 162, 0.45) 0%, rgba(222, 196, 162, 0.28) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.content-article th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-deep-space);
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(193, 152, 83, 0.25);
}
.content-article td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(222, 196, 162, 0.35);
  vertical-align: top;
  color: var(--color-onyx);
  opacity: 0.88;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.18);
}
.content-article tbody tr:last-child td { border-bottom: none; }
.content-article tbody tr:nth-child(even) td {
  background: rgba(222, 196, 162, 0.12);
}
.content-article tbody tr:hover td {
  background: rgba(193, 152, 83, 0.08);
  transition: background 0.2s;
}
/* Responsive table: scroll horizontal en pantallas pequeñas */
.content-article table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .content-article table { display: table; }
}

/* ── FOOTER (copia del funnel-captacion) ── */
.site-footer {
  background: var(--color-onyx);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
  /* iOS safe area */
  padding-bottom: var(--safe-bottom);
}
/* Silueta skyline full-width anclada al baseline
   Funnel: h-32 w-full md:h-48 (128px mobile, 192px desktop) */
.site-footer__skyline {
  color: var(--color-camel);
  opacity: 0.13;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}
.site-footer__skyline svg {
  display: block;
  width: 100%;
  height: 8rem;            /* h-32 = 128px mobile */
}
@media (min-width: 768px) {
  .site-footer__skyline svg { height: 12rem; }  /* md:h-48 = 192px desktop */
}
/* Inner content (funnel: pt-16 pb-12, max-w-[1440px], items-center) */
.site-footer__inner {
  position: relative;
  z-index: 1;
  /* pt-16 = 4rem (64px), pb-12 = 3rem (48px) */
  padding: 4rem 1rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .site-footer__inner {
    /* md:px-margin-desktop - 2rem es el default desktop */
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
/* Logo (funnel: h-14 w-auto opacity-90 [filter:brightness(0)_invert(1)] md:h-16) */
.site-footer__logo {
  margin: 0 auto 1.75rem;   /* mb-7 = 28px */
  width: auto;
  height: 3.5rem;          /* h-14 = 56px mobile */
  opacity: 0.9;
  filter: brightness(0) invert(1);
}
@media (min-width: 768px) {
  .site-footer__logo { height: 4rem; }  /* md:h-16 = 64px desktop */
}
/* Divider con gradiente camel (mb-7 = 28px abajo) */
.site-footer__divider {
  width: 100%;
  max-width: 28rem;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(193, 152, 83, 0.5), transparent);
  margin-bottom: 1.75rem;
}
.site-footer__tagline {
  /* Funnel: "LUXURY REAL ESTATE" en DM Sans uppercase con tracking ancho, mb-2 */
  font-family: var(--font-body);
  font-size: 0.6875rem;  /* 11px (mobile), funnel usa text-[11px] */
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(248, 243, 237, 0.8);  /* parchment alpha (no opacity → selección crisp) */
  margin-bottom: 0.5rem;  /* mb-2 = 8px */
}
@media (min-width: 768px) {
  .site-footer__tagline { font-size: 0.75rem; }  /* 12px (desktop) = funnel text-xs */
}
.site-footer__location {
  font-size: 0.6875rem;  /* text-[11px] mobile */
  color: rgba(248, 243, 237, 0.55);
  letter-spacing: 0.1em;
  font-weight: 300;
  margin-bottom: 0.75rem;  /* mb-3 = 12px */
}
.site-footer__services {
  font-size: 0.75rem;
  color: rgba(248, 243, 237, 0.45);
  letter-spacing: 0.06em;
  font-weight: 300;
  margin-bottom: 2rem;  /* mb-8 = 32px */
}
.site-footer__address {
  font-size: 0.75rem;
  color: rgba(248, 243, 237, 0.55);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 2rem;  /* mb-8 = 32px */
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;  /* gap-x-7 = 28px */
  max-width: 42rem;
  margin-bottom: 2rem;  /* mb-8 = 32px */
}
.site-footer__nav a {
  font-size: 0.625rem;  /* text-[10px] mobile */
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(248, 243, 237, 0.5);
  text-decoration: none;
  transition: color 0.5s, opacity 0.5s;
  padding: 0.4rem 0.2rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.site-footer__nav a:hover,
.site-footer__nav a.active {
  color: var(--color-camel);
}
.site-footer__disclaimer {
  font-size: 0.6875rem;  /* text-[11px] */
  color: var(--color-parchment);
  opacity: 0.35;
  max-width: 36rem;  /* max-w-xl = 36rem */
  line-height: 1.6;
  margin-bottom: 0.75rem;  /* mb-3 = 12px */
  font-weight: 300;
}
.site-footer__copyright {
  font-size: 0.75rem;
  color: rgba(248, 243, 237, 0.5);  /* WCAG AA on onyx; alpha → selección crisp */
  font-weight: 300;
}

/* ── Tablet (1024px) ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .content-inner { padding: 2.5rem 1.5rem 3rem; }
}

/* ── Mobile (< 768px) ── */
@media (max-width: 767px) {
  .page-layout {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 0;
    background: var(--color-deep-space);
    z-index: var(--z-dropdown);
    /* Sticky header con tabs + safe area */
    padding-top: var(--safe-top);
  }

  .toc-desktop { display: none; }
  .mobile-tabs { display: flex; }
  .mobile-toc-panel {
    max-height: 70vh;
    border-top: 1px solid rgba(255,255,255,0.05);
  }

  .content-main { order: 1; }
  .content-inner {
    padding: 2rem 1.25rem 3rem;
    /* iOS safe area lateral */
    padding-left: max(1.25rem, var(--safe-left));
    padding-right: max(1.25rem, var(--safe-right));
  }
  .page-title { font-size: 1.85rem; line-height: 1.2; }
  .page-date { font-size: 0.7rem; margin-bottom: 2rem; }

  /* Listas mobile: padding-left reducido */
  .content-article ul { margin-left: 1rem; }
  .content-article ul li::before { left: -0.85rem; }

  /* Headings mobile: menos margin */
  .content-article h2 { margin-top: 2rem; }
  .content-article h3 { margin-top: 1.5rem; }

  /* Footer mobile — el skyline ya se escala con h-32/h-48 en CSS principal */
  .site-footer__logo { /* mismo tamaño que desktop, ya está responsive */ }
  .site-footer__nav { gap: 0.4rem 1rem; }
  .site-footer__nav a { font-size: 0.625rem; padding: 0.5rem 0.2rem; min-height: 36px; }
}

/* ── Mobile pequeño (< 380px) ── */
@media (max-width: 379px) {
  .content-inner { padding: 1.5rem 1rem 2.5rem; }
  .page-title { font-size: 1.6rem; }
  .site-footer__inner { padding: 2.5rem 1rem 2rem; }
}

/* ── iOS Safari bottom bar ── */
@supports (-webkit-touch-callout: none) {
  .content-wrapper { min-height: calc(100dvh - 280px); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sep { color: var(--color-camel); opacity: 1; }
