@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif&display=swap');
:root {
  color-scheme: light;
  --brand: #39432f;
  --ink: #252a23;
  --muted: #54594b;
  --paper: #f7f4ea;
  --white: #fffdf8;
  --line: #e2dcd1;
  --accent: #d7aa52;
  --red: #842d32;
  --page-tint: color-mix(in srgb, var(--brand) 10%, #fff);
  --card-tint: color-mix(in srgb, var(--brand) 4%, #fff);
  --soft-tint: color-mix(in srgb, var(--brand) 17%, #fff);
  --theme-line: color-mix(in srgb, var(--brand) 25%, #fff);
  --control-border: color-mix(in srgb, var(--brand) 68%, #fff);
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
}
:root[data-branch-theme="navy"], .branch-theme-button[data-theme-choice="navy"] { --brand: #142b4a; --accent: #e4b755; }
:root[data-branch-theme="marines"], .branch-theme-button[data-theme-choice="marines"] { --brand: #8a202e; --accent: #f2c65b; }
:root[data-branch-theme="air-force"], .branch-theme-button[data-theme-choice="air-force"] { --brand: #194d81; --accent: #d1ddea; }
:root[data-branch-theme="coast-guard"], .branch-theme-button[data-theme-choice="coast-guard"] { --brand: #143d60; --accent: #ffa567; }
:root[data-branch-theme="space-force"], .branch-theme-button[data-theme-choice="space-force"] { --brand: #242732; --accent: #d4d4df; }
.branch-theme-button[data-theme-choice="army"] { --brand: #39432f; --accent: #d7aa52; }
.theme-status { margin: 12px 0 0; }
.theme-status:empty { display: none; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--page-tint); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
a { color: inherit; text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
h1, h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; line-height: 1; margin: 0 0 .35em; }
h1 { font-size: clamp(3.1rem, 7vw, 5.3rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 4vw, 2.65rem); }
p { margin: 0 0 1rem; }
.shell { width: min(1120px, calc(100% - 56px)); margin-inline: auto; }
.header { background: var(--brand); color: var(--paper); border-bottom: 1px solid var(--control-border); }
.header .button.outline { color: var(--paper); border-color: var(--accent); }
.header :focus-visible, .hero :focus-visible, footer :focus-visible { outline-color: var(--accent); }
.top { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.top-actions [hidden] { display: none; }
.header #suggest-edit-link { border-color: transparent; text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; font-size: 1.13rem; line-height: 1.15; }
.brand-names { display: grid; gap: 3px; }
.post-mark { --tag-face: color-mix(in srgb, var(--paper) 76%, var(--accent)); width: clamp(64px, 8vw, 76px); height: auto; flex: none; }
.brand small { display: block; margin-top: 4px; font-size: .72rem; font-weight: 500; color: #e8e4d8; }
nav, .actions, .toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
nav { gap: clamp(14px, 3vw, 35px); }
nav a { font-weight: 600; text-decoration: none; font-size: .94rem; padding-block: 8px; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }
@media (761px <= width <= 1050px) {
  .top { flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
  .top nav { order: 3; width: 100%; justify-content: space-between; }
}
.button { min-height: 44px; border: 1px solid transparent; border-radius: 5px; padding: .66rem 1.1rem; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: var(--brand); color: #fff; font-weight: 700; line-height: 1.25; }
.button:hover { filter: brightness(1.18); }
.button:disabled { opacity: .55; cursor: wait; }
.button.outline { background: transparent; color: var(--brand); border-color: var(--control-border); }
.button.small { font-size: .86rem; }
.hero { background: var(--brand); color: #fff9ed; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,var(--brand) 6%,var(--brand) 32%,color-mix(in srgb, var(--brand) 38%, transparent) 72%,color-mix(in srgb, var(--brand) 20%, transparent)), url('/flag.jpg') right center/auto 142% no-repeat; }
.hero-inner { position: relative; min-height: 438px; display: grid; align-items: center; padding-block: 48px; }
.hero-branch-art {
  position: absolute;
  top: 24px;
  right: 0;
  width: clamp(110px, 16vw, 160px);
  aspect-ratio: 1;
  border-radius: 8px;
  background: transparent var(--branch-emblem, url('/emblem-army.svg')) center / contain no-repeat;
  background-origin: content-box;
  padding: 4px;
  filter: drop-shadow(0 1px 2px #000b);
}
:root[data-branch-theme="air-force"] .hero-branch-art,
:root:not([data-branch-theme]) .hero-branch-art,
:root[data-branch-theme="army"] .hero-branch-art {
  filter: drop-shadow(0 0 1px #fff9ed) drop-shadow(0 1px 2px #000b);
}
:root[data-branch-theme="navy"] { --branch-emblem: url('/emblem-navy.svg'); }
:root[data-branch-theme="marines"] { --branch-emblem: url('/emblem-marines.svg'); }
:root[data-branch-theme="air-force"] { --branch-emblem: url('/emblem-air-force.svg'); }
:root[data-branch-theme="coast-guard"] { --branch-emblem: url('/emblem-coast-guard.svg'); }
:root[data-branch-theme="space-force"] { --branch-emblem: url('/emblem-space-force.svg'); }
.hero h1 { font-size: clamp(4.3rem, 9vw, 7.2rem); margin-bottom: .18em; line-height: .88; }
.hero p:not(.eyebrow) { max-width: 29rem; color: #f0eae0; font-size: 1.06rem; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 20px; }
.hero .button { background: var(--accent); color: #252a23; }
.hero .outline { background: color-mix(in srgb, var(--brand) 70%, transparent); border-color: #e9d8be99; color: #fff9ed; }
.home-content, .page { padding-block: 38px 56px; }
.page { min-height: 57vh; }
.page-heading { margin-bottom: 24px; }
.page-heading p, .muted { color: var(--muted); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; }
.section-heading a { font-weight: 700; color: var(--brand); }
.events { border: 1px solid var(--theme-line); border-radius: 7px; overflow: hidden; background: var(--card-tint); }
.event-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px 19px; text-decoration: none; }
.event-row + .event-row { border-top: 1px solid var(--theme-line); }
.event-row:hover { background: var(--page-tint); }
.event-summary { display: grid; gap: 2px; }
.event-summary strong { font-size: 1.1rem; }
.event-summary span { color: var(--muted); font-size: 1rem; }
.date { padding: 5px; display: grid; justify-items: center; color: var(--brand); background: var(--soft-tint); border-radius: 4px; line-height: 1.1; }
.date b { font-size: 1.38rem; }
.date small { text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; font-weight: 700; }
.tag { display: inline-block; width: fit-content; background: var(--soft-tint); padding: 4px 9px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.arrow { font-weight: 700; color: var(--brand); }
.grid { display: grid; gap: 18px; align-items: start; }
.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.home-content .grid { margin-top: 20px; }
.home-events { margin-top: 24px; }
.desktop-home-actions { margin-bottom: 20px; }
.content-grid { grid-template-columns: 1.55fr 1fr; }
.card { border: 1px solid var(--theme-line); border-radius: 7px; padding: clamp(16px, 3vw, 26px); background: var(--card-tint); overflow-wrap: anywhere; }
.card h2 { margin-bottom: 12px; }
.issue { margin-bottom: 12px; }
.explore { margin-top: 32px; }
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.links-grid a { border: 1px solid var(--theme-line); background: var(--card-tint); border-radius: 5px; text-decoration: none; padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.links-grid a:hover { border-color: var(--muted); }
.notice { background: #f5e7e5; color: #70262b; border-left: 5px solid var(--red); }
.notice .shell { display: flex; align-items: center; gap: 12px; padding-block: 9px; flex-wrap: wrap; }
.notice span { flex: 1; min-width: 14ch; }
.notice .notice-dismiss { color: inherit; border-color: currentColor; }
.toolbar { margin-bottom: 20px; align-items: start; }
.subscribe { max-width: min(100%, 32rem); }
.subscribe .card { margin-top: 8px; }
.reading { max-width: 46rem; }
.reading > p, .reading article p, article.reading p { line-height: 1.65; }
.phone-install-steps { padding-inline-start: 1.4rem; }
.phone-install-steps li + li { margin-top: 1rem; }
.install-app-icon { display: block; margin-top: .4rem; border-radius: 10px; }
.install-menu-icon {
  display: inline-block;
  width: 1.4em;
  border-radius: .25em;
  background: var(--soft-tint);
  color: var(--brand);
  font-size: 1.2em;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
}
.share-icon {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: .2em;
  color: var(--brand);
  width: 1.2em;
  line-height: 1;
  text-align: center;
  font-size: 1.3em;
  font-weight: 700;
  vertical-align: middle;
}
.reading .actions { margin-bottom: 24px; }
.reading .card { margin-block: 16px; }
.slot, .admin-item, .card > details { border-top: 1px solid var(--theme-line); padding: 10px 0; }
summary { font-weight: 700; padding-block: 6px; }
form { display: grid; gap: 10px; margin: 7px 0; }
form .button { justify-self: start; }
label { display: grid; gap: 4px; font-weight: 600; }
input:not([type="checkbox"]), textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--control-border); border-radius: 4px; background: #fff; color: var(--ink); min-height: 42px; }
textarea { min-height: 104px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.feedback { margin: 0; color: var(--red); font-weight: 600; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.guidon { max-width: 48rem; }
.guidon article { display: grid; gap: 16px; margin-top: 16px; font-size: 1.0625rem; line-height: 1.65; }
.guidon h2 { line-height: 1.12; }
.guidon-chapters { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 3; margin-top: 16px; padding: 8px 14px; }
.guidon-chapters summary { min-height: 32px; cursor: pointer; font-weight: 700; }
.guidon-chapters nav { max-height: 45dvh; overflow: auto; }
.guidon-bottom { text-align: right; margin-top: 16px; }
.guidon nav ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.guidon nav button { min-height: 44px; text-align: left; }
.guidon article section { scroll-margin-top: calc(66px + env(safe-area-inset-top, 0px)); }
.guidon-prices div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--theme-line); }
.guidon-prices dd { margin: 0; font-weight: 700; }
.guidon-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guidon-photos div { display: grid; place-items: center; min-height: 90px; padding: 12px; background: var(--soft-tint); text-align: center; }
@media (max-width: 480px) {
  .guidon nav ul { display: grid; }
  .guidon nav button { width: 100%; }
  .guidon-photos { grid-template-columns: minmax(0, 1fr); }
}
.saved { background: #e4eddf; padding: 9px 12px; border-radius: 5px; }
footer { background: var(--brand); color: #f7f2e9; }
.footer { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; padding-block: 24px; }
.footer p { font-size: .85rem; margin: 4px 0 0; color: #e8e4d8; }
.footer .footer-phone { margin: 0; }
.footer a { display: inline-block; margin: 4px 0 4px 16px; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .top { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; }
  nav { order: 3; width: 100%; gap: 0; justify-content: space-between; }
  nav a { font-size: .85rem; padding-block: 11px; }
  .hero-inner { min-height: 364px; }
  .hero::before { background: linear-gradient(90deg,var(--brand) 4%,color-mix(in srgb, var(--brand) 88%, transparent) 35%,color-mix(in srgb, var(--brand) 50%, transparent)),url('/flag.jpg') 64% center/cover no-repeat; }
  .two, .content-grid { grid-template-columns: minmax(0, 1fr); }
  .links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-row { grid-template-columns: 45px minmax(0,1fr) auto; padding-inline: 12px; gap: 6px 10px; }
  .footer a { margin: 4px 12px 4px 0; }
}
.calendar-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 24px 0 12px;
}
.calendar-controls h2 { margin: 0; text-align: center; }
.calendar-controls a:first-child { justify-self: start; }
.calendar-controls a:last-child { justify-self: end; }
.month-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--card-tint);
}
.month-grid th {
  padding: 8px 4px;
  background: var(--brand);
  color: var(--paper);
}
.month-grid td {
  height: 106px;
  padding: 6px;
  border: 1px solid var(--theme-line);
  vertical-align: top;
}
.month-grid .calendar-blank { background: var(--soft-tint); }
.month-grid .rental-day { width: 100%; padding-inline: 0; }
.rental-total { color: var(--brand); font-size: 1.75rem; font-weight: 700; }
.rental-mobile-total { display: none; }
.month-grid td.rental-unavailable { background: #e1e3e6; color: #4b5058; text-align: center; }
.rental-date-status { display: block; font-size: .7rem; }
@media (min-width: 761px) {
  .rental-summary { position: sticky; top: 16px; align-self: start; }
}
@media (max-width: 760px) {
  .rental-mobile-total {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 2;
    padding: 8px 14px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    background: var(--card-tint);
  }
  .rental-mobile-total .rental-total { font-size: 1.125rem; }
  .rental-summary .rental-total { display: none; }
  .rental-summary .card > p:first-of-type { display: none; }
  .rental-summary h2 { display: none; }
  .rental-layout form :is(input, textarea, select, button) { scroll-margin-top: 88px; }
}
.calendar-day { display: block; padding: 0 3px 4px; font-weight: 700; }
.calendar-event {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
  padding: 5px 7px;
  border-left: 3px solid var(--brand);
  border-radius: 3px;
  background: var(--soft-tint);
  font-size: .85rem;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.calendar-event:hover strong { text-decoration: underline; }
.calendar-event span { color: var(--muted); font-size: .78rem; }
.calendar-event.canceled { border-color: var(--red); background: #f5e7e5; }
.calendar-mobile-agenda { display: none; }
.calendar-view-auto .calendar-upcoming,
.calendar-view-month .calendar-upcoming,
.calendar-view-upcoming .calendar-month-view { display: none; }
.event-summary .tag, .reading > p .tag, .slot .tag { font-size: .875rem; }
#volunteer-signup { scroll-margin-top: 16px; }
.event-extra { border: 1px solid var(--theme-line); border-radius: 6px; padding: 10px 14px; }
.event-extra summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.event-extra label, .event-extra fieldset { margin-top: 12px; }
.calendar-empty { margin-top: 14px; }
@media (max-width: 650px) {
  .calendar-controls .button { padding-inline: 7px; font-size: .82rem; }
  .calendar-controls h2 { font-size: clamp(1.18rem, 5vw, 1.75rem); }
  .month-grid td { height: 58px; padding: 3px; }
  .month-grid th { font-size: .79rem; }
  .calendar-event { display: block; padding: 4px 3px; }
  .calendar-event span { display: none; }
  .calendar-event strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .calendar-mobile-agenda { display: block; margin-top: 24px; }
}
.event-facts { margin: 18px 0 24px; }
.event-facts div { border-top: 1px solid var(--theme-line); padding: 8px 0; }
.event-facts dt { font-weight: 700; }
.event-facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.volunteer-fields { min-width: 0; padding: 12px; border: 1px solid var(--theme-line); border-radius: 5px; }
.volunteer-fields legend { font-weight: 700; }
.volunteer-row { display: grid; gap: 8px; border-top: 1px solid var(--theme-line); padding: 10px 0; }
.volunteer-fields > .button { margin-top: 8px; }

.page > .card + .grid, .page > .grid + .grid { margin-top: 18px; }
.phone-preview { margin-bottom: 18px; }
.phone-preview img { display: block; max-width: 100%; height: auto; }
.phone-preview img + p { margin: 8px 0 0; }
.phone-nav, .phone-home-actions, .phone-refresh { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .shell {
    width: auto;
    margin-left: max(16px, env(safe-area-inset-left));
    margin-right: max(16px, env(safe-area-inset-right));
  }
  .top { min-height: 76px; padding: 8px 0; }
  .top nav { display: none; }
  .top-actions .button { min-height: 44px; }
  .top-actions .phone-refresh { display: inline-flex; }
  .hero-inner { min-height: 0; padding-block: 14px 18px; }
  .hero-branch-art { top: 10px; width: clamp(78px, 24vw, 116px); padding: 2px; }
  .hero h1 { font-size: clamp(2.65rem, 10vw, 4.25rem); line-height: 1; }
  .hero .eyebrow, .hero h1 { padding-inline-end: clamp(86px, 25vw, 124px); }
  .hero .eyebrow { margin-bottom: 8px; }
  .hero p:not(.eyebrow) { margin-bottom: 0; }
  .hero .hero-actions { display: none; }
  .home-content { padding-top: 18px; }
  .phone-home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .phone-home-actions .button { min-height: 56px; text-align: center; }
  .actions.desktop-home-actions { display: none; }
  .phone-home-actions .outline { background: var(--card-tint); border-color: var(--control-border); }
  .phone-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    gap: 4px;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--brand);
    border-top: 1px solid var(--control-border);
    color: var(--paper);
  }
  .phone-nav a {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 4px 2px;
    border: 1px solid #a9ad9d;
    border-radius: 6px;
    text-align: center;
    font-size: .9rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .phone-nav a[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
    text-decoration: none;
  }
  .phone-nav a:focus-visible { outline-color: var(--paper); outline-offset: 1px; }
  .page .actions .button, .event-row { min-height: 48px; }
  .calendar-view-auto .calendar-upcoming { display: block; }
  .calendar-view-auto .calendar-month-view { display: none; }
}
.branch-picker { margin-bottom: 26px; }
.branch-picker h2 { font-size: clamp(1.55rem, 4vw, 2rem); margin-bottom: 10px; }
.branch-theme-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 10px;
}
.branch-theme-button {
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  border-radius: 6px;
  box-shadow: inset 0 -4px var(--accent);
  min-height: 48px;
  padding: 7px 8px 10px;
  font-weight: 700;
}
.branch-theme-button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.theme-selected { visibility: hidden; margin-right: 5px; color: var(--accent); }
.branch-theme-button[aria-pressed="true"] .theme-selected { visibility: visible; }

main h1, main h2 { color: var(--brand); }
main .hero h1 { color: inherit; }
.links-grid a { color: var(--brand); }
.phone-home-actions .button.outline { background: var(--soft-tint); }
