/* =========================================================
   DESIGN TOKENS
========================================================= */
:root {
  --bg: #fafafa;
  --bg-soft: #f2f3f5;
  --ink: #1c1e21;
  --muted: #5c6370;
  --accent: #1958d1;
  --border: #e0e2e7;

  --shadow: 0 8px 24px rgba(28, 30, 33, 0.08);

  --max: 1160px;
  --measure: 68ch;
}

/* =========================================================
   RESET
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* =========================================================
   TYPOGRAPHY
========================================================= */
h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2.15rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
}

h4 {
  font-size: 1.05rem;
  line-height: 1.35;
}

h5 {
  font-size: 0.9rem;
  line-height: 1.35;
}

p {
  margin: 0 0 1rem;
}

.lede,
.subheadline {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

/* =========================================================
   LINKS
========================================================= */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.text-link {
  display: block;
  margin-top: 1.25rem;
  font-weight: 600;
  text-align: center;
}

/* =========================================================
   BUTTONS
========================================================= */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.btn:hover,
.btn:focus {
  opacity: 0.95;
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-small {
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}

.case-cta {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

/* =========================================================
   LAYOUT
========================================================= */
main,
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 3.5rem 0;
}

/* only “case sections” get separators */
.case-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.page-hero,
.case-hero {
  padding: 2.5rem 0 1rem;
}

/* =========================================================
   TEXT COLUMN (NO NESTING: works in all browsers)
   - Headings + lede/subheadline centered
   - Body left
========================================================= */
.text-column,
.page-hero,
.case-hero,
.case-section,
.feature .content {
  /* nothing here on purpose */
}

.text-column > h1,
.text-column > h2,
.text-column > h3,
.text-column > h4,
.text-column > h5,
.text-column > p,
.text-column > ul,
.text-column > ol,
.text-column > blockquote,
.text-column > .lede,
.text-column > .subheadline,
.page-hero > h1,
.page-hero > h2,
.page-hero > h3,
.page-hero > h4,
.page-hero > h5,
.page-hero > p,
.page-hero > ul,
.page-hero > ol,
.page-hero > blockquote,
.page-hero > .lede,
.page-hero > .subheadline,
.case-hero > h1,
.case-hero > h2,
.case-hero > h3,
.case-hero > h4,
.case-hero > h5,
.case-hero > p,
.case-hero > ul,
.case-hero > ol,
.case-hero > blockquote,
.case-hero > .lede,
.case-hero > .subheadline,
.case-section > h1,
.case-section > h2,
.case-section > h3,
.case-section > h4,
.case-section > h5,
.case-section > p,
.case-section > ul,
.case-section > ol,
.case-section > blockquote,
.case-section > .lede,
.case-section > .subheadline,
.feature .content > h1,
.feature .content > h2,
.feature .content > h3,
.feature .content > h4,
.feature .content > h5,
.feature .content > p,
.feature .content > ul,
.feature .content > ol,
.feature .content > blockquote,
.feature .content > .lede,
.feature .content > .subheadline {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

/* headings + subheadlines centered */
.text-column > h1,
.text-column > h2,
.text-column > h3,
.text-column > h4,
.text-column > h5,
.text-column > .lede,
.text-column > .subheadline,
.page-hero > h1,
.page-hero > h2,
.page-hero > h3,
.page-hero > h4,
.page-hero > h5,
.page-hero > .lede,
.page-hero > .subheadline,
.case-hero > h1,
.case-hero > h2,
.case-hero > h3,
.case-hero > h4,
.case-hero > h5,
.case-hero > .lede,
.case-hero > .subheadline,
.case-section > h1,
.case-section > h2,
.case-section > h3,
.case-section > h4,
.case-section > h5,
.case-section > .lede,
.case-section > .subheadline,
.feature .content > h1,
.feature .content > h2,
.feature .content > h3,
.feature .content > h4,
.feature .content > h5,
.feature .content > .lede,
.feature .content > .subheadline {
  text-align: center;
}

/* body text left */
.text-column > p,
.text-column > ul,
.text-column > ol,
.text-column > blockquote,
.page-hero > p,
.page-hero > ul,
.page-hero > ol,
.page-hero > blockquote,
.case-hero > p,
.case-hero > ul,
.case-hero > ol,
.case-hero > blockquote,
.case-section > p,
.case-section > ul,
.case-section > ol,
.case-section > blockquote,
.feature .content > p,
.feature .content > ul,
.feature .content > ol,
.feature .content > blockquote {
  text-align: left;
}

/* Improve gestalt spacing between “blocks” */
.case-section h3 {
  margin-top: 3rem;
}

.case-section h4 {
  margin-top: 2.5rem;
}

/* =========================================================
   HEADER + NAV
========================================================= */
.logo {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink);
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-link.active {
  background: var(--bg-soft);
  color: var(--ink);
}

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.25rem;
  position: relative;
  z-index: 1600;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition:
    transform 200ms ease,
    opacity 200ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

/* =========================================================
   HERO (homepage)
========================================================= */
.hero.hero-bg {
  position: relative;
  height: 80vh;
  min-height: clamp(420px, 70vh, 720px);
  padding: 0;
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-top: none;
}

.hero.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/hero-portrait-16x9-1600@2x.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.9);
}

/* Desktop overlay for readability + better composition */
.hero.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.42) 48%,
    rgba(0, 0, 0, 0) 72%
  );
  z-index: 1;
  pointer-events: none;
}

