/**
 * CTAs Google — Fontes preferidas + Google Notícias.
 *
 * Post: os dois CTAs entram na MESMA linha/flex dos compartilhamentos.
 * Rodapé: bloco compacto, sem fundo branco.
 */

.cdg-google-follow-cta {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cdg-google-follow-cta .cdg-google-follow-cta__button {
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
  text-decoration: none !important;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--primary,
.cdg-google-follow-cta .cdg-google-follow-cta__button--primary:visited {
  border: 1px solid #0b57d0;
  background: #0b57d0;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(11, 87, 208, .16);
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--primary > span:last-child,
.cdg-google-follow-cta .cdg-google-follow-cta__button--primary:visited > span:last-child {
  color: #fff !important;
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--primary:hover,
.cdg-google-follow-cta .cdg-google-follow-cta__button--primary:focus-visible {
  background: #0847ad;
  border-color: #0847ad;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 87, 208, .20);
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--news,
.cdg-google-follow-cta .cdg-google-follow-cta__button--news:visited {
  border: 1px solid #cfd8e3;
  background: #fff;
  color: #1f1f1f !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--news > span:last-child,
.cdg-google-follow-cta .cdg-google-follow-cta__button--news:visited > span:last-child {
  color: #1f1f1f !important;
}

.cdg-google-follow-cta .cdg-google-follow-cta__button--news:hover,
.cdg-google-follow-cta .cdg-google-follow-cta__button--news:focus-visible {
  border-color: #aebed0;
  background: #f4f8fd;
  color: #1f1f1f !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
}

.cdg-google-follow-cta .cdg-google-follow-cta__button:focus-visible {
  outline: 3px solid rgba(66, 133, 244, .25);
  outline-offset: 2px;
}

/* G multicolorido — protegido contra regras globais do tema para SVG/path. */
.cdg-google-follow-cta__google-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}

.cdg-google-follow-cta__google-mark svg {
  display: block;
  width: 19px;
  height: 19px;
}

.cdg-google-follow-cta__google-mark svg path:nth-child(1) { fill: #4285F4 !important; }
.cdg-google-follow-cta__google-mark svg path:nth-child(2) { fill: #34A853 !important; }
.cdg-google-follow-cta__google-mark svg path:nth-child(3) { fill: #FBBC05 !important; }
.cdg-google-follow-cta__google-mark svg path:nth-child(4) { fill: #EA4335 !important; }

.cdg-google-follow-cta__news-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
}

.cdg-google-follow-cta__news-mark svg {
  display: block;
  width: 21px;
  height: 21px;
}

/*
 * POSTS — mesma linha dos botões sociais.
 * O container .share-buttons já é flex/wrap no tema-pai; o CTA entra como
 * último item, depois dos quatro botões sociais.
 */
body.single-post .share-buttons-improved,
body.single-post .share-buttons {
  align-items: center;
}

body.single-post .share-buttons-improved > .cdg-google-follow-cta,
body.single-post .share-buttons > .cdg-google-follow-cta {
  flex: 0 1 auto;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.single-post .share-buttons-improved > .cdg-google-follow-cta .cdg-google-follow-cta__button,
body.single-post .share-buttons > .cdg-google-follow-cta .cdg-google-follow-cta__button {
  min-height: 44px;
}

/* Os fallbacks fora de .share-buttons continuam legíveis sem JS. */
body.single-post article.single-layout > .cdg-google-follow-cta--post-top,
body.single-post article.single-layout > .cdg-google-follow-cta--post-bottom {
  width: min(100%, 760px);
  margin: 14px 0;
  padding: 8px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #f8fbff;
}

/*
 * RODAPÉ GLOBAL — sem o fundo branco que envolvia os botões.
 * O botão Google Notícias também fica transparente para integrar ao footer.
 */
.cdg-google-follow-site-footer {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, .22);
  background: transparent;
}

.cdg-google-follow-site-footer__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.cdg-google-follow-site-footer__title {
  display: block;
  margin: 0;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.cdg-google-follow-site-footer .cdg-google-follow-cta {
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.cdg-google-follow-site-footer .cdg-google-follow-cta__button {
  min-height: 36px;
  padding: 6px 10px;
  gap: 6px;
  font-size: .75rem;
  box-shadow: none;
}

.cdg-google-follow-site-footer .cdg-google-follow-cta__google-mark {
  width: 20px;
  height: 20px;
}

.cdg-google-follow-site-footer .cdg-google-follow-cta__google-mark svg {
  width: 17px;
  height: 17px;
}

.cdg-google-follow-site-footer .cdg-google-follow-cta__news-mark,
.cdg-google-follow-site-footer .cdg-google-follow-cta__news-mark svg {
  width: 18px;
  height: 18px;
}

/* Remove especificamente o fundo branco do botão Google Notícias no footer. */
footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news,
footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news:visited {
  background: transparent !important;
  border-color: rgba(148, 163, 184, .48);
  color: inherit !important;
}

footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news > span:last-child,
footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news:visited > span:last-child {
  color: inherit !important;
}

footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news:hover,
footer#site-footer .cdg-google-follow-site-footer .cdg-google-follow-cta__button--news:focus-visible {
  background: rgba(148, 163, 184, .10) !important;
  color: inherit !important;
}

footer#site-footer .cdg-google-follow-site-footer__title {
  color: inherit;
}

/*
 * MOBILE
 * Continua dentro do mesmo container de compartilhamento. Como seis ações
 * não cabem em celulares estreitos, o flex-wrap do tema quebra a linha de
 * forma natural, sem overflow. Os dois CTAs ficam juntos quando possível.
 */
@media (max-width: 680px) {
  body.single-post .share-buttons-improved > .cdg-google-follow-cta,
  body.single-post .share-buttons > .cdg-google-follow-cta {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr);
    gap: 7px;
    margin-top: 2px;
  }

  body.single-post .share-buttons-improved > .cdg-google-follow-cta .cdg-google-follow-cta__button,
  body.single-post .share-buttons > .cdg-google-follow-cta .cdg-google-follow-cta__button {
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    font-size: .78rem;
  }

  .cdg-google-follow-site-footer {
    padding: 9px 0;
  }

  .cdg-google-follow-site-footer__inner {
    gap: 8px;
  }

  .cdg-google-follow-site-footer__title {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .cdg-google-follow-site-footer .cdg-google-follow-cta {
    width: 100%;
    justify-content: center;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  body.single-post .share-buttons-improved > .cdg-google-follow-cta,
  body.single-post .share-buttons > .cdg-google-follow-cta {
    grid-template-columns: 1fr 1fr;
  }

  .cdg-google-follow-site-footer .cdg-google-follow-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cdg-google-follow-site-footer .cdg-google-follow-cta__button {
    width: 100%;
    padding-inline: 7px;
  }
}

@media (max-width: 340px) {
  body.single-post .share-buttons-improved > .cdg-google-follow-cta,
  body.single-post .share-buttons > .cdg-google-follow-cta,
  .cdg-google-follow-site-footer .cdg-google-follow-cta {
    grid-template-columns: 1fr;
  }
}



/*
 * MOBILE — estabiliza os quatro botões sociais como círculos.
 *
 * O tema-pai possui regras responsivas antigas que, em alguns viewports de
 * iPhone/Safari, transformam .share-buttons em grid e fazem cada .share-button
 * ocupar a coluna inteira. Como os CTAs Google também entram nesse container,
 * neutralizamos apenas os quatro botões sociais originais no mobile.
 */
@media (max-width: 680px) {
  body.single-post .share-buttons-improved,
  body.single-post .share-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    gap: 10px !important;
  }

  body.single-post .share-buttons-improved > .share-button:not(.share-google-news),
  body.single-post .share-buttons > .share-button:not(.share-google-news) {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
  }

  body.single-post .share-buttons-improved > .share-button:not(.share-google-news) svg,
  body.single-post .share-buttons > .share-button:not(.share-google-news) svg {
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    min-height: 19px !important;
    margin: 0 !important;
  }

  body.single-post .share-buttons-improved > .share-button:not(.share-google-news) .share-label,
  body.single-post .share-buttons > .share-button:not(.share-google-news) .share-label {
    display: none !important;
  }

  /* Os dois CTAs Google ocupam a linha seguinte apenas quando necessário. */
  body.single-post .share-buttons-improved > .cdg-google-follow-cta,
  body.single-post .share-buttons > .cdg-google-follow-cta {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 380px) {
  body.single-post .share-buttons-improved > .share-button:not(.share-google-news),
  body.single-post .share-buttons > .share-button:not(.share-google-news) {
    flex-basis: 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cdg-google-follow-cta .cdg-google-follow-cta__button {
    transition: none;
  }
}
