/* Blog Dynamic Data Section - Blog Posts Grid */

/* Fade-in animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Uses site-grid-rails.css for layout and style.css for typography/colors */
/* Updated: Removed all emoji references, using SVG icons instead */

.blog-dynamic-data {
  background-color: var(--ica-mint, #DCF4EF);
  padding: 4rem 0;
}

.blog-dynamic-data__content {
  color: var(--ica-green-deep);
}

/* Ensure no emoji content is displayed */
.blog-post__date::before,
.blog-post__date::after {
  content: none !important;
}

/* Main Grid Container */
.blog-posts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Desktop Layout */
.blog-posts-desktop {
  display: block;
}

/* First Row Layout (1 large + 2 small) */
.blog-posts-first-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

/* Large Card (First Column) */
.blog-post--large {
  min-height: 400px;
}

.blog-post--large .blog-post__main {
  min-height: 300px;
}

/* Small Cards Container (Second Column) */
.blog-posts-small-cards {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Small Cards */
.blog-post--small {
  min-height: 190px;
}

.blog-post--small .blog-post__main {
  min-height: 130px;
}

/* Sidebar Posts */
.blog-posts-sidebar {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.blog-post--sidebar {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background-color: #2a2a2a;
  flex: 1;
  min-height: 0;
}

.blog-post--sidebar .blog-post__image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  border-radius: 6px;
}

.blog-post--sidebar .blog-post__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-post--sidebar .blog-post__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1;
  transition: background-color 0.3s ease;
}

.blog-post--sidebar:hover .blog-post__image::after {
  background-color: rgba(0, 0, 0, 0.5);
}

.blog-post--sidebar .blog-post__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
}

.blog-post--sidebar .blog-post__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.blog-post--sidebar .blog-post__title a {
  color: white;
  text-decoration: none;
  transition: color var(--ease);
}

.blog-post--sidebar .blog-post__title a:hover {
  color: var(--ica-lime);
}

.blog-post--sidebar .blog-post__date {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post--sidebar .date-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Grid Rows (3 posts per row) */
.blog-posts-grid-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

/* Mobile Grid (hidden on desktop) */
.blog-posts-mobile-grid {
  display: none;
}

.blog-post--grid {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease, opacity 0.6s ease;
  min-height: 300px;
  box-sizing: border-box;
  border: 2px solid transparent;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delays for initial cards */
.blog-post--grid:nth-child(1) { animation-delay: 0.1s; }
.blog-post--grid:nth-child(2) { animation-delay: 0.2s; }
.blog-post--grid:nth-child(3) { animation-delay: 0.3s; }
.blog-post--grid:nth-child(4) { animation-delay: 0.4s; }
.blog-post--grid:nth-child(5) { animation-delay: 0.5s; }
.blog-post--grid:nth-child(6) { animation-delay: 0.6s; }
.blog-post--grid:nth-child(7) { animation-delay: 0.7s; }
.blog-post--grid:nth-child(8) { animation-delay: 0.8s; }
.blog-post--grid:nth-child(9) { animation-delay: 0.9s; }

.blog-post--grid:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--ica-green-deep,#1E312F);
}

.blog-post--grid:hover .blog-post__main::after {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Main Section with Background Image */
.blog-post--grid .blog-post__main {
  position: relative;
  flex: 1;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.blog-post--grid .blog-post__main::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
  transition: background var(--ease);
}

.blog-post--grid .blog-post__main > * {
  position: relative;
  z-index: 2;
}

.blog-post--grid .blog-post__tag {
  margin-bottom: 0.75rem;
  background-color: var(--ica-lime);
  color: var(--ica-green-deep);
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.blog-post--grid .blog-post__title {
  font-family: var(--font-heading);
  font-size: 2.0rem;
  font-weight: 600;
  color: white;
  margin: 0;
  line-height: 1.3;
  text-transform: uppercase;
}


.blog-post--grid .blog-post__title a {
  color: white;
  text-decoration: none;
  transition: color var(--ease);
}

.blog-post--grid .blog-post__title a:hover {
  color: var(--ica-lime);
}

/* CTA Section */
.blog-post--grid .blog-post__cta {
  background-color: #f8f8f8;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.blog-post--grid .blog-post__read-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--ica-green-deep);
  transition: color var(--ease);
}

.blog-post--grid .blog-post__read-more:hover {
  color: var(--ica-teal);
}

.blog-post--grid .blog-post__read-more-text {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
}

.blog-post--grid .blog-post__read-more-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--ease);
  filter: brightness(0) saturate(100%) invert(20%) sepia(15%) saturate(2000%) hue-rotate(180deg) brightness(90%) contrast(90%);
}

.blog-post--grid .blog-post__read-more:hover .blog-post__read-more-icon {
  transform: translate(2px, -2px);
  filter: brightness(0) saturate(100%) invert(40%) sepia(80%) saturate(2000%) hue-rotate(160deg) brightness(90%) contrast(90%);
}

/* Tags */
.blog-post__tag {
  padding: 4px 8px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.blog-post__tag--featured {
  background-color: var(--ica-teal);
  color: white;
}

.blog-post__tag--business {
  background-color: #28a745;
  color: white;
}

/* Placeholder for missing images */
.blog-post__placeholder {
  width: 100%;
  height: 200px;
  background-color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  color: white;
  border-radius: 6px;
}

/* No posts message */
.no-posts {
  text-align: center;
  padding: 3rem 0;
}

.no-posts h2 {
  font-family: var(--font-heading);
  color: white;
  margin-bottom: 1rem;
}

.no-posts p {
  font-family: var(--font-body);
  color: #ccc;
  font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .blog-posts-sidebar {
    grid-column: 1;
    flex-direction: row;
    overflow-x: auto;
  }
  
  .blog-post--sidebar {
    flex: 0 0 300px;
  }
  
  .blog-posts-grid-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: First card in first row only - larger title */
@media (min-width: 769px) {
  .blog-posts-first-row .blog-post--large .blog-post__title {
    font-size: 60px !important;
  }
}

@media (max-width: 768px) {
  .blog-dynamic-data {
    padding: 3rem 0;
  }
  
  /* Hide desktop layout on mobile */
  .blog-posts-desktop {
    display: none;
  }
  
  /* Show mobile grid with all posts */
  .blog-posts-mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-post--grid {
    min-height: 320px;
  }
  
  .blog-post--grid .blog-post__main {
    min-height: 220px;
  }
  
  /* Increase title font size on mobile */
  .blog-post--grid .blog-post__title {
    font-size: 1.9rem;
  }
}

/* Load More Button */
.blog-load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  padding: 0 1rem;
}

.blog-load-more-btn {
  background-color: var(--ica-teal);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 150px;
  justify-content: center;
}

.blog-load-more-btn:hover {
  background-color: var(--ica-green-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.load-more-spinner {
  font-size: 0.9rem;
}

/* Mobile Load More Button */
@media (max-width: 768px) {
  .blog-load-more-container {
    margin-top: 2rem;
    padding: 0 1rem;
  }
  
  .blog-load-more-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-width: 120px;
  }
}
