/* Shared by the TV screen and the design picker in the app, so a swatch is
   drawn by the same rules as the real thing.

   A design is a set of custom properties (--bg, --fg, --accent, --soft, --shade,
   worked out in freshboard/designs.py) plus a few data attributes. --p is the
   size of one texture unit and --hair the width of a fine line; the screen sets
   them relative to the display, the picker sets them small. */

[data-pattern] {
  background-color: var(--bg);
  color: var(--fg);
}

/* Felt letterboard: fine horizontal grooves. */
[data-pattern="grooves"] {
  background-image: repeating-linear-gradient(
    transparent 0, transparent calc(var(--p) * 0.85),
    var(--shade) calc(var(--p) * 0.85), var(--shade) var(--p));
}

[data-pattern="grid"] {
  background-image:
    linear-gradient(var(--soft) var(--hair), transparent var(--hair)),
    linear-gradient(90deg, var(--soft) var(--hair), transparent var(--hair));
  background-size: calc(var(--p) * 3.5) calc(var(--p) * 3.5);
}

[data-pattern="dots"] {
  background-image: radial-gradient(var(--soft) 16%, transparent 17%);
  background-size: calc(var(--p) * 2.6) calc(var(--p) * 2.6);
}

/* Awning stripes. */
[data-pattern="stripes"] {
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0, transparent calc(var(--p) * 2.2),
    var(--soft) calc(var(--p) * 2.2), var(--soft) calc(var(--p) * 4.4));
}

/* A lit panel, darker toward the edges. */
[data-pattern="glow"] {
  background-image: radial-gradient(ellipse at center, transparent 40%, var(--shade) 100%);
}

/* A double keyline around the whole board, like a printed menu card. */
[data-pattern="frame"] {
  box-shadow:
    inset 0 0 0 calc(var(--p) * 1.3) var(--bg),
    inset 0 0 0 calc(var(--p) * 1.3 + var(--hair) * 2) var(--accent),
    inset 0 0 0 calc(var(--p) * 1.9) var(--bg),
    inset 0 0 0 calc(var(--p) * 1.9 + var(--hair)) var(--accent);
}

/* ---- a restaurant's own menu image with live prices placed on it ---------------
   The frame's font-size is 1% of its height, so a price's size and padding
   scale with the image wherever it is shown. */

.poster-frame { position: relative; }
.poster-frame > img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }

.price-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.06em 0.3em;
  border-radius: 0.12em;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
