/* nomination-card.css — canonical tribute card.
   Three styles via .nom-card--{editorial|tribute|certificate} modifiers.
   Used by Q-Web preview, Q-Web submitted reveal, A-Web aggregated grid,
   public permalink, dashboard feeds, and PDFs (compact mode). */

/* THE CARD OWNS ITS WIDTH — one number, every surface, no breakpoints.
 *
 * A nomination card is a portrait object: a photo, a name, a quote. It has ONE
 * right width, and it is not a function of whoever happens to contain it. It used
 * to be exactly that — the grid stretched it to the column (~950px on a canvas
 * Stage), the permalink capped it at 480px, and the /p grid gave it something
 * else again. Same disease as the copy: the card didn't own itself.
 *
 * 24rem = 384px — a phone. (An iPhone is 390px, and 24rem is already this app's
 * phone-column width; see the .participation-goto / preview rules in step.css.)
 *
 * Every layout below composes on this and NONE of them sets a width:
 *   • the grid  → repeat(auto-fill, …) recomputes the column COUNT continuously,
 *                 which is the breakpoint system. There is not one media query.
 *   • standalone (permalink, Q-Web preview) → the card caps itself.
 *   • print → report.css is a separate bundle and keeps its own compact width.
 *
 * `min(100%, …)` is the only concession: below 24rem there is no room for 24rem,
 * so the card takes the container. That is the mobile-first floor (Convention 11)
 * and it replaces every breakpoint this file used to need.
 */
:root { --nom-card-width: 24rem; }

.nom-card {
  inline-size: 100%;
  max-inline-size: var(--nom-card-width);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.nom-card:hover { box-shadow: var(--shadow-md); }
.nom-card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ============ EDITORIAL ============ */
.nom-card--editorial {
  border-radius: var(--radius-xl);
  /* No overflow: hidden — the share-menu dropdown breaks out above the
     card chrome. Photo-wrap clips its own image with matching top corners. */
  display: flex;
  flex-direction: column;
}
.nom-card--editorial .nom-card__photo-wrap {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--surface-sunken);
  overflow: hidden;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
}
.nom-card--editorial .nom-card__photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.nom-card--editorial .nom-card__photo-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-300), var(--brand-700));
  color: var(--text-on-accent);
  font-family: var(--font-serif); font-weight: var(--weight-bold);
  font-size: var(--text-5xl);
}
.nom-card--editorial .nom-card__category {
  position: absolute;
  top: var(--space-3); left: var(--space-3);
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-base);
  color: var(--text-primary);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.nom-card--editorial .nom-card__category .material-symbols-rounded {
  font-size: 14px; color: var(--accent-primary);
}
.nom-card--editorial .nom-card__body {
  padding: var(--space-6) var(--space-5) var(--space-5);
}
.nom-card--editorial .nom-card__kicker {
  font-family: var(--font-display);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest); text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
}
.nom-card--editorial .nom-card__name {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 30;
  font-size: var(--text-3xl); font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.nom-card--editorial .nom-card__org {
  font-size: var(--text-sm); color: var(--text-secondary);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-4);
}
.nom-card--editorial .nom-card__rule {
  width: var(--space-12); height: 2px;
  background: var(--accent-primary);
  margin-bottom: var(--space-4);
}
.nom-card--editorial .nom-card__quote {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 16;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}
.nom-card--editorial .nom-card__byline {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs); color: var(--text-tertiary);
}
.nom-card--editorial .nom-card__byline-author {
  font-weight: var(--weight-medium); color: var(--text-secondary);
}
.nom-card--editorial .nom-card__byline-author span {
  color: var(--text-tertiary); font-weight: var(--weight-regular);
}
.nom-card--editorial .nom-card__byline-sep {
  margin: 0 var(--space-1);
  color: var(--text-tertiary);
}
.nom-card--editorial .nom-card__byline-date {
  color: var(--text-tertiary); font-weight: var(--weight-regular);
}

