/* Public hubs, ingredient pages and search (public/fk/pub-hub.php,
   pub-ingredient.php, pub-search.php). Tokens only; both themes come
   from app.css. Mockups: FkPubHub, FkPubHubLow, FkPubIngredient,
   FkPubSearch, FkPubNoResults. */

.fkh { display: flex; flex-direction: column; gap: clamp(32px, 5vw, 56px); padding-top: clamp(12px, 2vw, 24px); padding-bottom: clamp(48px, 7vw, 96px); }
.fkh-sec { display: flex; flex-direction: column; gap: var(--s-8); min-width: 0; }
.fkh-cap { font-family: var(--f-body); font-size: 0.875rem; font-weight: 600; color: var(--c-text-2); }

/* --- Head ---------------------------------------------------- */
.fkh-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-12) var(--s-24); }
.fkh-head__copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-6); }
.fkh-h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.015em; max-width: 14ch; text-wrap: balance; }
.fkh-h1--sm { font-size: clamp(2rem, 4.5vw, 3.25rem); max-width: none; }
.fkh-lede { font-size: clamp(1rem, 1.3vw, 1.125rem); line-height: 1.55; color: var(--c-text-2); max-width: 56ch; }
.fkh-read { flex: 0 1 420px; min-width: 0; }

.fkh-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; font-size: 0.875rem; color: var(--c-text-2); }
.fkh-crumbs li { display: inline-flex; align-items: center; }
.fkh-crumbs li + li::before { content: "/"; padding: 0 var(--s-4); color: var(--c-text-3); }
.fkh-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text-2); }
.fkh-crumbs a:hover { color: var(--c-text); text-decoration: underline; text-underline-offset: 3px; }
.fkh-crumbs [aria-current] { color: var(--c-text); }

/* --- Search box and paste box -------------------------------- */
.fkh-search { flex: 1 1 380px; max-width: 560px; }
.fkh-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.fkh-search__clear { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: var(--r-full); color: var(--c-text-2); }
.fkh-search__clear:hover { background: var(--c-surface); color: var(--c-text); }
.fkh-paste { max-width: 560px; }
.fkh-fine { font-size: 0.8125rem; color: var(--c-text-3); }

/* --- Hub tiles on /recipes ----------------------------------- */
.fkh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-8); }
.fkh-tile { display: block; border-radius: var(--r-md); }
.fkh-tile__shot { aspect-ratio: 4 / 3; }
.fkh-tile__body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-8); display: flex; flex-direction: column; gap: 2px; }
.fkh-tile__body .g { font-size: 1.5rem; line-height: 1.1; color: var(--c-text); }
.fkh-tile__body.fk-onphoto .g { color: var(--c-on-photo); }
.fkh-tile__body .n { font-family: var(--f-num); font-stretch: 85%; font-variant-numeric: tabular-nums; font-size: 0.875rem; color: var(--c-text-2); }
.fkh-tile__body.fk-onphoto .n { color: var(--c-on-photo-2); }
.fkh-tile:hover img { transform: scale(1.03); }
.fkh-tile img, .fkh-card img, .fkh-feat__big img { transition: transform var(--dur-slow) var(--ease-expo); }
.fkh-tile:focus-visible, .fkh-card:focus-visible, .fkh-row:focus-visible, .fkh-feat__big:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

/* --- Feature -------------------------------------------------- */
.fkh-feat { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: var(--s-8); align-items: start; }
.fkh-feat__big { aspect-ratio: 16 / 10; border-radius: var(--r-xl); }
.fkh-feat__big:hover img { transform: scale(1.02); }
.fkh-feat__body { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(16px, 2.5vw, 28px); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); }
.fkh-feat__t { font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.04; text-wrap: balance; }
.fkh-feat__m { font-family: var(--f-num); font-stretch: 85%; font-size: 0.9375rem; color: var(--c-on-photo-2); }
.fkh-feat__side { display: flex; flex-direction: column; gap: var(--s-8); }

