
/* ========================================
   Bio Course Add-on Styles (non-breaking)
   File: bio-course.css
   Purpose: Adds a modern, student-friendly layout for Biology flows
   NOTE: Link this AFTER your existing style.css
   ======================================== */

/* Color tokens resolve to your site's theme variables */
:root {
  --bio-bg: var(--light-color, #e8f5e9);
  --bio-ink: var(--dark-color, #1a3c0f);
  --bio-ink-soft: color-mix(in srgb, var(--dark-color) 70%, white);
  --bio-acc: var(--accent-color, #6aab58);
  --bio-pri: var(--primary-color, #2c5e1a);
  --bio-sec: var(--secondary-color, #4b8b3b);
}

/* Page scaffolding */
.bio-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .bio-container {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem 2rem;
  }
}

/* Hero */
.bio-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(1200px 400px at 10% -20%, rgba(255,255,255,.6), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--bio-pri) 72%, black 10%), var(--bio-sec));
  color: #fff;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
  isolation: isolate;
  margin-bottom: 10px;
}

.bio-hero::after {
  content: "";
  position: absolute;
  inset: -10% -10% auto auto;
  height: 220px;
  width: 220px;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.35), transparent 70%),
    radial-gradient(closest-side, rgba(255,255,255,.25), transparent 70%);
  border-radius: 50%;
  filter: blur(4px);
  opacity: .8;
  z-index: -1;
}

.bio-hero h1 {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.6rem);
  line-height: 1.15;
  margin-bottom: .5rem;
}

.bio-hero p {
  font-size: clamp(1rem, 0.5vw + .9rem, 1.15rem);
  opacity: .95;
  max-width: 60ch;
}

.bio-cta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.bio-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--bio-pri);
  border: 2px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.bio-btn:hover { transform: translateY(-1px); }
.bio-btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.5);
  box-shadow: none;
}
.bio-btn i { font-size: 1.1rem; }

/* Sticky in-page navigation (no JS) */
.bio-toc {
  position: sticky;
  top: 1rem;
  height: max-content;
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 20%, transparent);
}
.bio-toc h3 {
  font-size: 1rem;
  color: var(--bio-pri);
  margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem;
}
.bio-toc ol, .bio-toc ul {
  list-style: none;
  margin: 0; padding: 0;
}
.bio-toc a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: .6rem;
  align-items: center;
  padding: .55rem .6rem;
  margin: .2rem 0;
  border-radius: 10px;
  color: var(--bio-ink);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.bio-toc a .num {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
  background: var(--bio-bg);
  color: var(--bio-sec);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 30%, transparent);
}
.bio-toc a:hover {
  background: var(--bio-bg);
  color: var(--bio-pri);
  transform: translateX(2px);
}

/* Section cards */
.bio-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 12%, transparent);
  scroll-margin-top: 90px;
}
.bio-section + .bio-section { margin-top: 1.25rem; }

.bio-section h2 {
  font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem);
  line-height: 1.2;
  color: var(--bio-pri);
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .5rem;
}
.bio-section .sub {
  color: var(--bio-ink-soft);
  margin-bottom: .8rem;
  font-size: .98rem;
}

/* Stepper (forløb) */
.bio-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px,1fr));
  gap: .75rem;
  margin-top: .75rem;
}
@media (max-width: 1100px) {
  .bio-steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .bio-steps { grid-template-columns: 1fr; }
}
.bio-step {
  background: var(--bio-bg);
  border: 1px dashed color-mix(in srgb, var(--bio-sec) 35%, transparent);
  border-radius: 12px;
  padding: .9rem;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: .7rem;
  align-items: start;
}
.bio-step .badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  border: 2px solid var(--bio-sec);
  color: var(--bio-sec);
  font-weight: 800;
}
.bio-step h4 { margin: 0; font-size: 1rem; line-height: 1.2; }
.bio-step p { margin: .2rem 0 0; font-size: .92rem; color: var(--bio-ink-soft); }

/* Card grid for tasks/materials */
.bio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: .75rem;
}
@media (max-width: 1100px) { .bio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .bio-grid { grid-template-columns: 1fr; } }

