/* ==========================================================================
   Bacalao Maribel - recipe blog.
   Uses the colour tokens declared by the bacalao-maribel theme, with
   fallbacks so the module also renders under a different theme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared card grid (index, product page, home block)
   -------------------------------------------------------------------------- */

.bm-blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}
.bm-blog__grid--compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }

.bm-card {
  display: flex;
  flex-direction: column;
  background: var(--bm-paper, #fff);
  border: 1px solid var(--bm-line, #e2dad0);
  border-radius: 22px;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.bm-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(11, 46, 63, .14);
  border-color: transparent;
}

.bm-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bm-foam, #e8f1f4);
}
.bm-card__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.bm-card:hover .bm-card__media img { transform: scale(1.05); }

.bm-card__tag {
  position: absolute;
  top: .85rem;
  left: .85rem;
  padding: .28rem .8rem;
  border-radius: 999px;
  background: var(--bm-deep, #0b2e3f);
  color: var(--bm-salt, #faf7f1);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bm-card__body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.15rem 1.25rem 1.4rem;
  flex: 1 1 auto;
}

.bm-card__title {
  font-family: var(--bm-font-display, Georgia, serif);
  font-size: 1.18rem;
  line-height: 1.25;
  margin: 0;
}
.bm-card__title a { color: var(--bm-deep, #0b2e3f); }
.bm-card__title a:hover { color: var(--bm-amber, #c8892e); }

.bm-card__summary {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--bm-muted, #5d6f79);
  margin: 0;
}

.bm-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .82rem;
  color: var(--bm-sea, #1d6a8c);
  font-weight: 600;
}
.bm-card__meta li { position: relative; padding-left: .9rem; }
.bm-card__meta li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bm-amber, #c8892e);
}

.bm-card__more {
  margin-top: auto;
  padding-top: .35rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bm-sea, #1d6a8c);
}
.bm-card__more::after { content: ' →'; }

/* --------------------------------------------------------------------------
   Blog index
   -------------------------------------------------------------------------- */

.bm-blog__intro {
  max-width: 46rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--bm-muted, #5d6f79);
  margin-bottom: 1.5rem;
}

.bm-blog__filters {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2rem;
}

.bm-chip {
  display: inline-flex;
  align-items: center;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--bm-line, #e2dad0);
  background: var(--bm-paper, #fff);
  color: var(--bm-deep, #0b2e3f);
  font-size: .88rem;
  font-weight: 600;
}
.bm-chip:hover { border-color: var(--bm-sea, #1d6a8c); color: var(--bm-sea, #1d6a8c); }
.bm-chip--active,
.bm-chip--active:hover {
  background: var(--bm-deep, #0b2e3f);
  border-color: var(--bm-deep, #0b2e3f);
  color: var(--bm-salt, #faf7f1);
}

.bm-blog__empty { color: var(--bm-muted, #5d6f79); }

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */

.bm-post { max-width: 60rem; margin: 0 auto; }

.bm-post__header { margin-bottom: 1.75rem; }

.bm-post__eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bm-amber, #c8892e);
  margin-bottom: .6rem;
}

.bm-post__title {
  font-family: var(--bm-font-display, Georgia, serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  color: var(--bm-deep, #0b2e3f);
  margin: 0 0 .85rem;
}

.bm-post__summary {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--bm-muted, #5d6f79);
  max-width: 44rem;
}

.bm-post__facts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.bm-post__facts li {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .7rem 1.2rem;
  border-radius: 14px;
  background: var(--bm-foam, #e8f1f4);
  min-width: 110px;
}
.bm-post__facts span {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bm-muted, #5d6f79);
}
.bm-post__facts strong {
  font-family: var(--bm-font-display, Georgia, serif);
  font-size: 1.15rem;
  color: var(--bm-deep, #0b2e3f);
}

.bm-post__cover {
  margin: 0 0 2rem;
}
.bm-post__cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(11, 46, 63, .12);
}

.bm-post__intro {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--bm-ink, #16242c);
  margin-bottom: 2.5rem;
}
.bm-post__intro p { margin-bottom: 1rem; }

/* Ingredients beside the steps on wide screens. */
.bm-post__recipe {
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}

.bm-post__ingredients {
  position: sticky;
  top: 1.5rem;
  background: var(--bm-paper, #fff);
  border: 1px solid var(--bm-line, #e2dad0);
  border-radius: 20px;
  padding: 1.5rem;
}
.bm-post__ingredients h2,
.bm-post__steps h2 {
  font-family: var(--bm-font-display, Georgia, serif);
  font-size: 1.4rem;
  color: var(--bm-deep, #0b2e3f);
  margin-bottom: 1rem;
}
.bm-post__ingredients ul { list-style: none; margin: 0; padding: 0; }
.bm-post__ingredients li {
  position: relative;
  padding: .45rem 0 .45rem 1.4rem;
  border-bottom: 1px dashed var(--bm-line, #e2dad0);
  font-size: .95rem;
}
.bm-post__ingredients li:last-child { border-bottom: none; }
.bm-post__ingredients li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bm-amber, #c8892e);
}

.bm-post__steps ol {
  list-style: none;
  counter-reset: bm-recipe-step;
  margin: 0;
  padding: 0;
}
.bm-post__steps li {
  counter-increment: bm-recipe-step;
  position: relative;
  padding: 0 0 1.5rem 3.5rem;
  font-size: 1.02rem;
  line-height: 1.7;
}
.bm-post__steps li::before {
  content: counter(bm-recipe-step);
  position: absolute;
  left: 0;
  top: -.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--bm-deep, #0b2e3f);
  color: var(--bm-salt, #faf7f1);
  font-family: var(--bm-font-display, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
}
.bm-post__steps li:last-child { padding-bottom: 0; }

.bm-post__shop,
.bm-post__related { margin: 3rem 0; }

.bm-post__back { margin-top: 2.5rem; font-weight: 600; }

/* --------------------------------------------------------------------------
   Home and product page blocks
   -------------------------------------------------------------------------- */

.bm-home-recipes {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  background: var(--bm-salt, #faf7f1);
}
.bm-home-recipes__more { text-align: center; margin: 2rem 0 0; }

.bm-product-recipes {
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--bm-line, #e2dad0);
  margin-top: 2.5rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .bm-post__recipe { grid-template-columns: 1fr; gap: 1.75rem; }
  .bm-post__ingredients { position: static; }
  .bm-post__facts li { flex: 1 1 calc(50% - .75rem); min-width: 0; }
  .bm-post__steps li { padding-left: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-card:hover { transform: none; }
  .bm-card:hover .bm-card__media img { transform: none; }
}

/* --------------------------------------------------------------------------
   Buy button under each product of a recipe
   -------------------------------------------------------------------------- */

.bm-post__add {
  margin: -.75rem 0 1.75rem;
  text-align: center;
}
.bm-post__add .add-to-cart { width: 100%; }
.bm-post__add--out {
  font-size: .88rem;
  color: var(--bm-muted, #5d6f79);
  font-style: italic;
}
