/* =========================================================
   MIDAMENTUM - LEGAL PAGES
   Archivo: /assets/css/pages/legal.css
   Páginas: aviso legal, privacidad, cookies
========================================================= */


/* =========================================================
   VARIABLES LOCALES
========================================================= */

:root {
  --legal-bg: #fafaff;
  --legal-surface: #ffffff;
  --legal-surface-soft: #f4f5f7;

  --legal-text: #141416;
  --legal-text-soft: #555a63;
  --legal-text-muted: #777d88;

  --legal-border: rgba(20, 20, 22, 0.12);
  --legal-border-strong: rgba(20, 20, 22, 0.2);

  --legal-accent: #161616;
  --legal-accent-soft: rgba(20, 20, 22, 0.06);

  --legal-max: 920px;
  --legal-wide: 1120px;

  --legal-radius: 0;
  --legal-shadow: 0 24px 70px rgba(20, 20, 22, 0.06);
}


/* =========================================================
   BASE
========================================================= */

body.page-legal {
  background: var(--legal-bg);
}

body.page-legal .site {
  background: var(--legal-bg);
}

.legal-page {
  background: var(--legal-bg);
  color: var(--legal-text);
}

.legal-page *,
.legal-page *::before,
.legal-page *::after {
  box-sizing: border-box;
}

.legal-page a {
  color: var(--legal-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.legal-page a:hover,
.legal-page a:focus {
  opacity: 0.72;
}

.legal-page p {
  margin: 0 0 1.1rem;
  color: var(--legal-text-soft);
  font-size: 1.02rem;
  line-height: 1.75;
}

.legal-page p:last-child {
  margin-bottom: 0;
}

.legal-page strong {
  color: var(--legal-text);
  font-weight: 700;
}


/* =========================================================
   CONTAINER FALLBACK
   Solo actúa si el container global no está suficientemente definido
========================================================= */

.page-legal .container {
  width: min(var(--legal-wide), calc(100% - 40px));
  margin-inline: auto;
}


/* =========================================================
   HERO LEGAL
========================================================= */

.legal-hero {
  position: relative;
  padding: 10vh 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(135deg, #141416 0%, #202126 52%, #111113 100%);
  color: #ffffff;
  overflow: hidden;
}

.legal-hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
}

.legal-hero::after {
  content: "";
  position: absolute;
  right: -12vw;
  top: -16vw;
  width: 38vw;
  height: 38vw;
  min-width: 360px;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(18deg);
  pointer-events: none;
}

.legal-hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--legal-max);
}

.legal-eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 840px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.legal-hero h1 + p,
.legal-hero__inner > p:last-child {
  max-width: 720px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.7;
}


/* =========================================================
   SECCIÓN GENERAL
========================================================= */

.legal-section {
  padding: clamp(56px, 8vw, 96px) 0 clamp(72px, 10vw, 120px);
}

.legal-content {
  max-width: var(--legal-max);
}


/* =========================================================
   BLOQUES DE CONTENIDO
========================================================= */

.legal-block {
  position: relative;
  margin: 0 0 28px;
  padding: clamp(28px, 4vw, 46px);
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  box-shadow: var(--legal-shadow);
}

.legal-block:last-of-type {
  margin-bottom: 0;
}

.legal-block::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 34px;
  width: 3px;
  height: 42px;
  background: var(--legal-accent);
}

.legal-block h2 {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--legal-text);
  font-size: clamp(1.42rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.legal-block h3 {
  margin: 30px 0 14px;
  color: var(--legal-text);
  font-size: clamp(1.16rem, 2vw, 1.36rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.legal-block h4 {
  margin: 26px 0 10px;
  color: var(--legal-text);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.35;
}

.legal-block ul,
.legal-block ol {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
  color: var(--legal-text-soft);
}

.legal-block li {
  margin-bottom: 0.62rem;
  padding-left: 0.18rem;
  color: var(--legal-text-soft);
  font-size: 1.02rem;
  line-height: 1.68;
}

.legal-block li:last-child {
  margin-bottom: 0;
}

.legal-block li::marker {
  color: var(--legal-text);
  font-weight: 700;
}

.legal-block blockquote {
  margin: 28px 0;
  padding: 22px 26px;
  background: var(--legal-accent-soft);
  border-left: 3px solid var(--legal-accent);
  color: var(--legal-text-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.legal-block hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--legal-border);
}


/* =========================================================
   DATOS LEGALES EN DL
========================================================= */

.legal-data {
  margin: 28px 0;
  border: 1px solid var(--legal-border);
  background: var(--legal-surface);
}

.legal-data div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--legal-border);
}

.legal-data div:last-child {
  border-bottom: 0;
}

.legal-data dt,
.legal-data dd {
  margin: 0;
  padding: 16px 18px;
  font-size: 1rem;
  line-height: 1.55;
}

.legal-data dt {
  display: flex;
  align-items: center;
  background: var(--legal-surface-soft);
  border-right: 1px solid var(--legal-border);
  color: var(--legal-text);
  font-weight: 700;
}

.legal-data dd {
  color: var(--legal-text-soft);
  overflow-wrap: anywhere;
}

.legal-data dd a {
  color: var(--legal-text);
  font-weight: 650;
}


/* =========================================================
   TABLAS LEGALES
   Por si las usamos en cookies o aviso legal
========================================================= */

.legal-table-wrap {
  width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--legal-border);
  background: var(--legal-surface);
}

