/* /assets/css/components/cards.css */

/* =========================================
   Recipe Card (Premium Refined)
   ========================================= */

.recipe-card {
  background-color: #ffffff;
  border-radius: 18px;
  /* Soft rounded interactions */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  /* Very delicate shadow */
  border: 1px solid #EDEDED;
  /* Ultra thin border */
  overflow: visible;
  /* Needed for dropdowns to escape if using absolute, but usually we handle z-index. 
     Actually, if overflow is visible, image corners need radius manually or card needs overflow hidden. 
     Let's use overflow: visible for menus and apply radius to children. */
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Rounding corners implementation since overflow is visible */
.rc-header {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

/* If header is present, it handles top corners. If image is first (not this design), it would need it. */

/* --- 1. Header (Author) --- */
.rc-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  border-bottom: 1px solid transparent;
}

.rc-author {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.rc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #F4E8D6;
  /* Beige */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 600;
  color: #5d4a3a;
  font-size: 0.95rem;
}

.rc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rc-author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 2px;
}

.rc-author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333333;
}

.rc-badge-social {
  font-size: 0.7rem;
  color: #A89B8C;
  /* Sand/Beige tone */
  font-weight: 500;
  display: flex;
  align-items: center;
}

.rc-menu {
  position: relative;
}

.btn-icon-subtle {
  background: none;
  border: none;
  color: #555555;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-subtle:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Custom Dropdown Menu */
.rc-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 180px;
  background-color: #F7F5F1;
  /* Warm white/beige */
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.rc-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.rc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}

.rc-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: #000;
}

.rc-dropdown-item i {
  font-size: 1.1rem;
  color: #333;
  width: 20px;
  text-align: center;
}


/* --- 2. Image Section --- */
.rc-image-container {
  position: relative;
  width: auto;
  margin: 0 14px;
  /* Add margin left/right */
  aspect-ratio: 4/3;
  overflow: hidden;
  background-color: #f8f9fa;
  border-radius: 16px;
  /* Rounded corners */
}

.recipe-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Category Badge (Overlay Top Right) */
.rc-category-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #F9E6C4;
  /* Pastel yellow/beige */
  color: #5F4B32;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.02em;
}


/* --- 3. Content Body --- */
.rc-content {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rc-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #262626;
  margin-bottom: 4px;
  line-height: 1.35;
}

.rc-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.rc-title a:hover {
  color: var(--kookly-primary);
}

.rc-description {
  font-size: 0.85rem;
  color: #777;
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}


/* --- 4. Footer (Interactions) --- */
.rc-footer {
  padding: 12px 16px;
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.rc-actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rc-action-btn {
  background: none;
  border: none;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #4A4A4A;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
}

.rc-action-btn i {
  font-size: 1.1rem;
  stroke-width: 0.5;
  /* If SVG, but using BS Icons font */
}

.rc-action-btn:hover {
  color: var(--kookly-primary);
}

.rc-action-btn:active {
  transform: scale(0.95);
}

/* Liked State */
.rc-action-btn.liked {
  color: #e63946;
}

.rc-action-btn.bookmarked {
  color: var(--kookly-primary);
}

.rc-actions-right {
  margin-left: auto;
}


/* =========================================
   Grid System
   ========================================= */
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 576px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1400px) {
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Skeleton Styles */
.skeleton {
  background-color: #eee;
  border-radius: 4px;
  animation: shimmer 1.5s infinite linear;
  background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
  background-size: 1000px 100%;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton-avatar {
  border-radius: 50%;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}