.hero.hero-bg .hero-text {
  position: relative;
  padding: 3rem 2rem;
  max-width: 760px;
  z-index: 2;
}

/* Hero headline refinements */
.hero.hero-bg .hero-text h1 {
  margin-bottom: 0;
  font-size: clamp(2.6rem, 4.6vw, 4.2rem);
  line-height: 1.05;
  max-width: 42ch;
  text-wrap: pretty;
}

/* Fallback: force 3-line balance on narrower desktops */
@media (max-width: 1200px) {
  .hero.hero-bg .hero-text h1 {
    font-size: clamp(2.2rem, 3.8vw, 3.4rem);
    max-width: 44ch;
  }
}

@media (max-width: 900px) {
  .hero.hero-bg .hero-text h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    max-width: 100%;
  }
}

/* HERO KICKER (subtitle line under the H1) */
.hero.hero-bg .kicker {
  margin-top: 0.6rem;
  margin-bottom: 1.1rem;

  font-size: clamp(1.2rem, 1.2vw, 1.15rem);
  font-weight: 500;
  line-height: 1.4;

  color: rgba(255, 255, 255, 0.75);
}

.hero.hero-bg .hero-text p {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.86);
}

.hero.hero-bg .hero-text .meta {
  color: rgba(255, 255, 255, 0.75);
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================================================
   CHECKLIST
========================================================= */
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 1rem auto 2.75rem;
  max-width: var(--measure);
}

.checklist li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.5rem 0;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-weight: 700;
  color: var(--accent);
}

/* =========================================================
   PULL QUOTE
========================================================= */
.pull-quote::before,
.pull-quote::after {
  content: "—";
  display: block;
  margin: 0.75rem 0;
  opacity: 0.15;
}

.pull-quote {
  color: #222;
  margin: 3rem 0;
  max-width: 720px;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.25;
  text-align: center;
  padding: 0 1rem;
}

/* =========================================================
   CARDS / GRIDS
========================================================= */
.card-box {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.facts-grid .card-box strong {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}

/* ABOUT layout */
.about-page .about-hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: center;
}

.about-photo {
  height: 360px;
  background: var(--bg-soft);
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   MEDIA (case images)
========================================================= */
.responsive-img {
  width: 100%;
  height: auto;
}

.case-media {
  margin: 2rem auto;
  max-width: var(--max);
}

.case-media img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* Blur-up helper (JS toggles .blur-up-ready) */
img.blur-up {
  filter: blur(18px);
  transform: scale(1.01);
  transition:
    filter 400ms ease,
    transform 400ms ease;
}

img.blur-up.blur-up-ready {
  filter: blur(0);
  transform: none;
}

/* Reveal helper (JS toggles .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox (JS creates the node) */
body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 1rem;
}

.image-lightbox--open {
  display: flex;
}

/* Optional helper nodes created by JS (keep them from affecting layout) */
.image-lightbox__loader,
.image-lightbox .image-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  pointer-events: none;
}

.image-lightbox__loader {
  top: 1rem;
  display: none; /* shown only if you later toggle it via JS */
}

.image-lightbox .image-hint {
  bottom: 1rem;
  display: none; /* keep hidden by default */
}

.image-lightbox__inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-lightbox__inner img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  height: auto;
  box-shadow: var(--shadow);
  border-radius: 10px;
}

.image-lightbox__close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3100;
}

