/* Westford Colonial Minutemen: shared stylesheet */
:root {
  --bg: #fbf7ea;
  --text: #000;
  --link: #000099;
  --visited: #551a8b;
  --accent: #993300;   /* brown headings */
  --green: #1a6b1a;
  --alert: #a00000;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 1.5rem 1rem 3rem;
  color: var(--text);
  background: var(--bg) url("Images/parchment.gif");
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.65;
}
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
main, .site-header, .site-footer { max-width: 54rem; margin-inline: auto; }

/* Header and navigation */
.site-header { text-align: center; }
.site-header .title { display: block; margin: 1rem auto; }
.masthead { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem 2.5rem; }
.masthead a { display: block; }
/* Logo centered on the page, the two side pictures flanking it */
@media (min-width: 42rem) {
  .masthead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2.5rem; }
  .masthead > :first-child { justify-self: end; }
  .masthead > :last-child { justify-self: start; }
}
.masthead figure { margin: 0; text-align: center; font-size: .85rem; font-style: italic; max-width: 15rem; }
.site-nav { margin: 1rem 0 1.5rem; padding: .6rem 0; border-block: 1px solid var(--text); text-align: center; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.5rem; margin: 0; padding: 0; list-style: none; font-size: 1rem; }
.site-nav [aria-current="page"] { font-weight: bold; }

h1, h2 { font-weight: normal; line-height: 1.25; }
h1 { margin: 1rem 0 .25rem; text-align: center; font-size: clamp(1.7rem, 5vw, 2.3rem); color: var(--accent); }
h2 { margin: 2rem 0 .5rem; font-size: 1.5rem; color: var(--accent); }
.subtitle { margin: 0 0 1.5rem; font-size: 1.3rem; font-style: italic; color: var(--green); text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.url { margin: 1rem 0; font-size: 1.5rem; font-style: italic; color: var(--accent); text-align: center; }
.hint { font-style: italic; color: var(--alert); text-align: center; }

.prose { max-width: 42rem; margin-inline: auto; }
.prose p::first-letter { font-size: 1.6em; font-weight: bold; }

/* Home page menu */
.menu { max-width: 22rem; margin: 2rem auto; padding: 1rem 1.5rem; border: 1px solid var(--text); text-align: center; }
.menu ul { margin: 0; padding: 0; list-style: none; font-size: 1.25rem; }
.menu li { margin: .75rem 0; }

/* Photo gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2.25rem 1.5rem; margin: 2rem 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; text-align: center; }
.gallery a { display: inline-block; }
.gallery img { border: 2px solid var(--text); background: #fff; }
.gallery a:hover img, .gallery a:focus-visible img { outline: 3px solid var(--link); }
.gallery figcaption { margin-top: .5rem; font-size: 1rem; }

/* Lightbox */
dialog.lightbox { max-width: 96vw; max-height: 96vh; padding: 1rem 1rem .75rem; border: 0; border-radius: 6px; background: #fffdf5; color: var(--text); text-align: center; overflow: auto; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.82); }
dialog.lightbox figure { margin: 0; }
dialog.lightbox img { display: block; max-width: 90vw; max-height: 78vh; margin: 0 auto; }
dialog.lightbox figcaption { margin-top: .6rem; font-size: 1rem; }
.lightbox button { position: absolute; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 2rem; line-height: 1; width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer; }
.lightbox button:hover, .lightbox button:focus-visible { background: #000; }
.lb-close { top: .5rem; right: .5rem; }
.lb-prev, .lb-next { top: 40%; }
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }

/* Content pages */
.center { text-align: center; }
.right { text-align: right; }
main h3 { margin: 1.5rem 0 .4rem; font-size: 1.2rem; }
main img { max-width: 100%; height: auto; }
.table-wrap { max-width: 100%; margin: 1rem auto; overflow-x: auto; }
table { border-collapse: collapse; }
table.bordered td, table.bordered th { border: 1px solid var(--text); padding: .4rem .6rem; }
td, th { vertical-align: top; text-align: left; }
.center table td, .center table th { text-align: inherit; }
blockquote { margin: 1rem 0 1rem 1.5rem; }
hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--text); }

