/* Onboarding funnel — the layout glue the design system does not cover.
 *
 * Everything reusable lives in vendor/eurosky-design. This file is only for
 * arrangements specific to the funnel: the page rhythm, the two preview
 * columns, the post cards. Prefixed ob- so it can never be mistaken for part
 * of the system, and written against --es-* tokens so it follows the theme.
 */

.ob-topbar-end { display: flex; align-items: center; gap: var(--es-space-3); }

.ob-main { padding-block: var(--es-space-7) var(--es-space-8); }
.ob-flash { margin-top: var(--es-space-4); max-width: none; }

.ob-footer { margin-top: var(--es-space-9); }
.ob-footer-row { display: flex; flex-wrap: wrap; gap: var(--es-space-2) var(--es-space-5); justify-content: space-between; max-width: none; }
.ob-footer-links { display: flex; gap: var(--es-space-4); }

/* ---------- Locale switch ---------- */
.ob-locale { display: inline-flex; border: var(--es-border-hairline) solid var(--es-border-strong); border-radius: var(--es-radius-pill); overflow: hidden; }
.ob-locale a { padding: 2px var(--es-space-3); font-family: var(--es-font-mono); font-size: var(--es-text-xs); text-decoration: none; }
.ob-locale a[aria-current="true"] { background: var(--es-fg); color: var(--es-bg); }

/* ---------- Hero ---------- */
.ob-hero { padding-block: var(--es-space-6) var(--es-space-7); }
.ob-hero h1 { max-width: 18ch; }
.ob-lede { font-size: var(--es-text-lg); line-height: var(--es-leading-snug); color: var(--es-fg-muted); }
.ob-feed-form { display: flex; flex-wrap: wrap; gap: var(--es-space-3); margin-top: var(--es-space-5); max-width: 44rem; }
.ob-feed-form .es-input { flex: 1 1 22rem; min-height: 3rem; }
.ob-hero-hint { margin-top: var(--es-space-3); }

/* ---------- Section rhythm ---------- */
.ob-section { padding-block: var(--es-space-7); border-top: var(--es-border-hairline) solid var(--es-border-strong); }
.ob-section > h2 { font-size: var(--es-text-xl); }
.ob-steps { display: grid; gap: var(--es-space-5); grid-template-columns: 1fr; list-style: none; padding: 0; max-width: none; }
@media (min-width: 48rem) { .ob-steps { grid-template-columns: repeat(3, 1fr); } }
.ob-step-n { font-family: var(--es-font-mono); font-size: var(--es-text-xs); color: var(--es-fg-muted); }
.ob-step h3 { font-size: var(--es-text-lg); margin-block: var(--es-space-2) var(--es-space-1); }
.ob-step p { font-size: var(--es-text-sm); color: var(--es-fg-muted); margin: 0; }
.ob-dont { list-style: none; padding: 0; max-width: var(--es-layout-measure); }
.ob-dont li { padding-block: var(--es-space-3); border-bottom: var(--es-border-hairline) solid var(--es-border); font-size: var(--es-text-sm); }
.ob-dont li:last-child { border-bottom: 0; }

/* ---------- Preview: two networks, side by side ---------- */
.ob-preview { display: grid; gap: var(--es-space-5); grid-template-columns: 1fr; }
@media (min-width: 62rem) { .ob-preview { grid-template-columns: 1fr 1fr; } }
.ob-col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--es-space-3); padding-bottom: var(--es-space-2); border-bottom: var(--es-border-hairline) solid var(--es-border-strong); margin-bottom: var(--es-space-4); }
.ob-col-head h3 { font-size: var(--es-text-md); margin: 0; }
.ob-col-note { font-family: var(--es-font-mono); font-size: var(--es-text-xs); color: var(--es-fg-muted); }
.ob-posts { display: grid; gap: var(--es-space-4); }
/* A column switched off is shown, not removed: the gap is the argument. */
.ob-col-off { opacity: .4; }

