/*
 * The blog: a list of posts, and a post. Both are read, so both are set by
 * pages.css; this is only what a post has that a policy does not. The pages
 * themselves are written by tools/blog.py from the markdown in blog/.
 */

/* A post's title is a sentence, not a word, so it is set smaller than
   "Privacy" is. */
.post h1 {
  font-size: clamp(2.5rem, 6.5vw, 4.25rem);
  line-height: 0.98;
}

.post .updated {
  margin: 0 0 1.25rem;
}

.post .updated a {
  text-decoration-thickness: 1px;
}

.post .lead {
  margin-bottom: 2.5rem;
}

.post blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: var(--rule) solid var(--ink);
}

.post blockquote p {
  color: var(--ink);
  font: 800 clamp(1.5rem, 3vw, 2rem)/1.1 var(--display);
  letter-spacing: -0.02em;
}

.post hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--hair);
}

.post pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--hair);
  background: var(--paper2);
  font-size: 0.9375rem;
}

/* A picture in a post that is not him: a still, a sheet, a before and after. */
.post .shot {
  margin: 2rem 0;
}

.post .shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.post .shot.ruled img {
  border: 1px solid var(--hair);
}

.post .shot.narrow img {
  max-width: 22rem;
  margin: 0 auto;
}

.post .shot figcaption {
  margin-top: 0.75rem;
  color: var(--ink2);
  font-size: 0.9375rem;
}

/* A video: one phone, the home page's (starts.css), with a 9:16 screen. */
.post .film {
  max-width: 20rem;
  margin: 0 auto 1rem;
}

.post .film-screen {
  aspect-ratio: 9 / 16;
}

.post .facts {
  margin: 0 0 2.5rem;
  color: var(--ink2);
  font-family: var(--mono);
  font-size: 0.875rem;
  text-align: center;
}

.post .post-action {
  margin: 2rem 0;
}

