/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* section: */

/* section.post-hero ties section:first-of-type in defaults.css on specificity
   and loads after it, so these paddings win */
section.post-hero {
    padding: 56px 0;

    /* safety net only: the triangle's offset below already keeps it on screen */
    overflow-x: clip;
}

.post-hero__container {
    max-width: var(--container-width--no-sidebar);
    margin: 0 auto;
    padding: 0 30px;
}

.post-hero__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* content: */

.post-hero__content {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 20px;
}

/* breadcrumbs (display_breadcrumbs()): plain purple links on white here, not
   the blue box hero-blog.css puts them in over a photo */

.post-hero nav.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.post-hero nav.breadcrumbs a {
    font-family: "Cachet";
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--purple-dk);
}

.post-hero nav.breadcrumbs a:hover {
    color: var(--blue-dk);
}

.post-hero nav.breadcrumbs .icon {
    font-size: 10px;
    color: var(--blue-lt);
}

/* date, title, excerpt */

.post-hero__date {
    margin: 0;
    color: var(--blue-lt);
}

.post-hero__title {
    margin: 0;
    color: var(--blue-dk);
    text-wrap: pretty;
}

.post-hero__excerpt {
    max-width: 560px;
    margin: 0;
    font-size: 18px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* image: */

/* a container so the triangle can be sized and placed in cqw (% of the image's
   width). The triangle's tip sits 8.1% of the image's width past its right edge
   (47px at 580): where the space outside the page container is less than that
   plus 12px, the image pulls in so the whole triangle stays on screen (0px at
   1440, ~28px at 1280). Same outer-space math as .contain-right in defaults.css. */
.post-hero__media {
    position: relative;
    container-type: inline-size;
    margin-right: max(0px, 8.1% + 12px - ((100vw - min(100vw, var(--container-width--no-sidebar))) / 2 + 30px));
}

/* 16:9, like the blog listing cards (horizontal_cards.css), so a featured image
   crops the same way on both pages and a 16:9 upload (1920x1080) isn't cropped at all */
.post-hero__image {
    position: relative;
    z-index: 1;
    aspect-ratio: 16 / 9;
    border-radius: var(--box-border-radius-lg);
    overflow: hidden;
}

.post-hero__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* triangle: the brand's rounded triangle-right icon, tucked behind the image's
   bottom-right corner. The icon draws in a 1em square with the triangle 0.89em
   wide in its middle, so 29.2cqw makes the triangle 26% of the image's width
   (151px at 580), and -9.7cqw puts its tip 8.1% past the image (47px at 580). */
.post-hero__triangle {
    position: absolute;
    z-index: 0;
    bottom: -7cqw;
    right: -9.7cqw;
}

.post-hero__triangle .icon {
    display: block;
    font-size: 29.2cqw;
    color: var(--blue-lt);
}

/* block, so no line-box space shifts the triangle off its bottom offset */
.post-hero__triangle .icon svg {
    display: block;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* small laptop + tablet: the title column narrows, so the title steps down */

@media (max-width: 1200px) {
    .post-hero__title {
        font-size: 48px;
        letter-spacing: -1.4px;
    }
}

@media (max-width: 992px) {
    .post-hero__row {
        gap: 40px;
    }

    .post-hero__title {
        font-size: 44px;
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* mobile: one column, image first (the client asked for the title under the image) */

@media (max-width: 768px) {
    section.post-hero {
        padding: 26px 0 36px;
    }

    .post-hero__row {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    /* full width here, so the triangle's tip stops 18px past the image, inside
       the 30px gutter */
    .post-hero__media {
        order: -1;
        margin-right: 0;
    }

    .post-hero__triangle {
        right: calc(-1.6cqw - 18px);
    }

    .post-hero__content {
        gap: 16px;
    }

    .post-hero__excerpt {
        font-size: 16px;
    }
}