/* ============ TRIBUTE ============ */
.nom-card--tribute {
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-5);
}
.nom-card--tribute .nom-card__top {
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.nom-card--tribute .nom-card__portrait {
  width: 64px; height: 64px; border-radius: var(--radius-full);
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 3px var(--surface-base), 0 0 0 4px var(--accent-muted);
}
.nom-card--tribute .nom-card__portrait img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.nom-card--tribute .nom-card__portrait-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: var(--text-on-accent);
  font-weight: var(--weight-bold); font-size: var(--text-xl);
}
.nom-card--tribute .nom-card__nominee {
  display: flex; flex-direction: column; min-width: 0;
}
.nom-card--tribute .nom-card__name {
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight); color: var(--text-primary);
  line-height: var(--leading-tight);
}
.nom-card--tribute .nom-card__org {
  font-size: var(--text-sm); color: var(--text-secondary);
  margin-top: var(--space-0-5);
}
.nom-card--tribute .nom-card__category {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-hover);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  margin-top: var(--space-1); align-self: flex-start;
}
.nom-card--tribute .nom-card__category .material-symbols-rounded { font-size: 13px; }
.nom-card--tribute .nom-card__quote-mark {
  font-family: var(--font-serif); font-size: var(--text-5xl);
  line-height: 1;
  color: var(--accent-muted);
  font-weight: var(--weight-bold);
  margin-bottom: calc(-1 * var(--space-4));
}
.nom-card--tribute .nom-card__quote {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 18;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  padding-left: var(--space-3);
  border-left: 2px solid var(--accent-muted);
}
.nom-card--tribute .nom-card__signature {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-subtle);
}
.nom-card--tribute .nom-card__signed-label {
  font-size: var(--text-xs); color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  font-weight: var(--weight-medium);
}
.nom-card--tribute .nom-card__signed-name {
  font-weight: var(--weight-semibold); color: var(--text-primary);
  font-family: var(--font-serif); font-style: italic;
  font-size: var(--text-base);
  margin-top: var(--space-0-5);
}
.nom-card--tribute .nom-card__signed-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-top: var(--space-1);
}

/* ============ CERTIFICATE ============ */
.nom-card--certificate {
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6) var(--space-6);
  position: relative;
  /* No overflow: hidden — the share-menu dropdown breaks out above the
     card chrome. The ::before gradient header clips its own top corners. */
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.nom-card--certificate::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 80px;
  background: linear-gradient(180deg, var(--accent-subtle) 0%, transparent 100%);
  pointer-events: none;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
}
.nom-card--certificate .nom-card__badge {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  border-radius: var(--radius-full);
  background: var(--surface-base);
  border: 2px solid var(--accent-primary);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.nom-card--certificate .nom-card__badge .material-symbols-rounded {
  font-size: var(--text-3xl);
  font-variation-settings: 'FILL' 1, 'wght' 500;
  color: var(--accent-primary);
}
.nom-card--certificate .nom-card__category {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest); text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
}
.nom-card--certificate .nom-card__presented-to {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest); text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.nom-card--certificate .nom-card__name {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 36;
  font-size: var(--text-3xl); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.nom-card--certificate .nom-card__org {
  font-size: var(--text-sm); color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.nom-card--certificate .nom-card__photo {
  width: 100%; max-width: 180px;
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 auto var(--space-5);
  border: 1px solid var(--border-subtle);
}
.nom-card--certificate .nom-card__photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.nom-card--certificate .nom-card__photo-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-300), var(--brand-700));
  color: var(--text-on-accent);
  font-weight: var(--weight-bold); font-size: var(--text-3xl);
}
.nom-card--certificate .nom-card__quote {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 16;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: var(--space-5);
  max-width: 90%;
}
.nom-card--certificate .nom-card__divider {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%; margin-bottom: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest); text-transform: uppercase;
  font-weight: var(--weight-medium);
}
.nom-card--certificate .nom-card__divider::before,
.nom-card--certificate .nom-card__divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-subtle);
}
.nom-card--certificate .nom-card__signed {
  font-family: var(--font-serif); font-style: italic;
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.nom-card--certificate .nom-card__date {
  font-size: var(--text-xs); color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-4);
}

