/* The Synap: the shared phone card (template-parts/phone-card.php), handle 'synap-catalogue-card'.
   Paper on the light reading surface, after the homepage's cards: a white sheet with a thin bezel around the
   photo, the brand as a small label, the name in Space Grotesk, a few quiet specs, the price and the arrow.
   Hover: the name turns orange, the arrow fills brand orange, the photo eases in 4% inside its frame.
   The name's link stretches over the whole card, so one tab stop and one clear name per phone. */

.ct-card {
  --ct-paper: #fff; --ct-line: rgba(0,0,0,.08); --ct-mute: #646464; --ct-ph: rgba(0,0,0,.05); --ct-tag: rgba(0,0,0,.78); --ct-tag-line: rgba(0,0,0,.18);
  --ct-lift: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.05);
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%;
  padding: .375em; border-radius: 1.75em; background: var(--ct-paper); color: var(--ink);
  box-shadow: var(--ct-lift), inset 0 0 0 1px var(--ct-line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ct-card { --ct-paper: #0e0e0e; --ct-line: rgba(255,255,255,.1); --ct-mute: #a7a7a7; --ct-ph: rgba(255,255,255,.06); --ct-tag: rgba(255,255,255,.85); --ct-tag-line: rgba(255,255,255,.24); --ct-lift: 0 0 0 0 transparent; }
}

/* photo: sample photos fill the box, real product shots sit on white */
.ct-card__ph { position: relative; flex: none; aspect-ratio: 1 / 1; border-radius: calc(1.75em - .375em); background: var(--ct-ph); color: var(--ct-mute); display: grid; place-items: center; }
.ct-card__ph > img { position: absolute; inset: 0; }
.ct-card .hp-ph img { transition: transform .7s cubic-bezier(.22,1,.36,1); }
.ct-card .hp-ph.is-product { background: #fff; }
.ct-noimg { width: 22%; height: auto; opacity: .45; }

/* status on the photo: Upcoming (with an orange dot: it is the thing to know), New, Discontinued */
.ct-card__badge { position: absolute; top: .75em; left: .75em; z-index: 1; display: inline-flex; align-items: center; gap: .45em; max-width: calc(100% - 1.5em); padding: .45em .8em; border-radius: 999px; background: #fff; color: #000; font-size: var(--t-label); font-weight: 600; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.ct-card__badge.is-up::before { content: ""; flex: none; width: .55em; height: .55em; border-radius: 50%; background: #E85002; }
.ct-card__rank { position: absolute; top: 1.1em; right: 1.1em; z-index: 1; display: grid; place-items: center; min-width: 2.4em; height: 2.4em; padding: 0 .5em; border-radius: 999px; background: #fff; color: #000; font-family: var(--display); font-weight: 500; font-size: var(--t-ui); letter-spacing: -0.02em; box-shadow: 0 2px 10px rgba(0,0,0,.12); }

/* words */
.ct-card__body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 1em .85em .7em; }
.ct-card__brand { font-size: var(--t-label); font-weight: 600; line-height: 1.2; letter-spacing: .02em; color: var(--ct-mute); }
.ct-card__name { margin: .45em 0 0; font-family: var(--display); font-weight: 500; font-size: var(--t-card-title); line-height: 1.15; letter-spacing: -0.02em; color: inherit; overflow-wrap: anywhere; }
.ct-card__brand + .ct-card__name { margin-top: .4em; }
.ct-card__body > .ct-card__name:first-child { margin-top: 0; }
.ct-card__link { color: inherit; text-decoration: none; transition: color .25s ease; }
.ct-card__link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.ct-card__note { align-self: flex-start; margin-top: .6em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ct-card .hp-tagpill { color: var(--ct-tag); box-shadow: inset 0 0 0 1px var(--ct-tag-line); }
.ct-card__status { margin-top: .35em; font-size: var(--t-meta); font-weight: 600; color: var(--ct-mute); }
.ct-card__status.is-up { color: var(--acc-text); }
.ct-card__specs { display: grid; gap: .2em; margin: .7em 0 0; padding: 0; list-style: none; font-size: var(--t-meta); line-height: 1.35; color: var(--ct-mute); }
.ct-card__specs li { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* price and arrow */
.ct-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .6em; margin-top: auto; padding-top: 1em; }
.ct-card__price { margin: 0; min-width: 0; font-size: var(--t-ui); line-height: 1.3; font-variant-numeric: tabular-nums; }
.ct-card__price b { font-weight: 600; white-space: nowrap; }
.ct-card__pre { font-size: var(--t-meta); font-weight: 500; color: var(--ct-mute); }
.ct-card__was { margin-left: .35em; font-size: var(--t-meta); font-weight: 500; color: var(--ct-mute); white-space: nowrap; }
.ct-card__na { font-size: var(--t-meta); font-weight: 500; color: var(--ct-mute); }
.ct-card .sy-go { width: 2.5em; height: 2.5em; background: var(--ink); color: var(--bg); }

/* hover and keyboard focus: same treatment, plus a ring for the keyboard */
.ct-card:hover .ct-card__link, .ct-card:has(.ct-card__link:focus-visible) .ct-card__link { color: var(--acc-text); }
.ct-card:hover .sy-go, .ct-card:has(.ct-card__link:focus-visible) .sy-go { background: #E85002; color: #fff; }
.ct-card:hover .sy-go svg, .ct-card:has(.ct-card__link:focus-visible) .sy-go svg { transform: rotate(45deg); }
.ct-card:hover .hp-ph img, .ct-card:has(.ct-card__link:focus-visible) .hp-ph img { transform: scale(1.04); }
.ct-card__link:focus-visible { outline: 0; }
.ct-card:has(.ct-card__link:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }

/* compact: photo, name, price */
.ct-card--compact .ct-card__body { padding: .85em .75em .6em; }
.ct-card--compact .ct-card__name { font-size: var(--t-ui); font-family: var(--font); font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.ct-card--compact .ct-card__foot { padding-top: .5em; }

/* row: for ranked lists */
.ct-card--row { flex-direction: row; align-items: center; gap: 1em; padding: .5em 1em .5em .5em; border-radius: 1.4em; }
.ct-card--row .ct-card__ph { width: 4.8em; border-radius: .95em; }
.ct-card--row .ct-card__rank { position: static; flex: none; min-width: 1.6em; height: auto; padding: 0 0 0 .5em; background: none; box-shadow: none; color: var(--ct-mute); font-size: calc(var(--t-big) * .62); letter-spacing: -0.04em; }
.ct-card--row .ct-card__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1em; align-items: center; padding: .3em 0; }
.ct-card--row .ct-card__body > * { grid-column: 1; }
.ct-card--row .ct-card__foot { grid-column: 2; grid-row: 1 / span 6; margin: 0; padding: 0; gap: 1em; }
.ct-card--row .ct-card__specs { display: flex; flex-wrap: wrap; gap: 0 .9em; margin-top: .35em; }
.ct-card--row .ct-card__specs li { flex: none; max-width: 100%; }
.ct-card--row .ct-card__note { justify-self: start; }
.ct-card--row .ct-card__price { text-align: right; }
.ct-card--row .ct-card__pre, .ct-card--row .ct-card__was { display: block; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .ct-card .hp-ph img, .ct-card__link { transition: none; }
  .ct-card:hover .hp-ph img, .ct-card:has(.ct-card__link:focus-visible) .hp-ph img { transform: none; }
}
@media (pointer: coarse) {
  .ct-card .sy-go { width: 2.75em; height: 2.75em; }
}
/* phones: two cards a row, so a little tighter; rows put the price under the name */
@media (max-width: 560px) {
  .ct-card__body { padding: .8em .6em .55em; }
  .ct-card__badge { top: .55em; left: .55em; padding: .4em .65em; letter-spacing: .04em; }
  .ct-card__specs li:nth-child(3) { display: none; }
  .ct-card__foot { padding-top: .8em; }
  .ct-card .sy-go { width: 2.3em; height: 2.3em; }
  .ct-card--row .ct-card__body { grid-template-columns: minmax(0, 1fr); }
  .ct-card--row .ct-card__foot { grid-column: 1; grid-row: auto; margin-top: .4em; }
  .ct-card--row .ct-card__price { text-align: left; }
  .ct-card--row .ct-card__pre, .ct-card--row .ct-card__was { display: inline; }
  .ct-card--row .ct-card__foot .sy-go { display: none; }
}
@media (max-width: 400px) {
  .ct-card__when { display: none; }
  .ct-card .sy-go { display: none; }
  .ct-card__price { font-size: var(--t-meta); }
  .ct-card__price b { font-size: var(--t-ui); }
}
