﻿@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,300,0..1,0');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css');

:root {
  --dark-gray: dimgray;
  --semi-gray: #757575;
  --medium-gray: darkgray;
  --gray: lightgray;
  --light-gray: #ebebeb;
  --extra-light-gray: whitesmoke;
  --white: #ffffff;
  --blue: #0077a0;

  --purple-700: #3b1f6b;
  --purple-500: #6b4f9a;
  --purple-400: #9d7dc4;
  --purple-300: #c9b8e8;
  --purple-150: #ede8f7;
  --purple-100: #f9f7fd;
  --magenta: #be185d;

  --color-700: var(--purple-700);
  --color-500: var(--purple-500);
  --color-400: var(--purple-400);
  --color-300: var(--purple-300);
  --color-150: var(--purple-150);
  --color-100: var(--purple-100);
  --color-0: var(--white);
  --color-accent: var(--magenta);
  --color-text: var(--dark-gray);

  --font-family: 'Atkinson Hyperlegible', Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--color-100);
  color: var(--color-text);
}

.site-header, .breadcrumb-bar, .page-inner, .site-footer {
  max-width: 1080px;
  margin: 0 auto;
}

/* ── Icons ───────────────────────────────── */

button::before,
button::after,
.breadcrumb-trail li:not(:last-child)::after,
.aside-link::after,
.feature-list li::before,
.feature-list-legend span::before,
.tag::before,
[class*="tag--"]::before {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0;
}

.tag[class*="tag--"]::before {
  font-size: 16px;
}

.button[class*="tag--"]::before {
  font-size: 18px;
}

.breadcrumb-trail li:not(:last-child)::after,
.aside-link::after {
  content: 'chevron_right' / '';
  font-size: 24px;
}

.breadcrumb-trail li:not(:last-child)::after {
  margin: 0 8px;
}

.aside-link::after {
  position: absolute;
}

.copy-btn::before {
  content: 'content_copy' / '';
  font-size: 18px;
}

.copy-btn.copied::before {
  content: 'check' / '';
}

.feature-list li::before {
  position: absolute;
  left: 0;
  top: 4px;
}

.feature-list li[aria-description="Required"]::before,
.feature-list-legend .required::before {
  content: 'square' / '';
  color: var(--color-500);
  font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0;
}

.feature-list li[aria-description="Recommended"]::before,
.feature-list-legend .recommended::before {
  content: 'circle' / '';
  color: var(--color-500);
}

.feature-list-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.feature-list-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

/* ── Typography ──────────────────────────── */

.page-section ol,
.page-section ul {
  padding-inline-start: 1.2em;
}

h1, h2 {
  color: var(--color-700);
  font-weight: 700;
}

h1 {
  font-size: 40px;
  line-height: 1;
}

.page-subtitle {
  font-size: 18px;
  color: var(--color-500);
  margin-top: 0.5rem;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: inherit;
  font-style: italic;
  margin-top: 8px;
}

a {
  color: var(--color-700);
}

.button {
  all: unset;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, var(--color-700), var(--color-500));
  color: var(--color-0);
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.button[aria-pressed="false"],
.button:has(input:not(:checked)) {
  background: none;
  color: var(--color-700);
  border: 1.5px solid var(--color-400);
}

code:not(pre code),
kbd {
  font-family: Consolas, 'Courier New', monospace;
  border-radius: 4px;
  font-size: 14px;
}

code:not(pre code) {
  padding: 1px 4px;
  background-color: rgb(0, 0, 0, 0.04);
}

kbd {
  border: 1.5px solid var(--medium-gray);
  padding: 1px 5px 4px 4px;
  box-shadow: -1px -2px 0px rgba(0, 0, 0, 0.2) inset;
  background-color: var(--light-gray);
}

/* ── Header ─────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 48px;
}

.skip-link:focus {
  top: 0;
}

site-header,
site-footer {
  display: block;
  background-color: var(--color-150);
  color: var(--color-700);
}

.site-header {
  position: relative;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.site-header .site-logo {
  padding: 16px 0;
}

.site-logo img {
  height: 32px;
  width: auto;
}

.nav-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-toggle::before {
  content: 'menu' / '';
  color: var(--color-700);
  font-size: 24px;
}

.nav-toggle[aria-expanded="true"]::before {
  content: 'close' / '';
}

.site-nav {
  display: flex;
}

.site-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  display: flex;
}

.site-nav a {
  color: var(--color-700);
  text-decoration: none;
  display: inline-flex;
  flex-grow: 1;
  align-items: center;
  text-underline-offset: 8px;
  padding: 8px 16px;
}

.site-nav a:hover {
  text-decoration: underline var(--color-300);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline var(--color-400);
  background: var(--color-100);
}

/* ── Footer ─────────────────────────────── */

