/*
 * BuyerX Peninsula Guide: V3 editorial layout.
 * Loaded only on pages using the "Peninsula Guide" template.
 * Every rule is scoped under .bxpg so the rest of the site is unaffected.
 */

.bxpg {
    --bxpg-deep: #112e34;
    --bxpg-deep-2: #194549;
    --bxpg-paper: #f5f2ea;
    --bxpg-card: #fffdf8;
    --bxpg-bar: #edeadd;
    --bxpg-ink: #1b3435;
    --bxpg-body: #3a5654;
    --bxpg-muted: #5d6f6a;
    --bxpg-line: #d8dfd6;
    --bxpg-accent: #126a6a;
    --bxpg-gold-text: #8a5f3c;      /* gold for text on light backgrounds (4.6:1 or better) */
    --bxpg-gold-light: #e6c5a2;     /* gold for text on the dark hero */
    --bxpg-gold-fill: #e1bd8f;
    --bxpg-hero-text: #c9d7d0;
    --bxpg-serif: Georgia, 'Times New Roman', serif;
    --bxpg-header-offset: 120px;    /* space for the site's fixed header */

    display: block;
    background: var(--bxpg-paper);
    color: var(--bxpg-body);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: normal;
}

.bxpg *,
.bxpg *::before,
.bxpg *::after {
    box-sizing: border-box;
}

.bxpg h1,
.bxpg h2,
.bxpg h3 {
    font-family: var(--bxpg-serif);
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--bxpg-ink);
    overflow-wrap: break-word;
    text-transform: none;
}

.bxpg a:focus-visible,
.bxpg summary:focus-visible {
    outline: 2px solid var(--bxpg-accent);
    outline-offset: 3px;
}

.bxpg-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.bxpg-eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bxpg-gold-text);
}

.bxpg-eyebrow--light {
    color: var(--bxpg-gold-light);
}

/* Hero. Top padding clears the theme's header, which overlays the page top. */
.bxpg-hero {
    background: var(--bxpg-deep);
    color: #fff;
    overflow: hidden;
}

.bxpg-hero-inner {
    display: grid;
    grid-template-columns: 58% 42%;
    min-height: 560px;
}

.bxpg-hero-copy {
    padding: calc(var(--bxpg-header-offset) + 40px) 52px 64px 0;
    align-self: center;
}

.bxpg .bxpg-hero h1 {
    color: #faf9f2;
    font-size: clamp(44px, 4.5vw, 71px);
    line-height: 1.08;
    margin: 20px 0;
}

.bxpg-hero-intro {
    max-width: 605px;
    margin: 0;
    color: var(--bxpg-hero-text);
    font-size: 17px;
    line-height: 1.8;
}

.bxpg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 26px;
}

.bxpg-meta span {
    font-size: 12px;
    color: var(--bxpg-hero-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bxpg-hero-art {
    position: relative;
    overflow: hidden;
    min-height: 320px;
}

.bxpg-hero-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/*
 * Photo hero (a featured image is set): the photo fills the whole hero, behind the
 * menu and out to the right edge. Its height follows the photo's shape, so on
 * desktop the photo is shown whole. A shade on the left keeps the copy readable.
 */
.bxpg-hero {
    position: relative;
}

.bxpg-hero-inner--photo {
    min-height: max(560px, min(52.5vw, 860px));
}

.bxpg-hero-copy {
    position: relative;
    z-index: 1;
}

.bxpg-hero-art--photo {
    position: absolute;
    inset: 0;
    min-height: 0;
}

.bxpg-hero-art--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(17, 46, 52, 0.55) 0, rgba(17, 46, 52, 0) 160px),
        linear-gradient(90deg, rgba(17, 46, 52, 0.94) 0%, rgba(17, 46, 52, 0.82) 38%, rgba(17, 46, 52, 0.25) 62%, rgba(17, 46, 52, 0) 78%);
}

/* Guide bar: back to the hub and across to the other article. */
.bxpg-bar {
    background: var(--bxpg-bar);
    border-bottom: 1px solid #dad8cb;
}

