/* ==========================================================================
   Koharu — Components
   Post cards, category cards, dividers, badges, buttons, pagination.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section divider — hairline / label / hairline
   -------------------------------------------------------------------------- */
.divider {
  display: flex;
  margin-block: 1rem;
  align-items: center;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex-grow: 1;
}

.divider::before {
  background: hsl(var(--foreground) / 0.4);
}

.divider::after {
  background: hsl(var(--foreground) / 0.5);
}

.divider > * {
  margin-inline: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: hsl(var(--foreground) / 0.6);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--duration-ui) var(--ease-out), color var(--duration-ui) var(--ease-out),
    transform var(--duration-ui) var(--ease-out);
}

.btn-ghost {
  background: none;
}

.btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-gradient {
  background: var(--gradient-shoka-button);
  color: #fff;
  border-radius: 1rem;
}

.btn-gradient:hover {
  transform: scale(1.05);
}

/* The signature Shoka "more..." corner tab. */
.card-more {
  position: absolute;
  bottom: -0.25rem;
  right: -0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--gradient-shoka-button);
  border-start-start-radius: 1rem;
  border-end-end-radius: 1rem;
  transition: transform var(--duration-ui) var(--ease-out);
}

.card-more:hover {
  transform: translate(0.25rem, 0.25rem) scale(1.05);
}

.card-more.is-left {
  right: auto;
  left: -0.25rem;
  border-start-start-radius: 0;
  border-end-end-radius: 0;
  border-start-end-radius: 1rem;
  border-end-start-radius: 1rem;
}

.card-more.is-left:hover {
  transform: translate(-0.25rem, 0.25rem) scale(1.05);
}

/* --------------------------------------------------------------------------
   Badges / tag pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: color var(--duration-ui) var(--ease-out), background var(--duration-ui) var(--ease-out);
}

.badge-outline {
  color: hsl(var(--badge-primary));
  border: 1px solid hsl(var(--badge-primary));
}

.badge-plain {
  color: hsl(var(--badge-primary));
  border: none;
  padding-inline: 0.25rem;
}

.badge-plain:hover {
  color: hsl(var(--badge-primary) / 0.8);
}

.badge-plain svg {
  height: 0.75rem;
  width: 0.75rem;
}

.badge-shoka {
  border: none;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.badge-draft {
  gap: 0.25rem;
  background: #b45309;
  border: 1px solid rgb(202 138 4 / 0.2);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Post list
   -------------------------------------------------------------------------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-block: 3rem;
  color: hsl(var(--foreground) / 0.3);
}

.post-list-empty svg {
  height: 6rem;
  width: 6rem;
  fill: hsl(var(--foreground) / 0.2);
}

/* --------------------------------------------------------------------------
   Post card
   -------------------------------------------------------------------------- */
.post-card {
  position: relative;
  display: flex;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--box-bg-shadow) 0px 5px 15px;
  /* Tailwind `transition-shadow`: 150ms, standard ease. */
  transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
  box-shadow: 0 0 2rem var(--box-bg-shadow);
}

.dark .post-card {
  background: transparent;
}

.post-card-cover {
  position: relative;
  order: 1;
  height: 11.625rem;
  max-height: 11.625rem;
  width: calc(50% - 2rem);
  flex-shrink: 0;
  overflow: hidden;
}

.post-card-cover.is-left {
  border-start-start-radius: var(--radius);
  border-end-start-radius: var(--radius);
  clip-path: polygon(0 0, 92% 0%, 100% 100%, 0% 100%);
}

.post-card-cover.is-right {
  order: 2;
  border-start-end-radius: var(--radius);
  border-end-end-radius: var(--radius);
  clip-path: polygon(0 0%, 100% 0%, 100% 100%, 8% 100%);
}

.post-card-cover img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  /* Source: `transition duration-500 group-hover:scale-110 group-hover:rotate-3`.
     Tailwind's bare `transition` eases with cubic-bezier(0.4, 0, 0.2, 1) — an
     ease-out here reads as a lurch, which is what made it feel stiff. */
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow,
    transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 500ms;
}

