/* The Earth Farer — Trail Running Editorial v2.5.0 */
body.tef-trail-running-editorial-meta-page,
body.tef-trail-running-editorial-meta-page #page,
body.tef-trail-running-editorial-meta-page .site,
body.tef-trail-running-editorial-meta-page .site-content,
body.tef-trail-running-editorial-meta-page .content-area {
    background: #fff !important;
}

body.tef-trail-running-editorial-meta-page .tef-trail-editorial-page-v1,
body.tef-trail-running-editorial-meta-page .tef-trail-editorial-article-v1 {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    clear: both !important;
    overflow: visible !important;
}

body.tef-trail-running-editorial-meta-page .site-content > .ast-container:has(> .tef-trail-editorial-page-v1),
body.tef-trail-running-editorial-meta-page #content > .ast-container:has(> .tef-trail-editorial-page-v1) {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.tef-trail-running-editorial-meta-page .tef-trail-editorial-page-v1 > .tef-trail-editorial-article-v1 > .tef-trail-hero-v1 {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

.tef-trail-editorial-article-v1,
.tef-trail-editorial-article-v1 * {
    box-sizing: border-box;
}

.tef-trail-editorial-article-v1 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #26374a;
}

.tef-trail-shell-v1 {
    width: min(1180px, calc(100% - 40px));
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

/* HERO — intentionally mirrors the finished Trekking editorial hero. */
.tef-trail-hero-v1 {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #15394a, #1d5669);
}

.tef-trail-hero-image-v1 {
    position: absolute;
    inset: 0;
}

.tef-trail-hero-image-v1 img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.tef-trail-hero-overlay-v1 {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 31, 42, .86) 0%, rgba(7, 31, 42, .70) 38%, rgba(7, 31, 42, .36) 72%, rgba(7, 31, 42, .16) 100%),
        linear-gradient(to top, rgba(7, 27, 35, .70) 0%, rgba(7, 27, 35, .28) 56%, rgba(7, 27, 35, .16) 100%);
}

.tef-trail-hero-content-v1 {
    position: relative;
    z-index: 2;
    padding: 150px 0 54px;
}

.tef-trail-kicker-v1 {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
    color: rgba(255,255,255,.96);
}

.tef-trail-hero-v1 h1 {
    max-width: 960px;
    margin: 0;
    color: #fff !important;
    font-size: clamp(42px, 5.1vw, 72px);
    line-height: 1.01;
    letter-spacing: -.04em;
    font-weight: 780;
    text-wrap: balance;
}

.tef-trail-meta-v1 {
    margin-top: 18px;
    color: rgba(255,255,255,.91);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 650;
}

.tef-trail-lead-v1 {
    max-width: 850px;
    margin-top: 24px;
    color: rgba(255,255,255,.94);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16.5px;
    line-height: 1.68;
}

/* Keep the editable hero introduction on the same standard editorial type
   regardless of formatting carried in from pasted content. */
.tef-trail-lead-v1,
.tef-trail-lead-v1 p,
.tef-trail-lead-v1 div,
.tef-trail-lead-v1 span,
.tef-trail-lead-v1 li,
.tef-trail-lead-v1 a,
.tef-trail-lead-v1 strong,
.tef-trail-lead-v1 b,
.tef-trail-lead-v1 em,
.tef-trail-lead-v1 i {
    color: inherit !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-size: 16.5px !important;
    line-height: 1.68 !important;
}

.tef-trail-lead-v1 > *:first-child { margin-top: 0; }
.tef-trail-lead-v1 > *:last-child { margin-bottom: 0; }
.tef-trail-lead-v1 p { margin: 0 0 12px; }
.tef-trail-lead-v1 a { text-underline-offset: 3px; }

/* MONTH-BY-MONTH ARTICLE BODY */
.tef-trail-main-v1 {
    width: 100% !important;
    max-width: none !important;
    padding: 46px 0 58px;
    background: #fff;
}

.tef-trail-month-v1 {
    padding: 0 0 52px;
}

.tef-trail-month-v1 + .tef-trail-month-v1 {
    padding-top: 2px;
}

.tef-trail-month-v1 > h2 {
    margin: 0 0 30px;
    color: #0d2443;
    font-size: 36px;
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 760;
    text-align: center;
}

.tef-trail-race-grid-v1 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
}

.tef-trail-race-grid-v1.is-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 576px;
    margin-left: auto;
    margin-right: auto;
}

.tef-trail-race-card-v1 {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dfe8e5;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(18, 50, 42, .05);
}

.tef-trail-race-image-v1 {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background: #eef2f2;
}

.tef-trail-race-image-v1 img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tef-trail-race-body-v1 {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 26px 26px 24px;
}

.tef-trail-race-body-v1 h3 {
    margin: 0;
    color: #0d2443;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -.025em;
    font-weight: 760;
}

.tef-trail-for-v1 {
    margin: 9px 0 17px;
    color: #334f69;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 600;
}

.tef-trail-race-copy-v1,
.tef-trail-extra-copy-v1 {
    color: #364451;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16.5px;
    line-height: 1.68;
}

