/* Chesapeake Shipbuilding Project shared generated-page stylesheet. */
:root {
  --csp-ink: #1b2633;
  --csp-muted: #4d5f72;
  --csp-link: #0b5d7b;
  --csp-rule: #8aa4b8;
  --csp-head: #244f6a;
  --csp-soft-head: #e8eef4;
  --csp-border: #d6dce4;
  --csp-bg-soft: #f7f9fb;
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0;
  background: #fff;
  color: var(--csp-ink);
  font-family: Arial, Helvetica, sans-serif;
}
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
}
a { color: var(--csp-link); text-decoration: underline; }
p, li { font-size: 15px; line-height: 1.55; }
p { margin: 0 0 12px 0; }
.note, .muted { color: var(--csp-muted); }
.muted { font-style: italic; }

.report-header {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--csp-ink);
  width: 100%;
  max-width: 1280px;
  margin: 18px auto 22px auto;
  border-bottom: 2px solid var(--csp-rule);
  padding: 0 18px 14px 18px;
}
.report-header .wrap,
.report-header > div:first-child {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.report-header .left,
.report-header > div:first-child > div:first-child {
  width: 50%;
}
.report-header .right,
.report-header > div:first-child > div:nth-child(2),
.essw,
.header-right {
  width: 50%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 18px;
  text-align: right;
}
.report-header .right-text,
.header-links {
  flex: 0 1 320px;
  min-width: 230px;
  text-align: right;
  padding: 2px 0 0 0;
}
.report-header .logo,
.essw-logo {
  flex: 0 0 160px;
  text-align: right;
}
.report-header img,
.essw img,
.essw-logo {
  display: inline-block;
  content: url("essw-nav-bar-logo.png");
  max-width: 160px;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.report-header h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 8px 0;
  color: var(--csp-ink);
  font-weight: 700;
}
.report-header h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 10px 0;
  color: #31445a;
  font-weight: 700;
}
.report-header h3 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 4px 0;
  color: var(--csp-muted);
  font-weight: 700;
}
.report-header p { margin: 10px 0 0; line-height: 1.45; }

.report-section {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--csp-ink);
  margin: 0 18px 18px 18px;
}
.report-section h2 {
  margin: 20pt 0 8px 0;
  font-size: 22px;
  line-height: 1.25;
  color: var(--csp-ink);
  font-weight: 700;
}
.report-section h3 {
  margin: 22px 0 8px 0;
  font-size: 19px;
  line-height: 1.3;
  color: #31445a;
}
.source-context {
  margin: 6px 0 12px 0;
  padding: 10px 12px;
  border-left: 4px solid #9fb8c8;
  background: #f7fafc;
}
.source-context h3 {
  margin: 0 0 6px 0 !important;
  font-size: 17px !important;
  color: #31445a !important;
}
.source-context .source-meta,
.source-context p {
  margin: 2px 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  color: var(--csp-muted) !important;
}
.source-meta { font-weight: 700; color: var(--csp-muted); }
.footnotes ol { padding-left: 22px; }
.footnotes li { font-size: 13px; line-height: 1.45; margin: 0 0 9px 0; }
.credit-footnote { margin: 28px 18px 12px 18px; color: var(--csp-muted); }

