/**
 * @file
 * Base styles: reset, colours, type scale.
 */

:root {
  /* Task Democracy palette: black on white, colour comes from the logo. */
  --color-primary: #111111;
  --color-primary-dark: #000000;
  --color-accent: #336797;        /* logo blue, used for focus and hover */
  --color-text: #111111;
  --color-heading: #000000;
  --color-muted: #5f6368;
  --color-border: #d9d9d9;
  --color-bg: #ffffff;
  --color-bg-alt: #f4f4f2;
  --color-footer: #ffffff;
  --color-footer-bottom: #ffffff;
  --color-footer-text: #111111;

  /* Spacing taken from the 1905 px wide design, scaled to the viewport. */
  --page-gutter: max(20px, 3.7vw);   /* header edges: 70 px in the design */
  --content-gutter: max(20px, 9.3vw); /* text column: 178 px in the design */
  --container: 1920px;
  --gutter: clamp(20px, 3.8vw, 72px);
  --radius: 3px;
  --text-large: clamp(1.125rem, 0.55rem + 1.15vw, 2rem); /* intro text */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 1.0625rem; /* 17px – Katha reads best a touch larger */
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5, h6 { font-size: 1rem; }

p, ul, ol, dl, blockquote, pre, table, figure {
  margin: 0 0 1.25em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

img,
video {
  max-width: 100%;
  height: auto;
}

blockquote {
  border-left: 4px solid var(--color-border);
  padding: 0.5em 1.25em;
  color: var(--color-muted);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.6em 0.75em;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  background: var(--color-bg-alt);
  padding: 1em;
  overflow: auto;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  font: inherit;
  max-width: 100%;
  padding: 0.5em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

button,
input[type="submit"],
input[type="button"],
.button {
  font: inherit;
  display: inline-block;
  cursor: pointer;
  padding: 0.55em 1.4em;
  color: #fff;
  background: var(--color-primary);
  border: 0;
  border-radius: 999px;
  transition: background 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
.button:hover {
  background: var(--color-primary-dark);
  color: #fff;
  text-decoration: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.visually-hidden.focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  clip: auto;
}

.skip-link:focus {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 0.5em 1em;
  background: #000;
  color: #fff;
}

.hidden { display: none; }
