/* /assets/css/pages/recipe.css - Recipe Detail Page (Premium Mobile-First) */

/* =========================================
   RECIPE DETAIL PAGE CONTAINER
   ========================================= */
.recipe-detail {
  background: var(--kookly-bg-app);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* =========================================
   HERO IMAGE (Full Width Mobile, Flexible Aspect Ratio)
   ========================================= */
.recipe-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--kookly-bg-secondary);
}

/* La gallery dentro l'hero mobile prende aspect-ratio 1:1 (square) o 3:4 (portrait) */
.recipe-hero .recipe-gallery,
.recipe-hero .recipe-hero-image-wrapper {
  max-height: 420px;
}

.recipe-hero .recipe-gallery {
  aspect-ratio: 1 / 1;
}

.recipe-hero .recipe-gallery.ratio-portrait {
  aspect-ratio: 3 / 4;
  max-height: 480px;
}

/* Flexible aspect ratio container */
.recipe-hero-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  /* Default 4:3 ratio */
  overflow: hidden;
}

.recipe-hero-image-wrapper.ratio-square {
  padding-bottom: 100%;
  /* 1:1 */
}

.recipe-hero-image-wrapper.ratio-landscape {
  padding-bottom: 56.25%;
  /* 16:9 */
}

.recipe-hero-image-wrapper.ratio-portrait {
  padding-bottom: 133%;
  /* 3:4 */
  max-height: 450px;
}

.recipe-hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.recipe-card-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kookly-bg-secondary);
  color: var(--kookly-text-muted);
  font-size: 4rem;
}

.recipe-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.recipe-gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.28s ease;
}

.recipe-gallery-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
}

/* Overlay play sul thumbnail video nella gallery */
.recipe-gallery-video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.2s;
}

.recipe-gallery-video-play-overlay:hover {
  background: rgba(0, 0, 0, 0.42);
}

.recipe-gallery-video-play-overlay i {
  width: 64px;
  height: 64px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Player YouTube inline nella slide galleria */
.recipe-gallery-inline-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.recipe-video-pending {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: radial-gradient(circle at 50% 40%, #2f2f2f 0%, #171717 100%);
  color: #f5f5f5;
}

.recipe-video-pending-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: recipe-video-spinner-rotate 0.8s linear infinite;
}

.recipe-video-pending-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

@keyframes recipe-video-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Anche nel wrapper singolo (recipe-hero-image-wrapper) */
.recipe-hero-image-wrapper {
  position: relative;
}

.recipe-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.recipe-gallery.ratio-square .recipe-gallery-image {
  object-fit: cover;
}

.recipe-gallery.ratio-portrait .recipe-gallery-image {
  object-fit: contain;
  background: linear-gradient(180deg, rgba(241, 232, 221, 0.72), rgba(247, 241, 234, 0.95));
}

.recipe-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--kookly-text-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 5;
}

.recipe-gallery-arrow:disabled {
  opacity: 0.45;
  cursor: default;
}

.recipe-gallery-arrow-prev {
  left: 16px;
}

.recipe-gallery-arrow-next {
  right: 16px;
}

.recipe-gallery-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 5;
}

.recipe-gallery-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.recipe-gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(113, 89, 62, 0.28);
}

.recipe-gallery-dot.is-active {
  background: var(--kookly-primary);
}

.recipe-gallery-count {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--kookly-text-heading);
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.recipe-video-spacing {
  height: 24px;
}

.recipe-video-section {
  margin-top: 24px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(196, 122, 44, 0.14);
  box-shadow: 0 18px 40px rgba(105, 79, 52, 0.08);
}

.recipe-video-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.recipe-video-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(111, 77, 37, 0.72);
  margin-bottom: 6px;
}

.recipe-video-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--kookly-text-heading);
}

.recipe-video-copy {
  margin: 8px 0 0;
  color: var(--kookly-text-body);
  line-height: 1.55;
}

.recipe-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.recipe-video-badge svg {
  width: 16px;
  height: 16px;
}

.recipe-video-badge.is-neutral {
  color: #5d5348;
  background: rgba(142, 126, 108, 0.12);
}

.recipe-video-badge.is-info {
  color: #0f5f76;
  background: rgba(24, 132, 164, 0.12);
}

