/* Ivey Minimal Theme + Top-Right Logo + Bottom-Right Controls + Minute Clock
   File: ivey-theme.css
*/

/* ===== Brand & System Tokens ===== */
:root{
  /* Brand palette
     Headings/links: Pantone 3308  → #034638
     Bullets/markers: Pantone 268  → #582C83
     Secondary text: Cool Grey 7   → #97999B
  */
  --brand-primary: #034638;  /* headings & links */
  --brand-accent:  #582C83;  /* bullets/markers */
  --muted:         #97999B;  /* secondary text */

  /* Text & surfaces */
  --bg:#ffffff;            /* background */
  --fg:#000000;            /* main text */
  --code-bg:#f6f8fa;       /* code surface */

  /* Fonts */
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Logo (top-right) */
  --logo-top: 12px;
  --logo-right: 18px;
  --logo-width: 120px;
  --logo-height: 32px;
  --logo-url: url("../images/logo.png"); /* shared logo */

  /* Clock (top-left) — seconds suppressed in JS */
  --clock-top: 12px;
  --clock-left: 22px;
  --clock-bg: rgba(255,255,255,.85);
  --clock-fg: #111315;
  --clock-radius: 10px;
  --clock-padding: 6px 10px;
  --clock-shadow: 0 2px 10px rgba(0,0,0,.05);
  --clock-font: 14px/1 var(--font-sans);

  /* Footer text */
  --footer-text: "Ivey Business School • A. Riofrío-Lara";
}

/* Optional back-compat with older token names */
:root{
  --utpl-blue:   var(--brand-primary);
  --utpl-yellow: var(--brand-accent);
}

/* ===== Typography ===== */
.reveal,
.reveal p,
.reveal li,
.reveal h1, .reveal h2, .reveal h3,
.reveal h4, .reveal h5, .reveal h6,
.reveal blockquote,
.reveal table, .reveal th, .reveal td,
.reveal small, .reveal figcaption {
  font-family: var(--font-sans) !important;
  color: var(--fg);
}

