/* ʻAlalā Feeders: site styles
   Palette from the montane forest of the release sites:
   hāpuʻu fern (primary), ʻōhiʻa lehua (attention), basalt (text), mist (background). */

:root {
  --mist: #eef2ee;
  --surface: #ffffff;
  --basalt: #23282b;
  --stone: #5b6763;
  --line: #cdd6d0;
  --fern: #2f5d46;
  --fern-dark: #234836;
  --fern-tint: #dde9e0;
  --lehua: #b3303a;
  --lehua-tint: #f6e0e1;
  --amber: #7d5800;
  --amber-tint: #f4e8c9;

  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.2rem + 3vw, 3.1rem);

  --radius: 6px;
  --gap: 1rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mist: #171b1a;
    --surface: #202625;
    --basalt: #e3e8e5;
    --stone: #a3aeaa;
    --line: #36403d;
    --fern: #7fb596;
    --fern-dark: #9ccbb0;
    --fern-tint: #24382d;
    --lehua: #f08a90;
    --lehua-tint: #3d2224;
    --amber: #e3bb5c;
    --amber-tint: #3a3020;
  }
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--basalt);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
}

a {
  color: var(--fern);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--fern-dark);
}

:focus-visible {
  outline: 3px solid var(--fern);
  outline-offset: 2px;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: var(--step-2);
}

h2 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
  max-width: 68ch;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--fern);
  color: #fff;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.wordmark:hover {
  color: #fff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
}

.site-nav a,
.site-nav .link-button {
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav .link-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.22);
}

.site-nav form {
  margin: 0;
}

.link-button {
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.site-header :focus-visible {
  outline-color: #fff;
}

/* ---------- Main ---------- */

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.site-footer {
  color: var(--stone);
  font-size: var(--step--1);
  padding-bottom: 2rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.page-head h1 {
  margin: 0;
}

.count {
  color: var(--stone);
  font-size: var(--step--1);
}

/* ---------- Landing ---------- */

.lede {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 22ch;
  margin: 0.5rem 0 1rem;
}

.lede-sub {
  color: var(--stone);
  margin-bottom: 2.5rem;
}

.attention {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2rem;
}

.attention ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.attention li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.attention .reason {
  color: var(--lehua);
  font-size: var(--step--1);
}

.all-clear {
  color: var(--stone);
}

.signin-intro {
  max-width: 34rem;
  padding: 2rem 0;
}

/* ---------- Buttons and forms ---------- */

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--fern);
  border: 0;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--fern-dark);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: var(--fern);
  box-shadow: inset 0 0 0 1px var(--fern);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: var(--step--1);
  color: var(--stone);
}

.field input,
.field select {
  font: inherit;
  font-size: var(--step-0);
  color: var(--basalt);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  min-height: 2.6rem;
}

.field input[type="search"] {
  width: 14rem;
}

.filters .clear {
  align-self: center;
  font-size: var(--step--1);
}

/* ---------- Tables ---------- */

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.data th,
table.data td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--stone);
  background: var(--surface);
  position: sticky;
  top: 0;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover {
  background: var(--fern-tint);
}

table.data .num {
  text-align: right;
}

.muted {
  color: var(--stone);
}

.thumb {
  display: block;
  width: 4.5rem;
  height: 3.4rem;
  object-fit: cover;
  border-radius: 4px;
  background: var(--line);
}

table.data td.thumb-cell {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

  table.data td.thumb-cell {
    display: block;
    order: -1;
  }

  table.data td.thumb-cell::before {
    content: none;
  }

  table.data td.thumb-cell .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

.subline {
  display: block;
  font-size: var(--step--1);
  color: var(--stone);
}

.warn {
  color: var(--lehua);
  font-weight: 600;
}

.pill {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}

.pill-alive,
.pill-active {
  background: var(--fern-tint);
  color: var(--fern-dark);
}

.pill-missing,
.pill-inactive {
  background: var(--amber-tint);
  color: var(--amber);
}

.pill-deceased,
.pill-fault {
  background: var(--lehua-tint);
  color: var(--lehua);
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

/* Phones: each row becomes a stacked label/value block */
@media (max-width: 720px) {
  .table-scroll {
    background: none;
    border: 0;
    overflow: visible;
  }

  table.data thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }

  table.data tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.35rem 0;
  }

  table.data td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.9rem;
    border: 0;
    white-space: normal;
    text-align: right;
  }

  table.data td::before {
    content: attr(data-label);
    color: var(--stone);
    font-size: var(--step--1);
    text-align: left;
  }

  table.data td .subline {
    display: inline;
    margin-left: 0.4rem;
  }

  table.data td.row-title {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 600;
    text-align: left;
  }

  table.data td.row-title::before {
    content: none;
  }

  .field input[type="search"] {
    width: 100%;
  }

  .filters .field:first-child {
    flex: 1 1 100%;
  }
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: var(--step--1);
}

/* ---------- Login ---------- */

.login {
  max-width: 24rem;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.login .field {
  margin-bottom: 1rem;
}

.login .button {
  width: 100%;
  margin-top: 0.5rem;
}

.form-error {
  background: var(--lehua-tint);
  color: var(--lehua);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: var(--step--1);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.errorlist { list-style: none; margin: 0; padding: 0; color: var(--lehua); }
.form-foot { margin: 1rem 0 0; font-size: var(--step--1); }
.form-hint { font-size: var(--step--1); }