.image-lightbox__close::before {
  content: "×";
  display: block;
  text-align: center;
  font-weight: 700;
}

/* LIGHTBOX — MOBILE: anchor container to the left (or effectively centered) */
@media (max-width: 640px) {
  .image-lightbox {
    /* start the lightbox content at the left edge of the viewport */
    justify-content: flex-start;
    padding: 0.75rem;
  }

  .image-lightbox__inner {
    width: 100%;
    max-width: none;
    height: 90vh;
    max-height: none;

    display: flex;
    align-items: center;

    /* keep the image starting near the left instead of visually "floating" */
    justify-content: flex-start;

    /* horizontal scroll area */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;

    /* optional: snap feel when panning */
    scroll-snap-type: x mandatory;
  }

  .image-lightbox__inner img {
    height: 90vh;
    width: auto;
    max-height: 90vh;
    max-width: none;
    margin: 0; /* avoid auto-centering that can look like right-shift */

    /* optional */
    scroll-snap-align: start;
  }
}

/* =========================================================
   FOOTER
========================================================= */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.site-footer .social {
  display: flex;
  gap: 1rem;
}

/* =========================================================
   COOKIE BANNER
========================================================= */
.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  max-width: 520px;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  z-index: 2200;
  font-size: 0.95rem;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner button {
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
}

#cookie-accept-all {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow);
}

#cookie-reject {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

/* =========================================================
   RESPONSIVE (includes mobile nav)
========================================================= */
@media (max-width: 960px) {
  .about-page .about-hero {
    grid-template-columns: 1fr;
  }

  .facts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  /* (opcional, mas recomendado) evita overflow horizontal por 100vw */
  body {
    overflow-x: hidden;
  }

  .hero.hero-bg {
    padding: 4rem 1rem 3.5rem;

    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 80vh;
    align-items: flex-end;
  }

  .hero.hero-bg::before {
    background-position: 65% center;
  }

  .hero.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
  }

  /* garante que o texto fique acima do overlay */
  .hero.hero-bg .hero-text {
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
  }

  /* HEADER */
  .site-header {
    padding-inline: 0.8rem;
    max-width: 100%;
    margin: 0;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 5rem 1.5rem 2rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
    background: #fff;
    z-index: 1400;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .nav-link {
    width: 100%;
    padding: 0.9rem 0;
    font-size: 1.2rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
  }

  .site-nav .nav-link:last-of-type {
    border-bottom: none;
  }

  .site-nav .nav-link.active {
    color: var(--accent);
    font-weight: 700;
    background: none;
  }

  .site-nav .btn.btn-small {
    width: 100%;
    margin-top: 1rem;
    text-align: center;
  }

  /* GRIDS */
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* FOOTER */
  .site-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

/* =========================================================
   FIX: h4 de blocos (My role / Key insight / Selected outcomes)
========================================================= */
.case-section :is(h4.case-block, h4.text-column, h4.case-block.text-column) {
  max-width: var(--measure);
  width: 100%;
  margin-left: auto;
  margin-right: auto;

  /* consistent with your centered headings */
  text-align: center;

  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.case-section
  :is(h4.case-block, h4.text-column, h4.case-block.text-column)
  + .checklist {
  margin-top: 0.5rem;
}

.case-section .checklist + p {
  margin-top: 1.25rem;
}

* =========================================================
   FIX: h5 de blocos (My role / Key insight / Selected outcomes)
========================================================= */
.case-section :is(h5.case-block, h5.text-column, h5.case-block.text-column) {
  max-width: var(--measure);
  width: 100%;
  margin-left: auto;
  margin-right: auto;

  /* consistent with your centered headings */
  text-align: center;

  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.case-section
  :is(h5.case-block, h5.text-column, h5.case-block.text-column)
  + .checklist {
  margin-top: 0.5rem;
}

.case-section .checklist + p {
  margin-top: 1.25rem;
}

/* CTA links inside reading column */
.text-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
}

/* KEY METRICS */
.key-metrics {
  margin: 1.5rem 0 2rem;
}

.metrics-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.metrics-list li {
  text-align: center;
}

.metrics-list li strong {
  display: block;
  font-size: 2.75rem;
  font-weight: 700;
}

.metrics-list li span {
  font-size: 0.95rem;
  color: #6b7280;
}

/* CAPTION */
.img-caption {
  margin-top: 0.5rem;
  margin-bottom: 5rem;
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--color-text-muted, #6b7280);
}
