/* Estilos del blog en MDX (Envy). Convencion del grupo: posts = MDX, no HTML
   congelado. Identidad de la marca (vino #572C32 / rosa #D1A09F, titulares Libre
   Caslon Text, cuerpo JetBrains Mono — ambas Google Fonts que carga el kit CSS)
   sin depender del markup de Elementor. */

:root {
  --bp-primary: #572C32;
  --bp-cream: #D1A09F;
  --bp-text: #273638;
}

.bp { background: #fff; color: var(--bp-text); font-family: 'JetBrains Mono', ui-monospace, system-ui, sans-serif; }

/* ---- Hero (banner con imagen de fondo + overlay) ----
   Header es overlay fijo (~75px); padding-top deja el titulo bajo el menu. */
.bp-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  padding: 190px 24px 56px;
  color: var(--bp-cream);
}
.bp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(87,44,50,0.35) 0%, rgba(87,44,50,0.82) 100%);
}
.bp-hero__inner { position: relative; max-width: 1000px; margin: 0 auto; width: 100%; }
.bp-hero h1 {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 14px;
  color: var(--bp-cream);
}
.bp-hero__meta { font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }

/* ---- Layout articulo + TOC ---- */
.bp-wrap {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 52px;
  padding: 56px 24px 80px;
}
@media (max-width: 1024px) { .bp-wrap { grid-template-columns: 1fr; gap: 24px; } }

/* ---- Prose ---- */
.bp-article { min-width: 0; }
.bp-article h2, .bp-article h3, .bp-article h4 {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-weight: 400;
  color: var(--bp-primary);
  line-height: 1.2;
  scroll-margin-top: 110px;
}
.bp-article h2 { font-size: 1.95rem; margin: 2.2em 0 0.6em; }
.bp-article h3 { font-size: 1.45rem; margin: 1.8em 0 0.5em; }
.bp-article h4 { font-size: 1.2rem; margin: 1.5em 0 0.5em; }
.bp-article p { font-size: 1.07rem; line-height: 1.78; margin: 0 0 1.25em; }
.bp-article a { color: var(--bp-primary); text-decoration: underline; text-underline-offset: 2px; }
.bp-article a:hover { color: var(--bp-primary); }
.bp-article ul, .bp-article ol { margin: 0 0 1.4em; padding-left: 1.3em; line-height: 1.7; }
.bp-article li { margin: 0.4em 0; }
.bp-article img { width: 100%; height: auto; border-radius: 10px; margin: 1.6em 0; display: block; }
.bp-article blockquote {
  margin: 1.8em 0;
  padding: 0.6em 1.2em;
  border-left: 4px solid var(--bp-primary);
  background: var(--bp-cream);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.bp-article strong { color: var(--bp-primary); }

/* ---- TOC sticky + colapsable ---- */
.bp-toc { align-self: start; }
@media (min-width: 1025px) { .bp-toc { position: sticky; top: 128px; } }
/* Caja teal con texto crema (igual que el widget TOC del WP en vivo: fondo
   #0C323D, header/links #EEE2D7, hover blanco). */
.bp-toc__box { background: var(--bp-primary); border-radius: 12px; padding: 18px 20px; }
.bp-toc__head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Libre Caslon Text', Georgia, serif;
  color: var(--bp-cream); font-size: 1.1rem; margin: 0 0 6px;
}
/* El reset del tema da a TODO <button> un borde rosa (#c36) + padding asimetrico
   y el kit le pone border-radius:100px -> el chevron quedaba descentrado y con
   un anillo rojo. Se neutraliza con !important: circulo limpio, chevron centrado. */
