/* 
 ---------------------------------
 |   LAST UPDATED: 2026-04-14    |
 ---------------------------------
 */

/* VIEWPORT HEADNOTE: Standard boundaries are 1024, 768-1023, and <768. prefers-reduced-motion is not a width breakpoint. */

/* Allow the homepage hero to overflow the default site-main clipping. */
.site-main:has(.latest-post) {
    overflow-x: visible;
}

.latest-post {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--text-color);
    position: relative;
    overflow: visible;
}

.latest-post-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding: 0 clamp(1.25rem, 2.5vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
    position: relative;
    z-index: 6;
    overflow: visible;
}

.latest-post-top {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

/* Title stack: ray inside title link, row flex so the ornament stays on the title’s first line at tablet/mobile (ISSUES-LIST-CURRENT2 follow-up). */
.latest-post-headline-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    padding-left: 0;
}

.latest-post-title.latest-post-title--with-ray {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: calc(0.4rem * var(--scale));
    min-width: 0;
    padding-left: 0;
    position: relative;
}

.latest-post-title.latest-post-title--with-ray .latest-post-ray-corner.ray-corner--top-left {
    position: relative;
    top: 0;
    left: 0;
    flex-shrink: 0;
    margin-top: 0.22em;
}

.latest-post-title.latest-post-title--with-ray h1 {
    flex: 1 1 auto;
    min-width: 0;
}

    /* tags */
        .latest-post-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.6rem;
            padding-top: calc(0.5rem * var(--scale));
            padding-bottom: calc(0.5rem * var(--scale));
        }

        .latest-post-tag {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border: 1px solid var(--port);
            border-radius: calc(4px * var(--scale));
            background-color: var(--port);
            color: var(--background-color);
            font-family: var(--cm);
            font-size: clamp(12px, calc(16px * var(--scale)), 20px);
            font-weight: calc(625 * var(--scale));
            font-variation-settings: "wght";
            text-decoration: none;
            text-transform: uppercase;
            transition: all 0.2s ease;
        }

        .latest-post-tag:hover,
        .latest-post-tag:focus-visible {
            text-decoration: underline !important;
            text-decoration-style: wavy !important;
            text-decoration-color: var(--tag-hover-color) !important;
            outline: none;
        }
    /* title */
        .latest-post-title {
            display: block;
            color: var(--text-color);
            text-decoration: none;
            text-decoration-color: var(--swiss-coffee);
        }

        .latest-post-title.latest-post-title--with-ray h1 {
            padding-left: 0;
            margin-left: 0;
        }

        .latest-post-title:visited {
            color: var(--text-color);
            text-decoration-color: var(--swiss-coffee);
        }

        .latest-post-title h1 {
            margin: 0;
            font-family: var(--edbl) !important;
            font-style: normal;
            font-size: calc(var(--fontSizeH2) * var(--scale));
            line-height: 95%;
            color: var(--text-color) !important;
        }

        .latest-post-title:hover {
            text-decoration: underline;
            text-decoration-thickness: calc(3px * var(--scale));
            text-decoration-color: var(--swiss-coffee) !important;
        }

.latest-post-subtitle {
    margin: 0;
    font-family: var(--ed) !important;
    font-style: italic;
    font-size: calc(var(--fontSizeH5) * var(--scale));
    line-height: 95%;
    color: var(--text-color);
}
/* takeaway / excerpt*/
.latest-post-excerpt,
.latest-post-paragraphs {
    max-width: 44rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.35;
}

.latest-post-excerpt p,
.latest-post-paragraphs p {
    margin: 0;
}

.latest-post-excerpt .takeaway-card,
.latest-post-paragraphs .takeaway-card {
    position: relative;
    z-index: 1;
}

.latest-post .takeaway-card .takeaway-card-text {
    padding-inline: 0;
}

/* Homepage takeaway: match page surface (not global takeaway-card rgba tint). */
.latest-post .takeaway-card.latest-post-takeaway {
    background-color: var(--background-color);
}

.latest-post-image-link {
    position: relative;
    min-width: 0;
    overflow: visible;
    z-index: 1;
}

/* Give each latest-post card the top-left ray-corner decorator. */
.latest-post-image-figure-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.latest-post-image-figure {
    margin: 0;
    overflow: hidden;
    background: var(--background-color);
}

/* Same element as `.jitter-image` — must stay `display: grid` (see image-jitter.css). Never use flex here:
   flex overrides the grid and lays base + subject out as siblings → ghosting / misaligned frames. */
