/*
 * SkillScope blog: the whole front-end stylesheet (no build step).
 *
 * Ported from docs/design/prototype.html (variants marked ★). The prototype's
 * `@container site` queries are `@media` here with the same points:
 *   ≥ 640px  tablet   (block "Tablet" near the end of the file)
 *   ≥ 1024px desktop  (block "Desktop")
 * Resets carry zero specificity (:where) so component classes (.btn, .backlink, .prose > *) always win.
 *
 * Sections: tokens · fonts · resets · layout · buttons · header · mobile menu · CTA · footer ·
 * contact modal · [templates: list, card, article, prose, 404 — stage 4] · tablet · desktop · motion.
 * Bump Version in style.css after every change: ?ver= is the theme version and assets are cached for a year.
 */

/* ---------- Tokens (landing lps/public/skillscope/style.css + blog contrast fixes) ---------- */

:root {
  --blue: #647ffe; /* brand: decor, borders, icons */
  --blue-ink: #3b5efe; /* blog only: text/buttons, 4.98:1 on white */
  --blue-deep: #2f4ee8; /* blog only: text on lavender, 5.59:1 on #f1f2ff, 4.53:1 on #d5daff (#3b5efe is 4.48:1) */
  --blue-300: #9fa9ff;
  --blue-100: #d5daff;
  --dark: #1d1d1f;
  --gray: #7a7a90; /* landing gray, decor only (4.19:1) */
  --gray-text: #6d6d83; /* blog only: secondary text, 5.04:1 */
  --gray-blue: #5c6c98;
  --bg-tertiary: #f7f8ff;
  --bg-subtle: #f9faff;
  --bg-selected: #f1f2ff;
  --border: #e3e3e8;
  --red: #ff5761;
  --yellow: #f6b22a;
  --green: #1caf70;
  --error: #d1242f; /* form errors, 5.4:1 on white (the landing's #ff4d4f is 3.4:1) */
  --code-bg: #1e2140;
  --code-fg: #e8ebff;
  --white: #ffffff;
  --font: 'Geologica', 'Segoe UI', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gut: 16px; /* side padding of .wrap: 16 / 32 / 40 */
  --header-h: 60px;
  color-scheme: light;
}

/* ---------- Fonts: Geologica variable (wght axis), self-hosted, OFL (assets/fonts/OFL.txt) ---------- */

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(../fonts/geologica-cyrillic-wght.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(../fonts/geologica-latin-wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Resets (zero specificity) ---------- */

/* Not :where — it has to beat `*` below, which every element inherits box-sizing through */
html {
  box-sizing: border-box;
}

:where(html) {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* `*` already has zero specificity (and pseudo-elements are not allowed inside :where) */
*,
*::before,
*::after {
  box-sizing: inherit;
}

:where(body) {
  margin: 0;
  background: var(--white);
  color: var(--dark);
  font-family: var(--font);
  font-weight: 300;
  font-variation-settings: 'CRSV' 0, 'SHRP' 0;
  -webkit-font-smoothing: antialiased;
}

:where(a) {
  color: inherit;
  text-decoration: none;
}

:where(img, svg, video) {
  display: block;
  max-width: 100%;
}

:where(img) {
  height: auto;
}

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd) {
  margin: 0;
}

:where(button, input, textarea, select) {
  font: inherit;
  color: inherit;
}

:where(button) {
  cursor: pointer;
}

:where(html.has-overlay) {
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--blue-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout ---------- */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-main {
  flex: 1 0 auto;
}

.site-main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: calc(1290px + 2 * var(--gut));
  margin-inline: auto;
  padding-inline: var(--gut);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--blue-ink);
  color: var(--white);
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Buttons (landing .btn with the accessible blue) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 12px 24px;
  border: 1px solid var(--blue-ink);
  border-radius: 300px;
  background: var(--blue-ink);
  font-family: inherit;
  font-size: 18px;
  line-height: 25px;
  font-weight: 400;
  color: var(--white);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.btn--sm {
  height: 40px;
  padding: 8px 20px;
  font-size: 16px;
}

.btn--outline {
  border-color: var(--blue);
  background: transparent;
  color: var(--blue-ink);
}

.btn--outline:hover {
  background: rgba(100, 127, 254, 0.08);
}

/* ---------- Header: logo | Blog lockup ---------- */

.header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 20;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 4.2px 0 rgba(100, 127, 254, 0.2);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header__logo img {
  width: 154px;
  height: 30px;
}

.brand-blog {
  display: flex;
  align-items: center;
  height: 30px; /* the logo height: the divider is as tall as the logo */
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--dark);
}

.brand-blog:hover {
  color: var(--blue-ink);
}

.lang {
  position: relative;
  display: none;
  margin-left: auto;
}

.lang__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 12px 0;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 25px;
  font-weight: 400;
  color: var(--gray-text);
}

