/**
 * Pasada visual global — hubs estáticos, blog, recetas, legal, calculadoras y panel.
 * Complementa theme.css y tools.css sin tocar copy del hero de portada.
 */
:root {
  --cgc-header-offset: 72px;
}

@media (max-width: 900px) {
  :root {
    --cgc-header-offset: 66px;
  }
}

/* Cabecera sticky: compensar padding en héroes de hubs */
body.cgc-static-hub .blog-hero,
body.blog-page .blog-hero,
body.cgc-static-recursos .recursos-hero,
body.cgc-page-recursos .recursos-hero,
body.cgc-static-recetas .hero,
body.cgc-static-pro .shell > .hero,
body.cgc-static-onboard .onboard-hero,
body.cgc-static-legal .legal-shell,
body.cgc-page-recipe main.detail {
  scroll-margin-top: calc(var(--cgc-header-offset) + 12px);
}

body.cgc-static-hub .blog-hero,
body.blog-page .blog-hero {
  padding-top: calc(var(--cgc-header-offset) + 28px) !important;
  padding-bottom: 42px !important;
}

body.cgc-static-recursos .recursos-hero,
body.cgc-page-recursos .recursos-hero {
  padding-top: calc(var(--cgc-header-offset) + 32px) !important;
}

body.cgc-static-recetas .hero {
  padding-top: calc(var(--cgc-header-offset) + 24px) !important;
}

body.cgc-static-pro .shell > .hero {
  padding-top: calc(var(--cgc-header-offset) + 20px) !important;
}

body.cgc-static-onboard .onboard-hero {
  padding-top: calc(var(--cgc-header-offset) + 24px) !important;
}

body.cgc-static-legal .legal-shell {
  padding-top: calc(var(--cgc-header-offset) + 28px) !important;
}

/* Blog artículo (50 páginas HTML) */
body.cg-blog-single-page .cg-static-blog-article,
body.cgc-page-blog-single .cg-static-blog-article {
  padding-top: calc(var(--cgc-header-offset) + 20px) !important;
}

body.cg-blog-single-page .blog-article-shell h1,
body.cgc-page-blog-single .blog-article-shell h1 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.02 !important;
}

/* Receta individual (250 HTML) */
body.cgc-page-recipe main.detail {
  padding-top: calc(var(--cgc-header-offset) + 12px) !important;
}

body.cgc-page-recipe .detail-card h1 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.05 !important;
  max-width: 100%;
}

body.cgc-page-recipe .detail-card,
body.cgc-page-recipe .container.detail-shell {
  min-width: 0;
}

/* Evitar nav legacy duplicada si queda resto tras inyección */
body:has(.site-header) > header.recipe-nav,
body:has(.site-header) > header.nav {
  display: none !important;
}

/* Calculadoras — catálogo y herramientas (plugin) */
body.cgc-page-tools .cg-calc-page {
  padding-top: 12px !important;
}

body.cgc-page-tools .cg-calc-top {
  gap: 20px !important;
  margin-bottom: 8px !important;
}

body.cgc-page-tools .cg-calc-top h1 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

body.cgc-page-tools .cg-calc-top h2 {
  overflow-wrap: break-word;
  max-width: 52ch;
}

/* Velo tarjetas foto — alineado con gradiente suave (también bloque legacy en tools.css) */
.cg-catalog-card--photo:not(.home-calc-card)::before,
.cg-catalog-app .cg-catalog-card.cg-catalog-card--photo::before,
.home-calc-grid a.home-calc-card.cg-catalog-card--photo::before {
  background: linear-gradient(
    105deg,
    rgba(15, 61, 46, 0.78) 0%,
    rgba(15, 61, 46, 0.42) 52%,
    rgba(15, 61, 46, 0.55) 100%
  ) !important;
  opacity: 1 !important;
}

/* Tarjeta ancha aminograma / nutrición — sin solapar CTA */
.cg-catalog-app .cg-catalog-card.cg-catalog-card--photo.cg-wide-card .cg-catalog-card__body,
.home-calc-grid .cg-catalog-card.cg-catalog-card--photo.cg-wide-card .cg-catalog-card__body {
  min-width: 0 !important;
}

.cg-catalog-app .cg-catalog-card.cg-catalog-card--photo.cg-wide-card .cg-catalog-card__go,
.home-calc-grid .cg-catalog-card.cg-catalog-card--photo.cg-wide-card .cg-catalog-card__go {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Panel y cuenta */
body.cgc-page-panel .cg-tools-account,
body.cgc-page-panel .cg-dashboard {
  padding-top: calc(var(--cgc-header-offset) + 8px);
}

body.cgc-page-panel .cg-tools-account h1,
body.cgc-page-panel .cg-dashboard h1 {
  overflow-wrap: break-word;
  line-height: 1.08;
}

body.cgc-page-panel .cg-dashboard-onboarding--compact {
  position: relative;
  z-index: 12;
}

body.cgc-page-panel .cg-dashboard-onboarding--compact .cg-dashboard-onboarding-copy p,
body.cgc-page-panel .cg-dashboard-onboarding--compact .cg-dashboard-guide strong,
body.cgc-page-panel .cg-dashboard-onboarding--compact .cg-dashboard-guide span {
  color: #213228 !important;
}

body.cgc-page-panel .cg-dashboard-reminder[hidden] {
  display: none !important;
}

/* Home calculadoras: texto claro sobre foto (anula cg-force-light) */
html.cg-force-light #herramientas .home-calc-grid a.home-calc-card.cg-catalog-card--photo h3 {
  color: #fffdf8 !important;
}

html.cg-force-light #herramientas .home-calc-grid a.home-calc-card.cg-catalog-card--photo p {
  color: rgba(255, 253, 248, 0.94) !important;
}

html.cg-force-light #herramientas .home-calc-grid a.home-calc-card.cg-catalog-card--photo .cg-catalog-card__eyebrow {
  color: #eef7e9 !important;
  background: rgba(15, 61, 46, 0.72) !important;
}

/* Hubs: títulos largos sin cortar bajo header */
body.cgc-static-hub h1,
body.cgc-static-recursos .recursos-hero h1,
body.cgc-page-recursos .recursos-hero h1,
body.cgc-static-recetas .hero h1 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 900px) {
  :root {
    --cgc-header-offset: 76px;
  }

  body.cgc-static-hub .blog-hero,
  body.blog-page .blog-hero {
    padding-top: calc(var(--cgc-header-offset) + 20px) !important;
  }
}

@media (max-width: 620px) {
  :root {
    --cgc-header-offset: 72px;
  }

  .cg-catalog-app .cg-catalog-card.cg-catalog-card--photo.cg-wide-card h3 {
    font-size: 1.2rem !important;
  }
}