.latest-post-jitter-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Hero bitmap: one shared cell; both layers fill it identically, then subject transforms = jitter only. */
.latest-post-image-figure .jitter-image {
    min-width: 0;
    min-height: 0;
    place-items: stretch;
}

.latest-post-image-figure .jitter-image__base,
.latest-post-image-figure .jitter-image__subject {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center center;
}

.latest-post-image {
    display: block;
}

.latest-post > .arrow-character-link {
    position: absolute;
    right: clamp(0.75rem, 1.5vw, 1.5rem);
    bottom: clamp(0.75rem, 1.5vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(52px, 5.5vw, 72px);
    height: clamp(52px, 5.5vw, 72px);
    border-radius: 999px;
    background: var(--revolver);
    border: none;
    text-decoration: none;
    z-index: 2;
    transition: transform var(--ease-transition), background-color var(--ease-transition), box-shadow var(--ease-transition);
}

.latest-post > .arrow-character-link .arrow-character {
    font-family: var(--edb);
    font-weight: 700;
    font-size: clamp(34px, 4vw, 48px);
    color: #ffffff;
    line-height: 1;
    transition: color var(--ease-transition);
}

.latest-post > .arrow-character-link:hover,
.latest-post > .arrow-character-link:focus-visible {
    transform: translateX(calc(10px * var(--scale)));
    background: var(--port);
    box-shadow: 0 0 0 calc(2px * var(--scale)) var(--swiss-coffee);
}

.latest-post > .arrow-character-link:hover .arrow-character,
.latest-post > .arrow-character-link:focus-visible .arrow-character {
    color: var(--background-color);
}

.latest-post > .arrow-character-link:active {
    transform: translateX(calc(6px * var(--scale)));
}

.homepage-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: calc(0.8rem * var(--scale));
    padding: calc(3.1vw * var(--scale));
}

.homepage-tag-cloud-tag.latest-post-tag {
    font-size: clamp(14px, calc(19px * var(--scale)), 20px);
    padding: calc(0.42rem * var(--scale)) calc(0.85rem * var(--scale));
    border-radius: calc(6px * var(--scale));
    margin-bottom: 0;
    border-width: calc(1.25px * var(--scale));
}

.homepage-bottom-bar {
    border-top: 1px solid var(--text-color);
    padding: calc(2.5vw * var(--scale)) calc(2.5vw * var(--scale)) 100px;
}

.homepage-bottom-nav {
    display: flex;
    flex-wrap: wrap;
    row-gap: calc(1.2vw * var(--scale));
    column-gap: calc(1.5vw * var(--scale));
    list-style: none;
    margin: 0;
    padding: 0;
}

.homepage-bottom-nav-item {
    display: flex;
    min-width: 0;
}

.homepage-bottom-nav-link {
    display: inline-block;
    line-height: 110%;
    font-size: calc(42px * var(--scale));
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
}

.homepage-bottom-nav-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .latest-post > .arrow-character-link,
    .latest-post > .arrow-character-link .arrow-character {
        transition: none;
    }
}

@media (min-width: 768px) {
    .latest-post {
        display: grid;
        grid-template-columns: minmax(40%, 60%) minmax(40%, 60%);
        column-gap: clamp(1.5rem, 3vw, 3rem);
        align-items: stretch;
    }

    .latest-post-content {
        padding: 0 0 clamp(1rem, 2vw, 1.75rem) clamp(1.5rem, 2.5vw, 3rem);
    }

    .latest-post-top {
        padding-right: clamp(1rem, 1.5vw, 1.75rem);
    }

    /* Excerpt stays within the text column (proportional to grid track, max-width: 44rem base). */
    .latest-post-excerpt,
    .latest-post-paragraphs {
        width: 100%;
        position: relative;
        z-index: 1;
    }

    /* Right column: use full row height; image scales inside with object-fit: contain (see above). */
    .latest-post-image-link {
        display: flex;
        align-items: stretch;
        align-self: stretch;
        height: 100%;
        min-height: 0;
    }

    .latest-post-image-figure-link,
    .latest-post-image-figure,
    .latest-post-jitter-frame {
        height: 100%;
    }

    .latest-post-image-figure-link {
        flex: 1 1 auto;
        display: flex;
        min-height: 0;
    }

    .latest-post-image-figure {
        display: flex;
        flex: 1 1 auto;
        min-height: 100%;
        min-width: 0;
    }

    .latest-post-image-figure > .placeholder {
        flex: 1 1 auto;
        min-height: 100%;
    }

    .latest-post > .arrow-character-link {
        width: 60px;
        height: 60px;
    }

    .latest-post > .arrow-character-link .arrow-character {
        font-size: 40px;
    }

    .homepage-bottom-nav-item {
        flex: 1 1 calc(50% - 8px);
    }
}

