/* ==========================================================================
   Single post: layout, header, "On this page", content typography,
   callouts, tags, author box, previous/next, comments
   ========================================================================== */

/* Main + sidebar */
.single-post #content.site-content,
.fcs-single-wrap {
  display: block;
}
@media (min-width: 1024px) {
  .single-post #content.site-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--fcs-sidebar);
    gap: var(--fcs-space-6);
    align-items: start;
  }
}
@media (max-width: 1023px) {
  .fcs-sidebar { margin-top: var(--fcs-space-7); }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.fcs-article__header { margin-bottom: var(--fcs-space-5); }
.fcs-article__chip { margin-bottom: var(--fcs-space-3); }
.fcs-article__title {
  font-size: var(--fcs-text-4xl);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 0.5em;
  max-width: 22ch;
}
.fcs-article__lede {
  font-size: var(--fcs-text-lg);
  color: var(--fcs-text-2);
  margin: 0 0 var(--fcs-space-4);
  max-width: 60ch;
}
.fcs-article__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--fcs-space-3);
}
.fcs-article__meta { font-size: var(--fcs-text-sm); }
.fcs-article__meta img { width: 32px; height: 32px; }

.fcs-share { display: inline-flex; align-items: center; gap: 0.35rem; }
.fcs-share__label { font-size: var(--fcs-text-xs); color: var(--fcs-text-3); margin-right: 0.25rem; }
.fcs-share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--fcs-border); border-radius: var(--fcs-radius-sm);
  background: var(--fcs-surface); color: var(--fcs-text-2);
  cursor: pointer;
  transition: background var(--fcs-dur) var(--fcs-ease), color var(--fcs-dur) var(--fcs-ease), border-color var(--fcs-dur) var(--fcs-ease);
}
.fcs-share__btn svg { width: 16px; height: 16px; flex: none; }
.fcs-share__btn:hover { background: var(--fcs-accent-soft); color: var(--fcs-accent-text); border-color: transparent; }
.fcs-share__btn.is-copied { background: var(--fcs-success-soft); color: var(--fcs-success); border-color: transparent; }

.fcs-article__hero { margin: 0 0 var(--fcs-space-6); }
.fcs-article__hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--fcs-radius-lg);
  box-shadow: var(--fcs-shadow);
}
.fcs-article__hero figcaption { margin-top: 0.5rem; font-size: var(--fcs-text-xs); color: var(--fcs-text-3); text-align: center; }

/* --------------------------------------------------------------------------
   Body layout: [On this page] [content]
   -------------------------------------------------------------------------- */
.fcs-article__layout { display: block; }
.fcs-article__body { padding: 0; }
.fcs-toc { display: none; }

@media (min-width: 1200px) {
  .fcs-article.has-toc .fcs-article__layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--fcs-space-6);
    align-items: start;
  }
  .fcs-toc {
    display: block;
    position: sticky;
    top: calc(var(--fcs-header-h) + 1.25rem);
    max-height: calc(100vh - var(--fcs-header-h) - 2.5rem);
    overflow-y: auto;
    padding: var(--fcs-space-4);
    border: 1px solid var(--fcs-border);
    border-radius: var(--fcs-radius);
    background: var(--fcs-surface);
    scrollbar-width: thin;
  }
  /* The in-content TOC from the Custom TOC plugin is redundant beside the sticky one */
  .fcs-article.has-toc .entry-content .ctoc { display: none; }
}
.fcs-toc__title { margin: 0 0 0.6rem; font-size: var(--fcs-text-sm); font-weight: 700; }
.fcs-toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.fcs-toc__item { position: relative; }
.fcs-toc__item a {
  display: block;
  padding: 0.3rem 0.5rem 0.3rem 0.6rem;
  border-left: 2px solid transparent;
  color: var(--fcs-text-3);
  font-size: var(--fcs-text-xs);
  line-height: 1.4;
  transition: color var(--fcs-dur) var(--fcs-ease), border-color var(--fcs-dur) var(--fcs-ease), background var(--fcs-dur) var(--fcs-ease);
}
.fcs-toc__item--h2 { counter-increment: toc; }
.fcs-toc__item--h2 a::before { content: counter(toc) ". "; color: var(--fcs-text-3); font-variant-numeric: tabular-nums; }
.fcs-toc__item--h3 a { padding-left: 1.4rem; }
.fcs-toc__item--h4 a { padding-left: 2rem; }
.fcs-toc__item a:hover { color: var(--fcs-text); }
.fcs-toc__item.is-active > a { color: var(--fcs-accent); border-left-color: var(--fcs-accent); background: var(--fcs-accent-soft); border-radius: 0 var(--fcs-radius-sm) var(--fcs-radius-sm) 0; font-weight: 600; }

