/* Human Islet Transplant Laboratory – recreated stylesheet */
@font-face { font-family: "Source Sans Pro"; font-weight: 400; font-style: normal; src: url("../fonts/SourceSansPro-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Source Sans Pro"; font-weight: 700; font-style: normal; src: url("../fonts/SourceSansPro-Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Source Sans Pro"; font-weight: 400; font-style: italic; src: url("../fonts/SourceSansPro-Italic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Source Sans Pro"; font-weight: 700; font-style: italic; src: url("../fonts/SourceSansPro-BoldItalic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "League Gothic"; src: url("../fonts/LeagueGothic-Regular.woff2") format("woff2"); font-display: swap; }

:root {
  --blue: #1e487d;
  --blue-dark: #163759;
  --red: #e2312d;
  --ink: #333;
  --muted: #666;
  --line: #e2e2e2;
  --bg-soft: #f5f5f5;
  --topbar: #3d3d3d;
  --wrap: 1200px;
  --display: "League Gothic", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--ink); background: #fff; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 1000; }
.skip-link:focus { left: 0; }

/* ---------- top bar & header ---------- */
.topbar { background: var(--topbar); border-bottom: 4px solid var(--blue); }
.topbar__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; display: flex; justify-content: flex-end; }
.topbar a { color: #fff; text-decoration: none; text-transform: uppercase; font-size: 18px; padding: 6px 14px; border-left: 1px solid #555; letter-spacing: .02em; }
.topbar a:first-child { border-left: 0; }
.topbar a:hover { background: var(--blue); color: #fff; }

.site-header__inner { max-width: var(--wrap); margin: 0 auto; padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.site-header__logo img { display: block; width: 537px; max-width: 100%; }
.site-header__tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lang { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; font-size: 16px; }
.lang a { color: var(--ink); text-decoration: none; }
.lang .is-active a { font-weight: 700; color: var(--blue); }
.lang a:hover { text-decoration: underline; }
.site-header__twitter img { display: block; }

/* ---------- main nav ---------- */
.nav { background: var(--blue); border-top: 5px solid var(--red); position: relative; z-index: 20; }
.nav__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav__item { position: relative; }
.nav__item > a { display: block; padding: 10px 16px; color: #fff; text-decoration: none; font-size: 17px; }
.nav__item:hover > a, .nav__item:focus-within > a, .nav__item.is-active > a { background: var(--blue-dark); color: #fff; }
.nav__sub { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--blue-dark); display: none; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.nav__item:hover > .nav__sub, .nav__item:focus-within > .nav__sub, .nav__item.is-open > .nav__sub { display: block; }
.nav__sub a { display: block; padding: 9px 16px; color: #fff; text-decoration: none; border-top: 1px solid rgba(255,255,255,.12); }
.nav__sub a:hover { background: var(--red); color: #fff; }
.nav__toggle { display: none; background: none; border: 0; color: #fff; font: inherit; padding: 12px 0; cursor: pointer; align-items: center; gap: 10px; }
.nav__bars, .nav__bars::before, .nav__bars::after { display: block; width: 22px; height: 2px; background: #fff; position: relative; content: ""; }
.nav__bars::before { position: absolute; top: -7px; }
.nav__bars::after { position: absolute; top: 7px; }

/* ---------- headings ---------- */
h1, h2, h3, h4, h5, .block-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; color: #333; line-height: 1.15; letter-spacing: .01em; }
.page__title { font-size: 3rem; margin: .2rem 0 1rem; color: var(--blue); }
.block-title { font-size: 2rem; margin: 0 0 .5rem; color: #444; }
.block-title a { color: inherit; text-decoration: none; }

/* ---------- slider ---------- */
.slider { position: relative; overflow: hidden; background: #222; aspect-ratio: 1090 / 313; max-height: 520px; min-height: 180px; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.slide.is-active { opacity: 1; z-index: 1; }
.slide > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide__caption { position: absolute; right: 2%; bottom: 8%; width: min(46%, 520px); background: rgba(90,90,90,.82); color: #fff; padding: 12px 16px; }
.slide__caption h2 { margin: 0; color: #fff; font-size: 1.9rem; }
.slide__caption p { margin: 4px 0 8px; opacity: .9; font-size: 15px; }
.slide__caption a { color: #fff; text-transform: uppercase; display: block; text-align: right; text-decoration: none; font-size: 15px; }
.slide__caption a:hover { text-decoration: underline; }
.slider__prev, .slider__next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.75); color: #333; cursor: pointer; font-size: 18px; line-height: 1; }
.slider__prev { left: 6px; } .slider__next { right: 6px; }
.slider__prev:hover, .slider__next:hover { background: #fff; }
.slider__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 3; }
.slider__dots button { width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.6); cursor: pointer; }
.slider__dots button[aria-current="true"] { background: #fff; box-shadow: 0 0 0 2px var(--blue); }

/* ---------- home grid & cards ---------- */
.home__grid { max-width: var(--wrap); margin: 30px auto 50px; padding: 0 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.promo { position: relative; display: block; border: 1px solid var(--line); padding: 3px; background: #fff; margin-bottom: 20px; }
.promo img { display: block; width: 100%; aspect-ratio: 400 / 195; object-fit: cover; }
.promo span { position: absolute; left: 3px; bottom: 3px; background: rgba(60,60,60,.8); color: #fff; padding: 2px 8px; font-size: 14px; text-transform: uppercase; }
.promo:hover span { background: var(--red); }
.side-block { margin-bottom: 24px; }
.recent { list-style: none; margin: 0; padding: 8px 12px; border: 1px solid var(--line); }
.recent li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.recent li:last-child { border: 0; }
.recent .recent__img img { display: block; border: 1px solid var(--line); padding: 2px; object-fit: cover; }
.recent a { text-decoration: none; font-weight: 700; color: #222; display: block; }
.recent a:hover { color: var(--red); }
.tag { display: inline-block; background: var(--red); color: #fff; text-transform: uppercase; font-size: 11px; font-weight: 700; padding: 0 5px; margin-top: 4px; }
.network { display: flex; gap: 14px; border: 1px solid var(--line); padding: 12px; align-items: flex-start; }
.network p { margin: 0; text-transform: uppercase; font-weight: 700; color: #555; }
.network a { color: #000; }
.donate-card { display: block; border: 1px solid var(--line); padding: 12px; text-align: center; }
.donate-card img { display: inline-block; }
.btn { display: inline-block; background: var(--blue); color: #fff; padding: 8px 16px; text-decoration: none; text-transform: uppercase; border-radius: 3px; }
.btn:hover { background: var(--red); color: #fff; }
.embed { position: relative; aspect-ratio: 16 / 9; background: #ddd; margin: 1rem 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed--map { aspect-ratio: 4 / 3; max-width: 640px; }

/* ---------- inner pages ---------- */
.page__inner { max-width: var(--wrap); margin: 0 auto; padding: 24px 20px 50px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; }
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.prose { overflow-wrap: break-word; }
.prose h2 { font-size: 2.1rem; margin: 1.6rem 0 .5rem; color: var(--blue); }
.prose h2.lead-title { font-family: var(--body); text-transform: none; text-align: center; font-weight: 700; font-size: 1.8rem; line-height: 1.25; color: var(--ink); }
.prose h3 { font-size: 1.7rem; margin: 1.4rem 0 .4rem; }
.prose h4 { font-size: 1.5rem; margin: 1.2rem 0 .4rem; color: var(--blue); line-height: 1.3; }
.prose p { margin: 0 0 1rem; text-align: justify; hyphens: auto; }
.prose ul, .prose ol { padding-left: 2em; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }
.prose img { border: 1px solid var(--line); padding: 3px; background: #fff; }
.prose a:has(> img) { display: inline-block; }
.prose a > img[width="220"] { max-width: 220px; }
.prose .logo-grid a > img { border: 1px solid var(--line); }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.sidebar .promo span { font-size: 15px; }
.sidebar { align-self: start; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; margin-top: 1.2rem; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); text-decoration: none; color: inherit; background: #fff; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.15); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border: 0 !important; padding: 0 !important; }
.card__tag { margin: 10px 12px 0; align-self: flex-start; background: var(--red); color: #fff; text-transform: uppercase; font-size: 11px; font-weight: 700; padding: 0 5px; }
.card__title { font-family: var(--display); text-transform: uppercase; font-size: 1.6rem; padding: 4px 12px 14px; color: var(--blue); line-height: 1.15; }
.card:hover .card__title { color: var(--red); }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin: 1rem 0; }
.logo-grid a { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; padding: 8px; }
.logo-grid img { width: 100%; height: auto; max-height: 160px; object-fit: contain; border: 0 !important; padding: 0 !important; }

/* ---------- gallery & lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 1rem 0 1.5rem; }
.gallery__item { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #eee; }
.prose .gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; padding: 0; transition: transform .25s; }
.gallery__item:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 20px 60px; }
.lightbox[hidden] { display: none; }
.lightbox__fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox__fig img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; }
.lightbox__fig figcaption { color: #fff; text-align: center; padding: 10px 0 0; max-width: 800px; font-size: 16px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; padding: 10px 14px; line-height: 1; }
.lightbox button:hover { color: var(--red); }
.lightbox__close { top: 8px; right: 12px; font-size: 44px !important; }
.lightbox__prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 4px; top: 50%; transform: translateY(-50%); }

/* ---------- footer ---------- */
.site-footer__about { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 22px 0 10px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.site-footer__about p { margin: 0 0 12px; text-align: justify; font-size: 16px; }
.site-footer__about .share { text-align: left; }
.site-footer__bar { background: var(--topbar); color: #fff; padding: 14px 0; }
.site-footer__bar .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer__bar a { color: #fff; margin-right: 18px; }
.site-footer__bar p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .home__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page__inner { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
}
@media (max-width: 800px) {
  .nav__toggle { display: flex; }
  .nav__list { display: none; flex-direction: column; padding-bottom: 8px; }
  .nav__list.is-open { display: flex; }
  .nav__sub { position: static; display: block; box-shadow: none; background: transparent; }
  .nav__sub a { padding-left: 32px; border-top: 0; font-size: 16px; opacity: .9; }
  .slide__caption { width: 90%; right: 5%; bottom: 28px; padding: 8px 10px; }
  .slide__caption h2 { font-size: 1.25rem; }
  .slide__caption p { display: none; }
  .site-header__inner { flex-direction: column-reverse; align-items: stretch; }
  .site-header__tools { flex-direction: row; justify-content: space-between; align-items: center; }
  .lightbox { padding: 20px 8px; }
}
@media (max-width: 600px) {
  .home__grid { grid-template-columns: minmax(0, 1fr); }
  .page__title { font-size: 2.4rem; }
  .prose p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topbar, .nav, .slider, .sidebar, .lightbox { display: none; } }

/* ---------- content refinements ---------- */
.prose h4 br { display: none; }
.prose h4 { text-transform: uppercase; }
.prose p:has(> a > img[width="220"]), .prose p:has(> img[width="220"]) { float: left; clear: left; margin: 0 22px 10px 0; }
.prose h4:has(> a > img) { float: left; clear: left; margin: 0 22px 10px 0; }
.prose h2, .prose h3 { clear: both; }
.prose::after { content: ""; display: block; clear: both; }
.prose > img, .prose > a > img { max-width: 100%; }
.prose .card { display: flex; }
.prose .card img { border: 0; }

/* ---------- cookie consent ---------- */
.consent-wrap { position: relative; margin: 1rem 0; }
.consent-wrap > iframe[data-consent] { display: block; width: 100%; max-width: none; margin: 0; }
.embed > .consent-wrap { position: absolute; inset: 0; margin: 0; }
.consent-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: #fff;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); }
.consent-wrap--map .consent-ph { background: radial-gradient(circle at 70% 30%, rgba(255,255,255,.1), transparent 55%), linear-gradient(135deg, #2b5a8f, var(--blue-dark)); }
.consent-ph__inner { max-width: 420px; }
.consent-ph__play { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--blue); border: 0; border-radius: 999px; padding: 10px 22px 10px 12px; font: 700 16px/1 var(--body); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .15s, background .15s, color .15s; }
.consent-ph__play:hover { transform: scale(1.04); background: var(--red); color: #fff; }
.consent-ph__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff; font-size: 13px; padding-left: 2px; }
.consent-ph__play:hover .consent-ph__icon { background: #fff; color: var(--red); }
.prose .consent-ph p, .consent-ph p { margin: 12px 0 0; font-size: 14px; line-height: 1.45; text-align: center; color: rgba(255,255,255,.9); hyphens: none; }
.consent-ph__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.consent-ph__links a, .consent-ph__always { color: #fff; font: inherit; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; opacity: .85; }
.consent-ph__links a:hover, .consent-ph__always:hover { color: #fff; opacity: 1; }

.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; display: flex; justify-content: center; pointer-events: none;
  opacity: 0; transform: translateY(20px); transition: opacity .3s ease, transform .3s ease; }
.cookie-banner.is-visible { opacity: 1; transform: none; }
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner { pointer-events: auto; width: 100%; max-width: 980px; display: flex; align-items: center; gap: 24px; background: #fff; color: var(--ink);
  border-top: 5px solid var(--red); border-radius: 4px; padding: 18px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.28); }
.cookie-banner__text { flex: 1; min-width: 0; }
.cookie-banner__title { margin: 0 0 4px; font-size: 1.6rem; color: var(--blue); }
.cookie-banner p { margin: 0; font-size: 15px; line-height: 1.5; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { font: 700 15px/1.2 var(--body); padding: 11px 18px; border-radius: 3px; cursor: pointer; border: 2px solid var(--blue); background: #fff; color: var(--blue); text-transform: uppercase; letter-spacing: .02em; }
.cookie-btn:hover { border-color: var(--red); color: var(--red); }
.cookie-btn--primary { background: var(--blue); color: #fff; }
.cookie-btn--primary:hover { background: var(--red); border-color: var(--red); color: #fff; }
.cookie-settings-link { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }
.cookie-settings-link:hover { color: #fff; opacity: .8; }
@media (max-width: 800px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .cookie-banner__actions { flex-direction: column-reverse; }
  .cookie-btn { width: 100%; }
}
@media (max-width: 600px) { .cookie-banner { left: 8px; right: 8px; bottom: 8px; } .cookie-banner p { font-size: 14px; } }
@media (max-width: 420px) { .consent-ph__text { display: none; } }
@media print { .cookie-banner, .consent-ph { display: none; } }

/* ---------- slider on wide screens ---------- */
/* explicit width stops max-height from shrinking the width via aspect-ratio (>1810px bug) */
.slider { width: 100%; --gutter: max(0px, calc((100% - var(--wrap)) / 2)); }
.slide > img { object-position: center 40%; }
@media (min-width: 1240px) {
  /* soft fade so the caption sits on the image rather than floating over it */
  .slide::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, transparent 55%, rgba(0,0,0,.28)); }
  .slide__caption { z-index: 1; right: calc(var(--gutter) + 20px); bottom: 14%; width: 460px; background: rgba(40,40,40,.72); border-left: 4px solid var(--red); padding: 16px 20px; backdrop-filter: blur(3px); }
  .slider__prev { left: max(6px, calc(var(--gutter) - 52px)); }
  .slider__next { right: max(6px, calc(var(--gutter) - 52px)); }
}

/* ---------- responsive refinements ---------- */
/* embedded media sized by width/height attributes scale down to the column */
.prose iframe, .prose video { display: block; max-width: 100%; width: 640px; height: auto; aspect-ratio: 16 / 9; border: 0; margin: 1rem 0; }
.prose iframe[src*="google.com/maps"], .prose iframe[data-provider="Google Maps"] { width: 600px; aspect-ratio: 4 / 3; }
.prose table { display: block; overflow-x: auto; }

@media (min-width: 601px) and (max-width: 1000px) {
  /* home: third column spans the full width instead of leaving a gap */
  .home__col:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
}
@media (max-width: 800px) {
  /* slider: drop the fixed ratio so min-height can't force it wider than the screen */
  .slider { aspect-ratio: auto; height: clamp(200px, 45vw, 320px); min-height: 0; }
  .slider__prev, .slider__next { width: 34px; height: 34px; font-size: 15px; }
  .nav__item > a { padding: 12px 4px; }
  .nav__sub a { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar a { font-size: 16px; padding: 6px 12px; }
  .site-header__inner { padding: 12px 16px 10px; }
  .topbar__inner, .nav__inner, .home__grid, .page__inner, .wrap { padding-left: 16px; padding-right: 16px; }
  .page__inner { gap: 28px; padding-top: 16px; }
  .prose h2 { font-size: 1.8rem; }
  .prose h2.lead-title { font-size: 1.4rem; }
  .prose h3 { font-size: 1.5rem; }
  .prose h4 { font-size: 1.35rem; }
  /* floated portraits/thumbnails stack above their text instead of squeezing it */
  .prose p:has(> a > img[width="220"]), .prose p:has(> img[width="220"]), .prose h4:has(> a > img) { float: none; margin: 1rem 0 .5rem; }
  .prose a > img[width="220"], .prose img[width="220"] { max-width: min(220px, 100%); }
  .slide__caption { bottom: 26px; }
  .slide__caption h2 { font-size: 1.1rem; }
  .slide__caption a { font-size: 13px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .site-footer__about p { text-align: left; }
  .site-footer__bar .wrap { flex-direction: column; }
  .lightbox button { font-size: 28px; }
}
