/* ============================================================
   GHDROL - Design Tokens (GHMUSCLE)
   Paleta extraída do rótulo · Preto absoluto + Ouro metálico
   ============================================================ */

:root {
  /* ---- PRETOS ---------------------------------------------- */
  --ghd-ink-900: #070707;  /* fundo absoluto        */
  --ghd-ink-800: #0E0E0F;  /* superfície base       */
  --ghd-ink-700: #161617;  /* cartões               */
  --ghd-ink-600: #1F1F21;  /* rótulo / charcoal     */
  --ghd-ink-500: #2B2B2E;  /* tampa / bordas        */

  /* ---- OURO ------------------------------------------------ */
  --ghd-gold-100: #FFE9A8; /* tint / highlight      */
  --ghd-gold-200: #FFD154; /* brilho metálico       */
  --ghd-gold-300: #E8B73C; /* ouro vivo             */
  --ghd-gold-400: #C2A155; /* NÚCLEO · cor da marca */
  --ghd-gold-500: #A07E33; /* ouro profundo         */
  --ghd-gold-600: #6E531F; /* bronze / sombra       */

  /* ---- NEUTROS --------------------------------------------- */
  --ghd-bone: #EDE9E0;     /* texto sobre preto     */
  --ghd-ash:  #8C887F;     /* texto secundário      */

  /* ---- PAPÉIS SEMÂNTICOS (use estes nos componentes) ------- */
  --ghd-bg:            var(--ghd-ink-900);
  --ghd-surface:       var(--ghd-ink-700);
  --ghd-surface-alt:   var(--ghd-ink-600);
  --ghd-border:        rgba(194, 161, 85, 0.18);
  --ghd-brand:         var(--ghd-gold-400);
  --ghd-brand-hover:   var(--ghd-gold-300);
  --ghd-text:          var(--ghd-bone);
  --ghd-text-muted:    var(--ghd-ash);
  --ghd-on-gold:       var(--ghd-ink-900);

  /* ---- GRADIENTE DE OURO (títulos / destaques) ------------- */
  --ghd-gold-grad: linear-gradient(180deg,
                     var(--ghd-gold-200) 0%,
                     var(--ghd-gold-400) 48%,
                     var(--ghd-gold-600) 100%);

  /* ---- FAIXA HAZARD (elemento de assinatura) -------------- */
  --ghd-hazard: repeating-linear-gradient(135deg,
                 var(--ghd-gold-400) 0 22px,
                 var(--ghd-ink-900) 22px 44px);
}

/* ============================================================
   HELPERS
   ============================================================ */

.ghd-gold-text {
  background: var(--ghd-gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  text-transform: uppercase;
}

.ghd-hazard {
  background: var(--ghd-hazard);
  height: 14px;
  width: 100%;
}

.ghd-btn {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ghd-on-gold);
  background: var(--ghd-brand);
  border: 0;
  padding: 14px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ghd-btn:hover { background: var(--ghd-brand-hover); }

.ghd-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: var(--ghd-brand);
}

.ghd-card {
  background: var(--ghd-surface);
  border: 1px solid var(--ghd-border);
  border-radius: 4px;
}

/* ============================================================
   COMPONENTE: PAINEL NUTRICIONAL (.ghd-panel)
   ============================================================ */

.ghd-panel {
  width: 100%;
  max-width: 560px;
  background: var(--ghd-ink-800);
  border: 1px solid var(--ghd-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

.ghd-panel__head {
  padding: 30px 34px 24px;
}

.ghd-panel__eyebrow {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ghd-brand);
  margin-bottom: 12px;
}

.ghd-panel__title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 38px;
  line-height: 0.92;
  letter-spacing: 0.01em;
  background: var(--ghd-gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ghd-panel__serving {
  margin-top: 16px;
  display: flex;
  border: 1px solid var(--ghd-border);
  border-radius: 4px;
  overflow: hidden;
}

.ghd-panel__serving-item {
  flex: 1;
  padding: 12px 16px;
}

.ghd-panel__serving-item + .ghd-panel__serving-item {
  border-left: 1px solid var(--ghd-border);
}

.ghd-panel__serving-key {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghd-text-muted);
  margin-bottom: 5px;
}

.ghd-panel__serving-val {
  font-weight: 600;
  font-size: 20px;
  color: var(--ghd-bone);
}

.ghd-panel__foot {
  padding: 20px 34px 30px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ghd-text-muted);
}

.ghd-panel__foot-note {
  color: var(--ghd-brand);
  font-size: 10px;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ============================================================
   COMPONENTE: TABELA NUTRICIONAL (.ghd-table)
   ============================================================ */

.ghd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.ghd-table thead th {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ghd-ink-900);
  background: var(--ghd-gold-400);
  font-weight: 600;
  padding: 10px 34px;
  text-align: right;
}

.ghd-table thead th:first-child {
  text-align: left;
}

.ghd-table tbody td {
  padding: 12px 34px;
  border-bottom: 1px solid var(--ghd-border);
  text-align: right;
}