/* --------------------------------------------------------------------------
   Content typography
   -------------------------------------------------------------------------- */
.entry-content {
  font-size: var(--fcs-text-md);
  line-height: var(--fcs-leading);
  color: var(--fcs-text);
}
.entry-content > * { max-width: 100%; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: var(--fcs-text-2xl); margin: 2em 0 0.7em; padding-top: 0.25em; }
.entry-content h3 { font-size: var(--fcs-text-xl); margin: 1.6em 0 0.6em; }
.entry-content h4 { font-size: var(--fcs-text-lg); margin: 1.4em 0 0.5em; }
.entry-content h2 + h3, .entry-content h3 + h4 { margin-top: 0.75em; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.35em 1.4em; padding: 0; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content li::marker { color: var(--fcs-text-3); }
.entry-content strong { font-weight: 700; }
.entry-content hr { border: 0; border-top: 1px solid var(--fcs-border); margin: 2.5em 0; }

.entry-content figure, .entry-content .wp-block-image { margin: 1.75em 0; }
.entry-content img { border-radius: var(--fcs-radius); }
.entry-content figcaption, .entry-content .wp-element-caption {
  margin-top: 0.6em;
  font-size: var(--fcs-text-sm);
  color: var(--fcs-text-3);
  text-align: center;
}

.entry-content blockquote {
  margin: 1.75em 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--fcs-accent);
  background: var(--fcs-surface);
  border-radius: 0 var(--fcs-radius) var(--fcs-radius) 0;
  font-style: normal;
  color: var(--fcs-text-2);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content table, .entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fcs-text-sm);
  margin: 1.5em 0;
}
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; border: 1px solid var(--fcs-border); text-align: left; vertical-align: top; }
.entry-content th { background: var(--fcs-surface-2); font-weight: 600; }
.entry-content tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--fcs-surface-2) 50%, transparent); }

.entry-content .wp-block-buttons { margin: 1.5em 0; }
.entry-content .wp-block-button__link { border-radius: var(--fcs-radius-sm); }

/* Callouts. Authors can use core Group blocks with these classes, and
   the "Why it matters" / "Try it yourself" boxes from the mockup. */
.entry-content .fcs-callout,
.entry-content .wp-block-group.is-style-fcs-note,
.entry-content .wp-block-group.is-style-fcs-tip,
.entry-content .wp-block-group.is-style-fcs-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  margin: 1.75em 0;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--fcs-accent) 25%, var(--fcs-border));
  border-radius: var(--fcs-radius);
  background: var(--fcs-info-soft);
  font-size: var(--fcs-text-sm);
}
.entry-content .fcs-callout::before,
.entry-content .wp-block-group.is-style-fcs-note::before,
.entry-content .wp-block-group.is-style-fcs-tip::before,
.entry-content .wp-block-group.is-style-fcs-warning::before {
  content: "";
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--fcs-accent-soft) center / 18px no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 8h.01M11 12h1v4h1'/></svg>");
}
.entry-content .wp-block-group.is-style-fcs-tip { background: var(--fcs-success-soft); border-color: color-mix(in srgb, var(--fcs-success) 30%, var(--fcs-border)); }
.entry-content .wp-block-group.is-style-fcs-tip::before { background-color: color-mix(in srgb, var(--fcs-success) 20%, transparent); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 4 14 8-14 8V4Z'/></svg>"); }
.entry-content .wp-block-group.is-style-fcs-warning { background: var(--fcs-warning-soft); border-color: color-mix(in srgb, var(--fcs-warning) 30%, var(--fcs-border)); }
.entry-content .wp-block-group.is-style-fcs-warning::before { background-color: color-mix(in srgb, var(--fcs-warning) 20%, transparent); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392400e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M13 2 3 14h8l-1 8 10-12h-8l1-8Z'/></svg>"); }
.entry-content .fcs-callout > *, .entry-content .wp-block-group[class*="is-style-fcs-"] > .wp-block-group__inner-container { min-width: 0; }
.entry-content .fcs-callout p:last-child, .entry-content .wp-block-group[class*="is-style-fcs-"] p:last-child { margin-bottom: 0; }
.entry-content .fcs-callout strong:first-child { display: block; margin-bottom: 0.2em; color: var(--fcs-text); }

/* Custom TOC plugin box (mobile / tablet) */
.entry-content .ctoc {
  --ctoc-bg: var(--fcs-surface);
  --ctoc-border: var(--fcs-border);
  --ctoc-link: var(--fcs-accent);
  --ctoc-text: var(--fcs-text);
  border-radius: var(--fcs-radius);
  width: 100%;
}

/* Download Manager and Presto blocks keep their own styling; just space them */
.entry-content .wpdm-button-area, .entry-content .presto-player-wrapper { margin: 1.5em 0; }

/* --------------------------------------------------------------------------
   Footer of the article
   -------------------------------------------------------------------------- */
.fcs-article__footer {
  margin-top: var(--fcs-space-6);
  padding-top: var(--fcs-space-5);
  border-top: 1px solid var(--fcs-border);
  display: flex;
  flex-direction: column;
  gap: var(--fcs-space-4);
}
.fcs-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fcs-chip--tag { background: var(--fcs-surface-2); color: var(--fcs-text-2); }
a.fcs-chip--tag:hover { background: var(--fcs-accent-soft); color: var(--fcs-accent-text); }
.fcs-article__share-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fcs-space-3);
  font-size: var(--fcs-text-sm); color: var(--fcs-text-2); font-weight: 500;
}

