/*
 * ShaoTech Solutions — main stylesheet.
 * Light, professional ground (white / very light gray sections). Red
 * (sampled from the dragon badge mark) is the primary recurring accent
 * for CTAs and interactive states. Charcoal/near-black carries body
 * text and the masthead/footer for contrast. Steel gray is the
 * secondary neutral (borders, secondary text, icon strokes). Cyan is a
 * sparing "circuit" garnish (small details, hover states, the AI
 * service icon) — never a primary color.
 */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f7;
  --ink: #1a1817;
  --ink-soft: #55595e;
  --red: #b3121f;
  --red-strong: #7f0f19;
  --red-soft: #fbe9ea;
  --red-tint: #ef6a72; /* red, lightened for AA contrast on dark (--ink) backgrounds */
  --steel: #9aa0a6;
  --steel-strong: #80868c; /* steel, darkened for AA non-text (3:1) contrast on white — interactive borders */
  --steel-soft: #eef0f1;
  --cyan: #3ad8ff;
  --cyan-strong: #0072c6;
  --line: #e4e6e8;
  --shadow: 0 10px 24px -16px rgba(20, 10, 10, 0.18);
  --font: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.75rem; }

h1, h2, h3, h4, h5 { font-family: var(--font); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan-strong);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute !important;
  top: 0; left: -9999px;
  z-index: 100000;
  width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal;
  background: var(--ink); color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 5px 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ----------
 * Shared by the hero, closing CTA banners, and the contact form submit.
 * .btn-primary/.btn-secondary get inverted treatment inside .cta-banner
 * (see that section) so they stay legible on a solid red background. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 0.88rem; font-weight: 700;
  padding: 0.8rem 1.5rem; border-radius: 5px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-strong); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--steel-strong); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.3);
}
/* WordPress fixes its admin bar to the top of the viewport for logged-in
 * users (32px desktop, 46px on narrow viewports) — offset the sticky
 * masthead below it so the admin bar doesn't cover the header on scroll. */
.admin-bar .masthead { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .masthead { top: 46px; }
}
.masthead-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0;
}
.masthead-logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.logo-lockup { display: inline-flex; align-items: center; gap: 0.6rem; }
.masthead img.logo,
.masthead .custom-logo { height: 34px; width: auto; margin: 0; display: block; }
.logo-wordmark {
  font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; color: #fff;
}
.masthead .kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 600;
  margin-left: auto;
  padding-right: 1rem;
}

.nav-toggle {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; width: 40px; height: 40px; flex-shrink: 0;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px; cursor: pointer; padding: 0;
}
.nav-toggle-bar { width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

nav.tabs { max-width: 1160px; margin: 0 auto; padding: 0 1.75rem 0.85rem; }
.tabs-menu {
  display: flex; gap: 2rem; flex-wrap: wrap;
  list-style: none; margin: 0; padding: 0;
}
.tabs-menu a {
  background: none; border: none; font-family: var(--font);
  font-size: 0.86rem; font-weight: 600; color: rgba(255, 255, 255, 0.75);
  text-decoration: none; padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tabs-menu a:hover { color: #fff; }
.tabs-menu .current-menu-item > a,
.tabs-menu .current_page_item > a {
  color: #fff; border-color: var(--red-tint);
}

/* ---------- Views / shared page-header pattern ----------
 * Sobre Nós, Serviços, Contato and the generic page/single/index
 * fallbacks all open with the same eyebrow + h1 + intro paragraph. */
.view { padding: 3rem 0 4.5rem; }

.intro { max-width: 720px; margin: 0 0 2.6rem; }
.intro .eyebrow {
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); font-weight: 700; margin-bottom: 0.6rem;
}
.intro h1 {
  font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.2; margin: 0 0 0.9rem; letter-spacing: -0.01em;
  text-wrap: balance;
}
.intro p { color: var(--ink-soft); font-size: 1.02rem; margin: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 4.5rem 0 3.6rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  border-bottom: 1px solid var(--line);
}
.hero .intro { margin-bottom: 2.2rem; }
.hero .intro h1 { font-size: clamp(2rem, 4vw, 3rem); }
.hero .intro p { font-size: 1.08rem; max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Services teaser / grid / cards ----------
 * Used on both the homepage teaser (3 cards) and the full Serviços
 * page (all cards). Icons are inline SVGs using currentColor, so the
 * accent color is set on .service-icon. */
.services-teaser { padding: 4rem 0; }
.services-teaser h2 { text-align: center; font-size: 1.7rem; margin: 0 0 2.4rem; font-weight: 800; }
.services-teaser > .wrap > p { text-align: center; margin: 2rem 0 0; }
.services-teaser > .wrap > p a,
.about-teaser > .wrap > p a { font-weight: 700; color: var(--red); text-decoration: none; border-bottom: 1px solid transparent; }
.services-teaser > .wrap > p a:hover,
.about-teaser > .wrap > p a:hover { border-color: var(--red); }

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.6rem; align-items: start; }
.service-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.6rem 1.4rem; display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.service-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-soft); color: var(--red); margin-bottom: 1.1rem;
}
.service-icon--ai { background: rgba(58, 216, 255, 0.14); color: var(--cyan-strong); }
.service-card h3 { font-size: 1.08rem; margin: 0 0 0.55rem; font-weight: 700; }
.service-card .service-body { font-size: 0.9rem; color: var(--ink-soft); }
.service-card .service-body p { margin: 0; }

