/* ============================================================
   Galileu News — TV display (v4)
   - Capa estilo broadsheet vintage (manchete + briefs em grid + classificados)
   - flex-shrink: 0 nos headers para não serem cortados
   ============================================================ */

:root {
  --paper:        #f0e4c8;
  --paper-dark:   #e2d2a8;
  --paper-light:  #f7eed5;
  --ink:          #2a1f0e;
  --ink-soft:     #4d3b1f;
  --ink-muted:    #7a5e36;
  --rule:         #8a6d3a;
  --accent-red:   #8b1a1a;

  --serif-display: 'Playfair Display', 'IM Fell English', Georgia, serif;
  --serif-body:    'Crimson Text', 'IM Fell English', Georgia, serif;
  --serif-caps:    'Cinzel', 'Playfair Display', serif;
  --serif-vintage: 'IM Fell English', 'Crimson Text', Georgia, serif;

  --header-h: 56px;
  --footer-h: 36px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--serif-body);
  color: var(--ink);
  background: #1a1410;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   TOOLBAR / FOOTER / LOADING
   ============================================================ */
#toolbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  background: rgba(20, 14, 8, 0.92);
  backdrop-filter: blur(6px);
  color: #d9c89a;
  z-index: 50;
  border-bottom: 1px solid #3a2a14;
}
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid #5a4624;
  color: #e0cfa0;
  padding: 6px 14px; border-radius: 3px;
  font-family: var(--serif-caps); font-size: 12px;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: all 0.15s ease;
}
.btn:hover { background: #3a2a14; border-color: #8a6d3a; color: #f5e4b8; }
.btn:active { transform: scale(0.96); }
.indicator {
  font-family: var(--serif-caps); font-size: 12px;
  letter-spacing: 2px; color: #b8a37a;
  min-width: 100px; text-align: center;
}

#paper-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--footer-h);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: rgba(20, 14, 8, 0.92);
  color: #b8a37a;
  font-family: var(--serif-caps); font-size: 11px; letter-spacing: 3px;
  z-index: 50;
  border-top: 1px solid #3a2a14;
}
.footer-orn { color: var(--accent-red); font-size: 14px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; }
.status-dot::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #d4554c;
}
.status-dot.online::before { background: #6abf69; box-shadow: 0 0 8px #6abf69; }

#loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #15100a;
  color: #b8a37a;
  font-family: var(--serif-vintage); font-style: italic;
  font-size: 18px; letter-spacing: 2px;
  z-index: 100;
}

/* ============================================================
   STAGE
   ============================================================ */
#stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: var(--header-h) 24px var(--footer-h);
  background:
    radial-gradient(ellipse at center, #2a1f10 0%, #15100a 70%, #0a0805 100%);
}
#jornal { /* StPageFlip injeta páginas aqui */ }

/* ============================================================
   PÁGINA — folha de papel envelhecido
   ============================================================ */
.page,
.stf__item {
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 200px 80px at 15% 20%, rgba(139, 110, 60, 0.08), transparent),
    radial-gradient(ellipse 150px 60px at 85% 75%, rgba(100, 80, 40, 0.07), transparent),
    radial-gradient(circle 5px at 30% 60%, rgba(80, 60, 20, 0.10), transparent),
    radial-gradient(circle 3px at 70% 40%, rgba(80, 60, 20, 0.08), transparent),
    linear-gradient(135deg, var(--paper) 0%, var(--paper-light) 50%, var(--paper-dark) 100%);
  color: var(--ink);
  padding: 22px 24px 26px;
  font-family: var(--serif-body);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  display: block;            /* fluxo normal — header fica em cima, conteúdo flui pra baixo */
  position: relative;
}
.page::before,
.stf__item::before {
  content: ''; position: absolute; inset: 12px;
  border: 1px solid rgba(139, 109, 58, 0.25);
  pointer-events: none;
}

/* --- masthead (capa) --- */
.masthead {
  text-align: center;
  border-bottom: 3px double var(--ink);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.masthead-tagline {
  font-family: var(--serif-caps);
  font-size: 8px; letter-spacing: 4px;
  color: var(--ink-muted);
  margin: 0 0 3px;
  text-transform: uppercase;
}
.masthead-title {
  font-family: var(--serif-display);
  font-weight: 900; font-size: 38px;
  line-height: 1; letter-spacing: 1.5px;
  color: var(--ink);
  margin: 0;
  text-transform: uppercase;
  font-variant: small-caps;
}
.masthead-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
  font-family: var(--serif-vintage); font-style: italic;
  font-size: 9.5px; color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 2px 6px;
}
.masthead-meta .ornament { color: var(--accent-red); font-size: 11px; }

/* --- header de página interna --- */
.page-header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-family: var(--serif-vintage); font-style: italic;
  font-size: 9.5px; color: var(--ink-muted);
  letter-spacing: 0.7px;
}
.page-header .pn { font-family: var(--serif-caps); letter-spacing: 2px; }

/* ============================================================
   CAPA — layout broadsheet (manchete + briefs + classificados)
   ============================================================ */
.cover-grid {
  display: block;            /* fluxo normal */
}

