/* =========================================================
   DAVÍD RINCÓN — Global Styles v3.0 "Lex Aurum"
   Luxury Legal · Gold × Obsidian · World-Class 2026
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Custom Properties ─────────────────────────────────── */
:root {
  /* Paleta Obsidiana × Oro */
  --obsidian:      #0a0705;
  --obsidian-mid:  #110e0a;
  --obsidian-soft: #1c1610;
  --brown-dark:    #3b1f0e;
  --brown-mid:     #6b3a1f;
  --brown-light:   #8b5a2b;

  /* Sistema dorado de 5 tonos */
  --gold-dim:      #7a5c1e;
  --mustard:       #b8892a;
  --gold:          #c9a227;
  --gold-bright:   #d4a843;
  --gold-pale:     #e8c96a;
  --gold-shine:    #f5e098;
  --mustard-light: #d4a843;

  /* Neutros */
  --white:         #ffffff;
  --off-white:     #f8f5f0;
  --cream:         #faf7f2;
  --gray-light:    #e8e0d5;
  --gray-text:     #6b6058;
  --text-dark:     #0a0705;

  /* Tipografía */
  --font-serif:    'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans:     'Outfit', 'Raleway', sans-serif;

  /* Espaciado & Forma */
  --radius:        6px;
  --radius-lg:     14px;
  --radius-pill:   999px;
  --header-h:      72px;

  /* Sombras doradas */
  --shadow:        0 4px 24px rgba(10,7,5,0.14), 0 1px 4px rgba(10,7,5,0.08);
  --shadow-lg:     0 12px 48px rgba(10,7,5,0.22), 0 4px 12px rgba(10,7,5,0.12);
  --shadow-gold:   0 0 0 1px rgba(201,162,39,0.25), 0 8px 32px rgba(184,137,42,0.18);
  --shadow-glow:   0 0 40px rgba(201,162,39,0.22);

  /* Gradientes */
  --grad-gold:     linear-gradient(135deg, #b8892a 0%, #e8c96a 50%, #b8892a 100%);
  --grad-gold-h:   linear-gradient(90deg, #c9a227 0%, #f5e098 50%, #c9a227 100%);
  --grad-dark:     linear-gradient(160deg, #0a0705 0%, #1c1610 100%);
  --grad-overlay:  linear-gradient(to bottom, rgba(10,7,5,0.2) 0%, rgba(10,7,5,0.75) 60%, rgba(10,7,5,0.95) 100%);

  /* Transiciones */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

/* Scrollbar personalizado */
::-webkit-scrollbar              { width: 6px; }
::-webkit-scrollbar-track        { background: var(--obsidian); }
::-webkit-scrollbar-thumb        { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--gold); }

/* Selección de texto */
::selection {
  background: var(--gold);
  color: var(--obsidian);
}

/* ── Layout ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px)  { .container { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2.5rem; } }

/* ── Tipografía Global ────────────────────────────────── */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--brown-dark);
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 2rem;
  position: relative;
  transition: color 0.3s ease;
}

/* Línea decorativa dorada bajo cada título */
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--grad-gold);
  margin: 0.75rem auto 0;
  border-radius: 2px;
  opacity: 0.85;
}

/* ── Botón Primario — Oro Premium ─────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--grad-gold);
  background-size: 200% auto;
  color: var(--obsidian);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.95rem 2.2rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background-position 0.5s var(--ease-out),
    transform 0.2s var(--ease-bounce),
    box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(184,137,42,0.35);
  text-align: center;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.12), rgba(255,255,255,0));
  pointer-events: none;
}

.btn-primary:hover {
  background-position: right center;
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 32px rgba(184,137,42,0.50), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
}

/* Botón secundario outline */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--gold);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s var(--ease-bounce);
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--obsidian);
  transform: translateY(-2px);
}

/* ── Ornamento decorativo (separador) ─────────────────── */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem auto 2rem;
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.7;
  letter-spacing: 0.3em;
}
.ornament::before,
.ornament::after {
  content: '';
  height: 1px;
  width: 48px;
  background: var(--grad-gold);
  opacity: 0.5;
  border-radius: 1px;
}

/* ── Animaciones ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,0); }
  50%       { box-shadow: 0 0 0 8px rgba(201,162,39,0.12); }
}

.fade-up   { animation: fadeUp  0.75s var(--ease-out) both; }
.fade-in   { animation: fadeIn  0.6s  ease both; }
.scale-in  { animation: scaleIn 0.6s  var(--ease-out) both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.22s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.5s; }

/* ── Scroll-triggered reveal ──────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Gold shimmer text ────────────────────────────────── */
.text-gold {
  background: var(--grad-gold-h);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ── Glassmorphism card ───────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(201,162,39,0.15);
  border-radius: var(--radius-lg);
}