.bp-toc__toggle {
  background: var(--bp-cream) !important; cursor: pointer; color: var(--bp-primary) !important;
  width: 30px; height: 30px; padding: 0 !important; border: 0 !important;
  display: grid; place-items: center; border-radius: 50% !important;
  transition: transform 0.3s ease, background 0.2s ease;
}
.bp-toc__toggle:hover { background: var(--bp-cream) !important; filter: brightness(0.92); }
.bp-toc__toggle svg { display: block; }
.bp-toc.is-collapsed .bp-toc__toggle { transform: rotate(-90deg); }
.bp-toc__body {
  overflow: hidden;
  transition: height 0.32s ease, opacity 0.25s ease, margin 0.3s ease, padding 0.3s ease;
}
.bp-toc.is-collapsed .bp-toc__body { height: 0 !important; opacity: 0; }
.bp-toc__list {
  list-style: none; margin: 6px 0 0; padding: 0;
  max-height: 52vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--bp-cream) transparent;
}
.bp-toc__list::-webkit-scrollbar { width: 6px; }
.bp-toc__list::-webkit-scrollbar-thumb { background: var(--bp-cream); border-radius: 3px; }
.bp-toc__list::-webkit-scrollbar-track { background: transparent; }
.bp-toc__list li { margin: 0; }
.bp-toc__list a {
  display: block; padding: 5px 0; color: var(--bp-cream);
  text-decoration: none; font-size: 0.92rem; line-height: 1.35;
  border-left: 2px solid transparent; padding-left: 10px; transition: border-color 0.2s, color 0.2s;
}
.bp-toc__list a:hover, .bp-toc__list a.is-active { border-left-color: var(--bp-cream); color: #fff; }
.bp-toc__list .lvl-3 a { padding-left: 24px; font-size: 0.88rem; }
.bp-toc__list .lvl-4 a { padding-left: 38px; font-size: 0.85rem; opacity: 0.85; }

/* ---- Share ---- */
.bp-share { display: flex; gap: 12px; align-items: center; margin: 36px 0 0; padding-top: 22px; border-top: 1px solid #e6ddd3; }
.bp-share span { font-size: 0.9rem; color: #6b7680; }
.bp-share a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bp-primary); color: var(--bp-cream); text-decoration: none; font-size: 1rem;
  transition: opacity 0.2s;
}
.bp-share a:hover { opacity: 0.82; }

/* ===== Indice del blog (grid de cards, imagenes uniformes 3:2) ===== */
.bp-index { max-width: 1180px; margin: 0 auto; padding: 150px 24px 80px; }
/* con el hero "Blog" arriba (que ya despeja el header fijo) el grid usa padding normal */
.bp-index--withhero { padding-top: 56px; }

/* Hero "Blog" del indice: el color oscuro del overlay y el color claro del titulo
   vivian en el inline CSS del index original (que el rebuild no incluye), y ademas
   .bp { color } heredaba texto oscuro al titulo. Se restaura el contraste: overlay
   teal semitransparente sobre la imagen + texto crema centrado. */
.bp .elementor-element-8aa6d7b::before {
  background-color: rgba(12, 50, 61, 0.5) !important;
  opacity: 1 !important;
}
.bp .elementor-element-8aa6d7b .elementor-heading-title,
.bp .elementor-element-8aa6d7b .elementor-widget-text-editor,
.bp .elementor-element-8aa6d7b p {
  color: var(--bp-cream) !important;
}
.bp-index__title {
  font-family: 'Libre Caslon Text', Georgia, serif; color: var(--bp-primary);
  font-size: clamp(2rem, 4vw, 3rem); text-align: center; margin: 0 0 8px;
}
.bp-index__sub { text-align: center; color: #6b7680; margin: 0 0 48px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; }
.bp-card {
  display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 22px rgba(87,44,50,0.08); transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none; color: inherit;
}
.bp-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(87,44,50,0.16); }
.bp-card__media { aspect-ratio: 3 / 2; overflow: hidden; }
.bp-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-card__body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bp-card__date { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #9aa4ac; }
.bp-card__title { font-family: 'Libre Caslon Text', Georgia, serif; color: var(--bp-primary); font-size: 1.3rem; line-height: 1.2; margin: 0; }
.bp-card__excerpt { font-size: 0.96rem; line-height: 1.6; color: #5a656e; margin: 0; }
.bp-card__more { margin-top: auto; color: var(--bp-primary); font-weight: 600; font-size: 0.92rem; }

/* ---- Iconos de compartir (Phosphor): tamano + hover de contraste ---- */
.bp-hero__share a svg, .bp-share a svg { width: 17px; height: 17px; }
.bp-share a:hover { background: var(--bp-cream); color: var(--bp-primary); opacity: 1; }

/* ---- FAQ de los posts -> acordeon animado (lo arma interactions.js setupPostFaq).
   CONSTANTE del grupo: las FAQ siempre con despliegue/cierre animado + schema. ---- */
.bp-faq { margin: 0.4em 0 1.6em; border-top: 1px solid #e0e0e0; }
.bp-faq__item { border-bottom: 1px solid #e0e0e0; }
.bp-faq__q {
  width: 100%; text-align: left; background: none !important; border: 0 !important;
  cursor: pointer; padding: 18px 0 !important; margin: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  font-family: 'Libre Caslon Text', Georgia, serif; font-size: 1.1rem; font-weight: 400;
  color: var(--bp-primary) !important; line-height: 1.3;
}
.bp-faq__q span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bp-faq__q svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--bp-primary); transition: transform 0.3s ease; }
.bp-faq__item.is-open .bp-faq__q svg { transform: rotate(180deg); }
.bp-faq__a { height: 0; overflow: hidden; transition: height 0.32s ease; }
.bp-faq__a-inner { padding: 0 0 18px; }
.bp-faq__a-inner > :first-child { margin-top: 0; }
.bp-faq__a-inner p { margin: 0 0 0.8em; }

/* ===================== ENVY-ESPECIFICO =====================
   El hero "Blog" del indice trae margin-top:-120px (header en-flujo del WP); con
   el header fijo subia "BLOG" bajo el menu. Se neutraliza. */
.bp-page .elementor-element-0f4ad17 { margin-top: 0 !important; }
