/* ============================================================
   Unifiedesk blog theme — mirrors unifiedesk.com brand system
   Light editorial canvas + engineered-dark rails, teal accent.
   ============================================================ */
:root {
  --canvas: #faf8f4;
  --canvas-2: #f3efe7;
  --canvas-3: #ebe5d9;
  --ink: #14161b;
  --muted: #565f6e;
  --faint: #8b94a3;
  --line: rgba(20, 22, 28, 0.09);
  --line-2: rgba(20, 22, 28, 0.15);

  --accent: #0d9488;
  --accent-2: #14b8a6;
  --accent-3: #2dd4bf;
  --accent-ink: #0a6f66;
  --accent-wash: rgba(13, 148, 136, 0.1);

  --panel: #0b0f14;
  --panel-2: #121a24;
  --panel-card: #161f2b;
  --panel-line: rgba(255, 255, 255, 0.1);
  --panel-txt: #e8ecf2;
  --panel-muted: #8b97a8;

  --radius-sm: 0.55rem;
  --radius-md: 0.85rem;
  --radius: 1.1rem;
  --radius-lg: 1.5rem;

  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.04), 0 2px 8px -4px rgba(20, 22, 28, 0.08);
  --shadow-md: 0 12px 30px -18px rgba(20, 22, 28, 0.28);
  --glow: 0 10px 30px -10px rgba(13, 148, 136, 0.55);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur: 280ms;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.menu-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(13, 148, 136, 0.28); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 3vw, 2.5rem);
}
.container-narrow {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 3vw, 2.5rem);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 500;
}
.eyebrow--light { color: var(--accent-3); }

.display {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-size: clamp(2.4rem, 1rem + 4.5vw, 4.4rem);
  margin: 0.6rem 0 0;
}
.display em { font-style: italic; color: var(--accent-ink); }
.h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.018em;
  font-size: clamp(1.7rem, 1rem + 2vw, 2.4rem);
  margin: 0;
}
.lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  max-width: 44rem;
  margin: 1.1rem 0 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--canvas-2); border-color: var(--accent); }
.btn-light { background: rgba(255, 255, 255, 0.08); color: var(--panel-txt); border-color: var(--panel-line); }
.btn-light:hover { background: rgba(255, 255, 255, 0.15); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(13, 148, 136, 0.4);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark img { width: 22px; height: 22px; }
.wordmark--light { color: var(--panel-txt); }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.navlink {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
.navlink:hover, .navlink.is-active { color: var(--accent-ink); }

.site-header__mobile-actions { display: none; align-items: center; gap: 0.6rem; }
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle:hover { border-color: var(--accent); background: var(--canvas-2); }

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--canvas);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.mobile-menu nav { display: grid; gap: 0.25rem; padding-block: 1rem 1.4rem; }
.mobile-menu nav > a:not(.btn) {
  padding: 0.75rem 0.25rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu nav > a.is-active { color: var(--accent-ink); }
.mobile-menu nav > .btn { justify-content: center; margin-top: 0.9rem; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-header__mobile-actions { display: flex; }
}
@media (max-width: 420px) {
  .site-header__mobile-actions .btn { display: none; }
}

/* ---------- Page hero / sections ---------- */
.page-hero { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(2rem, 1rem + 2vw, 3rem); }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-2);
}
.section-header__meta { color: var(--faint); font-size: 0.8rem; text-decoration: none; }
a.section-header__meta:hover { color: var(--accent-ink); }

/* ---------- Post grid / cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (max-width: 1024px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }

.post-card { overflow: hidden; display: flex; }
.post-card__link { display: flex; flex-direction: column; text-decoration: none; color: inherit; width: 100%; }
.post-card__image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--canvas-2); border-bottom: 1px solid var(--line); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur) var(--ease); }
.post-card:hover .post-card__image img { transform: scale(1.03); }
.post-card__image--empty { display: flex; align-items: center; justify-content: center; }
.post-card__image--empty img { width: 40px; height: 40px; opacity: 0.45; }
.post-card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
  transition: color var(--dur-fast) var(--ease);
}
.post-card:hover .post-card__title { color: var(--accent-ink); }
.post-card__excerpt { color: var(--muted); font-size: 0.93rem; margin: 0; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--faint); margin-top: 0.4rem; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; display: inline-block; }

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-block: 3rem 4rem;
}
.pagination > :last-child { justify-self: end; }
.pagination__page { font-size: 0.85rem; color: var(--faint); font-family: var(--font-mono); }

/* ---------- Post ---------- */
.post { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 2rem; }
.breadcrumb { display: flex; gap: 0.6rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 1.2rem; }
.breadcrumb a { text-decoration: none; color: var(--accent-ink); }
.post-header__title {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-size: clamp(2.1rem, 1rem + 3.6vw, 3.6rem);
  margin: 0;
}
.post-header__excerpt { color: var(--muted); font-size: 1.15rem; margin: 1.1rem 0 0; }
.post-header__meta { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-top: 1.4rem; font-size: 0.88rem; color: var(--faint); }
.post-header__meta strong { color: var(--ink); font-weight: 600; }

.post-feature-image { margin: 2.2rem 0 0; }
.post-feature-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.post-feature-image figcaption { font-size: 0.82rem; color: var(--faint); text-align: center; margin-top: 0.7rem; }

