/*
Theme Name: KiandaGenius
Theme URI: https://kiandagenius.ao
Author: KiandaGenius
Author URI: https://kiandagenius.ao
Description: Biblioteca digital gratuita para Angola. Tema-filho do Twenty Twenty-Five, com paleta pan-africana (preto, verde, vermelho) sobre branco, estrutura de página e navegação inspiradas na Apple, e microinteracções.
Version: 6.1.1
Template: twentytwentyfive
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kiandagenius
*/

/* ==========================================================================
   Typography — the system font stack renders as real SF Pro on Apple
   devices (and Segoe UI / Roboto elsewhere) with zero extra download,
   matching both the "iOS-native" brief and the project's fast-on-any-
   connection principle. No self-hosted webfont in this version.
   ========================================================================== */

/* ==========================================================================
   Root variables (mirror theme.json palette for use in custom CSS)
   ========================================================================== */
:root {
  --kg-verde: #0B6E4F;
  --kg-verde-escura: #085138;
  --kg-verde-clara: #E1F3EC;
  --kg-vermelho: #D62828;
  --kg-vermelho-escura: #A61E1E;
  --kg-vermelho-clara: #FBE4E4;
  --kg-preto: #1D1D1F;
  --kg-preto-suave: #3A3A3C;
  --kg-branco: #FFFFFF;
  --kg-cinza-suave: #F5F5F7;
  --kg-cinza-claro: #E5E5EA;
  --kg-radius: 16px;
  --kg-radius-lg: 32px;
  --kg-pill: 980px;
  --kg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --kg-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Subtle tactile grain overlay — apply with .kg-grain, opacity kept low so it
   reads as texture, not noise; skipped from ::selection/pointer-events. */
.kg-grain {
  position: relative;
  isolation: isolate;
}

.kg-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--kg-grain);
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

.kg-grain > * {
  position: relative;
  z-index: 2;
}

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

/* ==========================================================================
   Cross-page view transitions — declarative, zero-JS. Unsupported browsers
   simply ignore the at-rule and fall back to a normal hard navigation.
   ========================================================================== */
@media not (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root) {
  animation: kg-page-out 0.22s var(--kg-ease) both;
}

::view-transition-new(root) {
  animation: kg-page-in 0.28s var(--kg-ease) both;
}

@keyframes kg-page-out {
  to { opacity: 0; }
}

@keyframes kg-page-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ==========================================================================
   Base
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--kg-branco);
  color: var(--kg-preto);
}

a {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* Visible keyboard focus everywhere — important for accessibility */
a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--kg-verde);
  outline-offset: 2px;
}

/* ==========================================================================
   Header / navigation — full-width "Liquid Glass" bar, always translucent
   with a hairline bottom edge, matching Apple's own edge-to-edge nav.
   ========================================================================== */
.kg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 52px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background-color 0.3s var(--kg-ease), border-color 0.3s var(--kg-ease);
}

.kg-header > .wp-block-group {
  width: 100%;
}

.kg-header.is-scrolled {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
}

.kg-logo {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.kg-logo:hover {
  opacity: 0.7;
}

/* Animated underline on nav links */
.kg-nav .wp-block-navigation-item__content {
  font-weight: 600;
  position: relative;
}

.kg-nav .wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--kg-verde);
  transition: width 0.25s var(--kg-ease);
}

.kg-nav .wp-block-navigation-item__content:hover::after,
.kg-nav .wp-block-navigation-item__content:focus-visible::after {
  width: 100%;
}

.kg-nav a:hover,
.kg-nav a:focus-visible {
  color: var(--kg-verde);
}

.wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
  color: var(--kg-verde);
}

.wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content::after {
  width: 100%;
}

/* ==========================================================================
   Hero — full-bleed, edge-to-edge, no card boundary. Centered copy stacked
   above a wide visual band, echoing Apple's own product-page hero layout.
   The soft verde/vermelho glow orbs give it the "Liquid Glass" ambient light.
   ========================================================================== */
