/* ============================================================
   GLOSSARY HUB — CORE LAYOUT
   ============================================================ */

/* Main glossary content area (right column) */
.glossary-main {
  padding-bottom: 80px;
  margin: 0px auto 0px 0px !important;
}



/* ============================================================
   GLOSSARY SECTIONS (each category block)
   ============================================================ */

.glossary-section {
  margin-bottom: 40px;
  width: 760px;
  background-color: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}

.glossary-section:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* Offset headings so they scroll BELOW the sticky toggle bar */
/* ============================================
   OFFSET FOR STICKY LAYER TOGGLE BAR
   ============================================ */

.glossary-section,
.glossary-subsection,
.glossary-term {
    scroll-margin-top: 60px; /* adjust to taste */
}



/* ============================================================
   HEADINGS
   ============================================================ */

.glossary-heading {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: #222;
}



/* ============================================================
   GLOSSARY ENTRY BLOCKS
   (term + definition + optional examples)
   ============================================================ */

.glossary-entry {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.glossary-entry:last-child {
  border-bottom: none;
}

.glossary-term {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 6px;
}

.glossary-definition {
  color: #555;
  line-height: 1.6;
}



/* ============================================================
   OPTIONAL: COLLAPSIBLE ENTRY SUPPORT
   (if you want expandable definitions later)
   ============================================================ */

.glossary-collapsible {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glossary-collapsible:hover {
  color: #000;
}

.glossary-content {
  display: none;
  padding: 0 0 16px 0;
  color: #555;
  line-height: 1.6;
}

.glossary-content.open {
  display: block;
}



/* ============================================================
   OPTIONAL: MICRO TYPOGRAPHY FOR EXAMPLES
   ============================================================ */

.glossary-example {
  margin-top: 8px;
  font-style: italic;
  color: #666;
}



/* ============================================================
   OPTIONAL: CATEGORY LABELS / TAGS
   ============================================================ */

.glossary-tag {
  display: inline-block;
  background: #eef3ff;
  color: #3a57d0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 6px;
}


        /* ============================
           BASIC STYLES
        ============================ */

        html { scroll-behavior: smooth; }

        .sidebar {
            width: 260px;
            float: left;
            border-right: 1px solid #ddd;
        }

        .content-area {
            margin-left: 280px;
            padding: 20px;
        }

        .toc a.active {
            font-weight: 600;
            color: #005bbb;
        }

        .toc-sub a.active {
            color: #0077dd;
        }
        
        .page-subtitle {
            margin: 10px 0;
            font-weight: 600;
        }

        /* ============================
           SEARCH BAR
        ============================ */

.glossary-search {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #f1f8fa; /* faint tint of #daeef4 */
    border: 1px solid #C2D4DD;
}

.glossary-search input {
    width: 96%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #C2D4DD;
    border-radius: 6px;
    background: #ffffff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.glossary-search input:focus {
    border-color: #3ea6c4;
    box-shadow: 0 0 0 3px rgba(62,166,196,0.15);
    outline: none;
}


        /* ============================
           LEVEL TOGGLE
        ============================ */

        .glossary-level-toggle {
            display: flex;
            gap: 8px;
            padding: 12px 16px;
            background: #f7f9fc;
            border-bottom: 1px solid #e2e6ee;
        }

        .level-btn {
            padding: 6px 12px;
            border: 1px solid #ccd3e0;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }

        .level-btn.active {
            background: #005bbb;
            color: white;
            border-color: #005bbb;
        }


.main-content {
  flex: 1;
  display: block;
  width: 100%;
}

/* ============================================
   4‑COLOR SYSTEM — PASTEL VARIABLES
   ============================================ */

:root {
    /* Core Pastels */
    --c-base:        #FFF7CC;  /* pastel yellow */
    --c-elementary:  #F8C8C8;  /* pastel red */
    --c-intermediate:#DDEBFF;  /* pastel blue */
    --c-advanced:    #D9F2E3;  /* pastel green */

    /* Tints (backgrounds) */
    --t-base:        #FFFBE5;
    --t-elementary:  #FCEDED;
    --t-intermediate:#F3F7FF;
    --t-advanced:    #F1FBF6;

    /* Hover tints */
    --h-base:        #FFF3B3;
    --h-elementary:  #F5B4B4;
    --h-intermediate:#C9DFFF;
    --h-advanced:    #C8ECD7;

    /* Text colors */
    --tx-dark:       #3a3a3a;
    --tx-light:      #ffffff;
}

/* ============================================
   LAYER BLOCKS — Pastel System
   ============================================ */

.layer-base {
    background: var(--t-base);
    border-left: 2px solid var(--c-base);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.layer-base:hover {
    background: var(--h-base);
    border-color: var(--c-base);
}

.layer-elementary {
    background: var(--t-elementary);
    border-left: 2px solid var(--c-elementary);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.layer-elementary:hover {
    background: var(--h-elementary);
    border-color: var(--c-elementary);
}

.layer-intermediate {
    background: var(--t-intermediate);
    border-left: 2px solid var(--c-intermediate);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.layer-intermediate:hover {
    background: var(--h-intermediate);
    border-color: var(--c-intermediate);
}

.layer-advanced {
    background: var(--t-advanced);
    border-left: 2px solid var(--c-advanced);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.layer-advanced:hover {
    background: var(--h-advanced);
    border-color: var(--c-advanced);
}

/* Typography */
.definition-layer,
.example-layer,
.patient-layer {
    font-size: 0.95rem;
    line-height: 1.45;
}
.example-layer strong,
.patient-layer strong {
    color: #3a3a3a;
    font-weight: 600;
}
.example-layer,
.patient-layer {
    margin-top: 4px;
}

/* ============================================
   TOGGLE BUTTONS — Pastel System
   ============================================ */

.layer-toggle {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 10px;
    padding: 10px;
    margin: 0 0 10px 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e7ef;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.layer-toggle button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 2px solid transparent;
    background: #f2f3f7;
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Hover states */
.layer-toggle button[data-layer="base"]:hover {
    background: var(--h-base);
}
.layer-toggle button[data-layer="elementary"]:hover {
    background: var(--h-elementary);
}
.layer-toggle button[data-layer="intermediate"]:hover {
    background: var(--h-intermediate);
}
.layer-toggle button[data-layer="advanced"]:hover {
    background: var(--h-advanced);
}

/* ACTIVE STATES — solid pastels + correct text */
.layer-toggle button.active[data-layer="base"] {
    background: var(--c-base);
    border-color: var(--c-base);
    color: var(--tx-dark);
}
.layer-toggle button.active[data-layer="elementary"] {
    background: var(--c-elementary);
    border-color: var(--c-elementary);
    color: var(--tx-dark);
}
.layer-toggle button.active[data-layer="intermediate"] {
    background: var(--c-intermediate);
    border-color: var(--c-intermediate);
    color: var(--tx-dark);
}
.layer-toggle button.active[data-layer="advanced"] {
    background: var(--c-advanced);
    border-color: var(--c-advanced);
    color: var(--tx-dark);
}

.layer-toggle button.active {
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}




/* ============================================
   STICKY TOC CONTAINER
   ============================================ */

.glossary-toc {
    position: sticky;
    top: 1.5rem;
    background: #ffffff;
    padding: 1.4rem 1.2rem;
    border: 1px solid #e5e7ef;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

/* Heading */
.glossary-toc .toc-heading {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #e5e7ef;
    padding-bottom: 0.5rem;
}

/* Section list */
.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-section > a {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    padding: 6px 0;
    transition: color 0.2s ease;
}

.toc-section > a:hover {
    color: #4a5aff;
}

/* Subsections */
.toc-subsections {
    list-style: none;
    padding-left: 12px;
    margin: 4px 0 10px 0;
    border-left: 2px solid #e0e3ef;
}

.toc-subsection a {
    display: block;
    padding: 4px 0 4px 6px;
    color: #555;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.toc-subsection a:hover {
    color: #4a5aff;
}

/* ACTIVE LINK */
.glossary-toc a.active {
    color: #2284a2;
    font-weight: 700;
    background: #eef3ff;
    border-radius: 4px;
}




