/* =============================================================
   Science Habitat — Base Reset & Global Styles
   ============================================================= */

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

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

body {
  font-family: var(--sh-font-body);
  color: var(--sh-text);
  background: var(--sh-white);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography Base ─── */
h1, h2, h3 {
  font-family: var(--sh-font-display);
  line-height: 1.2;
  color: var(--sh-navy);
}
h4, h5, h6 {
  font-weight: 600;
  color: var(--sh-navy);
  line-height: 1.3;
}

h1 { font-size: var(--sh-text-h1); }
h2 { font-size: var(--sh-text-h2); }
h3 { font-size: var(--sh-text-h3); }
h4 { font-size: var(--sh-text-h4); }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.85rem; }

p {
  font-size: var(--sh-text-base);
  color: var(--sh-text);
  line-height: 1.7;
}

a {
  color: var(--sh-teal);
  text-decoration: none;
  transition: color var(--sh-transition-fast);
}
a:hover { color: var(--sh-teal-light); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol { list-style: none; }

button {
  font-family: var(--sh-font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--sh-font-body);
  font-size: var(--sh-text-base);
}

/* ─── Utility Classes ─── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }

.mono {
  font-family: var(--sh-font-mono);
  font-size: 0.8rem;
}

.sh-divider {
  height: 1px;
  background: var(--sh-border);
  margin: var(--sh-space-40) 0;
}

.sh-highlight-box {
  background: var(--sh-teal-10);
  border: 1px solid var(--sh-teal-20);
  border-radius: var(--sh-radius-lg);
  padding: var(--sh-space-24);
}

/* Drupal admin toolbar offset */
body.toolbar-fixed .site-header {
  top: var(--drupal-displace-top, 0);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--sh-navy);
  color: white;
  border-radius: var(--sh-radius-sm);
  font-size: var(--sh-text-sm);
  transition: top var(--sh-transition-fast);
}
.skip-link:focus { top: 6px; }

/* Messages */
.messages {
  padding: 16px 20px;
  border-radius: var(--sh-radius-md);
  margin: 16px 0;
  font-size: var(--sh-text-sm);
}
.messages--status  { background: #e8f5e9; border: 1px solid #66bb6a; color: #2e7d32; }
.messages--warning { background: #fff8e1; border: 1px solid #ffb74d; color: #e65100; }
.messages--error   { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; }