.kg-hero {
  position: relative;
  background: radial-gradient(120% 100% at 50% 0%, #FFFFFF 0%, var(--kg-cinza-suave) 60%);
  overflow: hidden;
  isolation: isolate;
}

/* Staggered load-in — the hero is above the fold, so it animates on page
   load rather than waiting for a scroll-triggered IntersectionObserver. */
.kg-hero-copy > * {
  opacity: 0;
  animation: kg-hero-in 0.7s var(--kg-ease) both;
}

.kg-hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.kg-hero-copy > *:nth-child(2) { animation-delay: 0.15s; }
.kg-hero-copy > *:nth-child(3) { animation-delay: 0.25s; }
.kg-hero-copy > *:nth-child(4) { animation-delay: 0.35s; }

.kg-hero-stack.wp-block-query {
  opacity: 0;
  animation: kg-hero-in 0.8s var(--kg-ease) 0.45s both;
}

@keyframes kg-hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .kg-hero-copy > *,
  .kg-hero-stack.wp-block-query {
    animation: none;
    opacity: 1;
  }
}

.kg-hero-copy {
  position: relative;
  z-index: 1;
}

/* Overlapping stack of the 3 latest book covers, tilted like a fanned hand
   of cards — built from a real wp:query so it stays live, not a mock image. */
.kg-hero-stack.wp-block-query {
  position: relative;
  z-index: 1;
  margin-top: 3rem;
  transition: transform 0.3s var(--kg-ease);
}

.kg-hero-stack .wp-block-post-template {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  list-style: none;
  margin: 0;
  padding: 2.5rem 0 0.5rem;
}

.kg-hero-stack li {
  width: 130px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  border: 4px solid var(--kg-branco);
  background: var(--kg-cinza-claro);
  transition: transform 0.35s var(--kg-ease);
}

.kg-hero-stack li + li {
  margin-left: -48px;
}

.kg-hero-stack li:nth-child(1) { transform: rotate(-9deg); z-index: 1; }
.kg-hero-stack li:nth-child(2) { transform: translateY(-18px) scale(1.08); z-index: 2; }
.kg-hero-stack li:nth-child(3) { transform: rotate(9deg); z-index: 1; }

.kg-hero-stack li:hover {
  transform: translateY(-10px) scale(1.05);
  z-index: 3;
}

.kg-hero-stack .wp-block-post-featured-image {
  margin: 0;
  height: 100%;
  width: 100%;
}

.kg-hero-stack .wp-block-post-featured-image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .kg-hero-stack li { transition: none; }
}

.kg-hero::before {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  top: -280px;
  right: -200px;
  background: radial-gradient(circle, var(--kg-verde) 0%, rgba(11, 110, 79, 0) 72%);
  opacity: 0.35;
  z-index: -1;
  animation: kg-float 22s ease-in-out infinite;
}

.kg-hero::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  bottom: -220px;
  left: -160px;
  background: radial-gradient(circle, var(--kg-vermelho) 0%, rgba(214, 40, 40, 0) 70%);
  opacity: 0.22;
  z-index: -1;
  animation: kg-float 22s ease-in-out infinite reverse;
}

@keyframes kg-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-18px, 18px); }
}

/* Cursor-reactive spotlight — a soft light that follows the pointer across
   the hero, injected by JS as the hero's first child (kept out of the flow
   with position:absolute so it doesn't affect layout). */
.kg-hero-spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--kg-mx, 50%) var(--kg-my, 50%),
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0) 32%
  );
  transition: opacity 0.4s var(--kg-ease);
}

.kg-hero-spotlight.is-active {
  opacity: 1;
}

