/* Discover (fk/discover.php), cook pages (fk/cook.php) and the
   post-a-plate sheet (js/fk-post.js). Matches FkWebDiscover,
   FkWebProfile and FkPost. */

/* --- Challenge hero ----------------------------------------- */
.fk-dsc__hero {
  min-height: 440px;
  border-radius: var(--r-md);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.fk-dsc__hero > img { object-position: 50% 65%; }
.fk-dsc__hero--nocover { background: var(--c-veil-deep); }
.fk-dsc__hero--nocover { min-height: 300px; }
.fk-dsc__heroin {
  position: relative;
  padding: clamp(20px, 3.5vw, 48px);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px 48px;
}
.fk-dsc__herocopy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fk-dsc__kicker { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; }
.fk-dsc__htitle { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1; }
.fk-dsc__hdesc { max-width: 52ch; color: var(--c-on-photo-2); font-size: 1.0625rem; line-height: 1.55; }
.fk-dsc__prize { font-size: 0.9375rem; color: var(--c-on-photo); }
.fk-dsc__heroside { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.fk-dsc__entrants { display: flex; align-items: center; gap: 12px; font-size: 0.9375rem; color: var(--c-on-photo-2); }
.fk-dsc__entrants .n { color: var(--c-on-photo); }
.fk-dsc__ghostphoto { background: transparent; color: var(--c-on-photo); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--c-on-photo) 40%, transparent); }
.fk-dsc__ghostphoto:hover { background: var(--c-veil); }
/* No challenge running: a quiet panel instead of a photo */
.fk-dsc__hero--plain {
  min-height: 0; justify-content: flex-start; gap: var(--s-8);
  padding: clamp(20px, 3vw, 40px); background: var(--c-surface); border-radius: var(--r-xl);
}
.fk-dsc__hero--plain .fk-dsc__htitle { font-size: clamp(2rem, 3.6vw, 3rem); }

