/* =======================
   Resources page + single resource
   ======================= */

.resources,
.resource {
  --rs-max: 1440px;
  --rs-border: rgba(0, 159, 227, .14);

  /* See seed-single.css: the global --gutter centres content by itself, so
     using it as padding inside an already capped .container squeezed these
     sections to a fraction of the width on large screens. */
  --gutter: clamp(20px, 4vw, 72px);
}

/* --- Hero --- */
.rs-hero {
  background: linear-gradient(135deg, var(--al-navy) 0%, var(--al-indigo) 60%, var(--al-blue) 100%);
  color: #fff;
}

.rs-hero__inner {
  max-width: var(--rs-max);
  margin-inline: auto;
  padding-block: 52px 56px;
}

.rs-hero__title {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  margin: 0 0 14px;
  color: #fff;
}

.rs-hero__intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .88);
  margin: 0;
  max-width: 68ch;
}

.rs-hero__intro p {
  margin: 0 0 .8rem;
}

.rs-hero__intro p:last-child {
  margin-bottom: 0;
}

/* --- Sticky section nav --- */
.rs-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rs-border);
  box-shadow: 0 2px 12px rgba(16, 24, 40, .05);
}

.rs-nav__inner {
  max-width: var(--rs-max);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-block: 10px;
}

.rs-nav__link {
  padding: 8px 15px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--al-navy);
  transition: background .2s ease, color .2s ease;
}

.rs-nav__link:hover {
  background: rgba(0, 159, 227, .1);
  color: var(--al-blue);
}

/* --- Sections --- */
.rs-section {
  max-width: var(--rs-max);
  margin-inline: auto;
  padding-block: 52px;
  scroll-margin-top: 72px;
}

.rs-section + .rs-section {
  border-top: 1px solid var(--rs-border);
}

.rs-section__title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  color: var(--al-navy);
  margin: 0 0 10px;
}

.rs-section__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--al-sky), var(--al-blue));
}

.rs-section__lead {
  color: var(--al-muted);
  margin: 16px 0 28px;
  max-width: 68ch;
}

.rs-empty {
  max-width: var(--rs-max);
  margin-inline: auto;
  padding-block: 64px;
  color: var(--al-muted);
}

/* --- Type badge --- */
.rs-type {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--al-blue);
  background: rgba(0, 105, 180, .09);
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.rs-type--sm {
  font-size: .64rem;
  padding: 3px 8px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.rs-type--light {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* --- Chips (taxonomy links on a single resource) --- */
.rs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 8px;
}

.rs-chips .chip {
  margin: 0;
}

/* --- Buttons --- */
.rs-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--al-sky), var(--al-blue));
  transition: transform .2s ease, box-shadow .2s ease;
}

.rs-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 159, 227, .3);
}

.rs-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
}

.rs-btn--ghost:hover {
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
}

/* --- Action rows --- */
.rs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

/* On light backgrounds the ghost button needs the navy outline instead */
.rs-actions:not(.rs-actions--light) .rs-btn--ghost {
  color: var(--al-navy);
  border-color: rgba(11, 36, 71, .25);
}

.rs-actions:not(.rs-actions--light) .rs-btn--ghost:hover {
  color: var(--al-navy);
  background: rgba(11, 36, 71, .06);
  border-color: rgba(11, 36, 71, .45);
}

.rs-actions .rs-btn {
  margin-top: 0;
}

.rs-actions--sm .rs-btn {
  padding: 8px 16px;
  font-size: .9rem;
  border-radius: 10px;
}

/* Inside the seed project output lists the title already links out, so the
   remaining action reads as a quiet link rather than a button */
.rs-actions--inline {
  display: inline-flex;
  margin-top: 0;
  margin-left: 10px;
  vertical-align: middle;
}

.rs-actions--inline .rs-btn {
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 999px;
  background: transparent;
  color: var(--al-blue);
  border: 1px solid rgba(0, 159, 227, .35);
}

.rs-actions--inline .rs-btn:hover {
  color: #fff;
  background: var(--al-blue);
  transform: none;
  box-shadow: none;
}

/* --- Inline PDF reader --- */
.rs-viewer {
  margin-top: 48px;
}

.rs-viewer__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.rs-viewer__pop {
  font-weight: 600;
  color: var(--al-blue);
}

.rs-viewer__frame {
  margin-top: 20px;
  border: 1px solid rgba(11, 36, 71, .12);
  border-radius: 14px;
  overflow: hidden;
  background: #f4f6f9;
  box-shadow: 0 10px 30px rgba(11, 36, 71, .08);
}

.rs-viewer__frame object,
.rs-viewer__frame iframe {
  display: block;
  width: 100%;
  height: 82vh;
  min-height: 520px;
  border: 0;
}

.rs-viewer__fallback {
  margin: 0;
  padding: 32px;
  text-align: center;
}

/* Mobile browsers rarely render PDFs inline and a tall dead frame is worse
   than no frame, so fall back to the buttons above */
@media (max-width: 700px) {
  .rs-viewer__frame {
    display: none;
  }
}