.lang__toggle svg {
  transition: transform 0.3s ease;
}

.lang:hover .lang__toggle svg,
.lang:focus-within .lang__toggle svg,
.lang.is-open .lang__toggle svg {
  transform: rotate(180deg);
}

.lang__list {
  position: absolute;
  top: 100%;
  left: -20px;
  display: flex;
  flex-direction: column;
  padding: 13px 20px;
  border: 1px solid var(--blue-100);
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.lang:hover .lang__list,
.lang:focus-within .lang__list,
.lang.is-open .lang__list {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.lang__list a {
  padding: 6px 0;
}

.lang__list a:hover,
.lang__list a[aria-current] {
  color: var(--blue-ink);
}

.header__actions {
  display: none;
  gap: 16px;
  margin-left: auto;
}

.header__actions .btn--outline {
  display: none;
}

.header__burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  background: var(--bg-selected);
  color: var(--dark);
}

/* ---------- Mobile menu (below 1024), Figma 1336:9933 — the landing's panel ---------- */

/* Full-screen and transparent: a tap below the panel closes the menu (site.js) */
.mmenu {
  position: fixed;
  inset: 0;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 50;
  color: var(--dark);
  visibility: hidden;
  transition: visibility 0.3s;
}

.mmenu.is-open {
  visibility: visible;
  /* visible at once, so site.js can move focus into the menu right after opening it */
  transition: visibility 0s;
}

.mmenu__panel {
  max-height: 100%;
  overflow-y: auto;
  border-radius: 0 0 16px 16px;
  background: var(--white);
  box-shadow: 0 8px 16px 0 rgba(100, 116, 254, 0.2);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mmenu.is-open .mmenu__panel {
  transform: none;
}

.mmenu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding-inline: 16px;
}

.mmenu__logo img {
  width: 154px;
  height: 30px;
}

.mmenu__close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-right: -12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--blue);
}

.mmenu__body {
  display: flex;
  flex-direction: column;
  gap: 100px;
  padding: 32px;
}

.mmenu__nav,
.mmenu__lang {
  max-width: 293px;
}

.mmenu__nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--blue-100);
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
}

.mmenu__nav a:hover,
.mmenu__nav a[aria-current] {
  color: var(--blue-ink);
}

.mmenu__lang {
  margin-top: 16px;
}

.mmenu__lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 32px;
  font-weight: 300;
  color: var(--gray-blue);
}

.mmenu__lang-toggle svg {
  transition: transform 0.3s ease;
}

.mmenu__lang.is-open .mmenu__lang-toggle svg {
  transform: rotate(180deg);
}

.mmenu__lang-list {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 8px;
  font-size: 18px;
  line-height: 25px;
  font-weight: 400;
}

.mmenu__lang.is-open .mmenu__lang-list {
  display: flex;
}

.mmenu__lang-list a[aria-current] {
  color: var(--blue-ink);
}

.mmenu__actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- CTA «Request a demo» (landing .cta), above the footer on every page ---------- */

.cta {
  position: relative;
  overflow: hidden;
  padding-block: 160px;
}

/* Mobile/tablet lines from the landing (m-cta-*.svg), pinned to the section
   edges instead of the landing's fixed tops so a longer heading cannot hit them */
.cta__mlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cta__ml {
  position: absolute;
  overflow: visible;
}

.cta__ml--red-top { left: 16px; top: 0; width: 57px; height: 105px; }
.cta__ml--yellow-top { left: 50%; top: 0; width: 62px; height: 51px; }
.cta__ml--green { right: 0; top: 81px; width: 66px; height: 14px; }
.cta__ml--red-bottom { right: 0; bottom: 12px; width: 85px; height: 47px; }
.cta__ml--yellow-bottom { left: 0; bottom: 12px; width: 161px; height: 86px; }