/* Body text justification (keep code/math left-aligned) */
.reveal p,
.reveal li,
.reveal blockquote,
.reveal table td,
.reveal figcaption,
.reveal small {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.reveal pre,
.reveal code,
.reveal kbd,
.reveal samp,
.reveal .katex,
.reveal .MathJax,
.reveal .math {
  text-align: left;
  hyphens: none;
}

.reveal code, .reveal pre, .reveal kbd, .reveal samp {
  font-family: var(--font-mono) !important;
}

/* ===== Base ===== */
.reveal .slides{ background:var(--bg); }
.reveal h1{ font-weight:800; letter-spacing:.01em; }
.reveal h2{ font-weight:700; }
.reveal h3{ font-weight:600; }

/* Headings in brand primary */
.reveal h1, .reveal h2, .reveal h3 { color: var(--brand-primary); }

/* Links use brand primary */
.reveal a{
  color: var(--brand-primary);
  text-decoration:none;
  border-bottom:2px solid color-mix(in srgb, var(--brand-primary) 45%, transparent);
}
.reveal a:hover{ border-bottom-color: var(--brand-primary); }

/* Lists & spacing */
.reveal ul, .reveal ol{ margin-block:.6em .2em; }
.reveal li{ margin:.18em 0; }

/* Bullet/number markers in brand accent; text remains main color */
.reveal ul li::marker,
.reveal ol li::marker { color: var(--brand-accent); }

/* Code blocks */
.reveal pre code{
  background:var(--code-bg);
  display:block;
  padding:.8em 1em;
  border-radius:8px;
  line-height:1.35;
  color:#1a1a1a; /* subtle contrast vs. body text */
}

/* ===== Helpers ===== */

/* Title slide */
.reveal .title-slide{
  display: grid;
  place-content: center;
  min-height: 100%;
  text-align: center;
}

/* Big, readable main title (moderate scale + width cap) */
.reveal .title-slide h1{
  color: #111827 !important;                /* near-black for the hero title */
  font-weight: 150;
  font-size: clamp(48px, 6.5vw, 96px);      /* tuned from earlier oversized value */
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: .1em auto .35em;
  max-width: 20ch;                          /* prevent ultra-wide lines */
  text-align: center;
}

/* Subtitle under the big title */
.reveal .title-slide .subtitle{
  display: block;
  font-size: clamp(14px, 1.4vw, 20px);
  color: var(--muted);
  font-weight: 400;
  margin: 0 0 1.8rem;
}

/* Optional midtitle helper (unused by default) */
.reveal .title-slide .midtitle {
  font-size: 2.4em;
  font-weight: 800;
  letter-spacing: .01em;
  margin: 0 0 .25em 0;
  color: var(--brand-primary);
}

/* Secondary/muted text (captions, notes, etc.) */
.reveal .slides .muted,
.reveal figcaption,
.reveal small,
.reveal .notes,
.reveal .footer,
.reveal .byline {
  color: var(--muted) !important;
}

/* Two-column layout */
.reveal .cols{ display:grid; grid-template-columns:1fr 1fr; gap:28px; align-items:start; }
@media (max-width:1080px){ .reveal .cols{ grid-template-columns:1fr; } }

/* Footer text (bottom-left) */
.reveal .slides::after{
  content: var(--footer-text);
  position:fixed;
  left:24px;
  bottom:24px; /* controls are bottom-right */
  font-size:14px;
  color:var(--muted);
  z-index: 9997;
  right:96px;  /* avoid overlap with controls on small screens */
}

/* ===== Logo (top-right on every slide) ===== */
.reveal .slides::before{
  content:"";
  position: fixed;
  top: var(--logo-top);
  right: var(--logo-right);
  width: var(--logo-width);
  height: var(--logo-height);
  background: var(--logo-url) right/contain no-repeat;
  opacity: .95;
  z-index: 9998;
  pointer-events: none;
}

/* ===== On-slide Clock (requires shared/js/clock.js; minutes only now) ===== */
.utpl-clock{
  position: fixed;
  top: var(--clock-top);
  left: var(--clock-left);
  right: auto;
  z-index: 9999;
  background: var(--clock-bg);
  color: var(--clock-fg);
  border-radius: var(--clock-radius);
  padding: var(--clock-padding);
  box-shadow: var(--clock-shadow);
  font: var(--clock-font);
  letter-spacing: .02em;
  user-select: none;
}
.utpl-clock.hidden{ display:none; }

/* ===== Controls bottom-right (visible) ===== */
.reveal .controls{
  position: fixed;
  right: 16px;
  left: auto !important;
  bottom: 16px;
  top: auto !important;
  transform: none !important;
  z-index: 10000; /* above logo/footer */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== Print adjustments ===== */
@media print{
  .reveal .slides::after{ opacity:.6; }
  .utpl-clock{ display:none !important; }
}

/* ===== Optional Dark-Mode Surfaces (keeps brand colors) ===== */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0d10;
    --fg:#e8eaed;
    --muted:#b7bcc1; /* slightly brighter for contrast on dark */
    --code-bg:#1a1f24;
    --clock-bg: rgba(20,22,26,.6);
    --clock-fg:#e8eaed;
  }
  .reveal .slides{ background:var(--bg); }
}

/* === Force light mode regardless of OS setting === */
html { color-scheme: light; }

@media (prefers-color-scheme: dark){
  :root{
    --bg:#ffffff; --fg:#000000; --muted:#97999B; --code-bg:#f6f8fa;
    --clock-bg: rgba(255,255,255,.85); --clock-fg:#111315;
  }
  .reveal .slides{ background: var(--bg); }
}

/* Only the title slide */
.reveal .title-slide h1{
  font-size: 3.2em;   /* tweak size */
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: .01em;
  margin: 0 0 .2em 0;
}
/* optional: slightly smaller subtitle */
.reveal .title-slide .subtitle{ font-size: 1.15em; }

/* Only affect slides tagged with class="slide-heading" */
.reveal section.slide-heading h1{
  font-size: calc(var(--r-heading1-size, 2.5em) * 2);
  line-height: 1.05;
}
.reveal section.slide-heading h2{
  font-size: calc(var(--r-heading2-size, 1.9em) * 2);
  line-height: 1.05;
}
.reveal section.slide-heading h3{
  font-size: calc(var(--r-heading3-size, 1.5em) * 2);
  line-height: 1.1;
}


/* === Slide-heading image layout fixes === */
.reveal section.slide-heading h2{
  margin: 0 0 .35em 0;            /* tighter gap under the title */
}

.reveal section.slide-heading .cols{
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-items: center;
  align-items: center;             /* center items on Y */
  place-content: center;           /* center the grid block in the slide */
  gap: 2rem;
  height: 60vh;                    /* leave room for title/footer; prevents overflow */
  padding-bottom: 1rem;            /* guard against footer overlap */
}

.reveal section.slide-heading .cols img{
  max-height: 36vh;                /* guaranteed to fit in 60vh area */
  max-width: 40vw;                 /* prevents extra-wide scaling */
  width: auto;
  object-fit: contain;
}

