/* ============================================================
   ROYAL IMBAU — Legal Pages Shared Styles
   Applies to: aviso-legal, politica-privacidad, politica-cookies
   ============================================================ */

/* ---- Legal Header ---- */
.legal-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.legal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
  flex-wrap: wrap;
}

.legal-header__logo img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.legal-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.legal-header__link {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
  letter-spacing: 0.02em;
}

.legal-header__link:hover {
  color: var(--text-primary);
  border-color: var(--border);
}

.legal-header__link--active {
  color: var(--text-primary);
  border-color: var(--border);
  background-color: var(--bg-section);
  font-weight: 600;
}

/* ---- Main layout ---- */
.legal-main {
  padding-block: 64px 96px;
}

.legal-content {
  max-width: 800px;
}

/* ---- Hero ---- */
.legal-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-hero__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 10px;
  margin-bottom: 8px;
}

.legal-hero__meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* ---- Article ---- */
.legal-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Section ---- */
.legal-section {
  padding-block: 36px;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.25;
}

.legal-section__subtitle {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 12px;
}

.legal-section p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

/* ---- Lists ---- */
.legal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-list li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.legal-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ---- Tables ---- */
.legal-table-wrap {
  overflow-x: auto;
  margin-block: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-block: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.legal-table--cookies {
  margin-block: 0;
  border: none;
  border-radius: 0;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}

.legal-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-section);
  font-size: 0.8125rem;
}

.legal-table td {
  color: var(--text-secondary);
}

.legal-table tr:last-child td,
.legal-table tr:last-child th {
  border-bottom: none;
}

.legal-table__note {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.8125rem;
}

/* ---- Links ---- */
.legal-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}

.legal-link:hover {
  text-decoration-color: var(--accent);
}

/* ---- TODO placeholders ---- */
.legal-todo {
  color: #C2410C;
  background-color: #FFF7ED;
  padding: 2px 6px;
  border-radius: 3px;
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ---- Cookie config button on cookies page ---- */
.legal-cookie-btn-wrap {
  margin-top: 16px;
}

.legal-cookie-open-btn {
  /* Inherits from .ri-cb__btn .ri-cb__btn--settings */
  /* These classes are injected by cookie-consent.js */
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  transition: background 0.2s;
  min-height: 44px;
}

.legal-cookie-open-btn:hover {
  background: #EFF6FF;
}

/* ---- Footer legal links ---- */
.footer__legal-link {
  font-size: 0.875rem;
  color: var(--text-light);
  transition: color var(--transition);
}

.footer__legal-link:hover {
  color: var(--accent);
}

.footer__legal-link--active {
  color: var(--accent);
  font-weight: 500;
}

/* ---- Inline code ---- */
.legal-section code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8125rem;
  background-color: var(--bg-section);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  word-break: break-all;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .legal-main {
    padding-block: 40px 64px;
  }

  .legal-section {
    padding-block: 24px;
  }

  .legal-table th,
  .legal-table td {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }

  .legal-header__inner {
    gap: 12px;
  }

  .legal-header__link {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

/* ---- Print ---- */
@media print {
  .legal-header { position: static; }
  .legal-todo { border: 1px solid #C2410C; }
}
