/* ==========================================================================
   KD ESCOLA — identidade visual compartilhada (derivada do style da home)
   Usado por: escola.html / raio-x-do-roteiro.html / produtor-fora-do-eixo.html
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Michroma&family=Roboto:wght@400;600;700;900&display=swap');

:root {
  --kd-bg-top: #08142b;
  --kd-bg-bottom: #000408;
  --kd-text: #fff;
  --kd-text-2: #a0b4cc;
  --kd-accent: #00d4ff;
  --kd-accent-hover: #4de0ff;
  --kd-panel: rgba(8, 20, 40, 0.6);
  --kd-border: rgba(0, 212, 255, 0.15);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  /* ponytail: this stack is copied verbatim from Tailwind v4's preflight
     (--default-font-family). The home gets it free from the CDN; these pages don't
     load Tailwind, so without it .episode-caption falls back to Times. */
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  background: linear-gradient(180deg, #08142b 0%, #000408 100%);
  background-attachment: fixed;
  color: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, iframe, video { max-width: 100%; height: auto; }
img, video { display: block; vertical-align: middle; }

a { color: var(--kd-accent); }

h1, h2, h3 {
  font-family: 'Michroma', sans-serif;
  font-weight: 400;
  letter-spacing: 1px;
}

/* --- PARTÍCULAS --- */
.dust-container {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}

.dust-particle {
  position: absolute;
  background: rgba(150, 220, 255, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(150, 220, 255, 0.4);
  opacity: 0;
  animation: dust-move linear infinite;
}

@keyframes dust-move {
  0%   { opacity: 0;   transform: translate(0, 0) scale(1); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.5; }
  100% { opacity: 0;   transform: translate(var(--tx), var(--ty)) scale(0.5); }
}

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  min-height: 68px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(8, 20, 43, 0.9) 10%, transparent 100%);
  transition: background 0.4s ease;
}

.navbar.scrolled {
  background: rgba(8, 20, 43, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Roboto', sans-serif;
  font-weight: 900; font-size: 1.2rem;
  color: var(--kd-accent);
  letter-spacing: -0.5px; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
  text-decoration: none;
}

.logo img { height: 28px; width: auto; display: block; }

.nav-links { display: flex; gap: 20px; list-style: none; align-items: center; margin: 0; padding: 0; }

.nav-links a {
  color: #dceeff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: color 0.3s;
}

.nav-links a:hover { color: #fff; }

.menu-toggle {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.5rem; cursor: pointer; padding: 10px;
}

/* --- HERO DAS PÁGINAS INTERNAS --- */
.page-hero {
  position: relative;
  z-index: 5;
  margin-top: 68px;
  padding: 90px 4% 70px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.12) 0%, transparent 60%),
    linear-gradient(135deg, rgba(8, 20, 43, 0.9) 0%, rgba(0, 5, 15, 0.9) 100%);
  border-bottom: 1px solid var(--kd-border);
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at 20% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 20% 30%, #000, transparent 75%);
  pointer-events: none;
}

.page-hero-inner { position: relative; z-index: 2; max-width: 900px; }

