/* ============================================================
   Regulamento oficial incorporado ao detalhe do evento.
   Escopo visual integral: .event-regulation.
   ============================================================ */

.event-regulation {
  --section-accent: var(--action);
  --section-accent-ink: var(--action-ink);
  --section-accent-line: var(--warm-line);
  scroll-margin-top: calc(var(--header-height) + var(--space-24));
  display: grid;
  gap: var(--space-24);
  padding: clamp(var(--space-24), 4vw, var(--space-40));
  border: var(--line-strong) solid var(--line-strong-color);
  border-top-width: var(--line-emphasis);
  border-top-color: var(--section-accent);
  background: var(--warm-surface);
}

.event-regulation__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-24);
  align-items: end;
}

.event-regulation__marker {
  display: inline-flex;
  width: fit-content;
  padding: var(--space-8) var(--space-12);
  border: var(--line-soft) solid var(--section-accent-line);
  background: var(--surface-plain);
  color: var(--section-accent-ink);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}

.event-regulation__header h2 {
  margin-top: var(--space-12);
  color: var(--structure-deep);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1;
  text-transform: uppercase;
}

.event-regulation__event-name {
  max-width: 42ch;
  margin-top: var(--space-12);
  color: var(--ink);
  font-size: var(--text-lead);
  font-weight: 700;
}

.event-regulation__meta,
.event-regulation__pages {
  margin-top: var(--space-8);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}

.event-regulation__pages {
  color: var(--section-accent-ink);
  font-weight: 700;
}

.event-regulation__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  justify-content: flex-end;
}

.event-regulation__controls .btn {
  min-height: 48px;
}

.event-regulation .regulation-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.event-regulation .regulation-document[hidden] {
  display: none;
}

.event-regulation .regulation-document {
  display: grid;
  gap: var(--space-32);
  padding-top: var(--space-32);
  border-top: var(--line-soft) solid var(--section-accent-line);
}

.event-regulation .regulation-sheet {
  width: 100%;
  max-width: 900px;
  padding: clamp(var(--space-24), 5vw, var(--space-48));
  margin-inline: auto;
  border: var(--line-soft) solid var(--line);
  border-top: var(--line-emphasis) solid var(--action);
  border-bottom: var(--line-emphasis) solid var(--structure);
  background: var(--surface-plain);
  box-shadow: var(--solid-offset) var(--solid-offset) 0 var(--line-strong-color);
}

.event-regulation .regulation-sheet__header {
  display: flex;
  gap: var(--space-20);
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-16);
  margin-bottom: var(--space-24);
  border-bottom: var(--line-strong) solid var(--action);
}

.event-regulation .regulation-sheet__brand {
  display: flex;
  gap: var(--space-10);
  align-items: center;
  flex: 0 0 auto;
}

.event-regulation .regulation-sheet__brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.event-regulation .regulation-sheet--continued .regulation-sheet__brand img {
  width: 32px;
  height: 32px;
}

.event-regulation .regulation-sheet__brand-text {
  display: grid;
  color: var(--structure);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: var(--tracking-meta);
  line-height: 1.15;
  text-transform: uppercase;
}

.event-regulation .regulation-sheet__brand-text strong {
  color: var(--action-ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.event-regulation .regulation-sheet__ident {
  max-width: 430px;
  padding: var(--space-12) var(--space-20);
  border-left: var(--line-emphasis) solid var(--action);
  background: var(--structure-deep);
  color: var(--color-white);
  text-align: right;
}

.event-regulation .regulation-sheet__ident strong {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 2vw, 1.15rem);
  letter-spacing: var(--tracking-title);
  line-height: 1.15;
  text-transform: uppercase;
}

.event-regulation .regulation-sheet__ident-detail {
  margin-top: var(--space-4);
  color: var(--on-dark-warning);
  font-size: var(--text-meta);
}

.event-regulation .regulation-chapter + .regulation-chapter {
  margin-top: var(--space-24);
}

.event-regulation .regulation-chapter > h3 {
  padding: var(--space-10) var(--space-16);
  margin-bottom: var(--space-16);
  border-left: var(--line-emphasis) solid var(--action);
  background: var(--surface-alt);
  color: var(--structure-deep);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.2;
  text-transform: uppercase;
}

.event-regulation .regulation-article {
  margin-bottom: var(--space-16);
}

.event-regulation .regulation-article:last-child {
  margin-bottom: 0;
}

.event-regulation .regulation-article__title {
  margin-bottom: var(--space-8);
  color: var(--structure-deep);
  font-family: var(--font-display);
  font-size: clamp(0.96rem, 1.7vw, 1.08rem);
  line-height: 1.3;
}

.event-regulation .regulation-article__number {
  color: var(--action-ink);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-meta);
}