.site-footer {
  padding: 48px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

/* ── Breadcrumb bar ──────────────────────── */

breadcrumb-bar {
  display: block;
  border-top: 1.5px solid var(--color-300);
  border-bottom: 1.5px solid var(--color-300);
}

.breadcrumb-bar {
  padding: 24px 48px;
}

.breadcrumb-trail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb-trail li {
  display: flex;
  align-items: center;
}

/* ── Page layout ─────────────────────────── */

.page-inner {
  padding: 120px 48px;
  display: flex;
  gap: 64px;
  align-items: flex-start;
  position: relative;
}

.page-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.page-description,
.page-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-description h1 {
  margin-bottom: 24px;
}

.page-description h2:not(:first-of-type) {
  margin-top: 24px;
}

.page-description-wrap {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

/* ── Aside ───────────────────────────────── */

.variants-aside {
  width: 280px;
  flex-shrink: 0;
  border-left: 1.5px solid var(--color-300);
  padding-left: 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: stretch;
}

.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-link {
  color: var(--color-accent);
  text-decoration: underline;
}

.page-section {
  min-width: 0;
}

.page-section h2 {
  border-bottom: 1.5px solid var(--color-300);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* ── On This Page aside ──────────────────── */

on-this-page {
  order: 1;
  align-self: stretch;
}

.page-aside {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 32px;
}

.on-this-page {
  display: flex;
  flex-direction: column;
  background: var(--color-150);
  border-radius: 8px;
  padding: 40px;
  gap: 24px;
}

.on-this-page-links {
  list-style: none;
  counter-reset: on-this-page;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.on-this-page-links li {
  counter-increment: on-this-page;
  display: flex;
  align-items: center;
  gap: 10px;
}

.on-this-page-links li::before {
  content: counter(on-this-page);
  background-color: var(--color-500);
  color: var(--color-150);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.on-this-page-links a {
  text-decoration: none;
}

.on-this-page-links a:hover {
  text-decoration: underline;
}

/* ── Filter bar ──────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.filter-bar legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.filter-bar input {
  position: absolute;
  inset: 0;
  appearance: none;
  cursor: pointer;
  margin: 0;
  border-radius: 8px;
}

.home-search {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.home-search .attr-search {
  width: 100%;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  padding: 2px 8px 2px 6px;
  border-radius: 8px;
  border: 1.5px solid var(--color-300);
  color: var(--color-700);
  background: var(--color-150);
}

.tag--category-1::before   { content: 'explore' / ''; }
.tag--category-2::before     { content: 'ads_click' / ''; }
.tag--category-3::before { content: 'dashboard' / ''; }
.tag--category-4::before { content: 'info' / ''; }

/* ── Cards ──────────────────────────── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
  width: 100%;
}

.variant-cards {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.card {
  background: var(--color-0);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  border: 1.5px solid var(--color-300);
  position: relative;
}

.variant-cards .card { flex-direction: row; }

.card:has(a:hover),
.card:has(a:focus-visible) {
  transform: translateY(-4px);
  box-shadow: 4px 4px 0px var(--color-300);
}

.card-preview {
  background-color: var(--color-150);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  height: 160px;
  flex-shrink: 0;
  width: 100%;
}

.variant-cards .card-preview {
  width: 240px;
  height: auto;
}

.card-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-content {
  padding: 20px 24px 24px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-heading a {
  color: inherit;
  text-decoration: none;
}

.card-heading a::before {
  content: '';
  position: absolute;
  inset: 0;
}

/* ── Feature list ────────────────────────── */

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-inline-start: 0 !important;
}

.feature-list li {
  position: relative;
  padding-left: 28px;
}

/* ── Example container ───────────────────── */

.example-container {
  background-color: var(--color-0);
  border: 1.5px solid var(--color-300);
  border-radius: 8px;
  padding: 48px 32px;
}

/* ── Code editor ─────────────────────────── */

code-editor {
  display: block;
}

.code-editor {
  border-radius: 8px;
  min-width: 0;
  margin-bottom: 16px;
  background-color: var(--color-700);
}

.code-toolbar {
  background-color: rgb(0, 0, 0, 0.1);
  display: flex;
  align-items: stretch;
  border-radius: 8px 8px 0 0;
}

.code-tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.code-tab {
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 1.5px solid transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-150);
  padding: 8px 16px;
  line-height: 1.2;
}

.code-tab.active {
  color: var(--color-0);
  border-bottom: 1.5px solid var(--color-0);
}

.copy-btn {
  background: none;
  border: none;
  border-radius: 0;
}

.code-panel {
  padding: 24px;
  overflow: auto;
  max-height: 400px;
  border-radius: 0 0 8px 8px;
  scrollbar-color: var(--color-300) rgb(0 0 0 / 0);
}

.code-panel pre {
  margin: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #f0f0f0;
  white-space: pre;
}

/* ── About page ──────────────────────────── */

.about-illustration {
  width: 360px;
  flex-shrink: 0;
}

/* ── Attributes page ─────────────────────── */

.table-group-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attr-search {
  display: flex;
  justify-content: space-between;
}

.search-input {
  padding: 8px 12px;
  border: 1.5px solid var(--color-400);
  border-radius: 8px 0 0 8px;
  font: inherit;
  color: inherit;
  background: var(--color-0);
  width: 100%;
}

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

#search-btn {
  padding: 0 16px;
  border-radius: 0 8px 8px 0;
}

#search-btn::before {
  content: 'search' / '';
  font-family: 'Material Symbols Outlined';
  font-size: 24px;
}

.search-results {
  white-space: nowrap;
}

#home-search-results {
  margin-top: -24px;
}