.recipe-video-badge.is-warning {
  color: #8b5a14;
  background: rgba(201, 145, 43, 0.16);
}

.recipe-video-badge.is-success {
  color: #1f6d3d;
  background: rgba(54, 179, 126, 0.16);
}

.recipe-video-badge.is-danger {
  color: #9c2f2f;
  background: rgba(220, 53, 69, 0.12);
}

.recipe-video-player-shell {
  overflow: hidden;
  border-radius: 20px;
  background: #181613;
}

.recipe-video-player {
  position: relative;
  width: 100%;
}

.recipe-video-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.recipe-video-actions {
  margin-top: 14px;
}

.recipe-video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--kookly-primary);
  font-weight: 700;
}

.recipe-video-link:hover {
  text-decoration: underline;
}

.recipe-video-status-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.recipe-video-status-card.is-info {
  border: 1px solid rgba(24, 132, 164, 0.18);
}

.recipe-video-status-card.is-warning {
  border: 1px solid rgba(201, 145, 43, 0.2);
}

.recipe-video-status-card.is-danger {
  border: 1px solid rgba(220, 53, 69, 0.18);
}

.recipe-video-status-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 122, 44, 0.12);
  color: var(--kookly-primary);
}

.recipe-video-status-title {
  font-weight: 700;
  color: var(--kookly-text-heading);
}

/* Hero Overlay Buttons */
.recipe-hero-back,
.recipe-hero-share {
  position: absolute;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--kookly-bg-card);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kookly-text-heading);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  z-index: 10;
}

@media (max-width: 767.98px) {
  .recipe-video-section {
    padding: 16px;
    border-radius: 20px;
  }

  .recipe-video-header {
    flex-direction: column;
  }
}

.recipe-hero-back {
  left: 16px;
}

.recipe-hero-share {
  right: 16px;
}

.recipe-hero-back:hover,
.recipe-hero-share:hover {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Category Chip on Hero */
.recipe-hero-category {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 10;
}

/* =========================================
   CHIP COMPONENTS (Reusable)
   ========================================= */
.kookly-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.kookly-chip i,
.kookly-chip svg {
  width: 14px;
  height: 14px;
}

/* Category Chip Variant */
.kookly-chip-category {
  background: var(--kookly-bg-card);
  backdrop-filter: blur(8px);
  color: var(--kookly-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--kookly-primary-light);
}

/* Metric Chip Variant (for stats row) */
.kookly-chip-metric {
  background: var(--kookly-bg-secondary);
  color: var(--kookly-text-body);
  border: 1px solid var(--kookly-border-color);
  padding: 8px 14px;
}

.kookly-chip-metric i,
.kookly-chip-metric svg {
  color: var(--kookly-primary);
  width: 16px;
  height: 16px;
}

.kookly-chip-metric.accent {
  background: var(--kookly-primary);
  color: var(--kookly-text-inverse);
  border-color: var(--kookly-primary);
}

.kookly-chip-metric.accent i,
.kookly-chip-metric.accent svg {
  color: var(--kookly-text-inverse);
}

/* =========================================
   CONTENT SECTION
   ========================================= */
.recipe-content {
  background: var(--kookly-bg-card);
  padding: var(--space-4);
  position: relative;
}

/* Desktop Layout Container - Block on Mobile, Grid on Desktop */
.recipe-desktop-layout {
  display: block;
  /* Mobile: normal flow */
}

/* Image Sidebar - Hidden on Mobile */
.recipe-image-sidebar {
  display: none;
  /* Hidden on mobile */
}

/* Title + Bookmark Row */
.recipe-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.recipe-detail-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--kookly-text-heading);
  margin: 0;
  flex: 1;
}

.recipe-bookmark-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--kookly-bg-secondary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kookly-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.recipe-bookmark-btn:hover {
  background: #FFEFD9;
  transform: scale(1.05);
}

.recipe-bookmark-btn.active {
  background: var(--kookly-primary);
  color: var(--kookly-text-inverse);
}

.recipe-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-4) 0;
}

.recipe-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--kookly-bg-secondary);
  border: 1px solid var(--kookly-border-color);
  color: var(--kookly-text-body);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-normal);
}

.recipe-tag-chip i,
.recipe-tag-chip svg {
  width: 14px;
  height: 14px;
  color: var(--kookly-primary);
}

