/* Substack dashboard styles */

body.substack-dashboard #main {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.substack-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 110px 0 130px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.substack-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.14) 0%, transparent 48%),
    radial-gradient(circle at 75% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

.substack-hero .wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.substack-hero h1 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.substack-hero p {
  margin: 0 auto;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 20px;
  line-height: 1.6;
}

.substack-subscribe-widget {
  max-width: 640px;
  margin: 22px auto 0;
  border-radius: 999px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.substack-inline-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  padding: 8px;
}

.substack-inline-form input[type='email'] {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
  color: #1e293b;
  background: #ffffff;
}

.substack-inline-form input[type='email']:focus {
  outline: 2px solid rgba(102, 126, 234, 0.45);
  outline-offset: 0;
}

.substack-inline-form button {
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.substack-inline-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.35);
}

.substack-hero .particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
  animation: float-substack 18s infinite ease-in-out;
}

.substack-hero .particle:nth-child(1) { left: 8%; top: 15%; animation-delay: 0s; }
.substack-hero .particle:nth-child(2) { left: 21%; top: 62%; animation-delay: 1.8s; }
.substack-hero .particle:nth-child(3) { left: 33%; top: 33%; animation-delay: 3.6s; }
.substack-hero .particle:nth-child(4) { left: 49%; top: 11%; animation-delay: 0.6s; }
.substack-hero .particle:nth-child(5) { left: 61%; top: 76%; animation-delay: 2.4s; }
.substack-hero .particle:nth-child(6) { left: 73%; top: 28%; animation-delay: 4.2s; }
.substack-hero .particle:nth-child(7) { left: 84%; top: 72%; animation-delay: 3.1s; }
.substack-hero .particle:nth-child(8) { left: 92%; top: 45%; animation-delay: 1.2s; }
.substack-hero .particle:nth-child(9) { left: 14%; top: 84%; animation-delay: 2.9s; }
.substack-hero .particle:nth-child(10) { left: 88%; top: 16%; animation-delay: 4.5s; }

.substack-main {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  min-height: 100vh;
  padding: 74px 0;
}

.substack-main .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.substack-section {
  margin-bottom: 74px;
}

.substack-section:last-child {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  color: #1e293b;
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 800;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid #667eea;
  text-decoration: none;
  color: #667eea;
  font-weight: 600;
  transition: all 0.25s ease;
  background: #ffffff;
}

.section-link::after {
  content: '↗';
  font-size: 13px;
}

.section-link:hover {
  background: #667eea;
  color: #ffffff;
  transform: translateY(-1px);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feed-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  transition: all 0.3s ease;
  overflow: hidden;
}

.feed-card:hover {
  border-color: rgba(102, 126, 234, 0.35);
  box-shadow: 0 14px 36px rgba(102, 126, 234, 0.16);
  transform: translateY(-4px);
}

.feed-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2ff 0%, #e2e8f0 100%);
}

.feed-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.feed-card:hover .feed-image {
  transform: scale(1.04);
}

.feed-image-placeholder,
.feed-image-fallback::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.25) 0%, transparent 46%),
    radial-gradient(circle at 70% 70%, rgba(240, 147, 251, 0.23) 0%, transparent 44%),
    linear-gradient(135deg, #eef2ff 0%, #e2e8f0 100%);
}

.feed-card-inner {
  padding: 24px;
}

.feed-meta {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.chip-audio {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.feed-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.4;
}

.feed-card h3 a {
  color: #1e293b;
  text-decoration: none;
}

.feed-card h3 a:hover {
  color: #667eea;
}

.feed-description {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  margin: 0;
  color: #64748b;
  font-size: 17px;
  padding: 18px 0 0;
}

@keyframes float-substack {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-26px) translateX(8px);
    opacity: 0.65;
  }
}

@media (max-width: 1023px) {
  .feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .substack-hero {
    padding: 84px 0 98px;
  }

  .substack-hero p {
    font-size: 18px;
  }

  .substack-main {
    padding: 52px 0;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }

  .section-link {
    width: 100%;
    justify-content: center;
  }

  .substack-inline-form {
    flex-direction: column;
    border-radius: 16px;
    padding: 12px;
  }

  .substack-inline-form input[type='email'],
  .substack-inline-form button {
    width: 100%;
  }
}