.ghd-table tbody td:first-child {
  text-align: left;
  color: var(--ghd-bone);
  font-weight: 500;
}

.ghd-table tbody td .ghd-unit {
  color: var(--ghd-text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 3px;
}

.ghd-table tbody td.ghd-val {
  color: var(--ghd-gold-200);
  font-weight: 500;
}

.ghd-table tbody td.ghd-vd {
  color: var(--ghd-bone);
}

.ghd-table tbody td.ghd-vd--dash {
  color: var(--ghd-ink-500);
}

.ghd-table tbody tr:hover {
  background: var(--ghd-ink-700);
}

.ghd-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ============================================================
   OVERRIDE: TABELAS DE CONTEÚDO EDITORIAL
   Substitui o estilo padrão do Kadence em posts/páginas
   ============================================================ */

.entry-content table,
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--ghd-ink-800);
  border: 1px solid var(--ghd-border);
  border-radius: 4px;
  overflow: hidden;
}

/* thead recebe faixa hazard (12px) no topo + ouro sólido embaixo via background em camadas */
.entry-content table thead,
.wp-block-table table thead {
  background:
    repeating-linear-gradient(135deg, var(--ghd-gold-400) 0 18px, var(--ghd-ink-900) 18px 36px) top / 100% 12px no-repeat,
    var(--ghd-gold-400);
}

.entry-content table thead th,
.wp-block-table table thead th {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ghd-ink-900);
  background: transparent;
  font-weight: 600;
  padding: 22px 34px 10px;
  text-align: right;
  border: 0;
}

.entry-content table thead th:first-child,
.wp-block-table table thead th:first-child {
  text-align: left;
}

.entry-content table tbody td,
.wp-block-table table tbody td {
  padding: 12px 34px;
  border: 0;
  border-bottom: 1px solid var(--ghd-border);
  text-align: right;
  color: var(--ghd-gold-200);
  font-weight: 500;
}

.entry-content table tbody td:first-child,
.wp-block-table table tbody td:first-child {
  text-align: left;
  color: var(--ghd-bone);
  font-weight: 500;
}

.entry-content table tbody tr:hover,
.wp-block-table table tbody tr:hover {
  background: var(--ghd-ink-700);
}

.entry-content table tbody tr:last-child td,
.wp-block-table table tbody tr:last-child td {
  border-bottom: 0;
}

.entry-content table tfoot td,
.wp-block-table table tfoot td {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ghd-text-muted);
  padding: 12px 34px;
  border-top: 1px solid var(--ghd-border);
}


/* ============================================================
   COMPONENTE: TABLE OF CONTENTS (.ghd-toc)
   ============================================================ */

.ghd-toc {
  width: 100%;
  background: var(--ghd-ink-800);
  border: 1px solid var(--ghd-border);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 2rem;
}

.ghd-toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--ghd-ink-700);
  border-bottom: 1px solid var(--ghd-border);
}

.ghd-toc__title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: var(--ghd-gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ghd-toc__toggle {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--ghd-border);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ghd-brand);
  font-size: 14px;
  padding: 0;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.ghd-toc__toggle::before {
  content: '▾';
  display: block;
  transition: transform 0.2s ease;
}
.ghd-toc__toggle:hover { background: rgba(194,161,85,.12); }
.ghd-toc--collapsed .ghd-toc__toggle::before { transform: rotate(-90deg); }

.ghd-toc__list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  max-height: 600px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.ghd-toc--collapsed .ghd-toc__list {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.ghd-toc__item { margin: 0; }

.ghd-toc__link {
  display: block;
  padding: 8px 20px;
  font-size: 0.78rem;
  color: var(--ghd-bone);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.ghd-toc__link:hover {
  color: var(--ghd-gold-200);
  background: var(--ghd-ink-700);
  border-left-color: var(--ghd-border);
  text-decoration: none;
}

.ghd-toc__item--active > .ghd-toc__link {
  color: var(--ghd-gold-300);
  border-left-color: var(--ghd-gold-400);
  background: rgba(194, 161, 85, 0.06);
}

/* ============================================================
   COMPONENTE: BACK TO TOP (.ghd-back-top)
   ============================================================ */

.ghd-back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--ghd-ink-700);
  border: 1px solid var(--ghd-border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ghd-brand);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s ease;
  z-index: 200;
  padding: 0;
}

.ghd-back-top::before {
  content: '▲';
  font-size: 14px;
  line-height: 1;
}

.ghd-back-top--visible {
  opacity: 1;
  visibility: visible;
}

.ghd-back-top:hover {
  background: var(--ghd-ink-600);
  border-color: var(--ghd-gold-400);
}

/* ============================================================
   COMPONENTE: BOTÃO CTA (.ghd-cta)
   ============================================================ */

.ghd-cta {
  display: flex;
  width: fit-content;
  margin-inline: auto;
  align-items: center;
  gap: 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  color: var(--ghd-bone);
  background: linear-gradient(180deg, var(--ghd-ink-700) 0%, var(--ghd-ink-900) 100%);
  padding: 15px 40px 15px 38px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 0 0 1px rgba(194, 161, 85, .28),
    0 10px 26px -12px rgba(7, 7, 7, .6),
    0 2px 0 #000;
  transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
  text-decoration: none;
}

