/*
 * Bespoke Selections - Journal (listing page and story pages)
 * listing: banner / "Stories we tell" intro / stories on the left, categories on the right
 * story:   narrow reading column / image / body / next story
 */

.journal-page {
    /* same left edge as "THE EDIT" on Curated Collections
       (theme container: 30px gutter + 2% row inset, centred above 1600px) */
    --journal-edge: calc(30px + (min(100vw, 1600px) - 60px) * 0.02 + max(0px, (100vw - 1600px) / 2));
    --journal-line: #4B4E53;
    color: #4B4E53;
}

/* ---------- listing ---------- */

/* the hero is the theme's .home-section, the same as on the other pages */

.journal-intro {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2.1fr);
    gap: 24px 0;
    /* title top-aligned with the text and the same distance below the banner as "THE EDIT" */
    align-items: start;
    padding: 60px var(--journal-edge) clamp(36px, 3.4vw, 60px);
    border-bottom: 1px solid var(--journal-line);
}

.journal-intro-text {
    max-width: calc(620px + clamp(24px, 3vw, 56px));
    padding-left: clamp(24px, 3vw, 56px);
}

.journal-intro-text p {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.6;
}

.journal-intro-text p:last-child {
    margin-bottom: 0;
}

/* stories + categories */
.journal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(240px, 22vw, 340px);
    padding: 0 var(--journal-edge);
}

.journal-posts {
    padding: clamp(16px, 1.6vw, 28px) clamp(24px, 3vw, 56px) clamp(36px, 3vw, 56px) 0;
    border-right: 1px solid var(--journal-line);
}

.journal-post {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(24px, 3.4vw, 64px);
    align-items: center;
    padding: clamp(20px, 1.8vw, 32px) 0;
}

/* a line between stories that are showing (category filter hides the rest) */
.journal-post:not([hidden]) ~ .journal-post:not([hidden]) {
    border-top: 1px solid var(--journal-line);
}

.journal-post[hidden] {
    display: none;
}

.journal-post-image {
    display: block;
    aspect-ratio: 16 / 9;
    background-color: #DCDAD4;   /* shows until the photo is added */
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
}

a.journal-post-image:hover {
    opacity: 0.88;
}

.journal-post-title {
    margin: 0;
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(20px, 1.6vw, 27px);
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4B4E53;
}

.journal-post-title a {
    color: inherit;
    text-decoration: none;
}

.journal-post-title a:hover {
    color: #8A7E2D;
}

.journal-post-sub {
    margin: 4px 0 18px;
    font-family: var(--font-headline);
    font-size: clamp(16px, 1.1vw, 18px);
    line-height: 1.35;
    color: #6E7176;
}

.journal-post-excerpt {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.6;
}

.journal-more {
    display: flex;
    justify-content: flex-end;
}

.journal-button {
    display: inline-block;
    padding: 7px 30px 7px 22px;
    border: 2px solid #000;
    background-color: #7F7D4F;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background-color 0.25s ease;
}

.journal-button:hover,
.journal-button:focus-visible {
    background-color: #4B4E53;
    color: #fff;
    text-decoration: none;
}

/* categories */
.journal-categories {
    padding: clamp(28px, 2.4vw, 44px) 0 40px clamp(24px, 2.6vw, 48px);
}

.journal-categories h2 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4B4E53;
}

.journal-categories ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.journal-categories li {
    border-bottom: 1px solid var(--journal-line);
}

.journal-categories a {
    display: block;
    padding: 14px 0 12px;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4B4E53;
    text-decoration: none;
}

.journal-categories a::before {
    content: "\2022";
    margin-right: 12px;
}

.journal-categories a:hover,
.journal-categories a[aria-current="true"] {
    color: #8A7E2D;
}

.journal-categories a[aria-current="true"] {
    font-weight: 700;
}

.journal-empty {
    margin: 32px 0;
    font-size: 16px;
}

/* ---------- story page ---------- */

.story {
    max-width: 780px;
    margin: 0 auto;
    padding: 150px 24px 0;
}

.story-meta {
    margin: 0 0 30px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.story-meta a {
    color: inherit;
    text-decoration: none;
}

.story-meta a:hover {
    color: #8A7E2D;
}

.story h1 {
    margin: 0;
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(30px, 2.8vw, 44px);
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #8A7E2D;
}

.story-sub {
    margin: 6px 0 22px;
    font-family: var(--font-headline);
    font-size: clamp(18px, 1.3vw, 21px);
    line-height: 1.35;
    color: #6E7176;
}

.story-lead {
    margin: 0 0 28px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.6;
}

.story-figure {
    margin: 0 -24px 40px;   /* a little wider than the text */
    aspect-ratio: 16 / 9;
    background-color: #DCDAD4;
    background-size: cover;
    background-position: center;
}

.story-body p {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.5;
}

.story-body a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #8A7E2D;
    text-underline-offset: 3px;
}

.story-body a:hover {
    color: #8A7E2D;
}

/* the rest of what the admin text editor can add */
.story-body h2,
.story-body h3 {
    margin: 40px 0 16px;
    font-family: var(--font-headline);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4B4E53;
}

.story-body h2 {
    font-size: clamp(22px, 1.7vw, 28px);
}

.story-body h3 {
    font-size: clamp(18px, 1.3vw, 21px);
}

.story-body ul,
.story-body ol {
    margin: 0 0 20px;
    padding-left: 1.4em;
    font-size: 16px;
    line-height: 1.5;
}

.story-body li p {
    margin: 0;
}

.story-body blockquote {
    margin: 36px 0;
    padding: 4px 0 4px 24px;
    border-left: 2px solid #7F7D4F;
    font-family: var(--font-headline);
    font-size: clamp(18px, 1.4vw, 22px);
}

.story-body blockquote p {
    font-size: inherit;
    line-height: 1.45;
}

.story-body blockquote p:last-child {
    margin-bottom: 0;
}

.story-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 36px 0;
}

.story-body hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--journal-line);
}

/* next story */
.story-next {
    max-width: 1100px;
    margin: clamp(48px, 4vw, 72px) auto 0;
    padding: clamp(28px, 2.6vw, 44px) 24px clamp(48px, 4vw, 72px);
    border-top: 1px solid var(--journal-line);
}

.story-next .journal-post {
    padding: 0;
}

/* a little more air between the title and the text under it */
.story-next .journal-post-sub {
    margin-top: 18px;
}

.story-next-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- tablets ---------- */
@media (max-width: 991.98px) {
    .journal-page {
        --journal-edge: 30px;
    }

    .journal-intro {
        grid-template-columns: minmax(0, 1fr);
    }

    .journal-intro-text {
        padding-left: 0;
    }

    /* categories move above the stories as a row */
    .journal-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .journal-categories {
        order: -1;
        padding: 24px 0 20px;
        border-bottom: 1px solid var(--journal-line);
    }

    .journal-categories ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 28px;
    }

    .journal-categories li {
        border-bottom: none;
    }

    .journal-categories a {
        padding: 8px 0;
    }

    .journal-categories a::before {
        margin-right: 8px;
    }

    .journal-posts {
        padding-right: 0;
        border-right: none;
    }
}

/* ---------- phones ---------- */
@media (max-width: 767.98px) {
    .journal-post {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 28px 0;
    }

    .story {
        padding-top: 120px;
    }

    .story-figure {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 575.98px) {
    .journal-more {
        justify-content: stretch;
    }

    .journal-more .journal-button {
        width: 100%;
        text-align: center;
    }
}
