/* The share card, and nothing else.
 *
 * In its own file because it is needed twice: once by the page that draws
 * the preview, and again inlined into the SVG the export hands to the
 * browser as an image. That image sees no stylesheets of its own, so
 * everything the card needs has to live here.
 *
 * This is the lab's card, ported (tools/lab/ui/card.css). A card saved from
 * the site and one saved from the lab are meant to be the same picture.
 */

/* The card's own faces, under their own names.
 *
 * The site takes the same three families from Google, and naming these
 * copies after them would have every problem page download both. Named
 * apart, nothing here is fetched until somebody actually opens a card, and
 * the export can inline them straight from this file. */
@font-face{font-family:'RMCardSerif';src:url(/fonts/Newsreader-400.woff2) format('woff2');
  font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'RMCardSerif';src:url(/fonts/Newsreader-500.woff2) format('woff2');
  font-weight:500;font-style:normal;font-display:swap;}
@font-face{font-family:'RMCardSans';src:url(/fonts/Archivo-400.woff2) format('woff2');
  font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'RMCardSans';src:url(/fonts/Archivo-600.woff2) format('woff2');
  font-weight:600;font-style:normal;font-display:swap;}
@font-face{font-family:'RMCardMono';src:url(/fonts/JetBrainsMono-400.woff2) format('woff2');
  font-weight:400;font-style:normal;font-display:swap;}

.sharecard{
  width:1080px; height:1080px;
  position:relative; overflow:hidden;
  display:flex; flex-direction:column;
  padding:70px 72px 62px;
  background:var(--cpaper); color:var(--cink);
  font-family:'RMCardSans', sans-serif;
  /* The serialised copy is laid out by the SVG renderer, which knows nothing
     of the page's own defaults. */
  box-sizing:border-box; line-height:1.5;
}
.sharecard *{box-sizing:border-box; margin:0; padding:0;}
/* The card borrows class names from the site -- .live, .choice and the rest
   -- and the site animates some of them. A .choice carries transition:.14s
   for every property, font-size included, so sizing the statement and
   measuring it in the same breath measured the animation halfway through:
   the card was fitted to a panel a third shorter than the one it ended up
   with, and the statement then spilled over the header. Nothing on a still
   picture has any business moving. */
.sharecard *, .sharecard *::before, .sharecard *::after{
  transition:none !important; animation:none !important;
}

.sharecard.dark{
  --cpaper:#0B0D10; --csurface:#14171B; --cink:#F0EFEA; --cink-2:#9BA2AA;
  --cink-3:#80878F; --cline:#232830; --cbrass:#CBA765;
}
.sharecard.light{
  --cpaper:#FCFBF8; --csurface:#FFFFFF; --cink:#16181B; --cink-2:#585E66;
  --cink-3:#696F77; --cline:#E5E3DC; --cbrass:#846526;
}

/* The category's colour, large enough to identify a card at thumbnail size
   before a word of it can be read. */
.sharecard .rule{position:absolute; top:0; left:0; right:0; height:10px; background:var(--c);}
.sharecard .wash{position:absolute; right:-200px; bottom:-200px; width:660px; height:660px;
  border-radius:50%; background:var(--c); opacity:.05;}

.sharecard .head{display:flex; align-items:center; justify-content:space-between; gap:20px;
  position:relative;}
.sharecard .brand{display:flex; align-items:center; gap:16px;}
.sharecard .brand svg{width:58px; height:58px; display:block;}
.sharecard .brand .word{font-family:'RMCardSerif', serif; font-size:33px; font-weight:500;
  letter-spacing:-.01em; color:var(--cink);}
.sharecard .kind{font-size:19px; letter-spacing:.15em; text-transform:uppercase;
  font-weight:600; color:var(--cink-3); white-space:nowrap;}

.sharecard .body{flex:1; min-height:0; display:flex; flex-direction:column;
  justify-content:center; padding:30px 0; position:relative;}
.sharecard .eyebrow{font-size:19px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--cink-3); font-weight:600; margin-bottom:18px;}
.sharecard .title{font-family:'RMCardSerif', serif; font-weight:500; font-size:52px;
  line-height:1.12; letter-spacing:-.02em; color:var(--cink); margin-bottom:26px;}

/* The problem panel, the same shape the site draws it in, scaled up. Anyone
   who has seen the site should recognise the card as the same object.
   flex-shrink:0 because the panel carries overflow:hidden for its rounded
   corners, and that makes its flex min-height resolve to zero: without it
   the panel quietly squeezes and clips the statement rather than reporting
   how tall it wants to be, and the fit has nothing to measure. */
.sharecard .live{border:1px solid var(--cline); background:var(--csurface);
  border-radius:8px; overflow:hidden; flex-shrink:0;}
.sharecard .live-top{display:flex; align-items:center; justify-content:space-between;
  gap:14px; padding:22px 34px; border-bottom:1px solid var(--cline);
  background:var(--cbg);}
.sharecard .live-src{font-family:'RMCardMono', monospace; font-size:21px;
  letter-spacing:.09em; text-transform:uppercase; color:var(--c);}
.sharecard .live-rate{font-family:'RMCardMono', monospace; font-size:22px;
  color:var(--cbrass);}
.sharecard .live-body{padding:38px 34px 34px; display:flex; gap:26px;}
.sharecard .spine{width:6px; background:var(--cline); border-radius:3px; flex-shrink:0;
  position:relative;}
.sharecard .spine i{position:absolute; bottom:0; left:0; right:0; background:var(--c);
  border-radius:3px; display:block;}
.sharecard .live-main{flex:1; min-width:0;}
.sharecard .live-q{font-family:'RMCardSerif', serif; line-height:1.5; color:var(--cink);
  white-space:pre-line;}
.sharecard .live-q b,.sharecard .live-q strong{font-weight:500;}

/* Lists written as \begin{enumerate} or \itemize, the same shape proseHtml
   gives them on the page. */
.sharecard .lx-list{margin:.5em 0; padding-left:1.4em; white-space:normal;}
.sharecard .lx-list .lx-list{margin:.3em 0 0;}
.sharecard .lx-list li{margin:.25em 0;}
.sharecard .lx-list li.lx-custom{list-style:none; position:relative;}
.sharecard .lx-list li.lx-custom > .lx-mark{position:absolute; right:100%;
  padding-right:.4em; white-space:nowrap;}

.sharecard .choices{display:grid; grid-template-columns:1fr 1fr; gap:14px 28px; margin-top:28px;}
.sharecard .choice{font-family:'RMCardSerif', serif; color:var(--cink-2); display:flex; gap:12px;}
.sharecard .choice b{color:var(--c); font-weight:600;}
.sharecard .figure{margin-top:26px; display:flex; justify-content:center;}
.sharecard .figure svg{max-width:100%; max-height:300px; height:auto; color:var(--cink);}

.sharecard .foot{display:flex; align-items:flex-end; position:relative;}
.sharecard .site .url{font-family:'RMCardMono', monospace; font-size:26px;
  color:var(--cink-2);}
.sharecard .site .cta{font-size:20px; color:var(--cink-3); margin-top:6px;}

/* Display maths in a card has room, but a very wide expression still has to
   sit inside the panel rather than run off the edge of the image. */
.sharecard .katex-display{margin:14px 0; display:flex; justify-content:center;}
.sharecard .katex{font-size:1.02em;}

/* A link in a statement is still a link on the page it came from, but on a
   picture it is only words. Underlined, in the card's own ink, rather than
   in the browser's link blue. */
.sharecard a{color:inherit; text-decoration:underline; text-underline-offset:2px;}
.sharecard .plink.ext::after{content:none;}
