/* ==============================================
   True Canadian Glossary — Investopedia-style
   ============================================== */

/* ---- Reset / base ---- */
.tcg-page *,
.tcg-page *::before,
.tcg-page *::after { box-sizing: border-box; }

.tcg-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ---- Hero ---- */
.tcg-hero {
    background: linear-gradient(135deg, #c0392b 0%, #8b0000 100%);
    color: #fff;
    padding: 56px 20px 52px;
}

.tcg-hero__inner {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.tcg-hero__eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: 10px;
}

.tcg-hero__title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.15;
}

.tcg-hero__sub {
    font-size: 17px;
    opacity: .9;
    max-width: 580px;
    margin: 0 auto 28px;
}

/* ---- Search ---- */
.tcg-search-wrap {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

.tcg-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.tcg-search-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    outline: none;
    color: #1a1a2e;
    background: #fff;
    transition: box-shadow .15s;
}

.tcg-search-input:focus {
    box-shadow: 0 0 0 3px rgba(192,57,43,.35), 0 2px 12px rgba(0,0,0,.2);
}

.tcg-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
    z-index: 999;
    overflow: hidden;
}

.tcg-search-results__item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #1a1a2e;
    border-bottom: 1px solid #f0f0f0;
    transition: background .1s;
}
.tcg-search-results__item:last-child { border-bottom: none; }
.tcg-search-results__item:hover { background: #f7f8fa; }

.tcg-search-results__title {
    font-weight: 700;
    font-size: 14px;
    color: #c0392b;
}

.tcg-search-results__summary {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.tcg-search-results__empty {
    padding: 14px 16px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

/* ---- Body layout ---- */
.tcg-body { padding: 40px 20px 60px; background: #f7f8fa; }

.tcg-body__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 768px) {
    .tcg-body__inner { grid-template-columns: 1fr; }
    .tcg-sidebar { order: 2; }
    .tcg-main    { order: 1; }
}

/* ---- Sidebar ---- */
.tcg-sidebar { display: flex; flex-direction: column; gap: 20px; }

.tcg-sidebar__card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    padding: 20px;
}

.tcg-sidebar__card--tip {
    background: #fff8f8;
    border-color: #f5c6c6;
}

.tcg-sidebar__card--tip p {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.6;
}

.tcg-sidebar__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin: 0 0 12px;
}

.tcg-cat-list { list-style: none; padding: 0; margin: 0; }

.tcg-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: color .15s;
}
.tcg-cat-list li:last-child .tcg-cat-link { border-bottom: none; }
.tcg-cat-link:hover,
.tcg-cat-link.is-active { color: #c0392b; font-weight: 600; }

.tcg-cat-count {
    background: #f0f0f0;
    color: #666;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* ---- Letter nav ---- */
.tcg-letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 28px;
}

.tcg-letter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #c0392b;
    transition: background .12s, color .12s;
}

.tcg-letter-link:hover:not(.tcg-letter--disabled) {
    background: #c0392b;
    color: #fff;
}

.tcg-letter--disabled {
    color: #ccc;
    pointer-events: none;
    cursor: default;
}

/* ---- Term sections / list ---- */
.tcg-letter-section { margin-bottom: 40px; }

.tcg-letter-heading {
    font-size: 28px;
    font-weight: 800;
    color: #c0392b;
    border-bottom: 3px solid #c0392b;
    padding-bottom: 8px;
    margin: 0 0 16px;
}

.tcg-term-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }

.tcg-term-item {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    padding: 14px 18px;
    transition: border-color .15s, box-shadow .15s;
}

.tcg-term-item:hover {
    border-color: #c0392b;
    box-shadow: 0 2px 10px rgba(192,57,43,.08);
}