.bxpg-bar-inner {
    min-height: 64px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.bxpg-bar a {
    color: #285b55;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.bxpg-bar a:hover {
    color: var(--bxpg-gold-text);
}

/* Article frame: contents on the left, story on the right. */
.bxpg-frame {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 75px;
    align-items: start;
    padding-top: 62px;
    padding-bottom: 97px;
}

.bxpg-toc {
    position: sticky;
    top: var(--bxpg-header-offset);
    max-height: calc(100vh - var(--bxpg-header-offset) - 20px);
    overflow: auto;
}

.bxpg-toc summary {
    list-style: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bxpg-gold-text);
    margin-bottom: 14px;
}

.bxpg-toc summary::-webkit-details-marker {
    display: none;
}

.bxpg-toc a {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid #e0e3db;
    color: var(--bxpg-muted);
    font-size: 13px;
    line-height: 1.55;
    text-decoration: none;
}

.bxpg-toc a:hover {
    color: var(--bxpg-accent);
}

.bxpg-toc a span {
    font-family: var(--bxpg-serif);
    color: var(--bxpg-gold-text);
}

.bxpg-article {
    min-width: 0;
    max-width: 890px;
}

.bxpg-lede {
    border-bottom: 1px solid var(--bxpg-line);
    padding-bottom: 26px;
}

.bxpg .bxpg-lede p {
    font-family: var(--bxpg-serif);
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.45;
    color: #224b4a;
}

/* Story sections, one per H2. */
.bxpg-story {
    padding: 50px 0 48px;
    border-bottom: 1px solid var(--bxpg-line);
}

.bxpg-story h2 {
    font-size: clamp(30px, 3.25vw, 46px);
    line-height: 1.17;
    max-width: 790px;
    margin: 12px 0 23px;
    scroll-margin-top: calc(var(--bxpg-header-offset) + 10px);
}

.bxpg-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bxpg-kicker span {
    font: italic 23px var(--bxpg-serif);
    color: var(--bxpg-gold-text);
}

.bxpg-kicker i {
    width: 28px;
    height: 1px;
    background: #bcb6a7;
}

/* Body copy. The theme resets margins and list bullets site-wide, so they are restored here. */
.bxpg-copy {
    color: var(--bxpg-body);
    font-size: 16px;
    line-height: 1.85;
}

.bxpg-copy p {
    margin: 0 0 17px;
}

.bxpg-copy ul,
.bxpg-copy ol {
    margin: 14px 0 23px;
    padding-left: 22px;
}

.bxpg-copy ul {
    list-style: disc;
}

.bxpg-copy ol {
    list-style: decimal;
}

.bxpg-copy li {
    margin: 12px 0;
    padding-left: 5px;
}

.bxpg-copy strong {
    color: #183d3f;
}

.bxpg-copy a {
    color: var(--bxpg-accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.bxpg-copy h3 {
    font-size: 26px;
    line-height: 1.25;
    margin: 28px 0 10px;
}

.bxpg-copy blockquote {
    margin: 24px 0;
    padding: 18px 24px;
    background: #e5eae2;
    border-left: 3px solid #b58963;
}

/* Tables scroll sideways inside their own box on small screens. */
.bxpg-copy table {
    display: block;
    width: 100%;
    overflow-x: auto;
    table-layout: auto;
    border-collapse: collapse;
    margin: 23px 0;
    font-size: 14px;
    line-height: 1.6;
}

.bxpg-copy th,
.bxpg-copy td {
    min-width: 140px;
    padding: 14px;
    border-bottom: 1px solid #d1dcd5;
    text-align: left;
    vertical-align: top;
}

.bxpg-copy th {
    background: #dce5da;
    color: #1d5654;
    font-weight: 700;
}

/* The next-step section is shown as a dark call-to-action panel. */
.bxpg-story--cta {
    background: var(--bxpg-deep);
    padding: 45px;
    margin: 40px 0 0;
    border-bottom: 0;
}

.bxpg-story--cta h2,
.bxpg-story--cta .bxpg-copy strong {
    color: #fff;
}

.bxpg-story--cta .bxpg-copy {
    color: var(--bxpg-hero-text);
}

.bxpg-story--cta .bxpg-copy a {
    color: var(--bxpg-gold-light);
}

.bxpg-story--cta .bxpg-kicker span {
    color: var(--bxpg-gold-light);
}

/* Hub: one card per child page. */
.bxpg-hub {
    padding-top: 72px;
    padding-bottom: 97px;
}

.bxpg-hub-intro {
    max-width: 760px;
    margin-bottom: 40px;
}

.bxpg-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 23px;
}

.bxpg-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    padding: 39px;
    background: var(--bxpg-card);
    border: 1px solid #d7ddd6;
    color: var(--bxpg-ink);
    text-decoration: none;
    transition: transform 0.22s, box-shadow 0.22s;
}

