/* ==========================================================================
   Plantillas CC del blog (single + archivos) — réplica clinic-cloud.com
   Depende de css/cc-tokens.css del plugin shortcode_fabricantecomplementos
   (variables --cc-* y Figtree, scopeadas a .cc-comp).
   ========================================================================== */

body.fca-blog-view {
  overflow-x: hidden;
}

/* GeneratePress pinta #content como flex (para content+sidebar). Como nuestras
   plantillas ocupan ellas solas el #content y hacen su propio full-bleed, hay que
   devolverlo a block: si no, el calc(50% - 50vw) se resuelve mal y la banda se va
   a la izquierda. */
body.fca-blog-view #content.site-content {
  display: block;
  width: 100%;
}

/* Full-bleed: las bandas cuelgan a lo ancho del viewport aunque #content esté
   dentro del contenedor de GeneratePress. */
.cc-comp.cc-blog-tpl {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---- Miga de pan --------------------------------------------------------- */
.cc-comp .cc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--cc-body);
}

.cc-comp .cc-crumbs a {
  color: var(--cc-body);
  text-decoration: none;
}

.cc-comp .cc-crumbs a:hover,
.cc-comp .cc-crumbs a:focus {
  color: var(--cc-green);
}

.cc-comp .cc-crumbs__sep {
  color: #B7B2AB;
}

.cc-comp .cc-crumbs__current {
  color: var(--cc-ink);
  font-weight: 500;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.cc-comp .cc-single__head {
  background: var(--cc-cream);
  padding: 48px 32px 40px;
}

.cc-comp .cc-single__head-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.cc-comp .cc-single__head .cc-crumbs {
  justify-content: center;
}

.cc-comp .cc-single__eyebrow {
  margin-top: 20px;
  text-decoration: none;
}

.cc-comp a.cc-single__eyebrow:hover {
  filter: brightness(.96);
}

.cc-comp .cc-single__title {
  margin-top: 20px;
}

.cc-comp .cc-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--cc-body);
  font-size: 15px;
}

.cc-comp .cc-single__author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cc-comp .cc-single__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.cc-comp .cc-single__author-name {
  color: var(--cc-ink);
  font-weight: 600;
}

.cc-comp .cc-single__dot {
  color: #B7B2AB;
}

/* Imagen destacada */
.cc-comp .cc-single__feat-wrap {
  max-width: var(--cc-container);
  margin: -28px auto 0;
  padding: 0 32px;
}

.cc-comp .cc-single__feat {
  margin: 0;
  overflow: hidden;
  border-radius: var(--cc-radius);
  background: #E9FAF3;
}

.cc-comp .cc-single__feat-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
}

/* Cuerpo: contenido + sidebar sticky */
.cc-comp .cc-single__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  max-width: var(--cc-container);
  margin: 0 auto;
  padding: 56px 32px 24px;
}

/* ---- Tipografía del artículo (contenido = shortcodes + prosa del usuario) - */
.cc-comp .cc-article {
  min-width: 0;
  max-width: 760px;
  color: var(--cc-body);
  font-size: 18px;
  line-height: 30px;
}

.cc-comp .cc-article > *:first-child {
  margin-top: 0;
}

.cc-comp .cc-article p {
  margin: 0 0 24px;
}

.cc-comp .cc-article h2 {
  margin: 48px 0 16px;
  color: var(--cc-ink);
  font-family: 'Figtree', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
  scroll-margin-top: 100px;
}

.cc-comp .cc-article h3 {
  margin: 36px 0 12px;
  color: var(--cc-ink);
  font-family: 'Figtree', sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  scroll-margin-top: 100px;
}

