/*
Theme Name:        Track Consagração
Theme URI:         https://legendarios.com.br/
Author:            Sergio
Author URI:        https://legendarios.com.br/
Description:       Tema oficial do movimento Legendários — Track Consagração. Design dark-first com CTA laranja, inspirado em loslegendarios.org. Compatível com os plugins Certificação Consagração e Legendários Álbuns.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.7
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       track-consagracao
Tags:              dark, custom-menu, featured-images, full-width-template, translation-ready, block-patterns
*/

/* =============================================================================
   1. Design Tokens
   ========================================================================== */
:root {
  /* Cores — marca */
  --color-brand:         #E97B00;
  --color-brand-light:   #FF9A2B;
  --color-brand-dark:    #B85D00;

  /* Cores — fundos (dark-first) */
  --color-bg-primary:    #111111;
  --color-bg-card:       #1A1A1A;
  --color-bg-surface:    #222222;
  --color-bg-elevated:   #2A2A2A;
  --color-border:        #333333;
  --color-border-soft:   rgba(255, 255, 255, 0.08);

  /* Cores — texto */
  --color-text-white:    #FFFFFF;
  --color-text-body:     rgba(255, 255, 255, 0.8);
  --color-text-muted:    rgba(255, 255, 255, 0.6);
  --color-text-faint:    rgba(255, 255, 255, 0.35);

  /* Cores — feedback */
  --color-success:       #3FB950;
  --color-warning:       #D29922;
  --color-danger:        #F85149;

  /* Tipografia */
  --font-base:           'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-hero:             clamp(2.25rem, 2vw + 1.75rem, 3.25rem);
  --fs-section:          clamp(1.75rem, 1vw + 1.5rem, 2.25rem);
  --fs-eyebrow:          0.75rem;
  --fs-body:             1rem;
  --fs-small:            0.875rem;
  --fs-xs:               0.8125rem;

  /* Espaçamento e layout */
  --container-max:       1200px;
  --container-pad:       24px;
  --section-py:          96px;
  --gap-grid:            24px;

  /* Raios e sombras */
  --radius-sm:           6px;
  --radius-md:           10px;
  --radius-lg:           14px;
  --radius-pill:         999px;

  --shadow-card:         0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg:           0 16px 48px rgba(0, 0, 0, 0.35);
  --shadow-brand:        0 8px 24px rgba(233, 123, 0, 0.25);

  /* Motion */
  --ease-out:            cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out:         cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:            150ms;
  --dur-base:            220ms;
  --dur-slow:            400ms;

  /* Layout fixo */
  --header-h:            72px;
  --z-header:            100;
  --z-modal:             1000;
}

@media (max-width: 768px) {
  :root {
    --section-py:        64px;
    --header-h:          64px;
  }
}

/* =============================================================================
   2. Reset e base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-body);
  background: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; padding: 0; }

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-brand-light); }
a:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1rem; }

::selection {
  background: var(--color-brand);
  color: #fff;
}

hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* =============================================================================
   3. Tipografia
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  color: var(--color-text-white);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-hero); line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-section); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 3px solid var(--color-brand);
  font-style: italic;
  color: var(--color-text-body);
}

code {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 0.9em;
  background: var(--color-bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--color-brand-light);
}

pre {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: transparent; padding: 0; color: inherit; }

/* =============================================================================
   4. Layout — container, grid, section
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--narrow { max-width: 760px; }
.container--wide { max-width: 1360px; }

.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.section--tight { padding-top: 48px; padding-bottom: 48px; }

.section--surface { background: var(--color-bg-card); }

.grid {
  display: grid;
  gap: var(--gap-grid);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto-fit { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* =============================================================================
   5. Botões
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}
.btn--primary:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-light);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn--secondary {
  background: transparent;
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn--secondary:hover {
  background: var(--color-brand);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-white);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  background: var(--color-bg-surface);
  border-color: var(--color-text-muted);
}

.btn--sm { padding: 8px 18px; font-size: 0.8125rem; }
.btn--lg { padding: 16px 36px; font-size: 0.9375rem; }
.btn--full { width: 100%; }

/* =============================================================================
   6. Badges / Chips
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.badge--brand { background: var(--color-brand); color: #fff; }
.badge--outline { background: transparent; color: var(--color-brand); border: 1px solid var(--color-brand); }
.badge--muted { background: var(--color-bg-elevated); color: var(--color-text-muted); }

/* Badge de data (usado em cards de TOPs, lives, etc.) */
.badge-date {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 10px;
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  line-height: 1;
}
.badge-date__month { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; }
.badge-date__day { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }

/* =============================================================================
   7. Cards
   ========================================================================== */
.card {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.card:hover {
  border-color: var(--color-border-soft);
}

.card--hover:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 123, 0, 0.35);
}

.card--media {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card--media .card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-surface);
  overflow: hidden;
}

.card--media .card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card--media:hover .card__media img { transform: scale(1.04); }

.card--media .card__body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.card__title {
  color: var(--color-text-white);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.card__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Card de depoimento */
.card-testimonial {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-testimonial__quote {
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.card-testimonial__person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.card-testimonial__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  object-fit: cover;
  flex-shrink: 0;
}

.card-testimonial__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-brand);
  line-height: 1.2;
}

.card-testimonial__role {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  line-height: 1.2;
  margin-top: 2px;
}