.post-card:hover .post-card-cover img {
  transform: scale(1.1) rotate(3deg);
}

.post-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(50% + 2rem);
  order: 2;
  padding: 1rem 1rem 0.5rem;
}

.post-card-cover.is-left ~ .post-card-body {
  order: 2;
}

.post-card-cover.is-right ~ .post-card-body {
  order: 1;
}

.post-card.is-no-cover .post-card-body {
  width: 100%;
}

/* Row 1: category + meta */
.post-card-top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-card-cat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  white-space: nowrap;
  color: hsl(var(--muted-foreground));
  transition: color var(--duration-ui) var(--ease-out);
}

.post-card-cat:hover {
  color: hsl(var(--shoka-blue));
}

.post-card-cat svg {
  height: 0.875rem;
  width: 0.875rem;
}

.post-card-meta {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.post-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.post-card-meta svg {
  height: 0.875rem;
  width: 0.875rem;
}

/* Row 2: title */
.post-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* The flex item is this <a>, not the <h2> inside it. A flex item's automatic
   minimum size is its min-content width, which for unbreakable CJK-free text is
   the whole line — so the <a> refused to shrink and the title spilled out of
   the card. `min-width: 0` has to sit on the element that is actually the item;
   on the <h2> it was inert. */
.post-card-title > a {
  flex: 1;
  min-width: 0;
}

/* Two lines, then an ellipsis (the source clamps to one; the user asked for
   two). `overflow-wrap` keeps a long unbroken token — a URL, a hashed filename —
   from punching through the clamp. */
.post-card-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: hsl(var(--primary));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  transition: color var(--duration-ui) var(--ease-out);
}

.post-card-title a:hover h2,
.post-card-title h2:hover {
  color: hsl(var(--shoka-blue));
}

/* Row 3: excerpt */
.post-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Row 4: tags.
   The "more..." tab is absolutely positioned over the card's bottom corner, so
   the row has to keep clear of it. The source leaves this to chance — its tags
   happen to stop short of the tab — which is exactly why longer tags (a Chinese
   tag is two to four times the width of the source's sample ones) end up under
   it. Reserving the tab's own measured width (79px on desktop, 56px on mobile,
   identical on both sites) makes it hold whatever the tag is. */
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-block: 0.25rem;
  padding-inline-end: 5.5rem;
}

/* The tab moves to the other corner when the cover is on the right; the reserve
   follows it. */
.post-card-tags.is-left {
  padding-inline-end: 0;
  padding-inline-start: 5.5rem;
}

/* Staggered padding follows the diagonal edge of the cover. */
.post-card.is-stagger .post-card-top {
  padding-left: 0;
}

.post-card.is-stagger .post-card-title {
  padding-left: 0.5rem;
}

.post-card.is-stagger .post-card-desc {
  padding-left: 1rem;
}

.post-card.is-stagger .post-card-tags {
  padding-left: 1.5rem;
}

/* --------------------------------------------------------------------------
   Featured category cards (3D flip)
   -------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  row-gap: 1rem;
}

.flip-card {
  position: relative;
  height: 14rem;
  perspective: 1000px;
}

/* `600ms` and nothing else: the source writes `transition: transform 600ms`
   with no timing function, which is the CSS keyword `ease` — not the
   `--ease-in-out` this used to carry. The two are close but not the same curve,
   and the difference is what a flip feels like on the way out. */
.flip-card-inner {
  position: relative;
  height: 100%;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms;
}

/*
 * The 100ms delay is the source's `transition-delay: calc(var(--delay) * 1ms)`
 * with `delay` defaulting to 100 (`FlippedCard.astro:67-70`, `:26`).
 *
 * It is a guard against a flip on every grazed pointer, not a per-card stagger:
 * the source renders every card with the same default and never passes a
 * per-index value, and the declaration lives on the `:hover` rule alone, so the
 * reverse flip is immediate.
 */