/* --- Recipe cards --------------------------------------------- */
.fkh-more__head { align-items: center; }
.fkh-sort { display: inline-flex; align-items: center; gap: var(--s-4); font-size: 0.875rem; }
.fkh-sort select {
  min-height: 44px; padding: 0 36px 0 16px; border-radius: var(--r-full);
  border: 0; box-shadow: inset 0 0 0 1px var(--c-ctl);
  background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--c-text); font: inherit; font-weight: 600; appearance: none; -webkit-appearance: none;
}
.fkh-sort select:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.fkh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-12) var(--s-8); }
.fkh-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; border-radius: var(--r-md); }
.fkh-card[hidden] { display: none; }
.fkh-card__shot { aspect-ratio: 4 / 3; margin-bottom: 4px; }
.fkh-card:hover img { transform: scale(1.03); }
.fkh-card__none { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: var(--s-8); background: var(--c-surface); }
.fkh-card__none span { font-size: 0.8125rem; color: var(--c-text-3); }
.fkh-card__none b { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; line-height: 1.12; color: var(--c-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fkh-card__t { font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--c-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fkh-card:hover .fkh-card__t { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fkh-card__m, .fkh-row__m { font-family: var(--f-num); font-stretch: 85%; font-variant-numeric: tabular-nums; font-size: 0.875rem; color: var(--c-text-2); }
.fkh-moreb { display: flex; justify-content: center; padding-top: var(--s-8); }
.fkh-moreb[hidden] { display: none; }

/* --- Rows (feature side, ingredient list, search) ------------- */
.fkh-rows { display: flex; flex-direction: column; }
.fkh-row { display: flex; gap: var(--s-8); align-items: center; padding: var(--s-6) 0; border-bottom: 1px solid var(--c-border); min-width: 0; }
.fkh-row[hidden] { display: none; }
.fkh-row--feat { border-bottom: 0; padding: 0; }
.fkh-row__shot { width: 132px; aspect-ratio: 1; flex: none; }
.fkh-row--feat .fkh-row__shot { width: 140px; }
.fkh-row:hover img { transform: scale(1.04); }
.fkh-row img { transition: transform var(--dur-slow) var(--ease-expo); }
.fkh-row__none { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: var(--s-6); font-family: var(--f-display); font-size: 1rem; line-height: 1.15; color: var(--c-text-2); }
.fkh-row__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fkh-row__t { font-family: var(--f-display); font-size: 1.375rem; line-height: 1.12; color: var(--c-text); text-wrap: balance; }
.fkh-row:hover .fkh-row__t { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.fkh-row__note { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--c-text-2); }
.fkh-row__note--have { color: var(--c-sage); }
.fkh-row__note--need { color: var(--c-ember); }

/* --- Bottom: narrow it down + CTA ----------------------------- */
.fkh-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: var(--s-16) clamp(32px, 6vw, 96px); align-items: start; border-top: 1px solid var(--c-border); padding-top: clamp(32px, 5vw, 56px); }
.fkh-narrow { display: flex; flex-direction: column; gap: var(--s-4); }
.fkh-narrow__a { display: flex; align-items: center; justify-content: space-between; gap: var(--s-8); min-height: 52px; border-bottom: 1px solid var(--c-border); color: var(--c-text); }
.fkh-narrow__a:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.fkh-narrow__a .n { font-family: var(--f-num); font-stretch: 85%; font-variant-numeric: tabular-nums; color: var(--c-text-2); }
.fkh-cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-6); padding: var(--s-12); border-radius: var(--r-xl); background: var(--c-surface); }
.fkh-cta__t { font-size: 1.75rem; line-height: 1.08; }
.fkh-cta p { color: var(--c-text-2); line-height: 1.5; }
.fkh-cta__dots { display: inline-flex; gap: 5px; }
.fkh-cta__dots i { width: 10px; height: 10px; border-radius: 999px; background: var(--c-sage); }
.fkh-cta__dots i.half { background: linear-gradient(90deg, var(--c-sage) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--c-sage); }
.fkh-cta__dots i.need { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-ember); }

/* --- Know a good one (paste panels) -------------------------- */
.fkh-know { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-8) var(--s-16); }
.fkh-know--row > div { flex: 1 1 320px; }
.fkh-know > div { min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.fkh-know--row { padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--c-border); }
.fkh-know--panel { flex-direction: column; align-items: stretch; gap: var(--s-6); padding: clamp(20px, 3vw, 32px); border-radius: var(--r-xl); background: var(--c-surface); }
.fkh-know--panel .fk-paste { background: var(--c-bg); max-width: none; }
.fkh-split .fkh-know--panel { align-self: start; }

