/*
 * The annual reports page (components/ReportsPage.tsx), 2026-11-04. The Elementor page set the covers by hand in
 * rows of four (empty 2025/2026 slots, square and tall covers at different sizes); here the newest report is a large
 * card and the rest stand on a shelf: every cover centred in the same square tile, its own shape kept.
 * The hero is the program pages' (components/PageHero.tsx, styles/hero.css) with this page's lighter overlay.
 */

.acm-rp {
  --rp-tile: var(--accent-soft);
}

.acm-rp-intro {
  max-width: 860px;
  margin: 0 auto 40px;
  font-family: var(--font-body);
  font-size: 16.2px;
  line-height: 1.5;
  color: var(--acm-text);
}
.acm-rp-intro p {
  margin: 0 0 1em;
}
.acm-rp-intro p:last-child {
  margin-bottom: 0;
}

/* covers: the plugin's thumbnails keep their own shape */
.acm-rp-latest__cover img,
.acm-rp-book__cover img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 14px 28px -12px rgba(16, 18, 60, 0.45), 0 2px 6px rgba(16, 18, 60, 0.12);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.acm-rp-nocover {
  display: grid;
  place-items: center;
  width: 70%;
  aspect-ratio: 3 / 4;
  background: #fff;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  box-shadow: var(--sh-card);
}

/* the newest report */
.acm-rp .acm-rp-latest {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 48px;
  margin: 0 0 72px;
  padding: 40px 48px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-soft) 100%);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.3s;
}
.acm-rp .acm-rp-latest:hover {
  box-shadow: var(--sh-card-hover);
}
.acm-rp .acm-rp-latest:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.acm-rp-latest__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 380px;
}
.acm-rp-latest:hover .acm-rp-latest__cover img {
  transform: translateY(-6px) rotate(-1deg);
}
.acm-rp-latest__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.acm-rp-latest__label {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
}
.acm-rp-latest__title {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--acm-ink);
}
.acm-rp-latest__text {
  max-width: 480px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--acm-text-2);
}
.acm-rp-latest__btn {
  margin-top: 8px;
}
.acm-rp-latest:hover .acm-rp-latest__btn {
  transform: translateX(4px);
}

/* the shelf */
.acm-rp-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acm-rp .acm-rp-book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}
/* every tile the same square: the cover is centred inside it at its own shape */
.acm-rp-book__cover img {
  position: absolute;
  inset: 18px;
  margin: auto;
  max-width: calc(100% - 36px);
  max-height: calc(100% - 36px);
}
.acm-rp-book__cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 8px;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--rp-tile);
  transition: background-color 0.25s;
}
.acm-rp-book:hover .acm-rp-book__cover {
  background: #e8eaff;
}
.acm-rp-book:hover .acm-rp-book__cover img {
  transform: translateY(-5px);
  box-shadow: 0 22px 34px -14px rgba(16, 18, 60, 0.5), 0 2px 6px rgba(16, 18, 60, 0.12);
}
.acm-rp .acm-rp-book:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--r-md);
}
.acm-rp-book__year {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--acm-ink);
}
.acm-rp-book__pdf {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--accent);
  opacity: 0.8;
}

@media (max-width: 1024px) {
  .acm-rp .acm-rp-latest {
    gap: 32px;
    padding: 32px;
  }
  .acm-rp-latest__cover {
    height: 300px;
  }
  .acm-rp-latest__title {
    font-size: 28px;
  }
  .acm-rp-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .acm-rp .acm-rp-latest {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 48px;
    padding: 28px 22px;
    text-align: left;
  }
  .acm-rp-latest__cover {
    height: 260px;
  }
  .acm-rp-latest__title {
    font-size: 24px;
  }
  .acm-rp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }
  .acm-rp-book__cover {
    padding: 14px;
  }
  .acm-rp-book__cover img {
    inset: 14px;
    max-width: calc(100% - 28px);
    max-height: calc(100% - 28px);
  }
}

