/* ── Google Fonts ── */
@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&family=DM+Mono:wght@400;500&display=swap");

/* ══════════════════════════════
   VARIABLES
══════════════════════════════ */
:root {
  --bg-page: #ffffff;
  --bg-surface: #f8f8f7;
  --bg-hover: #f3f3f1;
  --bg-border: #e8e8e4;

  --text-primary: #1a1916;
  --text-secondary: #6b6b66;
  --text-muted: #a8a8a2;
  --text-label: #888882;

  --accent: #0051ff;
  --accent-dim: #0051ff12;
  --accent-hover: #0041cc;

  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;

  --border: #e8e8e4;
  --border-strong: #d0d0ca;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07);

  --header-h: 56px;
  --sidebar-w: 240px;
  --toc-w: 200px;
  --content-max: 720px;

  --font-display: "Instrument Serif", serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "DM Mono", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.header__logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__logo-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.header__logo-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.header__search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.header__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header__search {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px 8px 34px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.header__search::placeholder {
  color: var(--text-muted);
}

.header__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: #fff;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
}

.search-results.open {
  display: block;
}

.search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.12s;
}

.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.search-result-item__platform {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1.5rem;
}

.hero__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  animation: fadeUp 0.5s ease both;
}

.hero__sub {
  font-size: 15px;
  color: var(--text-secondary);
  animation: fadeUp 0.5s ease 0.1s both;
}

/* ══════════════════════════════
   MAIN / HOMEPAGE
══════════════════════════════ */
.main {
  padding: 3rem 1.5rem;
}

.main__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Platform sections grid */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.section-card {
  display: block;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s;
  animation: fadeUp 0.4s ease both;
}

.section-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.section-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.section-card__name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-card__count {
  font-size: 12px;
  color: var(--text-muted);
}

.section-card__arrow {
  display: block;
  margin-top: 1rem;
  font-size: 18px;
  color: var(--accent);
  transition: transform 0.2s;
}

.section-card:hover .section-card__arrow {
  transform: translateX(4px);
}

/* Featured articles */
.featured__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.featured-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s;
}

.featured-card:hover {
  background: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

.featured-card__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.featured-card__platform {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ══════════════════════════════
   ARTICLE LAYOUT
══════════════════════════════ */
.article-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  gap: 3rem;
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  padding: 2rem 0;
  max-height: calc(100vh - var(--header-h) - 4rem);
  overflow-y: auto;
}

.sidebar__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.12s;
  line-height: 1.4;
}

.sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar__link.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

/* ── Article main ── */
.article-main {
  padding: 2.5rem 0;
  min-width: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb__sep {
  color: var(--border-strong);
}

/* Feature flag notice */
.feature-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.feature-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Cross-platform links */
.cross-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cross-platform__label {
  color: var(--text-secondary);
  font-style: italic;
}

.cross-platform__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cross-platform__link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 99px;
  transition: all 0.15s;
}

.cross-platform__link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Article header */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.article-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.article-header__meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Article body */
.article-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1rem;
}
/*.article-body p em:only-child {
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}*/
.article-body p.caption em,
.article-body p.caption {
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

.article-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body strong {
  font-weight: 600;
}

.article-body p em,
.article-body p a,
.article-body p strong {
  display: inline;
}
.article-body em {
  font-style: italic;
  color: var(--text-secondary);
}
.article-body a em {
  color: var(--accent);
  text-decoration: none;
}
.article-body a em:hover {
  text-decoration: underline;
}

/* Large images — screenshots and illustrations */
/* Large screenshots */
/* Large screenshots */
.article-body img {
  max-width: 60%;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 1rem auto;
  display: block;
}

/* Small icons — tab icons, UI element icons */
.article-body img[width="63"],
.article-body img[width="50"],
.article-body img[width="36"],
.article-body img[width="20"] {
  max-width: 32px;
  width: 32px;
  height: auto;
  display: inline;
  vertical-align: middle;
  margin: 0 4px;
  border: none;
  border-radius: 4px;
}

/* Full size screenshots — figures */
.article-body figure img,
.article-body img.wp-block-image,
.article-body .wp-block-image img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.article-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-primary);
}

.article-body pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

/* Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  text-decoration: none;
  transition: all 0.15s;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Prev / Next navigation */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}
.article-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s;
}

.article-nav__link:hover {
  border-color: var(--accent);
  background: #fff;
  text-decoration: none;
}

.article-nav__link--next {
  text-align: right;
}

.article-nav__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.article-nav__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ── Table of Contents ── */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  padding: 2rem 0;
}

.toc__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.toc__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc__link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all 0.15s;
  line-height: 1.4;
}

.toc__link:hover {
  color: var(--accent);
  text-decoration: none;
}
.toc__link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ══════════════════════════════
   SKELETON LOADING
══════════════════════════════ */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton-card,
.skeleton-line,
.skeleton-title {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-hover) 50%,
    var(--bg-surface) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 140px;
  border-radius: var(--radius-lg);
}
.skeleton-title {
  height: 36px;
  margin-bottom: 12px;
  border-radius: 6px;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 4rem;
}

.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════════
   SCROLLBAR
══════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

/* ══════════════════════════════
   ANIMATIONS
══════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .toc {
    display: none;
  }
}

@media (max-width: 700px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .sidebar {
    position: static;
    padding: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
  }

  .sidebar__label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    user-select: none;
  }

  .sidebar__label::after {
    content: "▼";
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
  }

  .sidebar__label.open::after {
    transform: rotate(180deg);
  }

  .sidebar__nav {
    display: none;
    padding-bottom: 0.75rem;
  }

  .sidebar__nav.open {
    display: block;
  }

  .header__search-wrap {
    max-width: 200px;
  }
  .article-nav {
    grid-template-columns: 1fr;
  }
  .sections-grid {
    grid-template-columns: 1fr;
  }
} /* Offset anchor links to account for sticky header */
.article-body h2,
.article-body h3,
.article-body h4 {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
