/* Militaria Research Services - shared stylesheet */
:root {
  --green: #2e7d32;
  --green-dark: #1f5a23;
  --ink: #2a2a2a;
  --muted: #5a5a5a;
  --paper: #f6f3ea;
  --card: #ffffff;
  --line: #ddd8cc;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;          /* 18px */
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; }

a { color: var(--green-dark); }
a:hover, a:focus { color: var(--green); }

/* ---------- Header / banner ---------- */
.site-header { padding: 1.25rem 1rem 0; text-align: center; }
.site-header .logo { display: block; margin: 0 auto; width: 100%; max-width: 900px; }

/* ---------- Navigation ---------- */
.site-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  max-width: 900px;
}
.site-nav a {
  display: block;
  padding: .5rem 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-decoration: none;
  border-radius: 4px;
}

/* ---------- Main content ---------- */
main {
  max-width: 820px;
  margin: 2rem auto 3rem;
  padding: 2rem 2.25rem;
  background: var(--card);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
}

h1, h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.25;
  color: #1b1b1b;
}
h1 { font-size: 1.9rem; margin: .25rem 0 0; }
h2 {
  font-size: 1.3rem;
  margin: 2rem 0 .5rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--green);
}
p { margin: 0 0 1rem; }

.profile {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
.profile figure { margin: 0; flex: 0 0 auto; text-align: center; }
.profile figure img {
  width: 160px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.profile figcaption {
  margin-top: .5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .95rem;
  font-weight: 600;
}
.profile .intro h2 { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  padding: 0 1rem 2rem;
}

/* ---------- Inner pages ---------- */
h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.1rem;
  margin: 1.5rem 0 .4rem;
}
main > h1:first-child, .breadcrumb + h1 { margin-bottom: 1.25rem; }
.breadcrumb {
  margin: 0 0 .25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .95rem;
}
.breadcrumb a::before { content: "\2190\00a0"; }
.indent { margin-left: 1.25rem; padding-left: 1rem; border-left: 3px solid var(--line); }
.note, .notice {
  padding: .75rem 1rem;
  background: #f1f5ef;
  border-left: 4px solid var(--green);
  border-radius: 3px;
}
.contact-card {
  font-style: normal;
  font-size: 1.2rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border-radius: 4px;
}
.entry { padding: .25rem 0 .5rem; border-bottom: 1px solid var(--line); }
.entry h2 { border: 0; margin: 1rem 0 .25rem; padding: 0; font-size: 1.1rem; }
a { overflow-wrap: anywhere; }

/* Specialties list */
.specialty {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.specialty h2 { border: 0; padding: 0; margin: 0 0 .35rem; font-size: 1.15rem; }
.specialty p { margin: 0; }
.specialty .thumb { flex: 0 0 200px; }
.specialty .thumb img { display: block; border-radius: 4px; border: 1px solid var(--line); }

/* Publication codes */
.pub-codes { margin: 0 0 1rem; }
.pub-codes dt {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: .9rem;
}
.pub-codes dd { margin: 0 0 0 1.25rem; }

/* Examples table */
.filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin: 1rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
}
.filter label { font-weight: 600; }
.filter input {
  flex: 1 1 16rem;
  font: inherit;
  padding: .55rem .75rem;
  border: 1px solid #b9b3a5;
  border-radius: 4px;
}
.filter input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
#filter-count { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.examples {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.45;
}
table.examples th {
  position: sticky; top: 0;
  background: #1b1b1b; color: #fff;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .9rem;
  padding: .55rem .6rem;
}
table.examples td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.examples tbody tr:nth-child(even) { background: #faf8f3; }
table.examples td.x { text-align: center; font-weight: 700; color: var(--green-dark); }
table.examples td.src { white-space: nowrap; width: 11rem; }
table.examples th:nth-child(2), table.examples td.x { width: 6.5rem; }
.long-image { overflow-x: auto; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }        /* 17px */
  main { margin: 1rem .75rem 2rem; padding: 1.25rem 1.1rem; }
  h1 { font-size: 1.6rem; }
  .profile { flex-direction: column; align-items: center; }
  .site-nav a { padding: .6rem .8rem; }
  .specialty { flex-direction: column; }
  .specialty .thumb { flex-basis: auto; }
  /* examples table: each row becomes a compact stacked block */
  table.examples thead { position: absolute; left: -9999px; }
  table.examples, table.examples tbody, table.examples tr, table.examples td { display: block; width: auto; }
  table.examples tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: .6rem .25rem;
    border-bottom: 1px solid var(--line);
  }
  table.examples tbody tr:nth-child(even) { background: transparent; }
  table.examples td { border: 0; padding: 0; }
  table.examples td.subj { grid-column: 1 / -1; grid-row: 1; font-weight: 700; }
  table.examples td.item { grid-column: 1 / -1; grid-row: 2; }
  table.examples td.src { grid-column: 1; grid-row: 3; width: auto; white-space: normal; color: var(--muted); font-size: .9rem; }
  table.examples td.x { grid-column: 2; grid-row: 3; width: auto; font-size: .9rem; }
  table.examples td.x:not(:empty)::after { content: " Researched"; font-weight: 600; }
  table.examples tr[hidden] { display: none; }
  .indent { margin-left: 0; }
}

/* =====================================================
   Header band theme
   ===================================================== */
.theme-band { background: var(--paper); }
.theme-band .site-header { background: #1b1b1b; padding-bottom: 1rem; }
.theme-band .site-nav {
  background: #1b1b1b;
  border-top: 1px solid #333;
  border-bottom: 4px solid var(--green);
}
.theme-band .site-nav a { color: #e8e8e8; }
.theme-band .site-nav a:hover,
.theme-band .site-nav a:focus,
.theme-band .site-nav a[aria-current="page"] { background: var(--green); color: #fff; }