.cta__lines {
  position: absolute;
  left: 50%;
  top: -137px;
  display: none;
  width: 2303.5px;
  max-width: none;
  height: 718px;
  margin-left: -1083px;
  pointer-events: none;
}

.cta__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cta h2 {
  font-size: 32px;
  line-height: 45px;
  font-weight: 600;
  text-wrap: balance;
}

.cta__side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 40px;
}

.cta__side p {
  font-size: 16px;
  line-height: 26px;
  font-weight: 300;
  color: var(--gray-blue);
}

.cta__side p span {
  color: var(--blue-ink);
}

/* ---------- Footer (landing) + «Blog» in Resources ---------- */

.footer {
  padding-block: 56px;
  background: var(--bg-tertiary);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer__brand { display: contents; }
.footer__brand > div:first-child { order: 1; }
.footer__menus { order: 2; }
.footer__brand > div:last-child { order: 3; }

.footer__logo {
  display: inline-block;
}

.footer__logo img {
  width: 205px;
  height: 40px;
}

.footer__tagline {
  max-width: 300px;
  margin-top: 16px;
  font-size: 12px;
  line-height: 17px;
  color: var(--gray-blue);
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social img {
  width: 32px;
  height: 32px;
}

.footer__copy {
  margin-top: 24px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--gray-blue);
}

.footer__menus {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 60px;
}

.footer__menu:first-child {
  flex-basis: 100%;
}

.footer__menu h2 {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 25px;
  font-weight: 400;
}

.footer__menu ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 22px;
  color: var(--gray-text);
}

.footer__menu a,
.footer__link {
  transition: color 0.2s ease;
}

/* «Contact us» is a button (it opens the modal) that looks like the other footer links */
.footer__link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
}

.footer__menu a:hover,
.footer__link:hover {
  color: var(--blue-ink);
}

/* ---------- Contact modal (landing .cm-*, loaded by assets/js/contact.js) ---------- */

.cm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cm-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(600px, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.cm-modal.is-open .cm-card {
  transform: none;
}

.cm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 20px 24px;
}

.cm-title {
  font-size: 24px;
  line-height: 29px;
  font-weight: 600;
}

.cm-close {
  display: flex;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--gray-text);
  transition: color 0.2s ease;
}

.cm-close:hover {
  color: var(--dark);
}

.cm-body {
  padding: 0 24px 24px;
}

.cm-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.cm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-label {
  font-size: 14px;
  font-weight: 500;
}

.cm-input,
.cm-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: var(--white);
  font: 400 16px/22px var(--font);
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cm-textarea {
  min-height: 120px;
  resize: vertical;
}

.cm-input::placeholder,
.cm-textarea::placeholder {
  color: #8a8a9e;
}

.cm-input:focus,
.cm-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(100, 127, 254, 0.1);
}

.cm-input[aria-invalid='true'],
.cm-textarea[aria-invalid='true'] {
  border-color: var(--error);
}

.cm-field-error,
.cm-form-error {
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  color: var(--error);
}

.cm-form-error {
  margin-top: 12px;
  font-size: 14px;
  line-height: 20px;
}

.cm-footer {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

.cm-policy {
  margin-bottom: 32px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  color: var(--gray-text);
}

.cm-policy a {
  color: var(--blue-ink);
  text-decoration: underline;
}

.cm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cm-success-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 32px 50px;
  text-align: center;
}

.cm-success-view[hidden],
.cm-view-form[hidden] {
  display: none;
}

.cm-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: #f0f4ff;
  color: var(--blue);
}

.cm-success-title {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 34px;
  font-weight: 600;
}

.cm-success-text {
  max-width: 320px;
  margin-bottom: 32px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--gray-text);
}

/* ================= Templates (stage 4) =================
 * Ported from docs/design/prototype.html with the ★ variants flattened: elevated card, «first large»
 * (.card--featured on the first card of page 1), stairs placeholder, centred article head, lines + latest 404.
 * The ≥640 / ≥1024 rules of these blocks are in the two media blocks below.
 */

.site-main {
  /* alignfull blocks use 100vw, which includes the scrollbar */
  overflow-x: clip;
}

/* ---------- Blog head: hero strip of the landing, left-aligned title and lead ---------- */

