/* Majiriki: compact horizontal post cards with tags */

body.mjr .post-card-list {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px !important;
  margin: 0 !important; padding: 0 !important;
}
body.mjr:not(.home) .post-card-list { grid-template-columns: 1fr; }
body.mjr .post-card-list::before, body.mjr .post-card-list::after { display: none !important; }

body.mjr .post-card-list-item.post-card {
  --thumb-w: 132px;
  display: grid !important;
  grid-template-columns: var(--thumb-w) minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "img cat date" "img body body" "img tags tags";
  column-gap: 16px; row-gap: 6px; align-items: start;
  width: auto !important; max-width: none !important; margin: 0 !important; padding: 14px !important;
  float: none !important; overflow: visible;
}
body.mjr:not(.home) .post-card-list-item.post-card { --thumb-w: 168px; padding: 16px !important; }
body.mjr .post-card-list-item:hover { transform: translateY(-3px); }

body.mjr .post-card .post-card-image { display: contents !important; }
body.mjr .post-card .post-card-image::before,
body.mjr .post-card .post-card-image::after { content: none !important; display: none !important; }
body.mjr .post-card .post-card-image > a { grid-area: img; display: block; align-self: start; overflow: hidden; border-radius: 12px; }
body.mjr .post-card .post-card-image img {
  position: static !important; top: auto !important; left: auto !important; transform: none !important;
  display: block; width: var(--thumb-w) !important; max-width: none !important; height: auto !important; aspect-ratio: 4 / 3;
  object-fit: cover; border-radius: 12px !important; transition: transform .3s ease;
}
body.mjr .post-card:hover .post-card-image img { transform: scale(1.04) !important; }

body.mjr .post-card .st-catgroup {
  grid-area: cat; position: static !important; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 !important; padding: 0 !important;
  width: auto !important; line-height: 1; pointer-events: auto !important;
  -webkit-mask-image: none !important; mask-image: none !important;
}
body.mjr .post-card .st-catgroup .catname {
  padding: 4px 10px !important; background: var(--mjr-primary-soft) !important; box-shadow: none !important; font-size: 11px !important;
}
body.mjr .post-card .post-card-date {
  grid-area: date; position: static !important; margin: 0 !important; padding: 0 !important;
  background: none !important; color: var(--mjr-muted) !important; font-size: 12px !important; line-height: 1.6 !important; white-space: nowrap;
}
body.mjr .post-card .post-card-date i { margin-right: 3px; }

body.mjr .post-card .post-card-body { grid-area: body; padding: 0 !important; min-width: 0; }
body.mjr .post-card .post-card-title { font-size: 15px !important; line-height: 1.65 !important; }
body.mjr .post-card .post-card-excerpt { margin-top: 4px; }

.mjr-card-tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 2px 0 0 !important; padding: 0; line-height: 1.6; }
body.mjr .mjr-card-tags a {
  color: var(--mjr-muted) !important; font-size: 12px; font-weight: 500; text-decoration: none;
}
body.mjr .mjr-card-tags a:hover { color: var(--mjr-primary) !important; text-decoration: underline; }
body.mjr .post-card .mjr-card-tags { grid-area: tags; }

/* Front page tag chips */
.mjr-tags { display: flex; flex-wrap: wrap; gap: 10px; }
body.mjr a.mjr-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px;
  background: var(--mjr-surface); border: 1px solid var(--mjr-line); border-radius: 999px;
  color: var(--mjr-ink); font-size: 14px; font-weight: 700; text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
body.mjr a.mjr-tag span {
  min-width: 24px; padding: 1px 7px; background: var(--mjr-bg); border-radius: 999px;
  color: var(--mjr-muted); font-size: 11px; font-weight: 700; text-align: center;
}
body.mjr a.mjr-tag:hover { border-color: var(--mjr-primary); background: var(--mjr-primary-soft); color: var(--mjr-primary-deep); }

/* Single post tags */
body.mjr .entry-content .mjr-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
body.mjr .entry-content a.mjr-chip {
  display: inline-flex; align-items: center; padding: 5px 14px;
  background: var(--mjr-bg); border: 1px solid var(--mjr-line); border-radius: 999px;
  color: var(--mjr-text) !important; font-size: 13px; font-weight: 700; line-height: 1.5; text-decoration: none !important;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
body.mjr .entry-content a.mjr-chip:hover { background: var(--mjr-primary-soft); border-color: var(--mjr-primary); color: var(--mjr-primary-deep) !important; }
body.mjr .entry-content .mjr-tagbox {
  margin: 56px 0 8px; padding: 22px 24px 6px; background: var(--mjr-bg); border: 1px solid var(--mjr-line); border-radius: var(--mjr-radius);
}
body.mjr .entry-content .mjr-tagbox .mjr-post-tags { margin-bottom: 16px; }
body.mjr .entry-content .mjr-tagbox a.mjr-chip { background: var(--mjr-surface); }
body.mjr .entry-content p.mjr-tagbox__title {
  display: flex; align-items: center; gap: 6px; margin: 0 0 14px !important;
  color: var(--mjr-ink); font-family: var(--mjr-head); font-size: 16px; font-weight: 700; line-height: 1.5;
}
body.mjr .entry-content p.mjr-tagbox__title .mjr-i { color: var(--mjr-accent); }
body.mjr.single-post p.tagst { display: none !important; }

@media (max-width: 959px) {
  body.mjr .post-card-list { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  body.mjr .post-card-list-item.post-card,
  body.mjr:not(.home) .post-card-list-item.post-card {
    --thumb-w: 100px;
    grid-template-columns: var(--thumb-w) minmax(0, 1fr);
    grid-template-areas: "img cat" "img body" "img date" "tags tags";
    column-gap: 12px; padding: 12px !important;
  }
  body.mjr .post-card .post-card-date { justify-self: start; text-align: left !important; }
  body.mjr .post-card .post-card-title { font-size: 14px !important; }
  body.mjr .post-card .post-card-excerpt { display: none; }
  body.mjr a.mjr-tag { font-size: 13px; padding: 6px 8px 6px 12px; }
}