.post .signed {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  color: var(--ink2);
  font: 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Him, in a post. His ground is paper and his frame is ink, as on How it
   works; the square holds the still and the canvas tour.js lays over it. */
.him {
  margin: 2.5rem 0;
}

.him .stage {
  --tall: 20rem;
  position: relative;
  overflow: hidden;
  height: var(--tall);
  border: var(--rule) solid var(--ink);
  background: var(--stage);
}

.him .frame {
  position: absolute;
  left: 50%;
  top: 50%;
  /* A little more of the square than How it works shows: in a post he also
     stands and throws his arms up, and standing he is a head taller. */
  width: min(44rem, 150%, calc(var(--tall) * 1.5));
  aspect-ratio: 1;
  transform: translate(-50%, -57%);
}

.him img,
.him canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.him canvas {
  transition: opacity 200ms ease;
}

.him figcaption {
  margin-top: 0.75rem;
  color: var(--ink2);
  font: 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* What he says, beside him on a wide page and over him on a phone. It is
   his line, so it is in the display face, like the block's. */
.him .says {
  position: absolute;
  inset: 1.25rem 1.25rem auto;
  max-width: none;
  color: var(--stage-ink);
  font: 800 clamp(1.375rem, 5.5vw, 1.75rem)/1.05 var(--display);
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}

.him.speaks .stage {
  --tall: 24rem;
}

.him.speaks .frame {
  transform: translate(-50%, -46%);
}

@media (min-width: 48rem) {
  .him .stage {
    --tall: 24rem;
  }

  .him.speaks .frame {
    left: 27%;
    transform: translate(-50%, -57%);
  }

  .him .says {
    inset: 0 1.5rem 0 61%;
    display: grid;
    align-content: center;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    text-align: left;
  }
}

/* Small, he stands beside the words with no stage round him. */
.him.small {
  float: right;
  width: 9rem;
  margin: 0 0 1rem 1.25rem;
}

.him.small .stage {
  --tall: 9rem;
  border: 0;
  background: none;
}

/* With no stage to be cut by, what stands beside him has to fit too. */
.him.small .frame {
  width: calc(var(--tall) * 1.25);
  transform: translate(-52%, -58%);
}

@media (min-width: 48rem) {
  .him.small {
    width: 12rem;
    margin-right: -2rem;
  }

  .him.small .stage {
    --tall: 12rem;
  }
}

.post .signed {
  clear: both;
}

/* The list: each post under a rule, the newest first. */
.legal .post-list {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.legal .post-list li {
  max-width: none;
  padding: 1.5rem 0 2rem;
  border-top: var(--rule) solid var(--ink);
}

.legal .post-list li + li {
  margin-top: 0;
}

.post-list time {
  color: var(--ink2);
  font: 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal .post-list h2 {
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  border: 0;
}

.legal .post-list h2 a {
  text-decoration: none;
}

.legal .post-list h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--lava);
  text-underline-offset: 0.15em;
}

/* A post that has its own Sam is led by him in the list. */
.legal .post-list li.led {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1.5rem;
  align-items: center;
}

.post-list .led > :not(.him):not(.art) {
  grid-column: 1;
}

.post-list .led .him,
.post-list .led .art {
  grid-column: 2;
  grid-row: 1 / span 3;
  float: none;
  margin: 0;
}

.post-list .led .art {
  width: 9rem;
}

@media (max-width: 30rem) {
  .post-list .led .him,
  .post-list .led .art {
    width: 6.5rem;
  }

  .post-list .led .him .stage {
    --tall: 6.5rem;
  }
}

/* A table in a post. On a phone pages.css turns a table into a list and
   labels the privacy policy's columns; a post's cells carry their own. */
@media (max-width: 44rem) {
  .legal.post td:nth-child(n)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    color: var(--ink2);
    font: 0.75rem/1.4 var(--mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .legal.post td + td {
    margin-top: 0.75rem;
  }

  .legal.post td:first-child::before {
    content: none;
  }
}

/* A comparison, "Ahonui vs Opal": a post without a date or a signature.
   Where the signature would be is when it was checked, as a sentence. */
/* A page's own picture of him (`art:`), drawn on his stage's paper, so it
   takes the same ink frame his stage has. Beside an entry in a list it sits
   where his still would, unframed, as the small one does. */
.art {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0;
  border: var(--rule) solid var(--ink);
  background: var(--stage);
}

.art img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 20rem;
  object-fit: contain;
  /* His picture's paper is the stage's to a shade, not to the pixel: the
     edges fade so no square shows round him. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}

.art.small {
  display: block;
  border: 0;
  background: none;
}

.art.small img {
  width: 100%;
  height: auto;
  -webkit-mask-image: none;
  mask-image: none;
}

/* A comparison (blog.py, compare_table): framed in ink as his stage is,
   the questions set as headings, and Ahonui's column a strip of his stage
   through the paper, the one to read first. A Yes is a filled square and a
   No an empty one; what qualifies either sits under it, smaller. */
.compare {
  margin: 2rem 0 2.5rem;
  overflow-x: auto;
}

.compare table {
  width: 100%;
  min-width: 32rem;
  border: var(--rule) solid var(--ink);
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.compare th,
.compare td {
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--hair);
  color: var(--ink2);
  text-align: left;
  vertical-align: top;
}

.compare thead th,
.compare thead td {
  padding-block: 1.1rem 0.9rem;
  border-top: 0;
  border-bottom: var(--rule) solid var(--ink);
  color: var(--ink2);
  font: 0.75rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: bottom;
}

.compare tbody th {
  width: 30%;
  color: var(--ink);
  font: 800 1.0625rem/1.2 var(--display);
  letter-spacing: -0.015em;
}

/* Two answers side by side get the same room, whichever says more. */
.compare:not(.wide) td {
  width: 35%;
}

.compare .us {
  border-inline: var(--rule) solid var(--ink);
  background: var(--stage);
  color: var(--ink);
}

.compare thead .us {
  color: var(--ink);
  font: 800 1.5rem/1 var(--display);
  letter-spacing: -0.03em;
  text-transform: none;
}

.compare .stop {
  color: var(--lava);
}

.compare .mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 700;
}

.compare .mark::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  box-sizing: border-box;
  border: 2px solid var(--ink);
}

.compare .mark.yes::before {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23f6f1e7' stroke-width='2.5' stroke-linecap='square'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.compare .mark.no {
  color: var(--ink3);
  font-weight: 400;
}

.compare .mark.no::before {
  border-color: var(--ink3);
}

.compare .more {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink2);
  font-size: 0.875rem;
  font-weight: 400;
}

/* The hub's table has every app in it: on a wide screen it leaves the
   column for the page's width, so its answers are not a word a line. */
@media (min-width: 64rem) {
  .compare.wide {
    width: min(72rem, 100vw - 2 * var(--gutter));
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .compare.wide tbody th {
    width: 14%;
  }
}

/* On a phone, a question at a time: the question, then each app's answer
   under its name, Ahonui's on its strip. */
@media (max-width: 44rem) {
  .compare {
    overflow: visible;
  }

  .compare table,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
    width: auto;
    min-width: 0;
  }

  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .compare tr + tr {
    border-top: var(--rule) solid var(--ink);
  }

  .compare tbody th,
  .compare td {
    border: 0;
    padding: 0.75rem 1rem;
  }

  .compare tbody th {
    width: auto;
    padding-top: 1rem;
  }

  .compare .us {
    border-block: 1px solid var(--hair);
    border-inline: 0;
  }

  .legal.post .compare td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink2);
    font: 0.75rem/1.4 var(--mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}
