/* NexDemo Polish: makers (Små Ting, Copenhagen makers and independent shops).
   Identity kept: green #3E5C4A, ink #1E1E1C, Lora, oat canvas #F2EEE6, square editorial controls.
   (The cold "No results" card is already fixed by re-issuing the site's own CSS in @layer nexdemo; nothing added here for it.)
   Fixes, in order:
    1. Cards: the charcoal gradient covered the lower half of every photo; a shorter, warmer scrim that only sits behind the text.
    2. Map pins: single pins were white on pale grey; solid green pins with a white rim.
    3. Home map: the map was 1440px wide inside a 992px column, so its zoom buttons and credit line were cut off; fitted to the column.
    4. Home hero: two identical outline buttons; the first becomes the solid green primary.
    5. Home "How this guide is made": button floated mid-row; aligned to the column's right edge.
    6. Listing page: three left edges below the article (224 / 410 / 564px) become two; the two-photo gallery fills its row.
    7. Listing page: "Contact" was only the directory's own account ("Små Ting editors · Member since 2026 · 24 places", Message -> "Accounts are off"): hidden while it has no real contact rows.
    8. Archive: view switch and current page in green instead of black.
    9. Footer: single short column pushed to the right edge so the right half is not empty.
   10. Phones: map credit line no longer wraps and clips.
   Also: "More like this" thumbnails get the 6px editorial corner; the read-only notice card sits on paper with square corners.
   Note on @layer: rule 4 sits inside "@layer nexdemo { }" because the site's own button colours are !important in that layer,
   and an !important declaration inside a layer outranks every unlayered rule.
*/

/* ---------- 1. Card photos (defect: heavy charcoal gradient over the lower 45% of every photo made a light site read murky) ---------- */
html body .nd-ecard.nd-ecard--poster .nd-ecard__shade {
  background: linear-gradient(180deg, rgba(30, 30, 28, 0) 0%, rgba(30, 30, 28, 0) 50%, rgba(30, 30, 28, .34) 68%, rgba(30, 30, 28, .66) 100%);
}
/* the text keeps its legibility on pale photos through a soft shadow rather than a darker photo */
html body .nd-ecard.nd-ecard--poster .nd-ecard__body { text-shadow: 0 1px 2px rgba(30, 30, 28, .55), 0 0 14px rgba(30, 30, 28, .35); }

/* ---------- 2. Map pins (defect: white pins with a thin outline on a pale grey map) ---------- */
html body .nd-pin .nd-pin__round { background: #3E5C4A; color: #fff; box-shadow: 0 6px 14px -6px rgba(30, 30, 28, .6), 0 0 0 2px #fff; }
html body .nd-pin--round:hover .nd-pin__round, html body .nd-pin--round.is-active .nd-pin__round { background: #1E1E1C; color: #fff; }

/* ---------- 3. Home map (defect: full-bleed 1440px map clipped by its 992px column; zoom buttons and map credit cut off) ---------- */
/* (the plugin's full-bleed margins and 100vw width are !important, so these are too) */
html body.home .st-map .nd-mapx { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; max-width: 100% !important; height: clamp(420px, 68vh, 620px); border: 1px solid #DAD4C8; }

/* ---------- 4. Home hero (defect: two identical outline buttons, no primary; the green accent barely present) ---------- */
/* (the site's button colours are !important inside @layer nexdemo; this joins that layer to set the primary) */
@layer nexdemo {
  html body .st-hero .st-cta .wp-block-button:first-child .wp-block-button__link { background: #3E5C4A !important; border-color: #3E5C4A !important; color: #fff !important; }
  html body .st-hero .st-cta .wp-block-button:first-child .wp-block-button__link:hover { background: #1E1E1C !important; border-color: #1E1E1C !important; }
}

/* ---------- 5. Home "How this guide is made" (defect: button floated mid-row, aligned to nothing) ---------- */
@media (min-width: 782px) {
  html body .st-made .st-made-cols > .wp-block-column:last-child .wp-block-buttons { justify-content: flex-end; }
}

/* ---------- 6. Listing page lower half ---------- */
@media (min-width: 1024px) {
  /* Location / Good to know / Contact sat in their own centred column (410px); line them up with the article and hours (564px) */
  html body .nds--editorial .nds-wrap.nds-ed__tail { max-width: none; }
  html body .nds--editorial .nds-ed__tail > .nds-section { max-width: none; width: auto; margin-left: 340px; margin-right: 0; }
}
/* two portrait thumbnails filled two thirds of the row */
html body .nds--editorial .nds-gallery--wall .nds-gallery__grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html body .nds--editorial .nds-gallery--wall .nds-gallery__grid[data-count="2"] .nds-gallery__item { aspect-ratio: 4 / 3; }
html body .nds--editorial .nds-gallery--wall .nds-gallery__grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
html body .nds--editorial .nds-gallery--wall .nds-gallery__grid[data-count="1"] .nds-gallery__item { aspect-ratio: 16 / 9; }
html body .nds--editorial .nds-gallery--wall .nds-gallery__item { border-radius: 6px; }

/* ---------- 7. Contact block (defect: seed-account filler and a Message button that only leads to "Accounts are off on this demo") ---------- */
html body .nds .nds-host .nds-host__meta,
html body .nds .nds-host .nds-host__actions a[href*="/login-signup/"],
html body .nds .nds-actions a[href*="/login-signup/"] { display: none; }
/* with those gone, "Contact" held only the directory's own account name, which the page already prints as "Listed by Små Ting editors" under the title:
   the section is hidden while it has no real contact rows (it returns as soon as a listing has a phone, website or email row) */
html body .nds--editorial #nds-host:not(:has(.nds-contact)) { display: none; }

/* ---------- 8. Archive (defect: pressed view button and current page in black; the accent never appears) ---------- */
html body .nd-discover .nd-viewtoggle button[aria-pressed="true"] { background: #3E5C4A !important; }
html body .nexdirectory-pagination .page-numbers span.page-numbers.current { background: #3E5C4A; border-color: #3E5C4A; color: #fff; }
html body .nexdirectory-pagination ul.page-numbers { color: #1E1E1C; }

/* ---------- 9. Footer (defect: one short "Menu" column, right 45% empty) ---------- */
@media (min-width: 900px) {
  html body .ndn-footer .ndn-footer__top { grid-template-columns: minmax(0, 1fr) auto; }
  html body .ndn-footer .ndn-footer__cols { grid-template-columns: minmax(0, 1fr); min-width: 320px; }
  html body .ndn-footer .ndn-footer__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}

/* ---------- 10. Map credit line on phones (defect: wrapped to two lines and clipped) ---------- */
@media (max-width: 899.98px) {
  html body .leaflet-container .leaflet-control-attribution { font-size: 9.5px !important; padding: 1px 6px; }
}

/* "More like this" thumbnails had 20px app-style corners next to the 6px editorial plates */
html body .nds--editorial .nds-relcard .nds-relcard__img { border-radius: 6px; }

/* Read-only notice ("Accounts are off on this demo"): a white app card with round corners on the oat page; paper plate with the site's square corners */
html body .nexdemo-ro .nexdemo-ro__card { background: #FBF9F5; border: 1px solid #DAD4C8; border-radius: 6px; box-shadow: none; }