/* ── Noise texture overlay ────────────────────────────── */
.noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 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.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

/* ── Focus visible accesible ──────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ========================================================
   SISTEMA DE TEMAS: CLARO (default) y OSCURO
   
   LÓGICA:
   - Por defecto (sin atributo o data-theme="light"):
       Secciones "light" → fondo blanco/crema
       Secciones "dark"  → fondo obsidian (WhyUs, Footer, Hero)
   - data-theme="dark":
       TODAS las secciones → fondo oscuro
   ======================================================== */

/* ── MODO CLARO (default) — estado base correcto ─────── */

/* El header siempre en blanco en modo claro */
html:not([data-theme="dark"]) .header-main {
  background: rgba(255, 255, 255, 0.97) !important;
}

html:not([data-theme="dark"]) .nav-link {
  color: var(--brown-mid);
}

html:not([data-theme="dark"]) .hamburger {
  color: var(--brown-dark);
  border-color: rgba(184,137,42,0.4);
}

/* Body claro */
html:not([data-theme="dark"]) body {
  background-color: var(--white);
  color: var(--text-dark);
}

/* Secciones claras: fondo blanco/crema */
html:not([data-theme="dark"]) .trust-badges {
  background: var(--white);
  border-top: 1px solid var(--gray-light);
  border-bottom: 1px solid var(--gray-light);
}

html:not([data-theme="dark"]) .services {
  background: var(--white);
}

html:not([data-theme="dark"]) .success-cases {
  background: var(--off-white);
}

html:not([data-theme="dark"]) .faq {
  background: var(--off-white);
}

html:not([data-theme="dark"]) .lawyers {
  background: var(--off-white);
}

html:not([data-theme="dark"]) .blog {
  background: var(--white);
}

html:not([data-theme="dark"]) .about-content,
html:not([data-theme="dark"]) .blog-index {
  background: var(--white);
}

/* Tarjetas en modo claro */
html:not([data-theme="dark"]) .service-card {
  background: var(--white);
  border: 1px solid rgba(184,137,42,0.12);
  box-shadow: 0 2px 16px rgba(10,7,5,0.06);
}

html:not([data-theme="dark"]) .faq-item {
  background: var(--white);
  border: 1px solid var(--gray-light);
}

html:not([data-theme="dark"]) .lawyer-card {
  background: var(--white);
  border: 1px solid rgba(184,137,42,0.1);
  box-shadow: 0 2px 16px rgba(10,7,5,0.06);
}

html:not([data-theme="dark"]) .blog-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
}

html:not([data-theme="dark"]) .sc-card--testimonial {
  background: var(--white);
  border: 1px solid rgba(184,137,42,0.1);
  box-shadow: 0 4px 24px rgba(10,7,5,0.06);
}

/* Textos en modo claro */
html:not([data-theme="dark"]) .section-title {
  color: var(--brown-dark);
}

html:not([data-theme="dark"]) .trust-label,
html:not([data-theme="dark"]) .trust-name-text {
  color: rgba(0,0,0,0.28);
}

html:not([data-theme="dark"]) .service-name,
html:not([data-theme="dark"]) .lawyer-name,
html:not([data-theme="dark"]) .blog-post-title a {
  color: var(--brown-dark);
}

html:not([data-theme="dark"]) .service-desc,
html:not([data-theme="dark"]) .lawyer-desc,
html:not([data-theme="dark"]) .blog-excerpt,
html:not([data-theme="dark"]) .faq-answer p {
  color: var(--gray-text);
}

html:not([data-theme="dark"]) .faq-question,
html:not([data-theme="dark"]) .faq-q-text {
  color: var(--brown-dark);
}

html:not([data-theme="dark"]) .sc-client {
  color: var(--brown-dark);
}

html:not([data-theme="dark"]) .sc-excerpt {
  color: var(--gray-text);
}

/* Secciones que SIEMPRE son oscuras (independiente del tema) */
/* WhyUs, Footer, Hero — siempre sobre fondo obsidian */
.why-us,
.site-footer,
.hero,
.header-topbar,
.mobile-menu-inner {
  /* Mantienen su fondo oscuro en ambos temas */
  color: rgba(255,255,255,0.85);
}

/* ── MODO OSCURO COMPLETO ─────────────────────────────── */

html[data-theme="dark"] body {
  background-color: var(--obsidian);
  color: rgba(255,255,255,0.85);
}

/* Header oscuro */
html[data-theme="dark"] .header-main {
  background: rgba(10, 7, 5, 0.97) !important;
  border-bottom-color: rgba(201,162,39,0.2) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4) !important;
}