.kg-eyebrow {
  display: inline-flex;
  align-items: center;
  background: rgba(11, 110, 79, 0.08);
  backdrop-filter: blur(8px);
  color: var(--kg-verde-escura);
  border: 1px solid rgba(11, 110, 79, 0.16);
  border-radius: var(--kg-pill);
  padding: 6px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.kg-highlight {
  background: linear-gradient(90deg, var(--kg-verde) 0%, var(--kg-vermelho) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Buttons — full-pill "Liquid Glass" style CTAs, Apple's App Store pattern
   ========================================================================== */
.kg-hero-buttons {
  flex-wrap: wrap;
}

.wp-block-button__link {
  position: relative;
  overflow: hidden;
  border-radius: var(--kg-pill);
  font-weight: 600;
  padding: 14px 30px !important;
  transition: transform 0.2s var(--kg-ease), box-shadow 0.2s var(--kg-ease), background-color 0.2s var(--kg-ease);
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
}

.wp-block-button__link:active {
  transform: translateY(0);
}

/* Ripple — brief tactile feedback on click/tap, injected by JS and
   removed from the DOM once its animation finishes. */
.kg-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  pointer-events: none;
  animation: kg-ripple 0.55s var(--kg-ease) forwards;
}

@keyframes kg-ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.is-style-kg-primary .wp-block-button__link {
  background-color: var(--kg-verde);
  color: var(--kg-branco);
}
.is-style-kg-primary .wp-block-button__link:hover {
  background-color: var(--kg-verde-escura);
  box-shadow: 0 10px 24px rgba(11, 110, 79, 0.35);
}

.is-style-kg-download .wp-block-button__link {
  background-color: var(--kg-preto);
  color: var(--kg-branco);
}
.is-style-kg-download .wp-block-button__link:hover {
  background-color: var(--kg-preto-suave);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.kg-download-cta {
  margin-top: 1.5rem;
}

.kg-download-count {
  margin-top: 0.6rem !important;
  font-size: 0.9rem;
  color: var(--kg-preto-suave);
}

/* Glassy outline button — translucent frosted fill instead of flat
   transparent, so it reads as "glass" rather than a plain bordered box. */
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1px solid rgba(29, 29, 31, 0.16);
  outline: none;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--kg-preto) !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus-visible {
  background-color: var(--kg-preto) !important;
  border-color: var(--kg-preto);
  outline-color: var(--kg-preto);
  color: var(--kg-branco) !important;
}

/* ==========================================================================
   Category chips / filters
   ========================================================================== */
.kg-chip,
.kg-chips a {
  display: inline-block;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--kg-cinza-claro);
  border-radius: var(--kg-pill);
  padding: 8px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--kg-preto);
  text-decoration: none;
  transition: background-color 0.2s var(--kg-ease), border-color 0.2s var(--kg-ease), color 0.2s var(--kg-ease), transform 0.2s var(--kg-ease), box-shadow 0.2s var(--kg-ease);
}

.kg-chips a:hover,
.kg-chips a:focus-visible {
  background: var(--kg-verde-clara);
  border-color: var(--kg-verde-clara);
  color: var(--kg-verde-escura);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Book cards (Biblioteca grid) — frosted glass caption panel over the cover
   ========================================================================== */
/* Force every track to a fixed width so cards stay identical in size even
   when the last row isn't full — WP's default grid uses minmax(*, 1fr),
   which stretches trailing items to fill leftover row space. */
.wp-block-post-template.wp-block-post-template-is-layout-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 230px)) !important;
  justify-content: center;
}

.kg-book-card {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--kg-radius-lg);
  overflow: visible;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--kg-ease), box-shadow 0.25s var(--kg-ease), opacity 0.55s var(--kg-ease);
  will-change: transform;
}

.kg-book-card:hover {
  transform: translateY(-6px);
}

/* While the pointer is actively moving over the card, JS drives the
   transform every frame — a CSS transition here would lag behind the
   cursor, so it's disabled and restored the instant the pointer leaves. */
.kg-book-card.is-tilting {
  transition: box-shadow 0.25s var(--kg-ease);
}

/* Scroll-reveal — starts hidden, JS adds .is-visible once in view.
   Progressive enhancement: if IntersectionObserver is unsupported or JS
   fails to run, the reveal script's own fallback adds .is-visible eagerly. */
.kg-book-card {
  opacity: 0;
  transform: translateY(20px);
}

.kg-book-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--kg-stagger-index, 0) * 70ms);
}

.kg-book-card.is-visible:hover,
.kg-book-card.is-visible.is-tilting {
  transition-delay: 0s;
}

.kg-book-card .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 3 / 4;
  background: var(--kg-cinza-claro);
  border-radius: var(--kg-radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s var(--kg-ease);
}

.kg-book-card:hover .wp-block-post-featured-image {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}