.eyebrow {
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  color: var(--kd-accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 20px;
}

.page-hero h1 {
  font-size: 1.68rem;
  margin: 0 0 15px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-hero p {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: #e0f0ff;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 640px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- BOTÕES --- */
.btn {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  padding: 10px 26px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-radius: 30px;
  color: var(--kd-accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.btn:hover {
  background: var(--kd-accent);
  color: #08142b;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
  border-color: var(--kd-accent);
}

.btn-solid {
  background: var(--kd-accent);
  color: #08142b;
  border-color: var(--kd-accent);
}

.btn-solid:hover {
  background: var(--kd-accent-hover);
  color: #08142b;
}

/* --- FILEIRAS (mesmo padrão de "Nossos Projetos") --- */
section[id] { scroll-margin-top: 100px; }
.content-rows { position: relative; z-index: 10; padding: 20px 0 60px; }

.row { margin-bottom: 40px; }

.row-header {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 15px;
}

.row-title {
  font-family: 'Michroma', sans-serif;
  font-size: 0.84rem;
  font-weight: 400;
  color: #e5f3ff;
  letter-spacing: 1px;
  margin: 0;
}

.slider { position: relative; overflow: visible; }

.slider-content {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 40px 15px;
  scrollbar-width: none;
  align-items: flex-start;
}

.slider-content::-webkit-scrollbar { display: none; }

.centered-container { width: fit-content; max-width: 100%; margin: 0 auto; }

/* --- CARD DE SERVIÇO / PROJETO --- */
.episode-card {
  flex: 0 0 auto;
  width: 300px;
  height: 480px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.episode-card:hover { transform: scale(1.05); z-index: 999; }

.episode-thumb-wrapper {
  position: relative;
  width: 80%;
  height: 80%;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s;
}

.episode-card:hover .episode-thumb-wrapper {
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.8), 0 10px 40px rgba(0, 0, 0, 0.9);
  border-color: var(--kd-accent);
}

.episode-thumb-wrapper img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.episode-caption {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.episode-caption span {
  font-size: 0.85rem;
  color: var(--kd-text-2);
}

/* ponytail: must stay inline (like the home's <a>). display:block here makes the <a>
   generate a box, so .episode-thumb-wrapper's height:80% resolves against the
   collapsed <a> instead of the 480px article — thumb flattens to 2px. */
a.card-link { text-decoration: none; color: inherit; }

/* Linha de moldura ao redor da imagem (thumb) na seção KD ESCOLA — só na imagem, não no card */
#servicos .episode-thumb-wrapper {
  border: 1px solid rgba(0, 212, 255, 0.5);
}

/* Espaço (padding) nas extremidades do CONTAINER da seção, para o glow do hover
   do primeiro/último card não ser cortado pelas bordas. Sem margin entre os cards. */
#servicos .slider-content {
  padding-left: 50px;
  padding-right: 32px;
}


/* --- CONTEÚDO DAS SUB-PÁGINAS --- */
.article {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 4%;
}

.article h2 {
  font-size: 1.2rem;
  color: var(--kd-accent);
  margin: 45px 0 15px;
}

.article p {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  color: var(--kd-text-2);
  line-height: 1.8;
  margin: 0 0 15px;
}

.article p strong { color: #fff; }

.article-hero-img {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--kd-border);
  display: block;
  margin: 0 0 30px;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0;
}

.pillar {
  padding: 18px;
  background: var(--kd-panel);
  border-left: 2px solid var(--kd-accent);
  border-radius: 3px;
}

.pillar strong {
  display: block;
  color: var(--kd-accent);
  font-family: 'Michroma', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pillar span { font-family: 'Roboto', sans-serif; color: var(--kd-text-2); font-size: 0.85rem; line-height: 1.6; }

.highlight {
  padding: 18px 22px;
  margin: 25px 0;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--kd-border);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- CTA FINAL --- */
.cta-band {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 60px 4%;
  background: linear-gradient(135deg, rgba(8, 20, 43, 0.6) 0%, rgba(0, 5, 15, 0.6) 100%);
  border-top: 1px solid var(--kd-border);
}

.cta-band h2 { font-size: 1.1rem; margin: 0 0 12px; color: #fff; }

.cta-band p { color: var(--kd-text-2); font-size: 0.95rem; margin: 0 0 25px; }

.cta-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* --- FOOTER --- */
.footer {
  padding: 40px 4%;
  color: #5a7a9a;
  font-size: 0.8rem;
  text-align: center;
  border-top: 1px solid rgba(0, 150, 200, 0.1);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  position: relative;
  z-index: 10;
}

.footer a { color: var(--kd-accent); text-decoration: none; }
.footer a:hover { color: var(--kd-accent-hover); }
.footer .footer-contact { margin-bottom: 20px; }
.footer .footer-contact strong { color: #a0b4cc; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0;
    width: 100%;
    background: rgba(8, 20, 43, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    text-align: center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .nav-links.active { display: flex; }

  .page-hero { padding: 60px 5% 50px; margin-top: 78px; }

  .row-header, .slider, .footer { padding-left: 5%; padding-right: 5%; }

  /* ponytail: minmax(0,1fr) + width:100% — the home's fit-content container lets 1fr
     collapse to each image's intrinsic width, so card widths drift per image. */
  #servicos .centered-container { width: 100%; }

  #servicos .slider-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 15px;
    padding: 40px 32px 0;
  }

  #servicos .episode-card { width: 100%; height: auto; min-height: 240px; }

  #servicos .episode-thumb-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    border-radius: 13px;
  }

  #servicos .episode-caption { font-size: 0.62rem; margin-top: 5px; }
  #servicos .episode-caption span { font-size: 0.58rem; }

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

  .article { padding: 40px 6%; }
}

@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    min-height: calc(68px + env(safe-area-inset-top));
  }
  .nav-links { top: calc(68px + env(safe-area-inset-top)); }
}

@media (max-width: 768px) {
  .navbar { min-height: 78px; padding-left: 5%; padding-right: 5%; }
  .logo { font-size: 1.2rem; line-height: 1.1; white-space: nowrap; flex-shrink: 0; }
  .logo img { height: 42px; }
  .menu-toggle { font-size: 1.8rem; padding: 12px; }
  .nav-links { top: 78px; padding: 24px 20px; }
}

@media (min-width: 769px) {
  .logo { font-size: 1.6rem; }
  .logo img { height: 30px; }
}

/* --- HERO RESPONSIVO (smartphone) ---
   No desktop a imagem vem do background do <header>. No mobile ela vira um
   <img class="page-hero-image"/> em cima, e o texto (.page-hero-inner) fica abaixo. */
.page-hero-image { display: none; }

@media (max-width: 768px) {
  .page-hero {
    display: flex;
    flex-direction: column;
    width: 100vw;                      /* largura total da TELA — a imagem cobre a tela
                                          inteira sem corte lateral */
    padding: 0 0 50px;
    background: none !important; /* sem imagem nem cor de fundo no mobile — a única
                                     imagem é a <img class="page-hero-image"/> do topo */
  }

  /* Grid como overlay cobrindo TUDO (imagem + texto). A máscara centralizada
     faz as linhas aparecerem tanto na imagem do topo quanto na área do texto. */
  .page-hero::after {
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 85%);
    z-index: 3; /* acima da imagem (z:1) e do texto (z:2) — overlay */
  }

  .page-hero-image {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: right center; /* ancora na DIREITA da tela; o corte do excesso da
                                      imagem panorâmica fica só à esquerda */
    opacity: 0.75; /* 25% transparente / 75% sólida */
    z-index: 1;
  }

  .page-hero-inner {
    max-width: 100%;
    padding: 24px 5% 0;
  }
}

/* --- BOTÕES MOBILE: centralizados e full-width nos smartphones --- */
@media (max-width: 768px) {
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* botões que usam inline justify-content flex-start no hero ganham centralização mobile */
  .page-hero-inner .cta-actions,
  .article .cta-actions {
    align-items: stretch;
  }
}