.ghd-cta::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ghd-gold-200), var(--ghd-gold-400) 55%, var(--ghd-gold-600));
}

.ghd-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px rgba(194, 161, 85, .5),
    0 16px 32px -12px rgba(7, 7, 7, .65),
    0 3px 0 #000;
}

.ghd-cta:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    inset 0 0 0 1px rgba(194, 161, 85, .4),
    0 5px 16px -10px rgba(7, 7, 7, .5),
    0 0 0 #000;
}

.ghd-cta:focus-visible {
  outline: 2px solid var(--ghd-gold-400);
  outline-offset: 3px;
}

.ghd-cta .lbl {
  background: linear-gradient(180deg, var(--ghd-gold-100), var(--ghd-gold-300) 60%, var(--ghd-gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ghd-cta .ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ghd-gold-300);
}

.ghd-cta .arrow {
  margin-left: 4px;
  width: 18px;
  height: 18px;
  color: var(--ghd-gold-300);
  transition: transform .25s ease;
}

.ghd-cta:hover .arrow { transform: translateX(4px); }

/* --- Tamanhos --- */
.ghd-cta.lg {
  font-size: 18px;
  padding: 15px 40px 15px 38px;
  gap: 16px;
}
.ghd-cta.lg .arrow { width: 22px; height: 22px; }

.ghd-cta.sm {
  font-size: 13px;
  padding: 13px 24px 13px 26px;
  letter-spacing: .1em;
}
.ghd-cta.sm .arrow { width: 15px; height: 15px; }

/* --- Variante: stacked --- */
.ghd-cta.stacked .txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.1;
  text-align: left;
}
.ghd-cta.stacked .txt .lab {
  font-size: 9px;
  letter-spacing: .32em;
  font-weight: 600;
  color: var(--ghd-gold-500);
}
.ghd-cta.stacked .txt .ttl { font-size: 17px; letter-spacing: .06em; }
.ghd-cta.stacked.lg .txt .ttl { font-size: 20px; }
.ghd-cta.stacked.lg .txt .lab { font-size: 10px; }

/* --- Variante: solid --- */
.ghd-cta.solid {
  background: var(--ghd-ink-900);
  padding-left: 30px;
}
.ghd-cta.solid::before { display: none; }

/* --- Variante: outline --- */
.ghd-cta.outline {
  background: transparent;
  color: var(--ghd-ink-900);
  border: 1.5px solid var(--ghd-ink-900);
  box-shadow: none;
  padding-left: 30px;
}
.ghd-cta.outline::before { display: none; }
.ghd-cta.outline .lbl {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--ghd-ink-900);
}
.ghd-cta.outline .arrow { color: var(--ghd-gold-500); }
.ghd-cta.outline:hover {
  background: var(--ghd-ink-900);
  color: var(--ghd-bone);
  box-shadow: 0 12px 26px -12px rgba(7, 7, 7, .5);
}
.ghd-cta.outline:hover .lbl { color: var(--ghd-bone); }

/* --- Variante: ghost --- */
.ghd-cta.ghost {
  background: transparent;
  color: var(--ghd-ink-900);
  padding: 14px 18px;
  box-shadow: none;
}
.ghd-cta.ghost::before { display: none; }
.ghd-cta.ghost .lbl { background: none; color: var(--ghd-ink-900); }
.ghd-cta.ghost .arrow { color: var(--ghd-gold-500); }
.ghd-cta.ghost:hover {
  color: #000;
  background: rgba(7, 7, 7, .05);
  box-shadow: none;
}

/* --- Variante: block --- */
.ghd-cta.block {
  width: 100%;
  margin-inline: 0;
  justify-content: flex-start;
}

/* --- Alinhamento: centralizado (wrapper do bloco Gutenberg) --- */
.wp-block-ghdrol-cta {
  display: flex;
  justify-content: center;
}

/* ============================================================
   COMPONENTE: CREDENCIAIS DO ARTIGO (.ghdrol-credentials)
   Exibido no meta do cabeçalho de posts — revisão clínica e autor
   ============================================================ */

.ghdrol-credentials {
  flex-basis: 100%;
  width: 100%;
  margin-top: 0.5em;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ghdrol-revisao-clinica {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25em;
}

.ghdrol-credentials .credentials-label {
  font-size: 0.82rem;
  color: var(--ghd-text-muted, #8C887F);
  white-space: nowrap;
}

.ghdrol-credentials .revisor-nome {
  color: inherit;
  font-weight: 500;
}

.ghdrol-credentials .revisor-credenciais {
  font-size: 0.82rem;
  color: var(--ghd-text-muted, #8C887F);
}

.ghdrol-credentials .revisor-credenciais::before {
  content: '|';
  margin-right: 0.25em;
  opacity: 0.5;
}
