/* ==========================================================================
   Article body: the StreamField blocks (callouts, figures, quotes, text) laid
   out in .article-grid, plus the colour tokens they use. Shared by the blog's
   Wagtail pages and the website's news, events and research pages, which drop
   in the same HTML (body_html from /api/site/articles/). Change the look of a
   block here and both sites follow.
   ========================================================================== */

:root {
  /* Noto Sans Bengali supplies only ০-৯ (includes/bengali-digits-font.html). */
  --blog-font: "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --blog-primary: #0f5b5b;
  --blog-primary-dark: #0b4646;
  --blog-mint: #e4f1f1;
  --blog-paper: #f7f6f2;
  --blog-text: #1f2328;
  --blog-body: #454b52;
  --blog-muted: #7b8289;
  --blog-line: #e4e7ea;
  --blog-radius: 12px;

  /* Named colours used by accents and bullet dots. */
  --colour-red: #c2413a;
  --colour-amber: #d57a1c;
  --colour-blue: #2f6fd6;
  --colour-green: #2e7a52;
  --colour-purple: #7a4cb5;
  --colour-teal: #0f5b5b;
  --colour-coral: #e8603c;
}

/* One rule per ACCENT_CHOICES value in blog/blocks.py (callouts + category pills). */
[data-accent="red"]    { --accent: var(--colour-red);    --accent-bg: #fdeeed; --accent-border: #f5d2cf; }
[data-accent="amber"]  { --accent: var(--colour-amber);  --accent-bg: #fdf3e6; --accent-border: #f3dcbd; }
[data-accent="blue"]   { --accent: var(--colour-blue);   --accent-bg: #eaf1fd; --accent-border: #cddcf7; }
[data-accent="green"]  { --accent: var(--colour-green);  --accent-bg: #e9f3ed; --accent-border: #cfe3d7; }
[data-accent="purple"] { --accent: var(--colour-purple); --accent-bg: #f3edf9; --accent-border: #e0d2f0; }

/* One rule per BULLET_COLOUR_CHOICES value in blog/blocks.py. */
[data-bullet="red"]    { --bullet: var(--colour-red); }
[data-bullet="amber"]  { --bullet: var(--colour-amber); }
[data-bullet="blue"]   { --bullet: var(--colour-blue); }
[data-bullet="green"]  { --bullet: var(--colour-green); }
[data-bullet="purple"] { --bullet: var(--colour-purple); }
[data-bullet="teal"]   { --bullet: var(--colour-teal); }
[data-bullet="coral"]  { --bullet: var(--colour-coral); }
[data-bullet="accent"] { --bullet: var(--accent); }

.sk-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* ---- Article body grid ---- */

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  overflow-wrap: anywhere;
}

.article-grid__item {
  min-width: 0;
}

.article-grid__item .block-paragraph_block p,
.article-grid__item p {
  color: var(--blog-body);
  line-height: 1.7;
}

.article-grid__item a {
  color: var(--blog-primary);
  text-decoration: underline;
}

/* Lists in text blocks. The website's Tailwind reset takes list markers and
   indents off; put them back. */
.block-paragraph_block ul,
.block-paragraph_block ol {
  margin-bottom: 1em;
  padding-left: 1.2rem;
  color: var(--blog-body);
  line-height: 1.7;
}

.block-paragraph_block ul {
  list-style: disc;
}

.block-paragraph_block ol {
  list-style: decimal;
}

.article-grid h2,
.article-grid h3,
.article-grid h4 {
  font-weight: 700;
  color: var(--blog-text);
}

.article-grid .block-embed_block iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--blog-radius);
}

@media (min-width: 768px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .article-grid__item--full {
    grid-column: 1 / -1;
  }
}

/* ---- Callout block ---- */

.blog-callout {
  height: 100%;
}

/* Beats .article-grid h2, so the title keeps its accent colour. */
.blog-callout .blog-callout__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.3;
}

.blog-callout__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  /* The glyph is currentColor; set it here rather than inherit the title's. */
  color: var(--accent);
}

.blog-callout__content {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--blog-body);
}

.blog-callout__content p:last-child,
.blog-callout__content ul:last-child,
.blog-callout__content ol:last-child {
  margin-bottom: 0;
}

.blog-callout__content ul,
.blog-callout__content ol {
  padding-left: 1.2rem;
}

/* The website's Tailwind reset takes list markers off; put them back. */
.blog-callout__content ul {
  list-style: disc;
}

.blog-callout__content ol {
  list-style: decimal;
}

.blog-callout__content li {
  margin-bottom: 8px;
  padding-left: 2px;
}

.blog-callout__content li::marker {
  color: var(--bullet, var(--colour-teal));
}

/* ---- Grid image block ---- */

/*
 * Figures are shown whole (never cropped): they scale to the available
 * width, and only very tall images are capped in height, with the spare
 * space filled by the frame's background instead of cutting the picture.
 */
.blog-figure {
  margin: 0;
}

.blog-figure picture {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--blog-radius);
  background: var(--blog-mint);
}

.blog-figure__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

.blog-figure__caption {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--blog-muted);
}

/* ---- Quote block ---- */

.article-grid .blockquote {
  height: 100%;
  margin: 0;
  padding: 24px 28px;
  border: 0;
  border-left: 4px solid var(--blog-primary);
  border-radius: var(--blog-radius);
  background: var(--blog-mint);
  color: var(--blog-primary-dark);
}

.article-grid .blockquote .text {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
  color: inherit;
}

.article-grid .blockquote .attribute-name {
  margin: 0;
  font-size: 0.85rem;
  color: var(--blog-muted);
}

.article-grid .blockquote .attribute-name:not(:empty)::before {
  content: "– ";
}

.article-grid .blockquote--text-large .text {
  font-size: 1.5rem;
}