.bxpg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 75px rgba(17, 46, 52, 0.09);
}

.bxpg-card--dark {
    background: var(--bxpg-deep-2);
    border-color: var(--bxpg-deep-2);
    color: #fff;
}

.bxpg .bxpg-card h2 {
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1.13;
    margin: 34px 0 16px;
    color: inherit;
}

.bxpg-card p {
    margin: 0;
    max-width: 420px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--bxpg-muted);
}

.bxpg-card--dark p {
    color: var(--bxpg-hero-text);
}

.bxpg-card-n {
    font: italic 27px var(--bxpg-serif);
    color: var(--bxpg-gold-text);
}

.bxpg-card--dark .bxpg-card-n {
    color: var(--bxpg-gold-light);
}

.bxpg-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 21px;
    border-top: 1px solid rgba(183, 204, 192, 0.55);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bxpg-card-bottom b {
    font-size: 26px;
}

@media (max-width: 1080px) {
    .bxpg-frame {
        grid-template-columns: 205px minmax(0, 1fr);
        gap: 36px;
    }
}

@media (max-width: 760px) {
    .bxpg-shell {
        padding-left: 20px;
        padding-right: 20px;
    }

    .bxpg-hero-inner {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .bxpg-hero-copy {
        padding: calc(var(--bxpg-header-offset) + 30px) 0 40px;
    }

    .bxpg .bxpg-hero h1 {
        font-size: clamp(38px, 10vw, 56px);
    }

    .bxpg-hero-art {
        height: 240px;
        min-height: 0;
        margin: 0 -20px;
    }

    .bxpg-frame {
        display: block;
        padding-top: 30px;
        padding-bottom: 70px;
    }

    .bxpg-toc {
        position: static;
        max-height: none;
        margin-bottom: 24px;
    }

    .bxpg-toc details {
        border: 1px solid #cad6cc;
        background: #ecefe7;
        padding: 12px 14px;
    }

    .bxpg-toc summary {
        margin: 0;
    }

    .bxpg-toc summary::after {
        content: ' ↓';
    }

    .bxpg-toc nav {
        padding-top: 8px;
    }

    .bxpg-story {
        padding: 40px 0;
    }

    .bxpg-story h2 {
        font-size: 32px;
    }

    .bxpg-copy {
        font-size: 16px;
    }

    .bxpg-story--cta {
        padding: 30px 22px;
        margin-left: -20px;
        margin-right: -20px;
    }

    .bxpg-cards {
        grid-template-columns: 1fr;
    }

    .bxpg-card {
        min-height: 320px;
        padding: 26px;
    }
}

@media (max-width: 760px) {
    .bxpg-hero-inner--photo {
        min-height: 0;
    }

    .bxpg-hero-art--photo {
        position: relative;
        inset: auto;
        height: auto;
    }

    .bxpg-hero-art--photo img {
        position: static;
        height: auto;
    }

    .bxpg-hero-art--photo::after {
        content: none;
    }
}

/* Match the theme's header height: about 87px on tablets, and about 117px on phones, where it adds a second row. */
@media (max-width: 991.98px) {
    .bxpg {
        --bxpg-header-offset: 100px;
    }
}

@media (max-width: 575.98px) {
    .bxpg {
        --bxpg-header-offset: 135px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bxpg-card {
        transition: none;
    }

    .bxpg-card:hover {
        transform: none;
    }
}
