.substack-feed {
  width: 100%;
}

.substack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (min-width: 700px) {
  .substack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .substack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.substack-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(8, 34, 47, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(8, 34, 47, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.substack-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(8, 34, 47, 0.12);
  text-decoration: none;
}

.substack-card__image {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #08222f;
}

.substack-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.5s ease;
}

.substack-card__image--default {
  background: #fff;
}

.substack-card__image--default img {
  object-fit: contain;
}

.substack-card:hover .substack-card__image img {
  transform: scale(1.03);
}

.substack-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 18px 20px 20px;
  min-height: 0;
}

.substack-card__title {
  margin: 0 0 8px;
  font-size: 1.2em;
  line-height: 1.3;
  color: #08222f;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-card:hover .substack-card__title {
  color: #a61d1d;
}

.substack-card__date {
  margin: 0 0 10px;
  font-size: 0.88em;
  color: #6d6d6d;
}

.substack-card__excerpt {
  margin: 0 0 16px;
  font-size: 0.98em;
  line-height: 1.45;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-card__more {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.95em;
  color: #a61d1d;
}

.substack-card:hover .substack-card__more {
  text-decoration: underline;
}

.substack-error {
  background: #fff;
  border: 1px solid rgba(8, 34, 47, 0.1);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
}

.substack-error p {
  margin-bottom: 20px;
  font-size: 1.2em;
}

.substack-button,
.substack-actions .wp-block-button__link {
  display: inline-block;
}

.substack-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(8, 34, 47, 0.1);
}

.substack-skeleton {
  background: linear-gradient(90deg, #ece7db 25%, #f7f3ea 50%, #ece7db 75%);
  background-size: 200% 100%;
  animation: substack-shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

.substack-card--skeleton {
  pointer-events: none;
}

.substack-skeleton--image {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.substack-skeleton--title {
  height: 1.5em;
  width: 75%;
  margin-bottom: 16px;
}

.substack-skeleton--date {
  height: 0.9em;
  width: 40%;
  margin-bottom: 20px;
}

.substack-skeleton--line {
  height: 0.85em;
  width: 100%;
  margin-bottom: 10px;
}

@keyframes substack-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.blog-intro {
  max-width: none;
  margin: 0 auto 32px;
  text-align: center;
}
