/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  color: #334155;
  background: #f1f5f9;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* Header */
.site-header {
  text-align: center;
  background: transparent;
  padding: 0;
  position: relative;
}

.site-header-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.site-header-link:focus-visible {
  outline: 3px solid #fb923c;
  outline-offset: 4px;
}

.header-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.site-header h1 {
  font-size: 2.25rem;
  color: #1e293b;
  margin: 0;
  padding: 1rem 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  background: #f4cd89;
}

/* Navigation */
nav {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: static;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 3px solid transparent;
  position: relative;
}

nav a:hover {
  color: #ea580c;
  background: rgba(251, 146, 60, 0.06);
}

nav a.active {
  color: #ea580c;
  background: rgba(251, 146, 60, 0.08);
  border-bottom-color: #fb923c;
}

.nav-search {
  position: relative;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 120;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-search-input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search-input:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
}

.nav-search-results.is-visible {
  display: block;
}

.nav-search-results li {
  margin: 0;
}

.nav-search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #1e293b;
  text-decoration: none;
  font-weight: 500;
  border-bottom: none;
  background: transparent;
}

.nav-search-results a:hover {
  background: rgba(251, 146, 60, 0.12);
  color: #ea580c;
}

.nav-search-empty {
  padding: 0.5rem 0.75rem;
  color: #64748b;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

section[id] {
  scroll-margin-top: 4.5rem;
}

/* Main content */
main {
  padding: 3rem 2rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

h2 {
  font-size: 2rem;
  color: #1e293b;
  margin-bottom: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #e2e8f0;
}

h3 {
  font-size: 1.375rem;
  color: #334155;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.0125em;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading-text {
  flex: 1;
  min-width: 0;
}

.section-link-button {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.section-link-button:hover {
  border-color: #94a3b8;
  color: #1f2937;
}

.section-link-button.is-copied {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

h4 {
  font-size: 1.125rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
  color: #475569;
}

section {
  margin-bottom: 1.5rem;
}

main > section {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 0px solid #e2e8f0;
  border-left-width: 4px;
  border-left-color: #e7edf3;
}

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

/* News */
.news-feed {
  padding-top: 2rem;
}

.news-item {
  margin-top: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.news-item:first-of-type {
  margin-top: 1rem;
}

.news-item:last-of-type {
  border-bottom: 0;
}

.news-meta {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

/* Links */
a {
  color: #ea580c;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #c2410c;
}

main a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: #fdba74;
}

main a:hover {
  text-decoration-color: #ea580c;
}

/* Lists */
ul,
ol {
  padding-left: 2rem;
}

li {
  margin-bottom: 0.75rem;
  color: #475569;
}

/* Definition lists */
dl {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 0.75rem 2rem;
  margin: 1.5rem 0;
}

dt {
  font-weight: 600;
  color: #334155;
}

dd {
  color: #64748b;
}

/* Footer */
footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9375rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .site-header h1 {
    font-size: 1.75rem;
  }

  nav ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
  }

  nav a {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #cbd5e1;
    text-align: center;
    font-size: 0.875rem;
  }

  nav li:nth-child(odd) a {
    border-right: 1px solid #cbd5e1;
  }

  .nav-search {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 150;
    background: #f8fafc;
    padding: 0.5rem 1rem;
    margin: 0;
  }

  .nav-search-input {
    border-radius: 12px;
    margin: 0;
    line-height: 1.2;
  }

  main {
    padding: 2rem 1.25rem;
  }

  h2 {
    font-size: 1.625rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .section-heading {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .section-link-button {
    margin-left: auto;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  dt {
    margin-top: 1rem;
  }
}