/* --- Books --- */
.rs-books {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.rs-book {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
  background: var(--al-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--al-radius);
  box-shadow: var(--al-shadow);
  padding: 26px 30px;
}

.rs-book__cover {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(16, 24, 40, .18);
}

.rs-book__cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.rs-book__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--al-navy), var(--al-blue));
  color: #fff;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
}

.rs-book__title {
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.rs-book__title a {
  color: var(--al-navy);
}

.rs-book__title a:hover {
  color: var(--al-blue);
}

.rs-book__subtitle {
  font-size: 1.02rem;
  color: var(--al-indigo);
  font-weight: 600;
  margin: 0 0 10px;
}

.rs-book__authors {
  font-size: .95rem;
  color: var(--al-muted);
  margin: 0 0 12px;
}

.rs-book__excerpt {
  line-height: 1.7;
  margin: 0 0 12px;
}

.rs-book__meta {
  font-size: .88rem;
  color: var(--al-muted);
  margin: 0 0 16px;
}

/* --- Card grid --- */
.rs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.rs-card {
  display: flex;
  flex-direction: column;
  background: var(--al-card);
  border: 1px solid var(--rs-border);
  border-radius: var(--al-radius);
  box-shadow: var(--al-shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.rs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(16, 24, 40, .12);
}

.rs-card__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rs-card__body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.rs-card__title {
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 0 0 10px;
}

.rs-card__title a {
  color: var(--al-navy);
}

.rs-card__title a:hover {
  color: var(--al-blue);
}

.rs-card__excerpt {
  font-size: .93rem;
  line-height: 1.6;
  color: var(--al-muted);
  margin: 0 0 12px;
  flex-grow: 1;
}

.rs-card__meta {
  font-size: .85rem;
  color: var(--al-muted);
  margin: 0;
}

/* --- Project outputs --- */
.rs-projects {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.rs-project {
  background: linear-gradient(180deg, #fff 0%, var(--al-bg) 100%);
  border: 1px solid var(--rs-border);
  border-radius: var(--al-radius);
  padding: 24px 26px 26px;
  box-shadow: 0 6px 22px rgba(11, 36, 71, .05);
}

.rs-project__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rs-border);
}

.rs-project__title {
  font-size: 1.12rem;
  line-height: 1.4;
  margin: 0;
  color: var(--al-navy);
}

.rs-project__title a {
  color: var(--al-navy);
}

.rs-project__title a:hover {
  color: var(--al-blue);
}

.rs-project__more {
  flex: none;
  font-size: .88rem;
  font-weight: 600;
  color: var(--al-blue);
}

.rs-project__more::after {
  content: " \2192";
}

.rs-project__outputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.rs-output {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--rs-border);
  border-radius: 14px;
  padding: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.rs-output:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11, 36, 71, .09);
}

.rs-output__cover {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: var(--al-bg);
  box-shadow: 0 4px 12px rgba(11, 36, 71, .14);
}

.rs-output__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.rs-output__placeholder {
  display: block;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--al-navy), var(--al-blue));
  opacity: .18;
}

.rs-output__body {
  min-width: 0;
}

.rs-output__title {
  font-size: 1rem;
  line-height: 1.4;
  margin: 8px 0 0;
}

.rs-output__title a {
  color: var(--al-navy);
}

.rs-output__title a:hover {
  color: var(--al-blue);
}

.rs-output__meta {
  margin: 6px 0 0;
  font-size: .86rem;
  color: var(--al-muted);
}

/* --- Resource cards inside a news article --- */
.news-resources {
  margin: 48px 0 8px;
  padding-top: 32px;
  border-top: 1px solid var(--rs-border, rgba(0, 159, 227, .14));
}

.news-resources__title {
  font-size: 1.25rem;
  margin: 0 0 20px;
  color: var(--al-navy);
}

.news-resources__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.news-resource {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--rs-border, rgba(0, 159, 227, .14));
  border-radius: 14px;
  background: #fff;
}

.news-resource__cover {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(11, 36, 71, .14);
}

.news-resource__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.news-resource__placeholder {
  display: block;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--al-navy), var(--al-blue));
  opacity: .18;
}

.news-resource__title {
  font-size: 1rem;
  line-height: 1.4;
  margin: 8px 0 0;
}

.news-resource__title a {
  color: var(--al-navy);
}

.news-resource__title a:hover {
  color: var(--al-blue);
}

.news-resource__meta {
  margin: 6px 0 0;
  font-size: .86rem;
  color: var(--al-muted);
}

@media (max-width: 700px) {
  .news-resources__list {
    grid-template-columns: 1fr;
  }

  .news-resource {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }
}

/* --- News items referencing a resource --- */
.rs-single__news {
  margin-top: 48px;
}

.rs-news {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.rs-news__link {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--rs-border);
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease;
}

.rs-news__link:hover {
  border-color: var(--al-blue);
  transform: translateY(-2px);
}

.rs-news__thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
}

.rs-news__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rs-news__text {
  display: block;
  min-width: 0;
}

.rs-news__date {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--al-muted);
}

