/* Akram Hamed (git.yappit.org) — Self-contained FOSS stylesheet */

:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --nav-bg: #212529;
  --nav-fg: #ffffff;
  --nav-hover: #cccccc;
  --text: #333333;
  --heading: #222222;
  --muted: #595959;
  --link: #0066cc;
  --border: #cccccc;
  --border-subtle: #dddddd;
  --max-width: 960px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 1.15rem;
  margin-bottom: 0.45rem;
}

p {
  margin: 0 0 0.85rem;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0 0 0.85rem;
  padding-left: 1.4rem;
}

ul:last-child {
  margin-bottom: 0;
}

li {
  margin-bottom: 0.4rem;
}

li > ul {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Header & Navigation (sticky, responsive, progressive-enhancement toggle) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--nav-bg);
  color: var(--nav-fg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
}

.site-brand {
  color: var(--nav-fg);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-brand:hover,
.site-brand:focus-visible {
  color: var(--nav-hover);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 2.35rem;
  height: 2.15rem;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--nav-fg);
  outline: none;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--nav-fg);
  border-radius: 1px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.site-nav.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-nav.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-nav.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--nav-fg);
  display: inline-block;
  padding: 0.15rem 0;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--nav-hover);
  text-decoration: underline;
}

/* Main Content & Sections */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2rem;
}

section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.35rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 4.25rem;
}

main > section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Profile Header (index.html) */
.profile {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: center;
}

.avatar {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.role {
  margin-bottom: 0.85rem;
  color: var(--muted);
}

.contact-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
}

.contact-list dt {
  font-weight: 700;
  color: var(--heading);
}

.contact-list dd {
  margin: 0;
  min-width: 0;
}

/* Structured Lists (index.html) */
.item-list {
  list-style: disc;
}

.item-list li {
  margin-bottom: 0.85rem;
}

.item-list li:last-child {
  margin-bottom: 0;
}

.item-title {
  display: block;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.15rem;
}

/* Partner Resources Page (partners.html) */
.page-intro {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.back-link {
  margin-bottom: 0.75rem;
}

.disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.updated {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.resource-list {
  margin-bottom: 0.9rem;
}

.note {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.9rem 0;
}

.badges a {
  display: inline-flex;
  align-items: center;
}

.badges img {
  display: block;
  height: 31px;
  width: auto;
}

.badges img.badge-nofb {
  height: 22px;
  width: auto;
}

/* Mobile Navigation Drawer (active when JS is enabled; graceful wrap if JS off) */
@media (max-width: 719px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .js .site-nav.is-open .nav-links {
    display: flex;
  }

  .js .nav-links a {
    display: block;
    padding: 0.45rem 0;
  }
}

/* Mobile Layout */
@media (max-width: 640px) {
  .site-nav {
    padding: 0.7rem 1rem;
  }

  main {
    padding: 1.25rem 1rem 1.5rem;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .avatar {
    max-width: 180px;
  }

  .contact-list {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .contact-list dd {
    margin-bottom: 0.45rem;
  }
}

@media print {
  .site-header {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }
}
