:root {
  --green-900: #123d2c;
  --green-800: #17533b;
  --green-700: #1f6a4b;
  --green-100: #e6f0eb;
  --gold: #c7a14a;
  --gold-soft: #f3ead2;
  --red: #a8423a;
  --ink: #17221d;
  --muted: #5f6d66;
  --line: #dce3df;
  --paper: #ffffff;
  --mist: #f5f8f6;
  --shell: 1180px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.utility-bar {
  color: #fff;
  background: var(--green-900);
  font-size: 13px;
}

.utility-inner,
.utility-inner nav,
.brand-row,
.footer-inner {
  display: flex;
  align-items: center;
}

.utility-inner { min-height: 38px; justify-content: space-between; }
.utility-inner nav { gap: 22px; }
.utility-inner a { text-decoration: none; opacity: .86; }
.utility-inner a:hover { opacity: 1; }

.brand-row {
  min-height: 92px;
  justify-content: space-between;
  gap: 32px;
}

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

.brand img {
  width: 270px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}

.brand-copy { display: none; line-height: 1.25; }
.brand-copy strong { color: var(--green-900); font-family: inherit; font-size: 23px; }
.brand-copy small { color: var(--muted); font-size: 12px; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { padding-block: 32px 28px; border-bottom: 3px solid transparent; color: #34433c; font-size: 14px; font-weight: 700; text-decoration: none; }
.main-nav a:hover,
.main-nav .active { color: var(--green-800); border-color: var(--gold); }

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--green-800);
  border-top: 1px solid rgba(255,255,255,.12);
}

.hero::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 38%;
  content: "";
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: skewX(-10deg) translateX(10%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr);
  align-items: center;
  gap: 72px;
  min-height: 410px;
  padding-block: 60px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-weight: 700; line-height: 1.12; }