.tcg-term-item__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tcg-term-link {
    font-weight: 700;
    font-size: 15px;
    color: #c0392b;
    text-decoration: none;
    transition: color .15s;
}
.tcg-term-link:hover { color: #8b0000; text-decoration: underline; }

.tcg-term-cat {
    font-size: 11px;
    font-weight: 700;
    background: #fff0f0;
    color: #c0392b;
    border-radius: 20px;
    padding: 2px 10px;
    letter-spacing: .04em;
}

.tcg-term-summary {
    font-size: 13.5px;
    color: #555;
    margin: 5px 0 0;
    line-height: 1.5;
}

.tcg-no-results { color: #888; font-size: 16px; padding: 24px 0; }

/* ============================================================
   SINGLE TERM PAGE
   ============================================================ */
.tcg-breadcrumb {
    background: #f7f8fa;
    border-bottom: 1px solid #e2e4e8;
    padding: 10px 20px;
    font-size: 13px;
}

.tcg-breadcrumb__inner {
    max-width: 1120px;
    margin: 0 auto;
    color: #888;
}

.tcg-breadcrumb a { color: #555; text-decoration: none; }
.tcg-breadcrumb a:hover { color: #c0392b; }
.tcg-breadcrumb__sep { margin: 0 6px; }
.tcg-breadcrumb__current { color: #1a1a2e; font-weight: 600; }

/* --- Single body layout --- */
.tcg-single-body { padding: 40px 20px 60px; background: #f7f8fa; }

.tcg-single-body__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 36px;
    align-items: start;
}

@media (max-width: 900px) {
    .tcg-single-body__inner { grid-template-columns: 1fr; }
}

/* --- Term header --- */
.tcg-single-main {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 36px 40px;
}

@media (max-width: 600px) {
    .tcg-single-main { padding: 24px 20px; }
}

.tcg-term-category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    background: #fff0f0;
    color: #c0392b;
    border-radius: 20px;
    padding: 3px 12px;
    text-decoration: none;
    margin-bottom: 10px;
}
.tcg-term-category-badge:hover { background: #c0392b; color: #fff; }

.tcg-term-title {
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.2;
}

.tcg-term-pronunciation {
    font-size: 14px;
    color: #888;
    font-style: italic;
    margin: 0 0 14px;
}

.tcg-term-lead {
    font-size: 17px;
    color: #333;
    font-weight: 500;
    line-height: 1.65;
    border-left: 4px solid #c0392b;
    padding-left: 16px;
    margin: 0 0 28px;
    background: #fff8f8;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
}

/* --- Key Takeaways --- */
.tcg-takeaways {
    background: #f0faf2;
    border: 1px solid #b7e4c7;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 28px;
}

.tcg-takeaways__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #1a7a3c;
    margin-bottom: 12px;
}

.tcg-takeaways__header svg { color: #1a7a3c; flex-shrink: 0; }

.tcg-takeaways__list {
    padding-left: 20px;
    margin: 0;
}

.tcg-takeaways__list li {
    font-size: 14.5px;
    color: #1d4a2b;
    margin-bottom: 6px;
    line-height: 1.5;
}

.tcg-takeaways__list li:last-child { margin-bottom: 0; }

/* --- Content --- */
.tcg-term-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2d2d2d;
    margin-bottom: 28px;
}

.tcg-term-content p { margin-bottom: 1em; }
.tcg-term-content h2, .tcg-term-content h3 { color: #1a1a2e; margin-top: 1.5em; }

/* --- Example box --- */
.tcg-example {
    background: #fffbf0;
    border: 1px solid #f5e0a0;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 28px;
}

.tcg-example__header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8a6200;
    margin-bottom: 10px;
}

.tcg-example p {
    font-size: 14.5px;
    color: #4a3a00;
    line-height: 1.65;
    margin: 0;
    font-style: italic;
}

/* --- Back link --- */
.tcg-back-link { margin-top: 8px; }
.tcg-back-link a {
    color: #c0392b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tcg-back-link a:hover { text-decoration: underline; }

/* --- Single sidebar --- */
.tcg-single-sidebar { display: flex; flex-direction: column; gap: 20px; }

.tcg-related-list { list-style: none; padding: 0; margin: 0; }

.tcg-related-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tcg-related-list li:last-child { border-bottom: none; padding-bottom: 0; }

.tcg-related-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    color: #c0392b;
    transition: color .15s;
}
.tcg-related-link:hover { color: #8b0000; }
.tcg-related-link svg { flex-shrink: 0; color: #ccc; }

.tcg-related-summary {
    font-size: 12px;
    color: #888;
    margin: 3px 0 0;
    line-height: 1.4;
}

/* --- Sidebar A–Z grid --- */
.tcg-sidebar-az {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.tcg-sidebar-az__link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    background: #f7f8fa;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #c0392b;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.tcg-sidebar-az__link:hover { background: #c0392b; color: #fff; }

/* --- Inline term tooltip --- */
.tcg-inline-term {
    color: #c0392b;
    font-weight: 600;
    text-decoration: underline dotted;
    cursor: help;
    position: relative;
}

.tcg-inline-term::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    max-width: 260px;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s;
    z-index: 100;
    line-height: 1.4;
}

.tcg-inline-term:hover::after { opacity: 1; }