.flip-card:hover .flip-card-inner {
  transform: rotateY(-180deg);
  transition-delay: 100ms;
}

/* No `overflow: hidden` here, matching the source's `FlippedCard.astro`. The
   back face's ribbon is deliberately wider than the card — `left: -1rem` with
   `max-width: calc(100% + 2rem)` — and its folded corner hangs below the tab;
   clipping the face cut both off, which is why only part of the label showed.
   Nothing here needs the clip: the cover image and the darkening mask each
   carry their own `border-radius`, and the link list scrolls itself. */
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  backface-visibility: hidden;
  /* The faces fade their own hover shadow. Without this the `:hover` box-shadow
     below snaps on, where the source's faces carry
     `transition: all calc(var(--duration) * 1ms) ease-in-out` with
     `--duration` defaulting to 600 (`FlippedCard.astro:97-101`, `:26`). */
  transition: all 600ms ease-in-out;
}

/* The front paints on top while the card is mid-flip, as in the source. */
.flip-card-front {
  z-index: 2;
}

.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.1);
}

.flip-card-front {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
}

.flip-card-front img {
  position: absolute;
  inset: 0;
  z-index: -10;
  height: 100%;
  width: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* Darkening mask that keeps the label legible. */
.flip-card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -10;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #434343 0, #000 100%);
  opacity: 0.25;
}

/*
 * The source's `<h2 class="text-2xl text-white">` (`CategoryCards.astro:76`):
 * `text-2xl` is 1.5rem/2rem, and the weight is 400 — Tailwind's preflight resets
 * headings to `font-weight: inherit`, so the source never renders this bold.
 * The port had no weight or line-height declared, so the UA's `h2 { font-weight:
 * bold }` and the body's 1.6 line-height both leaked in: measured 700/38.4px
 * against the source's 400/32px, which is what made the label look heavier and
 * sit lower than the original.
 */
.flip-card-front h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 2rem;
  color: #fff;
}

.flip-card-front .badge {
  position: absolute;
  top: 0.625rem;
  right: 0.75rem;
  color: #fff;
  opacity: 0.8;
}

.flip-card-back {
  display: flex;
  flex-direction: column;
  padding: 4rem 1.5rem 1rem;
  background: hsl(var(--card));
  transform: rotateY(-180deg);
}

/* Gradient ribbon with a notched left edge. */
.flip-tab {
  position: absolute;
  top: 1rem;
  left: -1rem;
  display: grid;
  height: 2rem;
  max-width: calc(100% + 2rem);
  place-items: center;
  padding-inline: 1rem;
  /* The source rounds only the right end, with `rounded-r-md` — the `-md` step
     of the radius scale, i.e. `calc(var(--radius) - 2px)`, which is 10px. This
     was hard-coded to 0.375rem (6px), which left the ribbon's free end visibly
     squarer than the source's. Measured on the source: 10px. Logical properties
     here, as elsewhere in this file; under LTR they are the physical right. */
  border-start-end-radius: calc(var(--radius) - 2px);
  border-end-end-radius: calc(var(--radius) - 2px);
  background: linear-gradient(to left, var(--gradient-shoka-button-start), var(--gradient-shoka-button-end));
}

/*
 * The fold: the sliver of ribbon that has wrapped around the card's edge.
 *
 * `left: -1rem` is load-bearing, not decorative. The ribbon starts 1rem left of
 * the card (`left: -1rem` above), so its protruding part occupies x ∈ [-16, 0].
 * The fold has to hang *under that part*, which is what `after:-left-4` does in
 * the source (`CategoryCards.astro:87`). At `left: 0` — where this sat — the
 * triangle instead painted at x ∈ [0, 16], over the card's back face, so the
 * ribbon read as a flat bar with a stray wedge beside it. Measured on the
 * source: `left: -16px`; on the port before this fix: `left: 0px`.
 *
 * The colour is the gradient's *end* stop because the gradient runs `to left`
 * (see `.flip-tab` above), which puts that stop at the ribbon's left edge — the
 * edge that folds. Hence `border-right`, matching `after:border-r-*`.
 */
