/*
Theme Name: TTT Dictionary
Theme URI: https://truth.circlescosites.com/dictionary/
Description: A modern dictionary/glossary theme for the Two by Two church terminology archive.
Version: 1.1
Author: Telling the Truth
Text Domain: ttt-dictionary
*/

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a1a2e;
  background: #f7f8fa;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #1a56db;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #1e40af;
}

/* ─── Header ─── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
}
.site-branding a {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.3px;
  text-decoration: none;
  line-height: 1;
}
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.header-search {
  position: relative;
  width: 100%;
  max-width: 480px;
}
.header-search form {
  position: relative;
}
.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.header-search input[type="search"] {
  width: 100%;
  padding: 9px 18px 9px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 100px;
  font-size: 14px;
  background: #f7f8fa;
  color: #1a1a2e;
  outline: none;
  transition: all 0.25s ease;
  -webkit-appearance: none;
}
.header-search input[type="search"]:focus {
  border-color: #1a56db;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.header-search input[type="search"]::placeholder {
  color: #9ca3af;
}
.header-right {
  display: flex;
  align-items: center;
}
.header-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #1a56db;
  background: #f0f4ff;
  padding: 8px 16px;
  border: 1px solid #1a56db;
  border-radius: 100px;
  transition: all 0.2s;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.header-site-link svg {
  flex-shrink: 0;
}
.header-site-link:hover {
  background: #1a56db;
  color: #fff;
}

/* ─── Hero Section ─── */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 80px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-section h1 {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 12px;
  position: relative;
}
.hero-section .subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
  position: relative;
}
.hero-stat {
  text-align: center;
}
.hero-stat .stat-number {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  display: block;
}
.hero-stat .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  display: block;
}

/* ─── Big Search ─── */
.big-search {
  max-width: 640px;
  margin: -28px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.big-search form {
  position: relative;
}
.big-search input[type="search"] {
  width: 100%;
  padding: 18px 24px 18px 56px;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  background: #fff;
  color: #1a1a2e;
  outline: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.big-search input[type="search"]:focus {
  box-shadow: 0 8px 40px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.big-search input[type="search"]::placeholder {
  color: #9ca3af;
}
.big-search .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}
.big-search .search-icon svg {
  width: 22px;
  height: 22px;
}

/* Live Search Results */
.live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.live-search-results.active {
  display: block;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.live-search-results a {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  color: #1a1a2e;
  transition: background 0.15s;
}
.live-search-results a:last-child {
  border-bottom: none;
}
.live-search-results a:hover {
  background: #f0f4ff;
}
.live-search-results .result-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.live-search-results .result-excerpt {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}
.live-search-results .no-results {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* ─── Alpha Navigation ─── */
.alpha-nav {
  max-width: 1200px;
  margin: 40px auto 8px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}
.alpha-nav a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}
.alpha-nav a:hover {
  background: #1a56db;
  color: #fff;
  border-color: #1a56db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,86,219,0.25);
}
.alpha-nav a.disabled {
  color: #d1d5db;
  background: transparent;
  border-color: #f3f4f6;
  pointer-events: none;
}

/* ─── Letter Sections ─── */
.letter-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.letter-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #1a56db;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
}
.letter-heading::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, #e5e7eb, transparent);
}

/* ─── Entry Cards ─── */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.entry-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.entry-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #1a56db;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.entry-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.entry-card:hover::before {
  opacity: 1;
}
.entry-card h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.entry-card h3 a {
  color: #1a1a2e;
  transition: color 0.2s;
}
.entry-card:hover h3 a {
  color: #1a56db;
}
.card-excerpt {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 16px;
}
.read-more {
  font-size: 13px;
  font-weight: 600;
  color: #1a56db;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}
.entry-card:hover .read-more {
  gap: 8px;
}

/* ─── Single Article ─── */
.single-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.single-header {
  margin-bottom: 40px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  padding: 8px 16px;
  border-radius: 8px;
  background: #f3f4f6;
  transition: all 0.2s;
}
.back-link:hover {
  background: #e5e7eb;
  color: #1a1a2e;
}
.single-article h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: #1a1a2e;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #f3f4f6;
}
.entry-content {
  font-size: 17px;
  line-height: 1.8;
  color: #374151;
}
.entry-content p {
  margin-bottom: 1.5em;
}
.entry-content em {
  font-style: italic;
  color: #1a1a2e;
}
.entry-content strong, .entry-content b {
  font-weight: 600;
  color: #1a1a2e;
}
.entry-content blockquote {
  margin: 2em 0;
  padding: 24px 28px;
  border-left: 4px solid #1a56db;
  background: #f0f4ff;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #374151;
}
.entry-content a {
  color: #1a56db;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.entry-content a:hover {
  color: #1e40af;
}
.entry-content ul, .entry-content ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}
.entry-content li {
  margin-bottom: 0.5em;
}

