/* =========================================================================
   H3 Consulting Partners Blog
   Static recreation of the WordPress.com "Retrospect" theme the blog used:
   Figtree type, a sticky left sidebar, and a bordered content column.
   Shared by every page in /blog. Post markup is documented in blog/README.md.
   ========================================================================= */

:root {
  /* Colors (Retrospect palette) */
  --c-bg: #ffffff;
  --c-border: #dddddd;
  --c-muted: #7b7b7b;
  --c-text: #333333;

  /* Spacing scale: 22px steps that shrink with the viewport */
  --space-20: min(22px, 2.2vw);
  --space-30: min(44px, 4.4vw);
  --space-40: min(66px, 6.6vw);
  --space-50: min(88px, 8.8vw);

  /* Type scale */
  --fs-x-small: 14px;
  --fs-small: clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.196), 16px);
  --fs-normal: 16px;
  --fs-medium: 26px;
  --fs-large: clamp(22.041px, 1.378rem + ((1vw - 3.2px) * 1.369), 36px);
  --fs-x-large: clamp(33.419px, 2.089rem + ((1vw - 3.2px) * 2.606), 60px);

  --content-size: 720px;
  --wide-size: 1340px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-small);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: currentColor;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--c-text);
  color: var(--c-bg);
  font-size: var(--fs-x-small);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* ---------- Page layout ---------- */

.site {
  padding: 0 var(--space-40);
}

.layout {
  display: flex;
  gap: var(--space-40);
  max-width: var(--wide-size);
  margin: 0 auto;
}

.sidebar {
  flex: 0 0 20%;
  min-width: 0;
}

.sidebar-inner {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: var(--space-40) 0;
  scrollbar-width: thin;
}

.main-col {
  flex: 1 1 auto;
  min-width: 0;
}

.card {
  border: 1px solid var(--c-border);
  border-top: 0;
  padding: var(--space-40) var(--space-30) var(--space-50);
}

.card > * {
  max-width: var(--content-size);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Sidebar ---------- */

.site-logo {
  display: block;
  max-width: 260px;
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.site-tagline {
  margin: 8px 0 0;
  color: var(--c-muted);
  font-size: var(--fs-x-small);
}

.site-nav {
  margin-top: var(--space-40);
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 4px;
}

.site-nav a {
  font-size: var(--fs-x-small);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
}

.sidebar-recent,
.sidebar-about {
  margin-top: var(--space-30);
}

.sidebar-heading {
  margin: 0;
  color: var(--c-muted);
  font-size: var(--fs-x-small);
  font-weight: 300;
  line-height: 1.2;
}

.recent-posts {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-x-small);
}

.recent-posts li + li {
  margin-top: var(--space-20);
}

.sidebar-about p {
  margin: 0;
}

.sidebar-about p + p {
  margin-top: var(--space-30);
}

/* ---------- Post header ---------- */

.post-title {
  margin: 0;
  font-size: var(--fs-large);
  font-weight: 700;
  line-height: 1.2;
}

.post-title a {
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-date {
  margin-top: 8px;
  color: var(--c-muted);
  font-size: var(--fs-x-small);
}

/* ---------- Post content ---------- */

.entry-content {
  margin-top: var(--space-20);
  font-size: var(--fs-normal);
  overflow-wrap: break-word;
}

.entry-content > * {
  margin-top: 0;
  margin-bottom: 0;
}

.entry-content > * + * {
  margin-top: var(--space-20);
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-weight: 700;
}

.entry-content h2 {
  font-size: var(--fs-x-large);
  line-height: 1;
}

.entry-content h3 {
  font-size: var(--fs-medium);
  line-height: 1.2;
}

.entry-content h4 {
  font-size: 22px;
  line-height: 1.3;
}

.entry-content h5 {
  font-size: var(--fs-medium);
  line-height: 1.4;
}

.entry-content h6 {
  font-size: var(--fs-small);
}

.entry-content ul,
.entry-content ol {
  padding-left: 40px;
}

.entry-content li > ul,
.entry-content li > ol {
  margin-top: 0;
}

.entry-content hr {
  height: 0;
  border: 0;
  border-top: 2px solid var(--c-text);
}

.entry-content blockquote {
  margin-left: 0;
  margin-right: 0;
}

.entry-content blockquote > * {
  margin: 0;
}

.entry-content blockquote > * + * {
  margin-top: var(--space-20);
}

.entry-content .has-medium-font-size {
  font-size: var(--fs-medium);
  line-height: 1.4;
}

.entry-content img {
  display: block;
}

.entry-content figure {
  margin-left: 0;
  margin-right: 0;
}

.entry-content figcaption {
  margin-top: 8px;
  color: var(--c-muted);
  font-size: var(--fs-x-small);
}

.entry-content pre,
.entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.entry-content pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--c-border);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 8px;
  border: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}

/* ---------- Post footer ---------- */

.post-footer {
  margin-top: var(--space-30);
}

.post-terms {
  margin: 0 0 var(--space-30);
  color: var(--c-muted);
  font-size: var(--fs-x-small);
}

.share-title {
  display: inline-block;
  margin: 0 0 10px;
  padding-top: 6px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  font-weight: 700;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.share-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  color: #2c3338;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
}

.share-links a:hover {
  border-color: #2c3338;
}

.share-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.post-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-20);
  margin-top: var(--space-50);
  font-size: var(--fs-x-small);
}

.post-navigation .nav-next {
  margin-left: auto;
  text-align: right;
}

/* ---------- Blog index ---------- */

.post-list {
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.post-summary + .post-summary {
  margin-top: var(--space-50);
}

.post-summary .post-excerpt {
  margin: var(--space-20) 0 0;
  font-size: var(--fs-normal);
}

.post-summary .read-more {
  margin: 10px 0 0;
  font-size: var(--fs-x-small);
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: var(--space-30) 0;
  color: var(--c-muted);
  font-size: var(--fs-x-small);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--c-muted);
}

/* ---------- Small screens: stack the columns ---------- */

@media (max-width: 781px) {
  .layout {
    flex-direction: column;
    gap: 0;
  }

  /* Let the sidebar's sections join the column flow so the post comes right
     after the logo and navigation, with recent posts and About below it. */
  .sidebar,
  .sidebar-inner,
  .main-col {
    display: contents;
  }

  .site-header {
    order: 1;
    padding-top: var(--space-40);
  }

  .site-nav {
    order: 2;
    margin-top: var(--space-20);
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
  }

  .site-nav li + li {
    margin-top: 0;
  }

  .card {
    order: 3;
    margin-top: var(--space-30);
    padding-top: var(--space-30);
    padding-bottom: var(--space-40);
  }

  .sidebar-recent {
    order: 4;
    margin-top: var(--space-40);
  }

  .sidebar-about {
    order: 5;
  }

  .site-footer {
    order: 6;
    margin-top: var(--space-30);
    border-top: 1px solid var(--c-border);
  }

  .site-logo {
    max-width: 340px;
  }

  .entry-content ul,
  .entry-content ol {
    padding-left: 28px;
  }
}

@media print {
  .sidebar,
  .share,
  .post-navigation,
  .skip-link {
    display: none !important;
  }

  .site {
    padding: 0;
  }

  .card {
    border: 0;
    padding: 0;
  }
}
