:root {
  --body-bg: #ffffff;
  --body-border: #e6e6e6;
  --body-primary-color: #1a1a1a;
  --body-secondary-color: #737373;
  --body-table-border: #cccccc;
  --card-bg: #ffffff;
  --card-border-color: #e6e6e6;
  --card-border-radius: 8px;
  --card-border-inner-radius: 6px;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --header-bg: #0385cd;
  --header-color: #ffffff;
  --header-image: url("/assets/theme/header-hero.jpg");
  --primary-color: #0385cd;
  --primary-color-alpha-10: rgba(3, 133, 205, 0.1);
  --primary-color-alpha-60: rgba(3, 133, 205, 0.6);
  --search-bar-border-radius: 10px;
  --search-shadow-hover: 0 5px 10px rgba(0, 0, 0, 0.1);
  --search-shadow-focus: 0 10px 20px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--body-bg);
  color: var(--body-primary-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  display: block;
}

button,
input,
select {
  font: inherit;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 12px 16px;
  background: #ffffff;
  color: #000000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  color: var(--header-color);
  margin-bottom: 36px;
  overflow: hidden;
}

.site-header__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(333.38% 100% at 50% 0%, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.12) 35.03%, rgba(255, 255, 255, 1) 100%),
    var(--header-image),
    var(--header-bg);
  background-size: cover;
  background-position: center;
}

.site-header__inner {
  position: relative;
  padding: 24px 0 36px;
}

.site-header--full .site-header__inner {
  min-height: 245px;
}

.site-header--compact .site-header__inner {
  min-height: 168px;
}

.site-header__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__brand {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header__desktop-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header__menu-button,
.site-header__mobile-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 6px;
  cursor: pointer;
}

.site-header__menu-button {
  display: none;
}

.site-header__hero {
  padding-top: 32px;
}

.site-header__headline {
  max-width: 680px;
  margin: 0 0 24px;
  font-size: clamp(2rem, 3vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.search-form {
  width: 100%;
}

.search-form__field {
  position: relative;
}

.search-form__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--header-color);
  pointer-events: none;
}

.search-form input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--search-bar-border-radius);
  background: rgba(255, 255, 255, 0.2);
  color: var(--header-color);
  padding: 16px 18px 16px 52px;
  outline: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input::placeholder {
  color: var(--header-color);
}

.search-form input:hover {
  background: rgba(255, 255, 255, 0.27);
  box-shadow: var(--search-shadow-hover);
}

.search-form input:focus {
  background: #ffffff;
  color: var(--body-primary-color);
  box-shadow: var(--search-shadow-focus);
}

.search-form input:focus + .search-form__icon,
.search-form input:focus ~ .search-form__icon {
  color: var(--body-secondary-color);
}

.locale-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.locale-picker__icon {
  color: inherit;
}

.locale-picker select {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding-right: 18px;
  cursor: pointer;
}

.locale-picker::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.site-header__mobile-panel {
  margin-top: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--body-primary-color);
  padding: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.site-header__mobile-panel[hidden] {
  display: none;
}

.locale-picker--mobile {
  color: var(--body-primary-color);
}

.page-content {
  flex: 1;
}

.landing-section {
  padding-bottom: 24px;
}

.collection-grid,
.collection-children-grid {
  display: grid;
  gap: 24px;
}

.collection-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border: 1px solid var(--card-border-color);
  border-radius: var(--card-border-radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.collection-card:hover {
  border-color: var(--primary-color-alpha-60);
  transform: translateY(-1px);
}

.collection-card__icon {
  flex: none;
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.collection-card__body {
  flex: 1;
  min-width: 0;
}

.collection-card__body h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.35;
}

.collection-card__body p {
  margin: 0;
  color: var(--body-secondary-color);
}

.collection-card__meta {
  margin-top: 12px;
  color: var(--body-secondary-color);
  font-size: 0.95rem;
}

.collection-card--compact {
  gap: 16px;
}

.collection-card--compact .collection-card__icon {
  width: 40px;
  height: 40px;
}

.breadcrumbs {
  padding-bottom: 16px;
  font-size: 0.95rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--body-secondary-color);
}

.breadcrumbs a {
  color: var(--body-primary-color);
}

