:root{
  --post-grid-gap: 1rem;
  --post-grid-min: 300px;
  --post-grid-row: 12px;
}

.post-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--post-grid-min, 300px), 1fr));
  grid-auto-rows: var(--post-grid-row, 12px);
  grid-auto-flow: dense;
  gap: var(--post-grid-gap, 1rem);
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.post-grid > *{
  position: relative;
  grid-row-end: span var(--post-grid-span, 40);
  align-self: start;
  width: 100%;
  min-width: 0;
}

.post-grid .wide{ grid-column: span 2; }
.post-grid .tall{ grid-row-end: span calc(var(--post-grid-span, 40) * 2); }

.post-grid figure{
  margin: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.post-grid .thumb{
  position: relative;
  display: block;
  width: 100%;
  background: #fff;
  overflow: hidden;
  border: 0;
}

.post-grid .thumb iframe{
  width: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.post-grid img.thumb,
.post-grid .thumb-img,
.post-grid .thumb > img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.post-card{
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--color-secondary);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  border: none;
  transition: transform .2s ease, color .2s ease;}
.post-card:hover,
.post-card:focus-visible{
  color: var(--color-text);
  transform: translateY(-2px);
}
.post-card:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--color-primary) 70%, #fff);
  outline-offset: 2px;
}

.post-card__media{
  position: relative;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1.46 / 1;
}

.post-card__media iframe,
.post-card__media img{
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.post-card__media img{
  object-fit: cover;
}

.post-card__media iframe{
  pointer-events: none;
}
.post-card__media img{
  pointer-events: none;
  user-select: none;
}

.post-card__body{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
  background: #ffffff00;
}

.post-card__info{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.post-card__meta{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.post-card__text{
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: .9rem;
  color: color-mix(in srgb, var(--color-text) 75%, #fff);
}
.post-card__separator{
  opacity: .6;
}
.post-card__avatar{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  border: none;
  flex: 0 0 auto;
}
.post-card__username{
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}
.post-card__title{
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
}
.post-card__views{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-text) 70%, #fff);
  white-space: nowrap;
  flex: 0 0 auto;
}
.post-card__views img{
  width: 16px;
  height: 16px;
  display: block;
  opacity: .75;
}

.post-card__actions{
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 2;
}
.post-card:hover .post-card__actions,
.post-card:focus-within .post-card__actions{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.post-card__action{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(38,59,70,.2);
  background:var(--color-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,.15);
  color: var(--color-text);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
}
.post-card__action:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-btn) 60%, var(--color-border));
  color: var(--color-btn);
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
}
.post-card__action:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--color-btn) 70%, #fff);
  outline-offset: 2px;
}
.post-card__action img,
.post-card__action svg{
  width: 18px;
  height: 18px;
  display: block;
}
.post-card__action .share-icon{
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("/assets/icons/share.svg") center / contain no-repeat;
  mask: url("/assets/icons/share.svg") center / contain no-repeat;
}
.post-card__action--favorite{
  position: relative;
  color: var(--color-text);
}
.post-card__action--favorite img,
.post-card__action--favorite svg{
  display: none;
}
.post-card__action--favorite::before{
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("/assets/icons/starborder.svg") center / contain no-repeat;
  mask: url("/assets/icons/starborder.svg") center / contain no-repeat;
}
.post-card__action--favorite.is-favorite{
  background-image: none;
  background-color: var(--color-btn);
  border-color: var(--color-btn);
  color: #fff;
}
.post-card__action--favorite.is-favorite::before{
  -webkit-mask-image: url("/assets/icons/star.svg");
  mask-image: url("/assets/icons/star.svg");
}

@media (hover: none){
  .post-card__actions{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.post-grid .overlay .tags,
.post-grid .overlay .o-tags,
.post-grid .meta2 .tags,
.post-grid .meta2 .o-tags,
.post-grid .meta .tags,
.post-grid .meta .o-tags,
.post-grid .tags,
.post-grid .o-tags{
  display: none;
}

body:not(.post-page) .tags,
body:not(.post-page) .tag,
body:not(.post-page) .tag-pill,
body:not(.post-page) .o-tags{
  display: none !important;
}
