/* ===== Blog index ===== */

.blog-title { margin-bottom: .75rem; }

/* Pagination */
.blog-pager { text-align: center; margin-top: 1.25rem; }
.blog-pagination { display: inline-block; }
.blog-pagination .page-number{
  color: var(--fg);
  display: inline-block;
  padding: .35em 1.05em;
  margin: 0 .25em;
  text-decoration: none;
  border-radius: 1em;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  transition: background-color .15s, color .15s, border-color .15s;
}
.blog-pagination .page-number:hover{ background: rgba(255,255,255,.06); }
.blog-hidden{ display: none; }

/* ===== Grid ===== */
.post-grid{
  --card-min: 320px;
  --gap: 1rem;

  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: var(--gap);
}

/* Bullet killers */
.post-grid > li { list-style: none; }
.post-grid *::marker { content: ''; }

/* ===== Card ===== */
.post-card{ display: block; }

.excerpt{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius, 16px);
  background: var(--surface, rgba(255,255,255,.04));
  box-shadow: var(--shadow-card, 0 10px 30px rgba(0,0,0,.25));
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  height: 100%; /* ← cards equal height in same row */
}
.excerpt:hover{
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--brand-strong, #3b82f6) 35%, var(--border));
  background: var(--surface-solid, rgba(255,255,255,.05));
}

/* ── Thumbnail ──────────────────────────────────────────────── */
/* .post-thumb is an <a> tag in HTML */
a.post-thumb,
.post-card .post-thumb,
.excerpt .post-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-muted);
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
}

/* base.css sets  img { height: auto }  which breaks our 100% height.
   We beat it with a slightly more specific selector — no !important needed. */
