/*
 * Ethos Prod — Single Project layout
 * Grid-based layout: spacing is controlled by the parent grid gap,
 * not by margins on each flexible-content block.
 */

.single-projects main {
    overflow: clip;
}

.ethos-project-content {
    background: #fff;
    padding: clamp(44px, 5vw, 82px) 0 clamp(64px, 7vw, 112px);
}

.ethos-project-flow {
    --project-gutter: clamp(24px, 4vw, 72px);
    --project-row-gap: clamp(34px, 4vw, 64px);
    width: min(100%, 1800px);
    margin: 0 auto;
    padding-inline: var(--project-gutter);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(18px, 2vw, 34px);
    row-gap: var(--project-row-gap);
    align-items: start;
}

/* The parent grid owns vertical rhythm. Individual blocks never add spacing. */
.ethos-project-item,
.ethos-project-block,
.ethos-project-image,
.ethos-project-split,
.ethos-project-legacy,
.ethos-project-item figure {
    margin: 0 !important;
}

.ethos-project-item {
    min-width: 0;
}

/* ---------- Text ---------- */
.ethos-project-item--text {
    grid-column: 2 / span 9;
}

.ethos-project-copy,
.ethos-project-richtext,
.ethos-project-legacy {
    width: 100%;
    max-width: 1080px;
    color: #292929;
    font-size: clamp(18px, 1.25vw, 22px);
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: -0.01em;
}

.ethos-project-copy p,
.ethos-project-richtext p,
.ethos-project-legacy p {
    margin: 0 0 1.05em !important;
}

.ethos-project-copy p:last-child,
.ethos-project-richtext p:last-child,
.ethos-project-legacy p:last-child {
    margin-bottom: 0 !important;
}

.ethos-project-copy > p:first-child,
.ethos-project-richtext > p:first-child {
    font-family: "Playfair Display", serif;
    font-size: clamp(26px, 2.35vw, 40px);
    line-height: 1.38;
    color: #111;
    letter-spacing: -0.025em;
}

.ethos-project-copy h2,
.ethos-project-copy h3,
.ethos-project-richtext h2,
.ethos-project-richtext h3,
.ethos-project-legacy h2,
.ethos-project-legacy h3 {
    font-family: "Playfair Display", serif;
    color: #111;
    font-weight: 400;
    letter-spacing: -0.035em;
}

.ethos-project-copy h2,
.ethos-project-richtext h2,
.ethos-project-legacy h2 {
    margin: 1.15em 0 .45em !important;
    font-size: clamp(42px, 5vw, 76px);
    line-height: 1;
}

.ethos-project-copy h3,
.ethos-project-richtext h3,
.ethos-project-legacy h3 {
    margin: 1.1em 0 .45em !important;
    font-size: clamp(30px, 3.5vw, 50px);
    line-height: 1.05;
}

.ethos-project-copy a,
.ethos-project-richtext a,
.ethos-project-legacy a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.ethos-project-copy ul,
.ethos-project-copy ol,
.ethos-project-richtext ul,
.ethos-project-richtext ol,
.ethos-project-legacy ul,
.ethos-project-legacy ol {
    margin: .9em 0 1.15em !important;
    padding-left: 1.4em !important;
}

.ethos-project-copy ul,
.ethos-project-richtext ul,
.ethos-project-legacy ul {
    list-style: disc;
}

.ethos-project-copy ol,
.ethos-project-richtext ol,
.ethos-project-legacy ol {
    list-style: decimal;
}

/* Direct structural wrappers pasted from the WYSIWYG must not create their own
   page-level width, height or vertical spacing. Typographic styles inside them stay intact. */
.ethos-project-copy > div,
.ethos-project-copy > section,
.ethos-project-copy > article,
.ethos-project-richtext > div,
.ethos-project-richtext > section,
.ethos-project-richtext > article,
.ethos-project-legacy > div,
.ethos-project-legacy > section,
.ethos-project-legacy > article {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    position: static !important;
    transform: none !important;
}

/*
 * The existing editor content uses blockquote as a structural wrapper.
 * Treat it as a transparent container on project pages only.
 * This also neutralizes inline/theme flex/min-height/quote decoration.
 */
.ethos-project-copy blockquote,
.ethos-project-richtext blockquote,
.ethos-project-legacy blockquote,
.ethos-project-copy blockquote.wp-block-quote,
.ethos-project-richtext blockquote.wp-block-quote,
.ethos-project-legacy blockquote.wp-block-quote {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;
    clear: none !important;
    font: inherit !important;
    color: inherit !important;
    text-align: inherit !important;
    align-items: initial !important;
    align-content: initial !important;
    justify-content: initial !important;
    gap: 0 !important;
}