/* --- Columns ------------------------------------------------ */
.fk-dsc__cols { display: flex; flex-wrap: wrap; gap: 56px; }
.fk-dsc__feed { flex: 3 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.fk-dsc__aside { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.fk-dsc__morewrap:empty { display: none; }
.fk-dsc__empty { grid-column: 1 / -1; }

/* --- Post card ---------------------------------------------- */
.fk-dsc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px 28px; }
.fk-dsc__post { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fk-dsc__head { display: flex; align-items: center; gap: 10px; }
.fk-dsc__byline { flex: 1; min-width: 0; font-size: 0.875rem; line-height: 1.3; }
.fk-dsc__byline .n { font-size: 0.8125rem; }
.fk-dsc__who { font-weight: 600; }
.fk-dsc__who:hover { text-decoration: underline; text-underline-offset: 3px; }
.fk-dsc__rating { display: inline-flex; align-items: center; gap: 4px; color: var(--c-accent); }
.fk-dsc__more {
  width: 44px; height: 44px; margin-right: -10px;
  display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: var(--r-full); background: none; color: var(--c-text-2); cursor: pointer;
}
.fk-dsc__more:hover { background: var(--c-surface); color: var(--c-text); }
.fk-dsc__more--inline { width: 36px; height: 36px; margin: -8px -8px -8px auto; }
.fk-dsc__shot { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
.fk-dsc__shot img { transition: transform var(--dur-slow) var(--ease-out); }
.fk-dsc__shot:hover img { transform: scale(1.02); }
.fk-dsc__chtag { position: absolute; left: 10px; top: 10px; }
.fk-dsc__vis { position: absolute; right: 10px; top: 10px; }
.fk-dsc__title { font-size: 1.3125rem; line-height: 1.15; }
.fk-dsc__title:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.fk-dsc__note { font-size: 0.9375rem; color: var(--c-text-2); line-height: 1.5; }
.fk-dsc__acts { display: flex; align-items: center; gap: 8px; }
.fk-dsc__acts .btn--sm { min-height: 44px; padding: 0 16px; }
.fk-dsc__like { background: var(--c-surface-hi); color: var(--c-text); border-color: transparent; }
.fk-dsc__like:hover { background: var(--c-surface-max); }
.fk-dsc__like[aria-pressed="true"] { color: var(--c-accent); }
.fk-dsc__like[aria-pressed="true"] svg { fill: currentColor; }
.fk-dsc__have { margin-left: auto; font-size: 0.875rem; color: var(--c-text-2); white-space: nowrap; }
.fk-dsc__have .n { color: var(--c-text); }

/* Compact tile (cook page grid, collections) */
.fk-dsc__tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fk-dsc__tileshot { aspect-ratio: 1 / 1; border-radius: var(--r-md); }
.fk-dsc__tileshot.fk-shot--empty { display: grid; place-items: center; }
.fk-dsc__tiletitle { font-size: 1.125rem; line-height: 1.15; }
.fk-dsc__tilemeta { display: flex; align-items: center; gap: 4px; font-size: 0.8125rem; }
.fk-dsc__tilemeta .n { color: var(--c-text); }

/* Menu rows inside a sheet */
.fk-dsc__menuitem {
  width: 100%; min-height: 56px;
  display: flex; align-items: center; gap: 14px;
  border: 0; border-top: 1px solid var(--c-border); background: none;
  font: inherit; font-size: 1rem; color: var(--c-text); text-align: left; cursor: pointer;
}
.fk-dsc__menuitem svg { color: var(--c-text-2); }
.fk-dsc__menuitem:hover { color: var(--c-accent); }
.fk-dsc__menuitem--danger, .fk-dsc__menuitem--danger svg { color: var(--c-error); }

/* --- Aside -------------------------------------------------- */
.fk-dsc__trend { display: flex; flex-direction: column; }
.fk-dsc__trendlist { list-style: none; margin: 0; padding: 0; }
.fk-dsc__trendrow {
  display: grid; grid-template-columns: 28px 56px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  min-height: 76px; padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
}
.fk-dsc__rank { font-size: 1.25rem; }
.fk-dsc__trendtxt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.fk-dsc__trendtxt .g { font-size: 1.0625rem; }
.fk-dsc__trendtxt .n { font-size: 0.8125rem; font-weight: 500; }
.fk-dsc__trendrow:hover .g { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fk-dsc__trend > .fk-link { align-self: flex-start; }
.fk-dsc__cooks { display: flex; flex-direction: column; gap: 6px; }
.fk-dsc__cook { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; border-top: 1px solid var(--c-border); }
.fk-dsc__cooktxt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.fk-dsc__cooktxt .fk-mut { font-size: 0.8125rem; }
.fk-dsc__cook .btn[aria-pressed="true"] { color: var(--c-text-2); }
.fk-dsc__share { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--c-surface); line-height: 1.4; }
.fk-dsc__share > svg:first-child { color: var(--c-accent); flex: none; }
.fk-dsc__share > span { flex: 1; }
.fk-dsc__share strong { font-weight: 600; }
.fk-dsc__share:hover { background: var(--c-surface-hi); }

/* --- Cook page ---------------------------------------------- */
.fk-cook__head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.fk-cook__head > .fk-av { box-shadow: inset 0 0 0 4px var(--pc), 0 0 0 2px var(--c-bg); }
.fk-cook__id { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fk-cook__name { font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1; }
.fk-cook__id p { font-size: 1.0625rem; max-width: 60ch; }
.fk-cook__acts { display: flex; align-items: center; gap: 10px; }
.fk-cook__body { display: flex; flex-direction: column; gap: clamp(32px, 4vw, 48px); }
.fk-cook__read { max-width: 840px; }
.fk-cook__private { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fk-cook__private > span:nth-child(2) { flex: 1 1 320px; }
.fk-cook__private > span:first-child { color: var(--c-text-2); }
.fk-cook__cols { display: flex; flex-wrap: wrap; gap: 56px; }
.fk-cook__main { flex: 3 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.fk-cook__badges { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fk-cook__tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--c-border-hi); overflow-x: auto; scrollbar-width: none; }
.fk-cook__tab {
  min-height: 48px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.9375rem; color: var(--c-text-2); white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.fk-cook__tab[aria-selected="true"] { color: var(--c-text); box-shadow: inset 0 -2px 0 var(--c-accent); }
.fk-cook__tab .n { color: var(--c-text); }
.fk-cook__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px 20px; }
.fk-cook__badge { align-items: center; }
.fk-cook__medal { width: 48px; height: 48px; border-radius: var(--r-full); display: grid; place-items: center; flex: none; color: var(--c-accent); box-shadow: inset 0 0 0 1.5px var(--c-accent); }
/* The badges aside carries them on wide screens; the tab covers phones. */
@media (min-width: 1000px) { .fk-cook__tab--narrow { display: none; } }
@media (max-width: 999px) { .fk-cook__badges { display: none; } }

/* --- Post sheet --------------------------------------------- */
.fk-post { display: flex; flex-direction: column; gap: var(--s-8); }
.fk-post__drop { aspect-ratio: 16 / 9; border-radius: var(--r-lg); cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--c-border-hi); }
.fk-post__drop:hover, .fk-post__drop:focus-visible { box-shadow: inset 0 0 0 1px var(--c-accent); outline: none; }
.fk-post__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--c-text-2); text-align: center; padding: var(--s-8); }
.fk-post__empty svg { color: var(--c-accent); }
.fk-post__empty[hidden] { display: none; }
.fk-post__change { position: absolute; right: 10px; bottom: 10px; }
.fk-post__stars { display: flex; gap: 2px; margin-left: -6px; }
.fk-post__stars button { width: 52px; height: 52px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--c-ctl); cursor: pointer; }
.fk-post__stars[data-rating="1"] [data-n="1"],
.fk-post__stars[data-rating="2"] :is([data-n="1"], [data-n="2"]),
.fk-post__stars[data-rating="3"] :is([data-n="1"], [data-n="2"], [data-n="3"]),
.fk-post__stars[data-rating="4"] button:not([data-n="5"]),
.fk-post__stars[data-rating="5"] button { color: var(--c-accent); }
.fk-post__stars[data-rating="1"] [data-n="1"] svg,
.fk-post__stars[data-rating="2"] :is([data-n="1"], [data-n="2"]) svg,
.fk-post__stars[data-rating="3"] :is([data-n="1"], [data-n="2"], [data-n="3"]) svg,
.fk-post__stars[data-rating="4"] button:not([data-n="5"]) svg,
.fk-post__stars[data-rating="5"] svg { fill: currentColor; }
.fk-post__stars button:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -4px; border-radius: var(--r-md); }
.fk-post__vis { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fk-post__vis legend { padding-bottom: 6px; }
.fk-post__vis label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--c-border); cursor: pointer; }
.fk-post__vis label > span { display: flex; flex-direction: column; line-height: 1.3; }
.fk-post__vd { font-size: 0.8125rem; }
.fk-post__vis input { width: 22px; height: 22px; accent-color: var(--c-accent); flex: none; }
.fk-post__vis label:has(input:checked) .fk-post__vl { font-weight: 600; }
.fk-post__public { display: flex; flex-direction: column; gap: 10px; padding: var(--s-8); border-radius: var(--r-lg); background: var(--c-surface); }
.fk-post__public[hidden] { display: none; }
.fk-post__search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: var(--r-full); box-shadow: inset 0 0 0 1px var(--c-ctl); color: var(--c-text-2); }
.fk-post__search:focus-within { box-shadow: inset 0 0 0 2px var(--c-accent); }
.fk-post__search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--c-text); }
.fk-post__pick { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 72px; border: 0; border-top: 1px solid var(--c-border); background: none; color: var(--c-text); text-align: left; cursor: pointer; font: inherit; }
.fk-post__pick > span:nth-child(2) { display: flex; flex-direction: column; }
.fk-post__pick svg { color: var(--c-text-3); }
.fk-post__pick:hover .fk-post__picktitle { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fk-post__picktitle { font-size: 1.0625rem; line-height: 1.2; }

@media (max-width: 640px) {
  .fk-dsc__hero { min-height: 480px; }
  .fk-dsc__hero--plain { min-height: 0; }
  .fk-dsc__cols, .fk-cook__cols { gap: 40px; }
  .fk-dsc__grid { grid-template-columns: 1fr; }
  .fk-cook__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .fk-cook__head { gap: 16px; }
  .fk-cook__head > .fk-av { --sz: 80px !important; }
  .fk-cook__acts { width: 100%; }
}
@media (max-width: 640px) {
  .fk-dsc__hero--nocover { min-height: 0; padding-top: var(--s-16); }
  .fk-dsc__scopes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .fk-dsc__scopes::-webkit-scrollbar { display: none; }
  .fk-dsc__scopes .fk-chip { flex: none; }
}
@media (max-width: 640px) {
  /* The copy covers most of a phone-sized photo; give it a solid floor. */
  .fk-dsc__hero:not(.fk-dsc__hero--nocover) { min-height: 560px; }
  .fk-dsc__hero .fk-dsc__heroin { background: linear-gradient(to top, var(--c-veil-deep) 62%, color-mix(in oklch, var(--c-veil-deep) 0%, transparent)); padding-top: 72px; }
}

/* Share dialog (FkPost.share, board FkShare). */
.fk-share { display: flex; flex-direction: column; gap: var(--s-8); }
.fk-share__card { display: flex; flex-direction: column; border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; }
.fk-share__img { display: block; height: 170px; border-radius: 0; background: var(--c-surface-hi); }
.fk-share__img img { width: 100%; height: 100%; object-fit: cover; }
.fk-share__txt { display: flex; flex-direction: column; gap: 2px; padding: var(--s-6) var(--s-8); background: var(--c-surface-hi); min-width: 0; }
.fk-share__host { font-size: 0.8125rem; font-weight: 600; }
.fk-share__title { font-size: 1.25rem; line-height: 1.2; font-weight: 400; }
.fk-share__link .input { width: 100%; font-size: 0.9375rem; color: var(--c-text-2); }
.fk-share__acts { display: flex; gap: var(--s-4); }
.fk-share__acts .btn { flex: 1; justify-content: center; }
.fk-share__note { display: flex; gap: var(--s-6); margin: 0; padding: var(--s-6) var(--s-8); border-radius: var(--r-md); background: var(--c-surface-hi); }
.fk-share__note > svg { flex: none; color: var(--c-text-2); margin-top: 2px; }
.fk-share__note > span { display: flex; flex-direction: column; gap: 2px; font-size: 0.9375rem; }

/* Challenge view (?challenge=slug, board FkChallenge). */
.fk-dsc__chinfo[hidden] { display: none; }
.fk-dsc__chinfo { display: flex; flex-direction: column; gap: var(--s-8); padding-bottom: var(--s-12); border-bottom: 1px solid var(--c-border); }
.fk-dsc__chname { display: flex; align-items: center; gap: var(--s-4); font-size: 1.625rem; font-weight: 400; margin: 0; }
.fk-dsc__chname svg { color: var(--c-accent); }
.fk-dsc__chdates { margin: 0; }
.fk-dsc__chread { max-width: 560px; }
.fk-dsc__how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fk-dsc__how li { display: flex; align-items: center; gap: var(--s-6); min-height: 44px; border-top: 1px solid var(--c-border); color: var(--c-text-2); }
.fk-dsc__how li:last-child { border-bottom: 1px solid var(--c-border); }
.fk-dsc__how svg { flex: none; color: var(--c-text-3); }

/* Public challenge page (fk/challenge.php). */
.fk-chpub { display: flex; flex-direction: column; gap: var(--s-16); padding-bottom: var(--s-32); }
.fk-chpub__cols { display: flex; flex-wrap: wrap; gap: var(--s-24); }
.fk-chpub__main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-10); }
.fk-chpub__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-16); }
.fk-chpub__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-12) var(--s-8); }
.fk-chpub__rank { position: absolute; left: 8px; top: 8px; }
.fk-chpub__likes { display: inline-flex; align-items: center; gap: 4px; }
.fk-chpub__join { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); padding: var(--s-12); }
.fk-chpub__join .fk-link { min-height: 44px; display: inline-flex; align-items: center; }
.fk-chpub .fk-dsc__tilemeta a { color: inherit; }
