/* Library Earl Haig - Main Stylesheet
   https://library.earlhaig.ca/
   Earl Haig institutional palette: blue & white, clean, modern */

:root {
  --eh-blue: #1a365d;
  --eh-blue-mid: #2c5282;
  --eh-blue-light: #3182ce;
  --eh-blue-pale: #ebf8ff;
  --eh-white: #ffffff;
  --eh-off-white: #f7fafc;
  --eh-gray-100: #edf2f7;
  --eh-gray-200: #e2e8f0;
  --eh-gray-600: #718096;
  --eh-gray-800: #2d3748;
  --eh-accent: #2b6cb0;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --shadow: 0 1px 3px rgba(26, 54, 93, 0.08);
  --shadow-md: 0 4px 12px rgba(26, 54, 93, 0.1);
  --radius: 6px;
  --max-width: 1200px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--eh-gray-800);
  background: var(--eh-off-white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  content-visibility: auto;
}

a {
  color: var(--eh-blue-mid);
  text-decoration: none;
}

a:hover {
  color: var(--eh-blue);
  text-decoration: underline;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--eh-blue);
  color: var(--eh-white);
  z-index: 100;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0.5rem;
}

/* Header */
.site-header {
  background: var(--eh-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-link:hover {
  text-decoration: none;
}

.logo-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--eh-blue);
  margin: 0;
}

/* Nav */
.nav-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-main a {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--eh-gray-800);
  border-radius: var(--radius);
}

.nav-main a:hover {
  background: var(--eh-blue-pale);
  color: var(--eh-blue);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--eh-blue) 0%, var(--eh-blue-mid) 100%);
  color: var(--eh-white);
  padding: 4rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--eh-off-white), transparent);
  pointer-events: none;
}

.hero-banner {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.25;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.125rem;
  opacity: 0.95;
  max-width: 36ch;
  margin: 0 auto;
}

/* Sections */
section {
  padding: 3.5rem 1.5rem;
  background: var(--eh-white);
}

section:nth-child(even) {
  background: var(--eh-off-white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--eh-blue);
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
}

.section-intro {
  font-size: 1.0625rem;
  color: var(--eh-gray-600);
  margin-bottom: 2rem;
  max-width: 65ch;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--eh-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--eh-gray-100);
  transition: box-shadow 0.2s;
}

section:nth-child(even) .card {
  background: var(--eh-white);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--eh-blue);
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--eh-gray-600);
}

.card a {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Page banner (subfolder) */
.page-banner {
  background: linear-gradient(135deg, var(--eh-blue) 0%, var(--eh-blue-mid) 100%);
  color: var(--eh-white);
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
}

.page-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.page-banner-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-banner h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.breadcrumb {
  font-size: 0.875rem;
  opacity: 0.9;
}

.breadcrumb a {
  color: var(--eh-white);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* FAQ */
.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-list li {
  border-bottom: 1px solid var(--eh-gray-200);
  padding: 1rem 0;
}

.faq-list li:first-child {
  padding-top: 0;
}

.faq-list dt {
  font-weight: 600;
  color: var(--eh-blue);
  margin-bottom: 0.35rem;
}

.faq-list dd {
  margin: 0;
  color: var(--eh-gray-600);
  font-size: 0.9375rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.contact-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--eh-blue);
  margin: 0 0 0.5rem;
}

.contact-block p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Footer */
.site-footer {
  background: var(--eh-blue);
  color: var(--eh-white);
  padding: 2.5rem 1.5rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  opacity: 0.9;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 0.35rem;
}

.footer-grid a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
}

.footer-grid a:hover {
  color: var(--eh-white);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.875rem;
  opacity: 0.85;
}

.footer-nap {
  margin-bottom: 0.5rem;
}

/* Subfolder content */
.content-section {
  padding: 3.5rem 1.5rem;
  background: var(--eh-white);
}

.content-section .section-inner h2 { margin-top: 2rem; }
.content-section .section-inner h2:first-of-type { margin-top: 0; }
.content-section .section-inner h3 { margin-top: 1.5rem; font-size: 1.25rem; color: var(--eh-blue-mid); }
.content-section .section-inner ul { margin: 1rem 0; padding-left: 1.5rem; }
.content-section .section-inner li { margin-bottom: 0.5rem; }

/* Utility */
.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;
}

@media (max-width: 768px) {
  .nav-main {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .hero {
    padding: 3rem 1rem 3.5rem;
  }
  section {
    padding: 2.5rem 1rem;
  }
}