/* ─── Related Terms ─── */
.related-terms {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.related-terms h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}
.related-terms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ─── Search Results ─── */
.search-header {
  max-width: 1200px;
  margin: 48px auto 32px;
  padding: 0 24px;
}
.search-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}
.search-header h1 span {
  color: #1a56db;
}
.search-results-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* No Results */
.no-results {
  max-width: 500px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}
.no-results h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}
.no-results p {
  color: #6b7280;
  margin-bottom: 32px;
}

/* ─── 404 ─── */
.error-404 {
  max-width: 500px;
  margin: 100px auto;
  padding: 0 24px;
  text-align: center;
}
.error-404 .error-code {
  font-size: 120px;
  font-weight: 800;
  color: #e5e7eb;
  line-height: 1;
  margin-bottom: 16px;
}
.error-404 h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}
.error-404 p {
  color: #6b7280;
  margin-bottom: 32px;
}

/* ─── Footer ─── */
.site-footer {
  background: #1a1a2e;
  padding: 48px 24px;
  text-align: center;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer .footer-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.site-footer .footer-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-section {
    padding: 56px 20px 52px;
  }
  .hero-section h1 {
    font-size: 32px;
  }
  .hero-section .subtitle {
    font-size: 15px;
  }
  .hero-stats {
    gap: 24px;
  }
  .hero-stat .stat-number {
    font-size: 24px;
  }
  .big-search {
    margin-top: -24px;
    padding: 0 16px;
  }
  .big-search input[type="search"] {
    padding: 16px 20px 16px 48px;
    font-size: 16px;
    border-radius: 14px;
  }
  .alpha-nav {
    gap: 3px;
    padding: 0 16px;
    margin: 32px auto 8px;
  }
  .alpha-nav a {
    width: 34px;
    height: 34px;
    font-size: 12px;
    border-radius: 8px;
  }
  .entries-grid,
  .related-terms-grid,
  .search-results-grid {
    grid-template-columns: 1fr;
  }
  .entry-card {
    padding: 22px;
  }
  .letter-section {
    padding: 0 16px;
  }
  .single-article {
    padding: 32px 16px 60px;
  }
  .single-article h1 {
    font-size: 26px;
  }
  .header-search input[type="search"] {
    width: 180px;
  }
  .header-search input[type="search"]:focus {
    width: 220px;
  }
  .header-inner {
    padding: 0 16px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 28px;
  }
  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
  .alpha-nav a {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
}

/* ─── Category Filter Pills ─── */
.category-filters {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 100px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.cat-pill:hover {
  border-color: #1a56db;
  color: #1a56db;
  background: #f0f4ff;
}
.cat-pill.active {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}
.cat-pill.active .pill-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.pill-count {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  transition: all 0.2s;
}
.cat-pill:hover .pill-count {
  background: #dbeafe;
  color: #1a56db;
}

/* ─── Card Category Label ─── */
.card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #1a56db;
  background: #eff3ff;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .category-filters {
    padding: 0 16px;
    gap: 6px;
  }
  .cat-pill {
    padding: 8px 14px;
    font-size: 12px;
  }
}

.site-content { padding-bottom: 80px; }
