/*
 * OAB/JF · Central de Certificados · Shell canônico v0.2.4
 *
 * Camada visual isolada sobre o build live homologado.
 * NÃO altera o JS/CSS original do certificado.
 */

:root {
  --cert-shell-paper: var(--paper, #fcfaf7);
  --cert-shell-sand: var(--sand, #f4f0e9);
  --cert-shell-ink: var(--ink, #1e2322);
  --cert-shell-clay: var(--clay, #6f6b66);
  --cert-shell-red: var(--brand-red, #ce181e);
  --cert-shell-blue: var(--brand-blue, #195773);
  --cert-shell-max: 80rem;
  --cert-shell-gutter: 2rem;
}

/* O shell legado continua no React, mas fica visualmente suprimido.
   O miolo do app permanece totalmente sob controle do bundle original. */
body.cert-shell-canonical .app-header,
body.cert-shell-canonical .app-footer {
  display: none !important;
}

body.cert-shell-canonical #root > div {
  min-height: calc(100vh - 5rem) !important;
}

.cert-canonical-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid color-mix(in srgb, var(--cert-shell-ink) 10%, transparent);
  background: color-mix(in srgb, var(--cert-shell-paper) 90%, transparent);
  backdrop-filter: blur(12px);
}

.cert-canonical-tricolor {
  display: flex;
  width: 100%;
  height: 4px;
}

.cert-canonical-tricolor > span:nth-child(1) {
  flex: 1;
  background: var(--cert-shell-red);
}

.cert-canonical-tricolor > span:nth-child(2) {
  flex: 2;
  background: var(--cert-shell-paper);
}

.cert-canonical-tricolor > span:nth-child(3) {
  flex: 1;
  background: var(--cert-shell-blue);
}

.cert-canonical-header__inner {
  width: min(calc(100% - var(--cert-shell-gutter)), var(--cert-shell-max));
  min-height: 5rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
}

.cert-canonical-header__brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  line-height: 0;
}

.cert-canonical-header__brand img {
  width: 11.25rem;
  height: auto;
  display: block;
}

.cert-canonical-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  color: color-mix(in srgb, var(--cert-shell-ink) 70%, transparent);
}

.cert-canonical-header__nav a {
  position: relative;
  padding: .5rem 0;
  color: inherit;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .875rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition: color 150ms ease;
}

.cert-canonical-header__nav a:hover {
  color: var(--cert-shell-ink);
}

.cert-canonical-header__nav a[aria-current="page"] {
  color: var(--cert-shell-blue);
  font-weight: 500;
}

.cert-canonical-header__nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.35rem;
  height: 2px;
  background: var(--cert-shell-red);
}

.cert-canonical-header__quick-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--cert-shell-clay) 25%, transparent);
  background: var(--cert-shell-paper);
  padding: .75rem 1.25rem;
  color: var(--cert-shell-ink);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.cert-canonical-header__quick-link:hover {
  border-color: color-mix(in srgb, var(--cert-shell-clay) 40%, transparent);
  background: var(--cert-shell-sand);
}

.cert-canonical-header__menu-button,
.cert-canonical-header__mobile-backdrop,
.cert-canonical-header__mobile-panel {
  display: none;
}

.cert-canonical-footer {
  margin-top: 5rem;
  background: var(--cert-shell-ink);
  color: color-mix(in srgb, var(--cert-shell-paper) 75%, transparent);
}

.cert-canonical-footer__inner {
  width: min(calc(100% - var(--cert-shell-gutter)), var(--cert-shell-max));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3.5rem 0;
}

.cert-canonical-footer__brand {
  display: block;
}

.cert-canonical-footer__brand a {
  display: inline-flex;
  line-height: 0;
}

.cert-canonical-footer__brand img {
  width: 11.5rem;
  height: auto;
  filter: grayscale(1) brightness(0) invert(1);
}

.cert-canonical-footer__brand p {
  max-width: 28rem;
  margin: .75rem 0 0;
  color: color-mix(in srgb, var(--cert-shell-paper) 65%, transparent);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .875rem;
  line-height: 1.55;
}

.cert-canonical-footer__links,
.cert-canonical-footer__contact {
  display: grid;
  align-content: start;
  gap: .375rem;
}

