/* tdsmith.org — site styles
   Palette: Air Force service blue and brass, on a cool archival grey.
   Type: Newsreader (reading and headings), Public Sans (navigation and labels). */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --blue: #1b2b4b;
  --blue-soft: #2b3f66;
  --brass: #a67c2e;
  --brass-text: #85621f;
  --steel: #576270;
  --ink: #1e242c;
  --paper: #f3f4f5;
  --mat: #ffffff;
  --line: #d5d9df;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: 1.5rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

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

a { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--mat);
  color: var(--blue);
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header and footer ---------- */

.site-header,
.site-footer {
  background: var(--blue);
  color: #fff;
}
.site-header { border-bottom: 3px solid var(--brass); }

.site-header .wrap,
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 2.5rem;
}
.site-header .wrap { padding-top: 1.15rem; padding-bottom: 1.05rem; }
.site-footer .wrap { padding-top: 2.25rem; padding-bottom: 2.5rem; }

.site-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  text-decoration: none;
}
a.site-name:hover { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: .2em; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: .2rem 0 .3rem;
  border-bottom: 2px solid transparent;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
}
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current],
.site-nav a.in-section {
  color: #fff;
  border-bottom-color: var(--brass);
}

.site-footer .site-name { font-size: 1.05rem; }
.site-footer .site-nav a { font-size: .9rem; }

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 4rem;
  align-items: center;
  padding: 5rem 0 5.5rem;
}

.nameplate {
  margin: 0;
  color: var(--blue);
  font-weight: inherit;
}
.nameplate .rank,
.nameplate .service {
  display: block;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
}
.nameplate .rank { color: var(--brass-text); margin-bottom: .9rem; }
.nameplate .service { color: var(--steel); font-weight: 500; margin-top: 1.1rem; }
.nameplate .name {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.75rem, 6.6vw, 5.4rem);
  font-weight: 420;
  line-height: 1.02;
  letter-spacing: -.015em;
}

.lede {
  max-width: 30ch;
  margin: 2.25rem 0 2.5rem;
  font-size: 1.4rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.button {
  display: inline-block;
  padding: .75rem 1.3rem;
  border: 2px solid var(--blue);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-soft); border-color: var(--blue-soft); }
.button-secondary { background: transparent; color: var(--blue); }
.button-secondary:hover { background: var(--mat); }

.portrait {
  margin: 0;
  justify-self: end;
  width: 100%;
  max-width: 27rem;
}
.portrait img {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--mat);
  border: 1px solid var(--line);
}

/* ---------- Page headings ---------- */

.page-head {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 420;
  line-height: 1.05;
  letter-spacing: -.012em;
}

/* ---------- Library ---------- */

.catalog {
  margin: 0 0 4.5rem;
  padding: 0;
  list-style: none;
}
.catalog-entry {
  display: grid;
  grid-template-columns: 11rem minmax(0, 46rem);
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}
.catalog-entry time {
  padding-top: .55rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  color: var(--steel);
}
.catalog-entry h2 {
  margin: 0 0 .4rem;
  font-size: 1.85rem;
  font-weight: 460;
  line-height: 1.18;
}
.catalog-entry h2 a { text-decoration: none; }
.catalog-entry h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: .18em;
}
.catalog-entry .source {
  margin: 0 0 .9rem;
  color: var(--steel);
  font-size: 1.1rem;
  font-style: italic;
}
.catalog-entry .excerpt {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
}
.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
}
.entry-links a {
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: .25em;
}
.entry-links .file-note { font-weight: 400; color: var(--steel); }

/* ---------- Articles and text pages ---------- */

.article {
  max-width: calc(44rem + 2 * var(--gutter));
  margin: 0 auto;
  padding-top: 3.5rem;
  padding-bottom: 4.5rem;
}

.crumb {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
}
.crumb a {
  color: var(--brass-text);
  text-decoration: none;
}
.crumb a:hover { text-decoration: underline; text-underline-offset: .2em; }