/* Stack on narrow screens */
@media (max-width: 900px){
  .reveal section.slide-heading .cols{
    grid-template-columns: 1fr;
    height: auto;
    min-height: 40vh;
  }
  .reveal section.slide-heading .cols img{
    max-height: 28vh;
    max-width: 70vw;
  }
}

/* Panels layout */
.reveal .panels{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:16px;
  align-items:start;
  max-width:1100px;
  margin:0 auto;
}
.reveal .panel{
  border:1px solid #c9ced6;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 2px 12px rgba(0,0,0,.05);
  background:#fff;
}
.reveal .panel .panel-hd{
  background:#0b3d5c; color:#fff; padding:10px 14px; font-weight:700;
}
.reveal .panel .panel-bd{ padding:14px; }
.reveal .panel table{
  width:100%; border-collapse:separate; border-spacing:0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.reveal .panel th{ text-align:left; color:#5b6573; font-weight:600; }
.reveal .panel td{ color:#111; }
.reveal .panel td:last-child{ text-align:right; }


:root{
  --ivey:#034638; --utpl:#582C83; --muted:#97999B;
  --ok1:#E6F2EF; --ok2:#BFE0D8; --ok3:#8FC6BC;
  --risk1:#FFF3CD; --risk2:#FFD3B6; --risk3:#F8B4B4;
  --danger:#C53030; --ink:#111827; --line:#E5E7EB;
}
.smart-funnel{max-width:1100px;margin:0 auto;display:grid;gap:1.25rem;font-size:.95em;color:var(--ink)}
.funnel{display:grid;gap:.5rem;position:relative;padding-bottom:.75rem}
.band{border:1px solid var(--line);border-radius:16px;padding:.9rem 1.1rem;font-weight:500;box-shadow:0 6px 18px rgba(0,0,0,.06)}
.band-1{background:var(--ok1);border-color:#D5EAE4}
.band-2{background:var(--ok2);border-color:#C6E1DB}
.band-3{background:var(--ok3);border-color:#A7D0C7}
.band em{color:var(--utpl);font-style:normal;font-weight:700}
.neck{width:30%;height:14px;margin:.1rem auto 0;background:linear-gradient(90deg,var(--ok3),var(--ok2));clip-path:polygon(20% 0%,80% 0%,100% 100%,0% 100%);filter:drop-shadow(0 4px 8px rgba(0,0,0,.08))}
.fork{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;align-items:start}
.lane .lane-track{position:relative;border:1px dashed var(--line);border-radius:14px;padding:1rem 1rem 2.75rem;min-height:120px;background:#fff}
.lane-good .lane-track{background:linear-gradient(0deg,#fff 0%,#F5FBF9 100%);border-color:#DCEDEA}
.lane-good .pill{background:#fff;border-left:6px solid var(--ivey);box-shadow:0 4px 14px rgba(3,70,56,.12)}
.end-good{width:46px;height:46px;border-radius:9999px;background:var(--ivey);position:absolute;bottom:10px;right:14px;box-shadow:0 6px 16px rgba(3,70,56,.25)}
.lane-bad .lane-track{background:linear-gradient(0deg,#fff 0%,#FFF7EB 100%);border-color:#F6E3C2}
.lane-bad .pill{background:#fff;border-left:6px solid #E4871B;box-shadow:0 4px 14px rgba(228,135,27,.14)}
.end-bad{width:46px;height:46px;border-radius:8px;background:linear-gradient(180deg,#F56565,#C53030);position:absolute;bottom:10px;right:14px;box-shadow:0 6px 16px rgba(197,48,48,.28)}
.pill{border:1px solid var(--line);border-radius:12px;padding:.7rem .9rem;margin-bottom:.65rem;font-weight:500}
.badge-loss{position:absolute;right:72px;bottom:8px;display:grid;grid-template-columns:auto 1fr;gap:.45rem;align-items:center;background:var(--risk3);border:1px solid #ECA5A5;border-radius:12px;padding:.5rem .7rem;box-shadow:0 6px 18px rgba(197,48,48,.20);line-height:1.1}
.badge-loss strong{color:var(--danger);font-size:1.1em}
.badge-loss span{font-size:.85em;color:#6B7280;letter-spacing:.1px}
@media (max-width:900px){.fork{grid-template-columns:1fr}.badge-loss{right:14px}}


/* ===== Brand tokens (tweak if you already define these) ===== */
:root{
  --ivey:  #034638;   /* trust/soundness */
  --utpl:  #582C83;   /* brand accent */
  --ink:   #111827;   /* body text */
  --muted: #6B7280;   /* secondary text */
  --line:  #E5E7EB;   /* borders */
  --bg:    #ffffff;

  /* Flow colors */
  --loans-fill:  #BFE0D8;  /* soft green tint */
  --loans-edge:  #7FBCAF;
  --other-fill:  #E8D7F3;  /* soft purple tint */
  --other-edge:  #BBA2D6;
}

/* ===== Layout ===== */
.mini-sankey{
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 1rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.95em;
}

.sankey-col{
  display: grid;
  gap: 0.8rem;
}
.sankey-col.left{ align-content: start; }
.sankey-col.right{ align-content: start; }

/* Nodes / tiles */
.node{
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.node .label{ font-weight: 700; letter-spacing: .2px; }
.node-dest{ display: grid; gap: .25rem; }
.node-dest .pct{ font-weight: 800; color: var(--utpl); }

.node-source .label{ color: var(--ivey); }

.tile{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #ffffff, #F8FAFC);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.kpi{ font-size: 1.6em; font-weight: 800; line-height: 1; }
.sub{ font-size: .9em; color: var(--muted); margin-top: .25rem; }
.src, .right-src{ font-size: .8em; color: var(--muted); margin-top: .35rem; }

/* Diagram area */
.sankey-diagram{
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .3rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}

.ribbon{
  stroke: rgba(0,0,0,0);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.06));
}
.ribbon.loans{ fill: var(--loans-fill); }
.ribbon.other{ fill: var(--other-fill); }

/* Subtle inner edges for depth */
.ribbon.loans{ stroke: var(--loans-edge); stroke-width: 0.5; }
.ribbon.other{ stroke: var(--other-edge); stroke-width: 0.5; }

/* Stubs & docks */
.stub{ fill: #E5F2EF; }
.dock.loans{ fill: #A9D4CB; }
.dock.other{ fill: #D9C9EA; }

/* Bottom sources line */
.sources{
  grid-column: 1 / -1;
  text-align: center;
  font-size: .85em;
  color: var(--muted);
  margin-top: .2rem;
}

/* Responsive */
@media (max-width: 980px){
  .mini-sankey{
    grid-template-columns: 1fr;
  }
  .sankey-diagram{ order: 2; }
  .sankey-col.right{ order: 3; }
  .sources{ order: 4; }
}


/* === Image fit & center defaults (non slide-heading slides) === */
.reveal section:not(.slide-heading) img{
  display:block;
  margin:0 auto;                 /* center X */
  max-width:90vw;                /* keep inside viewport width */
  max-height:72vh;               /* leave room for footer/logo */
  width:auto; height:auto;
  object-fit:contain;
}

/* === XY center wrapper for any media === */
.reveal .media-xy{
  display:grid;
  place-items:center;            /* center X & Y */
  min-height:70vh;               /* vertical centering space */
  padding:0.25rem 0;             /* tiny breathing space */
}

/* === Convenient size presets === */
.reveal img.img-lg{  max-width:85vw; max-height:75vh; }
.reveal img.img-md{  max-width:70vw; max-height:60vh; }
.reveal img.img-sm{  max-width:60vw; max-height:48vh; }

/* === Mental-map specific (smaller, consistent) === */
.reveal img.mindmap{ max-width:60vw; max-height:52vh; }
.reveal .mindmap-slide .media-xy{ min-height:68vh; } /* a tad tighter */

/* === Two-up with a heading (reuse your .slide-heading) ===
   Usage:
   <section class="slide-heading">
     <h1>Title...</h1>
     <div class="cols">
       <img src="..." class="img-md">
       <img src="..." class="img-md">
     </div>
   </section>
*/
.reveal section.slide-heading .cols{
  display:grid;
  grid-template-columns:1fr 1fr;
  justify-items:center;
  align-items:center;
  place-content:center;
  gap:2rem;
  height:60vh;
  padding-bottom:1rem;
}
.reveal section.slide-heading .cols img{
  max-height:36vh;
  max-width:40vw;
  width:auto;
  object-fit:contain;
}
@media (max-width:900px){
  .reveal section.slide-heading .cols{ grid-template-columns:1fr; height:auto; min-height:40vh; }
  .reveal section.slide-heading .cols img{ max-height:28vh; max-width:70vw; }
}


/* Tighter image caps, globally (non slide-heading) */
.reveal section:not(.slide-heading) img{
  max-width: 85vw;
  max-height: 60vh;      /* was 72vh */
}

/* Slide-heading grid: make the image band shorter to stay inside margins */
.reveal section.slide-heading .cols{ height: 50vh; } /* was 60vh */
.reveal section.slide-heading .cols img{
  max-height: 30vh;      /* was 36vh */
  max-width: 38vw;       /* slightly narrower */
}

/* Compact variant: bring content closer to the title */
.reveal section.slide-heading.tight h1{ margin-bottom: .25em; }
.reveal section.slide-heading.tight .cols{
  height: 42vh;          /* images sit closer to the title */
  gap: 1.25rem;
}
.reveal section.slide-heading.tight .cols img{
  max-height: 26vh;
  max-width: 34vw;
}

/* Single-image “diagram/mindmap” slides — smaller & centered */
.reveal .media-xy{ min-height: 62vh; }      /* was 70vh */
.reveal img.img-md{ max-height: 50vh; }     /* was 60vh */
.reveal img.img-sm,
.reveal img.mindmap{ max-height: 42vh; max-width: 60vw; }


/* === 1) "Closer to title" variant for two-up hero images === */
.reveal section.slide-heading.closer h1{ margin-bottom:.15em; }
.reveal section.slide-heading.closer .cols{
  height:32vh;         /* was 42vh */
  gap:1rem;
}
.reveal section.slide-heading.closer .cols img{
  max-height:22vh;     /* was 26vh */
  max-width:32vw;      /* a touch narrower */
}

/* === 2) Stricter clamp for big diagrams (heuristics) === */
.reveal section.slide-heading.diagram .media-xy{ min-height:56vh; }  /* less vertical push */
.reveal section.slide-heading.diagram img{
  max-height:40vh;     /* hard cap to avoid footer/logo */
  max-width:70vw;
}

/* Heuristics: closer to the title (combine with .diagram) */
.reveal section.slide-heading.diagram.closer h1{ margin-bottom:.15em; }
.reveal section.slide-heading.diagram.closer .media-xy{ min-height:48vh; }  /* pull content up */
.reveal section.slide-heading.diagram.closer img{
  max-height:38vh;     /* keep safely inside margins */
  max-width:68vw;
}

/* two-line grid for step cards */
.g62-wrap{max-width:1200px;margin:10px auto 0;padding:4px 0;}
.g62{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(12px,2.2vw,22px);align-items:stretch}
.g62-card{position:relative;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:rgba(255,255,255,.66);
  box-shadow:0 1px 6px rgba(0,0,0,.06);padding:clamp(12px,1.8vw,16px) clamp(12px,2vw,18px);
  font-size:clamp(18px,2.1vw,26px);line-height:1.25;min-height:90px}
.g62-num{position:absolute;left:clamp(10px,1.4vw,14px);top:clamp(10px,1.2vw,12px);width:34px;height:34px;border-radius:50%;
  display:grid;place-items:center;font-weight:800;background:var(--ivey-green,#0d5e3a);color:#fff;box-shadow:0 2px 10px rgba(13,94,58,.25)}
@media (max-width:900px){.g62{grid-template-columns:1fr}}

/* Vertical step list with boxed items and arrows */
.vsteps-wrap{max-width:900px;margin:14px auto 0}
.vsteps{list-style:none;margin:0;padding:0}
.vsteps li{
  position:relative;
  margin:14px 0;
  padding:14px 16px 14px 64px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  background:rgba(255,255,255,.66);
  box-shadow:0 1px 6px rgba(0,0,0,.06);
  font-size:clamp(18px,2.0vw,26px);
  line-height:1.28;
}
.vsteps .num{
  position:absolute; left:16px; top:50%; transform:translateY(-50%);
  width:36px; height:36px; border-radius:50%;
  display:grid; place-items:center; font-weight:800;
  background:var(--ivey-green,#0d5e3a); color:#fff;
  box-shadow:0 2px 10px rgba(13,94,58,.25);
}
/* connector line + arrow between items */
.vsteps li:not(:last-child)::after{
  content:""; position:absolute; left:34px; bottom:-24px; width:2px; height:22px;
  background:linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.1));
}
.vsteps li:not(:last-child)::before{
  content:""; position:absolute; left:29px; bottom:-28px;
  border-left:6px solid transparent; border-right:6px solid transparent; border-top:8px solid rgba(0,0,0,.25);
}
/* responsive */
@media (max-width:700px){
  .vsteps li{padding-left:58px}
  .vsteps .num{left:12px;width:32px;height:32px}
  .vsteps li:not(:last-child)::after{left:30px}
  .vsteps li:not(:last-child)::before{left:25px}
}