/* ============ Card actions (vote + share) — shared across styles ============ */
.nom-card__actions {
  display: flex; gap: var(--space-1); align-items: center;
  position: relative;
}
.nom-card__actions button,
.nom-card__actions a {
  background: none; border: none;
  padding: var(--space-1-5) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.nom-card__actions button:hover,
.nom-card__actions a:hover { background: var(--surface-hover); color: var(--text-primary); }
.nom-card__actions .nom-card__voted { color: var(--accent-primary); background: var(--accent-subtle); }
.nom-card__actions .nom-card__voted .material-symbols-rounded { font-variation-settings: 'FILL' 1; }
.nom-card__actions .material-symbols-rounded { font-size: 18px; }

/* Certificate places actions in their own footer */
.nom-card--certificate .nom-card__actions-wrap {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  display: flex; justify-content: center;
}

/* Share-menu dropdown — opens above the share trigger and breaks out of
   the card chrome (the editorial + certificate cards drop their card-level
   `overflow: hidden` so this menu isn't clipped). Anchored to the
   .nom-card__actions wrapper (which is position: relative). */
.nom-card__share-menu {
  position: absolute;
  top: auto;
  bottom: 100%;
  left: auto;
  right: 0;
  margin-bottom: var(--space-1);
  z-index: var(--z-dropdown);
  min-width: 180px;
  padding: var(--space-1);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nom-card__share-menu[hidden] { display: none; }
.nom-card__share-menu button,
.nom-card__share-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  width: 100%;
}
.nom-card__share-menu button:hover,
.nom-card__share-menu a:hover { background: var(--surface-hover); }
.nom-card__share-menu .material-symbols-rounded {
  font-size: 18px;
  color: var(--text-tertiary);
}

/* ============ See-more truncation (CSS-only) ============ */
.nom-card__quote--truncated {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nom-card__see-more {
  font-size: var(--text-xs); color: var(--accent-primary);
  font-weight: var(--weight-semibold);
  cursor: pointer; background: none; border: none; padding: 0;
  margin-bottom: var(--space-5);
}

/* ============ Compact variant (PDF + small surfaces) ============ */
.nom-card--compact { box-shadow: none; }
.nom-card--compact.nom-card--editorial .nom-card__body { padding: var(--space-3); }
.nom-card--compact.nom-card--editorial .nom-card__name { font-size: var(--text-xl); }
.nom-card--compact.nom-card--editorial .nom-card__quote { font-size: var(--text-sm); }
.nom-card--compact.nom-card--tribute { padding: var(--space-4) var(--space-3); }
.nom-card--compact.nom-card--tribute .nom-card__quote { font-size: var(--text-base); }
.nom-card--compact.nom-card--certificate { padding: var(--space-5) var(--space-4); }
.nom-card--compact.nom-card--certificate .nom-card__name { font-size: var(--text-2xl); }
.nom-card--compact.nom-card--certificate .nom-card__photo { max-width: 120px; }

/* Card shape + editorial type/photo follow the soul. */
.nom-card { border-radius: var(--soul-radius-card, 12px); }
.nom-card--editorial .nom-card__photo-wrap { aspect-ratio: 1 / 1; }
.nom-card__category:empty { display: none; }
.nom-card__name { font-family: var(--soul-font-display); }
.nom-card__quote { font-family: var(--soul-font-content); }

/* ============================================================================
   .nom-agg — the nomination LIST composition (grid, groups, stats, zero-state)

   WHY THIS LIVES IN components/ AND NOT IN A PAGE BUNDLE
   -----------------------------------------------------
   `participations/elements/_nomination_panel` + `_nomination_page` is a
   Multi-Use partial: it renders on /p (participation shell), on the member and
   org dashboards (coach shell), in the Experience Editor preview (admin shell),
   and on the /n/:id permalink. A Multi-Use partial's composition CSS therefore
   cannot live in a per-shell page bundle — every shell excludes some other
   shell's page bundle, so half the rules would be dead on half the producers.

   This block used to live in pages/participation/step.css, which is EXCLUDED
   from the member bundle (COACH_MEMBER_CSS_EXCLUDED_PREFIXES: `pages/participation/`),
   while pages/dashboards/dashboard.css — excluded from the participation
   bundle — grew its own `.dashboard-nominations-grid` to lay out the SAME card.
   Two divergent class families for one partial, neither able to see the other.

   Precedent: the To-dos `.todo-list__filter` duplication bug (2026-07-14) —
   the same rule existed twice, once per shell bundle, and drifted. The fix was
   the same: one home, in components/, which every bundle carries.
   components/nomination-card.css is in EVERY bundle (CSS_BUNDLE, no exclusion
   list names it), so it costs zero additional links on any shell.
   ============================================================================ */

.nom-agg { display: flex; flex-direction: column; gap: var(--space-6); }
.nom-agg__prompt { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--text-primary); }
.nom-agg__section-label { font-size: var(--text-sm); color: var(--text-secondary); }
.nom-agg__toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.nom-agg__stats { display: flex; align-items: baseline; gap: var(--space-2); }
.nom-agg__stats-num { font-family: var(--font-mono); font-size: var(--text-3xl); font-weight: var(--weight-bold); color: var(--accent-primary); letter-spacing: var(--tracking-tight); line-height: 1; }
.nom-agg__stats-lbl { font-size: var(--text-sm); color: var(--text-secondary); }

/* The chain container. It holds every group section of every page of the list.
   A chained page arrives as a `display: contents` frame, so its groups become
   direct children of THIS element — which is why group separation must be a
   `gap` on the column and NEVER an adjacent-sibling / bottom margin: a margin
   would collapse (or simply not apply) across the display:contents seam, and
   the first group of page 2 would sit flush against the last group of page 1. */
.nom-agg__groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.nom-agg__group-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.nom-agg__group-title { font-family: var(--font-display); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-widest); text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; }
.nom-agg__group-rule { flex: 1; height: 1px; background: var(--border-subtle); }
.nom-agg__group-count { font-size: var(--text-xs); color: var(--text-tertiary); font-family: var(--font-mono); padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-full); background: var(--surface-neutral); }