.breadcrumbs a:hover {
  color: var(--body-secondary-color);
}

.breadcrumbs__chevron {
  margin: 0 8px;
  color: var(--body-secondary-color);
}

.collection-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 16px;
}

.collection-page__header {
  display: grid;
  gap: 20px;
}

.collection-page__icon {
  color: var(--primary-color);
}

.collection-page__icon svg {
  width: 40px;
  height: 40px;
}

.collection-page__heading h1,
.search-page__header h1,
.article-page__header h1,
.not-found-card h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.collection-page__heading p,
.search-page__header p,
.not-found-card p {
  margin: 0;
  color: var(--body-secondary-color);
}

.collection-page__meta,
.article-page__updated {
  color: var(--body-secondary-color);
  font-size: 0.95rem;
}

.collection-page__children h2 {
  margin: 0 0 20px;
  font-size: 1.125rem;
}

.article-list-card,
.search-results-card,
.not-found-card {
  border: 1px solid var(--card-border-color);
  border-radius: var(--card-border-radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.article-row + .article-row {
  border-top: 1px solid var(--body-border);
}

.article-row:hover {
  background: var(--primary-color-alpha-10);
  color: var(--primary-color);
}

.article-row__title {
  color: var(--body-primary-color);
}

.article-row:hover .article-row__title {
  color: inherit;
}

.article-row__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.article-row__icon svg {
  transform: rotate(-90deg);
}

.article-section {
  display: flex;
  justify-content: center;
}

.article-shell {
  width: min(640px, 100%);
}

.article-page__header {
  margin-bottom: 40px;
}

.article-page__description {
  margin: 0 0 12px;
  color: var(--body-secondary-color);
}

.article-content {
  font-size: 1rem;
  color: var(--body-primary-color);
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 32px 0 12px;
  line-height: 1.25;
}

.article-content h2 {
  font-size: 1.5rem;
}

.article-content h3 {
  font-size: 1.2rem;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content table,
.article-content pre,
.article-content blockquote {
  margin: 0 0 18px;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
}

.article-content li + li {
  margin-top: 8px;
}

.article-content a {
  color: var(--primary-color);
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content img {
  margin: 24px 0;
  border: 1px solid var(--body-border);
  border-radius: 12px;
  background: #ffffff;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.article-content th,
.article-content td {
  border: 1px solid var(--body-table-border);
  padding: 10px 12px;
  text-align: left;
}

.article-content pre,
.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-content pre {
  overflow-x: auto;
  border-radius: 12px;
  background: #f6f8fb;
  padding: 16px;
}

.article-content blockquote {
  border-left: 3px solid var(--primary-color-alpha-60);
  padding-left: 16px;
  color: var(--body-secondary-color);
}

.search-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.search-results-card {
  overflow: hidden;
}

.search-results-card__summary {
  padding: 20px;
  border-bottom: 1px solid var(--body-border);
}

.search-results-card__summary h2 {
  margin: 0 0 4px;
  font-size: 1.125rem;
}

.search-results-card__summary p {
  margin: 0;
  color: var(--body-secondary-color);
}

.search-results-card__list:empty {
  display: none;
}

.search-result {
  display: block;
  padding: 18px 20px;
}

.search-result + .search-result {
  border-top: 1px solid var(--body-border);
}

.search-result:hover {
  background: var(--primary-color-alpha-10);
}

.search-result__collection {
  margin-bottom: 4px;
  color: var(--body-secondary-color);
  font-size: 0.9rem;
}

.search-result h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.4;
}

.search-result p {
  margin: 0;
  color: var(--body-secondary-color);
}

.not-found-page {
  padding-top: 40px;
}

.not-found-card {
  padding: 32px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
}

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--body-border);
  padding: 48px 0;
  color: var(--body-secondary-color);
}

.site-footer__inner {
  text-align: center;
}

@media (max-width: 767px) {
  .container {
    width: calc(100% - 40px);
  }

  .site-header__desktop-controls {
    display: none;
  }

  .site-header__menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-header__headline {
    font-size: 1.875rem;
  }

  .collection-card {
    flex-direction: column;
  }

  .collection-card__icon {
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 768px) {
  .collection-children-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