.cc-comp .cc-article h4 {
  margin: 28px 0 10px;
  color: var(--cc-ink);
  font-family: 'Figtree', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.cc-comp .cc-article a {
  color: var(--cc-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-comp .cc-article a:hover {
  text-decoration: none;
}

.cc-comp .cc-article ul,
.cc-comp .cc-article ol {
  margin: 0 0 24px;
  padding-left: 1.4em;
}

.cc-comp .cc-article li {
  margin-bottom: 10px;
}

.cc-comp .cc-article img {
  height: auto;
  border-radius: var(--cc-radius-sm);
}

.cc-comp .cc-article figure {
  margin: 32px 0;
}

.cc-comp .cc-article blockquote {
  margin: 32px 0;
  padding: 8px 0 8px 24px;
  border-left: 4px solid var(--cc-green);
  color: var(--cc-ink);
  font-size: 22px;
  line-height: 32px;
  font-style: normal;
}

.cc-comp .cc-article strong {
  color: var(--cc-ink);
}

/* ---- Sidebar ------------------------------------------------------------- */
.cc-comp .cc-single__side {
  min-width: 0;
}

.cc-comp .cc-single__sticky {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cc-comp .cc-toc-auto {
  padding: 24px;
  border-radius: var(--cc-radius-sm);
  background: var(--cc-cream);
}

.cc-comp .cc-toc-auto__title {
  margin-bottom: 14px;
}

.cc-comp .cc-toc-auto__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cc-comp .cc-toc-auto__item {
  margin: 0;
  line-height: 1.35;
}

.cc-comp .cc-toc-auto__item + .cc-toc-auto__item {
  margin-top: 10px;
}

.cc-comp .cc-toc-auto__item--h3 {
  padding-left: 16px;
}

.cc-comp .cc-toc-auto__item a {
  color: var(--cc-body);
  font-size: 15px;
  text-decoration: none;
}

.cc-comp .cc-toc-auto__item a:hover,
.cc-comp .cc-toc-auto__item a:focus {
  color: var(--cc-green);
}

/* La newsletter del sidebar no necesita su padding de sección */
.cc-comp .cc-single__sticky .cc-newsletter {
  padding: 0;
}

/* ==========================================================================
   ARCHIVOS (categoría / etiqueta / búsqueda) — y grid compartido de cards
   ========================================================================== */
.cc-comp .cc-archive__head {
  background: var(--cc-cream);
  padding: 56px 32px;
}

.cc-comp .cc-archive__head-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.cc-comp .cc-archive__head .cc-crumbs {
  justify-content: center;
}

.cc-comp .cc-archive__eyebrow {
  margin-top: 20px;
}

.cc-comp .cc-archive__title {
  margin-top: 18px;
}

.cc-comp .cc-archive__desc {
  margin-top: 16px;
}

.cc-comp .cc-archive__inner {
  max-width: var(--cc-container);
  margin: 0 auto;
  padding: 56px 32px 24px;
}

.cc-comp .cc-archive__empty {
  text-align: center;
  color: var(--cc-body);
}

/* ---- Grid de tarjetas de post (misma card que cc_related / cc_blog) ------ */
.cc-comp .cc-pgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.cc-comp .cc-pcard {
  min-width: 0;
}

.cc-comp .cc-pcard__media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--cc-radius-sm);
  background: #E9FAF3;
}

.cc-comp .cc-pcard__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.cc-comp .cc-pcard__media:hover img {
  transform: scale(1.025);
}

.cc-comp .cc-pcard__media--ph {
  background: #D9D9D9;
}

.cc-comp .cc-pcard__ph {
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
}

.cc-comp .cc-pcard__body {
  padding-top: 24px;
}

.cc-comp .cc-pcard__cat {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--cc-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
}

.cc-comp .cc-pcard__cat:hover {
  text-decoration: underline;
}

.cc-comp .cc-pcard__title {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 58px;
  color: var(--cc-ink);
  font-family: 'Figtree', sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 29px;
}

.cc-comp .cc-pcard__title a {
  color: inherit;
  text-decoration: none;
}

.cc-comp .cc-pcard__title a:hover,
.cc-comp .cc-pcard__title a:focus {
  color: var(--cc-green);
}

.cc-comp .cc-pcard__excerpt {
  margin: 14px 0 0;
  min-height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cc-comp .cc-pcard__date {
  display: block;
  margin-top: 12px;
  color: var(--cc-body);
}

/* ---- Paginación ---------------------------------------------------------- */
.cc-comp .cc-pag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.cc-comp .cc-pag .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #E4DED6;
  border-radius: 999px;
  color: var(--cc-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.cc-comp .cc-pag a.page-numbers:hover {
  border-color: var(--cc-green);
  color: var(--cc-green);
}

.cc-comp .cc-pag .page-numbers.current {
  background: var(--cc-green);
  border-color: var(--cc-green);
  color: var(--cc-white);
}

.cc-comp .cc-pag .page-numbers.dots {
  border-color: transparent;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
  .cc-comp .cc-single__body {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cc-comp .cc-single__sticky {
    position: static;
  }

  /* En una sola columna el índice auto estorba: solo dejamos la newsletter. */
  .cc-comp .cc-single__body .cc-toc-auto {
    display: none;
  }
}

@media (max-width: 900px) {
  .cc-comp .cc-pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .cc-comp .cc-single__head,
  .cc-comp .cc-archive__head {
    padding-left: 24px;
    padding-right: 24px;
  }

  .cc-comp .cc-single__feat-wrap,
  .cc-comp .cc-single__body,
  .cc-comp .cc-archive__inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .cc-comp .cc-article {
    font-size: 17px;
    line-height: 28px;
  }

  .cc-comp .cc-article h2 {
    font-size: 28px;
    line-height: 34px;
  }
}

@media (max-width: 560px) {
  .cc-comp .cc-pgrid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
