/*
 * base.css — Global element styles, typography, utilities
 * Tribu Bamiléké — tribubamileke.org
 */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

/* Visible focus for keyboard users — WCAG 2.1 AA */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Bamileke-language text — phonetic characters (ə ɔ ɛ ʉ ʼ) with tone marks */
.lang-bamileke {
  font-family: var(--font-lang);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Skip-to-content link, first focusable element on every page */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-sm);
  color: #ffffff;
}

/* Screen-reader-only text */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Utility */
.text-center { text-align: center; }
.text-light { color: var(--color-text-light); }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

blockquote {
  border-left: 4px solid var(--color-secondary);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--color-text-light);
}

figure {
  margin: var(--space-md) 0;
}

figcaption {
  font-size: var(--fs-sm);
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

th,
td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  text-align: left;
}

th {
  background-color: var(--color-bg-alt);
  font-family: var(--font-heading);
}

/*
 * Print stylesheet — content pages (history, stories, learn-language)
 */
@media print {
  .site-header,
  .site-footer,
  .lang-switcher,
  .theme-toggle,
  .breadcrumb,
  .btn,
  .skip-link,
  .newsletter,
  .nav-drawer {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  a {
    color: #000000;
    text-decoration: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  article,
  section {
    page-break-inside: avoid;
  }
}