/* Centered tables and left-aligned blocks */
.table-wrap.centered table, table.center { margin-inline: auto; }
.left { text-align: left; }

/* Sub-title lines under a page title (half the title size, same color) */
.title-sub { text-align: center; color: var(--accent); font-size: clamp(.95rem, 2.5vw, 1.15rem); }

/* Orderly book transcriptions: one paragraph per line, so keep the gaps tighter */
.transcript { line-height: 1.5; }
.transcript p { margin: 0 0 .45em; }

/* Orderly book title block */
.transcript h1 { margin-bottom: .9em; }
.transcript .pages-line { margin: 1.5em 0; }
.transcript p.transcribed { margin-bottom: 3em; }
.ms-note { margin: 1.5em 0; line-height: 1.5; }
.ms-note p { margin: 0 0 .45em; }
.ms-note > :last-child { margin-bottom: 0; }

/* Decorative section break */
.tilde { margin: .25em 0; text-align: center; font-size: 3em; line-height: 1; }

/* Site menu (collapsed "Menu" button with grouped links) */
.site-header { position: relative; }
.site-menu { position: absolute; top: 0; left: 0; z-index: 30; text-align: left; font-size: 1rem; }
.site-menu summary { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .85rem; list-style: none; cursor: pointer;
  border: 1px solid var(--text); border-radius: 4px; background: #fffdf5; color: var(--link); font-weight: bold; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary::before { content: ""; width: 1.1em; height: .15em; background: currentColor; border-radius: 1px;
  box-shadow: 0 .38em 0 currentColor, 0 -.38em 0 currentColor; }
.site-menu summary:hover, .site-menu summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.site-menu[open] summary { background: var(--link); color: #fff; }
.menu-panel { position: absolute; top: calc(100% + .4rem); left: 0; width: min(94vw, 52rem); max-height: 82vh; overflow: auto;
  columns: 3 14rem; column-gap: 1.75rem; padding: 1.1rem 1.4rem .4rem;
  background: #fffdf5; border: 1px solid var(--text); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.menu-group { break-inside: avoid; margin: 0 0 1.1rem; }
.menu-panel h2 { margin: 0 0 .4rem; padding-bottom: .2rem; border-bottom: 1px solid var(--accent); font-size: 1rem; font-style: italic; }
.menu-panel ul { margin: 0; padding: 0; list-style: none; }
.menu-panel li { margin: .2rem 0; line-height: 1.35; }
.menu-panel a[aria-current="page"] { font-weight: bold; color: var(--text); text-decoration: none; }
.menu-chips { display: flex; flex-wrap: wrap; gap: .2rem .6rem; margin: .15rem 0 .4rem .9rem !important; font-size: .9rem; }
.menu-chips li { margin: 0; }
@media print { .site-menu { display: none; } }

/* Footer */
.site-footer { margin-top: 3rem; text-align: center; font-size: .95rem; font-style: italic; }
.site-footer p { margin: .4rem 0; }
@media print { dialog.lightbox, .site-nav { display: none; } }

/* MSSRW_Intro: indented (i)/(ii)/(iii) items and section-title spacing */
.enum { display: grid; grid-template-columns: 3rem 1fr; margin: 0 0 1em 1.5rem; }
.enum p { margin: 0; }
p.sect-ref { margin-top: 3em; }

/* MSSRW letter-page heading (ABC, DEF, ...): 50% larger */
.letter-head { font-size: 1.5em; }

/* Stamp_Act_Response title: second line 20% smaller than the title lines, with extra space after */
h2.stamp-title { margin: 1.25rem 0 2rem; text-align: center; font-size: clamp(1.36rem, 4vw, 1.84rem); }
