/* ═══════════════════════════════════════════════════════════════
   glossary.css — Glossary term pages (/glossary/<slug>) + index extras
                  Brand: Columbus Bath Cost (CBC)

   Upload to: public_html/app/public/css/glossary.css
   Link from: Views/public/glossary_term.php and Views/public/glossary.php
              (both in the layout's 'styles' section)

   Tokens come from public.css :root — this file defines none of its own.
     --teal / --teal-dark   blueprint blue, links + accents
     --steel / --steel-pale sky tint for callouts and hovers
     --dark / --darker      the CTA band gradient
     --text-dark/-mid/-light copy hierarchy
     --border               hairlines
   Type follows the site: Oswald for headings/labels, Source Sans 3 for copy.

   CONTENTS:
   1. Term page frame + layout
   2. Definition callout + source
   3. Where this comes up
   4. Related term cards
   5. Previous / next pager
   6. Soft CTA
   7. Browse sidebar
   8. Index additions (term name links)
   9. Responsive
   ═══════════════════════════════════════════════════════════════ */


/* ─── 1. Term page frame + layout ─── */

.term-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 40px;
    align-items: start;
}

.term-article {
    min-width: 0;
    max-width: 780px;
}

.term-section {
    margin-top: 40px;
}

.term-section-heading {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px;
}


/* ─── 2. Definition callout + source ─── */

/* The snippet target: first block on the page, so it reads as the answer. */
.term-definition {
    padding: 22px 26px;
    border-left: 4px solid var(--teal);
    border-radius: 0 8px 8px 0;
    background: var(--steel-pale);
}

.term-definition-label {
    display: block;
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal-dark);
    margin-bottom: 8px;
}

.term-definition p {
    margin: 0;
    font-size: 18px;
    line-height: 1.65;
    color: var(--text-dark);
}

.term-source {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-light);
    margin: 12px 0 0;
}

.term-source a {
    color: var(--teal-dark);
    text-decoration: none;
    word-break: break-word;
}

.term-source a:hover {
    color: var(--teal);
    text-decoration: underline;
}

.term-source .fa-external-link-alt {
    font-size: 10px;
    opacity: 0.7;
}


/* ─── 3. Where this comes up ─── */

.term-usage {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.term-usage a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-dark);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.term-usage a:hover {
    border-color: var(--teal);
    background: var(--steel-pale);
}

.term-usage-kind {
    flex: 0 0 auto;
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal-dark);
}

.term-usage-title {
    flex: 1 1 auto;
    font-size: 15px;
    line-height: 1.4;
}

.term-usage .fa-arrow-right {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--teal);
}


/* ─── 4. Related term cards ─── */

.term-related {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.term-card {
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--teal);
    border-radius: 8px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.term-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(26, 31, 46, 0.12);
}

.term-card h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 6px;
}

.term-card h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.term-card h3 a:hover {
    color: var(--teal);
}

.term-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-mid);
}


/* ─── 5. Previous / next pager ─── */

.term-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.term-pager a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 48%;
    text-decoration: none;
}

/* Sits right even when it is the only child (the A-term has no previous). */
.term-pager-next {
    margin-left: auto;
    text-align: right;
}

.term-pager-label {
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-light);
}

.term-pager-title {
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    color: var(--teal-dark);
}

.term-pager-title .fas {
    font-size: 11px;
}

.term-pager a:hover .term-pager-title {
    color: var(--teal);
    text-decoration: underline;
}


/* ─── 6. Soft CTA ─── */

/* Same voice as the .cta-band on the index, sized to sit inside the column. */
.term-cta {
    margin-top: 48px;
    padding: 36px 24px;
    border-radius: 8px;
    text-align: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
}

.term-cta h2 {
    font-size: 24px;
    color: #fff;
    margin: 0 0 8px;
}

.term-cta p {
    font-size: 15px;
    color: #8898aa;
    margin: 0 0 20px;
}

.term-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.term-cta-primary,
.term-cta-secondary {
    display: inline-block;
    padding: 13px 30px;
    border-radius: 6px;
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.term-cta-primary {
    background: var(--teal);
    border: 1px solid var(--teal);
    color: #fff;
}

.term-cta-primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
    color: #fff;
}

.term-cta-secondary {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.85);
}

.term-cta-secondary:hover {
    border-color: var(--steel);
    color: #fff;
}


/* ─── 7. Browse sidebar ─── */

.term-side {
    position: sticky;
    top: 88px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.term-side-title {
    margin: 0;
    padding: 14px 18px;
    background: var(--dark);
    color: #fff;
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.term-letters {
    list-style: none;
    margin: 0;
    padding: 16px 18px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.term-letters a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--light-bg);
    color: var(--teal-dark);
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.term-letters a:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.term-side-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-family: 'Oswald', 'Oswald Fallback', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-dark);
    text-decoration: none;
}

.term-side-all:hover {
    background: var(--steel-pale);
    color: var(--teal);
}

.term-side-all .fas {
    font-size: 11px;
}


/* ─── 8. Index additions ─── */

/* On the A-Z index the term name is now a link to its own page. The block keeps
   its id="<slug>" anchor, so the tooltip links that point at glossary#slug and
   any older bookmark still land on the right block. */
.glossary-term-name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.glossary-term-name a:hover {
    color: var(--teal);
    border-bottom-color: var(--teal);
}


/* ─── 9. Responsive ─── */

@media (max-width: 991px) {
    .term-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .term-side {
        position: static;
    }

    .term-article {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .term-definition {
        padding: 18px 20px;
    }

    .term-definition p {
        font-size: 17px;
    }

    .term-related {
        grid-template-columns: 1fr;
    }

    .term-pager {
        flex-direction: column;
    }

    .term-pager a,
    .term-pager-next {
        max-width: none;
        margin-left: 0;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .term-card,
    .term-usage a,
    .term-letters a {
        transition: none;
    }

    .term-card:hover {
        transform: none;
    }
}
