/* Carat & Grace — the routes the prototype has no screen for: search, journal, article, 404,
   CMS pages, wishlist and the account pages. Built in the prototype's own language. */

/* ---------------------------------------------------------------- rich text */
.cg-rte { max-width: 72ch; }
.cg-rte > * + * { margin-top: 1.1em; }
.cg-rte h2 { font-family: var(--cg-display); font-size: 32px; line-height: 1.15; margin-top: 1.8em; }
.cg-rte h3 { font-family: var(--cg-display); font-size: 24px; line-height: 1.2; margin-top: 1.6em; }
.cg-rte p, .cg-rte li { font-size: 16px; line-height: 1.7; color: var(--cg-text-2); }
.cg-rte strong { color: var(--cg-text); font-weight: 500; }
.cg-rte a { color: var(--cg-accent); text-decoration: underline; text-underline-offset: 3px; }
.cg-rte ul, .cg-rte ol { padding-left: 1.2em; display: flex; flex-direction: column; gap: .5em; }
.cg-rte ul li { list-style: disc; }
.cg-rte ol li { list-style: decimal; }
.cg-rte img { margin-block: 1.6em; }
.cg-rte blockquote { margin: 1.6em 0; padding-left: 20px; border-left: 2px solid var(--cg-rose); font-family: var(--cg-display); font-size: 22px; color: var(--cg-text); }
.cg-page__body { margin-inline: auto; }

/* ---------------------------------------------------------------- big search */
.cg-bigsearch { display: flex; align-items: center; gap: 12px; max-width: 640px; padding-bottom: 10px; border-bottom: 1px solid var(--cg-line-strong); }
.cg-bigsearch input { flex: 1 1 auto; min-width: 0; border: 0; background: none; font-size: 16px; }
.cg-bigsearch .cg-btn { min-height: 40px; }

/* ---------------------------------------------------------------- journal */
.cg-art { display: block; }
/* the card photo is a <span>: inline, it ignored its 4:5 aspect-ratio and every cover kept its own shape */
.cg-art .cg-media { display: block; }
.cg-art__b { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; }
.cg-art__b strong { font-weight: 400; }
.cg-art:hover .cg-art__b strong { color: var(--cg-rose); }
.cg-article__head { display: flex; flex-direction: column; gap: 16px; padding-block: 56px 32px; align-items: center; text-align: center; }
.cg-article__h { max-width: 24ch; }
.cg-article__m { aspect-ratio: 1328 / 700; }
.cg-article__body { padding-block: 48px; margin-inline: auto; }
.cg-article__tags { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 24px; }
.cg-article__back { padding-bottom: 72px; }

/* ---------------------------------------------------------------- 404 */
.cg-404__in { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding-block: 120px 140px; }
.cg-404__in .cg-body-l { max-width: 52ch; color: var(--cg-text-2); }
.cg-404__links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 767px) { .cg-404__in { padding-block: 64px 80px; } }

/* ---------------------------------------------------------------- account */
.cg-acct { display: flex; justify-content: center; }
.cg-acct__card { display: flex; flex-direction: column; gap: 12px; width: min(460px, 100%); padding: 36px; border: 1px solid var(--cg-line); background: var(--cg-white); }
.cg-acct__full { width: min(860px, 100%); display: flex; flex-direction: column; gap: 18px; }
.cg-acct__l { font-weight: 500; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cg-text-2); }
.cg-acct__note { margin-bottom: 6px; }
.cg-acct__ok { color: var(--cg-accent); }
.cg-acct__err { color: var(--cg-sale); }
.cg-orders li a { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--cg-line); }
.cg-addrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cg-addrs li { padding: 20px; border: 1px solid var(--cg-line); }

/* ---------------------------------------------------------------- sign in / create account (sections/cng-account,
   2026-10-26 redesign): a full-height photo with a brand line, the form beside it, perks and a help line */
