/* History page specific styles */
.history-page { padding-top: 0; }

.history-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4rem;
  overflow: hidden;
  margin-top: 0;
}

.history-hero-bg {
  position: absolute;
  inset: 0;
}

.history-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.history-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15,23,42,0.4) 0%, rgba(15,23,42,0.75) 100%);
}

.history-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8rem 1.5rem 2rem;
  width: 100%;
}

.history-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.history-hero-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.03em;
}

/* Body layout */
.history-body {
  background: var(--cream-50);
  padding: 4rem 0 6rem;
}

.history-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}

/* TOC */
.history-toc {
  position: sticky;
  top: 6rem;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-200);
}

.history-toc h4 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.history-toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.history-toc a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
}

.history-toc a:hover {
  background: var(--cream-100);
  color: var(--primary);
}

.toc-pdf-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent) !important;
  padding: 0.6rem 0.6rem !important;
  border-top: 1px solid var(--cream-200);
  padding-top: 1rem !important;
  margin-top: 0.5rem;
}
.toc-pdf-link:hover {
  background: transparent !important;
  color: var(--gold-600) !important;
  text-decoration: underline;
}

/* Article */
.history-article {
  min-width: 0;
}

.history-section {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--cream-200);
}

.history-section:last-child {
  border-bottom: none;
}

.history-part-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.history-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.history-years {
  font-size: 0.7em;
  font-weight: 400;
  color: var(--text-muted);
}

.history-section h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin: 2rem 0 0.75rem;
}

.history-section p {
  font-size: 1rem;
  color: var(--slate-700);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.history-section blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--cream-100);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--primary);
  line-height: 1.7;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.history-list li {
  font-size: 1rem;
  color: var(--slate-700);
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
}

.history-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Pastor table */
.pastor-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--cream-200);
  box-shadow: var(--shadow-sm);
}

.pastor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pastor-table thead {
  background: var(--primary);
  color: #fff;
}

.pastor-table thead th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.pastor-table tbody tr:nth-child(odd) {
  background: #fff;
}

.pastor-table tbody tr:nth-child(even) {
  background: var(--cream-50);
}

.pastor-table tbody tr:last-child {
  background: var(--cream-100);
  font-weight: 600;
}

.pastor-table td {
  padding: 0.7rem 1.25rem;
  color: var(--slate-700);
  border-bottom: 1px solid var(--cream-200);
}

.pastor-table td:first-child {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  width: 140px;
}

/* Back button area */
.history-back {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .history-container {
    grid-template-columns: 1fr;
  }
  .history-toc {
    position: static;
  }
}

@media (max-width: 600px) {
  .history-hero-title { font-size: 2rem; }
  .history-back { flex-direction: column; }
  .history-back .btn { text-align: center; justify-content: center; }
}
