/* SUBSTACK.CSS */

#substack-posts {
    margin: 40px 0;
}

.substack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.substack-grid .substack-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.substack-grid .substack-card:nth-child(1) { animation-delay: 0.1s; }
.substack-grid .substack-card:nth-child(2) { animation-delay: 0.2s; }
.substack-grid .substack-card:nth-child(3) { animation-delay: 0.3s; }
.substack-grid .substack-card:nth-child(4) { animation-delay: 0.4s; }
.substack-grid .substack-card:nth-child(5) { animation-delay: 0.5s; }
.substack-grid .substack-card:nth-child(6) { animation-delay: 0.6s; }

.substack-grid .substack-card:hover {
    transform: scale(1.02);
}

.substack-grid .substack-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.substack-grid .substack-card .substack-content {
    padding: 1rem;
}

.substack-grid .substack-card .substack-content a {
    font-size: 1.1rem;
    font-weight: bold;
    color: #222;
    text-decoration: none;
}

.substack-grid .substack-card .substack-content a:hover {
    text-decoration: underline;
}

.substack-grid .substack-card .substack-content p {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
}

.substack-card a img {
  border: none;
  text-decoration: none;
  display: block;
}

/* slight zoom on hover */
.substack-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

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

/* Style for iframe containers */
.newsletter-signup,
#substack-popup iframe {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  max-width: 480px;
  margin: 0 auto;
}

/* Optional: match your funbutton style on the iframe border */
.newsletter-signup iframe,
#substack-popup iframe {
  border: 2px solid #d87a5f;
  border-radius: 20px;
}

/* Popup modal tweaks */
#substack-popup h2 {
  font-family: 'Work Sans', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

#substack-popup p {
  font-size: 1rem;
  color: #444;
  margin-bottom: 1rem;
}
