:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-alt: #f7f7f7;
  --text: #20262d;
  --muted: #5f6b76;
  --line: #dddddd;
  --brand: #cf0a2c;
  --brand-dark: #a1001d;
  --accent: #f3f3f3;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background: #ffffff;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-height: 72px;
  margin-bottom: 24px;
  padding: 0 4px 12px;
  border-bottom: 1px solid #e3e3e3;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-brand img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 52px;
}

.site-header-title {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  text-align: right;
}

.site-header-title span:last-child {
  margin-top: 2px;
}

.hero,
.detail-hero {
  display: grid;
  gap: 28px;
  margin-bottom: 18px;
}

.hero {
  grid-template-columns: minmax(420px, 0.95fr) minmax(0, 1.05fr);
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-family: "Source Sans 3", sans-serif;
  font-size: clamp(1.8rem, 2.35vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
}

.detail-hero-copy h1 {
  margin: 8px 0 16px;
  font-family: "Merriweather", serif;
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  line-height: 1.08;
}

.hero-text,
.lead-text,
.results-subline,
.small-text {
  color: var(--muted);
}

.fact-card,
.detail-card,
.filters-card,
.job-card {
  background: var(--panel);
  border: 1px solid #e3e3e3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.portal-layout,
.detail-layout {
  display: grid;
  gap: 24px;
}

.portal-layout {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  align-items: start;
}

.sidebar-stack {
  display: grid;
  gap: 24px;
  position: sticky;
  top: 20px;
  align-self: start;
}

.filters-card,
.detail-card {
  padding: 24px;
}

.filters-head h2 {
  margin: 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 42px;
}

.hero-text {
  max-width: 28rem;
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.55;
  color: #37424c;
}

.hero-media {
  min-height: 360px;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-note {
  margin: 0 0 44px;
  font-size: 1.14rem;
  line-height: 1.6;
  color: #25313a;
}

.filters-card {
  align-self: start;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.listing-promo {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  overflow: hidden;
  margin-top: 28px;
  border: 1px solid #e3e3e3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: #323234;
  color: #fff;
}

.listing-promo-copy {
  padding: 36px 34px;
}

.listing-promo-copy h3 {
  margin: 0 0 14px;
  font-size: 2rem;
  line-height: 1.1;
  color: #fff;
}

.listing-promo-copy p {
  margin: 0 0 22px;
  max-width: 28rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.listing-promo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: #20262d;
  font-weight: 700;
  text-decoration: none;
}

.listing-promo-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.filters-head,
.results-toolbar,
.job-card-top,
.job-card-footer,
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.filters-head,
.results-toolbar,
.job-card-top,
.job-card-footer {
  align-items: start;
}

.filter-block {
  display: block;
  margin-top: 18px;
}

.filters-footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: right;
}

.filter-block span,
.filter-label,
.meta-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.filters-card .filter-block > span,
.filters-card .filter-label {
  color: var(--text);
}

input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

.checkbox-list {
  display: grid;
  gap: 0px;
  max-height: 210px;
  overflow: auto;
  padding-right: 8px;
}

.checkbox-list label {
  display: flex;
  gap: 10px;
  align-items: start;
  font-size: 0.98rem;
}

.results-area {
  min-width: 0;
}

.results-toolbar {
  margin-bottom: 18px;
  align-items: baseline;
}

.results-count {
  white-space: nowrap;
  font-weight: 700;
  color: var(--brand);
}

.job-grid {
  display: grid;
  gap: 18px;
}

.job-card-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.job-card {
  width: 100%;
  padding: 24px;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.job-card-link:hover .job-card,
.job-card-link:focus-visible .job-card {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.job-card-link:focus-visible {
  outline: none;
}

.job-card-link:focus-visible .job-card {
  border-color: #cfcfcf;
}

.job-institution {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
}

.job-card-header {
  text-align: left;
}

.job-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.print-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.print-link-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.job-card h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.job-summary {
  margin: 12px 0 16px;
  font-size: 1.14rem;
  line-height: 1.55;
  color: #495662;
}

.meta-row {
  margin-bottom: 0;
  flex-wrap: wrap;
}

.meta-row > div {
  flex: 1 1 240px;
  padding: 14px 16px;
  background: #fbfbfb;
  border-radius: var(--radius-md);
  border: 1px solid #f0f0f0;
}

.button-link,
.link-button,
.back-link {
  text-decoration: none;
}

.button-link,
.link-button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
}

.deadline-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 600;
  padding: 8px 12px;
  background: #f6f6f6;
  color: #6c6c6c;
}

.hidden {
  display: none !important;
}

.empty-state {
  padding: 36px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--brand);
  font-weight: 700;
}

.detail-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.detail-topbar .back-link {
  margin-bottom: 0;
}

.detail-hero {
  grid-template-columns: 1fr;
  align-items: start;
}

.detail-hero-copy {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.detail-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 20px;
}

.detail-section {
  padding: 26px 28px;
  background: var(--panel);
  border: 1px solid #e3e3e3;
  border-radius: var(--radius-lg);
}

.detail-section h2,
.detail-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.detail-job-card h1 {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  font-size: clamp(2rem, 3vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
}

.detail-summary {
  margin-bottom: 16px;
}

.detail-summary p:last-child {
  margin-bottom: 0;
}

.detail-meta-row {
  margin-bottom: 0;
}

.rich-content p:first-child,
.lead-text p:first-child {
  margin-top: 0;
}

.rich-content ul,
.rich-content ol {
  padding-left: 22px;
}

.rich-content li {
  margin-bottom: 9px;
}

.detail-side {
  display: grid;
  gap: 18px;
}

.contact-box {
  font-style: normal;
  line-height: 1.65;
}

.apply-card .rich-content {
  margin-bottom: 16px;
}

.apply-card {
  border-color: rgba(207, 10, 44, 0.45);
}

.contact-methods {
  margin-top: 18px;
}

@media screen {
  .detail-job-top {
    display: block;
  }
}

.muted-card {
  background: var(--panel-alt);
}

@media (max-width: 980px) {
  .hero,
  .portal-layout,
  .listing-promo,
  .detail-hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .filters-card {
    position: static;
  }

  .sidebar-stack {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100vw - 20px, 1240px);
    padding-top: 18px;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    margin-bottom: 18px;
    padding: 0 0 12px;
  }

  .site-brand {
    justify-self: start;
  }

  .site-brand img {
    height: 42px;
  }

  .site-header-title {
    margin-left: 0;
    font-size: 1rem;
    line-height: 1.2;
    text-align: left;
  }

  .site-header-title span:last-child {
    margin-top: 4px;
    font-size: 0.96rem;
  }

  .hero,
  .detail-hero-copy,
  .filters-card,
  .job-card,
  .detail-card,
  .detail-section {
    padding: 20px;
  }

  .hero {
    padding: 0;
  }

  .hero-copy {
    padding: 28px 24px;
  }

  .hero-media {
    min-height: 240px;
  }

  .job-card-top,
  .job-card-footer,
  .results-toolbar {
    flex-direction: column;
  }

  .job-card h3 {
    font-size: 1.28rem;
  }

  .job-card-heading {
    flex-direction: column;
    gap: 8px;
  }

  .detail-actions {
    justify-content: flex-start;
  }
}

@media print {
  @page {
    margin: 16mm;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .site-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .back-link {
    display: none !important;
  }

  .site-header {
    display: none !important;
  }

  .print-link {
    display: none !important;
  }

  .detail-hero,
  .detail-layout {
    display: block;
  }

  .detail-hero {
    margin-bottom: 8mm;
  }

  .detail-hero-copy,
  .detail-section,
  .detail-card,
  .apply-card,
  .muted-card,
  .meta-row > div {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .detail-hero-copy,
  .detail-section,
  .detail-card {
    padding: 0 !important;
  }

  .detail-job-top {
    display: block;
  }

  .job-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6mm;
    margin-bottom: 2mm;
  }

  .job-institution {
    margin: 0;
    color: var(--brand) !important;
    font-size: 11pt;
    font-weight: 700;
  }

  .detail-job-card h1 {
    display: inline-block;
    margin: 0 0 1.5mm;
    padding: 0;
    color: #000 !important;
    font-size: 19pt;
    line-height: 1.15;
    border-bottom: 0;
  }

  .deadline-chip {
    display: inline-block;
    margin: 0;
    padding: 0;
    background: transparent !important;
    color: #000 !important;
    font-size: 10.5pt;
    font-weight: 700;
  }

  .job-summary,
  .detail-summary,
  .rich-content,
  .contact-box,
  .small-text {
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .detail-meta-row {
    display: block;
    margin: 0 0 7mm;
  }

  .detail-meta-row > div {
    padding: 0 !important;
    margin: 0 0 2.5mm;
  }

  .meta-label {
    display: inline;
    margin: 0;
    color: #000 !important;
    font-size: 10.5pt;
    font-weight: 700;
  }

  .detail-meta-row strong {
    font-weight: 400;
  }

  .detail-meta-row .meta-label::after {
    content: ": ";
  }

  .detail-main,
  .detail-side {
    display: block;
  }

  .detail-section,
  .detail-card {
    margin-bottom: 7mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .detail-section h2,
  .detail-card h2 {
    margin-bottom: 1.5mm;
    color: var(--brand) !important;
    font-size: 12.5pt;
  }

  .rich-content ul,
  .rich-content ol {
    margin-top: 0;
    padding-left: 6mm;
  }

  .rich-content li {
    margin-bottom: 1.2mm;
    line-height: 1.28;
  }

  .contact-methods {
    margin-top: 4mm;
  }
}
