/* ============================================================
   UK PRINT AND PUBLISH - BLOG POST
   Long-form editorial layout for /blogs posts. Built on the
   u-* design tokens from ukpp.css (navy + red, Instrument Serif
   display / Plus Jakarta Sans body). Namespaced `u-blog*`.
   ============================================================ */

/* ---------- hero meta (sits inside .u-phero) ---------- */
.u-blog-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin-top: 22px; font-family: var(--f-body);
  font-size: 13px; color: rgba(255, 255, 255, .7);
}
.u-blog-meta span { display: inline-flex; align-items: center; gap: 7px; }
.u-blog-meta i { color: #ff8fa1; font-size: 14px; }
.u-blog-meta .u-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 255, 255, .35); }

/* ---------- featured image ---------- */
.u-blog-figure { margin: 0; }
.u-blog-figure-wrap {
  margin-top: clamp(-64px, -5vw, -40px); position: relative; z-index: 2;
}
.u-blog-figure img {
  width: 100%; height: auto; border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); display: block;
}

/* ---------- article grid ---------- */
.u-blog { padding: clamp(48px, 6vw, 84px) 0 clamp(56px, 6vw, 96px); }
.u-blog-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(40px, 5vw, 72px); align-items: start;
}
@media (max-width: 980px) {
  .u-blog-grid { grid-template-columns: 1fr; gap: 32px; }
  .u-blog-aside { order: -1; }
}

/* ---------- sidebar: TOC + author/CTA cards ---------- */
.u-blog-aside { position: sticky; top: 104px; display: grid; gap: 22px; }
@media (max-width: 980px) { .u-blog-aside { position: static; top: auto; } }

.u-toc {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white); overflow: hidden;
}
.u-toc > summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  font-family: var(--f-body); font-size: 11.5px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.u-toc > summary::-webkit-details-marker { display: none; }
.u-toc > summary::before { content: ""; width: 22px; height: 2px; background: var(--red); flex: none; }
.u-toc > summary .u-toc-chev { transition: transform .2s; color: var(--muted); font-size: 13px; }
.u-toc[open] > summary .u-toc-chev { transform: rotate(180deg); }
.u-toc ol { list-style: none; margin: 0; padding: 4px 12px 16px; counter-reset: toc; }
.u-toc li { margin: 0; counter-increment: toc; }
.u-toc a {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px; align-items: baseline;
  padding: 7px 8px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.4; color: var(--body); transition: background .16s, color .16s;
}
.u-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--red); font-weight: 700; font-size: 11px; }
.u-toc a:hover { background: var(--tint); color: var(--ink); }

.u-blog-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--navy-d); color: rgba(255, 255, 255, .82);
  padding: 24px 22px 26px;
}
.u-blog-card h3 { color: #fff; font-size: 22px; margin: 0 0 8px; }
.u-blog-card p { font-size: 13.5px; line-height: 1.65; margin: 0 0 18px; color: rgba(255, 255, 255, .74); }
.u-blog-card .btn { width: 100%; }

/* ---------- prose ---------- */
.u-prose { max-width: 74ch; color: var(--body); font-size: 17px; line-height: 1.8; }
.u-prose > p { margin: 0 0 1.35em; }
.u-prose > p:first-of-type,
.u-prose .u-lead { font-size: 19px; line-height: 1.72; color: var(--ink); }

.u-prose h2 {
  font-family: var(--f-display); font-weight: 400; color: var(--ink);
  font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.015em;
  margin: 1.9em 0 .5em; padding-top: .5em; scroll-margin-top: 100px;
}
.u-prose h2:first-child { margin-top: 0; }
.u-prose h2 em { color: var(--red); font-style: italic; }
.u-prose h3 {
  font-family: var(--f-display); font-weight: 400; color: var(--ink);
  font-size: clamp(21px, 1.8vw, 27px); line-height: 1.2; letter-spacing: -.01em;
  margin: 1.6em 0 .45em; scroll-margin-top: 100px;
}
.u-prose h3::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--red); vertical-align: middle; margin-right: 12px; transform: translateY(-4px); }

.u-prose a {
  color: var(--navy); font-weight: 600;
  text-decoration: underline; text-decoration-color: rgba(223, 26, 56, .4);
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  transition: color .16s, text-decoration-color .16s;
}
.u-prose a:hover { color: var(--red); text-decoration-color: var(--red); }

.u-prose ul, .u-prose ol { margin: 0 0 1.35em; padding-left: 0; list-style: none; display: grid; gap: 11px; }
.u-prose ul li, .u-prose ol li { position: relative; padding-left: 30px; }
.u-prose ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
}
.u-prose ol { counter-reset: pl; }
.u-prose ol li { counter-increment: pl; }
.u-prose ol li::before {
  content: counter(pl); position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--red-tint);
  color: var(--red-d); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: var(--f-body);
}

.u-prose blockquote {
  margin: 1.6em 0; padding: 20px 24px; border-left: 3px solid var(--red);
  background: var(--tint); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 17px; color: var(--ink);
}
.u-prose blockquote p:last-child { margin-bottom: 0; }

.u-prose table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.u-prose thead th { background: var(--navy-d); color: #fff; font-family: var(--f-body); font-weight: 700; text-align: left; }
.u-prose th, .u-prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.u-prose tbody tr:nth-child(even) { background: var(--tint); }
.u-prose tbody tr:last-child td { border-bottom: 0; }

.u-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.u-prose strong, .u-prose b { color: var(--ink); font-weight: 700; }

.u-prose-tablewrap { overflow-x: auto; margin: 1.6em 0; }
.u-prose-tablewrap table { margin: 0; }

@media (max-width: 560px) {
  .u-prose { font-size: 16px; }
  .u-prose > p:first-of-type, .u-prose .u-lead { font-size: 17.5px; }
}

/* ============================================================
   BLOG INDEX - post cards on blogs.php (3 per row)
   ============================================================ */
.u-bloglist {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px); align-items: stretch;
}

/* vertical post card */
.u-postcard {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white);
  box-shadow: var(--sh-sm); transition: transform .2s var(--ease, ease), box-shadow .2s;
}
.u-postcard:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.u-postcard-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; flex: none; }
.u-postcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease, ease); }
.u-postcard:hover .u-postcard-media img { transform: scale(1.04); }
.u-postcard-cat {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; padding: 6px 11px; border-radius: var(--r);
}
.u-postcard-body { padding: clamp(20px, 2.2vw, 28px); display: flex; flex-direction: column; flex: 1 1 auto; }
.u-postcard-meta {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 12px;
}
.u-postcard-meta .u-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .6; }
.u-postcard-body h2 {
  color: var(--ink); margin: 0 0 10px; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.28;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.u-postcard:hover h2 { color: var(--navy); }
.u-postcard-body p {
  font-size: 14.5px; line-height: 1.7; color: var(--body); margin: 0 0 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.u-postcard-more {
  margin-top: auto; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-body); font-size: 12.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--red);
}
.u-postcard-more .arr { transition: transform .2s; }
.u-postcard:hover .u-postcard-more .arr { transform: translateX(4px); }

@media (max-width: 1024px) {
  .u-bloglist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .u-bloglist { grid-template-columns: 1fr; }
  .u-postcard-media { aspect-ratio: 16 / 9; }
}