.post-content { margin-top: 2.5rem; font-size: 1.08rem; line-height: 1.75; }
.post-content > * + * { margin-top: 1.25em; }
.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}
.post-content h2 { font-size: clamp(1.6rem, 1rem + 1.8vw, 2.2rem); margin-top: 2.4em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.post-content h3 { font-size: clamp(1.3rem, 1rem + 1vw, 1.55rem); margin-top: 1.8em; }
.post-content h4 { font-size: 1.15rem; font-family: var(--font-sans); font-weight: 600; margin-top: 1.6em; }
.post-content p { margin-bottom: 0; }
.post-content a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-content a:hover { color: var(--accent); }
.post-content strong { font-weight: 600; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li + li { margin-top: 0.4em; }
.post-content blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.3em;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.25em;
  line-height: 1.4;
  color: var(--ink);
}
.post-content hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.5em 0; }
.post-content img { border-radius: var(--radius-md); }
.post-content figure { margin: 2em 0; }
.post-content figcaption { font-size: 0.85rem; color: var(--faint); text-align: center; margin-top: 0.6rem; }
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.1em 0.4em;
}
.post-content pre {
  background: var(--panel);
  color: var(--panel-txt);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
.post-content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Tables */
.post-content table, .post-content .kg-table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.5;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.post-content .table-wrap, .post-content .kg-table-card { overflow-x: auto; }
.post-content table { display: block; overflow-x: auto; white-space: normal; }
@media (min-width: 700px) { .post-content table { display: table; } }
.post-content th, .post-content td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-content th { background: var(--canvas-2); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.post-content tr:last-child td { border-bottom: 0; }
.post-content tbody tr:hover td { background: rgba(13, 148, 136, 0.04); }

/* Key takeaways callout */
.post-content aside.key-takeaways,
.post-content .key-takeaways,
.post-content aside {
  background: #fff;
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin: 2em 0;
  font-size: 0.98rem;
}
.post-content aside > :first-child { margin-top: 0; }
.post-content aside > * + * { margin-top: 0.7em; }
.post-content aside h2, .post-content aside h3, .post-content aside h4, .post-content aside p:first-child strong {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 0;
  padding: 0;
  margin-top: 0;
  font-weight: 500;
}
.post-content aside ul { padding-left: 1.2em; }
.post-content aside li::marker { color: var(--accent); }

/* Ghost cards */
.post-content .kg-callout-card { border-radius: var(--radius-md); padding: 1.1rem 1.3rem; display: flex; gap: 0.8rem; }
.post-content .kg-callout-card-grey, .post-content .kg-callout-card-white { background: var(--canvas-2); }
.post-content .kg-callout-card-accent { background: var(--accent-wash); }
.post-content .kg-button-card .kg-btn { background: var(--accent); color: #fff; border-radius: 999px; padding: 0.7rem 1.3rem; text-decoration: none; font-weight: 600; }
.post-content .kg-bookmark-container { display: flex; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; color: inherit; }
.post-content .kg-bookmark-content { padding: 1rem 1.2rem; flex: 1; }
.post-content .kg-bookmark-title { font-weight: 600; }
.post-content .kg-bookmark-description { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.post-content .kg-bookmark-thumbnail img { height: 100%; object-fit: cover; }
.post-content .kg-width-wide { margin-inline: calc(-1 * clamp(0rem, 3vw, 6rem)); }
.post-content .kg-width-full { width: 100vw; margin-inline: calc(50% - 50vw); }
.post-content .kg-width-full img { border-radius: 0; }
.post-content .kg-embed-card iframe { max-width: 100%; }
.post-content .kg-toggle-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem 1.2rem; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-2); }
.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.tag-chip:hover { background: rgba(13, 148, 136, 0.18); }

/* CTA band (dark panel, like site) */
.post-cta { background: var(--panel); color: var(--panel-txt); margin-top: 3.5rem; }
.post-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-block: 3.5rem; }
.post-cta h2 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.018em; font-size: clamp(1.6rem, 1rem + 1.8vw, 2.2rem); line-height: 1.1; margin: 0.5rem 0 0.7rem; }
.post-cta p { color: var(--panel-muted); max-width: 34rem; margin: 0; font-size: 0.98rem; }
.post-cta__actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.related { padding-block: 3.5rem 1rem; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; padding-block: 2.5rem 4rem; }
.post-nav__item {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.1rem 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.post-nav__item:hover { border-color: rgba(13, 148, 136, 0.4); transform: translateY(-2px); }
.post-nav__item--next { text-align: right; grid-column: 2; }
.post-nav__title { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.25; }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { grid-column: auto; text-align: left; }
}

.error-page { padding-block: clamp(5rem, 3rem + 8vw, 9rem); }
.error-page .btn { margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--panel); color: var(--panel-muted); padding-block: 4rem 2.5rem; margin-top: 2rem; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; }
.foot-brand p { margin-top: 1rem; max-width: 260px; font-size: 0.9rem; line-height: 1.6; }
.foot-col h4 { color: var(--panel-txt); font-weight: 600; font-size: 0.85rem; margin: 0 0 0.9rem; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.foot-col a { font-size: 0.88rem; color: var(--panel-muted); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.foot-col a:hover { color: var(--accent-3); }
.foot-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--panel-line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.foot-tagline { color: var(--accent-3); }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

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