/* ============================================================
   American Yawp MS — Shared Stylesheet for Supporting Pages
   (Introduction, About, Contributors, Teaching, Who Pays, Primary Source Reader)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: #2C2C2C;
  background: #FAFAF8;
  line-height: 1.8;
}

/* Site banner: "Westward the Course of Empire Takes Its Way" (Currier & Ives, 1868), LOC */
.header {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #0D2137;
  background-image: linear-gradient(to bottom, rgba(13,33,55,.2) 0%, rgba(13,33,55,.55) 45%, rgba(13,33,55,.9) 100%),
    url('../images/site/westward-banner.jpg');
  background-size: 100% 100%, cover;
  background-position: 0 0, center center;
  background-repeat: no-repeat;
  color: white;
  text-align: center;
  padding: 48px 24px 44px;
}
.header h1 { font-size: 42px; margin-bottom: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.header .divider { width: 80px; height: 3px; background: #C4941D; margin: 0 auto 20px; }
.header p { font-family: 'Source Sans 3', sans-serif; font-size: 16px; opacity: .95; max-width: 600px; margin: 0 auto; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

.nav-bar {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
  text-align: center;
}
.nav-bar a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  color: #1B3A5C;
  text-decoration: none;
  margin: 0 12px;
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.nav-bar a:hover { border-bottom-color: #C4941D; }
.nav-bar a[aria-current="page"] { border-bottom-color: #2A7F8E; font-weight: 600; }

.container { max-width: 640px; margin: 0 auto; padding: 48px 24px; }

h2 { font-size: 28px; color: #1B3A5C; margin: 48px 0 20px; padding-bottom: 12px; border-bottom: 2px solid #E0E0E0; }
h2:first-of-type { margin-top: 0; }

p { margin-bottom: 20px; font-size: 17px; line-height: 1.8; }
p:last-child { margin-bottom: 0; }

ul, ol { margin-left: 24px; margin-bottom: 20px; }
li { margin-bottom: 8px; line-height: 1.7; }

a { color: #2A7F8E; }

.callout {
  background: #F0F4F8;
  border-left: 5px solid #2A7F8E;
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
}
.callout h3 { color: #2A7F8E; font-size: 20px; margin-bottom: 12px; }
.callout p { font-family: 'Source Sans 3', sans-serif; font-size: 16px; line-height: 1.7; }

.callout-green {
  background: #E8F5E9;
  border-left: 5px solid #2E7D32;
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
}
.callout-green h3 { color: #2E7D32; font-size: 20px; margin-bottom: 12px; }
.callout-green p { font-family: 'Source Sans 3', sans-serif; font-size: 16px; line-height: 1.7; }

.coming-soon {
  background: #FFF9E6;
  border-left: 5px solid #C4941D;
  padding: 32px 40px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
  text-align: center;
}
.coming-soon h3 { color: #C4941D; font-size: 24px; margin-bottom: 16px; }
.coming-soon p { font-family: 'Source Sans 3', sans-serif; font-size: 17px; line-height: 1.7; color: #666; }

/* ---- Universal Search ---- */

.search-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: #1B3A5C;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  transition: background .2s, border-color .2s;
}
.search-btn:hover { background: #f0f4f8; border-color: #2A7F8E; }
.search-btn .search-btn-icon { font-size: 14px; line-height: 1; }
.search-btn kbd {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 1px 5px;
  color: #888;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-modal {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%) scale(.96);
  width: 560px;
  max-width: 92vw;
  max-height: 70vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 16px 60px rgba(0,0,0,.25);
  z-index: 910;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s, visibility .2s;
  font-family: 'Source Sans 3', sans-serif;
}
.search-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.search-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
  gap: 10px;
}
.search-icon { font-size: 18px; color: #999; flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #2C2C2C;
  background: transparent;
}
.search-input::placeholder { color: #bbb; }
.search-kbd {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 7px;
  color: #999;
  flex-shrink: 0;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.search-result-item {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  color: #2C2C2C;
  border-left: 3px solid transparent;
  transition: background .1s, border-color .1s;
}
.search-result-item:hover,
.search-result-item.selected {
  background: #f0f6fa;
  border-left-color: #2A7F8E;
}
.search-result-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-result-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #2A7F8E;
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
}
.search-result-preview {
  font-size: 13px;
  color: #777;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-meta {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}
.search-hint {
  padding: 10px 18px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #bbb;
  text-align: center;
}
.search-empty {
  padding: 24px 18px;
  text-align: center;
  font-size: 14px;
  color: #999;
}

@media print {
  .search-overlay, .search-modal { display: none !important; }
}

footer {
  border-top: 2px solid #E0E0E0;
  margin-top: 64px;
  padding-top: 24px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: #999;
  line-height: 1.7;
}
footer a { color: #2A7F8E; text-decoration: none; border-bottom: 1px dotted #2A7F8E; }
footer a:hover { border-bottom-style: solid; }

@media (max-width: 768px) {
  .container { max-width: 90%; padding: 36px 20px; }
  .header h1 { font-size: 36px; }
  h2 { font-size: 24px; }
  .callout, .callout-green, .coming-soon { padding: 18px 22px; }
}

@media (max-width: 600px) {
  .header { min-height: 180px; padding: 36px 16px 32px; }
  .header h1 { font-size: 32px; }
  .container { padding: 32px 16px; }
  .nav-bar a { display: block; margin: 6px 0; }
}
