/* ===================================================================
   Open Universiteit – Reveal.js 
   -------------------------------------------------------------------
   - Optimized for fitting content on single slides
   - Clean white/grey aesthetic
   - Corporate palette based on Brand Manual 2023
   =================================================================== */

/* ---------- Fonts ------------------------------------------------------- */

/* SF Pro Rounded (Rounded Headings) */
@font-face {
  font-family: 'SF Pro Rounded';
  src: url('../fonts/SF-Pro-Rounded-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: url('../fonts/SF-Pro-Rounded-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: url('../fonts/SF-Pro-Rounded-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: url('../fonts/SF-Pro-Rounded-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

/* Circular Std (Body Text alternative or subtitles) */
@font-face {
  font-family: 'Circular Std';
  src: url('../fonts/CircularStd-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Circular Std';
  src: url('../fonts/CircularStd-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* Typ1451 (Special OU Accent Font if needed) */
@font-face {
  font-family: 'Typ1451';
  src: url('../fonts/Typ1451 Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* ---------- Color tokens ------------------------------------------------ */

:root {
  /* Brand Colors */
  --ou-red: #E2001A;
  --ou-black: #000000;
  --ou-darkgrey: #737373;
  --ou-lightgrey: #CDDECF;
  --ou-warmgrey: #F6F4F1;
  --ou-white: #FFFFFF;

  /* Reveal.js Overrides */
  --r-background-color: var(--ou-white);
  --r-main-color: var(--ou-black);
  --r-heading-color: var(--ou-red);
  --r-link-color: var(--ou-red);
  --r-link-color-hover: #B00014;

  /* Typography Variables - Compact for better fitting */
  --r-heading-font: 'SF Pro Rounded', 'SF Pro Display', system-ui, sans-serif;
  --r-main-font: 'Circular Std', 'SF Pro Rounded', system-ui, sans-serif;
  --r-code-font: 'JetBrains Mono', monospace;

  --r-block-margin: 15px;
  --r-heading-margin: 0 0 15px 0;
  --r-heading-line-height: 1.1;
  --r-main-line-height: 1.4;
}

/* ---------- Base Typography & Layout ------------------------------------ */

.reveal {
  font-family: var(--r-main-font);
  font-size: 24px;
  /* significantly reduced to ensure fit */
  font-weight: 400;
  color: var(--r-main-color);
}

/* 3. Content Slides */
.reveal .slides section {
  padding: 20px 40px;
  box-sizing: border-box;
  text-align: left;
  height: 100%;
  /* Ensure consistent height for centering */
  display: flex !important;
  flex-direction: column;
  justify-content: center;
}

/* Headings */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  color: var(--ou-red);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Reduced Heading Sizes */
.reveal h1 {
  font-size: 2.0em;
  margin-bottom: 0.5em;
  color: var(--ou-red);
}

.reveal h2 {
  font-size: 1.5em;
  margin-bottom: 0.4em;
  color: var(--ou-black);
}

.reveal h3 {
  font-size: 1.2em;
  margin-bottom: 0.3em;
  color: var(--ou-red);
}

/* Paragraphs & Lists */
.reveal p {
  margin-bottom: 0.6em;
  font-weight: 400;
  color: var(--ou-darkgrey);
}

.reveal ul,
.reveal ol {
  margin-left: 1em;
  margin-bottom: 0.8em;
  display: block;
}

.reveal li {
  margin-bottom: 0.3em;
  padding-left: 0.2em;
  color: var(--ou-black);
}

.reveal ul {
  list-style-type: none;
}

/* Clean Red Bullet */
.reveal ul li::before {
  content: "•";
  color: var(--ou-red);
  display: inline-block;
  width: 0.7em;
  margin-left: -0.7em;
  font-weight: bold;
}

/* ---------- Persistent Elements ----------------------------------------- */

/* Logo - Top Right */
/* IMPORTANT: Logo is now attached to the BODY (or .reveal wrapper) to be persistent */
/* We use a separate persistent overlay approach instead of .reveal::after */

/* 1. Hide the old .reveal::after if it conflicts or isn't showing */
.reveal::after {
  display: none;
}

/* 2. Create a new persistent logo element via .reveal-viewport::after */
/* .reveal-viewport is the parent container that doesn't scale with slides */
.reveal-viewport::after {
  content: "";
  position: absolute;
  top: 30px;
  right: 40px;
  width: 220px;
  height: 80px;
  background-image: url("../assets/ou-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right top;
  z-index: 99999;
  /* Absolute highest z-index */
  pointer-events: none;
}

/* 3. Invert Logo Color on Impact Slides */
/* When the current slide (.present) has class .ou-impact, invert the viewport logo */
/* This relies on Reveal.js adding classes to the slide */
.reveal:has(.slides section.ou-impact.present)+.reveal-viewport::after,
/* If viewport is sibling (rare) */
.reveal:has(.slides section.ou-impact.present).reveal-viewport::after,
/* If reveal IS the viewport */
.reveal-viewport:has(.slides section.ou-impact.present)::after {
  /* Standard Reveal 4/5 structure */
  filter: brightness(0) invert(1);
}

/* Progress bar */
.reveal .progress {
  color: var(--ou-red);
  height: 4px;
}

.reveal .progress span {
  background-color: var(--ou-red);
}

/* ---------- Slide Specific Layouts -------------------------------------- */

/* 1. Main Presentation Title Slide (First page) */
.reveal .slides section#title-slide {
  text-align: left;
  padding: 0;
  background-image: url("../assets/start.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100%;
  /* Standard full slide height */
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 60px;
}

.reveal .slides section#title-slide h1 {
  font-size: 3.2em;
  color: var(--ou-red);
  margin-bottom: 0.2em;
  max-width: 80%;
  text-shadow: none;
  line-height: 1;
}

.reveal .slides section#title-slide p.author {
  font-size: 1.1em;
  color: var(--ou-black);
  font-weight: 700;
  margin-top: 1em;
}

.reveal .slides section#title-slide p.date {
  font-size: 0.75em;
  color: var(--ou-darkgrey);
  margin-top: 0.5em;
  opacity: 0.8;
}

.reveal .slides section#title-slide p.subtitle {
  font-size: 0.9em;
  color: var(--ou-darkgrey);
  margin-top: 0.1em;
}

/* 2. Section Divider Slides (.title-slide) */
.reveal .slides section.title-slide {
  background-color: var(--ou-white);
  color: var(--ou-black);
  text-align: left;
  padding: 40px 60px;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  /* Vertically center content */
  height: 100%;
  /* Fill the slide area so border is full height */
  border-left: 12px solid var(--ou-red);
  /* Distinct red bar */
}

.reveal .slides section.title-slide h1 {
  color: var(--ou-red);
  font-size: 2.8em;
  line-height: 1.05;
  margin-bottom: 0.4em;
  border: none;
}

.reveal .slides section.title-slide h2 {
  font-size: 1.4em;
  color: var(--ou-black);
  font-weight: 400;
  margin-top: 0;
}

/* Fix content inside section title slides */
.reveal .slides section.title-slide ul li::before {
  color: var(--ou-red);
}

.reveal .slides section.title-slide li {
  color: var(--ou-black);
}

/* 3. Content Slides */
.reveal .slides section {
  padding: 20px 40px;
  box-sizing: border-box;
  text-align: left;
  height: 100%;
  /* Ensure consistent height for centering */
  display: flex !important;
  flex-direction: column;
  justify-content: center;
}

/* 4. Quote Slide */
.reveal .slides section.ou-quote blockquote {
  background: var(--ou-warmgrey);
  border-left: 4px solid var(--ou-red);
  box-shadow: none;
  font-size: 1.2em;
  /* Smaller quote text */
  font-style: italic;
  padding: 20px 30px;
  /* Compact padding */
  margin: 1em auto;
  width: 90%;
  color: var(--ou-black);
  border-radius: 0 8px 8px 0;
}

.reveal .slides section blockquote {
  /* General blockquote styling if not using specific class */
  background: var(--ou-warmgrey);
  border-left: 4px solid var(--ou-red);
  box-shadow: none;
  font-size: 0.8em;
  font-style: italic;
  padding: 15px 25px;
  margin: 1em 0;
  width: 95%;
  color: var(--ou-black);
}

/* 5. Impact Slide / Statement Slide */
/* Designed for slides with just a single H1 or a short statement */
.reveal .slides section.ou-impact {
  background-color: transparent;
  color: var(--ou-white);
  text-align: center;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: visible !important;
  z-index: 1;
  padding: 0 !important;
  border-left: none !important;
  /* Remove the vertical line from other styles */
  margin: 0 !important;
  /* Ensure no margins throw off centering */
}

/* Full Screen Red Background */
.reveal .slides section.ou-impact::before {
  content: "";
  position: absolute;
  top: -1000%;
  left: -1000%;
  width: 3000%;
  height: 3000%;
  background-color: var(--ou-red);
  z-index: -1;
}

/* Remove old filter rule since we handle it in the logo block now */
/* (Deleted old .reveal:has rule) */

.reveal .slides section.ou-impact h1 {
  color: var(--ou-white);
  font-size: 3.5em;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  border: none;
  text-shadow: none;
  position: relative;
}

/* Optional subtitle for impact slides */
.reveal .slides section.ou-impact h2,
.reveal .slides section.ou-impact p {
  color: var(--ou-white);
  opacity: 0.9;
  font-weight: 400;
  margin-top: 0.5em;
}

/* 5b. Comparison Slide (Custom Layout) */
.reveal .slides section#comparison-slide,
.reveal .slides section.comparison {
  border-left: none !important;
  padding: 0 20px !important;
  gap: 10px;
  height: 100%;
  overflow: visible !important;
  background: transparent !important;
  z-index: 10;
  align-items: start;

  display: flex !important;
  flex-direction: column !important;
}




.reveal .slides section#comparison-slide h1,
.reveal .slides section.comparison h1,
.reveal .slides section#comparison-slide h2,
.reveal .slides section.comparison h2 {
  font-size: 1.6em !important;
  /* Increased for readability */
  margin: 15px 0 !important;
  color: var(--ou-red);
  border: none !important;
  position: relative;
  z-index: 20;
  line-height: 1.2;
}

.reveal .slides section#comparison-slide .columns,
.reveal .slides section.comparison .columns {
  display: flex;
  gap: 30px;
  /* Increased gap */
  align-items: flex-start;
  margin-top: 0;
  width: 100%;
  position: relative;
  z-index: 20;
  /* border: 1px solid red; */
  /* Debugging: Uncomment if needed to see boundaries */
}

/* Hide any empty paragraphs that Pandoc might insert */
.reveal .slides section#comparison-slide p:empty,
.reveal .slides section.comparison p:empty {
  display: none;
}

/* Scoped column text size */
.reveal .slides section#comparison-slide .column,
.reveal .slides section.comparison .column {
  flex: 1 1 0;
  /* Force equal width */
  width: 50%;
}

.reveal .slides section#comparison-slide .column p,
.reveal .slides section.comparison .column p {
  font-size: 0.6em !important;
  /* Increased from 0.3em */
  line-height: 1.3;
  /* More readable line height */
  color: var(--ou-black);
  margin-bottom: 10px;
}

.reveal .slides section#comparison-slide .column h3,
.reveal .slides section.comparison .column h3 {
  font-size: 0.9em !important;
  /* Increased heading size */
  margin-bottom: 10px !important;
  padding-bottom: 5px !important;
}

/* Ensure headings in columns are compact */
.reveal .slides section.comparison .column h3 {
  font-size: 0.8em !important;
  margin-bottom: 10px !important;
  padding-bottom: 5px !important;
}

/* 6. Final Slide (Thanks) */
.reveal .slides section.final-slide {
  /* Background handled by viewport selector below for full width */
  background: none !important;
  height: 100%;
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* Apply background to viewport when final slide is present */
.reveal:has(.slides section.final-slide.present)::before,
.reveal-viewport:has(.slides section.final-slide.present)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../assets/final-slide-thanks.png");
  background-size: contain;
  background-position: bottom center;
  background-repeat: no-repeat;
  background-color: var(--ou-white);
  /* Ensure white background for any letterboxing */
  z-index: 1;
  /* Ensure it sits above the base background but below content if possible */
}

/* Hide logo on final slide */
.reveal:has(.slides section.final-slide.present)+.reveal-viewport::after,
.reveal:has(.slides section.final-slide.present).reveal-viewport::after,
.reveal-viewport:has(.slides section.final-slide.present)::after {
  display: none !important;
}

/* 6. Fragment Animations (Override Default to Fade Up) */
.reveal .slides .fragment {
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  transform: translate3d(0, 20px, 0);
  /* Start slightly lower */
}

.reveal .slides .fragment.visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  /* Move to original position */
}

/* Ensure standard fade-out still works if needed */
.reveal .slides .fragment.fade-out.visible {
  opacity: 0;
  visibility: hidden;
}

/* comparison slides: ensure the column wrapper spans full slide width */
.reveal .slides section.comparison .cols{
  width: 100%;
  flex: 1 1 auto;   /* if the slide is flex */
}

.reveal .slides section.comparison .cols .col{
  flex: 1 1 0;
  min-width: 0;
}

/* ===== Two columns + swapstack (drop-in) ===== */

/* two columns: make both columns same height */
.reveal .cols{
  display:flex;
  gap:1.5rem;
  align-items:stretch;          /* <-- key: equal-height columns */
}

/* each column is a flex column so its content can be top-aligned and stretch */
.reveal .cols .col{
  flex:1 1 0;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;   /* <-- key: content starts at top */
  font-size:0.72em;
  line-height:1.15;
  text-align:left;
}

.reveal .cols .col p {
  color: var(--ou-black);
}

/* right column: grey box fills full column height */
.reveal .cols .col-right{
  background:#f5f6f7;
  border-radius:6px;
  padding:1rem 1.2rem;
  flex:1 1 auto;                /* <-- fill available height */
}

/* remove default top/bottom margins that create “drops” */
.reveal .cols .col > :first-child{ margin-top:0; }
.reveal .cols .col > :last-child{ margin-bottom:0; }

/* headings in right column */
.reveal .cols .col-right h3{
  font-size:1.1em;
  margin:0 0 0.4em 0;
  color:var(--ou-red);
}

/* body text in right column should be black (but don't force headings) */
.reveal .cols .col-right p,
.reveal .cols .col-right li,
.reveal .cols .col-right span{
  color:var(--ou-black);
}

/* swapstack: appear then disappear (replacement fragments) */
.reveal .swapstack{ width:100%; }

.reveal .swapstack .fragment{
  opacity:0;
  transition:opacity 0.25s ease;
  transform:none;               /* avoid global fragment slide-up */
  visibility:visible;           /* avoid global hidden */
}

.reveal .swapstack .fragment.visible{ opacity:0; }
.reveal .swapstack .fragment.current-fragment{ opacity:1; }

/* --- swapstack: force top-left, no r-stack centering --- */
.reveal section.comparison .swapstack{
  display: block !important;
}

/* Hide all fragments by default (no stacking, no centering) */
.reveal section.comparison .swapstack > .fragment{
  display: none !important;

  /* neutralize reveal fragment animation + r-stack positioning */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  position: static !important;
  margin: 0 !important;
}

/* Show only the current fragment */
.reveal section.comparison .swapstack > .fragment.current-fragment{
  display: block !important;
}

/* Prevent heading/first element from creating a “top drop” */
.reveal section.comparison .swapstack > .fragment > :first-child{
  margin-top: 0 !important;
}



/* If a slide uses .cols, don't vertically center the whole slide */
.reveal .slides section:has(.cols){
  justify-content: flex-start !important;
}

/* --- force top-left alignment on comparison slides (no :has needed) --- */
.reveal .slides section.comparison{
  justify-content: flex-start !important; /* kills vertical centering */
  align-items: stretch !important;
}

/* keep the columns starting at the very top edge */
.reveal .slides section.comparison .cols{
  align-items: stretch;
}

/* make sure each column’s content starts at top */
.reveal .slides section.comparison .cols .col{
  justify-content: flex-start;
  align-items: stretch;
}

/* IMPORTANT: make the r-stack not vertically center its children */
.reveal .slides section.comparison .swapstack{
  display: block !important;    /* overrides r-stack's flex/centering */
}

.reveal .cols .col mark,
.reveal .cols .col strong,
.reveal .cols .col em,
.reveal .cols .col span {
  display: inline;
}


/* ---------- Components -------------------------------------------------- */

/* Links */
.reveal a {
  color: var(--ou-red);
  text-decoration: none;
  border-bottom: 1px solid rgba(226, 0, 26, 0.3);
  transition: border-color 0.2s;
}

.reveal a:hover {
  border-bottom-color: var(--ou-red);
}

/* Tables */
.reveal table {
  font-size: 0.8em;
  border-collapse: collapse;
  width: 100%;
}

.reveal table th {
  text-align: left;
  padding: 0.4em;
  border-bottom: 2px solid var(--ou-red);
  color: var(--ou-black);
}

.reveal table td {
  padding: 0.4em;
  border-bottom: 1px solid var(--ou-lightgrey);
}

/* Code Blocks */
.reveal pre code {
  background: var(--ou-warmgrey);
  color: var(--ou-black);
  font-family: var(--r-code-font);
  padding: 15px;
  border-radius: 4px;
  font-size: 0.8em;
  line-height: 1.3;
}

/* Labels */
.ou-label {
  background: var(--ou-warmgrey);
  color: var(--ou-black);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.6em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border: 1px solid var(--ou-lightgrey);
}

/* Diff Styling */
.diff-added {
  color: var(--ou-red);
  font-weight: bold;
  background-color: rgba(226, 0, 26, 0.1);
}

.diff-removed {
  color: var(--ou-red);
  text-decoration: line-through;
  opacity: 0.7;
}

/* Column Layout Utilities */
.columns {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.column {
  flex: 1;
}

.column h3 {
  font-size: 0.9em;
  color: var(--ou-darkgrey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--ou-red);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.column p {
  font-size: 0.65em;
  /* Smaller text for dense legal comparison */
  line-height: 1.5;
}
/* Custom highlight color */
.reveal mark {
  background-color: #EBCB8B;
  color: #2E3440;        /* optional: darker text for contrast */
  padding: 0.1em 0.25em; /* optional: nicer spacing */
  border-radius: 0.2em;  /* optional: softer look */
  display: inline;
  white-space: normal;
}

blockquote {
  font-size: 0.8em;
}