a.post-thumb img,
.post-card .post-thumb img,
.excerpt .post-thumb img {
  width: 100%;
  height: 100%;           /* overrides base.css "height: auto" */
  object-fit: cover;    /* KEY FIX: logos won't get cropped   */
  object-position: center;
  display: block;
  padding: 0;        /* breathing room around logos        */
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.post-thumb.contain img {
  object-fit: contain;
  padding: .75rem;
}

/* ── Body ───────────────────────────────────────────────────── */
.excerpt_body{
  padding: 1rem 1rem 1.05rem;
  display: grid;
  gap: .6rem;
  flex: 1;                        /* pushes actions to bottom of card */
}

/* Title */
.post_link{ margin: 0; line-height: 1.25; }
.post_link a{
  color: var(--fg);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post_link a:hover{ color: var(--brand); }

/* Meta row */
.post_meta{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  align-items: center;
  font-size: .9rem;
  color: var(--muted, #a7b0c0);
}
.post_meta .icon{
  width: 16px; height: 16px; opacity: .85; vertical-align: -2px; margin-right: .25rem;
}
.meta_item{ display: inline-flex; align-items: center; }

/* Tags */
.post_tags{ display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.post_tag{
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: .5rem;
  border: 1px solid var(--border, rgba(255,255,255,.16));
  color: var(--fg);
  text-decoration: none;
}
.post_tag:hover{
  background: var(--surface-muted, rgba(255,255,255,.08));
  border-color: var(--border-strong, rgba(255,255,255,.22));
}

/* Description */
.post_desc{
  margin: 0;
  color: var(--fg);
  opacity: .92;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions row */
.excerpt_actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .25rem;
}
.excerpt_more.button{ padding: .4rem .7rem; }

/* Share icons */
.post_share{
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .85rem; color: var(--muted, #a7b0c0);
}
.post_share .icon{ width: 18px; height: 18px; opacity: .9; }
.post_share a{
  display: inline-flex; align-items: center;
  padding: .25rem; border-radius: .4rem;
}
.post_share a:hover{ background: rgba(255,255,255,.08); }
.post_share .share_label{ margin-right: .25rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px){
  .post-grid{ --card-min: 280px; }
}

@media (max-width: 640px){
  .post-grid{ --card-min: 100%; --gap: .85rem; }
  .excerpt_body{ padding: .9rem; }

  /* On mobile: slightly taller thumb so portrait logos don't look tiny */
  .post-thumb{ aspect-ratio: 4 / 3; }
}

@media (max-width: 400px){
  .post-grid{ --card-min: 100%; --gap: .6rem; }
  .post_meta{ font-size: .8rem; }
}

/* ===== Blog post page ===== */
.blog-article--feature{
  width: min(1120px, 100%);
  margin: 0 auto;
  --blog-accent: var(--brand-strong, #087fa8);
  --blog-accent-rgb: 8, 127, 168;
}

.blog-hero{
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: clamp(1.1rem, 3vw, 2rem);
  align-items: stretch;
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
  padding: clamp(1.1rem, 3vw, 1.45rem);
  border: 1px solid var(--border);
  border-radius: clamp(1.35rem, 4vw, 2.2rem);
  background:
    radial-gradient(circle at 14% 10%, rgba(255,170,0,.18), transparent 18rem),
    radial-gradient(circle at 92% 20%, rgba(var(--blog-accent-rgb), .18), transparent 22rem),
    linear-gradient(135deg, var(--surface), var(--surface-muted));
  box-shadow: var(--shadow-soft);
}

.blog-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 16% 22%, rgba(var(--blog-accent-rgb), .28) 0 2px, transparent 2.8px),
    radial-gradient(circle at 28% 70%, rgba(255,170,0,.28) 0 1.8px, transparent 2.6px),
    radial-gradient(circle at 78% 18%, rgba(var(--blog-accent-rgb), .20) 0 2px, transparent 2.8px);
  opacity: .7;
}

.blog-hero > *{
  position: relative;
  z-index: 1;
}

.blog-hero__content{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.blog-hero__kicker{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .8rem;
  color: var(--blog-accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.blog-hero__kicker::before{
  content: "";
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: var(--blog-accent);
  box-shadow: 0 0 0 6px rgba(var(--blog-accent-rgb), .16);
}

.blog-hero h1{
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.25rem);
  line-height: 1;
}

.blog-hero .post_meta{
  margin: 1rem 0 0;
}

.blog-hero .post_tags{
  margin-top: 1rem;
}

/* .blog-hero__media is a <figure> tag — reset browser defaults */
.blog-hero__media{
  display: block;
  overflow: hidden;
  margin: 0;                      /* browser adds margin to <figure> by default */
  padding: 0;
  border-radius: 1.45rem;
  background: var(--surface-muted);
  align-self: stretch;
  min-height: 260px;
}

.blog-hero__media img{
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  margin: 0;
  object-fit: contain;
  object-position: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* Real photo? Add class="cover" on the <figure> */
.blog-hero__media.cover img{
  object-fit: cover;
  padding: 0;
}

.blog-article__shell{
  display: grid;
  grid-template-columns: 76px minmax(0, 820px);
  gap: clamp(1rem, 3vw, 1.5rem);
  justify-content: center;
  align-items: start;
}

.blog-share-panel{
  position: sticky;
  top: 5.8rem;
  display: grid;
  gap: .45rem;
  justify-items: center;
  padding: .75rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.blog-share-panel span{
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.blog-share-panel a{
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--brand-strong);
}

.blog-share-panel a:hover{
  background: var(--surface-muted);
}

.blog-share-panel .icon{
  width: 1rem;
  height: 1rem;
}

.blog-article .post-title {
  margin: 0 0 .25rem 0;
}

.blog-article .post_meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  color: var(--muted-fg, rgba(255,255,255,.75));
  margin-bottom: 1rem;
}

.blog-article .post_meta .icon,
.blog-article .post_share .icon,
.posts .icon,
.blog-card .icon {
  width: 1.05rem;
  height: 1.05rem;
  vertical-align: -.15em;
  flex: 0 0 auto;
  opacity: .9;
}

.blog-article .meta_item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .95rem;
}

.blog-article .post_share {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.blog-article .post_share .share_label {
  margin-right: .25rem;
  font-size: .92rem;
  opacity: .9;
}

.blog-article .post_share a {
  color: var(--muted-fg, rgba(255,255,255,.75));
}
.blog-article .post_share a:hover { color: var(--brand); }

.blog-article .post_tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.blog-article .excerpt_thumbnail figure { margin: 0; }

.blog-article .post_body svg.icon { width: 1em; height: 1em; }

.blog-article .post_body img {
  max-width: 100%;
  height: auto;
  display: block;
}
.blog-article .post_body img:not([width]):not([height]) {
  min-height: 1px;
}

/* ── Responsive: blog post page ─────────────────────────────── */
@media (max-width: 900px){
  .blog-hero{
    grid-template-columns: 1fr;
  }

  .blog-hero__media{
    min-height: 220px;
    aspect-ratio: 16 / 9;
  }

  .blog-article__shell{
    grid-template-columns: 1fr;
  }

  .blog-share-panel{
    position: static;
    display: flex;
    justify-content: flex-start;
    width: fit-content;
    border-radius: 999px;
  }

  .blog-share-panel span{
    writing-mode: initial;
  }
}

@media (max-width: 600px){
  .blog-hero h1{
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

  .blog-hero__media{
    aspect-ratio: 4 / 3;
  }
}

/* ── Editorial overrides (original design decisions kept) ────── */
.blog-hero{
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    linear-gradient(90deg, var(--blog-accent) 0 .5rem, transparent .5rem),
    linear-gradient(112deg, rgba(var(--blog-accent-rgb), .12) 0 34%, transparent 34.2%),
    var(--surface-solid);
}

.blog-hero__media{
  border-radius: 0;
}

.blog-share-panel{
  border-radius: 0;
  box-shadow: none;
}

.excerpt{
  border-radius: 0;
  box-shadow: none;
}

.excerpt:hover{
  box-shadow: none;
}

.post_tag,
.excerpt_more.button{
  border-radius: 0;
}
