/* Recipe cards (partials/blog_card.html): home page, all recipes, category
   pages and search results all use these, on top of the base card in style.css. */

/* Hover effect for affiliate cards */
.affiliate-card:hover .affiliate-badge {
    background-color: var(--highlight);
}

/* Non-clickable image container */
.image-only {
    cursor: default;
    width: 100%;
    height: 100%;
}

/* Affiliate link styling */
.affiliate-link {
    display: inline-block;
    margin: 1rem;
    padding: 0.6rem 1rem;
    background-color: var(--accent-warm);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 1rem;
    margin-bottom: 1rem;
    align-self: flex-start;
    width: calc(100% - 2rem);
    text-align: center;
    box-sizing: border-box;
}

.affiliate-link i {
    margin-right: 5px;
}

.affiliate-link:hover {
    background-color: var(--highlight);
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.affiliate-link::after {
    font-family: "Font Awesome 5 Free";
    content: " ";
    font-weight: 900;
    font-size: 0.8em;
    opacity: 0.8;
    margin-left: 5px;
    transition: margin-left 0.2s;
}

.affiliate-link:hover::after {
    margin-left: 8px;
}

/* Affiliate post styling */
.affiliate-card {
    position: relative;
    border: 2px solid var(--accent-warm);
    box-shadow: 0 5px 15px rgba(224, 122, 95, 0.3);
}

.affiliate-badge {
  letter-spacing: 0.5px;
  box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--accent-warm);
  color: white;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 3px;
  z-index: 10;
}

/* Image styling with focus on rustic aesthetic */
.blog-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

/* Hover effects with rustic warm filter */
.blog-card:hover .blog-image {
  transform: scale(1.05);
  filter: brightness(1.05) sepia(0.15); /* Adds slight sepia tone for rustic warmth */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}
/* ============================================
WELCOME SECTION MOBILE RESPONSIVE STYLES
============================================ */

/* ============================================
   BLOG CARDS MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet and Mobile (768px and below) */
@media screen and (max-width: 768px) {
  
  /* === BLOG GRID === */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 0;
    width: 100%;
  }
  
  /* === BLOG CARDS === */
  .blog-card {
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
  }
  
  /* Card Title */
  .blog-card h2 {
    font-size: 1.2rem;
    padding: 0 1rem;
    margin: 1rem 0 0.5rem 0;
    line-height: 1.4;
  }
  
  /* Image Container */
  .blog-image-container {
    padding-top: 75%; /* Slightly taller aspect ratio for mobile */
    height: auto;
    min-height: 250px;
  }
  
  .blog-image {
    object-fit: cover;
  }
  
  /* Post Content */
  .post-content {
    padding: 0 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0.75rem 0;
  }
  
  .post-content p {
    margin: 0;
  }
  
  /* Post Meta (Date and Tags) */
  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
  }
  
  .post-meta-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .date {
    font-size: 0.85rem;
  }
  
  /* Tags */
  .tags {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .tag {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  
  /* Read More Button */
  .read-more {
    margin: 0 1rem 1rem 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    text-align: center;
    width: calc(100% - 2rem);
    box-sizing: border-box;
  }
  
  /* === AFFILIATE CARDS === */
  .affiliate-card {
    border: 2px solid var(--accent-warm);
  }
  
  .affiliate-badge {
    top: 0;
    right: 0;
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 0 8px 0 8px;
  }
  
  .affiliate-link {
    margin: 0 1rem 1rem 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    width: calc(100% - 2rem);
  }
  
  /* Remove hover transforms on mobile for better performance */
  .blog-card:hover {
    transform: translateY(-3px);
  }
}

/* Small Mobile (480px and below) */
@media screen and (max-width: 480px) {
  
  .blog-grid {
    gap: 1.25rem;
  }
  
  .blog-card h2 {
    font-size: 1.1rem;
    padding: 0 0.75rem;
  }
  
  .post-content {
    font-size: 0.9rem;
    padding: 0 0.75rem;
  }
  
  .post-meta {
    padding: 0.5rem 0.75rem;
  }
  
  .date {
    font-size: 0.8rem;
  }
  
  .tag {
    font-size: 0.65rem;
    padding: 2px 5px;
  }
  
  .read-more,
  .affiliate-link {
    margin: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    width: calc(100% - 1.5rem);
  }
  
  .affiliate-badge {
    font-size: 0.6rem;
    padding: 3px 6px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  
  /* Larger tap targets */
  .blog-card,
  .read-more,
  .affiliate-link {
    min-height: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .blog-card:hover {
    transform: none;
  }
  
  .blog-card:hover .blog-image {
    transform: none;
  }
  
  /* Active state instead of hover */
  .blog-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .read-more:active,
  .affiliate-link:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
}

/* Landscape Mobile Orientation */
@media screen and (max-height: 600px) and (orientation: landscape) {
  
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .blog-card h2 {
    font-size: 1rem;
  }
  
  .blog-image-container {
    padding-top: 50%;
  }
  
  .post-content {
    font-size: 0.85rem;
  }
  
  .post-meta {
    padding: 0.5rem 0.75rem;
  }
}

/* Container adjustments for mobile */
@media screen and (max-width: 768px) {

  .blog-index .blog-grid {
    margin: 1rem 0;
  }
}

/* Welcome buttons ("Utforska Recept" / "Om Mig") on touch screens: the 44px
   minimum tap height above was added on top of the padding, which made the
   buttons ~67px tall with the text stuck at the top. Count the padding in
   the 44px and center the text instead. */

