/* ==========================================================================
   NeighbourhoodMums — The Kitchen Drawer (Local Directory)
   Mobile-first (design at 390px). D1 drawer, D2 results, D3 listing,
   D4 desktop 3-pane (>=1200px), D5 tablet split (768-1199px).
   Loaded only on the gm_place archive, gm_directory taxonomy and single place.
   ========================================================================== */

.nm-kd { padding: 16px 0 0; }
.nm-kd__cols { max-width: 1280px; margin-inline: auto; padding-inline: 16px; }
.nm-kd__h1 { font-family: var(--gm-font-display); font-weight: 700; font-size: 38px; line-height: 1.05; text-transform: uppercase; margin: 8px 0; }
.nm-kd__subhead { font-family: var(--gm-font-display); font-weight: 700; font-size: 20px; text-transform: uppercase; margin: 28px 0 12px; }
.nm-kd__back { font-family: var(--gm-font-display); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: var(--gm-ls-wide); color: var(--gm-raspberry); text-decoration: none; }

/* Search */
.nm-kd__search { width: 100%; box-sizing: border-box; height: 54px; border: 2px solid var(--gm-ink); border-radius: var(--gm-radius-md); padding: 0 16px; font-size: 16px; font-family: var(--gm-font-body); background: #fff; }
.nm-kd__search:focus { outline: 3px solid var(--gm-ink); outline-offset: 2px; }

/* Situation tiles */
.nm-kd__situations { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nm-kd-tile { min-height: 96px; border: 0; border-radius: var(--gm-radius-md); padding: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; transition: transform var(--gm-dur) var(--gm-ease); }
.nm-kd-tile__label { font-family: var(--gm-font-display); font-weight: 600; font-size: 17px; line-height: 1.1; }
.nm-kd-tile__sub { font-size: 12.5px; opacity: .85; }
.nm-kd-tile[aria-pressed="true"] { outline: 3px solid var(--gm-ink); outline-offset: 2px; transform: translateY(-2px); }

/* Drawer dividers in a recessed tan tray */
.nm-kd__drawer { background: #d9d2c5; border-radius: var(--gm-radius-md); padding: 10px; box-shadow: inset 0 2px 8px rgba(0,0,0,.18); display: grid; gap: 6px; }
.nm-kd-divider { display: flex; align-items: center; gap: 10px; min-height: 52px; background: #fff; border-radius: 3px; padding: 0 12px; text-decoration: none; color: var(--gm-ink); box-shadow: var(--gm-shadow-sm); }
.nm-kd-divider.is-active { outline: 2px solid var(--gm-ink); }
.nm-kd-divider__tab { font-family: var(--gm-font-display); font-weight: 700; font-size: 13px; color: #fff; padding: 4px 8px; border-radius: 2px; min-width: 28px; text-align: center; }
.nm-kd-divider__name { font-family: var(--gm-font-display); font-weight: 600; }
.nm-kd-divider__count { margin-left: auto; font-size: 12px; color: var(--gm-grey-400); }

/* "Stuck on most fridges" rail */
.nm-kd__rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.nm-kd-mini { position: relative; flex: 0 0 200px; scroll-snap-align: start; background: #fff; border: 1px solid var(--gm-grey-200); border-radius: var(--gm-radius-md); padding: 16px 14px 14px; text-decoration: none; color: inherit; box-shadow: var(--gm-shadow-card); }
.nm-kd-mini .nm-magnet { position: absolute; top: -8px; left: 14px; }
.nm-kd-mini__name { display: block; font-family: var(--gm-font-display); font-weight: 600; font-size: 16px; }
.nm-kd-mini__count { display: block; font-size: 12px; color: var(--gm-grey-400); margin-top: 4px; }

/* Results head + filters */
.nm-kd__resultshead { display: flex; align-items: baseline; justify-content: space-between; margin-top: 28px; }
.nm-kd__summary { font-size: 13px; color: var(--gm-grey-400); }
.nm-kd__filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; }
.nm-kd-filter { white-space: nowrap; min-height: 44px; }

/* Results grid */
.nm-kd__results { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* Business card */
.nm-kd-card { position: relative; background: #fff; border-radius: var(--gm-radius-md); box-shadow: var(--gm-shadow-card); overflow: hidden; transform: rotate(-0.6deg); }
.nm-kd-card:nth-child(even) { transform: rotate(0.6deg); }
.nm-kd-card__strip { height: 8px; background: var(--accent, var(--gm-raspberry)); }
.nm-kd-card__open { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 14px 16px 10px; cursor: pointer; }
.nm-kd-card__top { display: flex; gap: 12px; align-items: center; }
.nm-kd-card__thumb { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.nm-kd-card__thumb--blank { background: var(--gm-grey-050); display: block; }
.nm-kd-card__name { display: block; font-family: var(--gm-font-display); font-weight: 600; font-size: 22px; line-height: 1.05; }
.nm-kd-card__kind { display: block; font-size: 13px; color: var(--gm-grey-400); margin-top: 2px; }
.nm-kd-card__status { display: inline-block; margin-top: 10px; font-family: var(--gm-font-display); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: var(--gm-ls-wide); padding: 4px 9px; border-radius: 999px; background: var(--gm-grey-050); color: var(--gm-grey-700); }
.nm-kd-card__status.is-open { background: #EAF5EE; color: #1E5B38; }
.nm-kd-card__status.is-closed { background: var(--gm-grey-050); color: var(--gm-grey-400); }
.nm-kd-card__quote { font-size: 14.5px; font-weight: 300; margin: 10px 0 0; }
.nm-kd-card__facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nm-kd-card__fact { font-size: 11.5px; background: var(--gm-grey-050); border-radius: 2px; padding: 3px 7px; }
.nm-kd-card__mumscard { display: inline-block; margin: 10px 16px 0; font-family: var(--gm-font-display); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: var(--gm-ls-wide); background: var(--gm-yellow); color: var(--gm-ink); padding: 4px 9px; border-radius: 2px; }
.nm-kd-card__actions { display: flex; align-items: stretch; border-top: 1px dashed var(--gm-grey-200); margin-top: 12px; }
.nm-kd-card__action { flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; font-family: var(--gm-font-display); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: var(--gm-ls-wide); text-decoration: none; color: var(--gm-ink); background: #fff; border: 0; border-left: 1px dashed var(--gm-grey-200); cursor: pointer; }
.nm-kd-card__action:first-child { border-left: 0; }
.nm-kd-card__action[aria-pressed="true"] { background: var(--gm-raspberry); color: #fff; }

/* Empty state */
.nm-kd__empty { margin-top: 16px; }

/* Desktop panel (hidden until D4) */
.nm-kd__panel { display: none; }
.nm-kd__panel-empty { color: var(--gm-grey-400); padding: 24px; text-align: center; }

/* Recommend band */
.nm-kd__recommend { margin-top: 48px; padding: 40px 0; }

/* ----- D3 single listing ----- */
.nm-listing__hero { position: relative; height: 220px; overflow: hidden; background: var(--gm-grey-050); }
.nm-listing__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nm-listing__back { position: absolute; top: 16px; left: 16px; width: 44px; height: 44px; border-radius: 999px; background: #fff; display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--gm-ink); box-shadow: var(--gm-shadow-md); font-size: 20px; }
.nm-listing__body { padding-bottom: 96px; }
.nm-listing__card { position: relative; background: #fff; border-radius: var(--gm-radius-md); box-shadow: var(--gm-shadow-lg); padding: 24px; margin-top: -56px; transform: rotate(-1deg); border-top: 8px solid var(--accent, var(--gm-raspberry)); }
.nm-listing__magnet { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; }
.nm-listing__name { font-family: var(--gm-font-display); font-weight: 700; font-size: 32px; text-transform: uppercase; line-height: 1.05; margin: 8px 0 2px; }
.nm-listing__kind { color: var(--gm-grey-400); margin: 0; }

/* Hours bar */
.nm-hours { margin-top: 16px; }
.nm-hours__track { position: relative; height: 12px; background: var(--gm-grey-050); border-radius: 6px; }
.nm-hours__open { position: absolute; top: 0; height: 100%; background: var(--gm-success); border-radius: 6px; }
.nm-hours__now { position: absolute; top: -3px; width: 2px; height: 18px; background: var(--gm-raspberry); }
.nm-hours__now::after { content: "Now"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; font-family: var(--gm-font-display); text-transform: uppercase; color: var(--gm-raspberry); }
.nm-hours__labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--gm-grey-400); margin-top: 4px; }

.nm-listing__lowdown { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nm-listing__fact { background: #fff; border: 1px solid var(--gm-grey-200); border-radius: var(--gm-radius-md); padding: 14px 16px; }
.nm-listing__fact-label { display: block; font-size: 12px; color: var(--gm-grey-400); }
.nm-listing__fact-value { display: block; font-family: var(--gm-font-display); font-weight: 600; font-size: 17px; text-transform: uppercase; }
.nm-listing__quote { background: #fff; border: 1px solid var(--gm-grey-200); border-left: 4px solid var(--gm-yellow); border-radius: var(--gm-radius-md); padding: 20px; margin-top: 24px; }
.nm-listing__quote p { font-family: var(--gm-font-display); font-weight: 500; font-size: 21px; color: var(--gm-raspberry); margin: 0; }
.nm-listing__quote cite { color: var(--gm-grey-400); font-style: normal; font-size: 14px; }
.nm-listing__coupon { display: flex; margin-top: 24px; background: var(--gm-yellow); border-radius: var(--gm-radius-md); overflow: hidden; }
.nm-listing__coupon-body { padding: 16px 20px; flex: 1; }
.nm-listing__coupon-edge { writing-mode: vertical-rl; text-orientation: mixed; padding: 10px; border-left: 2px dashed rgba(34,34,34,.4); font-family: var(--gm-font-display); font-weight: 600; text-transform: uppercase; letter-spacing: var(--gm-ls-wide); font-size: 12px; display: flex; align-items: center; }
.nm-listing__tips { padding-left: 0; list-style: none; }
.nm-listing__tips li { position: relative; padding-left: 18px; margin: 6px 0; }
.nm-listing__tips li::before { content: ""; position: absolute; left: 0; top: 8px; width: 9px; height: 9px; background: var(--gm-raspberry); }
.nm-listing__address { padding: 16px; margin-top: 24px; }
.nm-listing__checked { font-size: 12px; color: var(--gm-grey-400); margin-top: 8px; }
.nm-listing__bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 55; background: #fff; border-top: 1px solid var(--gm-grey-200); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; }

/* ----- D5 tablet (768-1199px): split + situations 4x2 ----- */
@media (min-width: 768px) {
	.nm-kd__situations { grid-template-columns: repeat(4, 1fr); }
}

/* ----- D4 desktop (>=1200px): 3 columns ----- */
@media (min-width: 1200px) {
	.nm-kd__cols { display: grid; grid-template-columns: 320px minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
	.nm-kd__aside { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
	.nm-kd__situations { grid-template-columns: 1fr 1fr; }
	.nm-kd__results { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
	.nm-kd__panel { display: block; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; background: #fff; border: 1px solid var(--gm-grey-200); border-radius: var(--gm-radius-md); box-shadow: var(--gm-shadow-card); }
	/* On desktop the single listing's sticky bar sits inside the panel instead */
	.nm-kd__panel .nm-listing__bar { position: static; border-top: 1px dashed var(--gm-grey-200); }
	.nm-kd__panel .nm-listing__hero { height: 200px; border-radius: var(--gm-radius-md) var(--gm-radius-md) 0 0; }
	.nm-kd__panel .nm-listing__card { margin-top: -40px; transform: none; }
	.nm-kd__panel .nm-listing__body { padding: 0 16px 16px; }
}

/* Reduced motion: no tilt */
@media (prefers-reduced-motion: reduce) {
	.nm-kd-card, .nm-kd-card:nth-child(even), .nm-listing__card { transform: none; }
	.nm-kd-tile[aria-pressed="true"] { transform: none; }
}
