/* =====================================================================
   NYFE site chrome: ONE header, ONE footer and shared tokens for every page type.
   Source of truth. Loaded LAST on every page:
     - guide pages (/landmarks, /neighborhoods): appended verbatim to the end of /nyfe-guide-header.css
     - homepage app, public documents (stories, news, contact...), /tools/*: <link href="/nyfe-chrome.css"> before </head>
   The release check (check_chrome.py) fails any page that does not end its stylesheets with this file.
   Never targets .leaflet-*, .map-* internals, story panels or pins.
   ===================================================================== */

/* ---------- 1. Shared tokens ---------- */
html:root {
  --gold: #ffd700;
  --nyfe-gold: #ffd700;
  --nyfe-gold-hover: #ffe43b;
  --nyfe-gold-dim: #685800;
  --nyfe-gold-tint: #211d0d;
  --nyfe-line: #303030;
  --nyfe-muted: #b8c0cc;
  --nyfe-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nyfe-container: 1180px;
  --nyfe-gutter: 28px;
  --nyfe-header-h: 72px;
  --nyfe-header-h-phone: 52px;
  --nyfe-btn-h: 44px;
}
@media (min-width: 1500px) { html:root { --nyfe-gutter: 40px; } }
@media (max-width: 1150px) { html:root { --nyfe-gutter: 18px; } }
@media (max-width: 740px)  { html:root { --nyfe-gutter: 16px; } }

/* ---------- 2. Header: 72px on desktop, 52px below 1024px, on every page ---------- */
@media (min-width: 1024px) {
  .site-header,
  .public-document .site-header,
  .nyfe-global-header {
    box-sizing: border-box;
    min-height: var(--nyfe-header-h);
    height: var(--nyfe-header-h);
    padding-block: 8px;
    padding-inline: var(--nyfe-gutter);
  }
  .site-header .brand-logo,
  .nyfe-global-header .nyfe-brand img { width: 54px; height: 54px; }
  .site-header .brand strong,
  .nyfe-global-header .nyfe-brand strong { font-size: 16px; line-height: 1.15; }
}
.nyfe-global-header { font-family: var(--nyfe-font); }

/* Public documents (stories, news, contact, sponsor, policies) used a 101px desktop header and a 193px phone
   header with a wrapping menu. Below 1024px they now match the app: one 52px row, compact "NYFE" mark,
   and a menu that scrolls sideways instead of wrapping. */
@media (max-width: 1023px) {
  .public-document .site-header {
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    min-height: var(--nyfe-header-h-phone);
    height: var(--nyfe-header-h-phone);
    padding: 0 10px;
  }
  .public-document .site-header .brand { flex: none; display: flex; align-items: center; gap: 8px; }
  .public-document .site-header .brand-logo { width: 32px; height: 32px; }
  .public-document .site-header .brand strong { font-size: 0; line-height: 1; }
  .public-document .site-header .brand strong br { display: none; }
  .public-document .site-header .brand strong::after { content: "NYFE"; font-size: 15px; letter-spacing: .02em; }
  .public-document .site-header .document-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
  }
  .public-document .site-header .document-nav::-webkit-scrollbar { display: none; }
  .public-document .site-header .document-nav a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 420px) { .public-document .site-header .document-nav { justify-content: flex-start; } }

/* ---------- 3. Footer: one slim row (copyright left, links right), same size everywhere ---------- */
.site-footer,
.document-footer,
.tools-footer,
body.nyfe-has-global-header > footer {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 24px;
  width: auto;
  max-width: none;
  min-height: 48px;
  margin: 0;
  padding: 12px var(--nyfe-gutter);
  border-top: 1px solid var(--nyfe-line);
  background: #000;
  color: var(--nyfe-muted);
  font-family: var(--nyfe-font);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
/* Copyright first and on the left; everything else lines up after it on the right. */
:is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) > :is(p, span):first-of-type { order: -1; margin: 0 auto 0 0; }
:is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) > p { margin: 0; }
:is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
html body :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) button { display: inline-flex; align-items: center; min-height: 24px; height: auto; margin: 0; padding: 0; border: 0; background: none; color: var(--nyfe-gold); font: inherit; font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
html body :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) a { display: inline-flex; align-items: center; min-height: 24px; height: auto; padding: 0; border: 0; color: #e2e2e2; font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
:is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) a:hover { color: var(--nyfe-gold); }
/* The analytics consent control sits in some footers; size it like a footer link (its own rule uses an id). */
html body footer button#nyfe-ga4-settings { min-height: 24px; height: auto; padding: 0; font-size: 12px; line-height: 1.5; }
@media (max-width: 740px) { html body footer button#nyfe-ga4-settings { min-height: 32px; flex: none; white-space: nowrap; } }

/* Phones: one swipeable row, so every footer is the same height however many links it carries. */
@media (max-width: 740px) {
  .site-footer,
  .document-footer,
  .tools-footer,
  body.nyfe-has-global-header > footer {
    flex-wrap: nowrap;
    gap: 0 16px;
    padding: 10px 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    white-space: nowrap;
  }
  :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer)::-webkit-scrollbar { display: none; }
  :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) > :is(p, span):first-of-type { flex: none; margin: 0; }
  :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) > * { flex: none; }
  :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) nav { flex-wrap: nowrap; gap: 0 16px; }
  html body :is(.site-footer, .document-footer, .tools-footer, body.nyfe-has-global-header > footer) :is(a, button) { min-height: 32px; white-space: nowrap; }
}

