/*
Theme Name: Group KR
Theme URI: https://groupkr.com.br
Description: Tema institucional do ecossistema Group KR. Tema de blocos: cores, fontes, cabeçalho, rodapé e páginas são editados em Aparência > Editor, sem código. Base para os sites das empresas do grupo.
Author: Group KR
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: groupkr
*/

/*
 * Componentes do tema. Cores, fontes e espaçamentos vêm do theme.json
 * (Aparência > Editor > Estilos). Este arquivo só cobre o que os blocos
 * nativos não oferecem como opção no painel.
 */

/* ===== Base ===== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
:where(a, button, summary, input, textarea, select):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
	border-radius: 2px;
}
.wp-site-blocks > main { margin-block-start: 0; }
.wp-site-blocks > footer { margin-block-start: 0; }
main > .entry-content > .alignfull:first-child,
main > .wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }

/* ===== Cabeçalho ===== */
.kr-header { border-bottom: 1px solid rgb(201 162 75 / .45); position: relative; z-index: 50; }
.kr-header .wp-block-site-logo img { width: auto; max-height: 40px; }
.kr-header .wp-block-navigation__submenu-container {
	border: 1px solid rgb(201 162 75 / .35) !important;
	border-radius: 6px;
	padding: 6px !important;
	min-width: 230px !important;
	box-shadow: 0 18px 40px rgb(0 0 0 / .35);
}
.kr-header .wp-block-navigation__submenu-container a { padding: 9px 12px !important; border-radius: 4px; }
.kr-header .wp-block-navigation__submenu-container a:hover { background: rgb(201 162 75 / .16); }
.kr-header .wp-block-navigation-item.current-menu-item > a,
.kr-header .wp-block-navigation-item.current-menu-ancestor > a { color: var(--wp--preset--color--gold); }
.kr-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }
/* Menu mobile aberto: começa abaixo do cabeçalho (barra do grupo + logo continuam visíveis). */
.kr-header .wp-block-navigation__responsive-container.is-menu-open { top: var(--kr-nav-top, 0px); }
html.has-modal-open .kr-header .wp-block-navigation__responsive-container-open { visibility: hidden; }
html.has-modal-open .kr-topbar details { display: none; }
/* "Contato" some do menu quando o botão "Fale conosco" está visível (mesma página). */
@media (min-width: 782px) { .kr-header .kr-nav-contato { display: none; } }

