@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

/* ───────────────────────────────────────────────────────────
   1. Variables
   ─────────────────────────────────────────────────────────── */

:root {
  --teal: #007d69;
  --teal-dark: #003c3c;
  --teal-bright: #00c896;
  --teal-highlight: #00dca5;
  --ink: #1e293b;
  --muted: #64748b;
  --panel: #ffffff;
  --panel-border: rgba(0, 60, 60, 0.15);
  --fit-good-bg: #f2fcf9;
  --fit-good-border: rgba(0, 200, 150, 0.2);
  --fit-bad-bg: #fff1f2;
  --fit-bad-border: rgba(225, 29, 72, 0.2);
  --bad-title: #e11d48;
  --font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --card-radius: 20px;
}

/* ───────────────────────────────────────────────────────────
   2. Reveal.js global overrides
   ─────────────────────────────────────────────────────────── */

.reveal-viewport {
  background-color: #fff !important;
  background-image: url('background-right.png') !important;
  background-size: auto 100% !important;
  background-position: right top !important;
  background-repeat: no-repeat !important;
}

.reveal-viewport::before {
  content: "";
  position: absolute;
  bottom: 60px;
  left: 80px;
  width: 265px;
  height: 50px;
  background-image: url('Technician_Commitment.png');
  background-size: contain;
  background-position: left bottom;
  background-repeat: no-repeat;
  z-index: 50;
  pointer-events: none;
}

.reveal-viewport::after {
  content: "";
  position: absolute;
  bottom: 60px;
  right: 80px;
  width: 200px;
  height: 55px;
  background-image: url('gw4-logo.png');
  background-size: contain;
  background-position: right bottom;
  background-repeat: no-repeat;
  z-index: 50;
  pointer-events: none;
}

.reveal {
  font-family: var(--font-family);
  font-size: 38px;
}

body .reveal-viewport .reveal .slides section,
body .reveal-viewport .reveal,
.reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6,
.reveal p, .reveal a, .reveal li {
  font-family: "Outfit", system-ui, -apple-system, sans-serif !important;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  margin: 0;
  color: var(--teal-dark);
  text-transform: none !important;
}

.reveal .slides section {
  text-align: left;
  height: 1080px !important;
  width: 1920px !important;
  padding-top: 160px !important;
  box-sizing: border-box;
  overflow-y: auto !important;
  overflow-x: hidden;
}

.reveal .slides section h2 {
  font-size: 1.5em;
  margin-bottom: 0.2em;
}

/* Hardcode logos to the global layout */
.reveal::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 20px;
  width: 220px;
  height: 75px;
  background-image: url('uoe-logo.png');
  background-size: contain;
  background-position: left top;
  background-repeat: no-repeat;
  z-index: 50;
  pointer-events: none;
}

.reveal::before {
  content: "Research Software\A and Analytics";
  white-space: pre-wrap;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
  height: auto;
  background-color: #82c3a6;
  color: var(--teal-dark);
  font-size: 28px;
  font-family: var(--font-family);
  font-weight: 700;
  text-align: right;
  padding: 22px 35px;
  box-sizing: border-box;
  border-bottom-left-radius: 40px;
  z-index: 50;
  pointer-events: none;
  line-height: 1.15;
}

.corner-logo {
  display: none;
}

.footer-gw4 {
  display: none;
}

/* ───────────────────────────────────────────────────────────
   3. Shell slide — the standard themed slide
      No wrapper div needed; content divs are direct children.
   ─────────────────────────────────────────────────────────── */

.reveal .slides section.shell-slide {
  padding-left: 1.6rem;
  padding-right: 1.6rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 1080px !important;
}

/* Main content areas fill available vertical space */
.shell-slide > .shell-grid,
.shell-slide > .fit-panels,
.shell-slide > .contact-grid,
.shell-slide > .shell-text,
.shell-slide > .flow-row,
.shell-slide > .columns {
  flex: 1;
  min-height: 0;
}

/* When .columns fills a shell-slide, stretch children to the available height
   so tall content is clipped/scrolled rather than overflowing the slide. */
.shell-slide > .columns {
  align-items: stretch;
}

