/* The ATC brand on the public status page (DESIGN.md).
 *
 * Gatus serves this file at /css/custom.css (config.yaml.tftpl, ui.custom-css).
 * The fonts and the logo are under /brand/, which CloudFront serves from the
 * brand bucket (brand.tf), not from the box.
 *
 * Gatus draws its UI with Tailwind over HSL triples in CSS variables. This file
 * sets those variables to the DESIGN.md role tokens, light and dark, and
 * removes the radius, the shadows and the glass that DESIGN.md does not allow.
 * The selectors below name Gatus classes from the pinned release
 * (cloud/pins.json). After a Gatus bump, look at the live page again.
 *
 * Kept from Gatus: the green and red of the result bars and the status badge.
 * They are status semantics, not chrome.
 */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/brand/geist-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/brand/geistmono-latin.woff2') format('woff2');
}

/* The role tokens, light. HSL of: white, graphite, bone, slate, linen, red. */
html:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 14.1%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 14.1%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 14.1%;
  --primary: 0 0% 14.1%;
  --primary-foreground: 0 0% 100%;
  --secondary: 40 42.9% 90.4%;
  --secondary-foreground: 0 0% 14.1%;
  --muted: 40 42.9% 90.4%;
  --muted-foreground: 0 0% 27.5%;
  --accent: 40 42.9% 90.4%;
  --accent-foreground: 0 0% 14.1%;
  --destructive: 359.6 77% 41%;
  --destructive-foreground: 0 0% 100%;
  --border: 48 13.3% 77.8%;
  --input: 48 13.3% 77.8%;
  --ring: 0 0% 14.1%;
  --radius: 0;
}

/* The role tokens, dark. HSL of: graphite, linen, #302E2B, stone, slate,
 * #F76753. */
html:root.dark {
  --background: 0 0% 14.1%;
  --foreground: 48 13.3% 77.8%;
  --card: 0 0% 14.1%;
  --card-foreground: 48 13.3% 77.8%;
  --popover: 0 0% 14.1%;
  --popover-foreground: 48 13.3% 77.8%;
  --primary: 48 13.3% 77.8%;
  --primary-foreground: 0 0% 14.1%;
  --secondary: 36 5.5% 17.8%;
  --secondary-foreground: 48 13.3% 77.8%;
  --muted: 36 5.5% 17.8%;
  --muted-foreground: 60 4.6% 61.8%;
  --accent: 36 5.5% 17.8%;
  --accent-foreground: 48 13.3% 77.8%;
  --destructive: 7.3 91.1% 64.7%;
  --destructive-foreground: 0 0% 14.1%;
  --border: 0 0% 27.5%;
  --input: 0 0% 27.5%;
  --ring: 48 13.3% 77.8%;
}

body,
input,
select,
button {
  font-family: 'Geist', Arial, sans-serif;
}

/* No radius anywhere, no drop shadow, no hover lift. Focus rings stay: they
 * are box-shadows too, so only the shadow half is cleared. */
*,
*::before,
*::after {
  border-radius: 0 !important;
  --tw-shadow: 0 0 #0000 !important;
  --tw-shadow-colored: 0 0 #0000 !important;
}

.endpoint:hover {
  transform: none !important;
}

/* Weights are 400 and 500 only. */
.font-bold,
.font-semibold {
  font-weight: 500 !important;
}

h1 {
  letter-spacing: -0.03em;
}

/* The page title takes the DESIGN.md compact section head, so the long title
 * fits in two lines at phone width. */
.dashboard-container h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.12;
}

/* The header: a solid bar, not glass. The wordmark replaces the Gatus logo,
 * graphite on light and warm white on dark. The image itself is hidden: Gatus
 * gives it the alt text "Gatus". The header text beside it names the page. */
header {
  background-color: hsl(var(--background)) !important;
  backdrop-filter: none !important;
}

header .w-12.h-12 {
  width: 88px;
  height: 32px;
  background: url('/brand/logo-graphite.svg') left center / contain no-repeat;
}

.dark header .w-12.h-12 {
  background-image: url('/brand/logo-warmwhite.svg');
}

header .w-12.h-12 img {
  visibility: hidden;
}

/* The wordmark alone in the bar. The header text stays for screen readers
 * only, because the wordmark image is hidden. */
header h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* No subheading under the page title. */
.dashboard-container h1 + p {
  display: none;
}

/* Machine text: the hostname under each probe, and the times under its bars. */
.endpoint .text-muted-foreground {
  font-family: 'Geist Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/* A bar slot with no result yet: bone, not the Tailwind blue-grey. */
.endpoint .bg-gray-200 {
  background-color: hsl(var(--muted));
}

.dark .endpoint .bg-gray-200 {
  background-color: hsl(var(--muted));
}

.dark .endpoint:hover {
  border-color: hsl(var(--muted-foreground));
}

/* The response time chart draws in a fixed Tailwind blue on a canvas, which
 * CSS cannot recolour. Grey removes the blue. The cost: its rare red incident
 * markers go grey too. The bars, the badge and the event list keep the red. */
canvas {
  filter: grayscale(1);
}

/* The footer credit takes the ink, not an emerald link. The Gatus GitHub
 * corner link goes. */
footer a {
  color: inherit !important;
}

footer a:hover {
  color: hsl(var(--destructive)) !important;
}

#social {
  display: none;
}
