/* ============================================================
   research.css — Research sub-site styles
   billtrochim.net
   Depends on: /Assets/css/shared.css (loaded first)
   ============================================================ */

/* --- Cornell Red accent variables for this sub-site --- */
:root {
  --research-primary:   #8B1A1A;
  --research-dark:      #6B1212;
  --research-mid:       #B94444;
  --research-light:     #D98080;
  --research-pale:      #F5E6E6;
  --research-ghost:     #FBF3F3;
}

/* ---- Page layout ---- */
.bt-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bt-page-content {
  flex: 1;
}

/* ---- Research hero / page header ---- */
.research-hero {
  background: var(--research-primary);
  color: #fff;
  padding: 2.5rem 0 0;
  position: relative;
  overflow: hidden;
}

.research-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(107,18,18,0.6) 0%, transparent 60%),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 12px
    );
  pointer-events: none;
}

.research-hero .bt-container {
  position: relative;
  z-index: 1;
  /* Indent hero text to align with the main content column, not the sidebar */
  padding-left: calc(1.5rem + 220px + 2rem);
}

@media (max-width: 820px) {
  .research-hero .bt-container {
    padding-left: 1.5rem;
  }
}

.research-hero-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin: 0 0 0.6rem;
}

.research-hero h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: #fff;
}

.research-hero-desc {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
  max-width: 640px;
  margin: 0;
}

/* ---- Section statistics bar ---- */
.research-stats {
  background: var(--research-dark);
  border-bottom: 3px solid var(--research-mid);
}

.research-stats-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.research-stat {
  flex: 1 1 140px;
  padding: 0.9rem 1.5rem;
  border-right: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}

.research-stat:last-child {
  border-right: none;
}

.research-stat-number {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: #fff;
  display: block;
  line-height: 1;
}

.research-stat-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  display: block;
  margin-top: 0.25rem;
}

/* ---- Two-column layout: sidebar TOC + main content ---- */
.research-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

@media (max-width: 820px) {
  .research-layout {
    grid-template-columns: 1fr;
  }
  .research-sidebar {
    display: none;
  }
}

/* ---- Sidebar table of contents ---- */
.research-sidebar {
  position: sticky;
  top: 1.5rem;
  padding-right: 2rem;
}

.research-toc-heading {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #999;
  margin: 0 0 0.75rem;
}

.research-toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

.research-toc li {
  margin-bottom: 0;
}

.research-toc a {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  color: #555;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-left: 2px solid #e5e5e5;
  transition: color 0.18s, border-color 0.18s;
  line-height: 1.35;
}

.research-toc a:hover,
.research-toc a.active {
  color: var(--research-primary);
  border-left-color: var(--research-primary);
  background: var(--research-ghost);
}

.research-toc-count {
  font-size: 0.7rem;
  color: #bbb;
  margin-left: 0.3rem;
}

/* ---- Main content area ---- */
.research-main {
  min-width: 0;
}

/* ---- Section blocks ---- */
.research-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 1.5rem;
}

.research-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--research-pale);
}

.research-section-icon {
  width: 36px;
  height: 36px;
  background: var(--research-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.research-section-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.research-section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--research-primary);
  margin: 0;
}

.research-section-count {
  margin-left: auto;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  color: #aaa;
  background: var(--research-ghost);
  border: 1px solid var(--research-pale);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}

/* ---- Publication entries ---- */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-item:hover {
  background: var(--research-ghost);
}

.pub-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--research-light);
  margin-top: 0.6rem;
  flex-shrink: 0;
}

.pub-item:hover .pub-bullet {
  background: var(--research-primary);
}

.pub-text {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.925rem;
  line-height: 1.65;
  color: #333;
}

.pub-text a {
  color: var(--research-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.pub-text a:hover {
  color: var(--research-dark);
  border-bottom-color: var(--research-light);
}

/* Year badge for notable publications */
.pub-year-badge {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--research-mid);
  background: var(--research-pale);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---- "Note" callout for special items ---- */
.pub-note {
  font-size: 0.82rem;
  color: #888;
  font-style: italic;
  margin-top: 0.2rem;
}

/* ---- Divider between decade groups (optional visual rhythm) ---- */
.pub-decade-divider {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ccc;
  padding: 0.6rem 0.75rem 0.2rem;
  margin-top: 0.5rem;
}

/* ---- Back-to-top link ---- */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  color: #aaa;
  text-decoration: none;
  margin-top: 1rem;
  transition: color 0.15s;
}

.back-to-top:hover {
  color: var(--research-primary);
}

/* ---- Container (if not defined in shared.css) ---- */
.bt-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Search strip ---- */
.research-search-strip {
  background: var(--research-dark);
  border-bottom: 3px solid rgba(255,255,255,0.08);
  padding: 0.9rem 0;
}

.research-search-container {
  display: flex;
  justify-content: flex-end;
}

.research-search-box {
  width: 100%;
  max-width: 420px;
  position: relative;
}

.research-search-label {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.4rem;
}

.research-search-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.research-search-input {
  flex: 1;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  color: #fff;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}

.research-search-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.research-search-input:focus {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.45);
}

.research-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  background: var(--research-mid);
  border: none;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.research-search-btn:hover {
  background: var(--research-light);
}

.research-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.research-search-clear:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Results dropdown */
.research-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(500px, 90vw);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 7px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.6rem 0;
}

.research-search-count {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  color: #888;
  padding: 0.3rem 1rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  margin: 0;
}

.research-search-count strong {
  color: #333;
}

.research-search-empty {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: #777;
  padding: 0.8rem 1rem;
  margin: 0;
}

.research-search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.research-search-result-item {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f5f5f5;
}

.research-search-result-item:last-child {
  border-bottom: none;
}

.research-result-section {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--research-mid);
  margin-bottom: 0.2rem;
}

.research-result-link {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--research-primary);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.research-result-link:hover {
  text-decoration: underline;
  color: var(--research-dark);
}

/* Highlight matched item when scrolled-to */
.research-search-highlight {
  background: #fff3cd !important;
  outline: 2px solid #f0c040;
  border-radius: 4px;
  transition: background 0.5s;
}