.bio-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--bio-sec) 12%, transparent);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 1rem;
  display: grid;
  gap: .5rem;
  transition: transform .15s ease, box-shadow .2s ease;
}
.bio-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.bio-card .head {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; color: var(--bio-pri);
}
.bio-card p { font-size: .95rem; color: var(--bio-ink-soft); }
.bio-meta {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem;
}
.bio-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 600;
  padding: .25rem .55rem; border-radius: 999px;
  background: var(--bio-bg);
  color: var(--bio-sec);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 30%, transparent);
}

/* Callouts */
.bio-callout {
  border-left: 6px solid var(--bio-sec);
  background: color-mix(in srgb, var(--bio-bg) 85%, #fff);
  padding: .9rem 1rem;
  border-radius: 10px;
  margin: .75rem 0;
}
.bio-callout strong { color: var(--bio-pri); }

/* Checklist (no JS) */
.bio-checklist { list-style: none; padding: 0; margin: .5rem 0 0; }
.bio-checklist li {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .45rem .5rem;
  border-radius: 10px;
  background: var(--bio-bg);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 22%, transparent);
  margin-bottom: .45rem;
}
.bio-checklist input { margin-top: .2rem; }

/* Simple rubric */
.bio-rubric { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.bio-rubric th, .bio-rubric td {
  border: 1px solid #e6e6e6; padding: .6rem .5rem; text-align: left;
}
.bio-rubric thead th {
  background: var(--bio-bg); color: var(--bio-pri);
}

/* Utility */
.bio-muted { color: var(--bio-ink-soft); font-size: .95rem; }
.bio-spacer { height: .5rem; }



/* === Updates: width, step layout, image & fact box styles === */

/* Narrower container to align visually with header */
.bio-container {
  max-width: 1000px; /* was 1200px */
}

/* Forløb step: number above text for more space */
.bio-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
}
.bio-step .badge {
  margin: 0 0 .4rem 0;
}

/* Support for image grid (energistrømme) */
.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-top: .5rem;
}
.image-grid figure { margin: 0; }
.image-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 12%, transparent);
}
.image-grid figcaption {
  text-align: center;
  font-size: .92rem;
  color: var(--bio-ink-soft);
}

/* Fact-box styling for handlingsforslag */
.bio-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 10px;
}
.fact-box {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--bio-sec) 20%, transparent);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.fact-box h4 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.05rem;
  color: var(--bio-pri);
  margin: 0 0 .5rem 0;
}
.fact-box h4 .badge {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  font-weight: 800;
  border-radius: 50%;
  background: var(--bio-bg);
  color: var(--bio-sec);
  border: 1px solid color-mix(in srgb, var(--bio-sec) 30%, transparent);
}
.content-list {
  margin: 0;
  padding-left: 1.1rem;
}
.content-list.small li { margin: .25rem 0; }
.content-list li strong { color: var(--bio-ink); }


/* === Hotfix: prevent horizontal scroll & ensure sections never exceed main === */

/* Use border-box everywhere so padding/borders don't push width */
*, *::before, *::after { box-sizing: border-box; }

/* Constrain overall content to a safer width to match typical site headers */
.bio-container {
  max-width: 920px; /* reduced from 1000px */
  width: 100%;
  overflow-x: clip;
}

/* Ensure grid items can shrink inside the container (avoid min-content overflow) */
.bio-container > * { min-width: 0; }

/* Never let sections overflow the column width */
.bio-section, .bio-hero {
  max-width: 100%;
  width: 100%;
  overflow-wrap: anywhere;
}

/* More resilient step grid: auto-fit wraps and avoids overflow */
.bio-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

/* Generic image safety */
img { max-width: 100%; height: auto; display: block; }

/* As a last resort, remove horizontal scroll from the page */
html, body { overflow-x: hidden; }


/* === Updates (2025-08-11): Remove sidebar layout & make Forløb-steps clickable === */

/* Single-column layout now that the aside is removed */
.bio-container { 
  grid-template-columns: 1fr !important;
}

/* Smooth in-page scrolling */
html { scroll-behavior: smooth; }

/* Clickable step cards: overlay link fills the card */
.bio-step { position: relative; cursor: pointer; }
.bio-step .step-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
}

/* Subtle hover emphasis still works when card is a link */
.bio-step:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.1); }
