/* ============================================================================
   lesson-consistency.css — TaxTami shared lesson conventions
   Provides:
     1. .lesson-overview-card  — the STATIC replacement for the old animated
        feature-steps intro (Context / Legislation / Concepts). No motion,
        no stock images.
     2. .tt-lesson-flyout      — the sidebar hover preview panel
        (summary / objectives / key terms).
   Theme tokens: green #1a5038 / #2c724f / #1e5c3a, accent #c97a37,
   tint #f0f7f3, border #e6ebe8.
   ========================================================================== */

/* One shared indent token for every enumerated run (ul / ol / .tt-enum). */
:root { --tt-list-indent: 1.9em; }

/* ---- 1. Static lesson overview card ------------------------------------ */
.lesson-overview-card {
  border: 1px solid #e6ebe8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(20, 50, 35, 0.05);
  overflow: hidden;
  margin: 6px 0 26px;
}
.lesson-overview-card__head {
  background: linear-gradient(to right, #1e5c3a, #2c724f);
  color: #fff;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.lesson-overview-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.lesson-overview-card__cell {
  padding: 20px 22px;
  border-right: 1px solid #e6ebe8;
}
.lesson-overview-card__cell:last-child { border-right: none; }
.lesson-overview-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0f7f3;
  color: #1a5038;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}
.lesson-overview-card__cell h3 {
  margin: 0 0 8px;
  color: #1a5038;
  font-size: 15px;
  font-weight: 700;
}
.lesson-overview-card__cell p {
  margin: 0;
  color: #46524c;
  font-size: 13.5px;
  line-height: 1.55;
}
@media (max-width: 767px) {
  .lesson-overview-card__grid { grid-template-columns: 1fr; }
  .lesson-overview-card__cell { border-right: none; border-bottom: 1px solid #e6ebe8; }
  .lesson-overview-card__cell:last-child { border-bottom: none; }
}

/* ---- 1b. Per-section short description (every A–I section) -------------- */
/* Sits directly under the section heading, visible open or collapsed, so the
   reader knows what a section covers before expanding it. */
.lesson-section-desc {
  margin: 2px 0 0;
  padding: 0 0 2px;
  color: #6b7670;
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  font-weight: 400;
}
.lesson-summary .lesson-section-desc { margin-top: 4px; }

/* Accordion bar: read-tick on the left, then a clean gap, then a text column
   holding the heading with its description stacked underneath; the dropdown
   arrow stays pinned to the far right. */
.lesson-details .lesson-summary .lesson-summary-text {
  margin-left: 14px;   /* clean spacing after the complete-section tick */
  margin-right: auto;  /* keep the block left; arrow pushed to the right */
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.lesson-details .lesson-summary h2 {
  margin: 0;
  text-align: left;
}
.lesson-details .lesson-summary .lesson-section-desc {
  margin: 0;
  text-align: left;
}
.lesson-details .lesson-summary .tt-tick {
  float: none;
  margin: 0;           /* sit flush at the left of the bar */
}

/* ---- 1c. Uniform subheadings inside A–I sections ----------------------- */
/* Content sections author subheadings inconsistently as <h3> (big, underlined)
   or <h4> (small, plain) for the SAME level, so sections render at different
   sizes. No section nests both levels, so we unify them: every in-section
   subheading gets ONE consistent, theme-native subheading style. */
.lesson-details .section-content h2,
.lesson-details .section-content h3,
.lesson-details .section-content h4,
.lesson-details .section-content h5 {
  color: var(--primary-color, #1a5038);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  margin-top: 2.6em;
  margin-bottom: 0;      /* content butts straight up under the heading */
  padding-bottom: 1px;
  border-bottom: 1px solid var(--primary-light, #d7e6dd);
  display: block;
}
.lesson-details .section-content h3:first-child,
.lesson-details .section-content h4:first-child,
.lesson-details .section-content h5:first-child { margin-top: 0.5em; }
/* Pull whatever follows a heading right up under it — kill its top margin.
   `+ *` rather than a list of tags: sections also open with <div>, <blockquote>
   and callout wrappers, and those were keeping their own top margin. */
.lesson-details .section-content h2 + *,
.lesson-details .section-content h3 + *,
.lesson-details .section-content h4 + *,
.lesson-details .section-content h5 + * {
  margin-top: 0;
}

/* The theme pads the content box 20px below the green summary bar, which reads
   as a large gap between the section heading and its first line. */
.lesson-details .section-content { padding-top: 8px; }

/* ---- 1d. Reading rhythm: spacing, indentation, alignment --------------- */
/* Consistent vertical rhythm and list indentation so content lines up and
   breathes evenly across every lesson. */
.lesson-details .section-content > *:first-child { margin-top: 0; }
.lesson-details .section-content p {
  margin: 0 0 1.15em;   /* paragraph breaks stay clearly readable */
  line-height: 1.75;
}
.lesson-details .section-content p:last-child { margin-bottom: 0; }

/* ONE indent for every enumerated run — <ul>, <ol> and the reflowed
   .tt-enum block. These used to differ (1.5em vs 1.9em), so an (a) item
   rendered by list-formatter sat at a different left edge from a (b) item
   authored as a bullet, inside the same passage. */
.lesson-details .section-content ul,
.lesson-details .section-content ol {
  margin: 0.55em 0 1.15em;
  padding-left: var(--tt-list-indent, 1.9em);
  list-style-position: outside;   /* marker hangs; wrapped text stays aligned */
}
.lesson-details .section-content li {
  margin-bottom: 0.5em;
  line-height: 1.7;
  padding-left: 0.2em;
}
.lesson-details .section-content li:last-child { margin-bottom: 0; }
.lesson-details .section-content li > ul,
.lesson-details .section-content li > ol { margin: 0.4em 0 0.4em; }  /* nested lists tighter */
.lesson-details .section-content li::marker { color: #2c724f; }      /* aligned green markers */

/* Callout / gap boxes and blockquotes: even inset so they align with text */
.lesson-details .section-content blockquote {
  margin: 1em 0;
  padding: 0.6em 1em;
  border-left: 3px solid #c9d8cf;
  background: #f6faf8;
  border-radius: 0 8px 8px 0;
}
.lesson-details .section-content blockquote > *:last-child { margin-bottom: 0; }

/* Tables: consistent spacing above/below and comfortable cell padding */
.lesson-details .section-content table { margin: 0.6em 0 1.2em; }
.lesson-details .section-content th,
.lesson-details .section-content td { padding: 8px 12px; vertical-align: top; }

/* Reflowed enumeration: a touch more room between items for scannability */
.lesson-details .section-content .tt-enum { margin: 10px 0 12px; }
.lesson-details .section-content .tt-enum-item { margin: 6px 0; }

/* ---- 2. Sidebar hover lesson-preview flyout ---------------------------- */
.tt-lesson-flyout {
  position: fixed;
  z-index: 4000;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #d7e2db;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(20, 50, 35, 0.18);
  padding: 14px 16px 15px;
  font-size: 13px;
  color: #2a3530;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.tt-lesson-flyout.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Inline cross-lesson link (points to another lesson, with preview on hover) */
.lesson-link {
  color: #1a5038;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #bcd6c6;
  padding-bottom: 1px;
  white-space: nowrap;
}
.lesson-link::before {
  content: "\2197";           /* ↗ north-east arrow */
  font-size: 0.82em;
  color: #c97a37;
  margin-right: 2px;
  vertical-align: baseline;
}
.lesson-link:hover, .lesson-link:focus {
  color: #c97a37;
  border-bottom-color: #c97a37;
  outline: none;
}
.tt-lesson-flyout__tag {
  display: inline-block;
  background: #2c724f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.tt-lesson-flyout__title {
  margin: 0 0 8px;
  color: #1a5038;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}
.tt-lesson-flyout__summary {
  margin: 0 0 11px;
  color: #46524c;
  font-size: 12.5px;
  line-height: 1.5;
}
.tt-lesson-flyout__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7670;
  margin: 0 0 5px;
}
.tt-lesson-flyout__objectives {
  margin: 0 0 11px;
  padding: 0 0 0 16px;
}
.tt-lesson-flyout__objectives li {
  margin: 0 0 3px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #2a3530;
}
.tt-lesson-flyout__terms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tt-lesson-flyout__term {
  background: #f0f7f3;
  color: #1a5038;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
}
/* Hide the hover flyout on touch / small screens — tap opens the lesson. */
@media (hover: none), (max-width: 991px) {
  .tt-lesson-flyout { display: none !important; }
}

/* ---- Inline enumeration reflow ((i)/(ii) or (a)/(b) runs) -------------- */
/* A dense inline list is reflowed into one item per line with a marker chip.
   Applied at runtime by js/list-formatter.js. */
.tt-enum { margin: 8px 0 10px; padding-left: var(--tt-list-indent, 1.9em); }
.tt-enum-item { display: block; position: relative; margin: 4px 0; line-height: 1.6; }
.tt-enum-mark {
  position: absolute; left: calc(-1 * var(--tt-list-indent, 1.9em)); top: 0;
  min-width: 1.6em; text-align: right;
  font-weight: 700; color: #1a5038;
}
.tt-enum-lead { margin-bottom: 4px; }

/* ---- Key concept highlight (readability) ------------------------------ */
/* Restrained soft marker on a few core concept phrases per lesson. Distinct
   from .def-ref (green dotted) and legislation links so the three don't clash. */
.tt-key {
  /* Soft, evenly-tinted highlight with rounded ends — no hard gradient edge,
     and it stays clean when a phrase wraps across lines. */
  background: rgba(247, 178, 74, 0.34);   /* warmer amber */
  padding: 0.08em 0.28em;
  margin: 0 -0.06em;
  border-radius: 4px;
  font-weight: 700;
  color: #6b3b12;                          /* warm brown text */
  box-shadow: 0 0 0 1px rgba(201, 122, 55, 0.16);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---- Legislation full-text viewer (hover panel + click modal) --------- */
/* Themed to match the CGT legislation tooltip (css/legal-ref.css):
   white card, green left rule, uppercase act label, compact type. */
.tt-leg-panel {
  position: fixed; z-index: 9000; width: 560px; max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid rgba(44, 114, 79, 0.30);
  border-left: 4px solid #2c724f;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 0;
  font-size: 12.5px; line-height: 1.55; color: #2d3436;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tt-leg-panel .tt-leg-body { max-height: 300px; }   /* taller scroll area */
.tt-leg-panel.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.tt-leg-modal-overlay {
  position: fixed; inset: 0; z-index: 6100; background: rgba(15,30,22,0.5);
  display: none; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.tt-leg-modal-overlay.is-open { display: flex; }
.tt-leg-modal {
  background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.32);
  width: 620px; max-width: 100%; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden;
}
.tt-leg-modal .tt-leg-body { max-height: none; }
/* Header typography mirrors the CGT tooltip: small uppercase act label above a
   bold section line. */
.tt-leg-head {
  position: sticky; top: 0; background: #ffffff; z-index: 1;
  padding: 12px 15px 8px; border-bottom: 1px solid #e9f1ed;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.tt-leg-head h4 {
  margin: 0; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #2c724f; line-height: 1.3;
}
.tt-leg-head small {
  display: block; font-size: 13px; font-weight: 700; color: #1a3a2a;
  margin-top: 4px; line-height: 1.35;
}
.tt-leg-close {
  background: #eef3f0; border: none; color: #1a3a2a; width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer; flex-shrink: 0; font-size: 12px; line-height: 1;
}
/* The modal keeps the stronger green header for contrast at larger size. */
.tt-leg-modal .tt-leg-head { background: linear-gradient(135deg, #1e5c3a, #2c724f); border-bottom: none; }
.tt-leg-modal .tt-leg-head h4 { color: rgba(255,255,255,0.85); }
.tt-leg-modal .tt-leg-head small { color: #fff; }
.tt-leg-modal .tt-leg-close { background: rgba(255,255,255,0.22); color: #fff; }
.tt-leg-panel .tt-leg-close { display: none; }
.tt-leg-panel.is-pinned .tt-leg-close { display: block; }
.tt-leg-panel.is-pinned { box-shadow: 0 16px 44px rgba(20,50,35,0.3); border-color: #c9d8cf; }
.tt-leg-note {
  padding: 6px 15px; background: #f6faf8; border-bottom: 1px solid #eef3f0;
  font-size: 11px; color: #6b7670; font-weight: 600;
}
.tt-leg-note b { color: #b5641f; }
/* Amendment banner: what changed, by which Act, from when. */
.tt-leg-amend {
  margin: 10px 15px 4px;
  padding: 9px 11px;
  background: #fff7e6;
  border: 1px solid #f0d9a8;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #6b4a12;
}
.tt-leg-amend b { color: #8a5a15; }
.tt-leg-amend__tag {
  display: inline-block;
  background: #c97a37;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 7px;
}
.tt-leg-amend__more { margin-top: 5px; }
.tt-leg-amend__more > summary {
  cursor: pointer; font-style: italic; color: #8a5a15;
  list-style: none; outline: none; padding: 1px 0;
}
.tt-leg-amend__more > summary::-webkit-details-marker { display: none; }
.tt-leg-amend__more > summary::before { content: "▸ "; font-style: normal; }
.tt-leg-amend__more[open] > summary::before { content: "▾ "; }
.tt-leg-amend__more[open] > summary { margin-bottom: 4px; }
.tt-leg-amend__asat {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #f0d9a8;
  font-style: italic;
  color: #8a7350;
}

.tt-leg-body { padding: 12px 15px 14px; overflow-y: auto; position: relative; }
.tt-leg-modal .tt-leg-body { flex: 1; max-height: 70vh; }
.tt-leg-block {
  font-size: 12.7px; line-height: 1.55; color: #2a3530; margin: 0 0 9px;
  padding: 3px 6px; border-radius: 6px;
}
.tt-leg-block .tt-leg-id { font-weight: 700; color: #1a5038; margin-right: 5px; }
.tt-leg-block.is-target { background: #fff2cf; box-shadow: inset 3px 0 0 #c97a37; }
.tt-leg-block.is-target .tt-leg-id { color: #b5641f; }

/* ---- 3. Section-2 defined-term hover ---------------------------------- */
.def-ref {
  border-bottom: 1px dotted #2c724f;
  cursor: help;
  text-decoration: none;
}
.def-ref:hover, .def-ref:focus {
  background: #f0f7f3;
  outline: none;
}
.tt-def-tip {
  position: fixed;
  z-index: 4200;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #d7e2db;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(20, 50, 35, 0.18);
  padding: 11px 13px 12px;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity 0.13s ease, transform 0.13s ease;
}
.tt-def-tip.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.tt-def-tip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef3f0;
}
.tt-def-tip__term {
  color: #1a5038;
  font-weight: 700;
  font-size: 14px;
}
.tt-def-tip__ref {
  color: #c97a37;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;   /* no uppercase — show the full "VAT Act Section 2" */
  white-space: nowrap;
  flex-shrink: 0;
}
.tt-def-tip__body {
  color: #35423b;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ============================================================================
   SQUARED CORNERS — no rounded edges on lesson pages.
   The theme rounds via --border-radius plus ~60 hard-coded radii across
   lessons.css / legal-ref.css / our own components. Neutralising the variable
   and squaring the lesson surfaces is cleaner than editing each rule.
   ========================================================================== */
:root { --border-radius: 0 !important; }

/* Lesson page surfaces + every component we inject */
.sidebar-page-container, .sidebar-page-container *,
.dom-sidebar, .dom-sidebar *,
.customs-sidebar, .customs-sidebar *,
.lesson-overview-card, .lesson-overview-card *,
.lesson-details, .lesson-details *,
.lesson-nav, .lesson-nav *,
.tt-leg-panel, .tt-leg-panel *,
.tt-leg-modal, .tt-leg-modal *,
.tt-def-tip, .tt-def-tip *,
.tt-lesson-flyout, .tt-lesson-flyout *,
.tt-toolbar, .tt-toolbar *,
.tt-palette, .tt-palette *,
.tt-map, .tt-map *,
.tt-tutor, .tt-tutor *,
.tt-tutor-launch,
.tt-key, .tt-tick, .tt-readbar {
  border-radius: 0 !important;
}

/* Exception: the completion gauge is a ring, not a cornered box. */
.tt-ring, .tt-ring__inner { border-radius: 50% !important; }

/* Sidebar intro block: same colour as the sidebar (no separate tint) but
   OPAQUE — it is position:sticky, so a transparent background lets the
   scrolling lesson list show through and the text appears to overlap. */
.dom-sidebar-header,
.customs-sidebar-header {
  background: #ffffff !important;
  position: sticky; top: 0; z-index: 3;
}
/* Sticky module bands must also be opaque and sit above the list. */
.dom-sidebar-module, .customs-sidebar-module { z-index: 2; }
.dom-sidebar-submodule { position: relative; z-index: 1; }
/* Main menu is one solid colour: no box behind hover / current items. */
.main-menu .navigation > li > a,
.main-menu .navigation > li:hover > a,
.main-menu .navigation > li.current > a,
.main-menu .navigation > li.current-menu-item > a {
  background: transparent !important;
  box-shadow: none !important;
}
.main-menu .navigation > li.current > a,
.main-menu .navigation > li:hover > a {
  box-shadow: inset 0 -2px 0 #2c724f !important;
}

/* Sidebar hover preview: bullet the "What you'll learn" points.
   The theme sets a global `ul { list-style: none }`, which stripped them. */
.tt-lesson-flyout__objectives {
  list-style: disc outside !important;
  padding-left: 18px !important;
  margin: 0 0 11px !important;
}
.tt-lesson-flyout__objectives li {
  display: list-item !important;
  list-style: disc outside !important;
  padding-left: 2px;
}
.tt-lesson-flyout__objectives li::marker { color: #2c724f; font-size: 0.95em; }
html[data-theme="dark"] .tt-lesson-flyout__objectives li::marker { color: #7fd8a6; }