/* the cards are buttons that open the book viewer: no button look of their own */
.acm-rp button.acm-rp-latest,
.acm-rp button.acm-rp-book {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.acm-rp button.acm-rp-book {
  padding: 0;
  background: none;
}
.acm-rp-book__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ───────── the book viewer (components/ReportBook.tsx; the UBIFF brochure viewer in plain CSS) ───────── */

.acm-fb {
  user-select: none;
  touch-action: none;
}
.acm-fb__stage {
  height: 86vh;
}
.acm-fb__stage--ease {
  transition: transform 0.2s ease-out;
}
.acm-fb__spread {
  position: relative;
  display: flex;
  height: 100%;
  perspective: 2400px;
}
.acm-fb__box {
  position: relative;
  height: 100%;
}
.acm-fb__box--two {
  width: 44vw;
  max-width: 640px;
}
.acm-fb__box--one {
  width: 92vw;
  max-width: 900px;
}
.acm-fb .acm-fb__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
/* the two pages meet at the spine like an open book */
.acm-fb .acm-fb__img--left {
  object-position: right center;
}
.acm-fb .acm-fb__img--right {
  object-position: left center;
}
.acm-fb__wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
}
.acm-fb__spin {
  animation: acm-fb-spin 0.9s linear infinite;
}
@keyframes acm-fb-spin {
  to {
    transform: rotate(360deg);
  }
}
.acm-fb__leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
}
.acm-fb__leaf--next {
  left: 50%;
  transform-origin: left center;
  animation: acm-fb-leaf-next 0.7s ease-in-out forwards;
}
.acm-fb__leaf--prev {
  left: 0;
  transform-origin: right center;
  animation: acm-fb-leaf-prev 0.7s ease-in-out forwards;
}
.acm-fb__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}
.acm-fb__face--back {
  transform: rotateY(180deg);
}
/* the leaf darkens a little as it lifts and turns away from the light */
.acm-fb__shade {
  position: absolute;
  inset: 0;
  background: #000;
  pointer-events: none;
  animation: acm-fb-shade 0.7s ease-in-out forwards;
}
.acm-fb__in--next {
  transform-origin: left center;
  animation: acm-fb-in-next 0.7s ease-out;
}
.acm-fb__in--prev {
  transform-origin: right center;
  animation: acm-fb-in-prev 0.7s ease-out;
}
@keyframes acm-fb-leaf-next {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}
@keyframes acm-fb-leaf-prev {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}
@keyframes acm-fb-shade {
  from { opacity: 0; }
  to { opacity: 0.35; }
}
@keyframes acm-fb-in-next {
  from { transform: rotateY(-75deg); opacity: 0.4; }
  to { transform: rotateY(0deg); opacity: 1; }
}
@keyframes acm-fb-in-prev {
  from { transform: rotateY(75deg); opacity: 0.4; }
  to { transform: rotateY(0deg); opacity: 1; }
}

.acm-fb__tools {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.acm-fb .acm-fb__round,
.acm-fb .acm-fb__nav {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background-color 0.2s, opacity 0.2s;
}
.acm-fb .acm-fb__round {
  width: 44px;
  height: 44px;
}
.acm-fb .acm-fb__round:hover,
.acm-fb .acm-fb__nav:hover {
  background: rgba(0, 0, 0, 0.65);
}
.acm-fb .acm-fb__round:disabled,
.acm-fb .acm-fb__nav:disabled {
  opacity: 0.3;
  cursor: default;
}
.acm-fb .acm-fb__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}
.acm-fb__nav--prev {
  left: 12px;
}
.acm-fb__nav--next {
  right: 12px;
}
.acm-fb__count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  margin: 0;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--font-head);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}
.acm-fb__count span {
  margin-left: 12px;
  color: rgba(255, 255, 255, 0.6);
}
.acm-fb__msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: var(--font-head);
  color: rgba(255, 255, 255, 0.85);
}
.acm-fb__msg p {
  margin: 0;
}
.acm-fb .acm-fb__msgBtn {
  padding: 10px 22px;
  border-radius: var(--r-pill);
  background: #fff;
  font-weight: 700;
  color: var(--acm-ink);
}
@media (max-width: 767px) {
  .acm-fb .acm-fb__nav {
    width: 40px;
    height: 40px;
  }
  .acm-fb__nav--prev {
    left: 6px;
  }
  .acm-fb__nav--next {
    right: 6px;
  }
  .acm-fb__tools {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  .acm-fb .acm-fb__round {
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .acm-fb__leaf--next,
  .acm-fb__leaf--prev,
  .acm-fb__in--next,
  .acm-fb__in--prev {
    animation: none;
  }
}
/* a flipbook left in an Elementor page (components/Flipbook.tsx): the cover is the button */
button.acm-flipbook__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