/* =============================================================================
   8. Formulários
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-body);
  letter-spacing: 0.02em;
}

.field__control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-white);
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

input::placeholder, textarea::placeholder { color: var(--color-text-faint); }

input:focus, select:focus, textarea:focus,
.field__control:focus {
  outline: none;
  border-color: var(--color-brand);
  background: var(--color-bg-surface);
}

textarea { min-height: 120px; resize: vertical; }

.field__error {
  color: var(--color-danger);
  font-size: var(--fs-xs);
  margin-top: 4px;
}

.field__hint {
  color: var(--color-text-faint);
  font-size: var(--fs-xs);
  margin-top: 4px;
}

/* =============================================================================
   9. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--header-h);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--color-text-white);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.site-header__brand img {
  max-height: 40px;
  width: auto;
}

.site-header__brand:hover { color: var(--color-text-white); }

.site-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-menu a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--color-text-body);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-parent > a {
  color: var(--color-text-white);
  background: var(--color-bg-surface);
}

.site-header__cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.site-header__hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text-white);
  align-items: center;
  justify-content: center;
  position: relative;
}

.site-header__hamburger span {
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              top var(--dur-base) var(--ease-out);
}
.site-header__hamburger span:nth-child(1) { top: 14px; }
.site-header__hamburger span:nth-child(2) { top: 19px; }
.site-header__hamburger span:nth-child(3) { top: 24px; }

.site-header.is-menu-open .site-header__hamburger span:nth-child(1) {
  top: 19px; transform: rotate(45deg);
}
.site-header.is-menu-open .site-header__hamburger span:nth-child(2) { opacity: 0; }
.site-header.is-menu-open .site-header__hamburger span:nth-child(3) {
  top: 19px; transform: rotate(-45deg);
}

@media (max-width: 960px) {
  .site-header__nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px var(--container-pad);
    transform: translateX(100%);
    transition: transform var(--dur-base) var(--ease-out);
    overflow-y: auto;
  }
  .site-header.is-menu-open .site-header__nav { transform: translateX(0); }
  .primary-menu { flex-direction: column; align-items: stretch; width: 100%; gap: 2px; }
  .primary-menu a { padding: 14px 16px; font-size: 1rem; border-radius: var(--radius-md); }
  .site-header__hamburger { display: inline-flex; }
  .site-header__cta .btn { padding: 8px 18px; font-size: 0.8125rem; }
  .site-header__cta .btn span.cta-label-long { display: none; }
}

/* =============================================================================
   10. Footer — versão laranja (identidade forte de marca)
   ========================================================================== */
.site-footer {
  background: var(--color-brand);
  color: #111;
  padding: 72px 0 28px;
  margin-top: auto;
}

.site-footer a { color: #111; }
.site-footer a:hover { color: #fff; }

.site-footer__masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  flex-wrap: wrap;
}

.site-footer__brand { max-width: 420px; color: #111; }
.site-footer__brand img { max-height: 46px; margin-bottom: 14px; filter: brightness(0); }
.site-footer__logo-text {
  display: inline-block;
  color: #111;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.site-footer__tagline {
  color: rgba(0, 0, 0, 0.72);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 500px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .site-footer__masthead { flex-direction: column; align-items: flex-start; gap: 20px; }
}

.site-footer__col-title {
  color: #111;
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 16px;
}

.site-footer ul.menu li { margin-bottom: 10px; }

.site-footer ul.menu a {
  color: #111;
  font-size: 0.9375rem;
  font-weight: 500;
}

.site-footer ul.menu a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.site-footer__social {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.site-footer__social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  color: var(--color-brand);
  background: #111;
  transition: background var(--dur-fast) var(--ease-out);
}

.site-footer__social a:hover { background: #fff; color: var(--color-brand); }

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.18);
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.8125rem;
  flex-wrap: wrap;
}

.site-footer__bottom a { color: rgba(0, 0, 0, 0.7); }
.site-footer__bottom a:hover { color: #111; }

/* =============================================================================
   11. Main (wrapper de conteúdo)
   ========================================================================== */
.site-main { min-height: calc(100vh - var(--header-h)); }

body { display: flex; flex-direction: column; min-height: 100vh; }

/* =============================================================================
   12. Utilitários
   ========================================================================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-faint  { color: var(--color-text-faint); }
.text-brand  { color: var(--color-brand); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Skip link de acessibilidade */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--color-brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: var(--z-modal);
}
.skip-link:focus { left: 8px; color: #fff; }

/* Reveal-on-scroll (hook opcional pro JS) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================================
   13. Integração com plugins (hooks visuais condicionais)
   ========================================================================== */

/* Quando o plugin Certificação ativa body.cc-fullpage numa URL /live/{slug},
   garantimos que nada do tema vaze — o próprio plugin já esconde .site-header
   e .site-footer, mas deixamos explícito aqui para reforço de especificidade. */
body.cc-fullpage .site-header,
body.cc-fullpage .site-footer {
  display: none !important;
}

body.cc-fullpage .site-main { min-height: 100vh; }

/* body.has-albuns / body.has-certificacao são injetadas pelo functions.php
   quando cada plugin está ativo — ficam disponíveis para CSS condicional
   futuro sem custo agora. */

/* =============================================================================
   14. Estilos base para conteúdo do editor (post/página sem template custom)
   ========================================================================== */
.entry-content > * + * { margin-top: 1.25rem; }

.entry-content img,
.entry-content figure { border-radius: var(--radius-md); }

.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.entry-content table th,
.entry-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.entry-content table th {
  color: var(--color-text-white);
  font-weight: 600;
}

.entry-content table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