.flip-tab::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -1rem;
  width: 0;
  height: 0;
  border-top: 0 solid transparent;
  border-right: 16px solid var(--gradient-shoka-button-end);
  border-bottom: 16px solid transparent;
  border-left: 16px solid transparent;
}

.flip-tab a {
  display: block;
  font-size: 1rem;
  /* `text-base` in Tailwind is 1rem/1.5rem, not the 1.6 the port's body
     carries (`.flip-tab` is `place-items: center`, so the taller line box
     barely shows — but it moves the label off the ribbon's optical centre). */
  line-height: 1.5rem;
  color: #fff;
}

.flip-tab a:hover {
  animation: koharu-vertical-shake 1s;
}

@keyframes koharu-vertical-shake {
  0% { transform: scale(1); }
  10%, 20% { transform: scale(0.9) rotate(3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(-3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1); }
}

/*
 * The avatar's greeting wobble, from `src/styles/global/animate.css:2-36`. It is
 * a rotation-only shake, which is why `koharu-vertical-shake` above (a scale +
 * rotate) cannot stand in for it. The source runs it as `shake 2s ease` on
 * `.hover\:animate-shake` — `tailwind.config.mjs:98` for the shorthand,
 * `HomeInfo.astro:42` for the element, which is the avatar image itself.
 */
@keyframes koharu-shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(2deg); }
  15%, 25%, 35% { transform: rotate(-4deg); }
  20%, 30%, 40% { transform: rotate(4deg); }
  45% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
  55%, 90% { transform: rotate(0deg); }
}

.flip-links {
  display: grid;
  max-height: 6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
  row-gap: 0.75rem;
  overflow: auto;
}

.flip-links a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* `text-base` = 1rem/1.5rem in the source; the port inherited 1.6. Each row is
     one line here (`white-space: nowrap`), so the line-height is the row height
     and the 1.6px difference compounds across the list. */
  line-height: 1.5rem;
  color: hsl(var(--primary));
  transition: color var(--duration-ui) var(--ease-out);
}

.flip-links a:hover {
  color: hsl(var(--shoka-blue));
}

.flip-meta {
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  /* `text-sm` = 0.875rem/1.25rem in the source. */
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.flip-meta svg {
  height: 0.875rem;
  width: 0.875rem;
}

/*
 * The `more...` button. Its metrics come from the source's `Button` component
 * rather than from this file's own taste: `button.tsx` ships
 * `size.default = 'h-10 px-4 py-2'` and a base of `font-medium text-sm`, so the
 * button is a fixed 2.5rem tall with 14px/20px text. The port let it size from
 * its line box, which came out 38.4px because it inherited the body's 1.6
 * line-height — hence the explicit height and line-height below.
 *
 * `CategoryCards.astro:136` passes `rounded-2xl rounded-se-none rounded-es-none`
 * over that base. Measured on the source, that resolves to 16px on the top-left
 * and bottom-right and 0 on the other two; the port only declared the top-left.
 */
.flip-back-more {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #fff;
  background: var(--gradient-shoka-button);
  border-start-start-radius: 1rem;
  border-end-end-radius: 1rem;
  transition: transform var(--duration-ui) var(--ease-out);
}

/*
 * `md:h-7 md:px-2 md:py-1 md:text-xs`. Worth spelling out: this theme's `md` is
 * a *max*-width breakpoint (`tailwind.config.mjs:16`), so these are the small
 * -screen values, not the desktop ones — which is why the desktop button
 * measured full size on the source. Same convention as the port's other media
 * queries.
 */
@media (max-width: 768px) {
  .flip-back-more {
    height: 1.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
  }
}

.flip-back-more:hover {
  transform: translate(0.25rem, 0.25rem) scale(1.05);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-weight: 700;
}

.pagination .btn {
  padding-inline: 0.75rem;
  min-width: 2.5rem;
}

.pagination .is-current {
  color: hsl(var(--primary));
  opacity: 1;
  pointer-events: none;
}

.pagination .is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination .gap {
  margin-inline: 0.25rem;
}

/* --------------------------------------------------------------------------
   Post navigation (prev / next)
   --------------------------------------------------------------------------
   One quiet row, as the source theme has it: a tiny link per side with no
   background until hovered. An earlier port drew two grey cards, which read as
   two more content blocks sitting under the article. */
.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 1rem;
}

