/* ===== Sabatino Abogados — estilos generales ===== */
:root {
  --blanco: #ffffff;
  --turquesa: #51bec7;      /* color de la "S" del logo */
  --azul-noche: #0a2a44;
  --linea: rgba(255, 255, 255, .45);
  --margen: clamp(20px, 4.5vw, 88px);
  --duracion-fade: 1.4s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--blanco);
  background: var(--azul-noche);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }

/* ===== HOME ===== */
.home { overflow: hidden; }

/* Fondos */
.fondos { position: fixed; inset: 0; z-index: 0; }
.fondo {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--duracion-fade) ease;
}
.fondo.activo { opacity: 1; }
.fondo video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Oscurecido sutil para que el texto se lea sobre cualquier video */
.fondos::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,.2) 62%, rgba(0,0,0,.5) 100%);
  pointer-events: none;
}
/* Colores provisionales (se ven mientras no estén los videos) */
.fondo-1 { background: radial-gradient(ellipse at 60% 40%, #1d5f86 0%, #0d3b5e 55%, #082a45 100%); }
.fondo-2 { background: radial-gradient(ellipse at 50% 45%, #4f8a7c 0%, #2b625a 50%, #1a4440 100%); }
.fondo-3 { background: linear-gradient(180deg, #5d4a36 0%, #8a7a62 22%, #3f7d78 38%, #2f5f66 65%, #3a4a6a 100%); }

/* Marco fino alrededor de la pantalla */
.marco {
  position: fixed;
  inset: clamp(6px, .8vw, 14px);
  border: 1px solid rgba(255, 255, 255, .35);
  z-index: 1;
  pointer-events: none;
}

/* Cabecera */
.cabecera {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center;
  padding: clamp(24px, 3.4vw, 64px) var(--margen) 0;
  font-size: clamp(11px, .78vw, 15px);
  font-weight: 400;
  letter-spacing: .04em;
}

.idiomas { display: flex; gap: .7em; align-items: center; }
.idiomas a { opacity: .85; transition: opacity .2s; }
.idiomas a:hover, .idiomas a.activo { opacity: 1; font-weight: 500; }

.menu {
  margin-left: auto;
  display: flex;
  gap: clamp(28px, 6vw, 140px);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .4s ease, transform .4s ease, visibility .4s;
}
.menu a { position: relative; padding: 4px 0; }
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--blanco);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.menu a:hover::after { transform: scaleX(1); }
.menu-abierto .menu { opacity: 1; visibility: visible; transform: none; }

.hamburguesa {
  margin-left: clamp(24px, 3vw, 60px);
  width: 22px; height: 14px;
  position: relative;
  background: none; border: 0; cursor: pointer;
}
.hamburguesa span {
  position: absolute; left: 0; right: 0;
  height: 1px; background: var(--blanco);
  opacity: .8;
  transition: transform .35s ease, opacity .25s ease, top .35s ease;
}
.hamburguesa span:nth-child(1) { top: 0; }
.hamburguesa span:nth-child(2) { top: 6px; }
.hamburguesa span:nth-child(3) { top: 12px; }
.menu-abierto .hamburguesa span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-abierto .hamburguesa span:nth-child(2) { opacity: 0; }
.menu-abierto .hamburguesa span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* Logo */
.logo {
  position: fixed; z-index: 5;
  left: 11%; top: 62%;
  display: flex; align-items: center;
  font-size: clamp(42px, 5.6vw, 120px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
}
.logo img { width: clamp(200px, 25.5vw, 520px); height: auto; display: block; }

/* Textos verticales de la derecha */
.textos {
  position: fixed; z-index: 5;
  left: 75.4%; right: 4%;
  top: 23.5%; bottom: 8%;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  border-left: 1px solid var(--linea);
}
.texto {
  position: relative;
  padding: 2.2em 0 0 1.4vw;
  cursor: pointer;
  opacity: .78;
  transition: opacity .6s ease;
}
.texto::before {            /* tramo grueso de la línea = slide activo */
  content: ""; position: absolute;
  left: -2px; top: 0; bottom: 0;
  width: 3px; background: var(--blanco);
  transform: scaleY(0); transform-origin: top;
  transition: transform .9s ease;
}
.texto.activo { opacity: 1; }
.texto.activo::before { transform: scaleY(1); }
.texto:hover { opacity: 1; }
.texto-link { display: block; }
.ver-mas {
  display: inline-block; margin-top: .9em;
  font-size: clamp(11px, .75vw, 15px); font-weight: 500; letter-spacing: .04em;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .4s ease, transform .4s ease;
}
.texto.activo .ver-mas { opacity: .9; transform: none; }

.texto h2 {
  font-size: clamp(14px, 1.15vw, 23px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: .45em;
  letter-spacing: .01em;
}
.texto p {
  font-size: clamp(11px, .8vw, 16px);
  font-weight: 400;
  line-height: 1.25;
  max-width: 22em;
}

/* ===== HOME en móvil (propuesta) ===== */
@media (max-width: 820px) {
  .cabecera { padding: 28px 24px 0; }

  /* Menú: pantalla completa */
  .menu {
    position: fixed; inset: 0;
    margin: 0;
    flex-direction: column; justify-content: center; align-items: center;
    gap: 32px;
    font-size: 20px;
    background: rgba(6, 30, 50, .92);
    backdrop-filter: blur(6px);
    z-index: -1;
  }
  .hamburguesa { margin-left: auto; }

  .logo { left: 50%; top: 32%; transform: translateX(-50%); }
  .logo img { width: 72vw; max-width: 340px; }

  /* Solo se ve el texto activo; la línea pasa a ser horizontal (3 tramos) */
  .textos {
    left: 24px; right: 24px; top: auto; bottom: 48px;
    display: block;
    border-left: 0;
    border-top: 1px solid var(--linea);
    min-height: 190px;
  }
  .texto {
    position: absolute; left: 0; right: 0; top: 0;
    padding: 24px 0 0;
    opacity: 0; pointer-events: none;
  }
  .texto.activo { opacity: 1; pointer-events: auto; }
  .texto::before {
    left: calc(var(--i) * 33.333%); width: 33.333%;
    top: -2px; bottom: auto; height: 3px;
    transform: none;
  }
  .texto h2 { font-size: 19px; }
  .ver-mas { font-size: 14px; margin-top: 14px; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
  .texto p { font-size: 14px; line-height: 1.4; max-width: none; }
}

/* ===== Aviso de cookies (todas las páginas) ===== */
.aviso-cookies {
  position: fixed; z-index: 100;
  left: 50%; bottom: 20px;
  width: min(820px, calc(100% - 32px));
  transform: translate(-50%, 20px); opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  background: #1d4a4f; color: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 24px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 13px; line-height: 1.5;
}
.aviso-cookies.visible { opacity: 1; transform: translate(-50%, 0); }
.aviso-cookies a { color: var(--turquesa); text-decoration: underline; }
.aviso-cookies-botones { display: flex; gap: 10px; flex: none; }
.aviso-cookies button {
  font: inherit; font-size: 12px; font-weight: 500; letter-spacing: .08em;
  padding: 10px 20px; cursor: pointer; border-radius: 0;
  border: 1.5px solid #fff; background: transparent; color: #fff;
  transition: background .2s, color .2s;
}
.aviso-cookies button:hover { background: #fff; color: #1d4a4f; }
@media (max-width: 640px) {
  .aviso-cookies { flex-direction: column; align-items: stretch; gap: 14px; bottom: 12px; }
  .aviso-cookies-botones button { flex: 1; }
}

/* ===== Ajustes de legibilidad (19 nov) ===== */
.cabecera { font-size: clamp(13px, .9vw, 16px); }
.textos { left: 72%; right: 3.5%; }
.texto { padding-left: 1.6vw; }
.texto h2 { font-size: clamp(17px, 1.35vw, 24px); }
.texto p { font-size: clamp(14px, 1vw, 17px); line-height: 1.38; max-width: 24em; }
.ver-mas { font-size: clamp(13px, .85vw, 15px); }
.aviso-cookies { font-size: 14px; }
.aviso-cookies button { font-size: 13px; }
@media (max-width: 820px) {
  .texto { padding-left: 0; }
  .texto h2 { font-size: 20px; }
  .texto p { font-size: 15.5px; line-height: 1.45; max-width: none; }
  .ver-mas { font-size: 15px; }
}
/* Pantallas medianas (iPad horizontal, laptops pequeños): más ancho y más alto para los 3 textos */
@media (min-width: 821px) and (max-width: 1200px) {
  .textos { left: 64%; top: 17%; bottom: 5%; }
  .logo { left: 8%; }
}
@media (min-width: 821px) and (max-height: 800px) {
  .textos { top: 15%; bottom: 4%; }
  .texto { padding-top: 1.4em; }
}
/* Móvil: oscurecido suave abajo, para que el texto se lea sobre cualquier video */
@media (max-width: 820px) {
  .fondos::after { background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.35) 62%, rgba(0,0,0,.6) 100%); }
}
@media (max-width: 820px) {
  .textos { left: 24px; right: 24px; top: auto; bottom: 48px; }
}