.event-regulation .regulation-article__content {
  padding-left: var(--space-16);
  color: var(--ink);
  font-size: var(--text-label);
  line-height: 1.66;
}

.event-regulation .regulation-article__content > * + * {
  margin-top: var(--space-10);
}

.event-regulation .regulation-article__content strong {
  color: var(--structure-deep);
}

.event-regulation .regulation-accent {
  color: var(--action-ink);
  font-weight: 800;
}

.event-regulation .regulation-article__content ul,
.event-regulation .regulation-article__content ol {
  padding-left: var(--space-24);
}

.event-regulation .regulation-article__content li + li {
  margin-top: var(--space-4);
}

.event-regulation .regulation-article__content li::marker {
  color: var(--action-ink);
  font-weight: 800;
}

.event-regulation .regulation-notice,
.event-regulation .regulation-age-box {
  padding: var(--space-16);
  border: var(--line-soft) solid var(--amber-line);
  border-left-width: var(--line-emphasis);
  border-left-color: var(--color-ambar-quadra);
  background: var(--amber-surface);
}

.event-regulation .regulation-notice::before {
  content: "Atenção";
  display: block;
  margin-bottom: var(--space-8);
  color: var(--amber-ink);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}

.event-regulation .regulation-age-box {
  border-color: var(--on-dark-line-soft);
  border-left-color: var(--structure);
  background: var(--status-open-surface);
}

.event-regulation .regulation-table-wrap {
  max-width: 430px;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.event-regulation .regulation-table-wrap.is-scrollable {
  padding-bottom: var(--space-20);
  border-bottom: var(--line-soft) solid var(--line);
}

.event-regulation .regulation-table-wrap.is-scrollable::after {
  content: "Role horizontalmente para ver toda a tabela";
  display: block;
  margin-top: var(--space-8);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
}

.event-regulation .regulation-points-table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: var(--text-label);
}

.event-regulation .regulation-points-table th {
  padding: var(--space-10) var(--space-16);
  background: var(--structure-deep);
  color: var(--color-white);
  text-align: left;
}

.event-regulation .regulation-points-table td {
  padding: var(--space-8) var(--space-16);
  border-bottom: var(--line-soft) solid var(--line);
  background: var(--surface-alt);
}

.event-regulation .regulation-points-table__wo td {
  background: var(--status-alert-surface);
}

.event-regulation .regulation-points-table__negative {
  color: var(--status-alert-ink);
}

.event-regulation .regulation-note {
  color: var(--muted);
  font-size: var(--text-small);
}

.event-regulation .regulation-sheet__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-12);
  margin-top: var(--space-24);
  border-top: var(--line-strong) solid var(--action);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  text-transform: uppercase;
}

.event-regulation .regulation-sheet__mark,
.event-regulation .regulation-sheet__page {
  color: var(--structure-deep);
  font-weight: 800;
}

.event-regulation .regulation-sheet__footer-end strong {
  color: var(--action-ink);
}