h1 { max-width: 620px; font-size: clamp(36px, 5vw, 61px); }
.hero h1 { color: #fff; }
h2 { font-size: 34px; }
.lead { max-width: 600px; margin: 22px 0 0; color: #d9e8e1; font-size: 18px; }

.hero-search {
  padding: 28px;
  color: var(--ink);
  background: #fff;
  border-top: 5px solid var(--gold);
  box-shadow: 0 24px 50px rgba(0, 24, 14, .22);
}

.hero-search label { display: block; margin-bottom: 12px; color: var(--green-900); font-size: 14px; font-weight: 800; }
.search-control { display: grid; grid-template-columns: 1fr auto; }
.search-control input { min-width: 0; height: 54px; padding: 0 16px; border: 1px solid #bfcac4; border-right: 0; border-radius: 0; color: var(--ink); font: inherit; }
.search-control input:focus { outline: 3px solid var(--gold-soft); border-color: var(--gold); }
.search-control button { min-width: 98px; border: 0; border-radius: 0; color: #fff; background: var(--green-800); font: inherit; font-weight: 800; cursor: pointer; }
.search-control button:hover { background: var(--green-900); }
.search-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 15px; font-size: 13px; font-weight: 700; }
.search-links a { color: var(--green-700); }

.quick-access { padding-block: 72px 84px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading .eyebrow { color: var(--green-700); }
.text-link { color: var(--green-800); font-size: 14px; font-weight: 800; }

.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.action-card { display: grid; align-content: start; min-height: 230px; padding: 26px; border-right: 1px solid var(--line); text-decoration: none; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.action-card:last-child { border-right: 0; }
.action-card:hover { color: #fff; transform: translateY(-4px); }
.action-card strong { margin: auto 0 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 22px; line-height: 1.22; }
.action-card > span:last-child { color: var(--muted); font-size: 14px; }
.action-card:hover > span:last-child { color: rgba(255,255,255,.8); }
.card-number { color: #a7b4ad; font-size: 12px; font-weight: 800; }
.card-green:hover { background: var(--green-700); }
.card-gold:hover { background: #8d6c22; }
.card-ink:hover { background: #26342e; }
.card-red:hover { background: var(--red); }

.information-band { padding-block: 64px; background: var(--mist); border-block: 1px solid var(--line); }
.information-grid { display: grid; grid-template-columns: 1.1fr 1fr .7fr; gap: 64px; align-items: start; }
.information-grid h2 { max-width: 480px; }
.information-grid > p { margin: 4px 0 0; color: var(--muted); }
.info-links { display: grid; gap: 12px; }
.info-links a { color: var(--green-800); font-weight: 800; }

.site-footer { color: #dbe6e0; background: #102a20; }
.footer-inner { min-height: 132px; justify-content: space-between; gap: 32px; }
.site-footer strong { color: #fff; }
.site-footer p { margin: 4px 0 0; font-size: 13px; }

@media (max-width: 940px) {
  .brand-row { align-items: flex-start; flex-direction: column; padding-top: 20px; gap: 8px; }
  .main-nav { width: 100%; gap: 22px; overflow-x: auto; }
  .main-nav a { padding-block: 14px 13px; white-space: nowrap; }
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .action-card:nth-child(2) { border-right: 0; }
  .action-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .information-grid { grid-template-columns: 1fr 1fr; }
  .info-links { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .utility-inner > span { display: none; }
  .utility-inner { justify-content: flex-end; }
  .brand-row { min-height: auto; }
  .brand img { width: 240px; height: auto; }
  .brand-copy strong { font-size: 20px; }
  .main-nav { gap: 18px; }
  .hero-inner { min-height: 0; padding-block: 48px; }
  h1 { font-size: 39px; }
  h2 { font-size: 29px; }
  .lead { font-size: 16px; }
  .hero-search { padding: 20px; }
  .search-control { grid-template-columns: 1fr; }
  .search-control input { border-right: 1px solid #bfcac4; }
  .search-control button { height: 48px; }
  .quick-access { padding-block: 54px; }
  .section-heading { align-items: start; flex-direction: column; }
  .action-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); }
  .action-card:last-child { border-bottom: 0; }
  .information-grid { grid-template-columns: 1fr; gap: 28px; }
  .info-links { grid-column: auto; grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
}

/* EPrints template integration */
.uin-shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-right: auto;
  margin-left: auto;
}

.uin-utility {
  position: relative;
  z-index: 20;
  color: #fff;
  background: var(--green-900);
  font-size: 13px;
}

.uin-utility-inner,
.uin-utility-actions,
.uin-brand-row,
.uin-footer-inner,
.uin-footer-credit {
  display: flex;
  align-items: center;
}

.uin-utility-inner { min-height: 38px; justify-content: space-between; }
.uin-utility-actions { gap: 22px; }
.uin-utility ul,
.uin-utility #ep_tm_languages { margin: 0; padding: 0; }
.uin-utility ul { display: flex; gap: 18px; list-style: none; }
.uin-utility a,
.uin-utility .ep_tm_key_tools a,
.uin-utility #ep_tm_menu_tools a,
.uin-utility #ep_tm_languages a { color: #fff !important; text-decoration: none; }
.uin-utility #ep_tm_languages img { width: 22px; height: 22px; margin-left: 7px; border: 1px solid rgba(255,255,255,.35); }

.ep_tm_header {
  position: relative;
  z-index: 10;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  box-shadow: 0 1px 0 rgba(18,61,44,.12);
}

.uin-brand-row { min-height: 92px; justify-content: space-between; gap: 32px; }
.ep_tm_site_logo { position: static; width: auto; height: auto; margin: 0; }
.ep_tm_site_logo img { display: block; width: 270px; max-width: 100%; height: auto; max-height: 64px; object-fit: contain; object-position: left center; }

.ep_tm_header .ep_tm_menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 27px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: none;
  list-style: none;
}

.ep_tm_header .ep_tm_menu > li { position: relative; float: none; margin: 0; padding: 0; border: 0; }
.ep_tm_header .ep_tm_menu > li > a { display: block; padding: 33px 0 28px; color: #34433c; border: 0; border-bottom: 3px solid transparent; background: none; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ep_tm_header .ep_tm_menu > li > a:hover { color: var(--green-800); border-bottom-color: var(--gold); background: none; }

.ep_tm_header .ep_tm_menu ul {
  top: 72px !important;
  left: -18px !important;
  min-width: 220px;
  padding: 9px 0 !important;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(18,61,44,.14);
}
.ep_tm_header .ep_tm_menu ul li { float: none; margin: 0; }
.ep_tm_header .ep_tm_menu ul a { display: block; padding: 10px 18px; color: var(--ink); background: #fff; border: 0; font-size: 13px; text-decoration: none; white-space: nowrap; }
.ep_tm_header .ep_tm_menu ul a:hover { color: var(--green-800); background: var(--green-100); }

.uin-mobile-search { display: none; padding: 0 14px 16px; }
.uin-mobile-search form { display: grid; grid-template-columns: 1fr auto; max-width: 600px; margin: auto; }
.uin-mobile-search input { min-width: 0; height: 44px; margin: 0; padding: 0 13px; border: 1px solid #bfcac4; border-radius: 0; font: inherit; }
.uin-mobile-search button { min-width: 84px; height: 44px; margin: 0; border: 0; border-radius: 0; color: #fff; background: var(--green-800); font: inherit; font-weight: 700; }

.uin-page-wrap { min-height: 55vh; }
.ep_tm_page_content { width: min(calc(100% - 40px), var(--shell)); min-width: 0; max-width: none; margin: 0 auto; padding: 52px 0 72px; }
.ep_tm_pagetitle { margin: 0 0 34px; color: var(--green-900); border: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 36px; font-weight: 700; line-height: 1.2; text-align: left; }

body:has(.uinsgd-home) .ep_tm_page_content { width: 100%; padding: 0; }
body:has(.uinsgd-home) .ep_tm_pagetitle { display: none; }

.ep_tm_footer { width: 100%; min-width: 0; margin: 0; padding: 0; color: #dbe6e0; background: #102a20; border: 0; font-size: 13px; }
.uin-footer-inner { min-height: 132px; justify-content: space-between; gap: 32px; }
.uin-footer-inner strong { color: #fff; }
.uin-footer-inner p { margin: 4px 0 0; }
.uin-footer-credit { gap: 14px; }
.ep_tm_footer .ep_tm_eprints_logo { float: none; margin: 0; }
.ep_tm_footer .ep_tm_eprints_logo img { display: block; width: 64px; height: auto; filter: grayscale(1); opacity: .82; }

.ep_toolbox { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 0; background: #fff; }
.ep_toolbox_content { padding: 22px; color: var(--muted); background: #fff; }
.ep_toolbox_content a { color: var(--green-800); font-weight: 700; }

.ep_form_action_button,
input.ep_form_action_button,
button,
input[type="submit"] { border-radius: 0; }
.ep_form_action_button,
input.ep_form_action_button { color: #fff; background: var(--green-800); border: 1px solid var(--green-800); }

.ep_search_result { margin-bottom: 20px; padding: 22px; border: 1px solid var(--line); background: #fff; }
.ep_search_result a,
.ep_summary_content a,
.ep_tm_page_content a { color: var(--green-700); }
table { max-width: 100%; }
img { max-width: 100%; }
input, select, textarea { max-width: 100%; }

@media (max-width: 940px) {
  .uin-brand-row { align-items: flex-start; flex-direction: column; padding-top: 20px; gap: 8px; }
  .ep_tm_header .ep_tm_menu { width: 100%; gap: 22px; overflow-x: auto; }
  .ep_tm_header .ep_tm_menu > li > a { padding: 14px 0 13px; }
  .ep_tm_header .ep_tm_menu ul { display: none !important; }
  .uin-mobile-search { display: block; }
  .ep_tm_page_content { padding-top: 38px; }
}

@media (max-width: 620px) {
  .uin-shell,
  .ep_tm_page_content { width: min(calc(100% - 28px), var(--shell)); }
  .uin-repository-label { display: none; }
  .uin-utility-inner { justify-content: flex-end; }
  .uin-utility-actions { max-width: 100%; gap: 10px; }
  .uin-utility ul { gap: 10px; }
  .ep_tm_site_logo img { width: 240px; }
  .ep_tm_header .ep_tm_menu { gap: 18px; }
  .ep_tm_pagetitle { font-size: 30px; }
  .uin-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
  .ep_blister_bar { display: flex; max-width: 100%; overflow-x: auto; }
  .ep_form_input_grid { display: block; width: 100%; overflow-x: auto; }
}
