/* Anchor Alert design site. Pico 2.1.1 in dark, the house tweak sheet, then the
   pieces the design pages draw with. Colours are the app's, from
   AnchorAlertWidgets/BrandPalette.swift: link blue for the accent, MarNav's
   chrome grey, and the ramps' green, amber and red. */
/* cspell:ignore nums dont -- CSS's tabular-nums, and "don't" as a class name. */

:root[data-theme="dark"] {
  --pico-primary: #5b9bd5;
  --pico-primary-background: #5b9bd5;
  --pico-primary-border: #5b9bd5;
  --pico-primary-underline: rgba(91, 155, 213, 0.5);
  --pico-primary-hover: #8dbbe5;
  --pico-primary-hover-background: #8dbbe5;
  --pico-primary-hover-border: #8dbbe5;
  --pico-primary-inverse: #000;
  --pico-primary-focus: rgba(91, 155, 213, 0.35);
  --pico-background-color: #141318;
  --pico-card-background-color: #24222b;
  --pico-card-sectioning-background-color: #2b2933;
}

/* The page is the app's dark appearance: iOS's grouped black, with the bar's chrome grey on top. */
body {
  background: linear-gradient(#26242c 0, #141318 320px) no-repeat, #141318;
  min-height: 100vh;
}

/* House tweak sheet: see Workshop Web/house-style.md. */
h1,
h2,
h3,
h4 {
  margin-bottom: 0.2em;
}
hgroup h1,
hgroup h2,
hgroup h3,
hgroup h4 {
  margin-bottom: 0;
}
table td {
  vertical-align: top;
}
table th {
  font-weight: bold;
}
table {
  --pico-background-color: transparent;
}

h2 {
  margin-top: 2.5rem;
}
.lede {
  font-size: 1.2rem;
}
.muted {
  color: var(--pico-muted-color);
}
.site-title img {
  border-radius: 22%;
  vertical-align: middle;
}
.feedback {
  border-left: 4px solid var(--pico-primary);
  background: var(--glass);
  padding: 1rem 1.25rem;
  border-radius: 16px;
}

/* App tokens, for the samples on the design pages. */
:root {
  --accent: #5b9bd5;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --secondary: rgba(235, 235, 245, 0.6);
  --chrome: #373340;
  --green3: #0fa97c;
  --green4: #1c7b5a;
  --amber3: #f5a524;
  --amber4: #bc7800;
  --red3: #d93a2b;
  --red4: #a1281b;
  --red5: #5e1b13;
  --ok: var(--green3);
  --caution: var(--amber3);
  --warning: var(--amber3);
  --radius: 16px;
  --sans: -apple-system, "SF Pro Text", system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
}

/* Feature cards with a picture, and screenshot galleries. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.features article {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: none;
}
.features article img {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: 0;
}
.features article div {
  padding: 0.9rem 1rem 1rem;
}
.features article h3 {
  font-size: 1.05rem;
}
.features article p {
  font-size: 0.9rem;
  margin: 0;
}
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
figure {
  margin: 0;
}
figure img,
.shots img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.6rem;
  box-shadow: 0 0 1px #777;
}
figcaption {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin-top: 0.4rem;
}

/* Design pages. */
.ds code {
  color: var(--pico-primary);
}
.rule {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
}
.rule b {
  color: var(--accent);
}
.conflict {
  background: rgba(245, 165, 36, 0.07);
  border: 1px solid rgba(245, 165, 36, 0.35);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.92rem;
}
.conflict b:first-child {
  color: var(--warning);
}
.cols {
  display: grid;
  gap: 12px;
}
.g2 {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}
.g3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.g4 {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 16px;
}
.card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}
.card p {
  font-size: 0.92rem;
  margin: 6px 0 0;
}
td.spec,
td.use {
  font-size: 0.85rem;
  color: var(--secondary);
}

/* Type samples, at the app's default Dynamic Type sizes. */
.t-large { font-size: 34px; font-weight: 700; }
.t-title { font-size: 28px; }
.t-title2 { font-size: 22px; }
.t-title3 { font-size: 20px; }
.t-body { font-size: 17px; }
.t-headline { font-size: 17px; font-weight: 600; }
.t-callout { font-size: 16px; }
.t-sub { font-size: 15px; }
.t-foot { font-size: 13px; }
.t-caption { font-size: 12px; }
.t-caption2 { font-size: 11px; }
.rounded { font-family: var(--rounded); }
.sec { color: var(--secondary); }
.mono { font-variant-numeric: tabular-nums; }

/* Colour swatches. */
.swatch {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--glass);
}
.swatch .chip {
  height: 84px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  font: 600 13px ui-monospace, Menlo, monospace;
}
.swatch .meta {
  padding: 10px 12px 12px;
}
.swatch .meta b {
  display: block;
  font: 600 14px ui-monospace, Menlo, monospace;
  color: #fff;
}
.swatch .meta span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: var(--secondary);
}

/* A glass panel, drawn the way SectionPanel draws one. */
.panel {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 370px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.panel .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 17px;
}
.panel .row:first-of-type {
  border-top: 0;
}
.panel .row .v {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.panel .row .v small {
  display: block;
  font-size: 12px;
  color: var(--secondary);
}
.footer-sample {
  font-size: 11px;
  color: var(--secondary);
  padding: 8px 16px;
  max-width: 370px;
}

/* Spacing scale. */
.space {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
  font: 13px ui-monospace, Menlo, monospace;
  color: var(--secondary);
}
.space i {
  display: block;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.example {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--glass-edge);
}
.example h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.example p {
  font-size: 0.95rem;
  margin: 4px 0;
}
.dodont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.do,
.dont {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--glass-edge);
  background: var(--glass);
}
.do b {
  color: var(--ok);
}
.dont b {
  color: var(--warning);
}
.do code,
.dont code {
  display: block;
  margin-top: 6px;
  white-space: pre;
  background: none;
  padding: 0;
  overflow-x: auto;
}
.icons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.icons img {
  width: 96px;
  border-radius: 22%;
}
@media (max-width: 720px) {
  .example,
  .dodont {
    grid-template-columns: 1fr;
  }
  .g2 {
    grid-template-columns: 1fr;
  }
}

/* Picture viewer (gallery.js). */
dialog.lightbox {
  background: rgba(0, 0, 0, 0.92);
  padding: 0;
  display: none;
}
dialog.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}
dialog.lightbox figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100vh;
}
dialog.lightbox img {
  max-width: 82vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
}
dialog.lightbox figcaption {
  max-width: 60ch;
  text-align: center;
  font-size: 1rem;
  color: #fff;
  margin-top: 0.6rem;
}
dialog.lightbox button {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
  flex: none;
}
dialog.lightbox .lb-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
}
dialog.lightbox .lb-count {
  position: fixed;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

/* Palette page: ink drawn on both page backgrounds, and who wears each colour. */
.swatch .meta span.step {
  font: 12px ui-monospace, Menlo, monospace;
  margin-bottom: 4px;
}
.swatch .meta span.worn {
  margin-top: 6px;
  font-size: 12px;
}
.unused {
  color: var(--amber3);
}
.inks {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ink {
  height: 84px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-weight: 700;
}
.ink small {
  font: 600 11px ui-monospace, Menlo, monospace;
  color: #888;
}
.ink .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-bottom: 6px;
}

/* A status dot beside a word in a table. */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
