/* ===========================================================================
   Aerotur Notícias — Stories (mobile-first)
   =========================================================================== */
:root {
  /* Tema da marca Grupo Aerotur */
  --bg: #141417;          /* fundo neutro escuro (cinza da marca, escurecido) */
  --panel: #1d1d21;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #c11f2f;      /* vermelho Aerotur */
  --accent-dark: #91181b; /* vermelho escuro Aerotur */
  --brand-gray: #58585a;  /* cinza da marca */
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --cat-aviacao: #38bdf8;   --cat-companhias: #818cf8; --cat-aeroportos: #22d3ee;
  --cat-hotelaria: #f472b6; --cat-destinos: #34d399;   --cat-agencias: #fbbf24;
  --cat-operadoras: #fb923c;--cat-cruzeiros: #60a5fa;  --cat-corporativo: #a78bfa;
  --cat-tecnologia: #2dd4bf;--cat-eventos: #f87171;    --cat-mercado: #4ade80;
  --cat-internacional: #c084fc; --cat-nacional: #facc15; --cat-outros: #94a3b8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
}

/* ---------------- Stories shell ---------------- */
.stories-body { overflow: hidden; }

.stories {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;      /* fallback */
  height: 100dvh;
  background: #000;
  user-select: none;
  touch-action: pan-y;
}

/* Barra de progresso */
.progress {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
  right: calc(var(--safe-right) + 10px);
  display: flex;
  gap: 4px;
  z-index: 40;
}
.progress .seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.progress .seg > i {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
}
.progress .seg.done > i { width: 100%; }

/* Barra superior */
.top-bar {
  position: absolute;
  top: calc(var(--safe-top) + 22px);
  left: calc(var(--safe-left) + 14px);
  right: calc(var(--safe-right) + 14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}
.brand { display: flex; align-items: center; }
.brand img { height: 26px; width: auto; display: block; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.speed-btn {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.speed-btn:active { transform: scale(0.94); }

/* Botão de sino (notificações) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.on { background: var(--accent); border-color: var(--accent); }
.icon-btn.busy { opacity: 0.6; pointer-events: none; }

/* Palco / slides */
.stage { position: absolute; inset: 0; z-index: 10; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.slide.active { opacity: 1; visibility: visible; }

.slide .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--panel);
}
.slide .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.05) 32%,
    rgba(0,0,0,0.35) 62%,
    rgba(0,0,0,0.92) 100%
  );
}

.slide .caption {
  position: relative;
  z-index: 2;
  padding: 0 20px calc(var(--safe-bottom) + 96px);
  padding-left: calc(var(--safe-left) + 20px);
  padding-right: calc(var(--safe-right) + 20px);
}

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  color: #06121f;
  background: var(--cat-outros);
  margin-bottom: 12px;
}
.slide .title {
  font-size: clamp(20px, 6vw, 28px);
  line-height: 1.22;
  margin: 0 0 10px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
}
.slide .summary {
  font-size: clamp(14px, 3.8vw, 16px);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.slide .time { font-size: 12px; color: rgba(255,255,255,.6); }

/* Chips por categoria */
.chip-aviacao{background:var(--cat-aviacao)} .chip-companhias{background:var(--cat-companhias)}
.chip-aeroportos{background:var(--cat-aeroportos)} .chip-hotelaria{background:var(--cat-hotelaria)}
.chip-destinos{background:var(--cat-destinos)} .chip-agencias{background:var(--cat-agencias)}
.chip-operadoras{background:var(--cat-operadoras)} .chip-cruzeiros{background:var(--cat-cruzeiros)}
.chip-corporativo{background:var(--cat-corporativo)} .chip-tecnologia{background:var(--cat-tecnologia)}
.chip-eventos{background:var(--cat-eventos)} .chip-mercado{background:var(--cat-mercado)}
.chip-internacional{background:var(--cat-internacional)} .chip-nacional{background:var(--cat-nacional)}
.chip-outros{background:var(--cat-outros)}

/* Zonas de toque */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: calc(var(--safe-bottom) + 84px);
  width: 35%;
  z-index: 20;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.tap-left { left: 0; }
.tap-right { right: 0; width: 65%; }

/* Rodapé fixo */
.bottom-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px calc(var(--safe-bottom) + 14px);
  padding-left: calc(var(--safe-left) + 16px);
  padding-right: calc(var(--safe-right) + 16px);
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
}
.read-full, .read-full-inline {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  padding: 15px 18px;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(193,31,47,.4);
}
.read-full { flex: 1; }
.read-full:active { transform: scale(0.98); }

/* Botão de compartilhar (avião de papel) */
.share-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.12s ease, background 0.2s ease;
}
.share-btn svg { width: 24px; height: 24px; transform: translateX(-1px); }
.share-btn:active { transform: scale(0.92); }
.share-btn.copied { background: var(--accent); border-color: var(--accent); }

/* Toast de feedback */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 92px);
  transform: translate(-50%, 10px);
  z-index: 50;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.share-inline {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}

/* Estado vazio / offline */
.empty-state {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.empty-card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 420px;
  text-align: center;
}
.empty-card h1 { margin: 0 0 10px; font-size: 20px; }
.empty-card p { color: var(--muted); margin: 0 0 14px; }
.empty-card code {
  display: inline-block;
  background: #000;
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

/* ---------------- Página individual ---------------- */
.article-body { background: var(--bg); overflow-y: auto; }
.article { max-width: 760px; margin: 0 auto; padding-bottom: calc(var(--safe-bottom) + 32px); }
.article-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: linear-gradient(to bottom, rgba(20,20,23,.96), rgba(20,20,23,0));
}
.back { color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; }
.header-logo { height: 22px; width: auto; display: block; }
.article-hero { width: 100%; aspect-ratio: 16 / 9; background: var(--panel); overflow: hidden; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-content { padding: 20px 18px 0; padding-left: calc(var(--safe-left) + 18px); padding-right: calc(var(--safe-right) + 18px); }
.article-content h1 { font-size: clamp(22px, 5.5vw, 30px); line-height: 1.25; margin: 12px 0; }
.article-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.article-summary { font-size: 17px; line-height: 1.6; font-weight: 600; margin-bottom: 16px; }
.article-body-text { font-size: 16px; line-height: 1.7; color: var(--muted); }
.read-full-inline { margin-top: 28px; }

/* ---------------- Tablet / desktop ---------------- */
@media (min-width: 768px) {
  .stories {
    position: relative;
    width: min(440px, 100vw);
    height: min(900px, 100dvh);
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
  }
  .stories-body {
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: radial-gradient(circle at 50% 0%, #2a1416, #0d0d0f);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}

/* ---------------- Login ---------------- */
.empty-card .login-nota { font-size: 12px; margin: 18px 0 0; opacity: .7; }