/* ---------- Differentiators ----------
 * Homepage: card grid (.diff-grid/.diff-item). About page: prose-style
 * checklist (.diff-list) — deliberately different treatment. */
.diff-section { padding: 4rem 0; background: var(--surface-2); }
.diff-section h2 { text-align: center; font-size: 1.7rem; margin: 0 0 2.4rem; font-weight: 800; }
.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.6rem; }
.diff-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.4rem 1.3rem; position: relative; padding-left: 1.6rem;
}
.diff-item::before {
  content: ""; position: absolute; left: 0; top: 1.4rem; bottom: 1.4rem;
  width: 3px; border-radius: 3px; background: var(--red);
}
.diff-item h3 { font-size: 1rem; margin: 0 0 0.5rem; font-weight: 700; }
.diff-item p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

.diff-list {
  list-style: none; margin: 1.8rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.diff-list li {
  position: relative; padding-left: 1.9rem; font-size: 0.98rem; color: var(--ink);
}
.diff-list li::before {
  content: ""; position: absolute; left: 0; top: 0.28em;
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--red-soft);
  border: 1px solid var(--red);
}
.diff-list li::after {
  content: ""; position: absolute; left: 4px; top: 0.5em;
  width: 6px; height: 3px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red);
  transform: rotate(-45deg);
}

/* ---------- About teaser ---------- */
.about-teaser { padding: 4rem 0; text-align: center; }
.about-teaser .wrap { max-width: 760px; }
.about-teaser h2 { font-size: 1.7rem; margin: 0 0 1rem; font-weight: 800; }
.about-teaser p { color: var(--ink-soft); font-size: 1.02rem; margin: 0 0 0.4rem; }

/* ---------- CTA banner ----------
 * section.cta-banner is a full-bleed homepage section; div.cta-banner
 * is an embedded card inside the About page's prose column — same
 * class, different element, so each gets its own radius/margin. */
