/* Public pages share one compact, high-contrast navigation. */
.portal-public .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.portal-public .header-inner { min-height: 74px; }
.portal-public .main-nav { gap: clamp(12px, 2vw, 30px); }
.portal-public .main-nav > a:not(.button) { font: 700 0.94rem/1.3 var(--sans, system-ui); }
.portal-public .main-nav .button--ghost,
.portal-public .site-header.is-scrolled .button--ghost { color: var(--ink); border-color: var(--line); }
.portal-public .main-nav .button--ghost:hover { color: white; background: var(--ink); }
.portal-public main [id] { scroll-margin-top: 95px; }
.portal-public :where(h1, h2, h3) { overflow-wrap: normal; word-break: normal; }
.portal-public a:focus-visible, .portal-public button:focus-visible,
.portal-public input:focus-visible { outline: 3px solid #c64a29; outline-offset: 4px; }

/* Notícias: a abertura é a própria capa, não um segundo bloco institucional. */
.news-front .news-front__section { padding: 0; }
.news-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(320px, 35vw, 490px);
  background: #102429;
  color: #fff;
}
.news-cover__photo,
.news-cover::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.news-cover__photo { z-index: -2; object-fit: cover; object-position: 50% 52%; }
.news-cover::after {
  z-index: -1;
  content: "";
  background: linear-gradient(0deg, rgba(6, 16, 20, .92) 0%, rgba(6, 16, 20, .65) 36%, rgba(6, 16, 20, .04) 100%);
}
.news-cover .news-front__heading { margin-bottom: 0; padding-block: clamp(28px, 5vw, 58px); }
.news-cover .news-front__heading h1 { font-size: clamp(2.6rem, 6vw, 5.1rem); }
.news-cover .news-front__heading p { color: #f0f3f3; }
.news-cover .button--glass { flex: none; color: white; border-color: #d9e1e1; }
.news-cover .button--glass:hover { background: white; color: #07171b; }
.news-front__body { padding-block: 30px 42px; }
.news-front__body > .news-empty { margin: 0; padding: 0; border: 0; background: transparent; color: var(--muted); }
.news-front__body .news-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.news-front__body .news-grid > :only-child { grid-column: 1 / -1; max-width: 52rem; }
.news-front__body .news-grid .news-card:first-child .news-card__copy h3 { font-size: clamp(1.6rem, 3.2vw, 2.75rem); }
.news-front__body .news-grid .news-card__copy h3 { overflow-wrap: normal; word-break: normal; }

/* Institutional landing and history. */
.institutional-trail { display: flex; gap: .62rem; flex-wrap: wrap; padding-block: 24px 4px; font-size: .92rem; color: var(--muted); }
.institutional-trail a { text-decoration: underline; text-underline-offset: .2em; }
.portal-public .institutional-opening {
  padding-block: clamp(32px, 5vw, 62px) 26px;
  color: var(--ink);
  text-align: left;
}
.portal-public :is(.institutional-opening, .command-lead) h1 {
  margin: 9px 0 12px;
  color: var(--ink);
  font: 500 clamp(2.55rem, 6vw, 5rem)/1.05 var(--display);
  letter-spacing: -.04em;
}
.portal-public .institutional-opening h1 em { color: var(--ink); }
.portal-public .institutional-opening > p { color: var(--muted); max-width: 65ch; font-size: 1.06rem; margin: 0; }
.institutional-opening__links { display: flex; flex-wrap: wrap; gap: 18px; margin: 20px 0 10px; }
.institutional-opening__links a { font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.institutional-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 38px;
}
.institutional-directory a {
  display: grid;
  gap: 10px;
  padding: clamp(18px, 2.4vw, 28px);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 3px solid #a42625;
  background: #fff;
}
.institutional-directory a:hover { background: #fdf7f1; }
.institutional-directory strong { font: 600 clamp(1.4rem, 3vw, 2rem)/1.15 var(--display); }
.institutional-directory span { color: var(--muted); }
.portal-public [data-institutional-page="gbs"] .page-intro { padding-block: 42px; }
.portal-public .history-detail--archive { padding-top: 38px; border-top: 1px solid #ffffff28; }
.portal-public .history-detail--archive .history-list--managed { margin-top: 30px; }

/* Quadro de ex-comandantes. Todos os retratos mantêm a moldura e a tarjeta. */
.commanders-page { background: #f8f6f0; }
.command-lead {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  gap: clamp(25px, 5vw, 72px);
  padding-block: clamp(25px, 5vw, 64px);
}
.command-lead__officer { margin: 25px 0 17px; padding-left: 15px; border-left: 3px solid #a42625; }
.command-lead__officer span { font-size: .9rem; font-weight: 700; color: #7c2928; }
.command-lead__officer h2 { margin: 5px 0 0; font: 650 clamp(1.12rem, 2.05vw, 1.55rem)/1.25 var(--sans, system-ui); }
.command-lead__copy p { line-height: 1.6; color: var(--muted); max-width: 58ch; }
.command-lead__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.command-lead__photo { margin: 0; border: 1px solid var(--line); background: #fff; }
.command-lead__photo img { display: block; width: 100%; height: auto; }
.command-lead__photo figcaption { padding: 10px 14px; font-size: .87rem; color: var(--muted); }
.command-archive { color: #fff5e8; background: #182123; padding-block: clamp(35px, 6vw, 82px); }
.command-archive__heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; }
.command-archive__heading h2 { margin: 8px 0; font: 500 clamp(2rem, 5vw, 3.7rem)/1.08 var(--display); }
.command-archive__heading p { max-width: 62ch; margin: 0; color: #d5d8d1; }
.command-archive__search { display: grid; gap: 7px; font-size: .94rem; }
.command-archive__search input {
  padding: 10px 13px;
  min-height: 45px;
  width: min(100%, 280px);
  color: #fff;
  background: #263237;
  border: 1px solid #929d9d;
  border-radius: 3px;
  font: inherit;
}
.command-archive__search input::placeholder { color: #c2cdcb; }
.command-archive__status { min-height: 1.5em; margin: 24px 0 12px; color: #d5d8d1; font-size: .89rem; }
.command-archive__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.archive-frame { min-width: 0; border: 1px solid #586062; background: #202b2e; }
.archive-frame__portrait { display: block; cursor: zoom-in; background: #1a1a1a; }
.archive-frame__portrait--empty { display: grid; place-items: center; text-align: center; padding: 12px; aspect-ratio: 3 / 4; cursor: default; color: #ded8c9; }
.archive-frame__portrait img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; }
.archive-frame__caption { padding: 13px 12px 16px; }
.archive-frame__caption h3 { margin: 0 0 6px; color: #fff5e8; font-size: clamp(.91rem, 1.5vw, 1.07rem); line-height: 1.3; }
.archive-frame__caption p { margin: 3px 0 0; line-height: 1.3; font-size: .88rem; color: #dce4df; font-variant-numeric: tabular-nums; }
.archive-frame__note { display: block; margin-top: 7px; font-size: .79rem; color: #ead1a9; }
.command-archive__pager:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 17px; margin: 30px 0 0; }
.command-archive__pager button { color: #fff5e8; background: #303e40; border: 1px solid #8a9694; }
.command-archive__pager button:not(:disabled):hover { background: #485859; }
.command-archive__pager button:disabled { opacity: .45; cursor: default; }
.command-archive__credit { margin: 30px 0 0; font-size: .89rem; color: #d5d8d1; }
.frame-viewer { width: min(92vw, 48rem); max-height: 94dvh; padding: 14px; color: var(--ink); background: var(--paper); border: 0; }
.frame-viewer::backdrop { background: #081218df; }
.frame-viewer header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.frame-viewer h2 { margin: 0; font-size: clamp(1.05rem, 3vw, 1.5rem); }
.frame-viewer p { margin: 0; font-size: .91rem; color: var(--muted); }
.frame-viewer img { display: block; width: 100%; max-height: 76dvh; object-fit: contain; background: #1a1a1a; }
.commanders-page .commander-card img { object-fit: contain; background: #1a1a1a; }

@media (max-width: 860px) {
  .portal-public .header-inner { min-height: 66px; }
  .portal-public .menu-toggle { color: var(--ink); }
  .portal-public .site-header .main-nav,
  .portal-public .site-header.is-scrolled .main-nav {
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    gap: 0;
    padding: 10px 24px 22px;
    color: white;
    background: #122126;
  }
  .portal-public .main-nav > a:not(.button) { font-size: 1.1rem; padding-block: 13px; }
  .portal-public .site-header .main-nav .button--ghost { margin-top: 15px; color: white; border-color: #b8c6c7; }
  .portal-public .main-nav a.is-current { color: #f5d4bd; }
  .command-archive__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .command-lead { grid-template-columns: 1fr; }
  .command-lead__photo { max-width: 680px; }
}
@media (max-width: 610px) {
  .news-cover { min-height: 315px; }
  .news-cover__photo { object-position: 52% 48%; }
  .news-cover .news-front__heading { gap: 13px; }
  .news-front__body .news-grid, .institutional-directory { grid-template-columns: minmax(0, 1fr); }
  .news-front__body { padding-block: 23px 32px; }
  .command-archive__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-archive__search, .command-archive__search input { width: 100%; }
}