.rs-news__title {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--al-navy);
}

/* --- Publications, grouped by year --- */
.rs-years {
  display: grid;
  gap: 12px;
}

.rs-year {
  background: var(--al-card);
  border: 1px solid var(--rs-border);
  border-radius: 14px;
  overflow: hidden;
}

.rs-year__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--al-navy);
  transition: background .2s ease;
}

.rs-year__summary::-webkit-details-marker {
  display: none;
}

.rs-year__summary:hover {
  background: rgba(0, 159, 227, .05);
}

.rs-year__summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--al-blue);
  line-height: 1;
}

.rs-year[open] .rs-year__summary::after {
  content: "\2212";
}

.rs-year[open] .rs-year__summary {
  border-bottom: 1px solid var(--rs-border);
}

.rs-year__label {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--al-indigo);
}

.rs-year__count {
  font-size: .74rem;
  font-weight: 700;
  color: var(--al-muted);
  background: var(--al-bg);
  border-radius: 20px;
  padding: 3px 10px;
}

.rs-pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rs-pub {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  border-top: 1px solid rgba(16, 24, 40, .06);
}

.rs-pub:first-child {
  border-top: 0;
}

.rs-pub__thumb {
  flex: 0 0 46px;
}

.rs-pub__thumb img {
  width: 46px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .18);
}

.rs-pub__body {
  min-width: 0;
}

.rs-pub__authors {
  font-size: .88rem;
  color: var(--al-muted);
  margin: 0 0 4px;
  line-height: 1.5;
}

.rs-pub__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 5px;
  color: var(--al-text);
}

.rs-pub__title a {
  color: var(--al-navy);
}

.rs-pub__title a:hover {
  color: var(--al-blue);
}

.rs-pub__type {
  display: inline-block;
  margin-left: 8px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--al-blue);
  background: rgba(0, 159, 227, .12);
  border-radius: 6px;
  padding: 3px 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.rs-pub__venue {
  font-size: .88rem;
  font-style: italic;
  color: var(--al-muted);
  margin: 0 0 8px;
}

.rs-pub__links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  font-weight: 600;
}

.rs-bibtex summary {
  cursor: pointer;
  color: var(--al-blue);
  list-style: none;
}

.rs-bibtex summary::-webkit-details-marker {
  display: none;
}

.rs-bibtex pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  background: var(--al-bg);
  border: 1px solid var(--rs-border);
  border-radius: 10px;
  font-size: .78rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

/* --- Single resource --- */
.rs-single__head {
  background: linear-gradient(135deg, var(--al-navy) 0%, var(--al-indigo) 60%, var(--al-blue) 100%);
  color: #fff;
}

.rs-single__inner {
  max-width: var(--rs-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: center;
  padding-block: 48px 54px;
}

.rs-single__back {
  display: inline-block;
  color: rgba(255, 255, 255, .82);
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 16px;
}

.rs-single__back::before {
  content: "\2190";
  margin-right: .45rem;
}

.rs-single__back:hover {
  color: #fff;
}

.rs-single__title {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.15;
  margin: 6px 0 10px;
  color: #fff;
}

.rs-single__subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .9);
  margin: 0 0 12px;
}

.rs-single__authors {
  font-weight: 600;
  color: rgba(255, 255, 255, .85);
  margin: 0 0 6px;
}

.rs-single__meta {
  font-size: .9rem;
  color: rgba(255, 255, 255, .72);
  margin: 0 0 18px;
}

.rs-single__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rs-single__cover {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(6, 18, 46, .4);
}

.rs-single__cover img {
  width: 100%;
  object-fit: cover;
}

.rs-single__body {
  max-width: 860px;
  margin-inline: auto;
  padding-block: 44px;
}

.rs-single__body .prose p {
  font-size: 1.08rem;
  line-height: 1.9;
  margin: 1rem 0;
}

.rs-single__body .prose h2 {
  color: var(--al-indigo);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.rs-single__body .prose h3 {
  color: var(--al-blue);
  font-size: 1.2rem;
  margin: 1.4rem 0 .6rem;
}

.rs-single__projects {
  margin-top: 40px;
}

.rs-single__project-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rs-single__project-list li {
  padding: 14px 18px;
  background: var(--al-bg);
  border: 1px solid var(--rs-border);
  border-radius: 12px;
  font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .rs-book {
    grid-template-columns: 150px 1fr;
    gap: 22px;
    padding: 20px;
  }

  .rs-single__inner {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 34px 40px;
  }

  .rs-single__cover {
    order: -1;
    max-width: 220px;
  }
}

@media (max-width: 640px) {
  .rs-book {
    grid-template-columns: 1fr;
  }

  .rs-book__cover {
    max-width: 170px;
  }

  .rs-grid,
  .rs-projects,
  .rs-project__outputs {
    grid-template-columns: 1fr;
  }

  .rs-output {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }

  .rs-pub {
    flex-direction: column;
    gap: 12px;
  }

  .rs-nav__inner {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rs-nav__link {
    white-space: nowrap;
  }
}
