/* Phone shell. Desktop layout is unchanged above 800px.
   Wordmark: Fraunces, deep blue, same words. Coral lock stays #d86c4e. */

picture { display: contents; }

.m-shell { display: none; }
/* Closed menu stays out of the page even if the phone stylesheet does not apply. */
.m-menu[hidden] { display: none !important; }
.m-check:checked ~ .m-menu[hidden] { display: block !important; }

.site-foot {
  background: #1f3a4d;
  color: #f7f4ee;
  padding: 22px 18px 28px;
}
.site-foot__in { max-width: 720px; margin: 0 auto; }
.site-foot__mark {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.site-foot__mark strong { color: #d86c4e; font-weight: 700; }
.site-foot__own {
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(247, 244, 238, 0.9);
}
.site-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 10px;
}
.site-foot__links a {
  color: #f7f4ee;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.site-foot__links a:hover { color: #d86c4e; }
.site-foot__more {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 0 0 10px;
}
.site-foot__more a {
  color: rgba(247, 244, 238, 0.82);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.site-foot__more a:hover { color: #d86c4e; }
.site-foot__copy,
.site-foot__credit,
.site-foot__source {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(247, 244, 238, 0.78);
}
.site-foot__credit { margin: 0 0 8px; }
.site-foot__source { margin: 0 0 14px; }
.site-foot__credit a { color: #f7f4ee; text-decoration: underline; }

@media (max-width: 800px) {
  body {
    display: flex;
    flex-direction: column;
  }
  body > * { order: 2; width: 100%; min-width: 0; }
  .launch-banner,
  body > .ribbon { order: 0; }
  .m-shell { order: 1; }

  .m-shell { display: block; }

  /* Trust ribbons stay one scrolling line. The election banner wraps, below. */
  .launch-banner,
  body > .ribbon,
  .site-header .ribbon {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin: 0;
    padding: 0 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    text-align: left;
    text-transform: none;
    font-family: Inter, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    font-variation-settings: normal;
    line-height: 36px;
    letter-spacing: 0.01em;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 81;
  }
  .launch-banner::-webkit-scrollbar,
  body > .ribbon::-webkit-scrollbar,
  .site-header .ribbon::-webkit-scrollbar { display: none; }
  .launch-banner .pulse {
    width: 8px;
    height: 8px;
    margin: 0;
    flex: 0 0 auto;
  }
  .launch-banner.m-fade, body > .ribbon.m-fade {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent);
  }
  .ribbon__inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    width: max-content;
    min-height: 0;
    padding: 0;
  }
  .ribbon strong, .ribbon span, .ribbon a { white-space: nowrap; }
  .site-header .ribbon { display: none; }
  .launch-banner {
    display: block;
    height: auto;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-align: center;
    line-height: 1.35;
    padding: 8px 16px;
    font-size: 14px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .launch-banner.m-fade { -webkit-mask-image: none; mask-image: none; }
  body > .ribbon {
    display: block;
    height: auto;
    overflow: hidden;
    white-space: normal;
    line-height: 1.35;
    padding: 8px 16px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  body > .ribbon .ribbon__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
    max-width: 100%;
    gap: 4px 14px;
    white-space: normal;
  }
  body > .ribbon .nowrap { white-space: normal; }
  .desk-rail {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .desk-rail a, .desk-rail span { white-space: nowrap; }
  .site-header .ribbon .shell {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 0;
  }

  /* Retire the tall per-page headers on phones. */
  body > header:not(.m-head),
  .masthead,
  .site-header .masthead,
  nav.section-nav,
  .nav-toggle { display: none !important; }
  .site-header { display: contents; }

  .m-head {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 12px;
    background: rgba(247, 244, 238, 0.97);
    border-bottom: 1px solid rgba(31, 58, 77, 0.12);
    position: sticky;
    top: 0;
    z-index: 82;
  }
  body:has(.launch-banner) .m-head { top: var(--m-banner, 48px); }
  body:has(> .ribbon) .m-head { top: var(--m-ribbon, 72px); }
  .m-brand strong { color: #d86c4e; font-weight: 900; }
  .m-brand {
    margin-right: auto;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: #1f3a4d;
    font-family: Fraunces, Georgia, serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.02em;
    line-height: 1;
    text-decoration: none;
  }
  .m-sub {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 2px;
    background: #d86c4e;
    color: #1a252b;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }
  .m-check {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .m-burger {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 2px;
    border: 1px solid rgba(31, 58, 77, 0.22);
    cursor: pointer;
  }
  .m-bars,
  .m-bars::before,
  .m-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #1f3a4d;
    position: relative;
  }
  .m-bars::before,
  .m-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .m-bars::before { top: -6px; }
  .m-bars::after { top: 6px; }
  .m-check:checked ~ .m-head .m-bars { background: transparent; }
  .m-check:checked ~ .m-head .m-bars::before { top: 0; transform: rotate(45deg); }
  .m-check:checked ~ .m-head .m-bars::after { top: 0; transform: rotate(-45deg); }

  .m-menu {
    display: block;
    position: fixed;
    z-index: 70;
    left: 0;
    right: 0;
    top: 56px;
    bottom: 0;
    overflow: auto;
    background: #f7f4ee;
    padding: 8px 12px 40px;
    visibility: hidden;
    transform: translateX(12px);
  }
  .m-check:checked ~ .m-menu {
    visibility: visible;
    transform: none;
  }
  html:has(.m-check:checked) { overflow: hidden; }
  body:has(.launch-banner) .m-menu { top: calc(56px + var(--m-banner, 48px)); }
  body:has(> .ribbon) .m-menu { top: calc(56px + var(--m-ribbon, 72px)); }
  .m-kicker {
    margin: 18px 4px 4px;
    color: #d86c4e;
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .m-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(31, 58, 77, 0.1);
    color: #1f3a4d;
    font-family: Fraunces, Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
  }
  .m-menu a[aria-current="page"] { box-shadow: inset 3px 0 0 #d86c4e; padding-left: 10px; }

  /* Home hero: headline, deck, and primary action on the first screen. */
  .cine {
    height: auto;
    min-height: 0;
  }
  .cine::after {
    background: linear-gradient(180deg, rgba(26, 37, 43, 0.62) 0%, rgba(26, 37, 43, 0.78) 100%);
  }
  .cine .in { position: relative; padding: 22px 0 20px; }
  .cine h1 { font-size: 40px; margin: 8px 0 10px; }
  .cine p { font-size: 16px; line-height: 1.45; }
  .cine .ctas { margin-top: 16px; }
  .cine .btn { min-height: 48px; }

  /* Scannable cards and a shared type floor. */
  p, li, td, dd, .deck, .lede, .dek, .rn-list, .rn-src, .rn-empty, .rn-stamp,
  .piece-card p, .piece-card .meta, .promo-text, .small, .prose p, .quick-answer,
  .desk-lede, .page-copy p, .page-copy li, .town-card p, .answer-card p, .note {
    font-size: 16px;
    line-height: 1.5;
  }
  .right-now { padding: 22px 0 8px; }
  .rn-grid { gap: 14px; }
  .rn-tile {
    border-radius: 8px;
    padding: 18px 16px 16px;
  }
  .rn-head { margin-bottom: 14px; }
  .launch-pieces, .muni-section, .tip-section, .newsletter-hero { margin-bottom: 8px; }
  .section-heading, .launch-pieces h2, h2.section-heading { margin: 8px 0 14px; }
  .launch-pieces-grid, .coming-teaser-grid { gap: 14px; }
  .piece-card, .card, .promo-card, .muni-card, .town-card, .answer-card,
  .civic-card, .case-card, .pulse-docket, .teaser-item, .dateblock, .notice {
    border-radius: 8px;
  }
  .piece-card .content, .promo-card > div { padding: 14px 16px 16px; }
  .piece-card .btn, .promo-card .btn, .muni-card, .text-link, .cta, .btn {
    min-height: 48px;
  }
  .muni-grid { gap: 12px; background: transparent; }
  .muni-card { min-height: 72px; border: 1px solid rgba(31, 58, 77, 0.12); }
  .newsletter-hero, .tip-section { border-radius: 8px; overflow: hidden; }
  #newsletter, #tip, #right-now { scroll-margin-top: 72px; }

  .launch-intro { padding: 28px 0 22px; }
  .hero:has(.hero-feature) { margin-top: 18px; margin-bottom: 18px; }
  .hero-feature { border-radius: 8px; }
  .desk-rail a, .sidecard a, footer a, .site-footer a, .foot a, .toc a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }

  /* Town index uses the same paper, type, and coral. */
  .directory-hero { background: #ede3d0; }
  .town-card, .answer-card {
    background: #fffdf9;
    border: 1px solid rgba(31, 58, 77, 0.12);
    border-left: 3px solid #d86c4e;
    box-shadow: none;
  }
  .town-card h2, .answer-card h2, .directory-hero h1 {
    font-family: Fraunces, Georgia, serif;
    color: #1f3a4d;
  }
  .eyebrow { color: #d86c4e; }
  .status.hold { background: #f6e6d4; color: #6d3a28; }

  .lead-story { padding-top: 8px; }
  .lead-story__meta { gap: 10px; }
  .dateblock { border-radius: 8px; }

  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    width: 100%;
    max-width: none;
    background: transparent;
    gap: 8px;
  }
  .newsletter-form input,
  .newsletter-form button,
  .tip-form textarea,
  .tip-form input[type="email"] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
  }
  .newsletter-form input {
    background: #f7f4ee;
    border-radius: 3px;
  }
  input, select, textarea { font-size: 16px; }

  .table-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
  .table-scroll.is-wide {
    background:
      linear-gradient(to left, rgba(247, 244, 238, 0.96), rgba(247, 244, 238, 0)) right center / 28px 100% no-repeat;
  }
  table.m-cards,
  table.m-cards tbody,
  table.m-cards tr,
  table.m-cards td { display: block; width: auto; }
  table.m-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  table.m-cards { border: 0; background: transparent; }
  table.m-cards tr {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #fffdf9;
    border: 1px solid rgba(31, 58, 77, 0.12);
    border-left: 3px solid #d86c4e;
    border-radius: 8px;
  }
  table.m-cards td { padding: 6px 0; border: 0; }
  table.m-cards td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: #56636c;
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

a[href^="http"],
.answer-card a,
.source-list a,
.src a,
.prose a {
  overflow-wrap: anywhere;
}

.photo-credit {
  margin: 10px 0 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.photo-credit a { text-decoration: underline; }
.hero-overlay .photo-credit,
.vg-hero .photo-credit { color: rgba(247, 244, 238, 0.92); }
.hero-overlay .photo-credit a,
.vg-hero .photo-credit a { color: #fff; }
