/**
 * Estilos para Páginas Legais e Institucionais - Talhos Pavir
 * Preserva a identidade visual, tipografia e espaçamento do projeto.
 */

:root {
  --page-max: 860px;
  --page-wrap: 1080px;
}

body.page {
  background: var(--cream, #fbfaf7);
  color: var(--ink, #2a2220);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cabeçalho das Páginas Legais */
.pagehead {
  background: var(--cream, #fbfaf7);
  border-bottom: 1px solid var(--brown-light, #ede6de);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pagehead .wrap {
  max-width: var(--page-wrap);
  margin-inline: auto;
  padding-inline: var(--gutter, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pagehead .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
}

.pagehead .brand:hover {
  transform: scale(1.02);
}

.pagehead .brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.pagehead .brand-name {
  font-family: var(--font-display, 'Roboto Slab', serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--burgundy, #5a1921);
}

.pagehead .brand-name em {
  font-style: normal;
  color: var(--brown, #855335);
}

.pagehead-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pagehead-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--burgundy, #5a1921);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--brown-light, #ede6de);
  background: var(--warm-white, #fff);
  transition: all 0.2s ease;
}

.pagehead-nav a:hover {
  background: var(--burgundy, #5a1921);
  border-color: var(--burgundy, #5a1921);
  color: var(--warm-white, #fff);
}

/* Estrutura Principal */
main.legal-main,
main.page-main {
  flex: 1 0 auto;
  padding-block: clamp(40px, 6vw, 72px);
}

.legal-main .wrap,
.page-main .wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter, 28px);
}

/* Hero Institucional / Legal */
.legal-main .hero,
.page-main .hero {
  height: auto;
  min-height: 0;
  background: transparent;
  color: var(--ink, #2a2220);
  padding: 0 0 clamp(28px, 4vw, 44px);
  border-bottom: 2px solid var(--brown-light, #ede6de);
  display: block;
  text-align: left;
}

.legal-main .hero .eyebrow,
.page-main .hero .eyebrow {
  color: var(--burgundy, #5a1921);
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.legal-main .hero h1,
.page-main .hero h1 {
  font-family: var(--font-display, 'Roboto Slab', serif);
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.15;
  color: var(--ink, #2a2220);
  margin-bottom: 16px;
  font-weight: 700;
  text-shadow: none;
}

.legal-main .hero .lede,
.page-main .hero .lede {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.65;
  color: var(--ink-soft, #59524e);
  max-width: 68ch;
  margin-top: 14px;
}

.legal-main .hero .updated,
.page-main .hero .updated {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--brown, #855335);
  background: var(--brown-light, #ede6de);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Corpo do Documento / Artigos */
.page-body {
  padding-top: clamp(32px, 4.5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3.5vw, 36px);
}

/* Artigos / Cláusulas */
.clause {
  background: var(--warm-white, #fff);
  border: 1px solid var(--brown-light, #ede6de);
  border-radius: var(--radius, 10px);
  padding: clamp(20px, 3.5vw, 32px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clause:hover {
  box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,0.06));
}

.clause h2 {
  font-family: var(--font-display, 'Roboto Slab', serif);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 600;
  color: var(--ink, #2a2220);
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.clause h2 .no {
  font-family: var(--font-mono, monospace);
  color: var(--burgundy, #5a1921);
  font-size: 0.9em;
}

.clause h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--burgundy, #5a1921);
  margin-top: 20px;
  margin-bottom: 10px;
}

.clause p {
  color: var(--ink-soft, #59524e);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 14px;
}

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

.clause ul,
.clause ol {
  color: var(--ink-soft, #59524e);
  font-size: 15px;
  line-height: 1.65;
  padding-left: 24px;
  margin: 12px 0 16px;
}

.clause li {
  margin-bottom: 8px;
}

.clause a {
  color: var(--burgundy, #5a1921);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.clause a:hover {
  color: var(--brown, #855335);
}

/* Tabelas de Cookies */
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  background: var(--warm-white, #fff);
  border: 1px solid var(--brown-light, #ede6de);
  border-radius: 8px;
  overflow: hidden;
}

.cookie-table caption {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  padding: 10px 14px;
  background: var(--brown-light, #ede6de);
  color: var(--burgundy, #5a1921);
  caption-side: top;
}

.cookie-table th,
.cookie-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--brown-light, #ede6de);
  text-align: left;
}

.cookie-table th {
  background: var(--cream, #fbfaf7);
  font-weight: 600;
  color: var(--ink, #2a2220);
}

.cookie-table td.name {
  font-family: var(--font-mono, monospace);
  color: var(--burgundy, #5a1921);
  font-size: 13px;
}

.cookie-table tr:last-child td {
  border-bottom: none;
}

.cookie-note {
  font-size: 13.5px;
  color: var(--ink-soft, #59524e);
  font-style: italic;
  margin-top: 14px;
}

/* Bloco de Contato */
.contact-block {
  background: var(--cream, #fbfaf7);
  border: 1px solid var(--brown-light, #ede6de);
  border-radius: 8px;
  padding: 18px 22px;
  margin-top: 14px;
}

.contact-address {
  list-style: disc;
  padding-left: 20px;
  margin: 8px 0 14px;
}

.contact-address li {
  margin-bottom: 6px;
  font-size: 14.5px;
}

/* Cards (Livro de Reclamações, RAL/RLL, etc.) */
.card {
  background: var(--warm-white, #fff);
  border: 1px solid var(--brown-light, #ede6de);
  border-radius: var(--radius, 10px);
  padding: clamp(22px, 3.5vw, 36px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
}

.card .kicker {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--burgundy, #5a1921);
  font-weight: 600;
  margin-bottom: 8px;
}

.card h2 {
  font-family: var(--font-display, 'Roboto Slab', serif);
  font-size: clamp(22px, 2.6vw, 26px);
  color: var(--ink, #2a2220);
  margin-bottom: 16px;
}

.card p {
  color: var(--ink-soft, #59524e);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 14px;
}

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

.card .note {
  font-size: 13.5px;
  font-style: italic;
  color: var(--brown, #855335);
  margin-top: 14px;
}

/* Lista de Passos (Steps) */
ol.steps {
  list-style: none;
  counter-reset: steps-counter;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

ol.steps li {
  counter-increment: steps-counter;
  position: relative;
  padding-left: 44px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft, #59524e);
}

ol.steps li::before {
  content: counter(steps-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--burgundy, #5a1921);
  color: var(--warm-white, #fff);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Botão Link Externo */
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--burgundy, #5a1921);
  color: var(--warm-white, #fff) !important;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  text-decoration: none !important;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.ext-link::after {
  content: '↗';
  font-size: 14px;
}

.ext-link:hover {
  background: var(--burgundy-light, #7a232e);
  box-shadow: 0 6px 16px rgba(90, 25, 33, 0.25);
  transform: translateY(-2px);
}

/* Lista de Entidades RAL */
.entity-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entity-list li {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--cream, #fbfaf7);
  border: 1px solid var(--brown-light, #ede6de);
  border-radius: 8px;
  font-size: 14px;
}

.entity-list .acr {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--burgundy, #5a1921);
}

.entity-list .full {
  color: var(--ink, #2a2220);
  line-height: 1.4;
}

.entity-list .site {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  color: var(--brown, #855335);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .entity-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