.cert-canonical-footer__links > span,
.cert-canonical-footer__contact > span {
  margin-bottom: .375rem;
  color: color-mix(in srgb, var(--cert-shell-paper) 45%, transparent);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.cert-canonical-footer__links a,
.cert-canonical-footer__contact a,
.cert-canonical-footer__contact address {
  color: color-mix(in srgb, var(--cert-shell-paper) 75%, transparent);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .875rem;
  font-style: normal;
  line-height: 1.55;
  text-decoration: none;
}

.cert-canonical-footer__links a:hover,
.cert-canonical-footer__contact a:hover {
  color: var(--cert-shell-paper);
}

.cert-canonical-footer__legal {
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--cert-shell-paper) 10%, transparent);
  padding: .75rem var(--cert-shell-gutter);
  color: color-mix(in srgb, var(--cert-shell-paper) 40%, transparent);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: .625rem;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
}

.cert-canonical-header__mobile-panel[hidden],
.cert-canonical-header__mobile-backdrop[hidden],
.cert-canonical-header[hidden],
.cert-canonical-footer[hidden] {
  display: none !important;
}

@media (min-width: 768px) {
  :root {
    --cert-shell-gutter: 4rem;
  }
}

@media (max-width: 1023px) {
  .cert-canonical-header__nav,
  .cert-canonical-header__quick-link {
    display: none;
  }

  .cert-canonical-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cert-canonical-header__menu-button {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--cert-shell-ink) 15%, transparent);
    background: transparent;
    color: var(--cert-shell-ink);
    cursor: pointer;
  }

  .cert-canonical-header__mobile-backdrop:not([hidden]) {
    position: fixed;
    inset: 5rem 0 0;
    z-index: 90;
    display: block;
    border: 0;
    background: color-mix(in srgb, var(--cert-shell-ink) 15%, transparent);
    backdrop-filter: blur(1px);
  }

  .cert-canonical-header__mobile-panel:not([hidden]) {
    position: absolute;
    inset: 100% 0 auto;
    z-index: 100;
    display: block;
    border-top: 1px solid color-mix(in srgb, var(--cert-shell-blue) 20%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--cert-shell-blue) 20%, transparent);
    background: var(--cert-shell-paper);
    box-shadow: 0 20px 45px rgba(34, 29, 24, .18);
  }

  .cert-canonical-header__mobile-inner {
    width: min(calc(100% - var(--cert-shell-gutter)), var(--cert-shell-max));
    margin-inline: auto;
    display: grid;
    gap: .5rem;
    padding: 1rem 0;
  }

  .cert-canonical-header__mobile-inner > a {
    border: 1px solid color-mix(in srgb, var(--cert-shell-clay) 15%, transparent);
    background: color-mix(in srgb, var(--cert-shell-sand) 60%, var(--cert-shell-paper));
    padding: .75rem 1rem;
    color: var(--cert-shell-ink);
    font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
  }

  .cert-canonical-header__mobile-inner > a[aria-current="page"] {
    border-color: color-mix(in srgb, var(--cert-shell-blue) 30%, transparent);
    background: var(--cert-shell-paper);
    color: var(--cert-shell-blue);
  }

  .cert-canonical-header__mobile-meta {
    margin-top: .5rem;
    border-top: 1px solid color-mix(in srgb, var(--cert-shell-blue) 15%, transparent);
    background: color-mix(in srgb, var(--cert-shell-sand) 35%, var(--cert-shell-paper));
    padding: 1rem;
    color: var(--cert-shell-clay);
    font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: .75rem;
    line-height: 1.55;
  }
}

@media (max-width: 767px) {
  :root {
    --cert-shell-gutter: 2rem;
  }

  body.cert-shell-canonical #root > div {
    min-height: calc(100vh - 4rem) !important;
  }

  .cert-canonical-header__inner {
    min-height: 4rem;
    padding: .75rem 0;
  }

  .cert-canonical-header__brand img {
    width: 9.875rem;
  }

  .cert-canonical-footer {
    margin-top: 3.5rem;
  }

  .cert-canonical-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
  }

  .cert-canonical-footer__brand img {
    width: 10.25rem;
  }
}

@media print {
  .cert-canonical-header,
  .cert-canonical-footer,
  body.cert-shell-canonical .app-header,
  body.cert-shell-canonical .app-footer {
    display: none !important;
  }

  body.cert-shell-canonical #root > div {
    min-height: 0 !important;
  }
}
