/* Story detail page (Figma 19-8144): title, breadcrumbs and book CTA. The related stories use the block's grid
   and teaser from stories.css. Colours and fonts come from the theme tokens (base/_tokens.scss). */

/* Figma 19-8550: sans, accent in Newsreader Light, 45px on 1057. */
.story-header__title {
    max-width: 37.125rem; /* 594px */
    margin-top: 5.5625rem; /* 89px below the top, as the stories archive */
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4.26vw, 2.8125rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.011em;
    overflow-wrap: break-word;
}

/* Figma 177-1414: pills in the text column, each one sliding under the one before it. */
.story-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 32rem; /* $text-measure: the column of the text block */
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.story-breadcrumbs__item {
    position: relative;
    min-width: 0;
}

/* The earlier pill lies on top. */
.story-breadcrumbs__item:nth-child(1) {
    z-index: 3;
}

.story-breadcrumbs__item:nth-child(2) {
    z-index: 2;
}

.story-breadcrumbs__pill {
    display: flex;
    align-items: center;
    min-height: 2.75rem; /* 44px tap target below 1024px */
    padding: 0.5rem 1.125rem;
    border-radius: 100px;
    background-color: var(--color-beige);
    box-shadow: 1px 1px 4px rgb(0 0 0 / 25%);
    color: var(--color-dark);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

a.story-breadcrumbs__pill:hover {
    background-color: var(--color-beige-hover);
}

.story-breadcrumbs__pill--current {
    background-color: var(--color-action);
    box-shadow: none;
}

/* Overlapping pills from 768px; on a phone they wrap side by side, without the empty space on the left. */
@media (min-width: 768px) {
    .story-breadcrumbs__list {
        column-gap: 0;
        /* Every pill moves 46px under the previous one; this keeps the first (and the first of a new line) in the column. */
        padding-left: 2.875rem;
    }

    .story-breadcrumbs__item {
        margin-left: -2.875rem;
    }

    .story-breadcrumbs__pill {
        padding-left: 3.5rem;
    }

    .story-breadcrumbs__item:first-child .story-breadcrumbs__pill {
        padding-left: 1.125rem;
    }
}

@media (min-width: 1024px) {
    .story-breadcrumbs__pill {
        min-height: 2.3125rem; /* 37px as in Figma */
    }
}

/* Figma 19-8502: image 266px, text column from x=400 on 1057. */
.story-cta__grid {
    display: grid;
    gap: 2rem;
}

.story-cta__media {
    max-width: 16.625rem; /* 266px */
}

.story-cta__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-image);
}

.story-cta__content {
    min-width: 0;
}

.story-cta__title {
    max-width: 33.75rem; /* 540px */
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.26vw, 2.8125rem);
    font-weight: 300;
    line-height: 1.15;
    overflow-wrap: break-word;
}

.story-cta__text {
    max-width: 31.25rem; /* 500px */
    margin: 1.375rem 0 0;
    font-size: 1.125rem;
    line-height: 1.3;
}

.story-cta__form {
    max-width: 31.25rem;
    margin-top: 2rem;
}

.story-cta__more {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem; /* 20px between the intro and the link */
    max-width: 34.5625rem; /* 553px, the line */
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--color-dark) 20%, transparent);
    line-height: 1.3;
}

.story-cta__link {
    position: relative;
    color: var(--color-dark);
    text-decoration: underline;
}

.story-cta__link:hover {
    color: var(--color-action-hover);
}

/* At least 44px to tap, without moving the line. */
.story-cta__link::after {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    height: 2.75rem;
    transform: translateY(-50%);
}

@media (min-width: 768px) {
    .story-cta__grid {
        grid-template-columns: 16.625rem minmax(0, 1fr);
        gap: 3.6875rem; /* 59px */
        align-items: start;
    }

    /* Figma: the title starts 25px below the top of the image. */
    .story-cta__media + .story-cta__content {
        margin-top: 1.5625rem;
    }
}
