/* Blog pages only (body.blog), written by `pnpm blog:build`: the home's look
   (home.css) for the guides. Legal pages and /richiedi keep styles.css alone.
   Spec: docs/superpowers/specs/2026-11-13-blog-community-md-images-design.md */

body.blog {
  --surface: #FBF9F4;
  --card: #FFFFFF;
  --line: rgba(22, 35, 61, 0.1);
  --muted: rgba(22, 35, 61, 0.78);
  /* Amber for text on navy: 7:1 on --ink. On light surfaces text uses --amber-ink. */
  --amber-on-ink: #E3A44E;
  --article-w: 64rem;
  background-color: var(--surface);
  background-image: none;
}

/* Header and footer line up with the home's 74rem. */
body.blog main .container,
body.blog .site-header .container,
body.blog .site-footer .container { max-width: 74rem; }

.blog-kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin-bottom: 0.9rem;
}

/* ---------- Article ---------- */
.article { padding-block: 2rem clamp(3.5rem, 8vw, 5.5rem); }

.article__crumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.article__crumbs a { color: var(--ink); text-underline-offset: 3px; }

.article__head { max-width: 50rem; }

.article h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin-bottom: 1.5rem;
}

.article__summary {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

.article__summary::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 1.5rem;
  width: 2.5rem;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--amber);
}

.article__summary h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin-bottom: 0.4rem;
}

.article__summary p { font-size: 1.075rem; line-height: 1.65; }

.article__byline {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.article__cover {
  max-width: 50rem;
  margin-block: 2.25rem 0;
}

.article__cover img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: var(--card);
}

.article__layout {
  max-width: var(--article-w);
  margin-top: 2.5rem;
}

.article__toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 2.5rem;
}

.article__toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.article__toc ol { padding-left: 1.2rem; }
.article__toc li { font-size: 0.95rem; line-height: 1.45; }
.article__toc li + li { margin-top: 0.45rem; }
.article__toc a { color: var(--ink); text-decoration: none; }
.article__toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

.article__main { max-width: 46rem; min-width: 0; }

.article__body h2,
.article__faq h2,
.article__sources h2,
.article__related h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  letter-spacing: -0.015em;
  margin-block: 2.75rem 0.9rem;
  scroll-margin-top: 5.5rem;
}

.article__body > h2:first-child { margin-top: 0; }

.article__body h3 { font-size: 1.15rem; margin-block: 1.75rem 0.5rem; }

.article__body p,
.article__body ul,
.article__body ol,
.article__body table,
.article__body blockquote { margin-bottom: 1.1rem; }

.article__body p,
.article__body li { line-height: 1.7; }

.article__body ul,
.article__body ol { padding-left: 1.25rem; }

.article__body li + li { margin-top: 0.4rem; }

.article__body a,
.article__sources a,
.article__related a {
  color: var(--ink);
  text-decoration-color: rgba(209, 138, 43, 0.75);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.article__body blockquote {
  border-left: 3px solid var(--amber);
  padding-left: 1rem;
  color: var(--muted);
}

.article__body code { font-family: var(--font-mono); font-size: 0.9em; }

/* Deadlines and costs: wide tables scroll inside the column, not the page. */
.article__body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
}

.article__body th,
.article__body td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.article__body tr:last-child td { border-bottom: 0; }

.article__body thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.article__figure { margin-block: 2rem; }

/* Diagrams are drawn 560px wide (rendered at 2×): never shown larger, so their text keeps its size. */
.article__figure img {
  width: auto;
  max-width: min(100%, 35rem);
  height: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.article__figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--muted);
}

body.blog .faq { max-width: none; }

.article__sources ol { padding-left: 1.25rem; }
.article__sources li + li { margin-top: 0.45rem; }

.article__checked { font-size: 0.8125rem; color: var(--muted); }

.article__related ul { padding-left: 1.25rem; }
.article__related li + li { margin-top: 0.4rem; }

.article__disclaimer {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* The home's closing band. */
.article__cta {
  max-width: var(--article-w);
  margin-top: clamp(3rem, 7vw, 4.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  background: var(--ink);
  border-radius: 20px;
  padding: clamp(1.75rem, 4.5vw, 3rem);
}

.article__cta h2 {
  color: #FFFFFF;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  letter-spacing: -0.015em;
  max-width: 20em;
}

.article__cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.article__cta .btn {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.article__cta .btn:hover { background: #E09A3C; border-color: #E09A3C; }

.article__community {
  color: var(--amber-on-ink);
  font-weight: 600;
  text-underline-offset: 4px;
}

.article__cta :focus-visible { outline-color: var(--amber); }

/* Draft pages (/blog/bozze/): impossible to mistake for a published page. */
.draft-banner {
  border: 2px dashed var(--amber-ink);
  border-radius: 10px;
  background: var(--card);
  color: var(--amber-ink);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Index ---------- */
.blog-index { padding-block: 3rem clamp(3.5rem, 8vw, 5.5rem); }

.blog-index h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.blog-index__intro {
  max-width: 42em;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.blog-index__list {
  display: grid;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
  border-color: rgba(22, 35, 61, 0.3);
  box-shadow: 0 22px 44px -28px rgba(22, 35, 61, 0.45);
}

.blog-card__img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.blog-card__text { padding: 1.2rem 1.4rem 1.5rem; }

.blog-card__meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin-bottom: 0.5rem;
}

.blog-card h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.blog-card h2 a { color: var(--ink); text-decoration: none; }

/* The whole card opens the guide. */
.blog-card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.blog-card p:last-child { font-size: 0.975rem; color: var(--muted); }

/* ---------- Wider screens ---------- */
@media (min-width: 760px) {
  .blog-index__list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .blog-index__list { grid-template-columns: repeat(3, 1fr); }

  .article__layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 46rem);
    gap: 3.5rem;
    align-items: start;
  }

  .article__toc {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    margin-bottom: 0;
  }
}