.tef-trail-race-copy-v1,
.tef-trail-race-copy-v1 p,
.tef-trail-race-copy-v1 div,
.tef-trail-race-copy-v1 span,
.tef-trail-race-copy-v1 li,
.tef-trail-race-copy-v1 a,
.tef-trail-race-copy-v1 strong,
.tef-trail-race-copy-v1 b,
.tef-trail-race-copy-v1 em,
.tef-trail-race-copy-v1 i,
.tef-trail-extra-copy-v1,
.tef-trail-extra-copy-v1 p,
.tef-trail-extra-copy-v1 div,
.tef-trail-extra-copy-v1 span,
.tef-trail-extra-copy-v1 li,
.tef-trail-extra-copy-v1 a,
.tef-trail-extra-copy-v1 strong,
.tef-trail-extra-copy-v1 b,
.tef-trail-extra-copy-v1 em,
.tef-trail-extra-copy-v1 i {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-size: 16.5px !important;
    line-height: 1.68 !important;
}

.tef-trail-race-copy-v1 p,
.tef-trail-extra-copy-v1 p { margin: 0 0 12px; }
.tef-trail-race-copy-v1 > *:first-child,
.tef-trail-extra-copy-v1 > *:first-child { margin-top: 0; }
.tef-trail-race-copy-v1 > *:last-child,
.tef-trail-extra-copy-v1 > *:last-child { margin-bottom: 0; }
.tef-trail-race-copy-v1 a,
.tef-trail-extra-copy-v1 a {
    color: #087f9a;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Distances / Terrain — same visual language as Trekking Allow / Skip if. */
.tef-trail-facts-v1 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: calc(100% + 52px);
    margin: auto -26px -24px;
    padding-top: 20px;
}

.tef-trail-fact-v1 {
    display: grid;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    padding: 15px 16px;
    border-top: 1px solid #dceff1;
    border-bottom: 1px solid #dceff1;
    background: #edf7f8;
}

.tef-trail-fact-v1:first-child {
    border-left: 1px solid #dceff1;
    border-radius: 9px 0 0 9px;
}

.tef-trail-fact-v1:last-child {
    border-right: 1px solid #dceff1;
    border-left: 1px solid #bedfe4;
    border-radius: 0 9px 9px 0;
}

.tef-trail-fact-icon-v1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #117d90;
}

.tef-trail-fact-icon-v1 svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tef-trail-fact-v1 strong,
.tef-trail-fact-v1 span:not(.tef-trail-fact-icon-v1) {
    display: block;
}

.tef-trail-fact-v1 strong {
    margin: 0 0 2px;
    color: #183246;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
}

.tef-trail-fact-v1 span:not(.tef-trail-fact-icon-v1) {
    color: #354a58;
    font-size: 15.2px;
    line-height: 1.4;
}

/* Additional Sections — matches the Trekking article treatment. */
.tef-trail-extra-section-v1 {
    width: 100%;
    max-width: none;
    padding: 0 0 30px;
}

.tef-trail-extra-section-v1:last-child {
    padding-bottom: 0;
}

.tef-trail-extra-section-v1 h2 {
    margin: 0 0 18px;
    color: #0d2443;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 760;
}

@media (max-width: 980px) {
    .tef-trail-shell-v1 {
        width: min(100% - 40px, 1180px);
    }
    .tef-trail-hero-v1 {
        min-height: 610px;
    }
    .tef-trail-hero-content-v1 {
        padding-top: 130px;
    }
    .tef-trail-race-grid-v1 {
        gap: 22px;
    }
    .tef-trail-race-body-v1 {
        padding: 22px 20px 20px;
    }
    .tef-trail-facts-v1 {
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: -20px;
    }
    .tef-trail-race-body-v1 h3 {
        font-size: 24px;
    }
    .tef-trail-month-v1 > h2,
    .tef-trail-extra-section-v1 h2 {
        font-size: 30px;
    }
}

@media (max-width: 767px) {
    .tef-trail-shell-v1 {
        width: min(100% - 28px, 1180px);
    }
    .tef-trail-hero-v1 {
        min-height: 560px;
    }
    .tef-trail-hero-content-v1 {
        padding: 118px 0 38px;
    }
    .tef-trail-hero-v1 h1 {
        font-size: 42px;
        line-height: 1.02;
    }
    .tef-trail-lead-v1 {
        font-size: 16.5px;
        line-height: 1.68;
    }
    .tef-trail-main-v1 {
        padding: 34px 0 48px;
    }
    .tef-trail-month-v1 {
        padding-bottom: 44px;
    }
    .tef-trail-race-grid-v1,
    .tef-trail-race-grid-v1.is-single {
        grid-template-columns: 1fr;
        max-width: none;
    }
    .tef-trail-month-v1 > h2,
    .tef-trail-extra-section-v1 h2 {
        font-size: 29px;
    }
}

@media (max-width: 540px) {
    .tef-trail-hero-v1 h1 {
        font-size: 38px;
    }
    .tef-trail-facts-v1 {
        grid-template-columns: 1fr;
    }
    .tef-trail-fact-v1:first-child {
        border-right: 1px solid #dceff1;
        border-radius: 9px 9px 0 0;
    }
    .tef-trail-fact-v1:last-child {
        border-top: 0;
        border-left: 1px solid #dceff1;
        border-radius: 0 0 9px 9px;
    }
}
