/* Recipe card styles — global (not Astro-scoped) on purpose: RecipeCard.astro
   is rendered from more than one page (homepage, library) and its classes
   must resolve to the same rules everywhere. Relies on the design tokens on
   :root in src/layouts/Base.astro and the .chips/.chip primitives in
   site.css. */

.recipe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-sm);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}
.recipe-card:hover,
.recipe-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.card-image {
  position: relative;
  background: var(--imgph);
  width: 100%;
  overflow: hidden;
}
/* The photo is always shown whole (contain). Whatever the frame has left over
   (a portrait in a 4:3 frame) is filled with a blurred copy of the same
   photo instead of flat bars. */
.card-backdrop {
  position: absolute;
  inset: -32px;
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.7) saturate(0.8);
}
.card-image img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.recipe-card:hover .card-image img {
  transform: scale(1.025);
}
/* Library masonry: the photo keeps its own shape, never cropped. */
.rc-natural .card-image img {
  object-fit: contain;
}

.rc-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a0f05;
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px 15px;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text1);
}
.card-link {
  color: inherit;
}
.card-link:hover {
  color: inherit;
}
/* Stretched link: the title's anchor covers the whole card. */
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-link:focus-visible {
  outline: none;
}
.recipe-card:has(.card-link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.card-meta {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text4);
}

.card-chips {
  margin-top: 8px;
}

/* Featured: the big pair on the homepage. */
.rc-featured {
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}
.rc-featured:hover,
.rc-featured:focus-within {
  box-shadow: var(--shadow-lg);
}
.rc-featured .card-content {
  padding: 18px 20px 20px;
  gap: 5px;
}
.rc-featured .card-title {
  font-size: 22px;
  letter-spacing: -0.025em;
}
.rc-featured .card-meta {
  font-size: 14px;
}
.rc-featured .card-chips {
  margin-top: 12px;
  gap: 8px;
}
.rc-featured .chip {
  font-size: 12.5px;
  padding: 4px 11px;
}

@media (hover: none) {
  .recipe-card:hover {
    transform: none;
  }
  .recipe-card:hover .card-image img {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .recipe-card:hover,
  .recipe-card:focus-within {
    transform: none;
  }
  .recipe-card:hover .card-image img {
    transform: none;
  }
}
