/* The download box in a post (inc/downloads.php). Centered, on a recessed sheet of the page's own
   paper, with the file's first page lying on it. Colors come from the site's variables; the
   second value is for the editor, where they do not exist. */
.tavla-dl {
  margin: 2.8rem 0;
  padding: 2.6rem 1.4rem 2.4rem;
  text-align: center;
  background: var(--bg-2, #f4f3f0);
  border-top: 1.5px solid var(--fg, #171614);
  border-bottom: 1px solid var(--hairline, rgba(23, 22, 20, .12));
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg, #171614) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg, #171614) 5%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
}
.tavla-dl > * { margin-left: auto; margin-right: auto; }
.tavla-dl-sheet { width: min(13.5rem, 62%); margin-bottom: 1.8rem; transform: rotate(-2deg); }
.tavla-dl-sheet img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hairline, rgba(23, 22, 20, .12));
  box-shadow: 0 1px 0 rgba(23, 22, 20, .06), 0 18px 34px -18px rgba(23, 22, 20, .35);
  background: #fbfbfa;
}
.tavla-dl .tavla-dl-label {
  font-family: "Geist Pixel", ui-monospace, Menlo, monospace;
  font-size: .72rem; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent, #fd6420); margin-bottom: .7rem;
}
.tavla-dl .tavla-dl-label::before { content: "( "; }
.tavla-dl .tavla-dl-label::after { content: " )"; }
.tavla-dl .tavla-dl-title,
.article.entry .tavla-dl .tavla-dl-title {
  font-family: "Clash Display", system-ui, sans-serif; font-weight: 600;
  font-size: clamp(1.7rem, 4.6vw, 2.3rem); line-height: 1.04; letter-spacing: -.01em;
  max-width: 16ch; margin: 0 auto .9rem; color: var(--fg, #171614);
}
.tavla-dl .tavla-dl-text { max-width: 38ch; font-size: 1.02rem; line-height: 1.55; color: var(--muted, rgba(23, 22, 20, .62)); margin-bottom: 0; }

.tavla-dl-form { max-width: 27rem; margin-top: 1.6rem; }
.tavla-dl-row { display: flex; gap: .6rem; }
.tavla-dl-row input {
  flex: 1; min-width: 0; padding: .85rem 1rem; font: inherit; font-size: 1rem; text-align: center;
  border: 1px solid var(--hairline, rgba(23, 22, 20, .12)); border-radius: 12px;
  background: var(--bg, #fbfbfa); color: var(--fg, #171614);
}
.tavla-dl-row input:focus { outline: none; border-color: var(--ink2, #0f1eaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink2, #0f1eaf) 22%, transparent); }
.tavla-dl-row input.invalid { border-color: var(--accent, #fd6420); }
.tavla-dl-row .btn { border-radius: 12px; }
@media (max-width: 520px) { .tavla-dl-row { flex-direction: column; } }
.tavla-dl-check {
  display: flex; gap: .6rem; align-items: flex-start; justify-content: center; text-align: left;
  margin-top: 1rem; font-size: .88rem; line-height: 1.5; color: var(--muted, rgba(23, 22, 20, .62));
}
.tavla-dl-check input { margin-top: .2em; width: 1.05em; height: 1.05em; accent-color: var(--accent, #fd6420); flex: none; }
.tavla-dl .tavla-dl-fine { margin-top: .9rem; margin-bottom: 0; font-size: .78rem; line-height: 1.5; color: var(--muted, rgba(23, 22, 20, .62)); }
.tavla-dl .tavla-dl-fine a { color: inherit; }
.tavla-dl .tavla-dl-message {
  margin-top: 1rem; margin-bottom: 0; padding: .8rem 1rem; font-size: .95rem; border-radius: 10px;
  background: var(--bg, #fbfbfa); border: 1px solid var(--hairline, rgba(23, 22, 20, .12)); color: var(--fg, #171614);
}
.tavla-dl-done { margin-top: 1.6rem; }
.tavla-dl .tavla-dl-done-title { font-family: "Clash Display", system-ui, sans-serif; font-weight: 600; font-size: 1.5rem; line-height: 1.1; margin-bottom: .5rem; color: var(--fg, #171614); }
.tavla-dl-done .tavla-dl-to { color: var(--fg, #171614); font-weight: 600; overflow-wrap: anywhere; }
.tavla-dl [hidden] { display: none; }
.tavla-dl-done > * { margin-left: auto; margin-right: auto; }
.article.entry > .tavla-dl { margin: 2.8rem 0; }

/* Inside a post, the article's own paragraph margins are stronger than the lines above:
   say the centering again with the article's weight, for every line of the box. */
.article.entry .tavla-dl p,
.article.entry .tavla-dl h2,
.article.entry .tavla-dl form,
.article.entry .tavla-dl .tavla-dl-done { margin-left: auto; margin-right: auto; text-align: center; }
.article.entry .tavla-dl .tavla-dl-check { text-align: left; }
.tavla-dl-done .tavla-dl-to { display: block; margin-top: .15rem; }