@media (max-width: 900px) {
  .event-regulation__header {
    grid-template-columns: 1fr;
  }

  .event-regulation__controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .event-regulation {
    padding: var(--space-20);
  }

  .event-regulation__controls,
  .event-regulation__controls .btn {
    width: 100%;
  }

  .event-regulation .regulation-document {
    margin-inline: calc(var(--space-20) * -1);
  }

  .event-regulation .regulation-sheet {
    padding: var(--space-20) var(--space-16);
    border-inline: 0;
    box-shadow: none;
  }

  .event-regulation .regulation-sheet__header {
    display: grid;
  }

  .event-regulation .regulation-sheet__ident {
    max-width: none;
    text-align: left;
  }

  .event-regulation .regulation-article__content {
    padding-left: 0;
  }

  .event-regulation .regulation-sheet__footer-end {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-regulation,
  .event-regulation * {
    scroll-behavior: auto;
  }
}

/* --- Impressão isolada: uma folha do documento por página A4 -------- */
@media print {
  @page {
    size: A4;
    margin: 0.9cm;
  }

  body.is-printing-regulation {
    background: var(--surface-plain);
  }

  body.is-printing-regulation .skip-link,
  body.is-printing-regulation .scroll-progress,
  body.is-printing-regulation .site-header,
  body.is-printing-regulation .site-footer,
  body.is-printing-regulation .toast,
  body.is-printing-regulation .whatsapp-float,
  body.is-printing-regulation #eventDetailRoot > .breadcrumb,
  body.is-printing-regulation #eventDetailRoot > .event-hero,
  body.is-printing-regulation #eventDetailRoot > .event-quick,
  body.is-printing-regulation .event-sidebar,
  body.is-printing-regulation .event-mobile-cta,
  body.is-printing-regulation .event-regulation__header,
  body.is-printing-regulation .event-main-content > :not(.event-regulation) {
    display: none !important;
  }

  body.is-printing-regulation .event-content-section,
  body.is-printing-regulation .event-content-layout,
  body.is-printing-regulation .event-main-content,
  body.is-printing-regulation .event-regulation {
    display: block !important;
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: var(--surface-plain);
  }

  body.is-printing-regulation .event-content-layout {
    padding-inline: 0;
  }

  body.is-printing-regulation .event-regulation .regulation-document,
  body.is-printing-regulation .event-regulation .regulation-document[hidden] {
    display: block !important;
    padding: 0;
    border: 0;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet {
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet__header {
    padding-bottom: 5px;
    margin-bottom: 7px;
    border-bottom-width: 2px;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet__brand img {
    width: 30px;
    height: 30px;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet--continued .regulation-sheet__brand img {
    width: 24px;
    height: 24px;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet__ident {
    padding: 5px 12px;
  }

  body.is-printing-regulation .event-regulation .regulation-chapter + .regulation-chapter {
    margin-top: 7px;
  }

  body.is-printing-regulation .event-regulation .regulation-chapter > h3 {
    padding: 4px 10px;
    margin-bottom: 6px;
    font-size: 10.6pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  body.is-printing-regulation .event-regulation .regulation-article {
    margin-bottom: 4px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-printing-regulation .event-regulation .regulation-article__title {
    margin-bottom: 2px;
    font-size: 9.4pt;
  }

  body.is-printing-regulation .event-regulation .regulation-article__number {
    font-size: 8.6pt;
  }

  body.is-printing-regulation .event-regulation .regulation-article__content {
    padding-left: 10px;
    font-size: 9.3pt;
    line-height: 1.29;
  }

  body.is-printing-regulation .event-regulation .regulation-article__content > * + * {
    margin-top: 3px;
  }

  body.is-printing-regulation .event-regulation .regulation-article__content ul,
  body.is-printing-regulation .event-regulation .regulation-article__content ol {
    padding-left: 18px;
  }

  body.is-printing-regulation .event-regulation .regulation-article__content li + li {
    margin-top: 2px;
  }

  body.is-printing-regulation .event-regulation .regulation-notice,
  body.is-printing-regulation .event-regulation .regulation-age-box {
    padding: 6px 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-printing-regulation .event-regulation .regulation-notice::before {
    margin-bottom: 3px;
  }

  body.is-printing-regulation .event-regulation .regulation-table-wrap,
  body.is-printing-regulation .event-regulation .regulation-table-wrap.is-scrollable {
    overflow: visible;
    padding-bottom: 0;
    border: 0;
  }

  body.is-printing-regulation .event-regulation .regulation-table-wrap.is-scrollable::after {
    content: none;
  }

  body.is-printing-regulation .event-regulation .regulation-points-table {
    font-size: 9.3pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-printing-regulation .event-regulation .regulation-points-table th,
  body.is-printing-regulation .event-regulation .regulation-points-table td {
    padding: 3px 12px;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet__footer {
    padding-top: 6px;
    margin-top: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.is-printing-regulation .event-regulation .regulation-sheet__ident,
  body.is-printing-regulation .event-regulation .regulation-chapter > h3,
  body.is-printing-regulation .event-regulation .regulation-notice,
  body.is-printing-regulation .event-regulation .regulation-age-box,
  body.is-printing-regulation .event-regulation .regulation-points-table th,
  body.is-printing-regulation .event-regulation .regulation-points-table td,
  body.is-printing-regulation .event-regulation .regulation-points-table__wo td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
