/*
 * Arevei article typography — the one stylesheet for blog content.
 *
 * Loaded by the public site (index.html) and by the admin editor, which pulls
 * this same file from the site. Article HTML carries no styling of its own:
 * the admin API reduces every post to plain semantic tags plus the `av-*`
 * classes below. Change how articles look here, and only here.
 */

.av-prose {
  /* Colour roles follow the home page: white for main headings, the accent for
     sub-headings, a soft grey-green for reading text. */
  --av-text: #b4c2be;
  --av-heading: #edf5f4;
  --av-subheading: #00e6c4;
  --av-minor-heading: #dbe5e2;
  --av-muted: #8b9a96;
  --av-accent: #00e6c4;
  --av-accent-soft: rgba(0, 230, 196, 0.08);
  --av-border: rgba(225, 255, 246, 0.12);
  --av-border-strong: rgba(225, 255, 246, 0.26);
  --av-surface: rgba(255, 255, 255, 0.035);

  color: var(--av-text);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0;
  text-align: left;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  .av-prose {
    font-size: 1.125rem;
  }
}

.av-prose > :first-child {
  margin-top: 0;
}

.av-prose > :last-child {
  margin-bottom: 0;
}

/* Headings ------------------------------------------------------------- */

.av-prose h2,
.av-prose h3,
.av-prose h4 {
  color: var(--av-heading);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  scroll-margin-top: 6.5rem;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.av-prose h2 {
  margin: 3.25rem 0 1.1rem;
  font-size: 1.625rem;
  line-height: 1.22;
}

.av-prose h3 {
  margin: 2.25rem 0 0.75rem;
  color: var(--av-subheading);
  font-size: 1.3125rem;
  font-weight: 500;
  line-height: 1.3;
}

.av-prose h4 {
  margin: 1.75rem 0 0.5rem;
  color: var(--av-minor-heading);
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .av-prose h2 {
    font-size: 2rem;
  }

  .av-prose h3 {
    font-size: 1.4375rem;
  }

  .av-prose h4 {
    font-size: 1.125rem;
  }
}

.av-prose h2 + h3,
.av-prose h3 + h4 {
  margin-top: 1rem;
}

/* Text ----------------------------------------------------------------- */

.av-prose p {
  margin: 0 0 1.35em;
  color: var(--av-text);
}

.av-prose p.av-lead {
  color: #d3dedb;
  font-size: 1.15em;
  line-height: 1.65;
}

.av-prose strong {
  color: var(--av-heading);
  font-weight: 600;
}

.av-prose em {
  font-style: italic;
}

.av-prose a {
  color: var(--av-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 230, 196, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease;
}

.av-prose a:hover {
  text-decoration-color: var(--av-accent);
}

.av-prose mark {
  padding: 0.05em 0.25em;
  border-radius: 0.25em;
  background: rgba(0, 230, 196, 0.18);
  color: var(--av-heading);
}

.av-prose hr {
  height: 1px;
  margin: 3rem 0;
  border: 0;
  background: var(--av-border);
}

.av-prose .av-align-center {
  text-align: center;
}

.av-prose .av-align-right {
  text-align: right;
}

/* Lists ---------------------------------------------------------------- */

.av-prose ul,
.av-prose ol {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}

.av-prose li {
  position: relative;
  margin: 0 0 0.6em;
  padding-left: 1.75em;
  color: var(--av-text);
}

.av-prose li > p {
  margin-bottom: 0.5em;
}

.av-prose li > ul,
.av-prose li > ol {
  margin: 0.6em 0 0;
}

.av-prose ul > li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0.35em;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--av-accent);
}

.av-prose ul ul > li::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--av-accent);
}

.av-prose ol {
  counter-reset: av-item;
}

.av-prose ol > li {
  counter-increment: av-item;
}

.av-prose ol > li::before {
  content: counter(av-item) ".";
  position: absolute;
  top: 0;
  left: 0;
  width: 1.4em;
  color: var(--av-accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.av-prose ul.av-checklist > li {
  padding-left: 2em;
}

.av-prose ul.av-checklist > li::before {
  content: "";
  top: 0.32em;
  left: 0;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--av-accent-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300e6c4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E")
    center / 0.8em no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 230, 196, 0.35);
}

.av-prose ol.av-steps > li {
  margin-bottom: 1.1em;
  padding-left: 2.9em;
}

.av-prose ol.av-steps > li::before {
  content: counter(av-item);
  top: 0.05em;
  width: 1.95em;
  height: 1.95em;
  border-radius: 50%;
  background: var(--av-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 230, 196, 0.35);
  font-size: 0.85em;
  line-height: 1.95em;
  text-align: center;
}

/* Tables --------------------------------------------------------------- */

.av-prose .av-table-wrap {
  margin: 2rem 0 2.25rem;
  overflow-x: auto;
  border: 1px solid var(--av-border);
  border-radius: 0.75rem;
  background: var(--av-surface);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 255, 246, 0.25) transparent;
}

