/* =========================================================
   COURSES.CSS — InnovateHERs
   Styles for courses.html, course.html and dashboard.html,
   plus the sign-in widget that appears in the nav sitewide.

   Extends scrapbook.css — load that first. Palette borrowed
   from it deliberately: pink #e36180, blush #fce4ec,
   paper #fef6f8, green #a8d4a2.
   ========================================================= */

/* ── Nav auth widget ───────────────────────────────────── */

.auth-slot { display: flex; align-items: center; margin-left: .4rem; }

.auth-signin {
  font-family: 'Caveat', cursive;
  font-size: 1.08rem; font-weight: 700;
  color: #fff; background: #e36180;
  border: 1.5px solid #e36180; border-radius: 99px;
  padding: .3rem 1.1rem; cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.auth-signin:hover {
  background: #c45c78; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227,97,128,.3);
}

.auth-menu { position: relative; }
.auth-trigger {
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; border-radius: 50%;
  transition: transform .2s;
}
.auth-trigger:hover { transform: scale(1.06); }
.auth-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; border: 2px solid #f9a8c0; display: block;
}
.auth-avatar-initial {
  display: flex; align-items: center; justify-content: center;
  background: #e36180; color: #fff;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .95rem;
}

.auth-dropdown {
  position: absolute; top: calc(100% + .6rem); right: 0;
  min-width: 210px; z-index: 400;
  background: #fff; border: 1.5px solid #f9a8c0; border-radius: 6px;
  box-shadow: 0 12px 32px rgba(227,97,128,.22);
  padding: .5rem; display: flex; flex-direction: column; gap: .1rem;
}
.auth-who {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .5rem .6rem .6rem;
  border-bottom: 1px dashed #f3c9d6; margin-bottom: .3rem;
}
.auth-who strong { font-size: .92rem; color: #2d2d2d; }
.auth-who span {
  font-size: .78rem; color: #999;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-dropdown a, .auth-signout {
  font-family: 'Nunito', sans-serif; font-size: .88rem; font-weight: 600;
  color: #666; text-align: left;
  padding: .45rem .6rem; border-radius: 6px;
  background: none; border: none; cursor: pointer; width: 100%;
  transition: background .18s, color .18s;
}
.auth-dropdown a:hover, .auth-signout:hover { background: #fce4ec; color: #e36180; }
.auth-signout { border-top: 1px dashed #f3c9d6; margin-top: .3rem; padding-top: .55rem; }

/* ── Shared page furniture ─────────────────────────────── */

.page-header { position: relative; z-index: 10; text-align: center; padding: 4rem 1.5rem 1.5rem; }
.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; color: #2d2d2d;
}
.page-header p {
  margin-top: .6rem; font-family: 'Caveat', cursive;
  font-size: 1.25rem; color: #888; max-width: 520px; margin-inline: auto;
}

/* Progress bars — gradient lifted from .modal-divider in blog.html */
.bar { height: 8px; background: #f3e2e8; border-radius: 99px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #e36180, #a8d4a2);
  transition: width .45s cubic-bezier(.22,.68,0,1.2);
}
.bar-sm { height: 5px; }

.pct-label {
  font-family: 'Caveat', cursive; font-size: 1.05rem;
  font-weight: 700; color: #e36180; white-space: nowrap;
}

/* Buttons */
.btn-primary, .btn-ghost {
  font-family: 'Caveat', cursive; font-size: 1.15rem; font-weight: 700;
  border-radius: 99px; padding: .55rem 1.6rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn-primary {
  background: #e36180; color: #fff; border: 2px solid #e36180;
}
.btn-primary:hover {
  background: #c45c78; border-color: #c45c78;
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(227,97,128,.32);
}
.btn-ghost { background: transparent; color: #3d7a40; border: 2px solid #a8d4a2; }
.btn-ghost:hover { background: #a8d4a2; color: #fff; }
.btn-primary:disabled, .btn-ghost:disabled {
  opacity: .55; cursor: not-allowed; transform: none; box-shadow: none;
}

/* States: loading / empty / error */
.state-msg {
  text-align: center; padding: 3.5rem 1.5rem;
  font-family: 'Caveat', cursive; font-size: 1.3rem; color: #999;
}
.state-msg .btn-primary { font-size: 1.05rem; margin-top: 1rem; }

/* Draft + placeholder markers ---------------------------- */
.draft-banner {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto 1.2rem; padding: .7rem 1.1rem;
  background: repeating-linear-gradient(45deg, #fff8e1, #fff8e1 10px, #fff3cd 10px, #fff3cd 20px);
  border: 1.5px dashed #d4a72c; border-radius: 6px;
  font-family: 'Nunito', sans-serif; font-size: .85rem; color: #7a5c00;
}
.draft-banner strong { font-weight: 800; }
.draft-pill {
  display: inline-block; margin-left: .5rem; vertical-align: middle;
  background: #fff3cd; color: #7a5c00;
  border: 1px solid #d4a72c; border-radius: 99px;
  font-family: 'Nunito', sans-serif; font-size: .65rem;
  font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: .12rem .5rem;
}
/* Unwritten lesson copy — greyed so it can never pass for finished text */
.placeholder { color: #b0b0b0 !important; font-style: italic; }
.lesson-intent {
  background: #fce4ec; border-left: 4px solid #e36180;
  padding: .8rem 1rem; border-radius: 0 4px 4px 0;
  font-size: .88rem; color: #8a4a5c; margin-bottom: 1.2rem;
}

/* ═════════════════════════════════════════════════════════
   CATALOG  (courses.html)
   ═════════════════════════════════════════════════════════ */

.course-grid {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem 2rem;
  max-width: 1100px; margin: 0 auto; padding: 1rem 2rem 5rem;
}

.course-card {
  background: #fff; border-radius: 3px; position: relative;
  display: flex; flex-direction: column;
  border-left: 5px solid #a8d4a2;
  box-shadow: 2px 5px 16px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s;
}
/* washi tape, alternating like the blog cards */
.course-card::before {
  content: ''; position: absolute; top: -11px; left: 2rem;
  width: 54px; height: 18px; background: rgba(249,168,192,.8);
  border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.1); z-index: 2;
}
.course-card:nth-child(even)::before {
  background: rgba(255,240,120,.85); left: auto; right: 2rem;
}
.course-card:hover { transform: translateY(-6px) rotate(.4deg); box-shadow: 4px 14px 36px rgba(0,0,0,.18); }

.course-card-body { padding: 1.8rem 1.6rem 1.5rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.course-eyebrow {
  font-family: 'Caveat', cursive; font-size: .98rem;
  font-weight: 600; color: #e36180;
}
.course-card h2 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.5rem;
  font-weight: 700; line-height: 1.25; color: #2d2d2d;
}
.course-tagline { font-size: .9rem; color: #666; line-height: 1.6; flex: 1; }
.course-meta {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  font-size: .78rem; color: #999; margin-top: .3rem;
}
.course-meta span { display: inline-flex; align-items: center; gap: .3rem; }

.course-card-progress { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; }
.course-card-progress .bar { flex: 1; }

.course-card-footer {
  padding: 0 1.6rem 1.6rem; display: flex; align-items: center; gap: .7rem;
}

/* ═════════════════════════════════════════════════════════
   COURSE SHELL  (course.html)
   ═════════════════════════════════════════════════════════ */

.course-shell {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: 290px 1fr;
  gap: 2rem; align-items: start;
  max-width: 1180px; margin: 0 auto; padding: 2rem 2rem 5rem;
}

/* ── Side menu — styled as a scrapbook tab divider, not an LMS rail ── */
.course-side {
  position: sticky; top: 84px;
  background: #fff; border-radius: 3px;
  border-left: 5px solid #e36180;
  box-shadow: 2px 5px 16px rgba(0,0,0,.1);
  padding: 1.4rem 1.1rem; max-height: calc(100vh - 108px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 1rem;
}
.course-side-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1.2rem;
  font-weight: 700; line-height: 1.3; color: #2d2d2d;
}
.course-side-progress { display: flex; flex-direction: column; gap: .35rem; }
.course-side-progress .row { display: flex; justify-content: space-between; align-items: baseline; }
.course-side-progress .row span:first-child {
  font-family: 'Caveat', cursive; font-size: 1rem; color: #888;
}

.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav button {
  font-family: 'Caveat', cursive; font-size: 1.12rem; font-weight: 600;
  color: #7a7a7a; text-align: left; background: none; border: none;
  padding: .45rem .8rem; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
  transition: background .18s, color .18s;
}
.side-nav button:hover { background: #fce4ec; color: #c45c78; }
.side-nav button.active { background: #fce4ec; color: #e36180; font-weight: 700; }

.side-divider { height: 1px; background: repeating-linear-gradient(90deg,#f3c9d6 0 6px,transparent 6px 12px); }

/* Compact module tree, shown in the side menu during a lesson */
.side-tree { display: flex; flex-direction: column; gap: .8rem; }
.side-tree-mod > p {
  font-family: 'Nunito', sans-serif; font-size: .72rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: #b98a99;
  margin-bottom: .35rem;
}
.side-tree-lesson {
  display: flex; align-items: flex-start; gap: .45rem; width: 100%;
  font-family: 'Nunito', sans-serif; font-size: .82rem; line-height: 1.4;
  color: #777; text-align: left; background: none; border: none;
  padding: .35rem .5rem; border-radius: 6px; cursor: pointer;
  transition: background .18s, color .18s;
}
.side-tree-lesson:hover { background: #fce4ec; color: #c45c78; }
.side-tree-lesson.current { background: #fce4ec; color: #e36180; font-weight: 700; }
.side-tree-lesson .tick { flex-shrink: 0; width: 14px; color: #a8d4a2; font-weight: 900; }
.side-tree-lesson.done .tick::after { content: '✓'; }
.side-tree-lesson:not(.done) .tick::after { content: '○'; color: #ddd; }

/* ── Main pane ─────────────────────────────────────────── */
.course-main {
  background: #fff; border-radius: 3px;
  border-top: 5px solid #a8d4a2;
  box-shadow: 2px 5px 20px rgba(0,0,0,.1);
  padding: 2.2rem 2.4rem 2.6rem; min-height: 60vh;
}
.course-main h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 700;
  line-height: 1.2; color: #2d2d2d; margin-bottom: .5rem;
}
.course-main h2 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.5rem;
  font-weight: 700; color: #2d2d2d; margin: 2rem 0 .8rem;
}
.course-main p { line-height: 1.85; color: #444; }
.view-tagline { font-family: 'Caveat', cursive; font-size: 1.25rem; color: #e36180; margin-bottom: 1.4rem; }

.stat-row { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 1.5rem 0; }
.stat { display: flex; flex-direction: column; gap: .1rem; }
.stat b {
  font-family: 'Cormorant Garamond', serif; font-size: 1.9rem;
  font-weight: 700; color: #e36180; line-height: 1;
}
.stat span { font-family: 'Caveat', cursive; font-size: .98rem; color: #999; }

.outcome-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin: .8rem 0 0; }
.outcome-list li {
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .93rem; color: #444; line-height: 1.6;
}
.outcome-list li::before { content: '✓'; color: #a8d4a2; font-weight: 900; flex-shrink: 0; }

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 2rem; }

/* ── Modules accordion ─────────────────────────────────── */
.module-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.2rem; }

.module {
  border: 1.5px solid #f3c9d6; border-radius: 4px;
  background: #fffdfd; overflow: hidden;
}
.module.complete { border-color: #a8d4a2; background: #f7fcf6; }

.module-head {
  width: 100%; display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.2rem; background: none; border: none;
  cursor: pointer; text-align: left;
  transition: background .18s;
}
.module-head:hover { background: #fce4ec; }
.module.complete .module-head:hover { background: #eef8ec; }

.module-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fce4ec; color: #e36180;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .85rem;
}
.module.complete .module-num { background: #a8d4a2; color: #fff; }

.module-head-text { flex: 1; min-width: 0; }
.module-head-text h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.2rem;
  font-weight: 700; color: #2d2d2d; line-height: 1.3;
}
.module-head-text p { font-size: .82rem; color: #999; margin-top: .15rem; line-height: 1.5; }

.module-count {
  flex-shrink: 0; font-family: 'Caveat', cursive;
  font-size: 1rem; font-weight: 700; color: #b98a99; white-space: nowrap;
}
.module.complete .module-count { color: #3d7a40; }
.module-chev { flex-shrink: 0; color: #d4a0b4; transition: transform .25s; font-size: .8rem; }
.module.open .module-chev { transform: rotate(90deg); }

.module-bar { padding: 0 1.2rem 1rem; }

.module-body { display: none; padding: 0 1.2rem 1rem; }
.module.open .module-body { display: block; }

.lesson-row {
  width: 100%; display: flex; align-items: center; gap: .8rem;
  padding: .7rem .8rem; margin-bottom: .25rem;
  background: #fff; border: 1px solid #f3e2e8; border-radius: 4px;
  cursor: pointer; text-align: left;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.lesson-row:hover {
  border-color: #e36180; transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(227,97,128,.12);
}
.lesson-check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #e3c4cf; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 900; color: transparent;
  transition: background .2s, border-color .2s, color .2s;
}
.lesson-row.done .lesson-check { background: #a8d4a2; border-color: #a8d4a2; color: #fff; }
.lesson-row-text { flex: 1; min-width: 0; }
.lesson-row-text b {
  display: block; font-family: 'Nunito', sans-serif;
  font-size: .92rem; font-weight: 700; color: #2d2d2d; line-height: 1.4;
}
.lesson-row.done .lesson-row-text b { color: #6a8a68; }
.lesson-row-text span { font-size: .76rem; color: #aaa; }

/* ── Lesson reader ─────────────────────────────────────── */
.lesson-crumb {
  font-family: 'Nunito', sans-serif; font-size: .74rem; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; color: #b98a99;
  margin-bottom: .5rem;
}
.lesson-video {
  position: relative; width: 100%; padding-top: 56.25%;
  margin: 1.4rem 0; border-radius: 4px; overflow: hidden;
  background: #000; box-shadow: 0 6px 22px rgba(0,0,0,.2);
}
.lesson-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lesson-body { font-size: 1rem; line-height: 1.9; color: #444; }
.lesson-body p { margin-bottom: 1.1rem; }
.lesson-body ul, .lesson-body ol { margin: 0 0 1.1rem 1.3rem; }
.lesson-body li { margin-bottom: .5rem; }
.lesson-body h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.3rem;
  font-weight: 700; color: #2d2d2d; margin: 1.6rem 0 .6rem;
}

.lesson-complete-toggle {
  display: flex; align-items: center; gap: .6rem;
  margin: 2rem 0 1.4rem; padding: .9rem 1.1rem;
  background: #fffdfd; border: 1.5px dashed #f3c9d6; border-radius: 4px;
  font-family: 'Nunito', sans-serif; font-size: .9rem; color: #666;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.lesson-complete-toggle:hover { border-color: #e36180; background: #fff7f9; }
.lesson-complete-toggle.done { border-style: solid; border-color: #a8d4a2; background: #f7fcf6; color: #3d7a40; }
.lesson-complete-toggle .lesson-check { width: 24px; height: 24px; }

.lesson-nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px dashed #f3c9d6; padding-top: 1.5rem; margin-top: .5rem;
}

/* ── Progress view ─────────────────────────────────────── */
.ring-wrap { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .track { stroke: #f3e2e8; }
.ring .fill { stroke: #e36180; transition: stroke-dashoffset .7s cubic-bezier(.22,.68,0,1.2); }
.ring b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; font-weight: 700; color: #2d2d2d;
}

.mod-progress-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.mod-progress-item { display: flex; flex-direction: column; gap: .35rem; }
.mod-progress-item .row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.mod-progress-item .row b { font-family: 'Nunito', sans-serif; font-size: .9rem; font-weight: 700; color: #2d2d2d; }
.mod-progress-item .row span { font-family: 'Caveat', cursive; font-size: .98rem; color: #999; white-space: nowrap; }

.fact-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.fact-list li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: #666; border-bottom: 1px dashed #f3e2e8; padding-bottom: .5rem; }
.fact-list li b { color: #2d2d2d; font-weight: 700; }

/* Course-complete celebration */
.done-banner {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: #f7fcf6; border: 2px solid #a8d4a2; border-radius: 4px;
  padding: 1.1rem 1.3rem; margin-bottom: 1.5rem;
}
.done-banner b { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; color: #3d7a40; }
.done-banner span { font-size: .9rem; color: #5a7a58; }

/* ═════════════════════════════════════════════════════════
   DASHBOARD  (dashboard.html)
   ═════════════════════════════════════════════════════════ */

.dash-list {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; gap: 1.6rem;
  max-width: 820px; margin: 0 auto; padding: 1rem 2rem 5rem;
}
.dash-card {
  background: #fff; border-radius: 3px; border-left: 5px solid #a8d4a2;
  box-shadow: 2px 5px 16px rgba(0,0,0,.12);
  padding: 1.6rem 1.8rem;
  display: flex; flex-direction: column; gap: .7rem;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
}
.dash-card:hover { transform: translateY(-4px); box-shadow: 4px 12px 32px rgba(0,0,0,.16); }
.dash-card.complete { border-left-color: #e36180; }
.dash-card h2 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.4rem;
  font-weight: 700; color: #2d2d2d; line-height: 1.3;
}
.dash-next { font-family: 'Caveat', cursive; font-size: 1.08rem; color: #888; }
.dash-next b { color: #e36180; font-weight: 700; }
.dash-card-row { display: flex; align-items: center; gap: .9rem; }
.dash-card-row .bar { flex: 1; }
.dash-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .3rem; }
.dash-meta { font-size: .78rem; color: #aaa; }

/* ═════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .course-shell { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem 1.2rem 4rem; }
  /* Side menu becomes a top drawer rather than a rail */
  .course-side { position: static; max-height: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav button { flex: 1 1 auto; justify-content: center; }
  .course-main { padding: 1.6rem 1.3rem 2rem; }
}

@media (max-width: 640px) {
  /* The nav collapses into the hamburger drawer, so the auth widget
     has to lay out as a full-width row rather than a floating avatar. */
  .auth-slot { margin: .4rem 0 0; width: 100%; }
  .auth-signin { width: 100%; }
  .auth-menu { width: 100%; }
  .auth-trigger { width: 100%; justify-content: flex-start; gap: .6rem; }
  .auth-dropdown { position: static; box-shadow: none; border: none; padding: .3rem 0 0; min-width: 0; }
  .auth-dropdown[hidden] { display: none; }

  .page-header { padding: 2.5rem 1.2rem 1rem; }
  .course-grid { grid-template-columns: 1fr; gap: 2.2rem; padding: 1rem 1.2rem 3.5rem; }
  .dash-list { padding: 1rem 1.2rem 3.5rem; }
  .dash-card { padding: 1.3rem 1.2rem; }
  .module-head { padding: .85rem .9rem; gap: .6rem; }
  .module-head-text p { display: none; }   /* keep the header to one tidy line */
  .module-count { font-size: .88rem; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .btn-primary, .lesson-nav .btn-ghost { width: 100%; justify-content: center; }
  .ring-wrap { gap: 1.2rem; }
}
