/* ==========================================================================
   COCAMOO — COMMUNITY (round 11, part 2, Nov 12; app/lib/community.php)
   Loaded on a community recipe (/c/<id>, pages/community-recipe.php) and
   on a person's own recipe (/my/<id>), where they share it. The recipe
   page itself is recipe.css; the sheets build on base.css's .un-sheet.

   SECTIONS
     1. A community recipe: who shared it, the rating line, the photo
     2. The cook's own card (P8)
     3. The share sheet (P6) and the can't-share sheet (P7)
     4. The report sheet
   ========================================================================== */

/* ==========================================================================
   1. A COMMUNITY RECIPE (P3, P4)
   ========================================================================== */
.community-by { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; color: var(--muted); }
.community-by b { color: var(--ink); font-weight: 700; }
.community-by-avatar { position: relative; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--plum-button); color: var(--white); font: 700 13px var(--font-body); }
.community-by-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.community-rating { margin-top: 8px; font-size: 15px; }
.community-rating a { color: var(--plum-text); font-weight: 600; }
.community-rating a:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-photo { position: relative; }
.community-photo .recipe-hero { height: auto; }
.community-photo-cap { position: absolute; left: 14px; bottom: 12px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); font-size: 13px; font-weight: 600; color: var(--ink); }
.community-admin-note { margin: 0 0 12px; padding: 10px 16px; border-radius: var(--r-4); background: var(--note); color: var(--ink); font-weight: 600; }

/* ==========================================================================
   2. THE COOK'S OWN CARD (P8): under the head on /my/<id>
   ========================================================================== */
.community-mine { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; margin: 4px 0 18px; padding: 16px 18px; border-radius: var(--r-5); background: var(--card); box-shadow: var(--raise); }
.community-mine-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--well-bg); box-shadow: var(--well); color: var(--plum-icon); }
.community-mine-ic svg { width: 21px; height: 21px; }
.community-mine.is-waiting .community-mine-ic, .community-mine.is-private .community-mine-ic, .community-mine.is-hidden .community-mine-ic { color: var(--muted); }
.community-mine-h { font: 700 17px/1.3 var(--font-display); }
.community-mine-sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
.community-mine-sub a { color: var(--plum-text); font-weight: 600; }
.community-mine-counts { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.community-mine-notes { grid-column: 1 / -1; position: relative; display: grid; gap: 6px; margin: 10px 0 0; padding: 12px 52px 12px 14px; list-style: none; border-radius: var(--r-4); background: var(--well-bg); box-shadow: var(--well); font-size: 15px; }
.community-mine-x { position: absolute; top: 6px; right: 6px; }
.community-mine-x .round-btn { width: 36px; height: 36px; }
.community-mine-x .round-btn::before { content: ""; position: absolute; inset: -4px; } /* 44px to tap */

/* ==========================================================================
   3. THE SHARE SHEET (P6) AND "RECIPES FROM OTHER SITES STAY PRIVATE" (P7)
   ========================================================================== */
.community-sheet { gap: 14px; border: 0; z-index: 91; }
[data-share-scrim], [data-report-scrim] { z-index: 90; } /* over the recipe's sticky tools */
.share-lead { color: var(--muted); font-size: 15px; line-height: 1.5; }
.share-need { color: var(--plum-text); }
.share-photo-slot { position: relative; display: block; overflow: hidden; margin-top: 8px; border-radius: var(--r-4); background: var(--well-bg); box-shadow: var(--well); cursor: pointer; }
.share-photo-slot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.share-photo-slot img[hidden] { display: none; }
.share-photo-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; }
.share-photo-empty svg { width: 28px; height: 28px; color: var(--plum-icon); }
.share-photo-empty b { color: var(--plum-text); font-size: 16px; }
.share-photo.has-photo .share-photo-empty { display: none; }
.share-photo-change { display: none; position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); font-size: 14px; font-weight: 600; color: var(--ink); }
.share-photo.has-photo .share-photo-change { display: block; }
.share-photo-slot:focus-within { outline: 2px solid var(--plum-icon); outline-offset: 2px; }