#attr-search-results {
  align-self: center;
  margin-left: 16px;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 0 0 8px 8px;
}

.search-results:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.table {
  min-width: 560px;
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-0);
  font-size: 14px;
  table-layout: fixed;
}

.table thead th:last-child { width: 50%; }

.table th,
.table td {
  text-align: left;
  padding: 12px 16px;
  vertical-align: top;
}

.table th {
  font-weight: 700;
  color: var(--color-0);
  background: var(--color-500);
}

.table-accordion .table {
  border-radius: 0;
}

.table-accordion-header {
  display: flex;
  align-items: stretch;
  position: relative;
  text-align: left;
  background: var(--color-700);
  color: var(--color-0);
  border-radius: 8px;
}

.table-accordion-header:has(.category-btn[aria-expanded="true"]),
.table-accordion-header:has(.tooltip-btn[aria-expanded="true"]) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.table-accordion-header h2 {
  display: flex;
  align-items: stretch;
  border: none;
  font-size: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
}

.category-btn {
  all: unset;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.category-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.category-btn::before {
  content: '';
  position: absolute;
  inset: 0;
}

.category-btn::after {
  position: absolute;
  right: 16px;
}

.category-btn::after,
.table-group-btn::after {
  content: 'expand_less' / '';
  text-transform: none;
  letter-spacing: normal;
  transition: transform 0.2s ease;
  margin-left: auto;
  font-size: 24px;
}

.category-btn[aria-expanded="false"]::after,
.table-group-btn[aria-expanded="false"]::after {
  transform: rotate(180deg);
}

.tooltip-btn {
  all: unset;
  display: flex;
  align-items: center;
  padding: 0 12px;
  margin-left: -12px;
  z-index: 1;
  cursor: pointer;
}

.tooltip-btn::before {
  content: 'info' / '';
  font-size: 20px;
}

.tooltip-btn[aria-expanded="true"]::before {
  font-variation-settings: 'FILL' 1;
}

[role="tooltip"] {
  display: none;
  padding: 12px 16px;
  background: var(--color-700);
  color: var(--color-150);
}

.table-accordion:has(.category-btn[aria-expanded="false"]) [role="tooltip"] {
  border-radius: 0 0 8px 8px;
}

.table-accordion:has(.tooltip-btn[aria-expanded="true"]) [role="tooltip"] {
  display: block;
}

.table-accordion:has(.category-btn[aria-expanded="false"]) thead,
.table-accordion:has(.category-btn[aria-expanded="false"]) tbody {
  display: none;
}

.table-group tr:has(.table-group-btn) ~ tr { display: none; }
.table-group tr:has(.table-group-btn[aria-expanded="true"]) ~ tr { display: table-row; }

th:has(.table-group-btn) {
  color: inherit;
  background: var(--color-150);
  font-style: italic;
  padding: 0;
  border-bottom: 1.5px solid var(--color-300);
}

.table-group-btn {
  all: unset;
  display: flex;
  align-items: center;
  width: calc(100% - 32px);
  cursor: pointer;
  padding: 12px 16px;
}

.table-group-btn[aria-expanded="false"]::after {
  transform: rotate(180deg);
}

.note {
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  background: #fff8e8;
  border: 1.5px solid #ffC266;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 900px) {

  .site-header {
    padding: 0 24px;
  }

  .site-footer {
    flex-direction: column;
  }

  .site-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .skip-link {
    left: 24px;
  }

  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1.5px solid var(--color-300);
    padding: 16px 0;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav a {
    padding: 16px 0;
  }

  .site-nav a[aria-current="page"] {
    border-radius: 0 8px 8px 0;
    margin-left: -24px;
    padding-left: 24px;
  }

  .nav-toggle[aria-expanded="true"] ~ .site-nav {
    display: flex;
  }

  .breadcrumb-bar {
    padding: 24px;
  }

  .copy-btn [aria-live] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .page-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px;
    gap: 40px;
  }

  .variants-aside {
    width: 100%;
    border-left: none;
    padding-left: 0;
    padding-top: 40px;
    align-self: auto;
  }

  on-this-page {
    order: 0;
  }

  .page-aside {
    width: 100%;
    position: static;
  }

  .page-description-wrap {
    flex-direction: column;
  }

  .about-illustration {
    order: -1;
    width: 100%;
    max-width: 320px;
  }

  .variant-cards .card {
    flex-direction: column;
  }

  .variant-cards .card-preview {
    width: auto;
    height: 160px;
  }

}

* :focus-visible,
.table-accordion-header:has(.category-btn:focus-visible) {
	outline: 2px solid var(--color-700);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--color-0);
  border-radius: 8px;
}