.cg-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - var(--cg-header-h)); background: var(--cg-pearl); }
.cg-auth__m { position: relative; overflow: hidden; background: var(--cg-night); }
.cg-auth__m img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.cg-auth__m::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,17,26,0) 45%, rgba(22,17,26,.78) 100%); }
.cg-auth__mq { position: absolute; left: 48px; right: 48px; bottom: 48px; z-index: 1; display: flex; flex-direction: column; gap: 14px; color: var(--cg-inverse); }
.cg-auth__mq .cg-eyebrow, .cg-auth__mq .cg-it { color: var(--cg-champagne); }
.cg-auth__c { display: flex; align-items: center; justify-content: center; padding: 56px var(--cg-gutter); }
.cg-auth__in { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.cg-auth__eb { margin: 6px 0 0; }
.cg-auth__h { margin: 0 0 6px; }
.cg-auth__in form { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--cg-line); background: var(--cg-white); box-shadow: 0 12px 30px -14px rgba(183, 110, 121, .3); }
.cg-auth__note { margin: 0; }
.cg-auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cg-auth__fld { display: flex; flex-direction: column; gap: 6px; }
.cg-auth__fld .cg-select { width: 100%; height: 48px; padding-inline: 14px; font-size: 15px; }
.cg-auth__fld .cg-select:focus { outline: none; border-color: var(--cg-rose); box-shadow: 0 0 0 3px rgba(183, 110, 121, .15); }
.cg-auth__done { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--cg-blush); color: var(--cg-text); }
.cg-auth__done svg { flex: 0 0 auto; margin-top: 2px; color: var(--cg-accent); }
.cg-auth__done p { margin: 0; }
.cg-auth__perks { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.cg-auth__perks li { display: flex; gap: 14px; align-items: flex-start; }
.cg-auth__perks svg { flex: 0 0 auto; margin-top: 2px; color: var(--cg-rose); }
.cg-auth__perks span { display: flex; flex-direction: column; gap: 2px; }
.cg-auth__perks strong { font-weight: 500; font-size: 14px; }
.cg-auth__perks em { font-style: normal; font-size: 13px; color: var(--cg-text-2); }
.cg-auth__help { margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--cg-line); }
@media (max-width: 900px) {
  .cg-auth { grid-template-columns: 1fr; min-height: 0; }
  .cg-auth__m { height: 220px; }
  .cg-auth__mq { left: var(--cg-gutter); right: var(--cg-gutter); bottom: 22px; gap: 8px; }
  .cg-auth__mq .cg-d3 { font-size: 26px; }
  .cg-auth__c { padding: 28px var(--cg-gutter) 48px; }
  .cg-auth__in form { padding: 20px 18px; }
}
@media (max-width: 420px) { .cg-auth__row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- your account (signed in) */
.cg-acctx { padding-block: 40px 96px; background: var(--cg-pearl); }
.cg-acctx__band { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--cg-line); }
.cg-acctx__hi { display: flex; flex-direction: column; gap: 10px; }
.cg-acctx__hi .cg-eyebrow, .cg-acctx__hi p { margin: 0; }
.cg-acctx__h { margin: 0; }
.cg-acctx__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cg-acctx__side { display: flex; flex-direction: column; gap: 14px; }
.cg-acctx__card { display: block; padding: 24px; border: 1px solid var(--cg-line); background: var(--cg-white); }
.cg-acctx__card h2 { margin: 0 0 14px; }
.cg-acctx__ch { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cg-acctx__ch h2 { margin: 0; }
.cg-acctx__ol { margin: 0; padding: 0; list-style: none; }
.cg-acctx__ol a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid var(--cg-line); }
.cg-acctx__ol li:first-child a { border-top: 0; }
.cg-acctx__ol a:hover strong { color: var(--cg-rose); }
.cg-acctx__on { display: flex; flex-direction: column; gap: 2px; }
.cg-acctx__on strong { font-weight: 500; }
.cg-acctx__on em { font-style: normal; }
.cg-acctx__empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 16px 24px; }
.cg-acctx__empty p { margin: 0; max-width: 340px; }
.cg-acctx__empty .cg-btn { margin-top: 10px; }
.cg-acctx__ei { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--cg-blush); color: var(--cg-accent); margin-bottom: 4px; }
.cg-acctx__dl { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.cg-acctx__dl div { display: flex; flex-direction: column; gap: 2px; }
.cg-acctx__dl dd { margin: 0; word-break: break-word; }
.cg-acctx__link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; transition: border-color .2s ease, box-shadow .2s ease; }
.cg-acctx__link:hover, .cg-acctx__link:focus-visible { border-color: rgba(183, 110, 121, .5); box-shadow: 0 10px 24px -14px rgba(183, 110, 121, .4); }
.cg-acctx__link > svg { flex: 0 0 auto; color: var(--cg-text-2); transition: transform .2s ease; }
.cg-acctx__link:hover > svg { transform: translateX(3px); color: var(--cg-rose); }
.cg-acctx__li { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cg-acctx__li > svg { flex: 0 0 auto; color: var(--cg-rose); }
.cg-acctx__li > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-acctx__li strong { font-weight: 500; font-size: 14px; }
.cg-acctx__li em { font-style: normal; }
@media (max-width: 900px) {
  .cg-acctx { padding-block: 24px 64px; }
  .cg-acctx__grid { grid-template-columns: 1fr; }
  .cg-acctx__band { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .cg-acctx__link, .cg-acctx__link > svg { transition: none; } }
@media (max-width: 600px) { .cg-acctx__card { padding: 20px 18px; } .cg-acctx__link { padding: 16px 18px; } .cg-acctx__empty { padding: 24px 8px 12px; } }

/* Passwordless accounts (passwordless-account-spec.md, 31 Oct 2026). The recover panel and its
   "forgot password" link are gone with the password they belonged to; what is left is the line under the
   sign-in card that swaps between sign-in and create-account, the one-time welcome on /account, the order
   status pills, and the two little forms in the details and preferences cards. */
.cg-auth__swap { margin: 0; text-align: center; }
.cg-acctx__welcome { margin-bottom: 4px; }
.cg-acctx__st { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cg-acctx__pill { padding: 3px 9px; border: 1px solid var(--cg-line-strong); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.cg-acctx__pill--soft { border-color: var(--cg-line); color: var(--cg-text-2); }
.cg-acctx__pill--off { border-color: var(--cg-sale); color: var(--cg-sale); }
.cg-acctx__form { display: flex; flex-direction: column; gap: 12px; }
.cg-acctx__form .cg-btn { align-self: flex-start; }
.cg-acctx__saved { margin: -6px 0 12px; color: var(--cg-accent); }
.cg-acctx__so { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--cg-line); }
.cg-acctx__links { margin: 4px 0 0; }
@media (max-width: 600px) { .cg-acctx__st { justify-content: flex-start; } }

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

/* CAG-009 — the 404 search field was 162px wide, so its placeholder ("Search for a shape, a style,
   a stone…", 249px of text) was cut mid-sentence at "Search for a shape, a". The form already has
   max-width: 640px, but .cg-404__in is a centred flex COLUMN, so the form shrank to its content
   instead of taking that width. It now fills the column up to its own 640px cap, still centred. */
.cg-404 .cg-bigsearch { width: 100%; }

/* CAG-022 — the tag chip and "Back to the journal" sat at the page gutter (x=56 at 1366) while the
   article they belong to is a centred 648px column (x=394): .cg-article__body carries the column,
   those two carried only .cg-wrap. Same column, same edge, on every article. */
.cg-article__tags,
.cg-article__back { max-width: 648px; margin-inline: auto; }
