/* IoT Garage brochure: cover cards and the flipbook viewer (panel and full page). */

:root {
  --fb-ink: #1f2430;
  --fb-muted: #5e6472;
  --fb-accent: #2563eb;
  --fb-orange: #f0802a;
  --fb-paper: #fbf1e6;
}

/* ---------- cover card ---------- */
.brochure-cover {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.brochure-cover__book {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  transform: perspective(1200px) rotateY(-8deg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 18px 22px 40px rgba(31, 36, 48, 0.22), 2px 2px 6px rgba(31, 36, 48, 0.18);
}
.brochure-cover__book img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.brochure-cover__book::after {
  /* the spine */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}
.brochure-cover__book:hover,
.brochure-cover__book:focus-visible {
  transform: perspective(1200px) rotateY(0deg) translateY(-4px);
  box-shadow: 10px 26px 50px rgba(31, 36, 48, 0.28), 2px 2px 6px rgba(31, 36, 48, 0.18);
  outline: none;
}
.brochure-cover__hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.82);
  color: #fff;
  font: 700 0.8rem/1.2 Lato, system-ui, sans-serif;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.brochure-cover__book:hover .brochure-cover__hint,
.brochure-cover__book:focus-visible .brochure-cover__hint { opacity: 1; }

.brochure-cover__choices {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.brochure-cover--both:hover .brochure-cover__choices,
.brochure-cover--both:focus-within .brochure-cover__choices {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .brochure-cover__choices { opacity: 1; transform: none; }
  .brochure-cover__hint { opacity: 1; }
}
.brochure-cover__choices button {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #fff;
  color: var(--fb-accent);
  font: 700 0.85rem/1.2 Lato, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.brochure-cover__choices button:first-child { background: var(--fb-accent); color: #fff; border-color: var(--fb-accent); }
.brochure-cover__choices button:hover { background: var(--fb-accent); color: #fff; }

/* research outputs hero: the cover replaces the illustration */
.research-hero__illustration .brochure-cover { width: min(250px, 100%); }
.research-hero__illustration .brochure-cover__book { width: 100%; }
.research-hero__brochure-label {
  margin: 0;
  font: 700 0.78rem/1.3 Lato, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fb-muted);
  text-align: center;
}

/* annual reports carousel: the brochure card gets a second button */
.research-report--brochure .research-report__actions { display: flex; flex-direction: column; gap: 0.5rem; }
.research-report--brochure .research-report__media button {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
}
.research-report--brochure .research-report__media img { transition: transform 0.3s ease; }
.research-report--brochure .research-report__media button:hover img { transform: translateY(-4px) scale(1.02); }
.research-report__new {
  display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: var(--fb-orange); color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: middle;
}

/* home page band above the project grid */
.brochure-band {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0.5rem 0 1.75rem;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  background: linear-gradient(100deg, #fff7ee 0%, #fdf1e3 55%, #eef3ff 100%);
  border: 1px solid #f3dfc8;
}
.brochure-band .brochure-cover { width: 92px; flex: none; }
.brochure-band .brochure-cover__book { width: 100%; transform: rotate(-4deg); }
.brochure-band .brochure-cover__book:hover { transform: rotate(0deg) translateY(-3px); }
.brochure-band .brochure-cover__hint { display: none; }
.brochure-band__text { flex: 1; min-width: 0; }
.brochure-band__eyebrow {
  margin: 0 0 0.15rem; font: 700 0.75rem/1.2 Lato, system-ui, sans-serif; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fb-orange);
}
.brochure-band__title { margin: 0; font: 900 1.35rem/1.25 Lato, system-ui, sans-serif; color: var(--fb-ink); }
.brochure-band__blurb { margin: 0.25rem 0 0; color: var(--fb-muted); font: 400 0.95rem/1.45 Lato, system-ui, sans-serif; }
.brochure-band__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.brochure-band__actions button {
  padding: 0.6rem 1.1rem; border-radius: 10px; border: 1px solid var(--fb-accent); background: #fff;
  color: var(--fb-accent); font: 700 0.92rem/1.2 Lato, system-ui, sans-serif; cursor: pointer;
}
.brochure-band__actions button:first-child { background: var(--fb-accent); color: #fff; }
@media (max-width: 720px) {
  .brochure-band { flex-wrap: wrap; }
  .brochure-band__actions { width: 100%; }
}

/* ---------- viewer ---------- */
.flipbook {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  color: var(--fb-ink);
  font-family: Lato, system-ui, sans-serif;
}
.flipbook__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #ece3d6;
  background: #fff;
}
.flipbook__title { flex: 1; min-width: 0; font-weight: 900; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flipbook__tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: #f1ece4; }
.flipbook__tab {
  border: 0; background: none; padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer;
  font: 700 0.85rem/1.2 Lato, system-ui, sans-serif; color: var(--fb-muted);
}
.flipbook__tab.is-active { background: #fff; color: var(--fb-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.flipbook__actions { display: flex; gap: 0.4rem; }
.flipbook__btn {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.7rem; border-radius: 8px;
  border: 1px solid #e3dccf; background: #fff; color: var(--fb-ink); cursor: pointer; text-decoration: none;
  font: 700 0.85rem/1.2 Lato, system-ui, sans-serif;
}
.flipbook__btn:hover { border-color: var(--fb-accent); color: var(--fb-accent); }
.flipbook__btn svg, .flipbook__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.flipbook__btn--close { padding: 0.45rem; }

.flipbook__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 1.2rem 0.4rem;
  background: radial-gradient(ellipse at center, #fff 0%, var(--fb-paper) 70%);
  overflow: hidden;
}
.flipbook__holder { margin: 0 auto; }
.flipbook__book { width: 100%; }
.flipbook__page { background: #fff; overflow: hidden; }
.flipbook__page img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; background: var(--fb-paper); }

.flipbook__nav {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.55rem 1rem 0.8rem; background: var(--fb-paper);
}
.flipbook__arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e3dccf; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fb-ink);
}
.flipbook__arrow:hover { border-color: var(--fb-accent); color: var(--fb-accent); }
.flipbook__counter { min-width: 11rem; text-align: center; font-weight: 700; font-size: 0.9rem; color: var(--fb-muted); }

/* panel over the page */
html.flipbook-open { overflow: hidden; }
.flipbook-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 2vh 2vw;
  background: rgba(20, 22, 28, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.25s ease;
}
.flipbook-modal.is-open { opacity: 1; }
.flipbook-modal__panel {
  width: min(1500px, 96vw); height: 94vh;
  border-radius: 14px; overflow: hidden; background: var(--fb-paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* full page */
.brochure-page { padding: 0; }
.brochure-page__mount { height: calc(100vh - 64px); min-height: 560px; }

@media (max-width: 720px) {
  .flipbook__bar { flex-wrap: wrap; gap: 0.5rem; }
  .flipbook__title { flex-basis: 100%; }
  .flipbook__btn span { display: none; }
  .flipbook-modal { padding: 0; }
  .flipbook-modal__panel { width: 100vw; height: 100vh; border-radius: 0; }
}