html[data-theme="dark"] .nav-link {
  color: rgba(255,255,255,0.7) !important;
}

html[data-theme="dark"] .nav-link:hover {
  color: var(--gold-bright) !important;
}

html[data-theme="dark"] .hamburger {
  color: rgba(255,255,255,0.8) !important;
  border-color: rgba(201,162,39,0.3) !important;
}

html[data-theme="dark"] .logo-main {
  color: var(--gold-pale) !important;
}

/* Todas las secciones claras → oscuras */
html[data-theme="dark"] .trust-badges,
html[data-theme="dark"] .services,
html[data-theme="dark"] .success-cases,
html[data-theme="dark"] .faq,
html[data-theme="dark"] .lawyers,
html[data-theme="dark"] .about-content,
html[data-theme="dark"] .blog-index,
html[data-theme="dark"] .blog {
  background-color: var(--obsidian-mid) !important;
  border-color: rgba(255,255,255,0.05) !important;
}

/* Variación alternada para diferenciar secciones en dark mode */
html[data-theme="dark"] .success-cases,
html[data-theme="dark"] .lawyers,
html[data-theme="dark"] .faq {
  background-color: var(--obsidian-soft) !important;
}

/* Tarjetas en modo oscuro → glassmorphism */
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .sc-card--testimonial,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .lawyer-card,
html[data-theme="dark"] .blog-card {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(201,162,39,0.12) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
}

html[data-theme="dark"] .faq-item[open] {
  background: rgba(201,162,39,0.05) !important;
  border-color: rgba(201,162,39,0.2) !important;
}

html[data-theme="dark"] .cta-box,
html[data-theme="dark"] .about-img-wrap,
html[data-theme="dark"] .srv-faq,
html[data-theme="dark"] .srv-sections {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Textos principales → blancos */
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .trust-label,
html[data-theme="dark"] .trust-name-text,
html[data-theme="dark"] .service-name,
html[data-theme="dark"] .sc-client,
html[data-theme="dark"] .faq-question,
html[data-theme="dark"] .faq-q-text,
html[data-theme="dark"] .lawyer-name,
html[data-theme="dark"] .values-title,
html[data-theme="dark"] .value-label,
html[data-theme="dark"] .srv-title,
html[data-theme="dark"] .cta-box h3,
html[data-theme="dark"] .blog-post-title a,
html[data-theme="dark"] .cases-subtitle {
  color: #ffffff !important;
}

/* Párrafos → gris claro */
html[data-theme="dark"] .service-desc,
html[data-theme="dark"] .sc-excerpt,
html[data-theme="dark"] .faq-answer p,
html[data-theme="dark"] .lawyer-desc,
html[data-theme="dark"] .story-text,
html[data-theme="dark"] .value-desc,
html[data-theme="dark"] .srv-desc,
html[data-theme="dark"] .cta-box p,
html[data-theme="dark"] .blog-excerpt,
html[data-theme="dark"] .faq-subtitle,
html[data-theme="dark"] .lawyer-spec,
html[data-theme="dark"] .blog-date,
html[data-theme="dark"] .blog-meta {
  color: rgba(255,255,255,0.65) !important;
}

/* Trust badges logos → más visibles */
html[data-theme="dark"] .trust-logo {
  filter: brightness(0) invert(1) opacity(0.45);
}

/* Links de lectura/navegación en dark */
html[data-theme="dark"] .blog-read-more,
html[data-theme="dark"] .service-link {
  color: var(--gold-bright) !important;
}

/* Bordes separadores en dark */
html[data-theme="dark"] .trust-badges {
  border-top-color: rgba(255,255,255,0.06) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

/* FAQ icon y summary */
html[data-theme="dark"] .faq-icon {
  color: var(--gold) !important;
}

/* Stars de testimonios */
html[data-theme="dark"] .case-stars,
html[data-theme="dark"] .stars-visual {
  color: var(--gold-bright) !important;
}

/* Página Nosotros / Servicios (subpáginas interiores) */
html[data-theme="dark"] .about-hero,
html[data-theme="dark"] .srv-hero {
  background: var(--obsidian) !important;
}

html[data-theme="dark"] .value-card,
html[data-theme="dark"] .srv-card {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(201,162,39,0.12) !important;
}

html[data-theme="dark"] .value-label,
html[data-theme="dark"] .srv-card-title {
  color: #ffffff !important;
}

/* Formulario de contacto en dark */
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .contact-section {
  background: var(--obsidian-mid) !important;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(201,162,39,0.2) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(255,255,255,0.35) !important;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
  color: rgba(255,255,255,0.75) !important;
}