.legal-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.legal-table th,
.legal-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--legal-border);
  text-align: left;
  vertical-align: top;
  font-size: 0.98rem;
  line-height: 1.55;
}

.legal-table th {
  background: var(--legal-text);
  color: #ffffff;
  font-weight: 700;
}

.legal-table td {
  color: var(--legal-text-soft);
}

.legal-table tr:last-child td {
  border-bottom: 0;
}


/* =========================================================
   TEXTOS DESTACADOS / AVISOS
========================================================= */

.legal-note,
.legal-warning {
  margin: 28px 0;
  padding: 22px 24px;
  background: var(--legal-accent-soft);
  border: 1px solid var(--legal-border-strong);
}

.legal-note p,
.legal-warning p {
  color: var(--legal-text-soft);
}

.legal-note strong,
.legal-warning strong {
  color: var(--legal-text);
}

.legal-warning {
  background: #fff8ed;
}


/* =========================================================
   ÚLTIMA ACTUALIZACIÓN
========================================================= */

.legal-updated {
  margin: 34px 0 0;
  padding: 18px 22px;
  background: transparent;
  border-top: 1px solid var(--legal-border);
  color: var(--legal-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}


/* =========================================================
   BOTONES LEGALES
   Por si los añadimos después
========================================================= */

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.legal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid var(--legal-text);
  border-radius: 0;
  background: var(--legal-text);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.legal-btn:hover,
.legal-btn:focus {
  transform: translateY(-2px);
  background: transparent;
  color: var(--legal-text);
  opacity: 1;
}

.legal-btn--secondary {
  background: transparent;
  color: var(--legal-text);
}

.legal-btn--secondary:hover,
.legal-btn--secondary:focus {
  background: var(--legal-text);
  color: #ffffff;
}


/* =========================================================
   COMPATIBILIDAD CON HEADER / FOOTER
========================================================= */

.page-legal .site-main {
  min-height: 70vh;
}

.page-legal .site-footer {
  margin-top: 0;
}


/* =========================================================
   ACCESIBILIDAD
========================================================= */

.legal-page a:focus-visible,
.legal-page button:focus-visible,
.legal-page .legal-btn:focus-visible {
  outline: 3px solid rgba(20, 20, 22, 0.22);
  outline-offset: 4px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
  .legal-hero {
    padding: 82px 0 72px;
  }

  .legal-section {
    padding-top: 52px;
  }

  .legal-data div {
    grid-template-columns: 1fr;
  }

  .legal-data dt {
    border-right: 0;
    border-bottom: 1px solid var(--legal-border);
  }
}

@media (max-width: 640px) {
  .page-legal .container {
    width: min(100% - 28px, var(--legal-wide));
  }

  .legal-hero {
    padding: 70px 0 58px;
  }

  .legal-eyebrow {
    margin-bottom: 14px;
    font-size: 0.72rem;
  }

  .legal-hero h1 {
    font-size: clamp(2.18rem, 13vw, 3.25rem);
    line-height: 1;
    letter-spacing: -0.05em;
  }

  .legal-hero h1 + p,
  .legal-hero__inner > p:last-child {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .legal-section {
    padding: 40px 0 76px;
  }

  .legal-block {
    margin-bottom: 22px;
    padding: 26px 22px;
  }

  .legal-block::before {
    top: 28px;
    height: 36px;
  }

  .legal-block h2 {
    margin-bottom: 18px;
  }

  .legal-page p,
  .legal-block li {
    font-size: 0.98rem;
    line-height: 1.68;
  }

  .legal-data {
    margin: 24px 0;
  }

  .legal-data dt,
  .legal-data dd {
    padding: 14px 16px;
    font-size: 0.96rem;
  }

  .legal-actions {
    flex-direction: column;
  }

  .legal-btn {
    width: 100%;
  }

  .legal-updated {
    margin-top: 26px;
    padding: 16px 0 0;
  }
}


/* =========================================================
   PRINT
========================================================= */

@media print {
  body.page-legal,
  body.page-legal .site,
  .legal-page {
    background: #ffffff;
    color: #000000;
  }

  .legal-hero {
    padding: 0 0 24px;
    background: #ffffff;
    color: #000000;
  }

  .legal-hero::before,
  .legal-hero::after,
  .legal-block::before,
  .legal-actions {
    display: none;
  }

  .legal-hero h1,
  .legal-hero h1 + p,
  .legal-hero__inner > p:last-child,
  .legal-eyebrow,
  .legal-block h2,
  .legal-block h3,
  .legal-block h4,
  .legal-page p,
  .legal-block li,
  .legal-data dt,
  .legal-data dd {
    color: #000000;
  }

  .legal-section {
    padding: 0;
  }

  .page-legal .container,
  .legal-content {
    width: 100%;
    max-width: none;
  }

  .legal-block {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .legal-data,
  .legal-data div,
  .legal-data dt,
  .legal-data dd {
    border-color: #000000;
    background: #ffffff;
  }

  .legal-page a {
    color: #000000;
    text-decoration: underline;
  }
}