/* New York State map: the home page hero (owner, 2026-11-21).
 State outline: US Census via us-atlas (public domain), simplified and smoothed.
 Markup: .nymap-grid > .nymap-wrap > (.nymap > svg, .nymap-key, .places); js/nymap.js fills it. */
.nymap-wrap { max-width: 1000px; margin: 0 auto; --food: #6cc070; }   /* food = green (owner, 2026-11-21) */
/* WIDE SCREENS (owner, 2026-11-21): the town boxes run down the left in their own
   scrolling column; heading, map and key on the right. The wrapper steps aside
   (display: contents) so its parts join the section's grid. */
@media (min-width: 1100px) {
  /* the grid may be wider than the site's usual 1180 px column */
  .nymap-grid { max-width: 1500px; display: grid; grid-template-columns: clamp(380px, 34vw, 560px) minmax(0, 1fr);   /* wider boxes, smaller state (owner) */ column-gap: 28px; align-items: start;
    grid-template-areas: "places title" "places map" "places key"; }
  
  .nymap-grid .nymap-wrap { display: contents; }
  .nymap-grid .nymap { grid-area: map; width: 100%; }   /* auto margins in a grid item would shrink it to the SVG's default 300 px */
  .nymap-grid .nymap-key { grid-area: key; }
  .nymap-grid .places { grid-area: places; grid-template-columns: 1fr; gap: 10px; position: sticky; top: 12px;
    max-height: calc(100svh - 64px); overflow-y: auto; padding-left: 14px;
    direction: rtl; }   /* rtl puts the scrollbar on the LEFT (owner, 2026-11-21); each box sets ltr back */
  .nymap-grid .places > * { direction: ltr; }   /* fallback; js/nymap.js sets the height to what's on screen */
  /* An always-visible scrollbar ("elevator") on the right of the column: macOS hides
     plain scrollbars until you scroll, so it's drawn explicitly (owner, 2026-11-21). */
  /* Fade to transparent at an edge when there are more boxes beyond it (owner, 2026-11-21).
     Two mask layers: the fading one over the boxes, a solid one over the scrollbar strip. */
  .nymap-grid .places { --fade-top: 0px; --fade-bot: 0px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bot)), transparent 100%), linear-gradient(#000, #000);
    -webkit-mask-size: calc(100% - 14px) 100%, 14px 100%; -webkit-mask-position: right top, left top; -webkit-mask-repeat: no-repeat;
    mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bot)), transparent 100%), linear-gradient(#000, #000);
    mask-size: calc(100% - 14px) 100%, 14px 100%; mask-position: right top, left top; mask-repeat: no-repeat; }
  .nymap-grid .places.more-above { --fade-top: 56px; }
  .nymap-grid .places.more-below { --fade-bot: 90px; }
  .nymap-grid .places::-webkit-scrollbar { width: 10px; }
  .nymap-grid .places::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.08); border-radius: 6px; }
  .nymap-grid .places::-webkit-scrollbar-thumb { background: rgba(247, 144, 7, 0.75); border-radius: 6px; border: 2px solid rgba(0, 0, 0, 0); background-clip: padding-box; }
  .nymap-grid .places::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
  @supports not selector(::-webkit-scrollbar) { .nymap-grid .places { scrollbar-width: auto; scrollbar-color: rgba(247, 144, 7, 0.75) rgba(255, 255, 255, 0.08); } }
  /* "More below": a fade and a bouncing arrow pinned to the bottom of the column;
     hidden once you reach the end. Clicking it scrolls down a screenful. */
  /* Laid over the column (same grid area, same sticky top) rather than inside it, so the fade never dims it. */
  .nymap-grid .more { display: flex; grid-area: places; align-self: start; position: sticky; top: 12px; width: calc(100% - 14px); justify-self: end; z-index: 2; align-items: flex-end; justify-content: center;
    padding-bottom: 6px; pointer-events: none; transition: opacity 0.2s; }
  .nymap-grid .more.done { opacity: 0; }
  .nymap-grid .more button { pointer-events: auto; cursor: pointer; border: 1px solid rgba(247, 144, 7, 0.6); background: rgba(26, 6, 6, 0.9); color: var(--accent);
    border-radius: 999px; padding: 5px 18px 6px; font: 600 0.92rem var(--font-body); display: flex; align-items: center; gap: 6px; animation: nymap-bob 1.6s ease-in-out infinite; }
  .nymap-grid .more.done button { pointer-events: none; }
  @keyframes nymap-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
  @media (prefers-reduced-motion: reduce) { .nymap-grid .more button { animation: none; } }
  .nymap-grid .place.flash { animation: nymap-flash 1.4s ease-out; }
  @keyframes nymap-flash { 0%, 30% { border-color: var(--accent); background: rgba(247, 144, 7, 0.22); } 100% { border-color: var(--rule); background: rgba(0, 0, 0, 0.28); } }
  .nymap-grid .place { padding: 10px 14px 12px; }
  .nymap-grid .place h3 { font-size: 1.65rem; margin-bottom: 6px; }
}
/* Always the whole state on screen: as wide as fits, but never taller than the window (owner, 2026-11-21). */
.nymap { position: relative; margin: 0 auto; max-width: min(100%, calc((100svh - 32px) * 1040 / 850)); }   /* fallback; fitMap() refines it */
.nymap svg { display: block; width: 100%; height: auto; overflow: visible; }
.nymap .state { fill: rgba(42, 12, 12, 0.9); stroke: rgba(247, 144, 7, 0.6); stroke-width: 2.2; stroke-linejoin: round; }
.nymap .state-glow { fill: none; stroke: rgba(247, 144, 7, 0.16); stroke-width: 14; stroke-linejoin: round; }
.nymap .water { font-family: var(--font-display); font-style: italic; fill: rgba(255, 255, 255, 0.32); font-size: 24px; letter-spacing: 0.04em; }
.nymap .pl { cursor: pointer; }
.nymap .pl .halo { fill: rgba(247, 144, 7, 0.18); transition: r 0.2s, fill 0.2s; }
.nymap .pl .dot { fill: var(--accent); stroke: #2a0a0a; stroke-width: 3; }
.nymap .pl.food-only .dot { fill: var(--food); }
.nymap .pl .nm { font-family: var(--font-body); font-weight: 700; font-size: 25px; fill: #fff; paint-order: stroke; stroke: rgba(30, 6, 6, 0.85); stroke-width: 6px; stroke-linejoin: round; }
.nymap .pl .ct { font-family: var(--font-body); font-size: 19px; fill: rgba(255, 255, 255, 0.72); paint-order: stroke; stroke: rgba(30, 6, 6, 0.85); stroke-width: 5px; }
.nymap .pl .lead { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
.nymap .pl.on .halo, .nymap .pl:hover .halo { fill: rgba(247, 144, 7, 0.42); }
.nymap .pl .star { fill: #fff; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.nymap .pl .us { font-family: var(--font-display); font-style: italic; font-size: 24px; fill: var(--accent); paint-order: stroke; stroke: rgba(30, 6, 6, 0.85); stroke-width: 6px; }
.nymap-key .k-star { color: #fff; font-size: 1rem; margin-right: 5px; }
.nymap-key { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 0.85rem; color: var(--fg-dim); margin: 8px 0 22px; }
.nymap-key i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; border: 2px solid #2a0a0a; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.place { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px 14px; transition: border-color 0.2s, background 0.2s; }
.place.on { border-color: var(--accent); background: rgba(247, 144, 7, 0.09); }
.place h3 { margin: 0 0 6px; font-family: var(--font-display); font-style: italic; font-size: 1.75rem; font-weight: 600; line-height: 1.2; }   /* town names larger (owner, 2026-11-21) */
.place ul { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; line-height: 1.45; }
/* Every row has the same 22 px slot (logo, or a bullet centred in it) so the names line up. */
.place li { padding: 2px 0 2px 30px; position: relative; }
.place li::before { content: ''; position: absolute; left: 6px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.place li.f::before, .nymap-pop li.f::before { background: var(--food); }
.place li.has-logo::before, .nymap-pop li.has-logo::before { display: none; }
.place li .lg, .nymap-pop li .lg { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }   /* centred on the name, however many lines */
.place li.out, .nymap-pop li.out { color: var(--fg-dim); }
.place li.out::before, .nymap-pop li.out::before { background: #e5484d; }   /* 86'd tonight: red */
.place li.out s, .nymap-pop li.out s { text-decoration-thickness: 1.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.place li small { color: var(--fg-dim); }
/* Pop-up beside a dot (hover or tap): the town's beers and dishes, on the map itself. */
.nymap-pop { position: absolute; z-index: 5; width: 270px; max-width: calc(100% - 16px); pointer-events: auto;
  background: #1c0606; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; }
.nymap-pop.show { opacity: 1; transform: none; }
.nymap-pop h3 { margin: 0 24px 6px 0; font-family: var(--font-display); font-style: italic; font-size: 1.55rem; font-weight: 600; line-height: 1.2; }
.nymap-pop ul { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; line-height: 1.4; }
.nymap-pop li { padding: 2px 0 2px 30px; position: relative; }
.nymap-pop li::before { content: ''; position: absolute; left: 6px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nymap-pop li small { color: var(--fg-dim); }
.nymap-pop .x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--fg-dim); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px; }
.more { display: none; }   /* the "more below" arrow is only for the side column */
@media (max-width: 600px) {
  .nymap .pl .ct { display: none; }
  .nymap .pl .us { font-size: 30px; }
  .nymap .pl .nm { font-size: 34px; stroke-width: 8px; }
  .nymap .water { font-size: 30px; }
}

/* The hero section: the map starts close under the header. */
.nymap-section { padding: 12px 0 40px; }

/* Hidden until sized (js/nymap.js 'settled'), then a quick fade: no visible jumps on load. */
.nymap-grid:not(.settled) { visibility: hidden; }
.nymap-grid.settled { animation: nymap-in 0.25s ease-out; }
@keyframes nymap-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nymap-grid.settled { animation: none; } }

/* Western tip tucked behind the boxes on wide screens (owner, 2026-11-22; js/nymap.js
   fitMap sets the map's width and --tuck). The map is right-aligned in its column and
   overflows left under the boxes column, fading out there. */
@media (min-width: 1100px) {
  .nymap-grid .nymap { justify-self: start; max-width: none; }   /* js/nymap.js sets width + margins: right edge on the column edge, extra width to the left under the boxes */
  .nymap-grid { grid-template-rows: auto auto 1fr; }   /* extra column height goes under the key, never above the map (it pushed the map down) */
  .nymap-grid .places { position: sticky; z-index: 2; }
  .nymap-grid .more { z-index: 3; }
  /* no mask (owner, 2026-11-22: keep the state outline): the tip simply passes under the boxes, which sit on top */
}

/* Wide screens (2026-11-22): the key moves into the map's empty lower-left corner
   (under the Southern Tier, west of the Hudson), clear of the tucked tip, so the
   state can use its height. */
@media (min-width: 1100px) {
  .nymap-grid .nymap-key { grid-area: map; align-self: end; justify-self: start; position: relative; z-index: 1;
    flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 3% calc(var(--tuck, 0px) * 0 + 4%); }
}
