/* ============================================================
   Medium article slider: home page (#blog) and /blog (#medium). Loads after landing.css.
   Native horizontal scroll with snap, newest card on the left. site.js adds the arrow buttons.
   ============================================================ */
.medium-section { margin-top: var(--s5) }
.medium-section__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: var(--s4) }
.medium-section__head h2, .medium-section__head h3 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.025em }
.medium-follow { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--pink-dark) }
.medium-follow:hover { color: var(--pink) }

/* Full bleed: the track spans the viewport, --edge padding lines the first card up with the page
   content, and the mask fades cards out toward both screen edges. --cw is the .wrap content width.
   Block padding leaves room for the hover lift and shadow, which overflow would otherwise clip. */
.medium-track { --cw: calc(min(100vw, 1140px) - 2 * var(--gutter)); --edge: calc((100vw - var(--cw)) / 2); --fade: min(var(--edge), 160px); display: flex; gap: var(--s3); overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge); scrollbar-width: none; padding: 6px var(--edge) 14px; margin: -6px calc(50% - 50vw) -14px; mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent) }
.medium-track::-webkit-scrollbar { display: none }
.medium-track:focus-visible { outline-offset: -3px; border-radius: 20px }

.medium-card { flex: 0 0 calc((var(--cw) - 2 * var(--s3)) / 3); scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; color: inherit; box-shadow: var(--shadow-sm); transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out }
.medium-card:hover { transform: translateY(-2px); border-color: #F6DCE4; box-shadow: var(--shadow-md) }
.medium-card:active { transform: scale(.98); transition-duration: 80ms }
.medium-card__cover { position: relative; overflow: hidden; background: var(--bg-2) }
.medium-card__cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; transition: transform .3s ease-out }
.medium-card:hover .medium-card__cover img { transform: scale(1.03) }
.medium-card__badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(255,255,255,.94); color: #000; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.12) }
.medium-logo { width: 16px; height: 16px; flex: none; color: #000 }
.medium-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 16px }
.medium-card__body .fcard__tag { margin-bottom: 4px }
.medium-card__title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.015em }
.medium-card__desc { font-size: 15px; line-height: 1.55; color: var(--ink-2) }
.medium-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2) }
.medium-card__cta { font-weight: 600; color: var(--pink-dark); white-space: nowrap }
.medium-card__cta::after { content: " \2197" }

.medium-actions { display: flex; align-items: center; gap: 16px; flex: none }
.medium-nav { display: flex; gap: 8px }
.medium-nav[hidden] { display: none }
.medium-nav button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #F6DCE4; border-radius: 50%; background: #fff; color: var(--pink-dark); cursor: pointer; transition: transform .1s ease-out, background-color .15s ease-out, opacity .15s ease-out }
.medium-nav button .icon { width: 18px; height: 18px }
.medium-nav button:hover:not(:disabled) { background: var(--pink-tint) }
.medium-nav button:active:not(:disabled) { transform: scale(.92) }
.medium-nav button:disabled { opacity: .35; cursor: default }

@media (max-width: 950px) { .medium-card { flex-basis: calc((var(--cw) - var(--s3)) / 2) } }
/* A peek of the next card shows there's more to swipe. */
@media (max-width: 680px) {
  .medium-card { flex-basis: calc(var(--cw) * .82) }
  .medium-section__head { flex-direction: column; align-items: flex-start; gap: 10px }
}
@media (prefers-reduced-motion: reduce) {
  .medium-card, .medium-card__cover img, .medium-nav button { transition: none }
  .medium-card:hover, .medium-card:active, .medium-nav button:active, .medium-card:hover .medium-card__cover img { transform: none }
}
