/**
 * SignUpGenius: the signup cards. Forked from the store grid so a signup card
 * and a store card read as the same family; theme-token fallbacks keep the
 * module presentable on any theme.
 */

/* A wrapping flex row, not a grid: a grid cannot center a short LAST row
   (six cards on four lanes parked two on the left, 9-14). Each card takes a
   lane's width at every breakpoint and any short row centers on its own,
   so the RallyTrain rule (a short row never parks left) holds for the
   first row and the last. */
.rt-sg-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  max-width: var(--rt-maxw, 1120px);
  margin: 0 auto;
}
.rt-sg-grid > .rt-sg-card {
  flex: 0 1 100%;
  min-width: 0;
}
/* Explicit column counts, the store grid's pattern. The old
   auto-fit minmax(300px, 360px) counted columns by the 360px MAX
   (that is what the spec says auto-fit does), and three 360s plus
   gaps overflow an 1100px container by 28px, so a full season of
   signups rendered as two skinny centered columns. */
@media (min-width: 760px) {
  .rt-sg-grid > .rt-sg-card {
    flex-basis: calc((100% - 24px) / 2);
    max-width: 360px;
  }
}
@media (min-width: 1100px) {
  .rt-sg-grid > .rt-sg-card {
    flex-basis: calc((100% - 48px) / 3);
  }
}
@media (min-width: 1400px) {
  .rt-sg-grid > .rt-sg-card {
    flex-basis: calc((100% - 72px) / 4);
  }
}

/* Month sections wear the staff-birthdays clothes: each month is a white
   card whose title is a filled banner strip, not a bare underlined
   heading. Rules mirror .rt-ft-bd-month / .rt-ft-bd-month-title in
   favorite-things.css, including the standalone gradient. */
.rt-sg-month {
  background: var(--rt-white, #fff);
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: var(--rt-maxw, 1120px);
  margin: 0 auto 40px;
  overflow: hidden;
}
.rt-sg-month .rt-sg-month-title {
  margin: 0;
  background: var(--rt-black, #141414);
  /* Bright primary reads on the dark strip in BOTH palettes (Henry's gold,
     Cox's light blue); the plain primary is too dim on Cox navy. */
  color: var(--rt-primary-bright, var(--rt-primary, #f4b41c));
  font-family: var(--rt-font-display, "RT Display", "Arial Narrow", sans-serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-bottom: 3px solid var(--rt-primary, #f4b41c);
}
.rt-sg-standalone .rt-sg-month .rt-sg-month-title {
  background: linear-gradient(135deg, var(--rt-primary, #f4b41c), var(--rt-secondary, #d99a00));
  color: var(--rt-on-primary, #ffffff);
  border-bottom-color: var(--rt-primary-bright, #ffc845);
}
.rt-sg-month .rt-sg-month-title i {
  margin-right: 10px;
  font-size: 0.9em;
}
/* Cards breathe inside the month card instead of touching its walls. */
.rt-sg-month .rt-sg-grid {
  padding: 24px 22px;
}

/* The search hides cards and emptied months with the hidden attribute; the
   card's own display rule would out-cascade the browser default, so both
   get an explicit rule. */
.rt-sg-card[hidden],
.rt-sg-month[hidden] {
  display: none;
}

.rt-sg-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 10px);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--rt-shadow, 0 6px 24px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rt-sg-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rt-shadow-lift, 0 10px 24px rgba(0, 0, 0, 0.12));
}

/* The slim branded strip the no-artwork store cards use: signups carry no
   artwork of their own. */
/* The band carries the card's title (Furi, 9-15: an empty black strip with
   the title under it read as a mistake). Site mark stays at the right. */
.rt-sg-art {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px 86px 12px 18px;
  background-image: var(--rt-banner-logo, none);
  background-size: auto 54px;
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-color: var(--rt-black, #141414);
  box-shadow: inset 0 -3px 0 var(--rt-primary, #f4b41c);
}

.rt-sg-body {
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rt-sg-name {
  margin: 0 0 6px;
  font-family: var(--rt-font-display, "RT Display", "Arial Narrow", sans-serif);
  font-weight: var(--rt-font-display-weight, 400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.25rem;
}
.rt-sg-name a {
  color: inherit;
  text-decoration: none;
}
.rt-sg-name a:hover {
  text-decoration: underline;
}
.rt-sg-art .rt-sg-name {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.15;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.rt-sg-art .rt-sg-name a { color: #fff; }

.rt-sg-meta {
  margin: 0 0 6px;
  color: var(--rt-gray, #6b6b6b);
  font-size: 0.92rem;
}

/* ---- Fill meter ------------------------------------------------------------ */

.rt-sg-meter {
  height: 10px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--rt-line, #e7e2d6);
  overflow: hidden;
}
.rt-sg-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--rt-primary, #f4b41c);
  transition: width 0.3s ease;
}
.rt-sg-meter-fill--full {
  background: var(--rt-secondary, #d99a00);
}

.rt-sg-meter-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--rt-ink, #1f1f1f);
}
.rt-sg-meter-text strong {
  color: var(--rt-secondary, #d99a00);
}

/* ---- Open needs list ------------------------------------------------------- */

.rt-sg-needs {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--rt-ink, #1f1f1f);
}
.rt-sg-needs li {
  margin: 0 0 3px;
}
.rt-sg-needs-more {
  list-style: none;
  margin-left: -18px;
  color: var(--rt-gray, #6b6b6b);
}

/* ---- Button + chip (the store's visual language) --------------------------- */

.rt-sg-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* Phones: the pair sits centered. */
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  margin-bottom: 0;
}
/* The pair stays centered at every width (8-24 house rule: action buttons
   center in their card; only a backwards action earns an edge). This
   replaced the desktop row-reverse/space-between spread. */

/* The calendar button plays second chair: Sign Up keeps the fill, this one
   is a quiet outline. The base .rt-sg-btn color is !important (host-theme
   link colors out-specify it), so the recolor must be too. */
.rt-sg-btn--cal {
  background: transparent;
  border: 1px solid var(--rt-line, #e7e2d6);
  color: var(--rt-ink, #1f1f1f) !important;
  font-weight: 600;
}
.rt-sg-btn--cal:hover {
  background: var(--rt-primary, #f4b41c);
  border-color: var(--rt-primary, #f4b41c);
  color: var(--rt-on-primary, #141414) !important;
}

.rt-sg-btn {
  display: inline-block;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--rt-primary, #f4b41c);
  color: var(--rt-on-primary, #141414) !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
}
.rt-sg-btn:hover {
  background: var(--rt-secondary, #d99a00);
}

.rt-sg-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rt-line, #e7e2d6);
  color: var(--rt-gray, #6b6b6b);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Standalone scope (foreign theme): match the site's heading face, as the
   other modules' standalone scopes do. */
.rt-sg-standalone .rt-sg-name {
  font-family: Oswald, Helvetica, Arial, sans-serif;
}