/* The meta block (category / title / author) overlaps the cover slightly as
   a frosted glass caption card, like iOS widgets floating over content. */
.kg-book-card .wp-block-post-featured-image + .wp-block-group {
  position: relative;
  z-index: 1;
  margin: -1.5rem 0.75rem 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--kg-radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.kg-book-card .wp-block-post-featured-image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--kg-ease);
}

.kg-book-card:hover .wp-block-post-featured-image img {
  transform: scale(1.06);
}

.kg-book-card .wp-block-post-title a {
  color: var(--kg-preto);
  text-decoration: none;
}

.kg-book-card .wp-block-post-title a:hover {
  color: var(--kg-verde);
}

.kg-book-card .wp-block-post-terms {
  font-size: 0.85rem;
  color: var(--kg-preto-suave);
  font-weight: 600;
}

/* Category badge on cards/single */
.wp-block-post-terms a {
  background: var(--kg-verde-clara);
  color: var(--kg-verde-escura);
  border-radius: var(--kg-pill);
  padding: 3px 12px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.wp-block-post-terms a:hover {
  background-color: var(--kg-verde);
  color: var(--kg-branco);
}

/* ==========================================================================
   Live search (Biblioteca page)
   ========================================================================== */
.kg-search {
  position: relative;
  max-width: 420px;
}

.kg-search input[type="search"] {
  width: 100% !important;
  padding: 12px 18px 12px 46px !important;
  border-radius: var(--kg-pill) !important;
  border: 1px solid var(--kg-cinza-claro) !important;
  box-shadow: none !important;
  font-size: 1rem;
  font-family: inherit;
  color: var(--kg-preto);
  background-color: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233A3A3C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 16px center !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kg-search input[type="search"]:focus-visible {
  border-color: var(--kg-verde);
  outline: none;
  box-shadow: 0 0 0 3px var(--kg-verde-clara);
}

.kg-no-results {
  display: none;
  padding: 2rem 0;
  color: var(--kg-preto-suave);
}

.kg-no-results.is-visible {
  display: block;
}

.kg-book-card.is-hidden {
  display: none;
}

/* ==========================================================================
   Stats / counters — bold black "keynote slide" section between the light
   panels, with verde/vermelho used only as small accents.
   ========================================================================== */
.kg-stats {
  background: var(--kg-preto);
}

.kg-stat-number {
  font-weight: 700;
  font-size: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);
  color: var(--kg-branco);
  line-height: 1;
  display: block;
  letter-spacing: -0.02em;
}

.kg-stat-label {
  color: var(--kg-verde-clara);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ==========================================================================
   Scroll-reveal animation
   ========================================================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--kg-ease), transform 0.6s var(--kg-ease);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.is-visible > * {
  transition-delay: calc(var(--kg-stagger-index, 0) * 80ms);
}

/* ==========================================================================
   Steps ("Como funciona")
   ========================================================================== */
.kg-step-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: auto;
  height: auto;
  margin: 0 0 0.25rem 0 !important;
  border-radius: 0;
  background: none;
  color: var(--kg-preto);
  font-weight: 800;
  font-size: 3.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: transform 0.25s var(--kg-ease);
}

/* Each tile's number matches its own accent bar (preto/verde/vermelho) —
   see .kg-bento-tile::before — instead of a single color across all three. */
.wp-block-column:nth-child(2) .kg-step-number {
  color: var(--kg-verde);
}

.wp-block-column:nth-child(3) .kg-step-number {
  color: var(--kg-vermelho);
}

.kg-how-it-works .wp-block-column:hover .kg-step-number {
  transform: translateX(4px);
}

.kg-how-it-works h3,
.kg-how-it-works .wp-block-column > .wp-block-group > p:not(.kg-step-number) {
  margin: 0 !important;
}

/* ==========================================================================
   Back to top button
   ========================================================================== */
.kg-back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--kg-preto);
  color: var(--kg-branco);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s var(--kg-ease), transform 0.25s var(--kg-ease), background-color 0.2s ease;
  z-index: 90;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.kg-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kg-back-to-top:hover {
  background: var(--kg-verde);
}

