/* /blog section styles — content lives inside the exported Squarespace shell
   as `#sections .blogx` (see src/layouts/BaseLayout.astro). Scoped + a few
   !importants so custom.css's site-wide skin doesn't fight the article
   typography. Forced opacity: site-wide fade-ins only reveal native
   Squarespace blocks (same recipe as the desktop/agent/enterprise pages). */

#sections .blogx,
#sections .blogx * { opacity: 1 !important; }

#sections .blogx {
  --ink: #1c1a17;
  --paper: #eef1f4;
  --surface: #fbfcfd;
  --line: #e2e0da;
  --g700: #3d3a35;
  --g500: #5c5852;
  font-family: "Open Sans", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--ink);
}
#sections .blogx a { color: inherit; }

/* hard cap: no image, iframe, or video in blog content may exceed its column
   (Medium-export images are 1600px+; !important beats Squarespace img rules) */
#sections .blogx img,
#sections .blogx iframe,
#sections .blogx video {
  max-width: 100% !important;
}
#sections .blogx img { height: auto; }

/* the shell's section CSS constrains/left-aligns inner wrappers — undo it */
#sections .blogx > .blogx-wrap {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
#sections .blogx main {
  max-width: 720px !important;
  margin: 0 auto !important;
  padding: 48px 24px 80px !important;
}
#sections .blogx main.wide { max-width: 1120px !important; }

/* ---- blog index ---- */
#sections .blogx .index-head { margin: 0 0 40px; }
#sections .blogx .index-head h1 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  font-size: clamp(34px, 6vw, 52px) !important;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 10px;
}
#sections .blogx .index-head p { color: var(--g500); font-size: 18px; margin: 0; max-width: 60ch; }

#sections .blogx .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 26px;
}
@media (max-width: 900px) { #sections .blogx .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { #sections .blogx .grid { grid-template-columns: 1fr; } }

#sections .blogx .card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#sections .blogx .card:hover { transform: translateY(-3px); }
#sections .blogx .thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
#sections .blogx .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#sections .blogx .card .body { padding: 14px 2px 0; }
#sections .blogx .card h2 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 19px !important;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
#sections .blogx .card:hover h2 { text-decoration: underline; text-underline-offset: 2px; }
#sections .blogx .card .meta { color: var(--g500); font-size: 14px; margin: 0; }

/* ---- post page ---- */
#sections .blogx .crumb { font-size: 14px; margin: 0 0 24px; }
#sections .blogx .crumb a { color: var(--g500); text-decoration: none; }
#sections .blogx .crumb a:hover { color: var(--ink); }

#sections .blogx article h1 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1.12;
  font-size: clamp(30px, 5vw, 44px) !important;
  color: var(--ink);
  margin: 0 0 14px;
}
#sections .blogx article > .meta {
  color: var(--g500);
  font-size: 15px;
  margin: 0 0 28px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#sections .blogx img.hero {
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 0 0 32px;
  display: block;
}

/* prose typography */
#sections .blogx .prose { font-size: 18px; line-height: 1.72; color: #23201c; }
#sections .blogx .prose > :first-child { margin-top: 0; }
#sections .blogx .prose p { margin: 0 0 1.25em; font-size: inherit; }
#sections .blogx .prose h2 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  font-size: 1.55em !important;
  line-height: 1.2;
  color: var(--ink);
  margin: 1.9em 0 0.5em;
}
#sections .blogx .prose h3 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.28em !important;
  line-height: 1.25;
  color: var(--ink);
  margin: 1.6em 0 0.5em;
}
#sections .blogx .prose h4 {
  font-family: "Open Sans", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.1em !important;
  color: var(--ink);
  margin: 1.4em 0 0.4em;
}
#sections .blogx .prose a {
  color: #1c1a17;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #b9b4ab;
}
#sections .blogx .prose a:hover { text-decoration-color: #1c1a17; }
#sections .blogx .prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 1.5em auto 0.4em;
}
/* italic caption line that Medium places right under an image */
#sections .blogx .prose img + em,
#sections .blogx .prose p > img + em {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--g500);
  margin: 0 auto 1.5em;
}
#sections .blogx .prose em { color: inherit; }
#sections .blogx .prose ul,
#sections .blogx .prose ol { margin: 0 0 1.25em; padding-left: 1.4em; }
#sections .blogx .prose li { margin: 0.35em 0; font-size: inherit; }
#sections .blogx .prose blockquote {
  margin: 1.5em 0;
  padding: 0.4em 0 0.4em 1.1em;
  border-left: 3px solid var(--line);
  color: var(--g700);
  font-style: italic;
}
#sections .blogx .prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
#sections .blogx .prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #eceae4;
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
#sections .blogx .prose pre {
  background: #1c1a17;
  color: #eef1f4;
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 1.6em 0;
}
#sections .blogx .prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
#sections .blogx .prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
#sections .blogx .prose th,
#sections .blogx .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
#sections .blogx .prose .video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.6em 0;
  background: #000;
}
#sections .blogx .prose .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#sections .blogx .tags { margin: 44px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
#sections .blogx .tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--g700);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