.share-name { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.share-name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.share-field input { width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--well-bg); box-shadow: var(--well); color: var(--ink); font: 400 16px var(--font-body); }
.share-field input:focus { outline: none; box-shadow: var(--well), 0 0 0 2px var(--plum-icon); }
.share-optional { font-weight: 400; }
/* the three name forms: a segmented well (Library's look; library.css isn't on this page) */
.share-as { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--well-bg); box-shadow: var(--well); }
.share-as button { flex: 1 1 auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font: 600 15px var(--font-body); cursor: pointer; }
.share-as button:hover { color: var(--ink); }
.share-as button[aria-checked="true"] { background: var(--card); box-shadow: var(--raise); color: var(--plum-text); font-weight: 700; }
.share-hint { margin-top: -4px; font-size: 13px; color: var(--muted); }
.share-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.share-foot .btn { min-width: 110px; justify-content: center; }
.share-foot .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.un-sheet-error { color: var(--plum-text); font-size: 14px; font-weight: 600; }
.un-sheet-error[hidden] { display: none; }

/* ==========================================================================
   4. THE REPORT SHEET
   ========================================================================== */
.report-reasons { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; }
.report-reasons legend { margin-bottom: 6px; }
.report-reason { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; cursor: pointer; }
.report-reason input { position: absolute; opacity: 0; }
.report-dot { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--well-bg); box-shadow: var(--well), 0 0 0 1px var(--line); }
.report-reason input:checked + .report-dot { background: var(--plum-button); box-shadow: inset 0 0 0 5px var(--card), 0 0 0 1px var(--plum-icon); }
.report-reason input:focus-visible + .report-dot { outline: 2px solid var(--plum-icon); outline-offset: 2px; }

/* ==========================================================================
   5. THE COMMUNITY PAGE (part 3; P2, D1)
   The title and the two buttons, Cooks you follow, Following · Everyone ·
   Most made, then the cards (2 across on phones, 3 from 700px, 4 from 1200px).
   ========================================================================== */
.community-main { display: grid; gap: 24px; min-width: 0; }
.community-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.community-head .page-title { margin-bottom: 4px; }
.community-lead { margin: 0 4px; color: var(--muted); font-size: 15px; }
@media (min-width: 700px) { .community-lead { font-size: 17px; } }
.community-head-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.community-head-btns [hidden] { display: none; }
@media (max-width: 699px) { .community-head > div:first-child { display: none; } .community-head { margin-top: -10px; } }
.community-cooks .section-head { margin-bottom: 10px; }
.community-cooks-h { font-size: 20px; }
@media (min-width: 700px) { .community-cooks-h { font-size: 22px; } }
.community-avatars { display: flex; gap: 14px; overflow-x: auto; padding: 2px 4px 6px; scrollbar-width: none; }
.comm-cook { position: relative; flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; width: 72px; color: var(--ink); text-align: center; }
.comm-cook-av, .comm-av, .cook-avatar { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--plum-button); color: var(--white); font-weight: 700; flex: 0 0 auto; }
.comm-cook-av { width: 56px; height: 56px; font-size: 20px; box-shadow: var(--raise); }
.comm-cook-av img, .comm-av img, .cook-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comm-cook-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.comm-dot { position: absolute; top: 0; right: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--plum-button); box-shadow: 0 0 0 3px var(--ground); }
.community-empty-line { margin: 0 4px; color: var(--muted); font-size: 15px; }
.community-free { margin: -8px 4px 0; color: var(--muted); font-size: 14px; }
.community-free a { color: var(--plum-text); font-weight: 700; }

/* Following · Everyone · Most made (and the cook page's Newest · Most made) */
.community-tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--well-bg); box-shadow: var(--well); justify-self: start; }
.community-tabs button { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font: 600 15px var(--font-body); cursor: pointer; }
.community-tabs button:hover { color: var(--ink); }
.community-tabs button[aria-selected="true"] { background: var(--card); box-shadow: var(--raise); color: var(--plum-text); font-weight: 700; }
@media (max-width: 699px) { .community-page .community-tabs { justify-self: stretch; } .community-page .community-tabs button { flex: 1 1 0; padding: 0 8px; } }

.community-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
@media (min-width: 700px) { .community-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; } }
@media (min-width: 1200px) { .community-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.community-empty { grid-column: 1 / -1; padding: 12px 4px; color: var(--muted); }
.comm-card .card-name { font-family: var(--font-display); }
.comm-by { display: flex; align-items: center; gap: 6px; }
.comm-av { width: 20px; height: 20px; font-size: 11px; }

/* Find cooks */
.cook-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cook-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.cook-row a { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); }
.cook-row a span { display: grid; min-width: 0; }
.cook-row small { color: var(--muted); font-size: 13px; }
.cook-row .comm-cook-av { width: 44px; height: 44px; font-size: 16px; }
.cook-row .btn { flex: 0 0 auto; }

/* ==========================================================================
   6. A COOK'S PAGE (part 3; P5, D2)
   ========================================================================== */