/* Scroll-progress ring — a circle traced around the button as the reader
   moves down the page, fully drawn at the bottom of the page. */
.kg-btt-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.kg-btt-track {
  stroke: rgba(255, 255, 255, 0.22);
}

.kg-btt-progress {
  stroke: var(--kg-verde-clara);
  transition: stroke-dashoffset 0.15s linear;
}

.kg-btt-arrow {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Page header (Biblioteca / Sobre / Contacto)
   ========================================================================== */
.kg-page-header {
  background: var(--kg-cinza-suave);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.wp-block-query-pagination-numbers a,
.wp-block-query-pagination-numbers span {
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.wp-block-query-pagination-numbers a:hover {
  background: var(--kg-verde-clara);
}

.wp-block-query-pagination-numbers .current {
  background: var(--kg-verde);
  color: var(--kg-branco);
  font-weight: 700;
}

/* ==========================================================================
   CTA band — flush full-bleed black closing section, no rounded seam;
   Apple's sections butt directly against their neighbors.
   ========================================================================== */
.cta-band {
  text-align: center;
}

/* ==========================================================================
   Statement — a full-bleed, text-only editorial break between the hero and
   the stats band, the same rhythm Apple uses between product photography.
   ========================================================================== */
.kg-statement h2 {
  color: var(--kg-preto-suave);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.kg-statement .kg-highlight {
  font-weight: 800;
}

/* ==========================================================================
   Bento tiles ("Como funciona") — rounded glass cards sitting inside a
   full-bleed section, the same nested-card pattern Apple uses for feature
   grids (a full-width band containing individually boxed tiles).
   ========================================================================== */
.kg-bento-tile {
  position: relative;
  height: 100%;
  background: var(--kg-branco);
  border-radius: var(--kg-radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--kg-ease), box-shadow 0.3s var(--kg-ease);
}

/* A thin Pan-African accent bar per tile — preto, verde, vermelho in order —
   ties the palette into the feature grid instead of leaving it colorless. */
.kg-bento-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--kg-preto);
}

.wp-block-column:nth-child(2) .kg-bento-tile::before {
  background: var(--kg-verde);
}

.wp-block-column:nth-child(3) .kg-bento-tile::before {
  background: var(--kg-vermelho);
}

.kg-bento-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Marquee ticker — pure-CSS infinite scroll, content duplicated in markup
   for a seamless loop. Pauses on hover/focus and freezes for reduced motion.
   ========================================================================== */
.kg-marquee {
  overflow: hidden;
  border-top: 1px solid var(--kg-cinza-claro);
  border-bottom: 1px solid var(--kg-cinza-claro);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.kg-marquee-track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: kg-marquee 28s linear infinite;
}

.kg-marquee:hover .kg-marquee-track,
.kg-marquee:focus-within .kg-marquee-track {
  animation-play-state: paused;
}

.kg-marquee-track span {
  white-space: nowrap;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--kg-preto-suave);
  opacity: 0.6;
}

.kg-marquee-track span::after {
  content: "•";
  margin-left: 3rem;
  color: var(--kg-vermelho);
  opacity: 0.7;
}

@keyframes kg-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .kg-marquee-track {
    animation: none;
  }
}

/* ==========================================================================
   Footer — Apple's own pattern: plain, light, small text, no bold color
   block. A quiet close after the black CTA band, not another statement.
   ========================================================================== */
.kg-footer {
  background: var(--kg-cinza-suave);
  color: var(--kg-preto-suave);
}

.kg-footer .wp-block-separator {
  border-color: var(--kg-cinza-claro);
  opacity: 1;
}

.kg-footer a {
  color: var(--kg-preto-suave);
  transition: color 0.2s ease;
}

.kg-footer a:hover,
.kg-footer a:focus-visible {
  color: var(--kg-preto);
}

.kg-footer-nav .wp-block-navigation-item__content {
  color: var(--kg-preto-suave) !important;
  font-weight: 400;
  transition: color 0.2s ease;
}

.kg-footer-nav .wp-block-navigation-item__content:hover,
.kg-footer-nav .wp-block-navigation-item__content:focus-visible {
  color: var(--kg-preto) !important;
}
