:root {
  --background: 0 0% 98%;
  --foreground: 0 0% 18%;
  --muted: 0 12% 90%;
  --muted-foreground: 0 12% 30%;
  --popover: 0 0% 95%;
  --popover-foreground: 0 0% 8%;
  --card: 0 0% 96%;
  --card-foreground: 0 0% 13%;
  --border: 0 0% 93%;
  --input: 0 0% 90%;
  --primary: 174 42% 65%;
  --primary-rgb: 107, 198, 186;
  --primary-foreground: 174 42% 5%;
  --secondary: 174 30% 25%;
  --secondary-foreground: 174 30% 85%;
  --accent: 0 0% 83%;
  --accent-foreground: 0 0% 23%;
  --destructive: 2 87% 45%;
  --destructive-foreground: 0 0% 100%;
  --ring: 174 42% 65%;
  --chart-1: 174 42% 65%;
  --chart-2: 174 30% 25%;
  --chart-3: 0 0% 83%;
  --chart-4: 174 30% 28%;
  --chart-5: 174 45% 65%;
  --radius: 0.5rem;
}

:root.dark {
    --background: 0 0% 98%;
    --foreground: 0 0% 18%;
    --muted: 0 12% 90%;
    --muted-foreground: 0 12% 30%;
    --popover: 0 0% 95%;
    --popover-foreground: 0 0% 8%;
    --card: 0 0% 96%;
    --card-foreground: 0 0% 13%;
    --border: 0 0% 93%;
    --input: 0 0% 90%;
    --primary: 174 42% 65%;
    --primary-rgb: 107, 198, 186;
    --primary-foreground: 174 42% 5%;
    --secondary: 174 30% 25%;
    --secondary-foreground: 174 30% 85%;
    --accent: 0 0% 83%;
    --accent-foreground: 0 0% 23%;
    --destructive: 2 87% 45%;
    --destructive-foreground: 0 0% 100%;
    --ring: 174 42% 65%;
    --chart-1: 174 42% 65%;
    --chart-2: 174 30% 25%;
    --chart-3: 0 0% 83%;
    --chart-4: 174 30% 28%;
    --chart-5: 174 45% 65%;
  }
.channel-button {
  background-color: transparent;
  color: var(--secondary);
  border-radius: var(--radius);
  text-decoration: none;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.channel-button:hover {
  color: var(--primary);
  background-color: var(--primary-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.channel-button::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--primary);
  transition: all 0.3s ease;
}

.channel-button:hover::after {
  width: 0; /* Removing the underline effect when using background */
}

.channel-button:active {
  transform: translateY(1px);
  background-color: var(--primary-foreground);
  color: var(--primary);
}

/* Article Card Styling */
.article-card {
  border: none !important;
  border-radius: var(--radius) !important;
  background: linear-gradient(135deg, 
              hsl(0, 0%, 96%) 0%, 
              hsl(0, 0%, 96%) 80%, 
              hsl(174, 42%, 75%) 100%) !important;
  color: var(--card-foreground) !important;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
  overflow: hidden !important;
  margin-bottom: 2rem !important;
  max-width: 800px !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.1) !important;
  position: relative !important;
  padding: 0 !important; /* Remove padding from parent */
}

.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, hsl(174, 42%, 65%), hsl(174, 30%, 25%));
  opacity: 0.8;
  z-index: 1;
}

.article-card:hover {
  transform: translateY(-5px) scale(1.01) !important;
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15), 
              0 8px 10px -6px rgba(0, 0, 0, 0.05),
              0 0 15px hsla(174, 42%, 65%, 0.2) !important;
  background: linear-gradient(135deg, 
              hsl(0, 0%, 96%) 0%, 
              hsl(0, 0%, 96%) 70%, 
              hsl(174, 42%, 75%) 100%) !important;
}

.article-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.article-card-title a {
  color: var(--card-foreground);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-card-title a:hover {
  color: var(--primary);
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

.card-body {
  padding: 2rem;
  flex: 1 1 auto;
}

.card-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background-color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-excerpt {
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-date {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.inline-icon {
  vertical-align: middle;
  margin-right: 0.25rem;
}

.read-more-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.read-more-link:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Badge Styling */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  height: auto;
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-finance {
  background-color: hsl(215, 100%, 70%);
  color: hsl(215, 100%, 10%);
}

.badge-ai {
  background-color: hsl(280, 80%, 80%);
  color: hsl(280, 80%, 20%);
}

.badge-tech {
  background-color: hsl(195, 90%, 75%);
  color: hsl(195, 90%, 15%);
}

.badge-agriculture {
  background-color: hsl(120, 70%, 75%);
  color: hsl(120, 70%, 15%);
}

.badge-craft {
  background-color: hsl(30, 80%, 75%);
  color: hsl(30, 80%, 15%);
}

/* Feed Layout */
.article-feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* Animation for feed */
.article-feed .article-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeSlideUp 0.6s ease forwards;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger the animation for each card in feed */
.article-feed .article-card:nth-child(1) { animation-delay: 0.1s; }
.article-feed .article-card:nth-child(2) { animation-delay: 0.2s; }
.article-feed .article-card:nth-child(3) { animation-delay: 0.3s; }
.article-feed .article-card:nth-child(4) { animation-delay: 0.4s; }
.article-feed .article-card:nth-child(5) { animation-delay: 0.5s; }
.article-feed .article-card:nth-child(6) { animation-delay: 0.6s; }
.article-feed .article-card:nth-child(7) { animation-delay: 0.7s; }
.article-feed .article-card:nth-child(8) { animation-delay: 0.8s; }
.article-feed .article-card:nth-child(9) { animation-delay: 0.9s; }
.article-feed .article-card:nth-child(10) { animation-delay: 1.0s; }
.article-feed .article-card:nth-child(11) { animation-delay: 1.1s; }
.article-feed .article-card:nth-child(12) { animation-delay: 1.2s; }
.article-feed .article-card:nth-child(13) { animation-delay: 1.3s; }
.article-feed .article-card:nth-child(14) { animation-delay: 1.4s; }
.article-feed .article-card:nth-child(15) { animation-delay: 1.5s; }

/* Remove homepage grid animation since we're using the feed now */
.homepage-grid .article-card {
  animation: none;
  opacity: 1;
}

/* Add scroll reveal effect */
@media (prefers-reduced-motion: no-preference) {
  .article-feed {
    perspective: 1000px;
  }

  .article-feed .article-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
  }
}

.typewriter {
  overflow: hidden; /* Ensures the content is not revealed until the animation */
  border-right: .15em solid orange; /* The typwriter cursor */
  /* white-space: nowrap; Keeps the content on a single line */
  margin: 0 0; /* Gives that scrolling effect as the typing happens */
  letter-spacing: .05em; /* Adjust as needed */
  animation: 
    typing 1.5s steps(10, end) forwards,
    blink-caret .75s step-end infinite;
}

/* The typing effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

/* The typewriter cursor effect */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: orange; }
}
