/* container */
body {
  background: var(--surface-container);
}

main {
  background-color: var(--surface);
  border-radius: var(--shape-xl);
  margin: auto;
  margin-top: 20px;
  max-width: 900px;
  width: 80%;
  padding: 12px 40px;
}

@media screen and (max-width: 700px) {
  body {
    background: var(--surface);
  }

  
  main {
    margin: 0;
    width: 100%;
  }
}

@media screen and (prefers-color-scheme: dark) and (min-width: 700px) {
  body {
    background: var(--surface);
  }
  main {
    background: var(--surface-container)
  }
}

/* paragraphs */
main p {
  line-height: 1.5rem;
}

/* headings */
main h2 {
  font-weight: 700;
  margin-block-start: 2rem;
  margin-block-end: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--surface-variant);
}

.metadata {
  margin-top: 0.25rem;
  color: var(--on-surface-variant);
  font-style: italic;
}

.author-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0.25rem 0 6px;
  align-items: center;
}

.author-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--on-surface);
  box-shadow: none;
  border: 0;
  min-width: 220px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-high);
  flex: 0 0 auto;
}

.author-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.author-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  line-height: 1.2;
}

.author-role {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.2;
}

.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.author-links a {
  font-size: 0.8rem;
  color: var(--primary);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-container-highest);
  border: 1px solid var(--outline-variant);
  text-decoration: none;
  border-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.author-links a img {
  width: 16px;
  height: 16px;
  display: block;
}

.author-name a {
  text-decoration: none;
}

.author-links a:hover {
  border-bottom: 0;
  filter: brightness(0.98);
}

main h3,
main h4 {
  font-weight: 500;
  margin-block-end: 0.5rem;
}

main :is(h3, h4) + main :is(p, ul, ol) {
  margin-block-start:0px;
}

:is(p, ol, ul) + h3 {
  margin-block-start: 2rem
}

p + :is(ul, ol) {
  margin-block-start: 0px
}

main li {
  line-height: 1.5rem;
  font-weight: 300;
  margin-block-start: 0.5rem
}

main ol li > ul {
  margin: 0.5rem 0;
}

/* links */
main a {
  color: var(--primary);
  font-weight: 400;
  text-decoration: none;
  outline-offset: 4px;
}

main a:hover {
  border-bottom: 1px dashed;
}

main a:active {
  background: var(--secondary-container);
}

main a:visited {
  color: var(--tertiary);
}

code {
  background: var(--surface-variant);
  border-radius: var(--shape-m); 
  padding: 8px;
  font-family: 'Google Sans Code', monospace;
}

:not(pre) > code {
  border-radius: var(--shape-s);
  padding: 0 4px;
}

pre {
  background: var(--surface-variant);
  border-radius: var(--shape-m);
  padding: 16px;
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: 0.9em;
  line-height: 1.5;
}

blockquote {
  background: var(--surface-container-high);
  border-radius: var(--shape-s);
  border-left: 5px solid var(--outline-variant);
  margin: 1.5em 10px;
  padding: 0.01em 10px;
  margin-inline-start: 0;
}

/* Highlight.js syntax colors */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
  color: var(--code-keyword);
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
  color: var(--code-string);
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
  color: var(--code-comment);
}

.hljs-number,
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-bullet,
.hljs-link {
  color: var(--code-number);
}

.hljs-attr,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: var(--code-attr);
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}

.markdown-alert {
  background: var(--surface-container-high);
  border-radius: var(--shape-s);
  padding: 8px 16px;
  margin: 10px 0px;
}

.markdown-alert.markdown-alert-important {
  border-left: 8px solid var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.markdown-alert.markdown-alert-note {
  border-left: 8px solid var(--secondary-container);
  color: var(--on-secondary-container);
}

.markdown-alert.markdown-alert-tip {
  border-left: 8px solid var(--primary-container);
  color: var(--on-primary-container);
}

.markdown-alert.markdown-alert-warning,
.markdown-alert.markdown-alert-caution {
  border-left: 8px solid var(--error-container);
  color: var(--on-error-container);
}

.markdown-alert .markdown-alert-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.markdown-alert-icon {
  display: inline-flex;
  align-items: center;
  font-size: 1.25rem;
}

.markdown-alert-note .markdown-alert-title {
  color: var(--secondary);
}

.markdown-alert-tip .markdown-alert-title {
  color: var(--primary);
}

.markdown-alert-important .markdown-alert-title {
  color: var(--tertiary);
}

.markdown-alert-warning .markdown-alert-title,
.markdown-alert-caution .markdown-alert-title {
  color: var(--error);
}

/* Tables */
main table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 0.95rem;
  border-radius: var(--shape-m);
  overflow: hidden;
  border: 1px solid var(--outline-variant);
}

main th,
main td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--outline-variant);
  border-right: 1px solid var(--outline-variant);
  text-align: left;
}

main th:last-child,
main td:last-child {
  border-right: none;
}

main tr:last-child td {
  border-bottom: none;
}

main th {
  background: var(--surface-container-high);
  font-weight: 600;
  color: var(--on-surface);
}

main td {
  background: var(--surface);
}

main tr:hover td {
  background: var(--surface-container);
}

main th[align="center"],
main td[align="center"] {
  text-align: center;
}

main th[align="right"],
main td[align="right"] {
  text-align: right;
}