.recipe-tag-chip:hover {
  border-color: var(--kookly-primary);
  color: var(--kookly-primary);
  background: #fff3e3;
}

.recipe-dietary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-4) 0;
}

.recipe-dietary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--kookly-border-color);
  background: var(--kookly-bg-secondary);
  color: var(--kookly-text-body);
  font-size: 12px;
  font-weight: 700;
}

.recipe-dietary-chip i,
.recipe-dietary-chip svg {
  width: 14px;
  height: 14px;
}

.recipe-dietary-chip.vegan {
  border-color: #7abf7a;
  background: #ebf8eb;
  color: #2d6a33;
}

.recipe-dietary-chip.gluten-free {
  border-color: #d8bf8a;
  background: #fff8e9;
  color: #8a651c;
}

.recipe-use-as-ingredient {
  border: 1px dashed var(--kookly-border-color);
  border-radius: 14px;
  background: var(--kookly-bg-secondary);
  padding: 12px;
  margin: 0 0 var(--space-4) 0;
}

.recipe-use-as-ingredient-btn {
  width: 100%;
  border: 1px solid var(--kookly-primary);
  background: #fff;
  color: var(--kookly-primary);
  border-radius: 10px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recipe-use-as-ingredient-btn:hover {
  background: #fff5e7;
}

.recipe-use-as-ingredient p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--kookly-text-muted);
}

/* =========================================
   AUTHOR SECTION
   ========================================= */
.recipe-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: 0;
  background: transparent;
}

.recipe-author .kookly-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.recipe-author-info {
  flex: 1;
  min-width: 0;
}

.recipe-author-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--kookly-text-heading);
  display: block;
  margin-bottom: 2px;
}

.recipe-author-subtitle {
  font-size: 13px;
  color: var(--kookly-text-muted);
}

/* =========================================
   METRICS ROW (Chip Pills)
   ========================================= */
.recipe-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-5);
}

/* =========================================
   DESCRIPTION
   ========================================= */
.recipe-detail-description {
  color: var(--kookly-text-body);
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: var(--space-6);
}

/* =========================================
   TIPS / CONSIGLI
   ========================================= */
.recipe-tips {
  background: var(--kookly-bg-card);
  border: 1px solid var(--kookly-border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.recipe-tips-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--kookly-text-heading);
}

.recipe-tips-header i,
.recipe-tips-header svg {
  width: 18px;
  height: 18px;
  color: var(--kookly-primary);
}

.recipe-tips-text {
  margin: 0;
  color: var(--kookly-text-body);
  line-height: 1.6;
  font-size: 14.5px;
  white-space: pre-line;
}

/* =========================================
   TABS (Pill Style Toggle)
   ========================================= */
.recipe-tabs {
  margin-bottom: var(--space-5);
}

.recipe-tabs-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--kookly-text-heading);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recipe-tab-btn i,
.recipe-tab-btn svg {
  width: 18px;
  height: 18px;
}

.recipe-tab-btn.active {
  background: var(--kookly-bg-secondary);
  color: var(--kookly-text-heading);
}

.recipe-tab-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.03);
}

/* Tab Content */
.recipe-tab-content {
  display: none;
}

.recipe-tab-content.active {
  display: block;
}

/* =========================================
   INGREDIENTS LIST (Checklist Cards)
   ========================================= */
.portion-scaler {
  background: var(--kookly-bg-secondary);
  border: 1px solid var(--kookly-border-color);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  transition: opacity var(--transition-fast);
}

.portion-scaler.is-loading {
  opacity: 0.75;
}

.portion-scaler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portion-scaler-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--kookly-text-heading);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.portion-scaler-reset {
  border: none;
  background: transparent;
  color: var(--kookly-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.portion-scaler-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.portion-scaler-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--kookly-border-color);
  background: var(--kookly-bg-card);
  color: var(--kookly-text-heading);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.portion-scaler-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.portion-scaler-input {
  width: 84px;
  height: 38px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--kookly-border-color);
  background: var(--kookly-bg-card);
  color: var(--kookly-text-heading);
  font-weight: 600;
}

.portion-scaler-status {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--kookly-text-muted);
}

.ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ingredient-item {
  background: var(--kookly-bg-secondary);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.ingredient-item:hover {
  border-color: var(--kookly-border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ingredient-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--kookly-text-heading);
  border-radius: 6px;
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition-fast);
}

.ingredient-checkbox:checked {
  background: var(--kookly-primary);
  border-color: var(--kookly-primary);
}

.ingredient-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--kookly-text-inverse);
  font-size: 14px;
  font-weight: 700;
}

.ingredient-text-wrapper {
  flex: 1;
  min-width: 0;
}

.recipe-media-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.recipe-media-trigger-compact {
  flex-shrink: 0;
}

.recipe-media-trigger-block {
  width: 100%;
}

.recipe-media-trigger-step {
  width: min(250px, 40%);
  max-width: 250px;
  margin-left: auto;
  flex: 0 0 auto;
}

.ingredient-media-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--kookly-border-color);
  display: block;
}

.ingredient-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--kookly-text-heading);
  display: block;
  margin-bottom: 2px;
}

.ingredient-quantity {
  font-size: 13px;
  color: var(--kookly-text-muted);
}

.ingredient-item-composed {
  border-color: #eedec7;
}

.ingredient-composed-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4e4;
  color: #9d5f10;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}

.ingredient-composed-badge i,
.ingredient-composed-badge svg {
  width: 12px;
  height: 12px;
}

.ingredient-composed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--kookly-text-muted);
  margin-bottom: 2px;
}

.ingredient-composed-link {
  color: var(--kookly-primary);
  font-weight: 600;
  text-decoration: none;
}

.ingredient-composed-link:hover {
  text-decoration: underline;
}

.ingredient-item.checked .ingredient-name {
  text-decoration: line-through;
  color: #868E96;
}

.ingredient-item.checked .ingredient-quantity {
  text-decoration: line-through;
  color: #ADB5BD;
}

.ingredient-item.checked .ingredient-media-thumb {
  opacity: 0.55;
}

/* =========================================
   STEPS LIST (Numbered Cards)
   ========================================= */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.step-item {
  display: flex;
  gap: var(--space-4);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--kookly-bg-secondary);
  color: var(--kookly-primary);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--kookly-border-color);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-body {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.step-body.has-media .step-description {
  flex: 1;
}

.step-description {
  color: var(--kookly-text-body);
  line-height: 1.6;
  font-size: 15px;
  margin: 0;
}

.step-image {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  display: block;
  object-fit: cover;
}

/* =========================================
   COMMENTS SECTION
   ========================================= */
.comments-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--kookly-border-color);
}

.comments-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--kookly-text-heading);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-count {
  background: var(--kookly-primary-light);
  color: var(--kookly-primary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* Comment Input */
.comment-input-wrapper {
  position: relative;
  margin-bottom: var(--space-6);
}

.comment-input-wrapper .form-control {
  width: 100%;
  padding: 14px 60px 14px 18px;
  border-radius: 24px;
  border: 1px solid var(--kookly-border-color);
  background: var(--kookly-bg-input);
  font-size: 15px;
  color: var(--kookly-text-body);
  transition: all var(--transition-fast);
}

.comment-input-wrapper .form-control:focus {
  border-color: var(--kookly-primary);
  box-shadow: 0 0 0 3px var(--kookly-primary-light);
  outline: none;
  background: var(--kookly-bg-card);
}

.comment-input-wrapper .form-control::placeholder {
  color: var(--kookly-text-placeholder);
}

.comment-mention-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 6px);
  z-index: 30;
  border: 1px solid var(--kookly-border-color);
  border-radius: 14px;
  background: var(--kookly-bg-card);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.comment-mention-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--kookly-border-color);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.comment-mention-item:last-child {
  border-bottom: 0;
}

.comment-mention-item.active,
.comment-mention-item:hover {
  background: var(--kookly-primary-light);
}

.comment-mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--kookly-bg-secondary);
  color: var(--kookly-text-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

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

.comment-mention-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.comment-mention-meta strong {
  color: var(--kookly-text-heading);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-submit-btn {
  position: absolute;
  right: 6px;
  top: 29px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--kookly-primary);
  border: none;
  color: var(--kookly-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.comment-submit-btn:hover {
  background: #B36A24;
  transform: translateY(-50%) scale(1.05);
}

.comment-submit-btn i,
.comment-submit-btn svg {
  width: 18px;
  height: 18px;
}

.comment-char-counter {
  text-align: right;
  font-size: 12px;
  color: #868E96;
  margin-top: 6px;
  font-weight: 500;
}

/* Comment Item */
.comment-item {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--kookly-border-color);
}

.comment-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.comment-item .kookly-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--kookly-text-heading);
}

