/* eBook hero only: all layout and type rules stay inside this component. */
#tcgi-ebook-hero {
    --ebook-purple: #1d082a;
    --ebook-beige: #f7f6f2;
    --ebook-blue: #026eb8;
    --ebook-pink: #d88dca;
    --ebook-text: #514959;
    --ebook-line: #ded9df;

    width: 100%;
    margin-bottom: clamp(40px, 5vw, 72px);
    color: var(--ebook-purple);
    background: var(--ebook-beige);
    font-family: "Atlas Grotesk Regular", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    text-align: left;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

#tcgi-ebook-hero *,
#tcgi-ebook-hero *::before,
#tcgi-ebook-hero *::after {
    box-sizing: border-box;
}

#tcgi-ebook-hero :is(h1, p, dl, dd, figure) {
    margin: 0;
    padding: 0;
}

#tcgi-ebook-hero a {
    color: inherit;
    text-decoration: none;
}

#tcgi-ebook-hero a:focus-visible {
    outline: 3px solid var(--ebook-blue);
    outline-offset: 5px;
}

#tcgi-ebook-hero .hgf-wrap {
    width: min(100%, var(--site_width, 1140px));
    margin: 0 auto;
    padding-inline: 0;
}

#tcgi-ebook-hero .hgf-hero {
    padding-top: 28px;
    background: var(--ebook-beige);
    /* Paint through the theme gutters without a 100vw scrollbar overflow. */
    box-shadow: 0 0 0 100vmax var(--ebook-beige);
    clip-path: inset(0 -100vmax);
}

/* Standard Insight back link, scoped to the eBook hero. */
#tcgi-ebook-hero .insight-back-button-wrapper {
    line-height: 1.6;
}

#tcgi-ebook-hero .insight-back-button-text {
    display: inline-block;
    position: relative;
    padding-left: 30px;
    color: #000;
    font-family: "Lyon Display Light", Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
}

#tcgi-ebook-hero .insight-back-button-text:hover {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#tcgi-ebook-hero .insight-back-button-text::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 13px;
    top: 5px;
    left: 0;
    background: url("/wp-content/uploads/2023/01/Arrow-purple.svg") no-repeat;
    background-size: 18px 13px;
    transform: rotate(180deg);
}

/* Main two-column hero. */
#tcgi-ebook-hero .hgf-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
    padding-block: 48px 56px;
}

#tcgi-ebook-hero .hgf-hero-copy {
    min-width: 0;
    max-width: 640px;
}

#tcgi-ebook-hero .hgf-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--ebook-purple);
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: .035em;
}

#tcgi-ebook-hero .hgf-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--ebook-blue);
}

#tcgi-ebook-hero h1 {
    margin: 0;
    padding: 0;
    color: var(--ebook-purple);
    font-family: "Lyon Display Light", Georgia, serif !important;
    max-width: 19ch;
    font-size: clamp(42px, 4.5vw, 64px) !important;
    font-weight: 400 !important;
    font-style: normal;
    line-height: 1.08 !important;
    letter-spacing: -.025em;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

#tcgi-ebook-hero .hgf-lead {
    max-width: 530px;
    margin-top: 26px;
    color: var(--ebook-text);
    font-size: 18px;
    line-height: 1.65;
}

#tcgi-ebook-hero .hgf-lead p {
    color: inherit;
    font: inherit;
}

#tcgi-ebook-hero .hgf-lead p + p {
    margin-top: 14px;
}

/* Download button and optional secondary link. */
#tcgi-ebook-hero .hgf-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 24px;
    margin-top: 30px;
}

#tcgi-ebook-hero .hgf-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 54px;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 15px 22px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    transition: background-color .2s, color .2s;
}

#tcgi-ebook-hero .hgf-button-primary {
    color: var(--ebook-beige);
    background: var(--ebook-blue);
}

#tcgi-ebook-hero .hgf-button-primary:hover {
    color: var(--ebook-purple);
    background: var(--ebook-pink);
}

#tcgi-ebook-hero .hgf-button svg {
    display: block;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#tcgi-ebook-hero .hgf-text-link {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding-block: 5px;
    border-bottom: 1px solid currentColor;
    color: var(--ebook-purple);
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

#tcgi-ebook-hero .hgf-text-link:hover {
    color: var(--ebook-blue);
}

#tcgi-ebook-hero .hgf-text-link > span {
    flex-shrink: 0;
}

#tcgi-ebook-hero .hgf-file-note {
    margin-top: 12px;
    color: var(--ebook-text);
    font-size: 12px;
    line-height: 1.6;
}

/* Optional publisher/contributor credits. */
#tcgi-ebook-hero .hgf-client-line {
    max-width: 480px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--ebook-line);
}

#tcgi-ebook-hero .hgf-small-label {
    color: var(--ebook-text);
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: .04em;
    overflow-wrap: anywhere;
}

#tcgi-ebook-hero .hgf-client-line > p {
    margin-top: 8px;
    color: var(--ebook-purple);
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
}

/* Portrait paper frame; contain landscape placeholders without cropping. */
#tcgi-ebook-hero .hgf-cover-figure {
    width: min(100%, 312px);
    min-width: 0;
    justify-self: center;
}

#tcgi-ebook-hero .hgf-cover-link {
    display: block;
    transition: transform .25s;
}

#tcgi-ebook-hero .hgf-cover-link:hover {
    transform: translateY(-4px);
}

