/* AO-COMM-DEMO-002 (James 2026-11-19; public since AO-COMM-RELEASE-001): the article-discussion bubble beside every story and guide. Linked only when the reader runs
   with discussions (v1/server.js); pages served without the community never load it. The bubble is its own link, separate from the headline, with a visible count
   (including zero); its accessible name names the story and the count. Colours come from the reader's theme tokens, so light and dark both work. */
.discuss-bubble {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  min-height: 24px; min-width: 24px; padding: 1px 8px 1px 6px; margin-left: 6px;
  border: 1px solid var(--bb-rule, #d3dde1); border-radius: 999px; background: transparent;
  color: var(--bb-accent, #0a6e69); font-size: 0.8125rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
.discuss-bubble:hover { border-color: currentColor; text-decoration: none; }
.discuss-bubble:focus-visible { outline: 3px solid var(--bb-amber, #8a4f00); outline-offset: 2px; }
.discuss-icon { width: 16px; height: 16px; flex: none; }
.discuss-count { font-variant-numeric: tabular-nums; }
/* The bubble sits immediately to the right of the attribution (publisher or byline); it and the credit's last word stay on one line together.
   AO-COMM-PLACEMENT-001: with its visible label the bubble can be wider than what a narrow column (a Latest row beside its thumbnail, a phone)
   has left, so the pair is one wrapping inline flex box: one line while the pair fits the column, and only when the pair alone is wider than
   the whole column does the bubble move to the next line under the credit, instead of running into the thumbnail or past the column. */
.discuss-glue { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 4px; max-width: 100%; white-space: nowrap; }
.discuss-glue > .discuss-bubble { margin-left: 0; }
/* In a publisher credit (logo, name, bubble) the line itself wraps: the name box and the glue pass their children through, so a bubble that does not
   fit beside the name moves to the next line at the full column width, under the logo, rather than squeezing beside it. */
html[data-reader-v1="1"] .story-publisher { flex-wrap: wrap; row-gap: 4px; }
html[data-reader-v1="1"] .story-publisher > .story-source, html[data-reader-v1="1"] .story-publisher .discuss-glue { display: contents; }
.story-source .discuss-bubble, .story-byline .discuss-bubble, .guide-label .discuss-bubble, .guide-byline .discuss-bubble { font-weight: 600; text-transform: none; letter-spacing: normal; }
.guide-discuss { margin: 6px 0 0; }
.guide-discuss .discuss-bubble { margin-left: 0; }
@media (max-width: 560px) {
  .discuss-bubble { min-height: 28px; padding: 2px 9px 2px 7px; font-size: 0.875rem; }
}

/* AO-COMM-PLACEMENT-001 (James 2026-11-22). Loaded only when the reader runs with the community, so the Community-disabled pages are unchanged.
   The bubble's visible label: "Comment on this story" at zero, otherwise "1 comment" or "3 comments"; the icon and label are one link. */
/* One line wherever the bubble fits its column; in a column narrower than the label itself (a guide card on a 320 px phone) the label wraps inside the
   bubble rather than being clipped. */
.discuss-bubble { max-width: 100%; box-sizing: border-box; }
.discuss-label { white-space: normal; min-width: 0; text-align: left; }

/* The homepage invitation card: the Bulletin's own type and colours; the decorative mark is drawn in the accent and amber. */
html[data-reader-v1="1"] .community-invite { box-sizing: border-box; margin: 22px 0 0; padding: 16px 18px; border: 1px solid var(--bb-rule); border-top: 3px solid var(--bb-accent); background: var(--bb-bg); color: var(--bb-text); }
html[data-reader-v1="1"] .community-invite .invite-title { margin: 0 0 6px; font-family: var(--bb-head-font); font-weight: 400; font-size: 1.3125rem; line-height: 1.2; color: var(--bb-text); }
html[data-reader-v1="1"] .community-invite .invite-text { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.45; color: var(--bb-muted); }
html[data-reader-v1="1"] .community-invite .invite-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
html[data-reader-v1="1"] .community-invite .invite-join { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 8px; border: 1px solid var(--bb-accent); border-radius: 999px; color: var(--bb-accent); font-weight: 700; text-decoration: none; }
html[data-reader-v1="1"] .community-invite .invite-join:hover { background: color-mix(in srgb, var(--bb-accent) 8%, transparent); }
html[data-reader-v1="1"] .community-invite .invite-latest { display: inline-flex; align-items: center; min-height: 44px; color: var(--bb-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
html[data-reader-v1="1"] .community-invite a:focus-visible { outline: 3px solid var(--bb-amber, #8a4f00); outline-offset: 2px; }
html[data-reader-v1="1"] .community-invite .invite-art { flex: none; width: 40px; height: 34px; }
html[data-reader-v1="1"] .invite-art .invite-bubble-back { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
html[data-reader-v1="1"] .invite-art .invite-dot { fill: currentColor; }
html[data-reader-v1="1"] .invite-art .invite-bubble-front { fill: var(--bb-bg); stroke: var(--bb-amber, #8a4f00); stroke-width: 2; stroke-linejoin: round; }
html[data-reader-v1="1"] .invite-art .invite-edge { fill: none; stroke: var(--bb-amber, #8a4f00); stroke-width: 1.6; stroke-linejoin: round; }
html[data-reader-v1="1"] .invite-art .invite-node { fill: var(--bb-amber, #8a4f00); }
/* From 1000px Top Story and Latest sit side by side: the card heads the right column, and Latest continues below it. Below 1000px it follows Top Story. */
@media (min-width: 1000px) {
  html[data-reader-v1="1"] .home[data-view="front"] > .community-invite { float: right; clear: right; width: var(--bb-side); margin: 12px 0 0 25px; border-top-width: 3px; }
  html[data-reader-v1="1"] .home[data-view="front"] > .community-invite + .latest { clear: right; margin-top: 22px; }
}
@media (max-width: 999px) {
  html[data-reader-v1="1"] .home[data-view="front"] > .community-invite + .latest { margin-top: 26px; }
}
/* AO-REL-024: on the homepage the invitation's two links are centered as a group in the card; the heading and text stay left-aligned. */
html[data-reader-v1="1"] .home[data-view="front"] > .community-invite .invite-links { justify-content: center; }