.fcs-author {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--fcs-space-4);
  align-items: center;
  margin-top: var(--fcs-space-6);
  padding: var(--fcs-space-5);
  background: var(--fcs-surface);
  border: 1px solid var(--fcs-border);
  border-radius: var(--fcs-radius-lg);
}
.fcs-author__avatar { width: 72px; height: 72px; border-radius: 50%; }
.fcs-author__eyebrow { margin: 0; font-size: var(--fcs-text-xs); color: var(--fcs-text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.fcs-author__name { font-size: var(--fcs-text-lg); margin: 0.1em 0 0.3em; }
.fcs-author__name a { color: var(--fcs-text); }
.fcs-author__bio { margin: 0; color: var(--fcs-text-2); font-size: var(--fcs-text-sm); }
@media (max-width: 480px) { .fcs-author { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

.fcs-postnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--fcs-space-4);
  margin-top: var(--fcs-space-6);
}
@media (max-width: 640px) { .fcs-postnav { grid-template-columns: 1fr; } }
.fcs-postnav__link {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: var(--fcs-space-4);
  border: 1px solid var(--fcs-border); border-radius: var(--fcs-radius);
  background: var(--fcs-surface);
  color: var(--fcs-text);
  transition: border-color var(--fcs-dur) var(--fcs-ease), box-shadow var(--fcs-dur) var(--fcs-ease);
}
.fcs-postnav__link:hover { border-color: var(--fcs-accent); box-shadow: var(--fcs-shadow); color: var(--fcs-text); }
.fcs-postnav__link--next { text-align: right; align-items: flex-end; }
.fcs-postnav__label { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--fcs-text-xs); color: var(--fcs-text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.fcs-postnav__title { font-size: var(--fcs-text-sm); font-weight: 600; line-height: 1.4; }

/* --------------------------------------------------------------------------
   Comments (GP markup)
   -------------------------------------------------------------------------- */
.comments-area { margin-top: var(--fcs-space-7); }
.comments-title, .comment-reply-title { font-size: var(--fcs-text-xl); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment-body {
  padding: var(--fcs-space-4);
  background: var(--fcs-surface);
  border: 1px solid var(--fcs-border);
  border-radius: var(--fcs-radius);
  margin-bottom: var(--fcs-space-4);
}
.comment-list .children { list-style: none; margin-left: var(--fcs-space-5); }
.comment-author .avatar { border-radius: 50%; }
.comment-meta { font-size: var(--fcs-text-xs); color: var(--fcs-text-3); }
.comment-content { font-size: var(--fcs-text-sm); }
.comment-respond { margin-top: var(--fcs-space-5); }
.comment-form label { font-size: var(--fcs-text-sm); font-weight: 600; }
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: center; }
.comment-form-cookies-consent label { font-weight: 400; }

/* A wider canvas on posts so the reading column stays comfortable next to
   the "On this page" rail and the sidebar. */
@media (min-width: 1200px) {
  body.single-post #page.grid-container { max-width: 1320px; }
  body.single-post .site-header .inside-header,
  body.single-post .fcs-footer,
  body.single-post .site-footer .inside-site-info { max-width: 1320px; }
}