@media (min-width: 1024px) {
    .latest-post-content {
        padding: 0 0 clamp(1rem, 1.5vw, 1.75rem) clamp(2rem, 2.5vw, 3rem);
    }

    .latest-post > .arrow-character-link {
        width: clamp(52px, 5.5vw, 72px);
        height: clamp(52px, 5.5vw, 72px);
    }

    .latest-post > .arrow-character-link .arrow-character {
        font-size: clamp(34px, 4vw, 48px);
    }
}

/* Tablet + mobile: minimum 1rem horizontal inset for hero copy (issue: final-latest-post) */
@media (max-width: 1023px) {
    .latest-post-content {
        padding-left: max(1rem, clamp(1rem, 2.5vw, 2.5rem));
        padding-right: max(1rem, clamp(1rem, 2.5vw, 2.5rem));
    }

}

@media (max-width: 767px) {
    .latest-post {
        gap: 0.85rem;
    }

    .latest-post-image-link {
        order: -1;
    }

    .latest-post-content {
        padding: 0 1rem 1rem;
    }

    .latest-post-top {
        gap: 0.5rem;
    }

    .latest-post-tags {
        gap: calc(8px * var(--scale));
    }

    .latest-post-tag {
        padding: calc(0.28rem * var(--scale)) calc(0.54rem * var(--scale));
        font-size: clamp(12px, calc(3.3vw * var(--scale)), 20px);
        line-height: 1.2;
    }

    .latest-post-title h1 {
        font-size: clamp(34px, calc(8.1vw * var(--scale)), 46px);
        line-height: 1;
    }

    .latest-post-subtitle {
        font-size: clamp(20px, calc(5.4vw * var(--scale)), 30px);
        line-height: 1.15;
    }

    .latest-post-excerpt,
    .latest-post-paragraphs {
        width: 100%;
        max-width: none;
        font-size: clamp(16px, calc(4vw * var(--scale)), 18px);
    }

    .latest-post-image-figure {
        aspect-ratio: 16 / 9;
    }

    .latest-post > .arrow-character-link {
        right: 0.75rem;
        bottom: 0.75rem;
        width: 52px;
        height: 52px;
    }

    .latest-post > .arrow-character-link .arrow-character {
        font-size: 34px;
    }

    /* Index homepage: single column; at least 1rem inset vs safe area */
    .site-main main:has(.latest-post) .latest-post-content {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }

    .site-main main:has(.latest-post) .section-header {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .homepage-tag-cloud {
        padding: 30px max(1rem, env(safe-area-inset-left, 0px)) 30px max(1rem, env(safe-area-inset-right, 0px));
        gap: 12px;
    }

    .homepage-tag-cloud-tag.latest-post-tag {
        font-size: clamp(14px, calc(4.1vw * var(--scale)), 18px);
        padding: calc(0.32rem * var(--scale)) calc(0.66rem * var(--scale));
        line-height: 1.22;
    }

    .homepage-bottom-bar {
        padding: 30px max(1rem, env(safe-area-inset-left, 0px)) 100px max(1rem, env(safe-area-inset-right, 0px));
    }

    .homepage-bottom-nav {
        gap: 16px;
        row-gap: 18px;
    }

    .homepage-bottom-nav-item {
        flex: 1 1 calc(50% - 8px);
    }

    .homepage-bottom-nav-link {
        font-size: clamp(20px, calc(5.4vw * var(--scale)), 26px);
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.12;
    }
}

/* Small-mobile: keep index section headers full-bleed vs section-header.css 30px/18px. */
@media (max-width: 479px) {
    .site-main main:has(.latest-post) .section-header {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }
}

/* Homepage immersive: runway + sticky card per latest post */
body.homepage-immersive .latest-post-sticky-wrap {
    min-height: 135vh;
    position: relative;
    box-sizing: border-box;
}

body.homepage-immersive .latest-post-sticky-wrap .latest-post {
    position: sticky;
    top: max(env(safe-area-inset-top, 0px), calc(58px * var(--imgScale)));
    align-self: start;
}

@media (max-width: 767px) {
    body.homepage-immersive .latest-post-sticky-wrap {
        min-height: 125vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.homepage-immersive .latest-post-sticky-wrap {
        min-height: 0;
    }

    body.homepage-immersive .latest-post-sticky-wrap .latest-post {
        position: relative;
        top: auto;
    }
}