.cook-page .shell-main { display: grid; gap: 22px; min-width: 0; max-width: 980px; margin: 0 auto; width: 100%; }
.cook-back { justify-self: start; }
.cook-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; align-items: center; padding: 22px; border-radius: var(--r-5); }
.cook-avatar { width: 72px; height: 72px; font-size: 28px; }
@media (min-width: 700px) { .cook-head { grid-template-columns: auto minmax(0, 1fr) auto; padding: 28px; } .cook-avatar { width: 96px; height: 96px; font-size: 36px; } }
.cook-name { font: 700 28px/1.15 var(--font-display); letter-spacing: -.015em; }
@media (min-width: 700px) { .cook-name { font-size: 34px; } }
.cook-bio { margin-top: 6px; font-size: 16px; color: var(--ink); }
.cook-since { margin-top: 6px; font-size: 14px; color: var(--muted); }
.cook-act { grid-column: 1 / -1; }
.cook-act .btn { width: 100%; justify-content: center; }
@media (min-width: 700px) { .cook-act { grid-column: auto; } .cook-act .btn { width: auto; } }
.cook-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.cook-stats div { display: grid; gap: 2px; }
.cook-stats dt { font-size: 13px; color: var(--muted); }
.cook-stats dd { margin: 0; font: 700 20px var(--font-display); }
.cook-private { margin: -6px 4px 0; font-size: 14px; color: var(--muted); }
.cook-lately { padding: 18px 20px; border-radius: var(--r-5); }
.cook-lately ul { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 15px; }
.cook-recipes .section-head { flex-wrap: wrap; }
.cook-as { width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--well-bg); box-shadow: var(--well); color: var(--ink); font: 400 16px var(--font-body); }

/* ==========================================================================
   7. THE INVITATION AND FOUNDING COOKS (Nov 13; Dave: the community starts
   empty, so the page has to make people want to bring the first dish)
   A raised card heading the page while it's quiet: the Founding cooks line,
   the big ask, their own recipes ready to share (one plum Share, the rest
   raised), or Snap a recipe card, then three numbered steps.
   ========================================================================== */
.community-invite { display: grid; gap: 12px; padding: 22px; border-radius: var(--r-5); }
.community-invite[hidden] { display: none; }
@media (min-width: 700px) { .community-invite { padding: 30px 32px; } }
.invite-kicker, .founding-badge { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 0; padding: 4px 12px 4px 10px; border-radius: var(--r-pill); background: var(--well-bg); box-shadow: var(--well); color: var(--plum-text); font-size: 14px; font-weight: 700; }
.invite-kicker svg, .founding-badge svg { width: 15px; height: 15px; }
.founding-badge { margin-top: 6px; }
.founding-badge.is-small { margin: 0 0 0 4px; padding: 1px 8px; font-size: 12px; box-shadow: none; vertical-align: 1px; }
.invite-h { font: 700 26px/1.2 var(--font-display); letter-spacing: -.015em; text-wrap: balance; }
@media (min-width: 700px) { .invite-h { font-size: 32px; } }
.invite-p { max-width: 62ch; color: var(--muted); font-size: 16px; line-height: 1.5; }
.invite-p b { color: var(--ink); }
.invite-wait { padding: 10px 14px; border-radius: var(--r-4); background: var(--note); color: var(--ink); font-size: 15px; }
.invite-wait a { color: var(--plum-text); font-weight: 700; }
.invite-label { margin-top: 6px; font-weight: 700; color: var(--ink); }
.invite-ready { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.invite-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 8px 8px 8px; border-radius: var(--r-4); background: var(--well-bg); }
.invite-thumb { position: relative; width: 52px; height: 52px; overflow: hidden; border-radius: var(--r-3); background: var(--band); container-type: size; }
.invite-thumb img { width: 100%; height: 100%; object-fit: cover; }
.invite-name { font: 700 16px/1.25 var(--font-display); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.invite-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.invite-steps { display: grid; gap: 10px; margin: 8px 0 0; padding: 14px 0 0; list-style: none; counter-reset: step; border-top: 1px solid var(--line); }
@media (min-width: 700px) { .invite-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.invite-steps li { position: relative; display: grid; gap: 2px; padding-left: 40px; counter-increment: step; }
.invite-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--plum-button); box-shadow: var(--plum-shadow); color: var(--white); font: 700 14px var(--font-body); }
.invite-steps b { font-size: 15px; }
.invite-steps span { font-size: 14px; color: var(--muted); }
.community-by-link { color: inherit; }
.community-by-link:hover b { color: var(--plum-text); }