/* ---------- 4. One page container ---------- */
.document-main,
.document-main.story-main,
.document-main.legal-main,
.document-main.news-main {
  width: min(var(--nyfe-container), 100%);
  max-width: none;
  padding-inline: var(--nyfe-gutter);
}
body.nyfe-has-global-header:not([data-tool]) > main,
.tools-shell {
  max-width: var(--nyfe-container);
  padding-inline: var(--nyfe-gutter);
}
body.nyfe-has-global-header { background: #000; font-family: var(--nyfe-font); }

/* ---------- 5. Type: one hero scale and one eyebrow ---------- */
.document-main .document-hero h1,
body.nyfe-has-global-header:not([data-tool]) > main h1,
.tools-shell .hero h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -1px; }
.document-main .document-hero { padding-block: clamp(32px, 4vw, 56px) clamp(28px, 3vw, 40px); }
.public-document .eyebrow,
.public-document .news-packet-kicker,
body.nyfe-has-global-header main .eyebrow,
.mw-heading .eyebrow { color: var(--nyfe-gold); font-size: 12px; font-weight: 800; letter-spacing: 1.8px; line-height: 1.6; }

/* ---------- 6. One gold and one button spec ---------- */
.public-document .button,
body.nyfe-has-global-header:not([data-tool]) main :is(.button, .primary-action, .secondary-action),
.tools-shell button.primary,
.mw-heading-actions button,
.mw-collection-heading > button { min-height: var(--nyfe-btn-h); border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 650; line-height: 1.2; }
@media (min-width: 741px) {
  .public-document .button,
  body.nyfe-has-global-header:not([data-tool]) main :is(.button, .primary-action, .secondary-action),
  .tools-shell button.primary,
  .mw-heading-actions button,
  .mw-collection-heading > button { padding: 10px 16px; }
}
body.nyfe-has-global-header:not([data-tool]) main :is(.button.primary, .primary-action) { background: var(--nyfe-gold); border-color: var(--nyfe-gold); color: #000; }
body.nyfe-has-global-header:not([data-tool]) main :is(.button:not(.primary):not(.boost), .secondary-action) { border-color: #444; }
button.primary:hover, .button.primary:hover, .primary-action:hover { background: var(--nyfe-gold-hover); filter: none; }
.legal-copy a { color: var(--nyfe-gold); text-decoration-color: var(--nyfe-gold-dim); }
:is(button, a, input, textarea, select, summary):focus-visible { outline-color: var(--nyfe-gold); }

/* ---------- 7. App views: no empty newsroom gap, tighter My Map ---------- */
/* The hidden newsroom wrapper kept an 18px margin above every non-map app view. */
#newsroom-home-review:not(:has(> :not([hidden]))) { display: none; }

.mw-workspace { --mw-gutter: var(--nyfe-gutter); min-height: calc(100dvh - var(--nyfe-header-h)); padding-bottom: 16px; }
.mw-heading { padding: 16px var(--mw-gutter) 14px; gap: 16px; border-bottom: 0; }
.mw-heading h1 { margin: 4px 0; }
.mw-heading p { margin: 4px 0 0; line-height: 1.5; }
.mw-heading-actions { gap: 8px; }
.mw-nav { padding: 6px var(--mw-gutter); gap: 4px; border-bottom: 1px solid var(--nyfe-gold-dim); }
.mw-nav button { min-height: 42px; padding: 9px 14px; border-radius: 10px; }
.mw-nav button[aria-current=page] { background: var(--nyfe-gold-tint); border-color: var(--nyfe-gold-dim); color: var(--nyfe-gold); }
.mw-body { max-width: none; margin: 0; padding: 16px var(--mw-gutter) 28px; }
.mw-collection-heading { margin-bottom: 14px; gap: 12px; }
.mw-collection-heading h2, .mw-diary-intro h2 { font-size: 24px; margin: 0 0 4px; }
.mw-collection-heading p, .mw-diary-intro p { margin: 4px 0; }
.mw-diary-intro { margin-bottom: 16px; }
.mw-filterbar { margin-bottom: 16px; gap: 8px; }
.mw-filterbar input, .mw-filterbar select { padding: 10px 12px; }
.mw-settings-tabs { margin-bottom: 16px; }
.mw-empty { padding: 36px 20px 40px; }
.mw-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.mw-card-body { padding: 16px; }
@media (min-width: 1400px) {
  .mw-card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .mw-board-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (max-width: 1023px) {
  .mw-heading { padding: 16px 16px 14px; gap: 14px; }
  .mw-nav { padding: 6px 12px; }
  .mw-nav button { min-height: 44px; padding: 10px 12px; }
  .mw-body { padding: 16px 16px 28px; }
  .mw-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mw-body:has(.mw-diary-intro) .my-map-layout,
  .mw-body:has(.mw-diary-intro) .my-map-mobile-tabs { margin-inline: -16px; }
}
@media (max-width: 520px) {
  .mw-nav { padding-inline: 12px; }
  .mw-card-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
/* ---------- 8. One header menu and one footer with social links ---------- */
/* The brand never carries a tagline. */
.site-header .brand small, .nyfe-brand small { display: none; }
/* Tools sits right before the account, like the homepage app. */
.nyfe-global-nav > .nyfe-tools { margin-left: 2px; }
@media (max-width: 1023px) { .nyfe-global-nav > .nyfe-tools { min-height: 44px; padding: 8px; font-size: 13px; } }
html body .nyfe-footer .nyfe-social { display: flex; flex-wrap: nowrap; gap: 2px; margin: 0 -6px 0 0; }
html body .nyfe-footer .nyfe-social a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; min-height: 24px; border-radius: 6px; color: #d6d6d6; text-decoration: none; }
html body .nyfe-footer .nyfe-social a:hover, html body .nyfe-footer .nyfe-social a:focus-visible { color: #000; background: var(--nyfe-gold); }
.nyfe-footer .nyfe-social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Narrow desktops: tighter spacing keeps the footer on one 49px row even with the analytics link. */
@media (min-width: 1024px) and (max-width: 1279px) {
  html body footer.site-footer.nyfe-footer { column-gap: 14px; }
  html body footer.nyfe-footer > .nyfe-footer-links { column-gap: 12px; }
  html body .nyfe-footer .nyfe-social { gap: 0; }
}
/* Below 1024px (like the header): copyright and social icons on one row, the links on a swipeable row under them.
   Same height on every page. */
@media (max-width: 1023px) {
  html body footer.site-footer.nyfe-footer { flex-wrap: wrap; overflow: visible; white-space: normal; gap: 2px 12px; padding: 8px 16px 6px; }
  html body footer.nyfe-footer > span:first-of-type { order: -2; flex: 1 1 auto; margin: 0; }
  html body footer.nyfe-footer > .nyfe-social { order: -1; flex: none; }
  html body .nyfe-footer .nyfe-social a { width: 32px; height: 32px; min-height: 32px; }
  html body footer.nyfe-footer > .nyfe-footer-links { order: 0; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; gap: 0 16px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  html body footer.nyfe-footer > .nyfe-footer-links::-webkit-scrollbar { display: none; }
  html body footer.nyfe-footer > :is(button, a) { order: 1; }
  html body footer.nyfe-footer .nyfe-footer-links :is(a, button) { flex: none; min-height: 32px; white-space: nowrap; }
}

/* ---------- 9. Today in NYC pages: archive, borough and related lists as cards ---------- */
.borough-news-document .news-main > section > h2,
.borough-news-document .news-packet-body ~ section > h2 { margin: 36px 0 14px; font-size: 24px; line-height: 1.3; }
.borough-news-document .news-related-list { list-style: none; display: grid; gap: 12px; margin: 0 0 32px; padding: 0; font-size: 14px; line-height: 1.7; color: #c8c9bf; }
.borough-news-document .news-related-list > li { min-width: 0; margin: 0; padding: 16px 20px; border: 1px solid #444034; border-radius: 10px; background: #171710; overflow-wrap: anywhere; }
.borough-news-document .news-related-list > li > h2 { margin: 0 0 4px; font-size: 21px; line-height: 1.35; letter-spacing: -.2px; }
.borough-news-document .news-related-list > li > h2 a { color: #fff; text-decoration: none; }
.borough-news-document .news-related-list > li > h2 a:hover { color: var(--nyfe-gold); }
.borough-news-document .news-related-list > li > a { color: #f4d468; font-weight: 650; text-decoration: none; }
.borough-news-document .news-related-list > li > a:hover { text-decoration: underline; text-underline-offset: 4px; }
.borough-news-document .news-related-list > li > p { margin: 2px 0; font-size: 13px; line-height: 1.6; color: #bcb9ac; }
.borough-news-document .news-related-list time { font-size: 12px; color: #bcb9ac; }
.borough-news-document .news-related-list > li > ul { list-style: none; display: grid; gap: 4px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid #35342d; }
.borough-news-document .news-related-list > li > ul a { color: #f4d468; text-underline-offset: 4px; }
@media (min-width: 900px) { .borough-news-document .news-main > .news-related-list > li > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; } }
/* end NYFE site chrome */