.ethos-project-copy blockquote::before,
.ethos-project-copy blockquote::after,
.ethos-project-richtext blockquote::before,
.ethos-project-richtext blockquote::after,
.ethos-project-legacy blockquote::before,
.ethos-project-legacy blockquote::after {
    display: none !important;
    content: none !important;
}

.ethos-project-copy blockquote > :first-child,
.ethos-project-richtext blockquote > :first-child,
.ethos-project-legacy blockquote > :first-child {
    margin-top: 0 !important;
}

.ethos-project-copy blockquote > :last-child,
.ethos-project-richtext blockquote > :last-child,
.ethos-project-legacy blockquote > :last-child {
    margin-bottom: 0 !important;
}

/* Remove editor-generated empty lines so they cannot become visual gaps. */
.ethos-project-copy p:empty,
.ethos-project-richtext p:empty,
.ethos-project-legacy p:empty,
.ethos-project-copy blockquote:empty,
.ethos-project-richtext blockquote:empty,
.ethos-project-legacy blockquote:empty {
    display: none !important;
}

/* ---------- Single image ---------- */
.ethos-project-item--image {
    grid-column: 1 / -1;
}

.ethos-project-image {
    width: 100%;
}

.ethos-project-image--small {
    width: min(100%, 620px);
}

.ethos-project-image--medium {
    width: min(100%, 940px);
}

.ethos-project-image--wide {
    width: 100%;
}

.ethos-project-image--left {
    margin-right: auto !important;
}

.ethos-project-image--center {
    margin-inline: auto !important;
}

.ethos-project-image--right {
    margin-left: auto !important;
}

.ethos-project-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 860px;
    object-fit: cover;
}

.ethos-project-caption {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.55;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: #7d7d7d;
}

/* ---------- Text + image ---------- */
.ethos-project-item--split {
    grid-column: 1 / -1;
}

.ethos-project-split {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: clamp(32px, 5vw, 88px);
    align-items: center;
}

.ethos-project-split--image-large {
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
}

.ethos-project-split--image-small {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .72fr);
}

.ethos-project-split--image-left .ethos-project-split__media { order: 1; }
.ethos-project-split--image-left .ethos-project-split__text { order: 2; }
.ethos-project-split--image-right .ethos-project-split__text { order: 1; }
.ethos-project-split--image-right .ethos-project-split__media { order: 2; }

.ethos-project-split__text,
.ethos-project-split__media {
    min-width: 0;
}

.ethos-project-split__text .ethos-project-copy,
.ethos-project-split__text .ethos-project-richtext {
    max-width: 700px;
}

.ethos-project-split__text .ethos-project-copy > p:first-child,
.ethos-project-split__text .ethos-project-richtext > p:first-child {
    font-size: clamp(22px, 1.75vw, 30px);
}

.ethos-project-split__media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 760px;
    object-fit: cover;
}

/* ---------- Legacy story ---------- */
.ethos-project-item--legacy {
    grid-column: 2 / span 9;
}

.ethos-project-legacy figure {
    width: min(100%, 980px);
    margin: 32px 0 !important;
}

.ethos-project-legacy img {
    max-width: 100%;
    height: auto;
}

/* ---------- References ---------- */
.ethos-ref-content p,
.ethos-ref-content li {
    margin-bottom: .7em;
}

.ethos-ref-content a {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
    .ethos-project-flow {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        --project-row-gap: clamp(30px, 5vw, 52px);
    }

    .ethos-project-item--text,
    .ethos-project-item--legacy {
        grid-column: 1 / -1;
    }

    .ethos-project-split,
    .ethos-project-split--image-large,
    .ethos-project-split--image-small {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .ethos-project-split .ethos-project-split__media,
    .ethos-project-split .ethos-project-split__text {
        order: initial;
    }

    .ethos-project-split__media {
        width: min(100%, 760px);
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    .ethos-project-content {
        padding: 36px 0 58px;
    }

    .ethos-project-flow {
        --project-gutter: 20px;
        --project-row-gap: 30px;
        display: flex;
        flex-direction: column;
        gap: var(--project-row-gap);
    }

    .ethos-project-copy,
    .ethos-project-richtext,
    .ethos-project-legacy {
        font-size: 18px;
        line-height: 1.68;
    }

    .ethos-project-copy > p:first-child,
    .ethos-project-richtext > p:first-child {
        font-size: 25px;
        line-height: 1.4;
    }

    .ethos-project-copy h2,
    .ethos-project-richtext h2,
    .ethos-project-legacy h2 {
        font-size: 40px;
    }

    .ethos-project-copy h3,
    .ethos-project-richtext h3,
    .ethos-project-legacy h3 {
        font-size: 31px;
    }

    .ethos-project-image img,
    .ethos-project-split__media img {
        max-height: none;
    }
}
