/* =============================================
   HISTÓRICO — CSS EXCLUSIVO
   Estilos de header/footer/floating/back-to-top
   já vêm de header-footer.css e base-public.css
   ============================================= */

/* === HERO COMPACTO COM BREADCRUMB + STATS === */
.afh-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 48px 32px 72px;
  position: relative;
  overflow: hidden;
}

.afh-hero::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -50px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 201, 226, 0.22), transparent 70%);
  pointer-events: none;
}

.afh-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: end;
}

.afh-breadcrumb {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 12px;
}

.afh-breadcrumb a {
  color: #bce8f3;
  text-decoration: none;
}

.afh-breadcrumb a:hover {
  text-decoration: underline;
}

.afh-breadcrumb .sep {
  opacity: 0.5;
  margin: 0 2px;
}

.afh-hero h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 14px;
}

.afh-hero p {
  font-size: 14.5px;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 520px;
}

.afh-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.afh-back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Stats grid (glass-morphism) */
.afh-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.afh-stat .num {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.afh-stat .lbl {
  font-size: 10.5px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* === TOOLBAR (busca + selects) === */
.afh-toolbar {
  max-width: 1100px;
  margin: -32px auto 0;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

.afh-toolbar-inner {
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.afh-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6f5f1;
  border: 1px solid #e5e2db;
  border-radius: 10px;
  padding: 10px 14px;
}

.afh-search svg {
  flex-shrink: 0;
  color: #5a4a3a;
}

.afh-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: #1a1a1a;
}

.afh-search input::placeholder {
  color: var(--color-text-muted);
}

.afh-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f6f5f1;
  border: 1px solid #e5e2db;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #5a4a3a;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.afh-select select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-family: inherit;
  color: #1a1a1a;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.afh-select svg {
  color: #5a4a3a;
  flex-shrink: 0;
  pointer-events: none;
}

/* === CHIPS POR CARGO === */
.afh-chips {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 32px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.afh-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid #d8d4cc;
  background: #fff;
  color: #5a4a3a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.afh-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.afh-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.afh-chip .count {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.afh-chip.active .count {
  background: rgba(255, 255, 255, 0.25);
}

/* === LAYOUT GRID (decade nav + timeline) === */
.afh-layout {
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
  align-items: start;
}

/* Sticky decade nav */
.afh-decadenav {
  position: sticky;
  top: 90px;
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 14px 12px;
}

.afh-decadenav .ttl {
  font-size: 10.5px;
  font-weight: 700;
  color: #5a4a3a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #efece6;
}

.afh-decade-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #5a4a3a;
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background 0.15s;
}

.afh-decade-link:hover {
  background: #f6f5f1;
}

.afh-decade-link.active {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
  font-weight: 700;
}

.afh-decade-link .yr {
  font-weight: 700;
}

.afh-decade-link .ct {
  font-size: 10.5px;
  background: #efece6;
  padding: 1px 7px;
  border-radius: 10px;
}

.afh-decade-link.active .ct {
  background: var(--color-primary);
  color: #fff;
}

/* === TIMELINE === */
.afh-tl {
  position: relative;
}

.afh-tl-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 30px;
  width: 3px;
  background: linear-gradient(to bottom, var(--color-primary), #4ac9e2 80%, transparent);
  z-index: 1;
  border-radius: 2px;
}

/* Decade header (na timeline) */
.afh-decade-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0 14px;
  padding-left: 60px;
}

.afh-decade-header:first-child {
  margin-top: 0;
}

.afh-decade-header::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  border: 4px solid #fafafa;
  z-index: 2;
  box-shadow: 0 0 0 1px #d4ccc0;
}

.afh-decade-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.afh-decade-header .count-bdg {
  font-size: 11px;
  font-weight: 600;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Event / card container */
.afh-event {
  position: relative;
  padding-left: 60px;
  margin-bottom: 14px;
}

.afh-event::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--color-primary);
  z-index: 2;
}

.afh-event.current::before {
  background: #d93025;
  border-color: #fff;
  box-shadow: 0 0 0 2px #d93025;
}

/* === CARD === */
.afh-card {
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 14px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 18px;
  align-items: center;
  transition: all 0.2s;
}

.afh-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--color-primary);
}

