/* Hearing Him - INVESTIGACAO (Index + View)
   - Tema escuro consistente
   - Grid centralizado no index
   - Timeline responsiva no view
*/

:root {
  --bg: #0b1220;
  --panel: #0f172a;
  --card: #111b2e;
  --card2: #0f1a2c;
  --text: #e5e7eb;
  --muted: #a7b2c3;
  --muted2: #7b879a;
  --border: rgba(148, 163, 184, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --amber: #f59e0b;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  height: 100%;
}

body {
  background: radial-gradient(1200px 500px at 50% -200px, rgba(245, 158, 11, 0.08), transparent 60%),
              linear-gradient(180deg, var(--panel), var(--bg));
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

.text-amber {
  color: var(--amber);
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 38px 18px 64px;
}

/* =====================
   INDEX (index.php)
   ===================== */

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.main-title {
  font-size: 1.8rem;
  letter-spacing: 0.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.sub-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.header-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.lang-link {
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--muted);
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.lang-link:hover {
  color: var(--text);
}

.lang-link.active {
  color: var(--text);
  border-bottom-color: var(--amber);
}

.dashboard-grid {
  display: grid;
  /* 3 cards no desktop (como antes) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  justify-content: stretch;
  align-items: stretch;
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  position: relative;
  overflow: hidden;
  min-height: 230px;
}

.case-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--amber);
}

.case-card:hover {
  transform: translateY(-2px);
  transition: transform 0.15s ease;
}

.card-role {
  font-size: 0.72rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted2);
}

.card-title {
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 800;
}

.card-summary {
  color: var(--text);
  opacity: 0.92;
  font-size: 0.95rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
}

.card-footer span:first-child {
  color: var(--muted);
}

/* =====================
   VIEW (view.php)
   ===================== */

.back-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  opacity: 0.92;
}

.back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.page-title {
  font-size: clamp(1.75rem, 3.8vw, 2.75rem);
  line-height: 1.1;
  margin: 10px 0;
  font-weight: 900;
}

.timeline-container {
  margin-bottom: 26px;
}

.timeline-flex {
  display: flex;
  align-items: stretch;
  gap: 18px;
}

.time-node {
  flex: 1;
  min-width: 0; /* permite wrap correto */
}

.node-label {
  font-weight: 900;
  letter-spacing: 0.7px;
  font-size: 0.95rem;
  color: var(--text);
}

.node-ref {
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.verse-box {
  margin-top: 10px;
  padding: 14px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--amber);
  color: rgba(229, 231, 235, 0.92);
  font-style: italic;
  overflow-wrap: anywhere;
}

.timeline-middle {
  width: 160px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.duration-badge {
  display: inline-block;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.2px;
  padding: 0;
}

.timeline-line {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 999px;
}

.content-body {
  margin-top: 20px;
  color: rgba(229, 231, 235, 0.92);
}

.content-body h2,
.content-body h3,
.content-body h4 {
  margin-top: 18px;
  margin-bottom: 10px;
  line-height: 1.25;
}

.content-body h2 { font-size: 1.35rem; }
.content-body h3 { font-size: 1.15rem; }
.content-body p { margin: 10px 0; }

.content-body ul,
.content-body ol {
  padding-left: 20px;
  margin: 10px 0;
}

.content-body li {
  margin: 6px 0;
}

.content-body strong {
  color: var(--text);
}

/* =====================
   Responsivo
   ===================== */

@media (max-width: 900px) {
  .container {
    padding-top: 28px;
  }

  .main-title {
    font-size: 1.6rem;
  }
}

/* 2 colunas em telas médias */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .case-card {
    min-height: unset;
  }

  .timeline-flex {
    flex-direction: column;
  }

  .timeline-middle {
    width: 100%;
    min-width: 0;
  }

  .timeline-line {
    width: 100%;
  }

  /* no mobile, o nodo final nao precisa ficar alinhado a direita */
  .time-node[style*="text-align:right"] {
    text-align: left !important;
  }

  .verse-box[style*="border-right"] {
    border-right: none !important;
    border-left: 2px solid var(--amber) !important;
  }
}

/* =====================
   Compatibilidade (classes antigas, se existirem)
   ===================== */

.main-header {
  background: transparent;
  color: var(--text);
  padding: 0;
  position: static;
  box-shadow: none;
}

.logo-area h1 { color: var(--text); }

.language-area select {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.phase-title { color: var(--text); border-bottom-color: var(--border); }

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
}

.card-content p { color: var(--muted); }

.btn-open {
  background: rgba(245, 158, 11, 0.18);
  color: var(--text);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.btn-open:hover {
  background: rgba(245, 158, 11, 0.26);
}