#tcgi-ebook-hero img.hgf-cover {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: 0 20px 44px -12px rgba(29, 8, 42, .24),
        0 2px 8px rgba(29, 8, 42, .06);
}

#tcgi-ebook-hero .hgf-cover-figure figcaption {
    margin-top: 16px;
    color: var(--ebook-text);
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Optional facts strip. Adapts to the number of completed facts. */
#tcgi-ebook-hero .hgf-facts {
    display: grid;
    grid-template-columns:
        repeat(var(--ebook-fact-count, 4), minmax(0, 1fr));
    border-top: 1px solid var(--ebook-line);
    padding-block: 30px 36px;
}

#tcgi-ebook-hero .hgf-facts > div {
    min-width: 0;
    padding-inline: 24px;
    border-left: 1px solid var(--ebook-line);
    overflow-wrap: anywhere;
}

#tcgi-ebook-hero .hgf-facts > div:first-child {
    padding-left: 0;
    border-left: 0;
}

#tcgi-ebook-hero .hgf-facts dt {
    margin-bottom: 10px;
    color: var(--ebook-text);
    font-size: 12px;
    line-height: 1.5;
}

#tcgi-ebook-hero .hgf-facts dd {
    display: grid;
    gap: 7px;
}

#tcgi-ebook-hero .hgf-fact-main {
    padding-top: 0;
    color: var(--ebook-purple);
    font-family: "Atlas Grotesk Medium", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.5;
}

#tcgi-ebook-hero .hgf-facts dd > span:not(.hgf-fact-main) {
    color: var(--ebook-text);
    font-size: 12px;
    line-height: 1.5;
}

/* Fallback when no cover is selected. */
#tcgi-ebook-hero .ebook-no-cover {
    grid-template-columns: minmax(0, 1fr);
}

#tcgi-ebook-hero .ebook-no-cover .hgf-hero-copy {
    max-width: 780px;
}

/* Tablet. */
@media (min-width: 768px) and (max-width: 1024px) {
    #tcgi-ebook-hero .hgf-hero-grid:not(.ebook-no-cover) {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
        gap: 32px;
    }

    #tcgi-ebook-hero .hgf-cover-figure {
        max-width: 272px;
    }

    #tcgi-ebook-hero .hgf-facts > div {
        padding-inline: 18px;
    }

    #tcgi-ebook-hero .hgf-facts > div:first-child {
        padding-left: 0;
    }

    #tcgi-ebook-hero .hgf-fact-main {
        font-size: 16px;
    }
}

/* Give four facts room to breathe on tablets. */
@media (min-width: 768px) and (max-width: 1024px) {
    #tcgi-ebook-hero .hgf-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 0;
    }

    #tcgi-ebook-hero .hgf-facts > div:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    #tcgi-ebook-hero .hgf-facts > div:only-child {
        grid-column: 1 / -1;
    }
}

/* Mobile. */
@media (max-width: 767px) {
    #tcgi-ebook-hero h1 {
        font-size: clamp(36px, 7.2vw, 50px) !important;
    }

    #tcgi-ebook-hero .hgf-hero {
        padding-top: 24px;
    }

    #tcgi-ebook-hero .hgf-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        padding-block: 32px 40px;
    }

    #tcgi-ebook-hero .hgf-hero-copy {
        max-width: none;
    }

    #tcgi-ebook-hero .hgf-lead {
        font-size: 17px;
    }

    #tcgi-ebook-hero .hgf-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    #tcgi-ebook-hero .hgf-client-line {
        margin-top: 28px;
    }

    #tcgi-ebook-hero .hgf-cover-figure {
        width: min(82%, 280px);
        max-width: none;
        justify-self: center;
    }

    #tcgi-ebook-hero .hgf-facts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 26px 0;
        padding-block: 26px;
    }

    #tcgi-ebook-hero .hgf-facts > div {
        padding-inline: 20px;
    }

    #tcgi-ebook-hero .hgf-facts > div:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    #tcgi-ebook-hero .hgf-facts > div:nth-child(even) {
        padding-right: 0;
    }

    #tcgi-ebook-hero .hgf-facts > div:only-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    #tcgi-ebook-hero .hgf-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    #tcgi-ebook-hero .hgf-facts > div {
        padding-inline: 0;
        border-left: 0;
    }
}

@media (max-width: 380px) {
    #tcgi-ebook-hero .hgf-button {
        gap: 12px;
        padding-inline: 16px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #tcgi-ebook-hero *,
    #tcgi-ebook-hero *::before,
    #tcgi-ebook-hero *::after {
        transition: none !important;
    }
}

/* All enabled eBook covers retain their supplied artwork and natural proportions. */
#tcgi-ebook-hero .hgf-cover-figure {
    width: 100%;
    max-width: none;
}
@media (min-width: 768px) {
    #tcgi-ebook-hero .hgf-hero-grid:not(.ebook-no-cover) {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: clamp(32px, 4vw, 56px);
    }
}
@media (min-width: 768px) and (max-width: 1024px) {
    #tcgi-ebook-hero .hgf-hero-grid:not(.ebook-no-cover) {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: 28px;
    }
}
@media (max-width: 767px) {
    #tcgi-ebook-hero .hgf-cover-figure {
        width: min(calc(100% + 24px), calc(100vw - 40px));
    }
}
#tcgi-ebook-hero img.hgf-cover { aspect-ratio: auto; height: auto; background: transparent; }
