/*
Theme Name: Mecanismos Digitais
Theme URI: https://mecanismosdigitais.com.br
Author: Mecanismos Digitais
Description: Tema próprio do portal Mecanismos Digitais. Episódios como posts, tema como categoria, capa como imagem destacada.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mecanismos
*/

/* Layout · portal escuro com grade técnica · uma faixa inclinada · grade de cartões grandes · trilho de episódios · blocos claros intercalados */
:root {
  --navy: #1A1D52; --ink: #0E1133; --deep: #151A4A; --yellow: #FFC53D; --yellow-d: #D99A12;
  --coral: #FF6B57; --teal: #3DD6C4; --paper: #F4F6FF; --mist: #C9CEE8; --line: rgba(255,255,255,.08);
  --text: #FFFFFF; --muted: rgba(255,255,255,.72); --on-paper: #1A1D52; --on-paper-muted: #4A4F80;
  --display: "B612", "Trebuchet MS", system-ui, sans-serif; --body: "B612", "Segoe UI", system-ui, sans-serif; --mono: "B612 Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.grid-bg { background-color: var(--deep); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; line-height: .98; margin: 0; text-wrap: balance; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
.screen-reader-text { position: absolute !important; left: -9999px; }

/* barra de aviso */
.topbar { background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 14px; text-align: center; padding: 9px 16px; }
.topbar a { text-decoration: underline; text-underline-offset: 3px; }

/* cabeçalho */
header.site { position: sticky; top: 0; z-index: 40; background: rgba(14,17,51,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-bar header.site { top: 32px; }
.nav { display: flex; align-items: center; gap: 20px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.cats { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.cats a:hover { color: var(--text); background: var(--line); }
.biz { display: flex; gap: 8px; align-items: center; }
.tab { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1.5px solid rgba(255,255,255,.22); white-space: nowrap; }
.tab:hover { border-color: var(--teal); color: var(--teal); }
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer; }
.btn-y { background: var(--yellow); color: var(--navy); box-shadow: 0 6px 0 var(--yellow-d); }
.btn-y:hover { transform: translateY(-1px); }
.btn-sm { padding: 10px 16px; font-size: 13px; box-shadow: 0 4px 0 var(--yellow-d); }
.btn-ghost { background: transparent; color: var(--text); border: 2px solid rgba(255,255,255,.35); }
.arrow { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--navy); font-weight: 700; flex: none; }

/* hero */
.hero { position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-block: 64px 72px; }
.hero h1 { font-size: clamp(44px, 7.4vw, 104px); }
.hero h1 .hl { color: var(--yellow); }
.hero p.lead { max-width: 33ch; font-size: 19px; color: var(--muted); margin: 22px 0 30px; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .meta { display: flex; gap: 22px; margin-top: 34px; font-family: var(--mono); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.hero .meta b { color: var(--teal); font-weight: 700; }
.feature { position: relative; justify-self: center; width: min(360px, 100%); }
.feature .phone { border-radius: 34px; padding: 12px; background: #24285E; box-shadow: 0 30px 60px rgba(0,0,0,.45); transform: rotate(4deg); }
.feature .phone img { border-radius: 24px; aspect-ratio: 9/16; object-fit: cover; width: 100%; }
.badge { position: absolute; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: .06em; padding: 8px 14px; border-radius: 10px; }
.feature .b-new { top: 18px; left: -14px; background: var(--coral); color: #fff; transform: rotate(-6deg); }
.feature .b-src { bottom: 38px; right: -18px; background: var(--paper); color: var(--navy); transform: rotate(3deg); font-size: 12px; max-width: 80%; }
.gear-deco { position: absolute; right: -80px; top: -60px; width: 320px; opacity: .08; pointer-events: none; }

/* vídeo de apresentação na primeira dobra */
.hero.has-vsl .wrap { grid-template-columns: .9fr 1.1fr; }
.hero.has-vsl h1 { font-size: clamp(40px, 5.6vw, 86px); }
.vsl { position: relative; border-radius: 28px; overflow: hidden; background: #0B0E2C; box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 0 0 10px #24285E; aspect-ratio: 16 / 9; width: 100%; }
.vsl video { width: 100%; height: 100%; display: block; object-fit: cover; }
.vsl-som { position: absolute; right: 18px; top: 18px; display: inline-flex; align-items: center; gap: 10px; font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .04em; background: var(--yellow); color: var(--navy); border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer; box-shadow: 0 4px 0 var(--yellow-d); }
.vsl-som .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(255,107,87,.3); }
.vsl-som[aria-pressed="true"] .dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(61,214,196,.3); }
@media (max-width: 980px) { .hero.has-vsl .wrap { grid-template-columns: 1fr; } }

/* faixa inclinada */
.ribbons { position: relative; overflow: hidden; z-index: 2; }
.ribbon { position: relative; width: 100%; white-space: nowrap; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 26px; letter-spacing: .04em; padding-block: 12px; overflow: hidden; background: var(--yellow); color: var(--navy); }
.ribbon .track { display: inline-flex; gap: 28px; animation: slide 38s linear infinite; padding-left: 28px; }
.ribbon .star { color: var(--navy); }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ribbon .track { animation: none; } html { scroll-behavior: auto; } }

/* seções */
section { padding-block: 72px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(34px, 5vw, 60px); margin-top: 10px; }
.paper { background: var(--paper); color: var(--on-paper); }
.paper .eyebrow { color: var(--on-paper-muted); }

/* grade de temas */
.bento { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-auto-rows: minmax(210px, auto); gap: 16px; }
.cat { position: relative; border-radius: 26px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: var(--navy); transition: transform .15s; }
.cat:hover { transform: translateY(-3px); }
.cat .top { display: flex; justify-content: space-between; align-items: start; }
.cat img.ic { width: 92px; height: 92px; border-radius: 50%; }
.cat h3 { font-size: 30px; }
.cat p { margin: 6px 0 0; font-size: 15px; max-width: 30ch; opacity: .85; }
.cat:first-child { grid-row: span 2; background: var(--yellow); }
.cat:first-child img.ic { width: 150px; height: 150px; }
.cat:first-child h3 { font-size: 46px; }
.cat:nth-child(2) { background: var(--coral); color: #fff; }
.cat:nth-child(3) { background: var(--teal); }
.cat:nth-child(4) { background: #2A2F72; color: #fff; }
.cat:nth-child(5) { background: var(--paper); }
.cat:nth-child(6) { background: var(--mist); }
.cat:nth-child(n+7) { background: var(--paper); }
/* preenche a grade quando sobra espaço (4 ou 6 temas) */
.cat:nth-child(4):last-child { grid-column: span 2; }
.cat:nth-child(6):last-child { grid-column: span 3; }
.cat .count { font-family: var(--mono); font-size: 13px; margin-top: 10px; opacity: .8; }

/* trilho de episódios */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--body); font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1.5px solid #C9CEDD; background: #fff; color: var(--on-paper); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.rail-wrap { position: relative; margin-top: 26px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 230px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: thin; }
.ep { scroll-snap-align: start; background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 2px 0 #DDE1F2; display: flex; flex-direction: column; color: var(--on-paper); }
.ep[hidden] { display: none; }
.ep .thumb { position: relative; border-radius: 15px; overflow: hidden; aspect-ratio: 9/16; background: var(--navy); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ep .new { position: absolute; top: 10px; right: 10px; background: var(--coral); color: #fff; font-family: var(--display); font-weight: 700; font-size: 12px; padding: 4px 9px; border-radius: 7px; }
.ep .info { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding: 12px 6px 4px; }
.ep .info h3 { font-size: 16px; line-height: 1.12; }
.ep .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-paper-muted); margin-bottom: 4px; }
.ep .arrow { background: var(--navy); color: #fff; width: 34px; height: 34px; }
.rail-ctl { display: flex; gap: 8px; }
.rail-ctl button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--navy); background: transparent; color: var(--navy); font-size: 18px; font-weight: 700; cursor: pointer; }
.rail-ctl button:hover { background: var(--navy); color: #fff; }
.grid-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* método */
.method .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { border-radius: 26px; padding: 28px; background: rgba(255,255,255,.05); border: 1.5px solid var(--line); }
.step .n { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 28px; margin-bottom: 18px; }
.step h3 { font-size: 26px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); }
.n1 { background: var(--coral); color: #fff; } .n2 { background: var(--yellow); color: var(--navy); } .n3 { background: var(--teal); color: var(--navy); }
.source-demo { margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--muted); border-left: 3px solid var(--teal); padding-left: 14px; max-width: 70ch; }

/* lista */
.join .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.join h2 { font-size: clamp(36px, 5.4vw, 66px); }
.join h2 span { color: var(--yellow); }
form.signup { display: flex; gap: 10px; flex-wrap: wrap; }
form.signup input { flex: 1 1 240px; min-width: 0; font: inherit; padding: 15px 20px; border-radius: 999px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: var(--text); }
form.signup input::placeholder { color: var(--muted); }
.ok { font-weight: 700; color: var(--teal); margin-top: 12px; }

/* página do episódio */
.episode .wrap { display: grid; grid-template-columns: 360px 1fr; gap: 48px; align-items: start; padding-block: 56px; }
.episode .player { position: sticky; top: 100px; }
.episode .player .phone { border-radius: 30px; padding: 10px; background: #24285E; box-shadow: 0 24px 50px rgba(0,0,0,.45); }
.episode .player img, .episode .player iframe, .episode .player blockquote { border-radius: 22px; width: 100% !important; max-width: 100% !important; margin: 0 !important; }
.episode .watch { margin-top: 16px; width: 100%; justify-content: center; }
.episode h1 { font-size: clamp(36px, 5vw, 64px); margin: 14px 0 18px; }
.episode .kicker { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill-cat { background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.pill-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.entry { font-size: 18px; max-width: 65ch; color: rgba(255,255,255,.88); }
.entry h2 { font-size: 28px; margin: 34px 0 12px; }
.entry a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.entry img { border-radius: 16px; }
.fontes { margin-top: 34px; padding: 22px 24px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1.5px solid var(--line); max-width: 65ch; }
.fontes h2 { font-size: 20px; margin-bottom: 12px; }
.fontes ol { margin: 0; padding-left: 20px; font-family: var(--mono); font-size: 14px; color: var(--muted); display: grid; gap: 6px; }
.share { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* arquivo / categoria */
.archive-head { padding-block: 56px 20px; }
.archive-head .row { display: flex; gap: 24px; align-items: center; }
.archive-head img { width: 110px; height: 110px; border-radius: 50%; }
.archive-head h1 { font-size: clamp(40px, 6vw, 80px); }
.archive-head p { color: var(--muted); max-width: 60ch; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; }
.pagination .page-numbers { padding: 10px 16px; border-radius: 999px; border: 1.5px solid #C9CEDD; font-weight: 700; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* rodapé */
footer.site { border-top: 1px solid var(--line); padding-block: 48px 36px; font-size: 14px; color: var(--muted); }
footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; }
footer h4 { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text); margin: 0 0 12px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
footer a:hover { color: var(--yellow); }
footer .legal { margin-top: 34px; font-size: 12px; }

/* responsivo */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 44px 80px; }
  .feature { width: min(300px, 80%); }
  .bento { grid-template-columns: 1fr 1fr; }
  .cat:first-child { grid-row: auto; grid-column: span 2; }
  .cat:nth-child(4):last-child, .cat:nth-child(6):last-child { grid-column: auto; }
  .cat:nth-child(even):last-child { grid-column: span 2; }
  .method .steps { grid-template-columns: 1fr; }
  .join .wrap { grid-template-columns: 1fr; }
  .episode .wrap { grid-template-columns: 1fr; }
  .episode .player { position: static; max-width: 360px; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .cats { display: none; }
  .nav { justify-content: space-between; }
}
@media (max-width: 782px) { .admin-bar header.site { top: 0; } }
@media (max-width: 560px) {
  .biz .tab { display: none; }
  .bento { grid-template-columns: 1fr; }
  .cat:first-child, .cat:nth-child(even):last-child { grid-column: auto; }
  .ribbon { font-size: 20px; }
  .brand span { display: none; }
}

/* ---------- acessibilidade ---------- */
.a11y { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; }
.a11y-btn { display: inline-flex; align-items: center; gap: 10px; font: 700 15px var(--display); background: var(--paper); color: var(--navy); border: 3px solid var(--navy); border-radius: 999px; padding: 10px 16px 10px 10px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.a11y-btn svg { width: 30px; height: 30px; }
.a11y-painel { position: absolute; left: 0; bottom: 64px; width: min(330px, calc(100vw - 32px)); background: var(--paper); color: var(--navy); border-radius: 22px; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.45); display: grid; gap: 8px; }
.a11y-painel h2 { font-size: 20px; margin: 0 0 4px; }
.a11y-painel button { font: 700 16px var(--body); text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: #fff; color: var(--navy); border: 2px solid #C9CEDD; border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.a11y-painel button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.a11y-painel .linha { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.a11y-painel .linha button { justify-content: center; }
.a11y-painel #a11y-zoom { font: 700 16px var(--mono); min-width: 56px; text-align: center; }
.a11y-painel .nota { font-size: 13px; color: var(--on-paper-muted); margin: 4px 0 0; }
.transcricao { margin-top: 16px; color: var(--muted); font-size: 15px; }
.transcricao summary { cursor: pointer; font-weight: 700; color: var(--text); }
.transcricao p { max-width: 65ch; }
/* alto contraste */
.a11y-contraste body, .a11y-contraste .grid-bg, .a11y-contraste .paper, .a11y-contraste header.site, .a11y-contraste .ep, .a11y-contraste .step, .a11y-contraste .cat, .a11y-contraste .fontes { background: #000 !important; background-image: none !important; color: #fff !important; }
.a11y-contraste .cat, .a11y-contraste .ep, .a11y-contraste .step, .a11y-contraste .fontes, .a11y-contraste .chip { border: 2px solid #fff !important; }
.a11y-contraste .eyebrow, .a11y-contraste .muted, .a11y-contraste p, .a11y-contraste .tag, .a11y-contraste .count, .a11y-contraste .ep h3, .a11y-contraste .cat h3, .a11y-contraste .cat p { color: #fff !important; opacity: 1 !important; }
.a11y-contraste a, .a11y-contraste .hl { color: #FFE600 !important; }
.a11y-contraste .btn-y, .a11y-contraste .ribbon, .a11y-contraste .topbar { background: #FFE600 !important; color: #000 !important; }
/* destacar links */
.a11y-links main a, .a11y-links footer a { text-decoration: underline !important; text-decoration-thickness: 3px !important; text-underline-offset: 4px; outline: 2px dashed currentColor; outline-offset: 2px; }
/* pausar animações */
.a11y-pausa *, .a11y-pausa *::before, .a11y-pausa *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (max-width: 560px) { .a11y-btn .lbl { display: none; } .a11y-btn { padding: 10px; } }
.a11y-contraste .topbar a, .a11y-contraste .pill-cat, .a11y-contraste .btn-y, .a11y-contraste .vsl-som { color: #000 !important; }
.a11y-contraste .pill-cat, .a11y-contraste .vsl-som { background: #FFE600 !important; }
.a11y-contraste .a11y-painel, .a11y-contraste .a11y-painel h2 { background: #fff !important; color: #000 !important; }
.a11y-contraste .a11y-painel p { color: #222 !important; }
.a11y-contraste .a11y-painel button { color: #000 !important; border-color: #000 !important; }
.a11y-contraste .a11y-painel button[aria-pressed="true"] { background: #000 !important; color: #FFE600 !important; }

.a11y-painel:focus { outline: none; }
.a11y-painel button:focus { outline: none; }
.a11y-painel button:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* correções do painel · respeitar [hidden] e botão só com ícone */
.a11y-painel[hidden] { display: none !important; }
.a11y-btn { padding: 6px !important; gap: 0 !important; border-radius: 50% !important; }
.a11y-btn svg { width: 42px !important; height: 42px !important; }
.a11y-btn .lbl { position: absolute; left: 62px; top: 50%; transform: translateY(-50%); background: var(--navy); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.a11y-btn:hover .lbl, .a11y-btn:focus-visible .lbl { opacity: 1; }

/* acessibilidade no cabeçalho (não cobre o conteúdo) */
.a11y { position: relative !important; left: auto !important; bottom: auto !important; z-index: 45; }
.a11y-btn { padding: 3px !important; border-width: 2px !important; box-shadow: none !important; }
.a11y-btn svg { width: 34px !important; height: 34px !important; }
.a11y-btn .lbl { left: auto !important; right: 0; top: calc(100% + 8px) !important; transform: none !important; }
.a11y-painel { top: calc(100% + 12px) !important; bottom: auto !important; left: auto !important; right: 0 !important; }
@media (max-width: 560px) { .biz .a11y-btn { display: inline-flex; } }

/* redes sociais */
.redes { display: flex; gap: 10px; flex-wrap: wrap; }
.redes a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.22); color: var(--text); font-weight: 700; font-size: 14px; }
.redes a:hover { border-color: var(--yellow); color: var(--yellow); }
.redes svg { width: 20px; height: 20px; }
.redes-post { margin-top: 22px; }

footer .copy { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

footer .legal, footer .copy { text-align: center; }