/* ---------- Post cards ----------
 * Deliberate copies of somebody else's visual language. These should read as a
 * Bluesky post and a Mastodon toot, not as Eurosky components, because the
 * claim they make is "this is what yours will look like over there". Geometry
 * and greys are taken from the design canvas.
 */
.ob-post { background: var(--es-palette-white); border: 1px solid #d4dbe2; border-radius: 12px; padding: var(--es-space-4); color: #0b1620; }
.ob-post-head { display: flex; gap: var(--es-space-3); align-items: flex-start; }
.ob-avatar { width: 42px; height: 42px; border-radius: 999px; background: var(--es-palette-linen); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; flex: none; color: var(--es-palette-black); }
.ob-post-id { min-width: 0; flex: 1; }
.ob-post-name { font-size: 15px; line-height: 20px; display: flex; gap: 4px; white-space: nowrap; overflow: hidden; }
.ob-post-name b { font-weight: 700; }
.ob-post-handle { color: #42576c; overflow: hidden; text-overflow: ellipsis; }
.ob-post-text { font-size: 15px; line-height: 20px; margin-top: 2px; word-wrap: break-word; }
.ob-card { margin-top: 8px; border: 1px solid #d4dbe2; border-radius: 10px; overflow: hidden; }
.ob-card-img { aspect-ratio: 1.91/1; background: var(--es-palette-linen); display: flex; align-items: center; justify-content: center; font-family: var(--es-font-mono); font-size: 12px; color: var(--es-fg-muted); overflow: hidden; }
.ob-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ob-card-body { padding: 10px 12px 8px; }
.ob-card-title { font-size: 14px; line-height: 18px; font-weight: 600; }
.ob-card-desc { font-size: 13px; line-height: 17px; color: #42576c; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ob-card-host { border-top: 1px solid #d4dbe2; margin: 8px -12px 0; padding: 6px 12px 0; display: flex; align-items: center; gap: 4px; font-size: 12px; color: #42576c; }

/* Mastodon: squarer card, cooler grey, handle carries the bridge domain. */
.ob-post-mastodon { border-color: #d9e1e8; border-radius: 8px; }
.ob-post-mastodon .ob-post-name { display: block; }
.ob-post-mastodon .ob-post-handle { color: #606984; display: block; }
.ob-post-mastodon .ob-post-text { font-size: 15px; line-height: 22px; margin-top: 10px; }
.ob-post-mastodon .ob-card { border-color: #d9e1e8; border-radius: 8px; margin-top: 12px; }
.ob-post-mastodon .ob-card-body { padding: 12px 14px; }
.ob-post-mastodon .ob-card-desc { color: #606984; font-size: 14px; line-height: 20px; margin-top: 4px; }

/* The whole reason the two columns sit side by side. */
.ob-no-link { margin-top: var(--es-space-3); }

/* ---------- Character count ---------- */
.ob-count { font-family: var(--es-font-mono); font-size: var(--es-text-xs); color: var(--es-fg-muted); }
.ob-count-over { color: var(--es-fg); border-left: 3px solid var(--es-warning); padding-left: var(--es-space-2); }

/* ---------- Sticky action bar ---------- */
.ob-actions {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--es-space-3);
  justify-content: space-between;
  margin-bottom: var(--es-space-2); padding-block: var(--es-space-3);
  background: var(--es-bg);
  border-bottom: var(--es-border-hairline) solid var(--es-border);
}
.ob-claim-cta { margin-left: auto; }

/* Demoted once the panel is open, not removed. The accent moves to the form's
 * own submit — one green per view either way — but a button disappearing from
 * under the cursor that just clicked it reads as a fault, and it still has a
 * job: scrolling back down to the form after reading further up. */
.is-revealed .ob-claim-cta {
  background: var(--es-bg-raised);
  border-color: var(--es-border-strong);
  color: var(--es-fg);
}
.is-revealed .ob-claim-cta:hover { background: var(--es-fg); color: var(--es-bg); }

/* ---------- Unfolding panels ----------
 * grid-template-rows 0fr -> 1fr is the one way to animate to a height nobody
 * has measured. The child must own the overflow, or its content spills while
 * the row is still growing.
 *
 * Rendered open and closed by JavaScript on connect, so the form is reachable
 * when script has not run — hence .is-open in the markup rather than a class
 * the controller has to add before anything is visible.
 */
.ob-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--es-motion-ease); }
.ob-panel > * { overflow: hidden; min-height: 0; }
.ob-panel.is-open { grid-template-rows: 1fr; }
.ob-panel-inner { padding-top: var(--es-space-1); }

.ob-chevron { margin-left: .4em; display: inline-block; transition: transform 200ms var(--es-motion-ease); }
[aria-expanded="true"] .ob-chevron { transform: rotate(180deg); }

.ob-claim-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--es-space-3); }
.ob-claim-head > div { min-width: 0; }
.ob-open { flex: none; }

@media (prefers-reduced-motion: reduce) {
  .ob-panel, .ob-chevron { transition: none; }
}

/* ---------- Claim (screen B's lower half) ---------- */
/* Clear of the sticky bar when jumped to, or the heading lands underneath it. */
#claim { scroll-margin-top: 4.5rem; }
.ob-claim { max-width: 32rem; margin-top: var(--es-space-5); }
.ob-alts { margin-top: var(--es-space-2); }
.ob-alts summary { cursor: pointer; }
.ob-alt-list { list-style: none; padding: var(--es-space-2) 0 0; margin: 0; display: grid; gap: var(--es-space-1); }
.ob-have-handle { margin-top: var(--es-space-4); }

/* ---------- Which door ---------- */
.ob-modes { border: 0; padding: 0; margin: 0 0 var(--es-space-4); display: grid; gap: var(--es-space-2); }
.ob-modes legend { padding: 0; margin-bottom: var(--es-space-2); }
.ob-mode { display: flex; gap: var(--es-space-3); align-items: flex-start; padding: var(--es-space-3); border: var(--es-border-hairline) solid var(--es-border); border-radius: var(--es-radius-sm); cursor: pointer; }
.ob-mode:has(input:checked) { border-color: var(--es-fg); }
.ob-mode:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.ob-mode input { margin-top: .25rem; }
.ob-mode strong { display: block; font-weight: var(--es-weight-medium); font-size: var(--es-text-sm); }

/* Alternatives are buttons, not decoration: clicking one fills the field
   rather than asking somebody to retype a handle we just suggested. */
.ob-alt { font: inherit; font-family: var(--es-font-mono); font-size: var(--es-text-xs); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; color: inherit; }
.ob-alt:hover { color: var(--es-fg-muted); }
.ob-form-error { margin-bottom: var(--es-space-4); }


/* The two pages that are nothing but text. Everywhere else on this funnel the
   reading is short and beside something; here it is the whole screen, so it
   gets a measure and room between paragraphs rather than the dense rhythm the
   cards use. */
.ob-prose { max-width: 42rem; border-top: 0; }
.ob-prose > h1 { font-size: var(--es-text-2xl); }
.ob-prose > h2 { font-size: var(--es-text-lg); margin-block-start: var(--es-space-6); }
.ob-prose > p { margin-block-start: var(--es-space-2); line-height: var(--es-leading-normal); }
.ob-prose > ul { margin-block-start: var(--es-space-2); padding-inline-start: var(--es-space-5); }
.ob-prose > ul > li { margin-block-start: var(--es-space-2); line-height: var(--es-leading-normal); list-style: disc; }

/* ---------- Confirm (the funnel's last step, after sign-in) ----------
 * Deliberately plain. Everything before this screen is persuasion; this one is
 * a question, and the only thing on it that should catch the eye is the answer
 * they are about to give. */
.oc-candidate { margin-bottom: var(--es-space-5); }
.oc-url { word-break: break-all; color: var(--es-fg-muted); margin-top: var(--es-space-1); }
.oc-domain { display: grid; gap: var(--es-space-2); margin-bottom: var(--es-space-5); max-width: var(--es-layout-measure); }
.oc-domain p { margin: 0; }
.oc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--es-space-3); margin-top: var(--es-space-5); }
.oc-nothing-yet { margin-top: var(--es-space-4); }