.shell-slide > .columns > .column {
  overflow-y: auto;
}

/* Pandoc columns — global side-by-side layout for any `::: columns` block.
   The `.shell-slide > .columns` rule above additionally makes it fill the
   slide height when used inside a shell-slide. */
.reveal .columns {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  margin-top: 0.45rem;
}

.reveal .columns > .column {
  min-width: 0;
  font-size: 0.95em;
  color: var(--ink);
  line-height: 1.4;
}

.reveal .columns > .column pre,
.reveal .columns > .column p {
  margin: 0 0 0.45rem;
}

/* Prevent the slide-note from stretching */
.shell-slide > .slide-note {
  flex: 0 0 auto;
}

/* h3/h4 subheadings inside shell slides */
.shell-slide h3 {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0.35rem 0 0.15rem;
}

.shell-slide h4 {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--teal);
  margin: 0.25rem 0 0.1rem;
}

/* ───────────────────────────────────────────────────────────
   4. Slide subtitle — secondary line below h2
   ─────────────────────────────────────────────────────────── */

.slide-subtitle {
  margin-top: 0.2rem;
  margin-bottom: 0.55rem;
  font-size: 0.95em;
  font-weight: 300;
  color: var(--muted);
}

.slide-subtitle p {
  margin: 0;
}

/* ───────────────────────────────────────────────────────────
   5. Slide note — unified footnote / aside
      Replaces .fit-note and .shell-note
   ─────────────────────────────────────────────────────────── */

.slide-note {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--panel-border);
  font-size: 0.55em;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.25;
  max-width: 95%;
}

.slide-note p {
  margin: 0 0 0.15rem;
}

/* ───────────────────────────────────────────────────────────
   6. Shell text — body text block
   ─────────────────────────────────────────────────────────── */

.shell-text {
  font-size: 0.95em;
  color: var(--ink);
  line-height: 1.4;
  padding-right: 1rem;
}

.shell-text p {
  margin: 0 0 0.45rem;
}

.shell-text .emphasis {
  font-weight: 700;
}

/* ───────────────────────────────────────────────────────────
   7. Shell grid — text (+ optional image) layout
      With .grid-image child: two-column (55/45).
      Without: single column, full width.
   ─────────────────────────────────────────────────────────── */

.shell-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
  align-items: start;
  margin-top: 0.45rem;
}

.shell-grid:has(> .grid-image) {
  grid-template-columns: 55% 45%;
}

.grid-image p {
  margin: 0;
}

.grid-image img {
  width: 100%;
  border-radius: 8px;
}

/* ───────────────────────────────────────────────────────────
   8. Fit panels — good / bad comparison cards
   ─────────────────────────────────────────────────────────── */

.fit-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.45rem;
}

.fit-panel {
  border-radius: var(--card-radius);
  padding: 0.65rem 0.75rem;
  border: 1px solid;
  min-height: 332px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  word-wrap: break-word;
  overflow: hidden;
}

.fit-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.fit-panel.good {
  background: var(--fit-good-bg);
  border-color: var(--fit-good-border);
}

.fit-panel.bad {
  background: var(--fit-bad-bg);
  border-color: var(--fit-bad-border);
}

.fit-panel .fit-title {
  display: block;
  font-size: 1.35em;
  font-weight: 700;
}

.fit-panel.good .fit-title {
  color: var(--teal-dark);
}

.fit-panel.bad .fit-title {
  color: var(--bad-title);
}

.fit-panel p {
  margin: 0 0 0.4rem;
}

.fit-panel ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.85em;
  line-height: 1.36;
  color: var(--ink);
}

/* ───────────────────────────────────────────────────────────
   9. Flow row — N-step process
      Uses CSS grid with auto-fit so cards wrap to new rows
      and stay equal-width. Arrows hide at line breaks via
      the .flow-row-inner wrapper approach:
      Instead, we use a simple grid of cards only (no arrows
      in the DOM), with a CSS ::after arrow on each non-last card.
   ─────────────────────────────────────────────────────────── */

.flow-row {
  margin-top: 0.48rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  column-gap: 2.4rem;
  row-gap: 0.6rem;
  position: relative;
}

