/*
  ============================================================
  MPO — Research & Outputs page styles
  Supplements style.css (which must also be loaded).
  ============================================================
*/


/* ============================================================
   ACCESSIBILITY UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   NAV ACTIVE STATE
   ============================================================ */
.nav__link--active {
  color: var(--color-accent);
  font-weight: 600;
}


/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
  padding-block: var(--sp-20) var(--sp-16);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.page-hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-16);
  align-items: center;
}

@media (min-width: 768px) {
  .page-hero__inner {
    grid-template-columns: 55fr 45fr;
    gap: var(--sp-20);
  }
}

.page-hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-text);
}

.page-hero__desc {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.75;
  max-width: 520px;
}

/* Raw photo — no border-radius or shadow */
.page-hero__image-wrap {
  display: none;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
  .page-hero__image-wrap {
    display: block;
  }
}

.page-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ============================================================
   PUBLICATIONS LIST — editorial, no card boxes
   ============================================================ */
.publications {
  padding-block: var(--sp-20);
}

.pub-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.pub-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-12);
  align-items: start;
  padding-block: var(--sp-16);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .pub-card {
    grid-template-columns: 260px 1fr;
    gap: var(--sp-16);
  }
}

.pub-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.pub-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.pub-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pub-card__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
}

.pub-card__desc {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 600px;
}

.pub-card__download {
  align-self: flex-start;
  margin-top: var(--sp-2);
}


/* ============================================================
   IMAGE STACK — fanned photos with rounded corners
   Used in page-hero and pub-card image slots.
   ============================================================ */
.img-stack {
  position: relative;
  width: 100%;
  height: 320px;
  flex-shrink: 0;
}

.img-stack__item {
  position: absolute;
  width: 84%;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

/* Back card — rotated right, bottom-right anchor */
.img-stack__item--back {
  bottom: 0;
  right: 0;
  transform: rotate(5.5deg);
  z-index: 1;
  object-position: center 30%;
}

/* Middle card */
.img-stack__item--mid {
  bottom: 28px;
  right: 20px;
  transform: rotate(-3deg);
  z-index: 2;
  object-position: center 20%;
}

/* Front card — slight tilt, highest */
.img-stack__item--front {
  bottom: 56px;
  right: 40px;
  transform: rotate(1.5deg);
  z-index: 3;
  object-position: center 15%;
}

/* Tighter stack for the pub-card (narrower column) */
.pub-card__image-stack {
  height: 280px;
}

.pub-card__image-stack .img-stack__item {
  height: 210px;
}


/* ============================================================
   EMAIL GATE MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.modal__card {
  position: relative;
  z-index: 1;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

/* Teal accent bar at top */
.modal__accent {
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
}

/* Both states sit inside the card with consistent padding */
#modal-form-state,
#modal-success {
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

#modal-form-state[hidden],
#modal-success[hidden] {
  display: none;
}

.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.modal__desc {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-top: calc(var(--sp-2) * -1);
}

/* Form internals */
.modal__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.modal__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.modal__input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.modal__input::placeholder {
  color: var(--color-text-muted);
}

.modal__input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(91, 191, 170, 0.15);
}

.modal__submit {
  width: 100%;
  height: 44px;
  font-size: var(--text-xs);
  margin-top: var(--sp-2);
}

.modal__privacy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-top: calc(var(--sp-2) * -1);
}

.modal__cancel {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  text-align: center;
  transition: color var(--transition-fast);
  margin-top: calc(var(--sp-2) * -1);
}

.modal__cancel:hover {
  color: var(--color-text);
}

/* Success state */
.modal__success-state {
  text-align: center;
  align-items: center;
}

.modal__success-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent-dim);
  color: var(--color-accent);
  font-size: var(--text-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__fallback {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: calc(var(--sp-2) * -1);
}

.modal__fallback-link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal__fallback-link:hover {
  color: var(--color-accent-hover);
}

.modal__close-btn {
  margin-top: calc(var(--sp-2) * -1);
}
