/* TD Post Grid (cards) */
.td-grid-wrap{
  max-width:var(--td-max);
  margin:0 auto;
  padding:0 18px;
}
.td-grid{
  display:grid;
  gap:22px;
  align-items:stretch;
}
.td-grid--cols-1{ grid-template-columns:1fr; }
.td-grid--cols-2{ grid-template-columns:repeat(2, minmax(0,1fr)); }
.td-grid--cols-3{ grid-template-columns:repeat(3, minmax(0,1fr)); }
.td-grid--cols-4{ grid-template-columns:repeat(4, minmax(0,1fr)); }

@media (max-width:980px){
  .td-grid--cols-3,
  .td-grid--cols-4{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:620px){
  .td-grid--cols-2,
  .td-grid--cols-3,
  .td-grid--cols-4{ grid-template-columns:1fr; }
}

.td-card{
  background:var(--td-bg-soft);
  border-radius:var(--td-radius);
  overflow:hidden;
  border:1px solid var(--td-border);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
  display:flex;
  flex-direction:column;
}
.td-card__media{
  display:block;
  line-height:0;
  background:#e9e9e9;
}
.td-card__img{
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  object-fit:cover;
  display:block;
}
.td-card__body{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:0;
}
.td-card__title{
  margin:0;
  font-size:18px;
  line-height:1.2;
}
.td-card__title-link{
  text-decoration:none;
  color:var(--td-accent);
}
.td-card__title-link:hover{ text-decoration:underline; }
.td-card__excerpt{
  margin:0;
  font-size:15px;
  line-height:1.6;
  color:#222;
}
.td-card__time{
  margin-top:auto;
  font-size:12px;
  opacity:.78;
}

/* Style 3 can be long — keep readable without skyscrapers */
.td-card--style-3 .td-card__excerpt{
  line-height:1.65;
  font-size:15px;
  max-height:260px;
  overflow:auto;
  padding-right:6px;
}

/* Pagination (if used) */
.td-pagination{
  width:min(var(--td-max), 100%);
  margin:26px auto 10px;
  padding:0 18px;
  text-align:center;
}
.td-pagination ul{
  list-style:none;
  margin:0;
  padding:0;
  display:inline-flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.td-pagination a,
.td-pagination span{
  display:inline-flex;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.14);
  text-decoration:none;
  line-height:1;
}
.td-pagination .current{
  background:rgba(152,57,57,.12);
  border-color:rgba(152,57,57,.30);
}
.td-loadmore{
  display:inline-flex;
  padding:12px 18px;
  border-radius:12px;
  background:var(--td-accent);
  color:#fff;
  text-decoration:none;
  font-weight:800;
}
.td-loadmore:hover{ filter:brightness(.95); }

.td-grid-pagination {
  width: min(var(--td-max), 100%);
  margin: 26px auto 10px;
  padding: 0 18px;
  text-align: center;
}

.td-grid-pagination__inner {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.td-grid-page {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.14);
  text-decoration: none !important;
  line-height: 1;
  margin: 0 !important;
  background: #fff;
}

.td-grid-page:hover {
  text-decoration: none !important;
}

.td-grid-page--current,
.td-grid-page.current {
  background: rgba(152,57,57,.12);
  border-color: rgba(152,57,57,.30);
}

.td-grid-page.prev,
.td-grid-page.next {
  padding-left: 16px;
  padding-right: 16px;
}