.afh-card.current {
  border-color: #d93025;
  background: linear-gradient(to right, #fef7f5, #fff 40%);
}

/* Card photo / initials */
.afh-card-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f8f5, #e3f1ed);
  border: 3px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  color: var(--color-primary-dark);
  flex-shrink: 0;
  overflow: hidden;
}

.afh-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.afh-card.current .afh-card-photo {
  border-color: #d93025;
  color: #9a2218;
  background: linear-gradient(135deg, #ffeae7, #ffd5cf);
}

/* Card info */
.afh-card-info {
  min-width: 0;
}

.afh-card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.afh-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

/* Tag colors by cargo */
.afh-tag.presidente {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

.afh-tag.vice_presidente {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary-dark);
}

.afh-tag.pastor {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

.afh-tag.tesoureiro,
.afh-tag.tesouraria {
  background: rgba(184, 120, 17, 0.12);
  color: #b87811;
}

.afh-tag.secretario,
.afh-tag.secretaria {
  background: rgba(30, 142, 62, 0.12);
  color: #1e8e3e;
}

.afh-tag.presbitero {
  background: rgba(75, 85, 99, 0.12);
  color: #4b5563;
}

.afh-tag.evangelista {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.afh-tag.fiscal {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.afh-tag.fundador {
  background: #fef3e0;
  color: #b87811;
}

.afh-tag.atual {
  background: #ffe5e0;
  color: #9a2218;
  gap: 5px;
}

.afh-tag.atual .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d93025;
  box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.6);
  animation: afhPulse 1.4s infinite;
}

@keyframes afhPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(217, 48, 37, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0);
  }
}

.afh-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
  line-height: 1.25;
}

.afh-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-text-light);
}

.afh-card-meta .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.afh-card-meta .item.obs {
  opacity: 0.85;
}

.afh-card-meta svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Card side (years, link) */
.afh-card-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  border-left: 1px dashed #e0dccf;
  padding-left: 18px;
  min-width: 130px;
}

.afh-card-side .yrs {
  font-weight: 900;
  font-size: 20px;
  color: var(--color-primary-dark);
  line-height: 1;
}

.afh-card-side .yrs .dash {
  opacity: 0.5;
  padding: 0 4px;
}

.afh-card-side .yrs-label {
  font-size: 10px;
  color: #5a4a3a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.afh-card-side .perfil-link {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.afh-card-side .perfil-link:hover {
  background: var(--color-primary);
  color: #fff;
}

/* === FUNDACAO MARKER === */
.afh-fundacao {
  position: relative;
  padding-left: 60px;
  margin-top: 30px;
}

.afh-fundacao::before {
  content: "\2605";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #b87811;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 4px solid #fafafa;
  box-shadow: 0 0 0 1px #d4ccc0;
  z-index: 2;
}

.afh-fundacao-card {
  background: linear-gradient(135deg, #fef3e0, #faecd1);
  border: 1px solid #e8d4a4;
  border-radius: 14px;
  padding: 18px 22px;
}

.afh-fundacao-card .ttl {
  font-size: 17px;
  font-weight: 700;
  color: #7a4811;
  margin: 0 0 4px;
}

.afh-fundacao-card .sub {
  font-size: 12.5px;
  color: #7a5811;
  line-height: 1.5;
}

/* === CTA BAR === */
.afh-cta {
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 0 32px;
}

.afh-cta-inner {
  background: linear-gradient(135deg, #f0f8f5, #e8efe8);
  border: 1px solid #d4e0d6;
  border-radius: 14px;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
}

.afh-cta-inner h4 {
  font-size: 17px;
  color: var(--color-primary-dark);
  margin: 0 0 4px;
}

.afh-cta-inner p {
  font-size: 12.5px;
  color: #5a4a3a;
  margin: 0;
  line-height: 1.5;
}

.afh-action {
  padding: 12px 22px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.afh-action.primary {
  background: var(--color-primary);
  color: #fff;
}

.afh-action.primary:hover {
  background: var(--color-primary-dark);
}

/* === SKELETON LOADING === */
.afh-skeleton-group {
  padding-left: 60px;
}

.afh-skeleton-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-left: 60px;
  position: relative;
}

.afh-skeleton-header::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e2db;
}

.afh-skeleton-card {
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 14px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  margin-left: 60px;
}

.skel-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #eee;
}

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: #eee;
}