.cta-banner {
  background: var(--red); color: #fff; text-align: center;
  padding: 3.2rem 1.75rem;
}
section.cta-banner { border-radius: 0; }
div.cta-banner { border-radius: 10px; margin: 3rem 0 0; }
.cta-banner h2 { font-size: 1.7rem; margin: 0 0 1.4rem; font-weight: 800; }
.cta-banner .hero-cta { justify-content: center; }
.cta-banner .btn-primary { background: #fff; color: var(--red-strong); }
.cta-banner .btn-primary:hover { background: var(--red-soft); }
.cta-banner .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.cta-banner .btn-secondary:hover { border-color: #fff; background: rgba(255, 255, 255, 0.12); }

/* ---------- Contato ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2.6rem; align-items: start; }
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.contact-list li { display: flex; flex-direction: column; gap: 0.2rem; }
.contact-list .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); font-weight: 700; }
.contact-list .v { font-size: 1rem; }
.contact-list .v a { text-decoration: none; }
.contact-list .v a:hover { color: var(--red); }

.contact-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.6rem; display: flex; flex-direction: column; gap: 0.9rem;
}
.contact-form input,
.contact-form textarea {
  border: 1px solid var(--steel-strong); border-radius: 5px; padding: 0.7rem 0.8rem;
  font-family: var(--font); font-size: 0.92rem; background: var(--bg); color: var(--ink);
  width: 100%;
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible { border-color: var(--cyan-strong); }
.contact-form button { align-self: flex-start; margin-top: 0.2rem; }

.reader-note {
  margin: 0 0 1.6rem; padding: 0.8rem 1rem; border-radius: 5px;
  font-size: 0.9rem; max-width: 640px; border-left: 3px solid var(--steel);
  background: var(--surface-2); color: var(--ink);
}
.reader-note--success { border-left-color: #1e7d3c; background: #eaf7ee; color: #14532b; }
.reader-note--error { border-left-color: var(--red); background: var(--red-soft); color: var(--red-strong); }

/* ---------- Single post / generic page content ----------
 * Kept only for the minimal WP fallback templates (index.php,
 * single.php, page.php) — not part of the primary navigation. */
.reader-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer; text-decoration: none;
  font-family: var(--font); font-size: 0.82rem; font-weight: 700;
  color: var(--ink-soft); padding: 0; margin-bottom: 1.8rem;
}
.reader-back:hover { color: var(--red); }
.single-thumb { max-width: 720px; margin: 0 auto 2rem; border-radius: 6px; overflow: hidden; }
.single-thumb img { width: 100%; height: auto; display: block; }
.single-content { max-width: 720px; margin: 0 auto; font-size: 1rem; }
.single-content p { margin: 0 0 1.2rem; }
.single-content img { border-radius: 6px; margin: 1.5rem 0; }

.pagination { margin-top: 2.4rem; }
.pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.pagination .page-numbers {
  font: inherit; display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--red);
}
.pagination .page-numbers:hover { background: var(--red-strong); }
.pagination .page-numbers.dots { background: transparent; color: var(--ink-soft); }
.pagination .page-numbers.current { background: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); padding: 3rem 0 1.6rem; color: rgba(255, 255, 255, 0.85); }
.foot-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 1fr; gap: 2.2rem; margin-bottom: 2rem; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; gap: 1.8rem; } }
.foot-grid h5 { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-tint); margin: 0 0 0.8rem; font-weight: 700; }
.foot-grid p { font-size: 0.86rem; color: rgba(255, 255, 255, 0.7); margin: 0 0 0.4rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { font-size: 0.86rem; color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color 0.15s ease; }
.footer-links a:hover { color: #fff; }
.social-links { display: flex; flex-direction: column; gap: 0.7rem; }
.social-links a {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.86rem; color: rgba(255, 255, 255, 0.7); text-decoration: none;
  transition: color 0.15s ease;
}
.social-links a:hover { color: #fff; }
.social-links svg { flex-shrink: 0; color: var(--red-tint); }
.copyright { text-align: center; font-size: 0.76rem; color: rgba(255, 255, 255, 0.6); border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 1.2rem; }

/* ---------- Scroll reveal (progressive enhancement) ----------
 * assets/js/main.js adds .reveal-init only when IntersectionObserver
 * is available and the visitor hasn't asked for reduced motion; it
 * then toggles .is-visible as each element enters the viewport.
 * Without JS (or with it disabled/unsupported) elements simply render
 * in their normal, fully visible state — nothing is ever hidden by
 * CSS alone. */
.reveal-init { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-init.is-visible { opacity: 1; transform: none; }

/* ---------- Mobile nav + touch-target refinements ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .masthead .kicker { display: none; }

  nav.tabs.is-collapsible {
    max-height: 0; overflow: hidden; padding-top: 0; padding-bottom: 0;
    transition: max-height 0.25s ease;
  }
  nav.tabs.is-collapsible.is-open { max-height: 400px; padding-bottom: 0.85rem; }
  nav.tabs.is-collapsible .tabs-menu { flex-direction: column; gap: 0.2rem; padding-top: 0.4rem; }
  nav.tabs.is-collapsible .tabs-menu a { display: block; padding: 0.75rem 0.1rem; }
}

@media (max-width: 600px) {
  .tabs-menu a { padding: 0.7rem 0.15rem; font-size: 0.9rem; }
  .btn { padding: 0.85rem 1.4rem; }

  .contact-form input,
  .contact-form textarea,
  .contact-form button { min-height: 2.75rem; }

  .reader-back { padding: 0.6rem 0; margin-bottom: 1.2rem; }

  .cta-banner { padding: 2.4rem 1.25rem; }
  .service-grid { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
}
