/*
 * Last Modified: 2026-10-06
 * Modern public term-page typography and responsive editorial layout.
 * Loaded after glossary.css only for active term pages so article-specific composition
 * can evolve without changing shared homepage or legacy public-page styling.
 */

.tga-term-heading {
    padding: 20px 22px;
}

.tga-term-heading h1 {
    max-width: 820px;
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    line-height: 1.16;
    letter-spacing: -0.018em;
}

.tga-term-subheading {
    max-width: 720px;
    margin: 0 0 10px;
    font-size: clamp(.98rem, 1.4vw, 1.08rem);
    line-height: 1.4;
}

.tga-term-meta {
    gap: 7px 11px;
    font-size: .82rem;
}

.tga-share-links .share-btn {
    min-height: 36px;
    padding: 7px 11px;
    font-size: .78rem;
}

.tga-term-reading-layout {
    padding: 14px 18px 18px;
}

.tga-term-primary-column > .card-body {
    padding: 0;
}

.tga-definition-card p,
.tga-faqs p,
.tga-references p {
    max-width: 72ch;
    margin: 0 0 .95rem;
    font-size: 1rem;
    line-height: 1.58;
}

.tga-definition-card p:last-child {
    margin-bottom: 0;
}

.tga-definition-card strong.H2,
.tga-definition-card h2.H2 {
    margin: 1.55rem 0 .55rem;
    font-size: 1.46rem;
    line-height: 1.28;
}

.tga-definition-card strong.H3,
.tga-definition-card h3.H3 {
    margin: 1.3rem 0 .5rem;
    font-size: 1.23rem;
    line-height: 1.3;
}

.tga-definition-card strong.H4,
.tga-definition-card h4.H4 {
    margin: 1.1rem 0 .45rem;
    font-size: 1.08rem;
    line-height: 1.35;
}

/* The primary image belongs to the article rather than to a separate hero row. A
 * right float lets the opening and following prose use the space below short paragraphs
 * naturally instead of leaving the blank grid cell created by a fixed two-column lead.
 * The shared stylesheet still defines the historic media area as a two-column ad+image
 * grid, so retire that grid here now that modern term pages no longer render the manual ad. */
.tga-primary-definition > .card-body {
    display: flow-root;
}

.tga-primary-definition > .card-body > .tga-term-media {
    display: block;
    float: right;
    width: min(44%, 380px);
    margin: 0 0 16px 24px;
    padding: 0;
}

.tga-primary-definition > .card-body > .tga-term-media .tga-term-carousel {
    display: block;
    width: 100%;
    max-width: 380px;
    margin: 0;
}

/* Author attribution should begin below a floated hero even when the article is short. */
.tga-primary-definition .tga-author-card,
.tga-primary-definition .tga-author-byline {
    clear: both;
}

/* If a legacy definition starts with a heading instead of prose, keep the media compact
 * above the article rather than reserving the old two-slot advertising grid. */
.tga-term-primary-column > .tga-term-media {
    display: block;
    width: min(100%, 380px);
    margin: 0 auto 18px;
    padding: 0;
}

.tga-term-primary-column > .tga-term-media .tga-term-carousel {
    display: block;
    width: 100%;
    max-width: 380px;
}

@media (min-width: 1024px) {
    .tga-term-reading-layout-no-map {
        grid-template-areas: "main";
        grid-template-columns: minmax(0, 1fr);
    }

    /* No Contents rail means the article can use the shell width. Individual prose
     * remains capped at 72ch above, so readability is preserved without wide gutters. */
    .tga-term-reading-layout-no-map .tga-term-primary-column {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .tga-term-heading {
        padding: 16px 15px;
    }

    .tga-term-heading h1 {
        margin-bottom: 7px;
        font-size: clamp(1.65rem, 8vw, 1.85rem);
        line-height: 1.18;
    }

    .tga-term-subheading {
        margin-bottom: 9px;
        font-size: .98rem;
        line-height: 1.4;
    }

    .tga-term-meta {
        gap: 7px;
        font-size: .8rem;
    }

    .tga-share-links .share-btn {
        min-height: 38px;
        padding: 7px 10px;
    }

    .tga-term-reading-layout {
        padding: 10px 12px 14px;
    }

    .tga-primary-definition > .card-body > .tga-term-media,
    .tga-term-primary-column > .tga-term-media {
        float: none;
        width: min(100%, 336px);
        max-width: 336px;
        margin: 0 auto 14px;
    }

    .tga-primary-definition > .card-body > .tga-term-media .tga-term-carousel,
    .tga-term-primary-column > .tga-term-media .tga-term-carousel {
        width: 100%;
        max-width: 336px;
        margin: 0 auto;
    }

    .tga-definition-card p,
    .tga-faqs p,
    .tga-references p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .tga-definition-card strong.H2,
    .tga-definition-card h2.H2 {
        margin-top: 1.35rem;
        font-size: 1.3rem;
    }

    .tga-definition-card strong.H3,
    .tga-definition-card h3.H3 {
        margin-top: 1.15rem;
        font-size: 1.16rem;
    }

    .tga-definition-card strong.H4,
    .tga-definition-card h4.H4 {
        font-size: 1.05rem;
    }
}
