/* Responsividade compartilhada — Expedição São Pedro e São Paulo
   O site é construído com estilos inline (sem classes), então os seletores
   abaixo usam trechos exatos dos atributos style= já usados nas páginas. */

@media (max-width: 860px) {

  html, body { overflow-x: hidden; }

  /* ===== Gutters laterais: 88px -> 18px em todas as variações ===== */
  [style*="padding: 8px 88px 0"],
  [style*="padding: 24px 88px 0"],
  [style*="padding: 0 88px 0"],
  [style*="padding: 0 88px;"] { padding-left: 18px !important; padding-right: 18px !important; }
  [style*="margin: 0 88px"] { margin-left: 18px !important; margin-right: 18px !important; }

  /* ===== Navbar (pílula) ===== */
  [style*="padding: 14px 20px 14px 28px"] {
    flex-wrap: wrap !important;
    border-radius: 24px !important;
    padding: 14px 18px !important;
    row-gap: 10px !important;
  }
  [style*="padding: 14px 20px 14px 28px"] > a:first-child,
  [style*="padding: 14px 20px 14px 28px"] > div:first-child { font-size: 13px !important; }
  /* menu de links do meio: vira linha própria, centralizada e quebrando */
  [style*="gap: 32px; font-size: 14px; font-weight: 500; color: #DCE9FA"] {
    order: 3;
    width: 100%;
    flex-wrap: wrap !important;
    gap: 10px 18px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  /* ===== Heróis / títulos grandes ===== */
  h1 { font-size: 28px !important; line-height: 1.15 !important; }
  h2 { font-size: 22px !important; }
  [style*="height: 640px"] { height: 78vh !important; min-height: 460px !important; max-height: 640px !important; }
  [style*="height: 460px"] { height: 60vh !important; min-height: 320px !important; max-height: 460px !important; }
  [style*="padding: 56px 64px"] { padding: 24px 22px !important; }
  [style*="padding: 48px 56px"] { padding: 22px 20px !important; }
  [style*="font-size: 17px; line-height: 1.6; color: #DCE9FA; max-width: 680px"] { font-size: 14px !important; }

  /* ===== Linhas de estatísticas / cards fixos (index: 4 cards; CTAs; "Nossos vídeos") ===== */
  [style*="padding: 0 88px; display: flex; gap: 20px"],
  [style*="display: flex; align-items: center; justify-content: space-between; gap: 32px"],
  [style="display: flex; gap: 24px;"] {
    flex-direction: column !important;
  }

  /* ===== Grades (2 ou 3 colunas) -> 1 coluna ===== */
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  /* itens com grid-column: span 2/3 (ex.: galeria) forçariam colunas implícitas mesmo com 1fr acima */
  [style*="grid-column: span 2"],
  [style*="grid-column: span 3"] { grid-column: span 1 !important; }

  /* ===== Painéis divididos (imagem + texto lado a lado) -> empilha ===== */
  div[style*="border-radius: 32px"][style*="overflow: hidden"][style*="display: flex"] {
    flex-direction: column !important;
  }
  div[style*="border-radius: 32px"][style*="overflow: hidden"][style*="display: flex"] > div[style*="height: 100%"],
  div[style*="border-radius: 32px"][style*="overflow: hidden"][style*="display: flex"] > img[style*="height: 100%"] {
    height: 220px !important;
  }
  div[style*="border-radius: 32px"][style*="overflow: hidden"][style*="display: flex"] [style*="padding: 44px 48px"] {
    padding: 26px 22px !important;
  }

  /* ===== Fileiras de fotos lado a lado (altura fixa) -> empilha ===== */
  [style*="display: flex; gap: 16px; height:"],
  [style*="display: flex; gap: 4px; padding: 4px 4px 4px 0"] {
    flex-direction: column !important;
    height: auto !important;
  }
  [style*="display: flex; gap: 16px; height:"] > img,
  [style*="display: flex; gap: 16px; height:"] > div,
  [style*="display: flex; gap: 4px; padding: 4px 4px 4px 0"] > img {
    width: 100% !important;
    height: 200px !important;
    flex: none !important;
    border-radius: 20px !important;
  }

  /* ===== Cabeçalho de seção (título + "ver mais") ===== */
  [style*="align-items: baseline; justify-content: space-between; margin-bottom: 16px"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* ===== Rodapé ===== */
  [style*="justify-content: space-between; font-size: 12px; color: #7A93B8"] {
    flex-direction: column !important;
    gap: 4px !important;
    text-align: center !important;
  }
  [style*="align-items: center; gap: 28px; flex-wrap: wrap"] { justify-content: center !important; text-align: center; }

  /* ===== Régua de logos e imagens: nunca estourar a largura ===== */
  img { max-width: 100%; }
  video { max-width: 100%; }

  /* ===== Formulário (solicitar-vr.html) ===== */
  [style*="display: flex; gap: 14px"] { flex-wrap: wrap !important; }
  [style*="padding: 48px 52px"] { padding: 26px 20px !important; }
}

@media (max-width: 480px) {
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px"] { gap: 8px 16px !important; }
  h1 { font-size: 24px !important; }
}

/* ===== Rodapé: chamada para o canal do YouTube (todas as larguras) ===== */
.footer-yt { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.footer-yt-text { font-size: 14px; line-height: 1.5; color: #A9C4E8; max-width: 300px; text-align: right; }
.footer-yt-btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700; color: #071B3D; text-decoration: none;
  background: linear-gradient(135deg, #FFC960, #FFB020); border-radius: 999px; padding: 12px 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.footer-yt-btn svg { flex-shrink: 0; }
.footer-yt-btn:hover { background: linear-gradient(135deg, #FFD885, #FFC960); }
@media (max-width: 860px) {
  .footer-yt { margin-left: 0; width: 100%; flex-direction: column; gap: 12px; }
  .footer-yt-text { text-align: center; max-width: none; }
}

/* ===== Cards de vídeo do YouTube (video-360, making-of, navio): no celular,
   16:9 fica baixo demais para o botão + textos; usa altura fixa ===== */
@media (max-width: 860px) {
  [id^="player-"] { padding-top: 0 !important; height: 340px; }
  /* card com dois botões e texto longo (video-360 PT) */
  div#player-360 { height: 420px; }
}

/* ===== Galeria: linhas de 390px no desktop; em 1 coluna a altura acompanha a largura ===== */
@media (max-width: 860px) {
  [style*="grid-auto-rows: 390px"] { grid-auto-rows: min(70vw, 460px) !important; }
  /* linha 40/60 da galeria: empilha ocupando duas linhas da grade */
  .galeria-2x3 { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: repeat(2, minmax(0, 1fr)) !important; grid-row: span 2; }
}
