@import url("https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap");

/* --------------------------------------------------------------------------
   DGIN 5401 — common visual language
   -------------------------------------------------------------------------- */
:root {
  --mermaid-font-family: "Indie Flower", "Comic Sans MS", cursive;
  --dgin-ink: #172033;
  --dgin-muted: #52606d;
  --dgin-panel: rgba(255, 255, 255, 0.97);
  --dgin-blue: #246bce;
  --dgin-teal: #128c7e;
  --dgin-green: #2a8f58;
  --dgin-purple: #6d4aff;
  --dgin-red: #c73b3b;
  --dgin-gold: #f6c500;
  --dgin-orange: #c15f16;
  --dgin-code-bg: #f3f4f6;
  --dgin-border: #d6dde5;
  --dgin-shadow: 0 0.55rem 1.35rem rgba(15, 23, 42, 0.10);
  --dgin-shadow-small: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.08);
}

.reveal {
  color: var(--dgin-ink);
  background-color: #f9fafb;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.reveal .slides {
  padding: 0 !important;
}

/* Leaf slides sit on a white card. Section dividers opt out with .no-card. */
.reveal .slides section:not(:has(section)):not(.no-card)::before {
  content: "";
  position: absolute;
  inset: -2% -2% -10% -2%;
  border-radius: 18px;
  background: var(--dgin-panel);
  box-shadow: var(--dgin-shadow);
  z-index: -1;
}

.reveal .slides section {
  line-height: 1.18;
  box-sizing: border-box;
}

.reveal strong { color: #0f172a; }
.reveal em { color: #334155; }
.reveal .slides section > h3:first-child { margin-bottom: 0.43em; }

ol,
ul {
  padding-left: 1.25em;
  margin-left: 0;
}

/* --------------------------------------------------------------------------
   Type and layout utilities retained from the instructor's normal theme
   -------------------------------------------------------------------------- */
.smaller { font-size: 0.90em; overflow-wrap: break-word; }
.small   { font-size: 0.72em; overflow-wrap: break-word; }
.smallest{ font-size: 0.60em; overflow-wrap: break-word; }
.tiny    { font-size: 0.44em; overflow-wrap: break-word; }
.indented { margin-left: 1em; }
.centering { text-align: center; }

.reveal .small p,
.reveal .smaller p,
.reveal .smallest p {
  margin-top: 0.32em;
  margin-bottom: 0.32em;
}

.reveal .columns {
  gap: 0.9em;
  align-items: flex-start;
}

.reveal .columns .column > :first-child { margin-top: 0; }
.reveal .columns .column > :last-child  { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Scrollable slides and regions
   -------------------------------------------------------------------------- */
/* Quarto's native .scrollable and the instructor's .sscrollable alias. */
.reveal .slides section.scrollable,
.reveal .slides section.sscrollable {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding-right: 0.45em;
  padding-bottom: 1.1em;
  -webkit-overflow-scrolling: touch;
}

/* Scroll only a region inside a fixed slide. */
.reveal .slides section .sscrollable {
  max-height: min(68vh, 650px);
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding-right: 0.45em;
  padding-bottom: 0.75em;
  -webkit-overflow-scrolling: touch;
}

.reveal .slides section.scrollable,
.reveal .slides section.sscrollable,
.reveal .slides section .sscrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.62) rgba(226, 232, 240, 0.65);
}

.reveal .slides section.scrollable::-webkit-scrollbar,
.reveal .slides section.sscrollable::-webkit-scrollbar,
.reveal .slides section .sscrollable::-webkit-scrollbar { width: 0.42em; }

.reveal .slides section.scrollable::-webkit-scrollbar-track,
.reveal .slides section.sscrollable::-webkit-scrollbar-track,
.reveal .slides section .sscrollable::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.65);
  border-radius: 999px;
}

.reveal .slides section.scrollable::-webkit-scrollbar-thumb,
.reveal .slides section.sscrollable::-webkit-scrollbar-thumb,
.reveal .slides section .sscrollable::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.62);
  border-radius: 999px;
}

/* Mermaid diagrams alone may overflow visibly. */
.reveal .slides section.mermaid-slide { overflow: visible !important; }
.reveal .mermaid { max-width: 100%; }
.reveal .mermaid svg {
  max-width: 100%;
  width: auto;
  height: auto;
  overflow: visible !important;
}
.reveal .mermaid svg foreignObject { overflow: visible !important; }