.controls {
  margin: 12px 0 14px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
button {
  padding: 6px 10px;
  border: 1px solid #9db2c3;
  background: #eef4f8;
  cursor: pointer;
}
textarea {
  width: 100%;
  min-height: 120px;
  margin: 0 0 18px 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

table,
.source-table,
.dsp-table,
.newspaper-report-table,
.newspaper-curated-table,
.newspaper-uncurated-table,
.cbmm-table,
.mm-table,
.wb-table,
.maib-table,
.tab-table,
.www-table,
.vessel-index-table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed;
  background: #fff;
  color: var(--csp-ink);
  margin: 0 0 18px 0;
}
th, td {
  border: 1px solid var(--csp-border) !important;
  padding: 8px 9px !important;
  text-align: left !important;
  vertical-align: top !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}
th {
  background: var(--csp-head) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
td img {
  display: block;
  width: 100% !important;
  max-width: 360px !important;
  height: auto !important;
  object-fit: contain;
  border: 0;
}

.newspaper-uncurated-table th:nth-child(1) { width: 6%; }
.newspaper-uncurated-table th:nth-child(2) { width: 6%; }
.newspaper-uncurated-table th:nth-child(3) { width: 8%; }
.newspaper-uncurated-table th:nth-child(4) { width: 18%; }
.newspaper-uncurated-table th:nth-child(5) { width: 12%; }
.newspaper-uncurated-table th:nth-child(6) { width: 17%; }
.newspaper-uncurated-table th:nth-child(7) { width: 11%; }
.newspaper-uncurated-table th:nth-child(8) { width: 22%; }
.newspaper-curated-table img,
.newspaper-report-table img,
.newspaper-uncurated-table img {
  max-width: 420px !important;
}
.newspaper-curated-table th:nth-child(1),
.newspaper-report-table th:nth-child(1) { width: 9%; }
.newspaper-curated-table th:nth-child(2),
.newspaper-report-table th:nth-child(2) { width: 16%; }
.newspaper-curated-table th:nth-child(3),
.newspaper-report-table th:nth-child(3) { width: 12%; }
.newspaper-curated-table th:nth-child(4),
.newspaper-report-table th:nth-child(4) { width: 12%; }
.newspaper-curated-table th:nth-child(5),
.newspaper-report-table th:nth-child(5) { width: 10%; }
.newspaper-curated-table th:nth-child(6),
.newspaper-report-table th:nth-child(6) { width: 20%; }
.newspaper-curated-table th:nth-child(7),
.newspaper-report-table th:nth-child(7) {
  width: 20%;
}
.newspaper-deep-fetch-table th:nth-child(1) { width: 10%; }
.newspaper-deep-fetch-table th:nth-child(2) { width: 15%; }
.newspaper-deep-fetch-table th:nth-child(3) { width: 38%; }
.newspaper-deep-fetch-table th:nth-child(4) { width: 37%; }
.newspaper-deep-fetch-table .article-text {
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
}
.newspaper-deep-fetch-table .article-text p { margin: 0 0 10px; }
.newspaper-deep-fetch-table .article-text p:last-child { margin-bottom: 0; }
.newspaper-deep-fetch-table .page-images .links {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.newspaper-deep-fetch-table .viewer-preview {
  width: 100% !important;
  max-width: 420px !important;
  max-height: 300px;
  object-fit: contain;
  background: #eef2f4;
}
.cbmm-table img,
.mm-table img {
  max-width: 360px !important;
}
.cbmm-table th:nth-child(1) { width: 5%; }
.cbmm-table th:nth-child(2) { width: 9%; }
.cbmm-table th:nth-child(3) { width: 10%; }
.cbmm-table th:nth-child(4) { width: 12%; }
.cbmm-table th:nth-child(5) { width: 9%; }
.cbmm-table th:nth-child(6) { width: 9%; }
.cbmm-table th:nth-child(7) { width: 12%; }
.cbmm-table th:nth-child(8) { width: 24%; }
.cbmm-table th:nth-child(9) { width: 15%; }
.cbmm-table th:nth-child(10) { width: 7%; }
.mm-table th:nth-child(1) { width: 4%; }
.mm-table th:nth-child(2) { width: 4%; }
.mm-table th:nth-child(3) { width: 18%; }
.mm-table th:nth-child(4) { width: 8%; }
.mm-table th:nth-child(5) { width: 9%; }
.mm-table th:nth-child(6) { width: 8%; }
.mm-table th:nth-child(7) { width: 8%; }
.mm-table th:nth-child(8) { width: 10%; }
.mm-table th:nth-child(9) { width: 10%; }
.mm-table th:nth-child(10) { width: 13%; }
.mm-table th:nth-child(11) { width: 8%; }
.wb-table th,
.maib-table th,
.tab-table th,
.www-table th,
.source-table th { width: auto; }
.www-table th:nth-child(1) { width: 16%; }
.www-table th:nth-child(2) { width: 22%; }
.www-table th:nth-child(3) { width: 40%; }
.www-table th:nth-child(4) { width: 22%; }

.dsp-index {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 26px 42px;
}
.dsp-index .report-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
  border-bottom: 3px solid #2f5d7c;
  padding-bottom: 18px;
  margin-bottom: 26px;
}
.dsp-index .report-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
  color: #16384f;
}
.dsp-index .report-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  color: #16384f;
}
.dsp-index .report-header h3 {
  margin: 4px 0;
  font-size: 17px;
  line-height: 1.35;
  color: #314c5f;
}
.dsp-table { margin: 10px 0 22px; border: 1px solid #c8d2da; }
.dsp-table td { border-top: 1px solid #d8e0e6; padding: 9px 10px; font-size: 14px; }
.dsp-table tr:nth-child(even) td { background: #f3f7fa; }
.dsp-table .vessel { width: 28%; font-weight: 700; }
.dsp-table .type { width: 14%; }
.dsp-table .year { width: 10%; }
.dsp-table .builder { width: 26%; }
.dsp-table .location { width: 22%; }
.dsp-table .research { width: 22%; }
h2.state-heading { margin: 30px 0 8px; color:#16384f; border-bottom: 2px solid #d1dde7; padding-bottom: 5px; }
h3.county-heading { margin: 24px 0 8px; color:#244f6a; }
h3.county-heading .back-to-county-index {
  font-size: 13px;
  font-weight: 400;
  margin-left: 8px;
  white-space: nowrap;
}
h4.location-heading { margin: 18px 0 4px; color:#314c5f; }
h4.unlocated-heading { margin: 22px 0 4px; color:#5a4a30; }

@media (max-width: 760px) {
  main { padding: 14px; }
  .report-header .wrap,
  .report-header > div:first-child,
  .dsp-index .report-header {
    display: block;
  }
  .report-header .left,
  .report-header .right,
  .report-header > div:first-child > div:first-child,
  .report-header > div:first-child > div:nth-child(2) {
    width: 100% !important;
  }
  .report-header .right,
  .essw,
  .header-right {
    justify-content: flex-start !important;
    text-align: left !important;
    margin-top: 14px;
  }
  .report-header .right-text,
  .header-links { text-align: left !important; }
}
/* Source-specific table geometry: CBMM curated, uncurated, and report tables
   use different column sets. Keep these rules below the generic cbmm-table
   rules so they override earlier shared defaults. */
.cbmm-curated-table th:nth-child(1),
.cbmm-report-table th:nth-child(1) { width: 6%; }
.cbmm-curated-table th:nth-child(2),
.cbmm-report-table th:nth-child(2) { width: 8%; }
.cbmm-curated-table th:nth-child(3),
.cbmm-report-table th:nth-child(3) { width: 10%; }
.cbmm-curated-table th:nth-child(4),
.cbmm-report-table th:nth-child(4) { width: 12%; }
.cbmm-curated-table th:nth-child(5),
.cbmm-report-table th:nth-child(5) { width: 10%; }
.cbmm-curated-table th:nth-child(6),
.cbmm-report-table th:nth-child(6) { width: 9%; }
.cbmm-curated-table th:nth-child(7),
.cbmm-report-table th:nth-child(7) { width: 9%; }
.cbmm-curated-table th:nth-child(8),
.cbmm-report-table th:nth-child(8) { width: 25%; }
.cbmm-curated-table th:nth-child(9),
.cbmm-report-table th:nth-child(9) { width: 9%; }
.cbmm-curated-table th:nth-child(10),
.cbmm-report-table th:nth-child(10) { width: 5%; }

.cbmm-uncurated-table th:nth-child(1) { width: 4%; }
.cbmm-uncurated-table th:nth-child(2) { width: 4%; }
.cbmm-uncurated-table th:nth-child(3) { width: 4%; }
.cbmm-uncurated-table th:nth-child(4) { width: 7%; }
.cbmm-uncurated-table th:nth-child(5) { width: 9%; }
.cbmm-uncurated-table th:nth-child(6) { width: 9%; }
.cbmm-uncurated-table th:nth-child(7) { width: 9%; }
.cbmm-uncurated-table th:nth-child(8) { width: 9%; }
.cbmm-uncurated-table th:nth-child(9) { width: 20%; }
.cbmm-uncurated-table th:nth-child(10) { width: 20%; }
.cbmm-uncurated-table th:nth-child(11) { width: 5%; }

/* Vessel-report source tables omit the selection and row-ID columns. */
.cbmm-report-table th:nth-child(1) { width: 5%; }
.cbmm-report-table th:nth-child(2) { width: 8%; }
.cbmm-report-table th:nth-child(3) { width: 10%; }
.cbmm-report-table th:nth-child(4) { width: 10%; }
.cbmm-report-table th:nth-child(5) { width: 8%; }
.cbmm-report-table th:nth-child(6) { width: 8%; }
.cbmm-report-table th:nth-child(7) { width: 28%; }
.cbmm-report-table th:nth-child(8) { width: 18%; }
.cbmm-report-table th:nth-child(9) { width: 5%; }

.mm-report-table th:nth-child(1) { width: 20%; }
.mm-report-table th:nth-child(2) { width: 4%; }
.mm-report-table th:nth-child(3) { width: 8%; }
.mm-report-table th:nth-child(4) { width: 5%; }
.mm-report-table th:nth-child(5) { width: 6%; }
.mm-report-table th:nth-child(6) { width: 8%; }
.mm-report-table th:nth-child(7) { width: 8%; }
.mm-report-table th:nth-child(8) { width: 10%; }
.mm-report-table th:nth-child(9) { width: 7%; }

.vessel-reports-list-table th:nth-child(1) { width: 27%; }
.vessel-reports-list-table th:nth-child(2) { width: 12%; }
.vessel-reports-list-table th:nth-child(3) { width: 9%; }
.vessel-reports-list-table th:nth-child(4) { width: 22%; }
.vessel-reports-list-table th:nth-child(5) { width: 18%; }
.vessel-reports-list-table th:nth-child(6) { width: 12%; }

/* Index-page header override: type index pages place header-left and header-right
   directly inside report-header. Keep the older report wrapper compatibility rules
   from turning the left text block into a flex wrapper. */
.dsp-index .report-header > .header-left {
  display: block !important;
  width: auto !important;
  min-width: 0;
}
.dsp-index .report-header > .header-right {
  width: auto !important;
}
.dsp-index .report-header > .header-left p {
  display: block;
}

/* Direct two-column generated headers.
   Some older generated result pages place the left header block and ESSW block
   as direct children of .report-header rather than inside .wrap. */
.report-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.report-header > div:first-child:not(.wrap):not(.header-left):not(.left):not(.right):not(.essw):not(.header-right) {
  display: block !important;
  flex: 1 1 56%;
  width: auto !important;
  min-width: 0;
}
.report-header > .essw,
.report-header > .header-right,
.report-header > .right {
  flex: 0 0 42%;
  width: auto !important;
}
.report-header > .essw img,
.report-header > .header-right img,
.report-header > .right img {
  max-width: 160px;
}

/* Generated search-result pages place their content directly under body rather
   than inside main. Give every source the same centered page gutter. */
body:has(> table.cbmm-uncurated-table),
body:has(> table.mm-table),
body:has(> table.newspaper-uncurated-table),
body:has(> table.wb-table),
body:has(> table.maib-table),
body:has(> table.tab-table),
body:has(> table.www-table) {
  --csp-result-width: min(calc(100% - 36px), 1280px);
}
body:has(> table.cbmm-uncurated-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.mm-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.newspaper-uncurated-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.wb-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.maib-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.tab-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote),
body:has(> table.www-table) > :is(.report-header, .selection-page-header, p, .controls, .selection-controls, textarea, table, .credit-footnote) {
  width: var(--csp-result-width) !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body:has(> table.cbmm-uncurated-table) > :is(.report-header, .selection-page-header),
body:has(> table.mm-table) > :is(.report-header, .selection-page-header),
body:has(> table.newspaper-uncurated-table) > :is(.report-header, .selection-page-header),
body:has(> table.wb-table) > :is(.report-header, .selection-page-header),
body:has(> table.maib-table) > :is(.report-header, .selection-page-header),
body:has(> table.tab-table) > :is(.report-header, .selection-page-header),
body:has(> table.www-table) > :is(.report-header, .selection-page-header) {
  padding-left: 0;
  padding-right: 0;
}

/* Source-result pages use several generations of markup. Direct-child rules
   provide reliable gutters without depending on a particular table variant. */
body > .report-header,
body > .selection-page-header {
  width: calc(100% - 36px) !important;
  max-width: 1244px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body > table.cbmm-table,
body > table.mm-table,
body > table.newspaper-curated-table,
body > table.newspaper-uncurated-table,
body > table.wb-table,
body > table.maib-table,
body > table.tab-table,
body > table.www-table,
body > table.dsp-table {
  width: calc(100% - 36px) !important;
  max-width: 1244px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body > :is(.selection-instructions, .controls, .selection-controls, textarea) {
  width: calc(100% - 36px) !important;
  max-width: 1244px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Curated selection pages use a section wrapper distinct from report-header. */
.selection-page-header {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--csp-ink);
  border-bottom: 2px solid var(--csp-rule);
  padding-bottom: 14px;
}
.selection-page-header > div {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.selection-page-header > div > div:first-child {
  width: 50%;
}
.selection-page-header > div > div:nth-child(2) {
  display: flex;
  width: 50%;
  gap: 18px;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: right;
}
.selection-page-header > div > div:nth-child(2) > div:first-child {
  flex: 0 1 320px;
  min-width: 230px;
}
.selection-page-header > div > div:nth-child(2) > div:last-child {
  flex: 0 0 160px;
}
.selection-page-header img {
  display: inline-block;
  content: url("essw-nav-bar-logo.png");
  width: 100%;
  max-width: 160px;
  height: auto;
  object-fit: contain;
}
.selection-page-header h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
.selection-page-header h2 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; }
.selection-page-header h3 { font-size: 16px; line-height: 1.35; margin: 0 0 4px; }
.selection-page-header p { margin: 10px 0 0; line-height: 1.45; }

/* CBMM curated pages include Select? and Row ID before the nine evidence
   columns. Keep all eleven headings visible and preserve description/image room. */
.cbmm-curated-table th:nth-child(1) { width: 4%; }
.cbmm-curated-table th:nth-child(2) { width: 4%; }
.cbmm-curated-table th:nth-child(3) { width: 4%; }
.cbmm-curated-table th:nth-child(4) { width: 7%; }
.cbmm-curated-table th:nth-child(5) { width: 9%; }
.cbmm-curated-table th:nth-child(6) { width: 9%; }
.cbmm-curated-table th:nth-child(7) { width: 9%; }
.cbmm-curated-table th:nth-child(8) { width: 9%; }
.cbmm-curated-table th:nth-child(9) { width: 20%; }
.cbmm-curated-table th:nth-child(10) { width: 20%; }
.cbmm-curated-table th:nth-child(11) { width: 5%; }

@media (max-width: 760px) {
  .selection-page-header > div { display: block; }
  .selection-page-header > div > div:first-child,
  .selection-page-header > div > div:nth-child(2) { width: 100%; }
  .selection-page-header > div > div:nth-child(2) {
    justify-content: flex-start;
    text-align: left;
    margin-top: 14px;
  }
}

/* County/entity index for vessels_by_location.html. */
.county-index {
  margin: 8px 0 28px;
  padding: 16px 18px 18px;
  border: 1px solid #d1dde7;
  background: #f7fafc;
}
.county-index h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #16384f;
}
.county-index-state {
  margin-top: 14px;
}
.county-index-state h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #244f6a;
  font-weight: 700;
}
.county-index-list {
  margin: 0;
  padding-left: 18px;
  columns: 4 180px;
  column-gap: 28px;
}
.county-index-list li {
  break-inside: avoid;
  margin: 0 0 4px;
}
.county-index-list a {
  font-weight: 400;
}
@media (max-width: 760px) {
  .county-index-list {
    columns: 2 150px;
  }
}

/* Vessel index Search Results cells.
   Keep nested labels and links at normal table scale even when host pages
   or pasted WordPress styles try to enlarge paragraph/link text. */
.vessel-index-table td.results,
.vessel-index-table td.results * {
  font-size: 13px !important;
  line-height: 1.35 !important;
}
.vessel-index-table td.results p {
  margin: 0 0 4px 0 !important;
  font-weight: 400 !important;
}
.vessel-index-table td.results p b {
  font-weight: 700 !important;
}
.vessel-index-table td.results a {
  display: block;
  margin: 2px 0 !important;
  font-weight: 400 !important;
}
.vessel-index-table td.results .result-group,
.vessel-index-table td.results .no-results {
  margin: 0 !important;
}