/* The grid decides HOW MANY cards fit. It never decides how WIDE one is — the
   card already knows (--nom-card-width, above). auto-fill recomputes the column
   count continuously as the container changes, so this one rule serves the narrow
   /p step column, the half-width `duo` Stage zone and the full-width `canvas`
   surface page identically, with ZERO media queries. */
.nom-agg__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--nom-card-width)), var(--nom-card-width)));
  gap: var(--space-5);
  justify-content: start;
  /* align-items: start prevents the grid's default `stretch` from forcing
     every card in a row to the tallest card's height. Each card sizes to
     its own content. */
  align-items: start;
}

.nom-agg__empty { padding: var(--space-12) var(--space-6); text-align: center; border: 1px dashed var(--border-subtle); border-radius: var(--radius-xl); background: var(--surface-neutral); }
.nom-agg__empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--surface-base); margin-bottom: var(--space-4); }
.nom-agg__empty-icon .material-symbols-rounded { font-size: var(--text-3xl); color: var(--text-tertiary); }
.nom-agg__empty-title { font-family: var(--font-serif); font-variation-settings: 'opsz' 24; font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--text-primary); margin-bottom: var(--space-2); }
.nom-agg__empty-body { font-size: var(--text-sm); color: var(--text-secondary); max-width: 420px; margin: 0 auto; }

/* ============ Public permalink page (/n/:id) ============
   Formerly pages/public_nomination.css — a whole per-page sheet (21 lines, two
   selectors) for one surface, excluded from every shell bundle and therefore
   hand-injected by the view with its own stylesheet_link_tag. It is the same
   card on the same partial, so it belongs here with it. */
.public-nomination-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

/* No width of its own — the card knows how wide a card is. This used to cap at
   480px, which is why the permalink showed a wider card than the grid did. */
.public-nomination-page__card-wrap {
  width: 100%;
  max-width: var(--nom-card-width);
}