/* --------------------------------------------------------------------------
   Images, tables, code, citations
   -------------------------------------------------------------------------- */
.shadow-img {
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.28);
  border-radius: 4px;
}

.reveal img,
.reveal svg {
  max-width: 100%;
  height: auto;
}

.reveal .cell-output-display img,
.reveal .cell-output-display svg {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.reveal table {
  font-size: 0.78em;
  border-collapse: collapse;
  margin: 0.45em auto;
}

.reveal table th,
.reveal table td {
  padding: 0.28em 0.48em;
  border-bottom: 1px solid rgba(100, 116, 139, 0.24);
  vertical-align: top;
}

.reveal table th {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.13);
  font-weight: 800;
}

.reveal code {
  padding: 0.05em 0.22em;
  border-radius: 0.28em;
  background: var(--dgin-code-bg);
  color: #7c2d12;
  border: 1px solid rgba(209, 213, 219, 0.7);
}

.reveal pre code {
  display: block;
  max-height: 440px;
  padding: 0.78em;
  overflow: auto;
  line-height: 1.2;
  border-radius: 12px;
  color: inherit;
  background: #f8fafc;
  border: 1px solid var(--dgin-border);
}

.reveal .cell-output pre code,
.reveal .cell-output-display pre code { background: #ffffff; }

.reveal .footnotes {
  position: absolute;
  bottom: 0;
  font-size: 0.76em;
  opacity: 0.82;
}

.source-note {
  font-size: 0.54em;
  color: var(--dgin-muted);
  margin-top: 0.55em;
}

/* --------------------------------------------------------------------------
   Existing dialogue and quotation components
   -------------------------------------------------------------------------- */
.callout-assistant,
.callout-user {
  border-left: 4px solid #999;
  padding: 0.8em 0.95em;
  margin: 0.75em 0;
  border-radius: 6px;
  background: #fdfdfd;
}
.callout-assistant .callout-content,
.callout-user .callout-content { text-align: justify; }
.callout-assistant {
  border-left-color: #007bff;
  background: #e9f1ff;
  text-align: left;
  max-width: 72%;
  margin-right: auto;
}
.callout-user {
  border-left-color: #e83e8c;
  background: #fff0f5;
  text-align: right;
  max-width: 72%;
  margin-left: auto;
}

.quote-box {
  border-left: 4px solid #555;
  background: #f9f9f9;
  padding: 0.85em 1em;
  margin: 0.8em 0;
  font-style: italic;
}
.quote-source {
  font-style: normal;
  font-weight: bold;
  text-align: right;
  margin-top: 0.4em;
  color: #6b7280;
}

/* --------------------------------------------------------------------------
   Course-specific components: crisp, neutral, and reusable
   -------------------------------------------------------------------------- */
.white-title,
.white-title h1,
.white-title h2,
.white-title h3,
.white-title p,
.white-title .author,
.white-title .date,
.white-title .quarto-title-author-name {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}
.reveal .slides section.white-title::before { display: none !important; }

.participation-slide {
  background-color: #1a1a2e !important;
  color: #f8f8ff !important;
}
.participation-slide h1,
.participation-slide h2,
.participation-slide h3,
.participation-slide p { color: #f8f8ff !important; }

.course-grid,
.thread-grid,
.actor-grid,
.repair-grid,
.privacy-grid {
  display: grid;
  gap: 0.7em;
}
.course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.thread-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.repair-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.privacy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.course-card,
.thread-card,
.actor-card,
.repair-card,
.provisional-card,
.evidence-card {
  border: 1px solid var(--dgin-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--dgin-shadow-small);
  padding: 0.68em 0.78em;
}
.course-card h4,
.thread-card h4,
.actor-card h4,
.repair-card h4,
.provisional-card h4,
.evidence-card h4 { margin: 0 0 0.25em 0; }

.course-card { border-top: 0.34em solid var(--dgin-blue); }
.course-card:nth-child(2) { border-top-color: var(--dgin-teal); }
.course-card:nth-child(3) { border-top-color: var(--dgin-purple); }
.course-card:nth-child(4) { border-top-color: var(--dgin-green); }

.thread-card { border-left: 0.45em solid var(--dgin-red); }
.thread-target { border-left-color: var(--dgin-red) !important; }
.thread-benchmark { border-left-color: var(--dgin-blue) !important; }
.thread-metric { border-left-color: var(--dgin-orange) !important; }
.thread-lifecycle { border-left-color: var(--dgin-purple) !important; }

.thread-badge {
  display: inline-block;
  margin: 0 0 0.35em 0;
  padding: 0.14em 0.52em;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: #ffffff;
  color: var(--dgin-red);
  font-size: 0.62em;
  font-weight: 850;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.thread-badge.benchmark { color: var(--dgin-blue); }
.thread-badge.metric { color: var(--dgin-orange); }
.thread-badge.lifecycle { color: var(--dgin-purple); }

.provisional-card {
  border: 2px dashed var(--dgin-purple);
  background: linear-gradient(180deg, #ffffff 0%, #f6f2ff 100%);
}

.exercise-box,
.debrief-box,
.recall-box,
.dossier-box {
  border-radius: 15px;
  padding: 0.75em 0.9em;
  margin: 0.65em 0;
  box-shadow: var(--dgin-shadow-small);
}
.exercise-box {
  border: 2px solid var(--dgin-blue);
  border-left: 0.55em solid var(--dgin-blue);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.debrief-box {
  border: 2px solid var(--dgin-green);
  border-left: 0.55em solid var(--dgin-green);
  background: linear-gradient(180deg, #ffffff 0%, #effbf4 100%);
}
.recall-box {
  border: 2px solid var(--dgin-gold);
  border-left: 0.55em solid #ba9400;
  background: linear-gradient(180deg, #ffffff 0%, #fffbea 100%);
}
.dossier-box {
  border: 2px solid var(--dgin-purple);
  border-left: 0.55em solid var(--dgin-purple);
  background: linear-gradient(180deg, #ffffff 0%, #f6f2ff 100%);
}

.exercise-box::before,
.debrief-box::before,
.recall-box::before,
.dossier-box::before {
  display: block;
  margin-bottom: 0.2em;
  font-size: 0.68em;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.exercise-box::before { content: "Work the problem"; color: var(--dgin-blue); }
.debrief-box::before { content: "Defensible synthesis"; color: var(--dgin-green); }
.recall-box::before { content: "Retrieve before reviewing"; color: #8a6c00; }
.dossier-box::before { content: "Add to the AIRO dossier"; color: var(--dgin-purple); }

.evidence-card { border-top: 0.32em solid var(--dgin-green); }
.repair-card { border-top: 0.32em solid var(--dgin-orange); }
.actor-card { border-top: 0.32em solid var(--dgin-teal); }

.metric-number {
  font-size: 1.55em;
  line-height: 1;
  font-weight: 900;
  color: var(--dgin-blue);
}

.arrow-chain {
  display: flex;
  gap: 0.35em;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.7em 0;
}
.arrow-chain > span {
  border: 1px solid var(--dgin-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.42em 0.62em;
  box-shadow: var(--dgin-shadow-small);
}
.arrow-chain > b { color: var(--dgin-muted); }

.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #666;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 0.4em 0.6em;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 0.8em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 100;
}
.tooltip:hover::after { opacity: 1; }

@media (max-width: 1000px) {
  .course-grid,
  .repair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actor-grid,
  .privacy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .course-card,
  .thread-card,
  .actor-card,
  .repair-card,
  .provisional-card,
  .evidence-card,
  .exercise-box,
  .debrief-box,
  .recall-box,
  .dossier-box,
  .callout-warning,
  .callout-important,
  .callout-note,
  .callout-tip { box-shadow: none !important; }
}


/* Final accessibility and evidence-navigation refinements. */
.thread-badge.target { color: var(--dgin-red); }

.reveal .slides section.scrollable:focus,
.reveal .slides section.sscrollable:focus,
.reveal .slides section .sscrollable:focus {
  outline: 3px solid rgba(36, 107, 206, 0.45);
  outline-offset: 0.15em;
}

.reveal a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.reveal .fragment.visible {
  transition: opacity 180ms ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .reveal .fragment.visible,
  .reveal .slides section,
  .shadow-img {
    transition: none !important;
  }
}