.bhead {
  position: relative;
  overflow: hidden;
  padding-block: 48px;
  background: linear-gradient(180deg, #eef0ff 0%, var(--white) 100%);
}

.bhead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(29, 29, 31, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(29, 29, 31, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0, transparent 85%);
  pointer-events: none;
}

.bhead .wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.bhead h1 {
  font-size: 36px;
  line-height: 1.24;
  font-weight: 600;
}

.bhead p {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--gray-text);
}

/* ---------- Post grid and card: white on the lavender list section, no shadow ---------- */

.posts-section {
  padding-block: 40px;
  background: var(--bg-tertiary);
}

.posts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--white);
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 410 / 298;
  background: var(--bg-selected);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 16px;
}

.card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

/* Reading time. #647ffe on #f7f8ff is 3.3:1, so the text takes the blog's accessible blue (4.7:1) */
.badge {
  display: inline-flex;
  padding: 4px 16px;
  border-radius: 100px;
  background: var(--bg-tertiary);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 300;
  color: var(--blue-ink);
  white-space: nowrap;
}

.card__title {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.card__title a {
  transition: color 0.2s ease;
}

/* The title link covers the whole card; «Read more» sits above it */
.card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card:hover .card__title a {
  color: var(--blue-ink);
}

.card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--dark);
}

/* A link that looks like the landing's text button */
.card__more {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 200px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--blue-ink);
}

.card__more svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.card:hover .card__more svg {
  transform: translate(2px, -2px);
}

/* ---------- Placeholder without a cover: the landing's stepped lines + logo ---------- */

.ph {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ph svg.ph__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card__media .ph__logo {
  position: relative;
  width: 44%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
}

.card:hover .card__media .ph__logo {
  transform: none;
}

.ph--stairs {
  background: var(--bg-selected);
}

/* ---------- «View more»: a link to the next page, loaded in place by site.js ---------- */

.more {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ---------- Empty state: a white plate on the lavender section ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--white);
  text-align: center;
}

.empty__img {
  width: 343px;
  max-width: 100%;
  height: auto;
  margin-block: 16px;
}

.empty__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty h2 {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 400;
}

.empty p {
  max-width: 600px;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--gray-text);
}

/* ---------- Article ---------- */

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--blue-ink);
}

.backlink svg {
  transition: transform 0.2s ease;
}

.backlink:hover svg {
  transform: translateX(-3px);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--gray-text);
}

.meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--blue-300);
}

/* Head: centred. The back link above it is a direct child of .wrap, so it starts where the logo
   in the site header does; the one below the article stays in the 720px text column. */
.art-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 860px;
  margin-inline: auto;
  padding-block: 24px;
  text-align: center;
}

.article .wrap > .backlink {
  margin-top: 24px;
}

.article .wrap > .backlink + .art-head {
  padding-top: 16px;
}

.art-head .meta {
  justify-content: center;
}

.art-head h1 {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.art-head .lead {
  font-size: 18px;
  line-height: 29px;
  color: var(--gray-text);
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dark);
  font-weight: 400;
}

.author img,
.author__initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.author img {
  object-fit: cover;
}

/* No avatar uploaded: the initial on lavender */
.author__initial {
  display: grid;
  place-items: center;
  background: var(--bg-selected);
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  color: var(--blue-deep);
}

.cover {
  max-width: 1080px;
  margin: 8px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-selected);
}

.cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.art-foot {
  max-width: 720px;
  margin: 24px auto 0;
  padding-block: 20px 56px;
  border-top: 1px solid var(--border);
}

/* ---------- Prose: the content of an article (Gutenberg blocks) ---------- */

.prose {
  max-width: 720px;
  margin-inline: auto;
  padding-block: 40px 16px;
  font-size: 17px;
  line-height: 28px;
  font-weight: 300;
  overflow-wrap: break-word;
  /* alignwide: from the 720 column out to min(1000, the wrap); 100% is the prose width */
  --wide: min(1000px, 100vw - 2 * var(--gut));
}

/* floats (alignleft/alignright) stay inside the article */
.prose::after {
  content: '';
  display: table;
  clear: both;
}

.prose > * + * { margin-top: 22px; }
.prose > h2 { margin-top: 48px; font-size: 26px; line-height: 34px; font-weight: 600; text-wrap: balance; }
.prose > h3 { margin-top: 36px; font-size: 21px; line-height: 30px; font-weight: 500; text-wrap: balance; }
.prose > h4 { margin-top: 28px; font-size: 18px; line-height: 26px; font-weight: 500; }
.prose > h5,
.prose > h6 { margin-top: 24px; font-size: 17px; line-height: 26px; font-weight: 500; }
.prose > h2 + *,
.prose > h3 + *,
.prose > h4 + *,
.prose > h5 + *,
.prose > h6 + * { margin-top: 12px; }