.flow-card {
  position: relative;
  background: var(--fit-good-bg);
  border: 1px solid var(--fit-good-border);
  border-radius: var(--card-radius);
  padding: 0.55rem 0.58rem;
  box-sizing: border-box;
  min-height: 132px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flow-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

/* Arrow rendered in the column-gap between cards */
.flow-card:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
  font-size: 1.15em;
  font-weight: 700;
  pointer-events: none;
}

.flow-card .flow-title {
  display: block;
  font-size: 1.25em;
  font-weight: 700;
  color: var(--teal-dark);
}

.flow-card p {
  margin: 0;
  font-size: 0.75em;
  color: #282828;
  line-height: 1.32;
}

.flow-card p:first-child {
  margin-bottom: 0.2rem;
}

/* ───────────────────────────────────────────────────────────
   10. Contact grid — contact card + CTA card
   ─────────────────────────────────────────────────────────── */

.contact-grid {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: 62% 38%;
  gap: 0.8rem;
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: 0.72rem 0.86rem;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.contact-card p {
  margin: 0 0 0.36rem;
  font-size: 0.8em;
  color: var(--ink);
  line-height: 1.35;
}

.contact-card p:first-child {
  color: var(--teal-dark);
  font-weight: 700;
}

.cta-card {
  background: var(--fit-good-bg);
  border: 1px solid var(--fit-good-border);
  border-radius: var(--card-radius);
  padding: 0.72rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 402px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.cta-card p {
  margin: 0;
  text-align: center;
  font-size: 0.85em;
  color: var(--teal-dark);
  font-weight: 700;
}

.cta-card img {
  width: 210px;
  max-width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
}

/* ───────────────────────────────────────────────────────────
   11. Hero slide — title/landing page
       Uses .hero-grid as direct child (no .slide-frame wrapper).
   ─────────────────────────────────────────────────────────── */

.reveal .slides section.hero-slide {
  display: flex;
  flex-direction: column;
}

.hero-slide > h2 {
  display: none;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 1.2rem;
  align-items: stretch;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0;
}

.hero-left > p {
  margin: 0;
}

.hero-uoe {
  display: none;
}

.hero-title {
  font-size: 2.1em;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.08;
  margin-top: 0.2rem;
}

.hero-title p {
  margin: 0;
  color: inherit;
}

.hero-subtitle {
  font-size: 0.95em;
  color: #282828;
  line-height: 1.3;
  max-width: 88%;
}

.hero-subtitle p {
  margin: 0;
}

.next-steps-card {
  margin-top: 0.2rem;
  width: 84%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: 0.8rem 1rem;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.next-steps-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.next-steps-card .card-title {
  display: block;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--teal-dark);
}

.next-steps-card p {
  margin: 0 0 0.35rem;
}

.next-steps-card ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.8em;
  color: var(--ink);
  line-height: 1.35;
}

.next-steps-card a,
.reveal a {
  color: #006a8f;
}

.docs-qr-block {
  margin-top: 0.2rem;
  width: 180px;
  text-align: center;
}

.docs-qr-block p {
  margin: 0;
}

.docs-qr-block img {
  display: block;
  width: 170px;
  margin: 0 auto;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
}

.docs-qr-block a {
  font-size: 0.55em;
  color: #505050;
  text-decoration: none;
}

.presenter-line {
  margin-top: auto;
  margin-bottom: 0.4rem;
  font-size: 0.6em;
  color: #464646;
}

.presenter-line p {
  margin: 0;
}

.hero-gw4 {
  display: none;
}

.hero-right {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.hero-right p {
  margin: 0;
}

.hero-right img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 8px;
}

/* ───────────────────────────────────────────────────────────
   12. Q&A slide — large centred question prompt
   ─────────────────────────────────────────────────────────── */

.reveal .slides section.qa-slide {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 !important;
  height: 1080px !important;
}

.qa-slide > h2 {
  display: none;
}

.qa-slide .qa-mark {
  font-size: 9em;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1;
  letter-spacing: -0.02em;
}

.qa-slide .qa-mark p {
  margin: 0;
}

.qa-slide .qa-subtitle {
  margin-top: 1.4rem;
  font-size: 1.15em;
  font-weight: 300;
  color: var(--muted);
  max-width: 70%;
}

.qa-slide .qa-subtitle p {
  margin: 0;
}

/* ───────────────────────────────────────────────────────────
   13. Case study slide — photo background with overlay panel
   ─────────────────────────────────────────────────────────── */

.case-study-slide > h2 {
  margin-bottom: 0.2rem;
}

.case-study-wrap {
  position: relative;
  min-height: 615px;
  overflow: hidden;
  border-radius: 10px;
}

.case-study-wrap > p {
  margin: 0;
}

.case-study-wrap .low-density {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-study-wrap .panel {
  position: absolute;
  left: 4%;
  top: 23%;
  width: 49%;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--card-radius);
  padding: 0.7rem 0.82rem;
  box-sizing: border-box;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.case-study-wrap .panel .panel-title {
  display: block;
  color: #ffffff;
  font-size: 1.18em;
  font-weight: 700;
  margin: 0.2rem 0 0.06rem;
}

.case-study-wrap .panel p {
  margin: 0 0 0.2rem;
  font-size: 0.5em;
  line-height: 1.35;
}

.case-study-wrap .pi-line {
  position: absolute;
  left: 3.6%;
  top: 13.3%;
  color: #ffffff;
  font-size: 0.75em;
}

.case-study-wrap .pi-line p {
  margin: 0;
}

.case-study-wrap .high-density {
  position: absolute;
  right: 1.1%;
  top: 21%;
  width: 30%;
  border-radius: 8px;
}

.case-study-wrap .label {
  position: absolute;
  color: #ffffff;
  font-size: 0.47em;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
}

.case-study-wrap .label p {
  margin: 0;
}

.case-study-wrap .label.low {
  right: 12.8%;
  bottom: 10.6%;
}

.case-study-wrap .label.high {
  right: 2.2%;
  top: 42.3%;
}

/* ───────────────────────────────────────────────────────────
   14. Stat grid — key-metrics summary cards
   ─────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 0.45rem;
}

/* Allow stat-grid as a direct shell-slide child to fill space */
.shell-slide > .stat-grid {
  flex: 1;
  min-height: 0;
}

.stat-card {
  background: var(--fit-good-bg);
  border: 1px solid var(--fit-good-border);
  border-radius: var(--card-radius);
  padding: 0.8rem 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card p {
  margin: 0;
}

.stat-value {
  display: block;
  font-size: 2.2em;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.05;
}

.stat-label {
  display: block;
  font-size: 0.55em;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.3;
}

/* ───────────────────────────────────────────────────────────
   15. Code blocks — remove reveal.js default max-height cap
   ─────────────────────────────────────────────────────────── */

/* reveal.js white theme sets pre code { max-height: 400px } which clips
   tall code blocks: the shaded background stops at the cap while text
   overflows it. Remove the cap so the shaded box always encloses all lines. */
.reveal pre {
  width: 100%;
  box-sizing: border-box;
}

.reveal pre code {
  max-height: none;
}

/* ───────────────────────────────────────────────────────────
   16. Figure captions
   ─────────────────────────────────────────────────────────── */

.reveal figcaption {
  font-size: 0.5em;
  color: var(--muted);
  text-align: center;
  margin-top: 0.3rem;
}

/* QR code blocks: restore font-size to 1em so the .docs-qr-block a /
   .cta-card p size rules apply from the correct base; tighten gap. */
.docs-qr-block figcaption,
.cta-card figcaption {
  font-size: 1em;
  margin-top: 0;
}

/* ───────────────────────────────────────────────────────────
   17. Responsive
   ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .hero-grid,
  .shell-grid,
  .contact-grid,
  .fit-panels,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .flow-row {
    grid-template-columns: 1fr;
  }

  .reveal::after,
  .reveal::before,
  .footer-gw4,
  .corner-logo {
    display: none;
  }

  .hero-right img {
    max-height: 320px;
  }

  .case-study-wrap .panel {
    width: 60%;
  }
}