.av-prose table {
  width: 100%;
  min-width: 34rem;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9em;
  line-height: 1.55;
  text-align: left;
}

/* A bare table (content that has not been through the API yet) still gets a frame. */
.av-prose > table {
  margin: 2rem 0 2.25rem;
  border: 1px solid var(--av-border);
}

.av-prose th,
.av-prose td {
  padding: 0.9rem 1.1rem;
  border: 0;
  border-right: 1px solid var(--av-border);
  border-bottom: 1px solid var(--av-border);
  color: var(--av-text);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

.av-prose th:last-child,
.av-prose td:last-child {
  border-right: 0;
}

.av-prose tbody tr:last-child > td,
.av-prose tbody tr:last-child > th {
  border-bottom: 0;
}

.av-prose thead th,
.av-prose table > tr:first-child > th,
.av-prose tbody:first-child > tr:first-child > th {
  border-bottom: 2px solid var(--av-border-strong);
  background: rgba(255, 255, 255, 0.045);
  color: var(--av-heading);
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.av-prose tbody td:first-child,
.av-prose tbody th {
  color: var(--av-heading);
  font-weight: 500;
}

.av-prose tbody tr:hover > td {
  background: rgba(255, 255, 255, 0.025);
}

.av-prose td > :last-child,
.av-prose th > :last-child {
  margin-bottom: 0;
}

.av-prose caption {
  padding: 0.75rem 1rem;
  caption-side: bottom;
  color: var(--av-muted);
  font-size: 0.9em;
  text-align: left;
}

/* Quotes and callouts -------------------------------------------------- */

.av-prose blockquote {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--av-accent);
  color: var(--av-heading);
  font-size: 1.2em;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.av-prose blockquote p {
  margin-bottom: 0.6em;
  color: inherit;
}

.av-prose blockquote > :last-child {
  margin-bottom: 0;
}

.av-prose .av-callout {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(0, 230, 196, 0.22);
  border-left: 3px solid var(--av-accent);
  border-radius: 0.75rem;
  background: var(--av-accent-soft);
}

.av-prose .av-callout > :first-child {
  margin-top: 0;
}

.av-prose .av-callout > :last-child {
  margin-bottom: 0;
}

.av-prose .av-callout h3,
.av-prose .av-callout h4 {
  margin: 0 0 0.5rem;
  color: var(--av-heading);
  font-size: 1.0625em;
}

.av-prose .av-cta {
  margin: 2.5rem 0;
  padding: 1.75rem;
  border: 1px solid var(--av-border);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(0, 230, 196, 0.1), rgba(0, 174, 255, 0.05));
}

.av-prose .av-cta > :first-child {
  margin-top: 0;
}

.av-prose .av-cta > :last-child {
  margin-bottom: 0;
}

.av-prose a.av-button {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.35rem;
  border-radius: 9999px;
  background: var(--av-accent);
  color: #052a25;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.av-prose a.av-button:hover {
  background: #69f6df;
  transform: translateY(-1px);
}

.av-prose .av-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.av-prose .av-card {
  padding: 1.25rem;
  border: 1px solid var(--av-border);
  border-radius: 0.75rem;
  background: var(--av-surface);
  font-size: 0.95em;
}

.av-prose .av-card > :first-child {
  margin-top: 0;
}

.av-prose .av-card > :last-child {
  margin-bottom: 0;
}

.av-prose .av-card h3,
.av-prose .av-card h4 {
  margin: 0 0 0.5rem;
  color: var(--av-heading);
  font-size: 1.0625rem;
}

/* Media and code ------------------------------------------------------- */

.av-prose figure {
  margin: 2.5rem 0;
}

.av-prose img,
.av-prose video,
.av-prose iframe {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.av-prose figure img,
.av-prose figure video {
  width: 100%;
  border: 1px solid var(--av-border);
}

.av-prose iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.av-prose figcaption {
  margin-top: 0.75rem;
  color: var(--av-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.av-prose code {
  padding: 0.15em 0.4em;
  border-radius: 0.35em;
  background: rgba(255, 255, 255, 0.08);
  color: #e6f4f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.av-prose pre {
  margin: 2rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--av-border);
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.9em;
  line-height: 1.6;
}

.av-prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.av-prose details {
  border-bottom: 1px solid var(--av-border);
}

.av-prose details:first-of-type {
  border-top: 1px solid var(--av-border);
}

.av-prose summary {
  padding: 1.1rem 2rem 1.1rem 0;
  position: relative;
  color: var(--av-heading);
  font-weight: 500;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

.av-prose summary::-webkit-details-marker {
  display: none;
}

.av-prose summary::after {
  content: "+";
  position: absolute;
  top: 0.95rem;
  right: 0.25rem;
  color: var(--av-accent);
  font-size: 1.35em;
  font-weight: 400;
  line-height: 1;
}

.av-prose details[open] > summary::after {
  content: "\2212";
}

.av-prose details > :not(summary) {
  margin: 0 0 1.1rem;
}