.prose strong { font-weight: 500; }

.prose a {
  color: var(--blue-ink);
  text-decoration: underline;
  text-decoration-color: var(--blue-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover { text-decoration-color: var(--blue-ink); }

.prose ul,
.prose ol { padding-left: 26px; }
.prose li + li { margin-top: 8px; }
.prose li > ul,
.prose li > ol { margin-top: 8px; }
.prose li::marker { color: var(--blue); }
.prose ol li::marker { color: var(--blue-ink); font-weight: 500; }

/* Quote: the lavender plate with the landing's quote mark (drawn by CSS, the block has none) */
.prose blockquote {
  margin-block: 36px;
  padding: 28px;
  border-radius: 16px;
  background: var(--bg-tertiary);
}

.prose blockquote::before {
  content: '';
  display: block;
  width: 36px;
  height: 28px;
  margin-bottom: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='28' viewBox='0 0 36 28'%3E%3Cpath fill='%23647FFE' d='M0 28V16.6C0 7.9 4.3 2.4 12.9 0l1.8 3.6C10.2 5.3 8 8.2 7.6 12.4H14V28H0zm21 0V16.6C21 7.9 25.3 2.4 33.9 0l1.8 3.6c-4.5 1.7-6.7 4.6-7.1 8.8H35V28H21z'/%3E%3C/svg%3E") no-repeat;
}

.prose blockquote > * + * { margin-top: 12px; }
.prose blockquote p { font-size: 20px; line-height: 31px; font-weight: 400; text-wrap: pretty; }
.prose blockquote cite {
  display: block;
  margin-top: 14px;
  font-size: 15px;
  line-height: 22px;
  font-style: normal;
  color: var(--gray-text);
}

.prose .wp-block-pullquote { padding: 0; text-align: left; }
.prose .wp-block-pullquote blockquote { margin: 0; }

/* Images */
.prose figure img { width: 100%; border-radius: 16px; }
.prose figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--gray-text);
  text-align: center;
}

.prose .alignwide { margin-inline: calc((100% - var(--wide)) / 2); }
.prose .alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }
.prose .alignfull img { border-radius: 0; }
.prose .aligncenter { margin-inline: auto; }
.prose .alignleft,
.prose .alignright { max-width: 50%; }
.prose .alignleft { float: left; margin: 4px 24px 12px 0; }
.prose .alignright { float: right; margin: 4px 0 12px 24px; }
.prose .alignleft img,
.prose .alignright img { width: auto; }

.prose .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.prose .wp-block-gallery > * + * { margin-top: 0; }
.prose .wp-block-gallery img { height: 100%; object-fit: cover; }

/* Table: scrolls inside its own box, the caption stays in view */
.prose .wp-block-table { overflow-x: auto; }
.prose .wp-block-table figcaption { position: sticky; left: 0; }
.prose table {
  width: 100%;
  min-width: 480px;
  border: 1px solid var(--border);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td { padding: 12px 16px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-selected); font-weight: 500; }
.prose th:first-child { border-top-left-radius: 11px; }
.prose th:last-child { border-top-right-radius: 11px; }
.prose td { border-top: 1px solid var(--border); }

/* Code: inline on lavender, the block dark and scrolling inside itself */
.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-selected);
  color: #2b3990;
  font-family: var(--mono);
  font-size: 0.86em;
}

.prose pre {
  overflow-x: auto;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 14px/23px var(--mono);
}
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.prose .wp-block-preformatted,
.prose .wp-block-verse { white-space: pre-wrap; }
.prose .wp-block-verse { font-family: inherit; }

.prose hr {
  height: 1px;
  margin-block: 40px;
  border: 0;
  background: var(--border);
}

.prose .wp-block-spacer { height: 32px; }

/* Buttons: the blog .btn, the outline style as .btn--outline */
.prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

.prose .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 24px;
  border: 1px solid var(--blue-ink);
  border-radius: 300px;
  background: var(--blue-ink);
  font-size: 18px;
  line-height: 25px;
  font-weight: 400;
  color: var(--white);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.prose .wp-block-button__link:hover { transform: translateY(-1px); }