/* --- Ingredient page ----------------------------------------- */
.fkh-ing__cols { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--s-16) clamp(32px, 5vw, 72px); align-items: start; }
.fkh-have { position: sticky; top: var(--s-12); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-6); padding: var(--s-12); border-radius: var(--r-xl); background: var(--c-surface); }
.fkh-have .fk-chip { background: var(--c-bg); }
.fkh-have .fk-chip[aria-pressed="true"] { background: var(--c-text); }
.fkh-have__plus { font-size: 0.875rem; color: var(--c-text-3); }
.fkh-ing__list { display: flex; flex-direction: column; gap: var(--s-16); min-width: 0; }
.fkh-ing__list > section { display: flex; flex-direction: column; gap: var(--s-4); }
.fkh-ing__list > section[hidden] { display: none; }

.fkh-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-width: 760px; }
.fkh-bars li { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; align-items: center; gap: var(--s-8); min-height: 48px; border-bottom: 1px solid var(--c-border); }
.fkh-bars a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text); }
.fkh-bars a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fkh-bars__bar { height: 6px; border-radius: 999px; background: var(--c-surface-hi); overflow: hidden; }
.fkh-bars__bar i { display: block; height: 100%; border-radius: inherit; background: var(--c-accent); }
.fkh-bars .n { font-family: var(--f-num); font-stretch: 85%; font-variant-numeric: tabular-nums; font-size: 0.875rem; color: var(--c-text-2); white-space: nowrap; }

/* --- Search -------------------------------------------------- */
.fkh-srch__head { flex-direction: column; align-items: stretch; gap: var(--s-8); }
.fkh-srch__head .fkh-search { flex: none; max-width: 720px; }
.fkh-srch__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: var(--s-16) clamp(32px, 5vw, 72px); align-items: start; }
.fkh-srch__main { display: flex; flex-direction: column; gap: var(--s-8); min-width: 0; max-width: 820px; }
.fkh-srch__count { font-size: 0.875rem; font-weight: 600; color: var(--c-text-2); }
.fkh-srch__aside { position: sticky; top: var(--s-12); }
.fkh-match { display: flex; align-items: center; gap: var(--s-8); padding: var(--s-8) var(--s-10); border-radius: var(--r-lg); background: var(--c-surface); color: var(--c-text); min-height: 64px; }
.fkh-match > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fkh-match b { font-weight: 600; }
.fkh-match .fk-mut { font-size: 0.875rem; }
.fkh-match__ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-full); background: var(--c-surface-hi); color: var(--c-accent); flex: none; }
.fkh-match:hover { background: var(--c-surface-hi); }
.fkh-cook { min-height: 56px; color: var(--c-text); }

/* --- Narrow screens ------------------------------------------ */
@media (max-width: 960px) {
  .fkh-feat, .fkh-split, .fkh-ing__cols, .fkh-srch__cols { grid-template-columns: minmax(0, 1fr); }
  .fkh-have, .fkh-srch__aside { position: static; }
  .fkh-read { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .fkh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-10) var(--s-6); }
  .fkh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
  .fkh-tile__body { padding: var(--s-6); }
  .fkh-tile__body .g { font-size: 1.25rem; }
  .fkh-card__none b { font-size: 1.0625rem; }
  .fkh-row__shot, .fkh-row--feat .fkh-row__shot { width: 96px; }
  .fkh-row__t { font-size: 1.1875rem; }
  .fkh-feat__big { aspect-ratio: 4 / 5; }
  .fkh-have { padding: var(--s-8); }
  .fkh-bars li { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) auto; gap: var(--s-6); }
  .fkh-paste .btn, .fkh-search .btn { padding: 0 var(--s-8); }
  .fkh-search .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fkh-tile img, .fkh-card img, .fkh-feat__big img, .fkh-row img { transition: none; transform: none !important; }
}
.fkh-facets .fk-chip { flex: none; white-space: nowrap; }