.post-nav a {
  display: flex;
  min-width: 0;
  max-width: 45%;
  flex: 1;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  transition: background var(--duration-ui) var(--ease-out), color var(--duration-ui) var(--ease-out);
}

.post-nav a:hover {
  background: hsl(var(--accent));
  color: hsl(var(--primary));
}

.post-nav a > svg {
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
}

.post-nav .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-nav .is-next {
  justify-content: flex-end;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Related / random post lists
   -------------------------------------------------------------------------- */
.post-footer-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-inline: 2.5rem;
}

.post-footer-lists h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground) / 0.8);
}

.post-footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-footer-list a {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: background var(--duration-ui) var(--ease-out), color var(--duration-ui) var(--ease-out);
}

.post-footer-list a:hover {
  background: hsl(var(--foreground) / 0.05);
  color: hsl(var(--primary));
}

.post-footer-list .idx {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: hsl(var(--foreground) / 0.3);
}

.post-footer-list .cat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: hsl(var(--foreground) / 0.5);
}

.post-footer-list .t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: hsl(var(--foreground) / 0.8);
}

/* --------------------------------------------------------------------------
   Author card + copyright notice
   -------------------------------------------------------------------------- */
.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.6);
}

.author-card img {
  height: 4rem;
  width: 4rem;
  flex-shrink: 0;
  border-radius: 9999px;
  object-fit: cover;
}

.author-card .name {
  margin: 0;
  font-weight: 600;
}

.author-card .bio {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.copyright-notice {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid hsl(var(--primary));
  border-radius: 0 0.5rem 0.5rem 0;
  background: hsl(var(--primary) / 0.06);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.copyright-notice a {
  color: hsl(var(--primary));
}

.copyright-notice a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .post-card {
    flex-direction: column;
  }

  .post-card-cover,
  .post-card-cover.is-left,
  .post-card-cover.is-right {
    order: 1;
    width: auto;
    height: 11.625rem;
    clip-path: none;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .post-card-body,
  .post-card-cover.is-left ~ .post-card-body,
  .post-card-cover.is-right ~ .post-card-body {
    order: 2;
    width: 100%;
    padding: 0.25rem 1rem 1rem;
  }

  .post-card.is-stagger .post-card-top,
  .post-card.is-stagger .post-card-title,
  .post-card.is-stagger .post-card-desc,
  .post-card.is-stagger .post-card-tags {
    padding-left: 0;
  }

  /* Narrower card, narrower tab: the reserve shrinks with it. */
  .post-card .post-card-tags {
    padding-inline-end: 4rem;
  }

  .post-card .post-card-tags.is-left {
    padding-inline-end: 0;
    padding-inline-start: 4rem;
  }

  .post-card-meta .reading-time {
    display: none;
  }

  .post-card-desc {
    height: auto;
    max-height: 3.75rem;
  }

  .card-more {
    bottom: -0.25rem;
    right: -0.25rem;
    left: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-start-start-radius: 1rem;
    border-end-end-radius: 1rem;
    border-start-end-radius: 0;
    border-end-start-radius: 0;
  }

  .category-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-footer-lists {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 1.5rem;
  }

  .post-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .post-nav a {
    max-width: 100%;
  }

  /* Stacked rows have no left/right edge to hug, so the arrows lead the text. */
  .post-nav .is-next {
    justify-content: flex-start;
    text-align: left;
  }
}