/* ===== Barra do ecossistema (plugin KR Ecosystem Bar) ===== */
.kr-topbar { background: var(--wp--preset--color--emerald-dark); color: #e3dcc6; font-size: .875rem; position: relative; z-index: 60; }
.kr-topbar__inner { max-width: var(--wp--style--global--wide-size); margin: 0 auto; padding: 0 var(--wp--preset--spacing--40); min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kr-topbar__badge { display: inline-flex; align-items: center; gap: 8px; color: #f6f1e4; font-weight: 600; }
.kr-topbar__dot { width: 7px; height: 10px; background: var(--wp--preset--color--gold); clip-path: polygon(50% 0, 100% 100%, 50% 80%, 0 100%); flex-shrink: 0; }
.kr-topbar details { position: relative; }
.kr-topbar summary { list-style: none; cursor: pointer; border: 1px solid rgb(201 162 75 / .5); color: #f6f1e4; padding: 4px 12px; border-radius: 4px; white-space: nowrap; }
.kr-topbar summary::-webkit-details-marker { display: none; }
.kr-topbar__menu { position: absolute; top: 100%; right: 0; margin-top: 6px; background: var(--wp--preset--color--emerald); color: var(--wp--preset--color--ivory); border: 1px solid rgb(201 162 75 / .35); min-width: 280px; max-width: calc(100vw - 32px); border-radius: 6px; box-shadow: 0 12px 30px rgb(0 0 0 / .25); overflow: hidden; z-index: 100; }
.kr-topbar__menu a { display: block; padding: 11px 14px; color: var(--wp--preset--color--ivory); text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / .1); }
.kr-topbar__menu a:last-child { border-bottom: 0; }
.kr-topbar__menu a:hover { background: rgb(255 255 255 / .08); }
.kr-topbar__menu strong { display: block; color: #fff; }
.kr-topbar__menu span { font-size: .8125rem; color: #cfc8b0; }
.kr-topbar__links { display: none; gap: 4px; }
.kr-topbar__links a { color: #d6cfb8; text-decoration: none; padding: 4px 8px; border-radius: 4px; }
.kr-topbar__links a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.kr-topbar__links a.is-active { color: #fff; box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold); border-radius: 0; }
.kr-topbar__heading { margin: 0; padding: 8px 14px 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--gold); background: var(--wp--preset--color--emerald-dark); border-bottom: 1px solid rgb(255 255 255 / .1); }
.kr-topbar__links { align-items: center; }
.kr-topbar__group { position: relative; }
.kr-topbar__trigger { font: inherit; color: #d6cfb8; background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; }
.kr-topbar__trigger::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.kr-topbar__trigger:hover, .kr-topbar__group.is-open .kr-topbar__trigger { color: #fff; background: rgb(255 255 255 / .08); }
.kr-topbar__trigger.is-active { color: #fff; box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold); border-radius: 0; }
.kr-topbar__group.is-open .kr-topbar__trigger::after { transform: translateY(1px) rotate(-135deg); }
.kr-topbar__drop { display: none; position: absolute; top: 100%; right: 0; padding-top: 6px; min-width: 260px; z-index: 100; }
.kr-topbar__group:hover .kr-topbar__drop, .kr-topbar__group.is-open .kr-topbar__drop { display: block; }
.kr-topbar__drop a { display: block; padding: 10px 14px; background: var(--wp--preset--color--emerald); color: var(--wp--preset--color--ivory); text-decoration: none; border: 1px solid rgb(201 162 75 / .35); border-top: 0; border-bottom: 1px solid rgb(255 255 255 / .1); border-radius: 0; }
.kr-topbar__drop a:first-child { border-top: 1px solid rgb(201 162 75 / .35); border-radius: 6px 6px 0 0; }
.kr-topbar__drop a:last-child { border-bottom: 1px solid rgb(201 162 75 / .35); border-radius: 0 0 6px 6px; }
.kr-topbar__drop a:hover, .kr-topbar__drop a[aria-current] { background: color-mix(in srgb, var(--wp--preset--color--emerald) 88%, #fff); color: var(--wp--preset--color--ivory); }
.kr-topbar__drop a[aria-current] { box-shadow: inset 3px 0 0 var(--wp--preset--color--gold); }
.kr-topbar__drop { filter: drop-shadow(0 12px 18px rgb(0 0 0 / .22)); }
.kr-topbar__drop strong { display: block; color: #fff; }
.kr-topbar__drop span { font-size: .8125rem; color: #cfc8b0; }
@media (min-width: 861px) { .kr-topbar__links { display: flex; } .kr-topbar details { display: none; } }

/* ===== Abertura (hero) com a agulha ===== */
.kr-hero { position: relative; overflow: hidden; isolation: isolate; }
.kr-hero h1 { max-width: 13ch; }
.kr-hero p { max-width: 54ch; }
.kr-needle { margin: 0 !important; display: flex; justify-content: center; }
.kr-needle img { width: clamp(96px, 13vw, 190px); height: auto; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: no-preference) {
	.kr-needle img { animation: kr-norte 1.8s cubic-bezier(.3, 1.45, .5, 1) .15s both; }
}
@keyframes kr-norte {
	0%   { transform: rotate(-38deg); opacity: 0; }
	25%  { opacity: 1; }
	100% { transform: rotate(0deg); opacity: 1; }
}
@media (max-width: 781px) {
	/* no celular a agulha fica menor e sobe para antes do título */
	.kr-hero .wp-block-columns { flex-direction: column-reverse; }
	.kr-hero .kr-needle { justify-content: center; }
	.kr-needle img { width: 34px; }
	.kr-header .kr-header-cta { display: none; }
}

/* ===== Lista de empresas (diretório) ===== */
.kr-empresas { border-top: 1px solid var(--wp--preset--color--line); }
.kr-empresa { border-bottom: 1px solid var(--wp--preset--color--line); padding-block: var(--wp--preset--spacing--50); margin: 0 !important; scroll-margin-top: 24px; }
.kr-empresa .kr-logo { margin: 0; height: 88px; display: flex; align-items: center; }
.kr-empresa .kr-logo img { max-height: 80px; max-width: 200px; width: auto; height: auto; object-fit: contain; }
.kr-empresa h3 { margin-block: 0 .35em; }
.kr-empresa p { margin-block: 0 .5em; max-width: 60ch; }
.kr-empresa p:last-child { margin-bottom: 0; }
.kr-empresa .kr-link a { font-weight: 600; }

/* ===== Lista com marcador de norte ===== */
.kr-norte-list { list-style: none; padding-left: 0; }
.kr-norte-list li { position: relative; padding-left: 1.6em; margin-bottom: .9em; }
.kr-norte-list li::before {
	content: ""; position: absolute; left: .1em; top: .3em;
	width: .62em; height: .9em;
	background: var(--wp--preset--color--gold);
	clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

/* ===== Linha do tempo (Nossa História) ===== */
.kr-timeline { position: relative; max-width: 820px; margin-inline: auto !important; padding-left: 40px; }
.kr-timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--wp--preset--color--gold); opacity: .55; }
.kr-tl-item { position: relative; padding: 0 0 var(--wp--preset--spacing--50); margin: 0 !important; }
.kr-tl-item::before {
	content: ""; position: absolute; left: -38px; top: .35em;
	width: 20px; height: 26px; background: var(--wp--preset--color--gold);
	clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}
.kr-tl-item .kr-tl-logo { height: 52px; margin: 0 0 12px; display: flex; align-items: center; }
.kr-tl-item .kr-tl-logo img { max-height: 48px; max-width: 170px; width: auto; height: auto; object-fit: contain; }
.kr-tl-item .kr-tl-year { font-size: var(--wp--preset--font-size--x-large); font-stretch: 125%; font-weight: 700; line-height: 1; color: var(--wp--preset--color--gold-text); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.kr-tl-item h3 { margin: 0 0 6px; }
.kr-tl-item p:last-child { margin-bottom: 0; }
.kr-tl-note { font-size: var(--wp--preset--font-size--small); color: #5f6b65; font-style: italic; }

/* ===== Carrossel do DNA (plugin KR Carousel) ===== */
/* O plugin zera a margem da seção; aqui ela volta a ocupar a largura toda (sem faixas nas laterais). */
.wp-block-post-content > .kr-carousel-sec.alignfull {
	margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
	width: auto;
	max-width: none !important;
}
/* Frase do slide na tipografia do tema (Archivo expandida) */
.kr-carousel-sec .kr-slide .kr-slide-text { font-family: inherit; font-stretch: 118%; letter-spacing: -0.015em; line-height: 1.08; }
.kr-carousel-sec .kr-slide::before { content: none; }

/* ===== Rodapé ===== */
.kr-footer h2 { font-stretch: 100%; letter-spacing: 0; }
.kr-footer a { text-decoration: none; }
.kr-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kr-footer .wp-block-list { list-style: none; padding-left: 0; }
.kr-footer .wp-block-list li { margin-bottom: .45em; }
.kr-footer .kr-footer__copy { border-top: 1px solid rgb(201 162 75 / .3); }