/* manchete principal */
.cover-headline {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.cover-headline-kicker {
  font-family: var(--serif-caps);
  font-size: 8.5px; letter-spacing: 4.5px;
  color: var(--accent-red);
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 3px;
}
.cover-headline-title {
  font-family: var(--serif-display);
  font-weight: 900; font-size: 24px;
  line-height: 1.1;
  text-align: center;
  margin: 2px 0 4px;
  color: var(--ink);
}
.cover-headline-lead {
  font-family: var(--serif-vintage); font-style: italic;
  font-size: 12px; color: var(--ink-soft);
  text-align: center;
  max-width: 90%; margin: 0 auto 6px;
}
.cover-headline-body {
  columns: 2; column-gap: 14px; column-rule: 0.5px solid var(--ink-muted);
  font-size: 11.5px; line-height: 1.45;
  text-align: justify;
  hyphens: auto;
}
.cover-headline-body p { margin: 0 0 4px; }

/* grid de seções breves */
.cover-briefs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.cover-brief {
  border-top: 1px solid var(--rule);
  padding-top: 4px;
  overflow: hidden;
}
.cover-brief-kicker {
  font-family: var(--serif-caps);
  font-size: 7px; letter-spacing: 2.5px;
  color: var(--accent-red);
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 2px;
}
.cover-brief-title {
  font-family: var(--serif-display);
  font-weight: 700; font-size: 12.5px;
  line-height: 1.1;
  margin: 0 0 4px;
  text-align: center;
  color: var(--ink);
}
.cover-brief-body {
  font-family: var(--serif-body);
  font-size: 10.5px; line-height: 1.4;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}

/* classificados */
.cover-classifieds {
  border-top: 2px solid var(--ink);
  padding-top: 5px;
}
.cover-classifieds-title {
  font-family: var(--serif-caps);
  font-size: 8px; letter-spacing: 3.5px;
  text-align: center;
  margin: 0 0 4px;
  color: var(--accent-red);
  text-transform: uppercase;
}
.cover-classifieds-list {
  font-family: var(--serif-vintage);
  font-size: 9.5px; line-height: 1.35;
  columns: 2; column-gap: 14px; column-rule: 0.5px solid var(--ink-muted);
}
.cover-classifieds-list .ad {
  break-inside: avoid;
  margin: 0 0 3px;
}
.cover-classifieds-list .ad strong {
  font-family: var(--serif-caps);
  font-size: 8px; letter-spacing: 1.5px;
}

/* ============================================================
   SEÇÕES INTERNAS (páginas 2+)
   ============================================================ */
.page-body { display: block; }

.section { margin-bottom: 14px; }
.section:last-child { margin-bottom: 0; }
.section-title {
  font-family: var(--serif-display);
  font-weight: 900; font-size: 19px;
  line-height: 1.1;
  margin: 0 0 4px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.5px;
}
.section-kicker {
  font-family: var(--serif-caps);
  font-size: 8.5px; letter-spacing: 3.5px;
  color: var(--accent-red);
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 3px;
}
.section-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 3px;
  margin: 4px auto 9px;
  width: 80%;
}
.section-body {
  font-family: var(--serif-body);
  font-size: 13px; line-height: 1.5;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
}
.section-body.cols-2 { columns: 2; column-gap: 16px; column-rule: 0.5px solid var(--ink-muted); }
.section-body p { margin: 0 0 6px; }

/* drop cap manual */
.dropcap {
  font-family: var(--serif-display);
  font-weight: 900;
  font-size: 38px;
  line-height: 0.85;
  color: var(--accent-red);
  float: left;
  margin: 4px 6px 0 0;
}

/* ============================================================
   AO VIVO (página 2)
   ============================================================ */
.live-feed { display: flex; flex-direction: column; gap: 10px; }
.live-empty {
  text-align: center;
  font-family: var(--serif-vintage); font-style: italic;
  color: var(--ink-muted);
  padding: 18px 12px;
  border: 1px dashed var(--rule);
  background: rgba(255, 250, 230, 0.4);
  font-size: 12.5px;
}
.live-post {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  background: rgba(255, 250, 230, 0.5);
  position: relative;
  animation: fade-in 0.5s ease;
}
.live-post::before, .live-post::after {
  content: ''; position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--rule);
}
.live-post::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.live-post::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.live-author {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--serif-caps);
  font-size: 8.5px; letter-spacing: 2.5px;
  color: var(--ink-muted); text-transform: uppercase;
  margin-bottom: 3px;
}
.live-headline {
  font-family: var(--serif-display);
  font-weight: 700; font-size: 14.5px;
  line-height: 1.2;
  margin: 0 0 5px;
  color: var(--ink);
}
.live-body {
  font-family: var(--serif-body);
  font-size: 12px; line-height: 1.45;
  color: var(--ink-soft);
  text-align: justify;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.live-post.fresh {
  box-shadow: 0 0 0 2px var(--accent-red);
  animation: fresh-pulse 1.6s ease 1, fade-in 0.5s ease;
}
@keyframes fresh-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-red); }
  50%      { box-shadow: 0 0 0 6px rgba(139, 26, 26, 0.25); }
}

/* ============================================================
   ESTUDO (placeholder visual)
   ============================================================ */
.study-placeholder {
  font-family: var(--serif-vintage); font-style: italic;
  color: var(--ink-muted);
  text-align: center;
  border: 1px dashed var(--rule);
  background: rgba(255, 250, 230, 0.4);
  padding: 24px 18px;
  margin-top: 20px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 14, 8, 0.94);
  color: #f5e4b8;
  font-family: var(--serif-vintage); font-style: italic;
  padding: 10px 20px;
  border: 1px solid #5a4624;
  border-radius: 3px;
  z-index: 150;
  animation: toast-in 0.3s ease, toast-out 0.4s ease 3.6s forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translate(-50%, 12px); }
}

/* StPageFlip — sombras */
.stf__parent { margin: 0 auto; }
.stf__block { box-shadow: 0 0 30px rgba(0, 0, 0, 0.6); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .masthead-title { font-size: 28px; }
  .cover-headline-title { font-size: 18px; }
  .cover-briefs { grid-template-columns: 1fr 1fr; }
  .cover-classifieds-list { columns: 1; }
  .section-body.cols-2 { columns: 1; }
  .page, .stf__item { padding: 14px 14px 16px; font-size: 12px; }
  .indicator { display: none; }
}
