/* Carat & Grace — theme-served pages (Step 24). Uses the theme's own parts throughout. */
.cg-tp__in { display: flex; flex-direction: column; gap: 56px; padding-block: 64px 96px; max-width: 820px; }
.cg-tp__b { display: flex; flex-direction: column; gap: 16px; }
.cg-tp__b > h2 { color: var(--cg-text); }

.cg-tp__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; }
.cg-tp__facts li { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--cg-line); }
.cg-tp__facts em { font-style: normal; }
.cg-tp__facts a { color: var(--cg-accent); text-decoration: underline; text-underline-offset: 3px; }

.cg-tp__steps { display: flex; flex-direction: column; }
.cg-tp__steps li { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--cg-line); }
.cg-tp__n {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px;
  width: 40px; height: 40px; border: 1px solid var(--cg-line); border-radius: 99px;
  font-family: var(--cg-display); font-size: 16px; color: var(--cg-rose);
}
.cg-tp__sb { display: flex; flex-direction: column; gap: 3px; }
.cg-tp__sb strong { font-weight: 400; font-size: 16px; }
.cg-tp__sb em { font-style: normal; font-size: 13px; color: var(--cg-text-2); }

.cg-tp__shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cg-tp__shapes li { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border: 1px solid var(--cg-line); }

.cg-tp__form { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.cg-tp__ta { height: auto; padding-block: 12px; resize: vertical; }
.cg-tp__form .cg-btn { align-self: flex-start; margin-top: 8px; }

.cg-tp__cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 32px; background: var(--cg-porcelain);
}

@media (max-width: 767px) {
  .cg-tp__in { gap: 40px; padding-block: 36px 64px; }
  .cg-tp__facts { grid-template-columns: 1fr; gap: 14px; }
  .cg-tp__shapes { grid-template-columns: repeat(3, 1fr); }
  .cg-tp__cta { padding: 24px 20px; }
}

/* ---------------------------------------------------------------- QA, 19 Nov 2026 */

/* CAG-021 — every .cg-tp__facts item drew a border-top, including the items in the FIRST row, so a
   stray line sat directly under the heading, above "Cost / Made to order". The line is meant to
   separate rows. Two columns: drop it on the first two items. (Shipping policy, Refund policy,
   About, Contact, Care x2 and The 4Cs all use this list.) */
.cg-tp__facts > li:nth-child(-n+2) { padding-top: 0; border-top: 0; }

/* CAG-011 — a 2-column list with an ODD number of items left the last one alone with an empty cell
   beside it ("Checks" on Lifetime warranty, "Silver" on Precious metals). The odd one now runs the
   full width, so there is no empty half. */
.cg-tp__facts > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* CAG-020 — the description line under each shape name. */
.cg-tp__shapes--desc li { padding: 20px 14px; }
.cg-tp__shapes--desc li a { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cg-tp__shd { display: block; text-align: center; text-wrap: balance; }

/* CAG-004 — the loyalty sign-up reuses the footer's subscribe control, whose colours are drawn for
   the dark footer (white border, white text). On a page body it needs the page's own ink. */
.cg-tp__sub { max-width: 420px; }
.cg-tp__sub .cg-sub__i { border-color: var(--cg-line-strong); color: var(--cg-text); }
.cg-tp__sub .cg-sub__i::placeholder { color: var(--cg-text-2); opacity: 1; }

@media (max-width: 767px) {
  /* one column on the phone, so only the very first item loses its line and an odd last item
     needs no span */
  .cg-tp__facts > li:nth-child(2) { padding-top: 14px; border-top: 1px solid var(--cg-line); }
  .cg-tp__facts > li:first-child { padding-top: 0; border-top: 0; }
  .cg-tp__sub { max-width: none; }
}

/* ---------------------------------------------------------------- QA re-check, 19 Nov 2026 */

/* CAG-011 round 2 — running the lone last item across both columns was not enough: the CELL was
   full width but its text still sat in the left half, so the right half still read as empty
   ("Checks" on Lifetime warranty, "Silver" on Precious metals). The number of columns is now taken
   from the number of items, so every row is full: three items sit in three columns, five sit as
   3 + 2 on a six-track grid. Even counts keep the two-column layout, and the row divider still
   begins below the first row. */
@media (min-width: 768px) {
  .cg-tp__facts:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
  .cg-tp__facts:has(> li:nth-child(3):last-child) > li { grid-column: auto; padding-top: 0; border-top: 0; }

  .cg-tp__facts:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(6, 1fr); }
  .cg-tp__facts:has(> li:nth-child(5):last-child) > li { grid-column: span 2; padding-top: 0; border-top: 0; }
  .cg-tp__facts:has(> li:nth-child(5):last-child) > li:nth-child(n+4) {
    grid-column: span 3; padding-top: 14px; border-top: 1px solid var(--cg-line);
  }
}