.comment-time {
  font-size: 12px;
  color: var(--kookly-text-muted);
}

.comment-text {
  color: var(--kookly-text-body);
  line-height: 1.5;
  font-size: 14px;
  margin: 0;
}

.comment-image-trigger {
  display: inline-flex;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-image-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.comment-image-trigger img {
  display: block;
}

body.comment-image-overlay-open {
  overflow: hidden;
}

.comment-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 14, 20, 0.88);
  backdrop-filter: blur(6px);
}

.comment-image-overlay.is-open {
  display: flex;
}

.comment-image-overlay-panel {
  position: relative;
  max-width: min(94vw, 1180px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-image-overlay-image {
  display: block;
  max-width: min(94vw, 1180px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.comment-image-overlay-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.comment-image-overlay-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

.comment-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--kookly-border-color);
  border-radius: 999px;
  background: var(--kookly-bg-card);
  color: var(--kookly-text-body);
  font-size: 13px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reaction-btn:hover {
  border-color: var(--kookly-primary);
}

.reaction-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reaction-btn.is-active {
  border-color: var(--kookly-primary);
  background: rgba(201, 123, 46, 0.12);
}

.reaction-btn-count {
  min-width: 10px;
  font-size: 11px;
  color: var(--kookly-text-muted);
}

.reaction-count {
  font-size: 12px;
  color: var(--kookly-text-muted);
  font-weight: 600;
}

.kookly-mention-link {
  color: var(--kookly-primary);
  text-decoration: none;
  font-weight: 600;
}

.kookly-mention-link:hover {
  color: var(--kookly-primary-dark);
}

.comment-delete {
  background: none;
  border: none;
  color: #FA5252;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.comment-delete:hover {
  color: #C92A2A;
  text-decoration: underline;
}

/* =========================================
   FORK BANNER
   ========================================= */
.fork-banner {
  background: var(--kookly-bg-secondary);
  border: 1px solid var(--kookly-border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.fork-banner i,
.fork-banner svg {
  color: var(--kookly-primary);
  width: 20px;
  height: 20px;
}

.fork-banner-text {
  flex: 1;
  font-size: 14px;
  color: var(--kookly-text-muted);
}

.fork-banner-author {
  font-weight: 600;
  color: var(--kookly-text-primary);
}

.fork-banner-author:hover {
  color: var(--kookly-primary);
  text-decoration: underline;
}

/* =========================================
   DESKTOP OPTIMIZATIONS - Two Column Layout
   ========================================= */
@media (min-width: 992px) {
  .recipe-detail {
    background: var(--kookly-bg-app);
    padding-bottom: 60px;
  }

  /* Hide mobile hero, show desktop layout */
  .recipe-hero {
    display: none;
  }

  /* Desktop Container */
  .recipe-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-8);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  /* Two Column Layout */
  .recipe-desktop-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: var(--space-10);
    align-items: start;
  }

  /* Left Column - Image Sidebar (Sticky) */
  .recipe-image-sidebar {
    display: block;
    /* Show on desktop */
    position: sticky;
    /* top: 80px; */
    background: var(--kookly-bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }

  .recipe-image-sidebar-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Default square, will be overridden by JS */
    overflow: hidden;
    background: var(--kookly-bg-secondary);
  }

  /* These classes are kept for backwards compatibility but aspect-ratio will be set via inline style */
  .recipe-image-sidebar-wrapper.ratio-landscape {
    aspect-ratio: 4 / 3;
  }

  .recipe-image-sidebar-wrapper.ratio-portrait {
    aspect-ratio: 4 / 5;
  }

  .recipe-image-sidebar-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .recipe-image-sidebar-wrapper .recipe-card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .recipe-image-sidebar-wrapper .recipe-gallery {
    height: 100%;
  }

  /* Image Overlay Actions (Desktop) */
  .recipe-image-actions {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
  }

  .recipe-image-action-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--kookly-bg-card);
    backdrop-filter: blur(8px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kookly-text-heading);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }

  .recipe-image-action-btn:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  /* Category Chip on Image (Desktop) */
  .recipe-image-category {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
  }

  /* Image Info Footer */
  .recipe-image-info {
    padding: var(--space-5);
    background: var(--kookly-bg-card);
    border-top: 1px solid var(--kookly-border-color);
  }

  .recipe-image-info-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--kookly-text-muted);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .recipe-sidebar-social-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: var(--space-4);
    background: var(--kookly-bg-card);
    border-top: 1px solid var(--kookly-border-color);
    border-bottom: 1px solid var(--kookly-border-color);
  }

  .recipe-sidebar-social-btn {
    border: 1px solid var(--kookly-border-color);
    border-radius: 18px;
    background: var(--kookly-bg-secondary);
    color: var(--kookly-text-heading);
    min-height: 78px;
    padding: 12px 10px;
    display: grid;
    justify-items: center;
    gap: 4px;
    cursor: pointer;
    transition: border-color var(--transition-normal), transform var(--transition-normal), color var(--transition-normal), background var(--transition-normal);
  }

  .recipe-sidebar-social-btn:hover {
    border-color: var(--kookly-primary);
    color: var(--kookly-primary);
    transform: translateY(-1px);
    background: rgba(244, 133, 37, 0.08);
  }

  .recipe-sidebar-social-btn.active {
    color: var(--kookly-primary);
    border-color: rgba(244, 133, 37, 0.38);
    background: rgba(244, 133, 37, 0.1);
  }

  .recipe-sidebar-social-btn i,
  .recipe-sidebar-social-btn svg {
    font-size: 20px;
    width: 20px;
    height: 20px;
  }

  .recipe-sidebar-social-btn__label {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .recipe-sidebar-social-btn__count {
    font-size: 0.76rem;
    color: var(--kookly-text-muted);
    font-variant-numeric: tabular-nums;
  }

  .recipe-image-metrics {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .recipe-image-metric-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 14px;
    color: var(--kookly-text-body);
  }

  .recipe-image-metric-item i,
  .recipe-image-metric-item svg {
    width: 18px;
    height: 18px;
    color: var(--kookly-primary);
  }

  .recipe-image-metric-label {
    flex: 1;
    color: var(--kookly-text-muted);
  }

  .recipe-image-metric-value {
    font-weight: 600;
    color: var(--kookly-text-heading);
  }

  /* Fork Button in Sidebar */
  .recipe-sidebar-actions {
    margin-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .recipe-sidebar-fork-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--kookly-primary);
    color: var(--kookly-text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(196, 122, 44, 0.2);
  }

  .recipe-sidebar-fork-btn:hover {
    background: #B36A24;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 122, 44, 0.3);
  }

  .recipe-sidebar-fork-btn:active {
    transform: translateY(0);
  }

  .recipe-sidebar-fork-btn i,
  .recipe-sidebar-fork-btn svg {
    width: 20px;
    height: 20px;
  }

  .recipe-sidebar-use-ingredient-btn {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    color: var(--kookly-text-muted);
    border: 1px solid var(--kookly-border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .recipe-sidebar-use-ingredient-btn:hover {
    color: var(--kookly-primary);
    border-color: var(--kookly-primary);
    background: #fffaf3;
  }

  .recipe-sidebar-use-ingredient-btn i,
  .recipe-sidebar-use-ingredient-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Right Column - Main Content */
  .recipe-main-content {
    background: var(--kookly-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    min-width: 0;
  }

  /* Desktop Back Button (Top of main content) */
  .recipe-desktop-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--kookly-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-5);
    transition: color var(--transition-fast);
  }

  .recipe-desktop-back:hover {
    color: var(--kookly-primary);
  }

  .recipe-desktop-back i,
  .recipe-desktop-back svg {
    width: 18px;
    height: 18px;
  }

  /* Title */
  .recipe-header-row {
    margin-bottom: var(--space-5);
  }

  .recipe-detail-title {
    font-size: 42px;
    line-height: 1.1;
  }

  .recipe-bookmark-btn {
    width: 48px;
    height: 48px;
  }

  /* Author */
  .recipe-author {
    margin-bottom: var(--space-5);
  }

  .recipe-author .kookly-avatar {
    width: 52px;
    height: 52px;
  }

  .recipe-author-name {
    font-size: 16px;
  }

  .recipe-author-subtitle {
    font-size: 14px;
  }

  /* Metrics - Hide individual chips on desktop, keep fork button */
  .recipe-metrics-row .kookly-chip-metric:not(.accent) {
    display: none;
    /* Hide likes, comments, time, portions on desktop */
  }

  .recipe-metrics-row .kookly-chip-metric.accent {
    display: none;
    /* Keep fork button visible */
  }

  /* Description */
  .recipe-detail-description {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: var(--space-8);
  }

  /* Tabs */
  .recipe-tabs {
    margin-bottom: var(--space-6);
  }

  .recipe-tab-btn {
    padding: 12px 32px;
    font-size: 16px;
  }

  /* Ingredients */
  .ingredient-item {
    padding: 16px 18px;
    border-radius: 20px;
  }

  .ingredient-name {
    font-size: 16px;
  }

  .ingredient-quantity {
    font-size: 14px;
  }

  /* Steps */
  .step-item {
    gap: var(--space-5);
  }

  .step-number {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .step-description {
    font-size: 16px;
  }

  /* Comments */
  .comments-section {
    margin-top: var(--space-10);
    padding-top: var(--space-8);
  }

  .comments-title {
    font-size: 24px;
  }

  .comment-input-wrapper .form-control {
    padding: 16px 64px 16px 20px;
    font-size: 16px;
  }

  .comment-submit-btn {
    width: 44px;
    height: 44px;
    right: 8px;
  }

  .comment-item .kookly-avatar {
    width: 44px;
    height: 44px;
  }

  .comment-author {
    font-size: 15px;
  }

  .comment-text {
    font-size: 15px;
  }

  .comment-image-overlay {
    padding: 16px;
  }

  .comment-image-overlay-image {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 14px;
  }

  /* Fork Banner */
  .fork-banner {
    margin-bottom: var(--space-5);
  }
}

/* Large Desktop */
@media (min-width: 1400px) {
  .recipe-content {
    max-width: 1600px;
  }

  .recipe-desktop-layout {
    grid-template-columns: 480px 1fr;
    gap: var(--space-12);
  }

  /* .recipe-image-sidebar {
    top: 100px;
  } */
}

/* =========================================
   FLOATING ACTION BUTTON (Fork)
   ========================================= */
.recipe-fab-fork {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: #C47A2C;
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(196, 122, 44, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  z-index: 100;
}

.recipe-fab-fork:hover {
  background: #B36A24;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(196, 122, 44, 0.4);
}

.recipe-fab-fork i,
.recipe-fab-fork svg {
  width: 24px;
  height: 24px;
}

.recipe-mobile-secondary-action {
  background: #fff;
  color: var(--kookly-text-muted);
  border: 1px solid var(--kookly-border-color) !important;
}

.recipe-mobile-secondary-action:hover {
  color: var(--kookly-primary);
  border-color: var(--kookly-primary) !important;
  background: #fffaf3;
}

@media (min-width: 992px) {
  .recipe-fab-fork {
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
  }

  .recipe-fab-fork i,
  .recipe-fab-fork svg {
    width: 28px;
    height: 28px;
  }
}

/* =========================================
   ACTIONS BAR (Like, Comment, Share)
   ========================================= */
.recipe-actions-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: var(--space-2) 0;
  margin: var(--space-5) 0;
}

.recipe-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  background: var(--kookly-bg-secondary);
  border: 1px solid var(--kookly-border-color);
  border-radius: 16px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--kookly-text-heading);
  text-decoration: none;
  transition: border-color var(--transition-normal), color var(--transition-normal), background var(--transition-normal), transform var(--transition-normal);
}

.recipe-action:hover {
  color: var(--kookly-primary);
  border-color: var(--kookly-primary);
  background: rgba(244, 133, 37, 0.08);
  transform: translateY(-1px);
}

.recipe-action.active {
  color: var(--kookly-primary);
  border-color: rgba(244, 133, 37, 0.38);
  background: rgba(244, 133, 37, 0.1);
}

.recipe-action i,
.recipe-action svg {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.recipe-action span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.recipe-action-count {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 992px) {
  .recipe-actions-bar--mobile {
    display: none;
  }
}