.article h1 {
  margin: 0 0 1.1rem;
  color: var(--blue);
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  font-weight: 420;
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.article-meta p {
  margin: 0;
  color: var(--steel);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
}
.article-meta a { color: var(--steel); text-decoration-color: var(--brass); text-underline-offset: .18em; }

.download {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 2.75rem;
  padding: 1rem 1.25rem;
  background: var(--mat);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  color: var(--ink);
  text-decoration: none;
}
.download svg { flex: none; color: var(--blue); }
.download strong {
  display: block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  color: var(--blue);
}
.download span {
  display: block;
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--steel);
}
.download:hover strong { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: .2em; }

.prose {
  font-size: 1.25rem;
  line-height: 1.68;
  font-variant-numeric: oldstyle-nums;
}
.prose p { margin: 0 0 1.15em; }
.prose a {
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
}
.prose h2 {
  margin: 2.5rem 0 .8rem;
  color: var(--blue);
  font-size: 1.65rem;
  font-weight: 480;
  line-height: 1.25;
}
.prose ul { margin: 0 0 1.5em; padding-left: 1.2em; }
.prose li { margin-bottom: .85em; padding-left: .25em; }
.prose li::marker { color: var(--brass); }
.prose figure { margin: 2.5rem 0; }
.prose figure img {
  display: block;
  padding: .75rem;
  background: var(--mat);
  border: 1px solid var(--line);
}
.prose figcaption {
  margin-top: .8rem;
  font-family: var(--sans);
  font-size: .92rem;
  line-height: 1.5;
  color: var(--steel);
  font-variant-numeric: lining-nums;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.post-nav a { display: block; text-decoration: none; }
.post-nav .next { grid-column: 2; text-align: right; }
.post-nav .label {
  display: block;
  margin-bottom: .35rem;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  color: var(--steel);
}
.post-nav .title {
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--blue);
}
.post-nav a:hover .title { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: .18em; }

/* ---------- Gallery ---------- */

.gallery {
  columns: 3 18rem;
  column-gap: 1.25rem;
  padding: 2.5rem 0 4.5rem;
}
.gallery figure {
  margin: 0 0 1.25rem;
  break-inside: avoid;
}
.gallery a { display: block; }
.gallery img {
  display: block;
  width: 100%;
  padding: .6rem;
  background: var(--mat);
  border: 1px solid var(--line);
}
.gallery a:hover img { border-color: var(--brass); }

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.lightbox::backdrop { background: rgba(13, 21, 36, .97); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 80vh;
  width: auto;
  height: auto;
  background: var(--mat);
  padding: .5rem;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: .95rem;
}
.lightbox button {
  padding: .55rem 1rem;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--brass); }
.lightbox .count { color: rgba(255, 255, 255, .75); min-width: 4.5rem; text-align: center; }
.lightbox .close { position: absolute; top: 1rem; right: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] img { animation: lightbox-in .18s ease-out; }
  @keyframes lightbox-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    padding: 2.75rem 0 3.5rem;
  }
  .portrait { justify-self: start; max-width: 22rem; }
  .catalog-entry { grid-template-columns: 1fr; gap: .4rem; padding: 2rem 0; }
  .catalog-entry time { padding-top: 0; }
}

@media (max-width: 560px) {
  :root { --gutter: 1rem; }
  .site-header .wrap { flex-direction: column; gap: .6rem; }
  .site-nav ul { gap: .3rem 1.2rem; }
  .lede { font-size: 1.25rem; }
  .page-head { padding: 2.75rem 0 1.5rem; }
  .article { padding-top: 2.5rem; padding-bottom: 3.5rem; }
  .prose { font-size: 1.15rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
  .lightbox .close { top: .75rem; right: .75rem; }
}

@media print {
  .site-header, .site-footer, .post-nav, .download, .skip-link { display: none; }
  body { background: #fff; }
}