.skel-line.w60 {
  width: 60%;
}

.skel-line.w40 {
  width: 40%;
}

.skel-line.w30 {
  width: 30%;
}

.skel-line.w80 {
  width: 80%;
}

.skel-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skel-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 100px;
}

.skel-pulse {
  animation: skelPulse 1.5s ease-in-out infinite;
}

@keyframes skelPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Bar skeleton for decade header */
.skel-bar {
  height: 22px;
  width: 140px;
  border-radius: 6px;
  background: #eee;
}

.skel-badge {
  height: 18px;
  width: 60px;
  border-radius: 10px;
  background: #eee;
}

/* === EMPTY STATE === */
.afh-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.afh-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: #ccc;
}

.afh-empty h4 {
  font-size: 18px;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.afh-empty p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

/* === CONTAGEM DE RESULTADOS === */
.afh-results-count {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 0 32px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* === RESPONSIVO === */
@media (max-width: 1024px) {
  .afh-hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .afh-hero-stats {
    max-width: 400px;
  }

  .afh-toolbar-inner {
    grid-template-columns: 1fr 1fr;
  }

  .afh-toolbar-inner .afh-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .afh-hero {
    padding: 32px 16px 56px;
  }

  .afh-hero h1 {
    font-size: 28px;
  }

  .afh-hero p {
    font-size: 13px;
  }

  .afh-hero-stats {
    padding: 14px;
    gap: 10px;
  }

  .afh-stat .num {
    font-size: 24px;
  }

  .afh-toolbar {
    padding: 0 16px;
    margin-top: -24px;
  }

  .afh-toolbar-inner {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .afh-toolbar-inner .afh-search {
    grid-column: auto;
  }

  .afh-chips {
    padding: 0 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .afh-chips::-webkit-scrollbar {
    display: none;
  }

  .afh-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Decade nav vira horizontal pills */
  .afh-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px 60px;
    margin-top: 24px;
  }

  .afh-decadenav {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px;
    align-items: center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .afh-decadenav::-webkit-scrollbar {
    display: none;
  }

  .afh-decadenav .ttl {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    white-space: nowrap;
    margin-right: 4px;
  }

  .afh-decade-link {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 10px;
  }

  /* Cards stack vertical */
  .afh-card {
    grid-template-columns: 50px 1fr;
    gap: 12px;
    padding: 14px;
  }

  .afh-card-photo {
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  .afh-card-side {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px dashed #e0dccf;
    padding-left: 0;
    padding-top: 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .afh-card-side .yrs {
    font-size: 16px;
  }

  .afh-card-name {
    font-size: 15px;
  }

  .afh-card-meta {
    gap: 8px;
    font-size: 11px;
  }

  /* Event dot adjust */
  .afh-event {
    padding-left: 44px;
  }

  .afh-event::before {
    left: 14px;
    top: 22px;
    width: 10px;
    height: 10px;
  }

  .afh-decade-header {
    padding-left: 44px;
  }

  .afh-decade-header::before {
    left: 8px;
    width: 22px;
    height: 22px;
  }

  .afh-decade-header h3 {
    font-size: 18px;
  }

  .afh-tl-line {
    left: 18px;
    width: 2px;
  }

  .afh-fundacao {
    padding-left: 44px;
  }

  .afh-fundacao::before {
    left: 4px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* Skeleton mobile */
  .afh-skeleton-card {
    grid-template-columns: 50px 1fr;
    margin-left: 44px;
  }

  .afh-skeleton-card .skel-side {
    display: none;
  }

  .afh-skeleton-header {
    padding-left: 44px;
  }

  .afh-skeleton-header::before {
    left: 8px;
    width: 22px;
    height: 22px;
  }

  /* CTA */
  .afh-cta {
    padding: 0 16px;
  }

  .afh-cta-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 18px 16px;
  }

  .afh-results-count {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .afh-hero h1 {
    font-size: 24px;
  }

  .afh-stat .num {
    font-size: 20px;
  }

  .afh-stat .lbl {
    font-size: 9.5px;
  }
}