.prose .is-style-outline .wp-block-button__link {
  border-color: var(--blue);
  background: transparent;
  color: var(--blue-ink);
}

.prose .is-style-outline .wp-block-button__link:hover { background: rgba(100, 127, 254, 0.08); }

/* Embeds and media */
.prose iframe,
.prose video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 16px;
}
.prose audio { width: 100%; }

/* YouTube facade (inc/embeds.php, assets/js/embed.js) */
.embed {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--code-bg);
  color: var(--white);
  text-align: left;
}
.prose .embed img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; border-radius: 0; }
.embed__play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: var(--blue-ink);
  box-shadow: 0 8px 24px rgba(59, 94, 254, 0.45);
  transition: transform 0.2s ease;
}
.embed:hover .embed__play { transform: scale(1.06); }
.embed__label {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

/* Other blocks */
.prose details {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.prose summary { cursor: pointer; font-weight: 500; }
.prose details[open] summary { margin-bottom: 10px; }

.prose .wp-block-columns { display: flex; flex-direction: column; gap: 24px; }
.prose .wp-block-column { min-width: 0; }
.prose .wp-block-column > * + * { margin-top: 22px; }

.prose .wp-block-group.has-background { padding: 24px; border-radius: 16px; }
.prose .wp-block-group > * + * { margin-top: 22px; }

.prose .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Text alignment and the palette from theme.json (global styles are not loaded on the front) */
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.has-text-align-left { text-align: left; }

.has-small-font-size { font-size: 14px; }
.has-normal-font-size { font-size: 17px; }
.has-medium-font-size { font-size: 20px; }
.has-large-font-size { font-size: 26px; }
.has-x-large-font-size { font-size: 32px; }

.has-dark-color { color: var(--dark); }
.has-blue-ink-color { color: var(--blue-ink); }
.has-blue-color { color: var(--blue); }
.has-blue-300-color { color: var(--blue-300); }
.has-blue-100-color { color: var(--blue-100); }
.has-gray-text-color { color: var(--gray-text); }
.has-gray-blue-color { color: var(--gray-blue); }
.has-bg-selected-color { color: var(--bg-selected); }
.has-bg-tertiary-color { color: var(--bg-tertiary); }
.has-red-color { color: var(--red); }
.has-yellow-color { color: var(--yellow); }
.has-green-color { color: var(--green); }
.has-white-color { color: var(--white); }

.has-dark-background-color { background-color: var(--dark); }
.has-blue-ink-background-color { background-color: var(--blue-ink); }
.has-blue-background-color { background-color: var(--blue); }
.has-blue-300-background-color { background-color: var(--blue-300); }
.has-blue-100-background-color { background-color: var(--blue-100); }
.has-gray-text-background-color { background-color: var(--gray-text); }
.has-gray-blue-background-color { background-color: var(--gray-blue); }
.has-bg-selected-background-color { background-color: var(--bg-selected); }
.has-bg-tertiary-background-color { background-color: var(--bg-tertiary); }
.has-border-background-color { background-color: var(--border); }
.has-red-background-color { background-color: var(--red); }
.has-yellow-background-color { background-color: var(--yellow); }
.has-green-background-color { background-color: var(--green); }
.has-white-background-color { background-color: var(--white); }

/* ---------- 404 ---------- */

.nf {
  position: relative;
  overflow: hidden;
  padding-block: 56px 72px;
  background: linear-gradient(180deg, #eef0ff 0%, var(--white) 70%);
  text-align: center;
}

.nf__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.nf .wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.nf__num {
  width: min(100%, 300px);
  height: auto;
}

.nf h1 {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
}

.nf p {
  max-width: 460px;
  font-size: 17px;
  line-height: 27px;
  color: var(--gray-text);
}

.nf__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.latest {
  padding-block: 40px;
  background: var(--bg-tertiary);
}

.latest > .wrap > h2 {
  margin-bottom: 24px;
  font-size: 26px;
  line-height: 34px;
  font-weight: 600;
}

/* ================= Tablet ≥ 640 ================= */

@media (min-width: 640px) {
  :root { --gut: 32px; }

  .header__actions { display: flex; }
  /* Sign Up takes the free space from here; in the prototype this rule applied below 640 too
     and pulled the burger next to «Blog» on phones */
  .header__actions + .header__burger { margin-left: 0; }

  .bhead { padding-block: 64px; }
  .bhead h1 { font-size: 44px; }
  .bhead p { font-size: 18px; }

  .posts-section,
  .latest { padding-block: 60px; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

  .empty { padding: 64px 32px; }

  .art-head h1 { font-size: 42px; line-height: 52px; }
  .art-head .lead { font-size: 20px; line-height: 32px; }
  .cover { border-radius: 24px; }

  .prose { font-size: 18px; line-height: 31px; padding-top: 48px; }
  .prose > h2 { font-size: 30px; line-height: 40px; margin-top: 56px; }
  .prose > h3 { font-size: 23px; line-height: 33px; }
  .prose > h4 { font-size: 19px; line-height: 27px; }
  .prose blockquote { padding: 32px 36px; }
  .prose blockquote p { font-size: 22px; line-height: 34px; }
  .prose .wp-block-columns { flex-direction: row; gap: 32px; }
  .prose .wp-block-column { flex: 1 1 0; }
  .prose .wp-block-gallery.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prose .wp-block-gallery.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .nf h1 { font-size: 40px; line-height: 50px; }

  .cta__side { align-items: flex-start; }

  .footer__menus { flex-wrap: nowrap; gap: 48px; }
  .footer__menu:first-child { flex-basis: auto; }

  .cm-head { padding: 24px 24px 24px 32px; }
  .cm-body { padding: 0 32px 32px; }
  .cm-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cm-field.full { grid-column: 1 / -1; }
  .cm-policy { margin-bottom: 44px; }
}

/* ================= Desktop ≥ 1024 ================= */

@media (min-width: 1024px) {
  :root { --gut: 40px; --header-h: 80px; }

  .header__inner { gap: 21px; }
  .header__brand { gap: 24px; }
  .header__logo img { width: 205px; height: 40px; }
  .brand-blog { height: 40px; padding-left: 22px; }
  .lang { display: block; }
  .header__actions { margin-left: 0; }
  .header__actions .btn--outline { display: inline-flex; }
  .header__burger { display: none; }

  .bhead { padding-block: 100px; }
  .bhead h1 { font-size: 54px; }
  .bhead p { font-size: 20px; }

  .posts-section,
  .latest { padding-block: 100px; }
  .empty { min-height: 600px; }
  .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }

  /* The first post of the first page, large: 590 × 460 image, 70px, the text column (a normal card below 1024) */
  .card--featured { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 70px; }
  .card--featured .card__media { flex: 0 0 calc(590 / 1290 * 100%); aspect-ratio: 590 / 460; }
  .card--featured .card__body { flex: 1; justify-content: center; padding: 0 24px 0 0; }
  .card--featured .card__title { font-size: clamp(30px, 3.2vw, 44px); font-weight: 600; }
  .card--featured .card__excerpt { display: block; font-size: 20px; font-weight: 300; color: var(--gray-text); }

  .art-head { padding-block: 32px; gap: 20px; }
  .article .wrap > .backlink { margin-top: 32px; }
  .article .wrap > .backlink + .art-head { padding-top: 20px; }
  .art-head h1 { font-size: 52px; line-height: 64px; }

  .nf { padding-block: 88px 96px; }
  .nf h1 { font-size: 48px; line-height: 60px; }

  .cta { padding-block: 0; height: 460px; display: flex; align-items: center; }
  .cta__lines { display: block; }
  .cta__mlines { display: none; }
  /* Figma 1333:9167: a 1070px block in the middle, the heading stays 32px */
  .cta__inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 48px; max-width: calc(1070px + 2 * var(--gut)); }
  .cta h2 { max-width: 661px; }
  .cta__side { flex: 0 0 299px; gap: 8px; }
  .cta__side .btn { margin-top: 12px; }

  .footer { padding-block: 40px; background: var(--bg-subtle); }
  .footer__inner { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .footer__brand { display: flex; flex-direction: column; justify-content: space-between; width: 297px; min-height: 261px; }
  .footer__menus { gap: 60px; }
  .footer__menu:first-child { width: 264px; }

  .mmenu { display: none; }
}

/* The admin bar is not sticky below 601px: keep the header at the top. */
@media (max-width: 600px) {
  .admin-bar .header { top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
