/* =============================================================
   activity-widget.css
   Styles for the Research Activities widget (.research-container)
   All rules are scoped to avoid conflicts with site CSS.
   ============================================================= */

/* ── Hard reset: neutralise site CSS inside widget only ── */
.research-container * { box-sizing: border-box; }

.research-container label {
  all: unset;
  display: grid;
  grid-template-columns: 15px 1fr;
  align-items: start;
  gap: 5px;
  padding: 2px 0;
  margin: 0;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 520;
  line-height: 1.3;
  color: #2e2d29;
}
.research-container label:hover { color: #b1040e; }
.research-container button { all: unset; cursor: pointer; }
.research-container input[type="text"] {
  all: unset; flex: 1; font-size: 1.5rem;
  background: transparent; color: #1e2a3e; min-width: 0;
}
.research-container input[type="text"]::placeholder { color: #a0aec0; }
.research-container input[type="checkbox"] { display: none; }
.research-container ul, .research-container li { list-style: none; margin: 0; padding: 0; }

/* ── Base ── */
.research-container {
  font-family: inherit;
  color: #1e2a3e;
  line-height: 1.5;
  font-size: 16px;
  background: #fff;
}

/* ── Header ── */
.research-container .research-header {
  border-bottom: 3px solid #b1040e;
  padding-bottom: 1.2rem;
  margin-bottom: 2rem;
}
.research-container .research-title {
  font-size: 5rem;
  font-weight: 750;
  color: #2e2d29;
  margin-bottom: 1.5rem;
}

/* ── Type pills ── */
.research-container .type-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.research-container .type-pill {
  all: unset;
  background: #f8f9fb;
  border: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  min-width: 65px;
  transition: all 0.15s;
}
.research-container .type-pill .pill-number { font-size: 4.5rem; font-weight: 700; color: #b1040e; line-height: 1; }
.research-container .type-pill .pill-label  { font-size: 2rem; font-weight: 600; color: #2e2d29; text-align: center; }
.research-container .type-pill:hover        { background: #fff; border-color: #b1040e; box-shadow: 0 2px 8px rgba(140,21,21,0.1); }
.research-container .type-pill.active       { background: #fff; border-color: #b1040e; box-shadow: 0 2px 10px rgba(140,21,21,0.15); }
.research-container .type-pill.active .pill-number { color: #b1040e; }
.research-container .type-pill.active .pill-label  { color: #0f2b4d; font-weight: 600; }

/* ── Two-column layout ── */
.research-container .two-columns { display: flex; gap: 5rem; align-items: flex-start; }

/* ── Sidebar ── */
.research-container .research-sidebar { width: 300px; flex-shrink: 0; }

.research-container .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 1.6rem; color: #2e2d29; text-decoration: none;
  margin-bottom: 0.9rem; font-weight: 500;
}
.research-container .back-link:hover { text-decoration: underline; }

.research-container .filter-section-label {
  display: block;
  font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: #fff;
  padding: 0.4rem 0.75rem;
  background: linear-gradient(90deg, #b1040e, #b1040e);
  border-radius: 5px; margin-bottom: 0.75rem;
}

.research-container .filter-group {
  border-bottom: 1px solid #eef2f6;
  padding: 0.4rem 0 0.25rem;
  margin: 0;
}
.research-container .filter-group:last-child { border-bottom: none; }

.research-container .filter-heading {
  display: block;
  font-weight: 700; font-size: 1.6rem; text-transform: uppercase;
  letter-spacing: 0.4px; color: #2e2d29; margin-bottom: 0.25rem;
}

/* ── Checkbox ── */
.research-container .check-box {
  width: 13px; height: 13px;
  border: 1.5px solid #c0cad8; border-radius: 2px;
  background: white; display: block; position: relative; margin-top: 1px;
}
.research-container input[type="checkbox"]:checked + .check-box { background: #b1040e; border-color: #b1040e; }
.research-container input[type="checkbox"]:checked + .check-box::after {
  content: ""; position: absolute; left: 3px; top: 0;
  width: 4px; height: 7px; border: solid white;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.research-container .custom-check-left { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.research-container .custom-check-left > span:first-child {
  flex: 1; min-width: 0; white-space: normal; line-height: 1.3; word-break: break-word;
}
.research-container .count-badge { color: #9aa5b4; font-size: 1.5rem; flex-shrink: 0; white-space: nowrap; }

.research-container .toggle-sdg,
.research-container .toggle-type {
  display: block; font-size: 1.5rem; color: #2e2d29;
  font-weight: 600; margin-top: 3px; padding: 0; background: none; border: none; cursor: pointer;
}
.research-container .toggle-sdg:hover,
.research-container .toggle-type:hover { color: #b1040e; }
.research-container .sdg-hidden,
.research-container .type-hidden { display: none; }

/* ── Year range slider ── */
.research-container .year-slider-wrap { padding: 0.3rem 0 0.5rem; }

.research-container .year-track-outer {
  position: relative;
  padding: 30px 2px 4px; /* top padding = room for floating labels */
}

/* Floating labels that follow the thumbs */
.research-container .year-floating-labels {
  position: absolute; top: 0; left: 0; right: 0;
  height: 26px; pointer-events: none;
}
.research-container .year-float-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 1.4rem; font-weight: 700; color: #fff;
  background: #b1040e; border-radius: 5px;
  padding: 2px 7px; line-height: 1.4;
  white-space: nowrap;
  transition: left 0.05s;
}
.research-container .year-float-label::after {
  content: '';
  position: absolute; bottom: -5px; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #b1040e;
  border-bottom: 0;
}

.research-container .year-track {
  position: relative; height: 5px;
  background: #e2e8f0; border-radius: 10px;
}
.research-container .year-fill {
  position: absolute; top: 0; height: 5px;
  background: linear-gradient(90deg, #b1040e, #b1040e);
  border-radius: 10px; pointer-events: none;
}

/* Kill all browser track/thumb defaults */
.research-container .year-track input[type="range"] {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 100%; height: 5px;
  background: transparent !important; border: none !important;
  outline: none !important; margin: 0 !important; padding: 0 !important;
  pointer-events: none; box-shadow: none !important;
}
.research-container .year-track input[type="range"]::-webkit-slider-runnable-track {
  background: transparent !important; border: none !important; height: 5px;
}
.research-container .year-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: all; width: 16px; height: 16px;
  border-radius: 50%; background: #f2f2f2;
  border: 2.5px solid #b1040e;
  box-shadow: 0 1px 6px rgba(31,74,124,0.25);
  cursor: pointer; margin-top: -5.5px;
}
.research-container .year-track input[type="range"]::-moz-range-track {
  background: transparent !important; border: none !important; height: 5px;
}
.research-container .year-track input[type="range"]::-moz-range-thumb {
  pointer-events: all; width: 16px; height: 16px;
  border-radius: 100%; background: #00343e;
  border: 2.5px solid #1f4a7c;
  box-shadow: 0 1px 6px rgba(31,74,124,0.25); cursor: pointer;
}
.research-container .year-track input[type="range"]::-ms-track {
  background: transparent !important; border-color: transparent !important;
  color: transparent !important; height: 5px;
}
.research-container .year-track input[type="range"]::-ms-thumb {
  pointer-events: all; width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  border: 2.5px solid #1f4a7c; cursor: pointer;
}
.research-container .year-minmax {
  display: flex; justify-content: space-between;
  font-size: 1.7rem; color: #9aa5b4; margin-top: 0.3rem; padding: 0 2px;
}

/* ── Profile links ── */
.research-container .profile-links { display: flex; flex-direction: column; gap: 3px; }
.research-container .profile-links a { font-size: 1.5rem; color: #1f4a7c; text-decoration: none; }
.research-container .profile-links a:hover { color: #b1040e; text-decoration: underline; }

/* ── Main content ── */
.research-container .main-content { flex: 1; min-width: 0; }

/* ── Search box ── */
.research-container .search-section {
  background: linear-gradient(135deg, #f7f7f7 0%, #f7f7f7 100%);
  border-radius: 14px; padding: 1.4rem 1.6rem;
  margin-bottom: 1.4rem; box-shadow: 0 4px 20px rgba(15,43,77,0.18);
}
.research-container .search-heading {
  display: block; font-size: 3rem; font-weight: 700; color: #b1040e; margin-bottom: 0.9rem;
}
.research-container .search-input-wrapper {
  display: flex; align-items: center; background: #fff;
  border-radius: 10px; padding: 0.55rem 1rem; gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.research-container .search-input-wrapper > i { color: #b1040e; font-size: 1.5rem; flex-shrink: 0; }
.research-container .search-divider { width: 1px; height: 22px; background: #e2e8f0; flex-shrink: 0; }
.research-container .search-modes { display: flex; gap: 5px; flex-shrink: 0; }
.research-container .search-mode-btn {
  font-size: 1.5rem; color: #4a627a; background: #f0f4fa;
  padding: 3px 9px; border-radius: 20px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.research-container .search-mode-btn.active { background: #b1040e; color: #fff; }
/* ── Sort bar ── */
.research-container .sort-bar {
  display: flex; align-items: center; gap: 10px; font-size: 1.5rem;
  padding: 8px 0 10px; border-bottom: 1px solid #eef2f6;
  margin-bottom: 1.1rem; flex-wrap: wrap;
}
.research-container .result-count { font-weight: 600; color: #0f2b3f; }
.research-container .sort-divider  { color: #c0c8d4; }

.research-container .sort-btn {
  all: unset; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 1.45rem; font-weight: 600; color: #b1040e;
  padding: 4px 12px; border-radius: 20px;
  border: 1.5px solid #f0d0d2; background: #fff5f5;
  transition: all 0.15s;
}
.research-container .sort-btn:hover {
  background: #b1040e; color: #fff; border-color: #b1040e;
}
.research-container .sort-btn i { font-size: 1.3rem; }

.research-container .export-btn {
  all: unset; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 1.45rem; font-weight: 600; color: #1f4a7c;
  padding: 4px 12px; border-radius: 20px;
  border: 1.5px solid #dce5f0; background: #f0f4fa;
  margin-left: auto; transition: all 0.15s;
}
.research-container .export-btn:hover {
  background: #1f4a7c; color: #fff; border-color: #1f4a7c;
}
.research-container .export-btn i { font-size: 1.3rem; }

/* ── Activity cards ── */
.research-container .year-header {
  display: block; font-size: 3.5rem; font-weight: 800; color: #b1040e;
  margin: 2rem 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 2px solid #f0e8e8;
}
.research-container .activity {
  padding: 1.1rem 1.4rem 1.1rem 1.4rem;
  border-bottom: 1px solid #f0f2f5;
  border-radius: 8px;
  transition: background 0.15s;
}
.research-container .activity:hover { background: #fdf8f8; }
.research-container .activity:last-child { border-bottom: none; }

.research-container .activity-title {
  display: block; font-size: 2rem; font-weight: 700; color: #2e2d29;
  margin-bottom: 0.55rem; line-height: 1.35; text-decoration: none;
}
.research-container a.activity-title:hover { color: #0f2b4d; text-decoration: underline; }

/* Role badge */
.research-container .activity-person {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.6rem; color: #2e2d29; margin-bottom: 0.35rem;
}
.research-container .activity-person .role-label {
  font-size: 1.4rem; font-weight: 500; color: #6b7a8d; letter-spacing: 0.02em;
}
.research-container .activity-person .role-badge {
  display: inline-flex; align-items: center;
  font-size: 1.35rem; font-weight: 650;
  padding: 2px 10px; border-radius: 20px;
  background: #f0f0fb; color: #3d2481;
  border: 1.5px solid #dcd8f5;
  letter-spacing: 0.01em;
}

/* Date line */
.research-container .activity-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.6rem; color: #4a5568; margin-bottom: 0.25rem;
}
.research-container .activity-date::before {
  content: "\f073"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: 1.3rem; color: #b1040e; opacity: 0.7;
}

/* Activity type line */
.research-container .activity-type-line {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 1.45rem; color: #6b7a8d; font-style: normal;
  margin-top: 0.3rem;
}
.research-container .activity-type-line::before {
  content: "\f02b"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: 1.2rem; color: #9aa5b4;
}

/* Resource links */
.research-container .activity-resource {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.5rem; color: #6b7a8d; margin-top: 0.55rem; flex-wrap: wrap;
}
.research-container .resource-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 1.4rem; font-weight: 550; color: #1f4a7c; text-decoration: none;
  background: #f0f4fa; border: 1px solid #dce5f0;
  border-radius: 20px; padding: 3px 12px;
  transition: all 0.15s;
}
.research-container .resource-link:hover {
  background: #b1040e; color: #fff; border-color: #b1040e;
}

/* ── Pagination ── */
.research-container .pagination {
  margin-top: 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem;
  padding: 1.4rem 0 0.5rem; border-top: 2px solid #f0e8e8;
}
.research-container .pagination-pages {
  display: flex; align-items: center; gap: 4px;
}

/* Page number buttons */
.research-container .pagination a,
.research-container .pagination span.pg-num {
  all: unset;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  font-size: 1.5rem; font-weight: 500;
  color: #4a5568; background: #f7f8fa;
  border: 1.5px solid #e8ecf1;
  cursor: pointer; transition: all 0.18s ease;
}
.research-container .pagination a:hover {
  background: #fff5f5; border-color: #b1040e; color: #b1040e;
  box-shadow: 0 2px 8px rgba(177,4,14,0.12);
  transform: translateY(-1px);
}
.research-container .pagination span.pg-num.active-page {
  background: #b1040e; border-color: #b1040e; color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(177,4,14,0.35);
  transform: translateY(-1px);
}
.research-container .pagination .ellipsis {
  all: unset; font-size: 1.5rem; color: #b0b8c4;
  padding: 0 4px; pointer-events: none; letter-spacing: 1px;
}

/* Prev / Next — base (applies to BOTH active and disabled) */
.research-container .pagination-nav {
  /* Full reset of button defaults */
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  margin: 0; font-family: inherit;
  /* Identical sizing for both states */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 110px; height: 40px;
  padding: 0 22px; border-radius: 10px;
  font-size: 1.5rem; font-weight: 650; letter-spacing: 0.01em;
  line-height: 1; white-space: nowrap;
  cursor: pointer; transition: all 0.2s ease; text-decoration: none;
  box-sizing: border-box;
  /* Active colours */
  background: #b1040e; color: #fff;
  border: 2px solid #b1040e;
  box-shadow: 0 4px 14px rgba(177,4,14,0.28);
}
.research-container .pagination-nav:not(.disabled):hover {
  background: #8c0310; border-color: #8c0310;
  box-shadow: 0 6px 18px rgba(177,4,14,0.38);
  transform: translateY(-2px);
}
.research-container .pagination-nav:not(.disabled):active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(177,4,14,0.22);
}

/* Disabled — same size, different colours, no interaction */
.research-container .pagination-nav.disabled,
.research-container .pagination-nav:disabled {
  background: #f0f2f5;
  color: #b8c0cc;
  border: 2px solid #e2e6ea;
  box-shadow: none;
  cursor: default; pointer-events: none;
  transform: none;
}

/* ── Override site parent containers + 15vw margins ── */
.centered-container, .jumpstart-ui--two-column .centered-container,
.jumpstart-ui--one-column .centered-container, .main-region,
.layout__region, .layout__region--main, .layout__region--content,
.layout-container, .ptype-stanford-wysiwyg, .su-wysiwyg-text,
.field--name-body, .field__item, .node__content,
.block-system-main-block, .views-element-container, .view-content,
article.node, .node--type-stanford-page, .su-page-components {
  width: 100% !important; max-width: 100% !important;
  padding-left: 0 !important; padding-right: 0 !important;
  margin-left: 0 !important; margin-right: 0 !important;
}
.research-container {
  width: 85vw !important; max-width: 85vw !important;
  margin-left: 8vw !important; margin-right: 8vw !important;
  padding: 0rem 0 !important;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .research-container {
    width: 84vw !important; max-width: 84vw !important;
    margin-left: 8vw !important; margin-right: 8vw !important;
  }
}
@media (max-width: 860px) {
  .research-container {
    width: 94vw !important; max-width: 94vw !important;
    margin-left: 3vw !important; margin-right: 3vw !important;
  }
  .research-container .two-columns { flex-direction: column; }
  .research-container .research-sidebar { width: 100%; }
  .research-container .search-modes,
  .research-container .search-divider { display: none; }
}
