body:has(.epf-sponsors) #main-content {
    background: #f6fdff !important;
}

#main-content .epf-sponsors.et_pb_section {
    padding: 0 0 64px;
    background: #f6fdff;
    color: #173e39;
}

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

.epf-sponsors .et_pb_row {
    width: 90%;
    max-width: 1180px;
    padding: 0;
}

.epf-sponsors .et_pb_column {
    min-width: 0;
}

.epf-sponsors .et_pb_column .et_pb_module {
    margin-bottom: 0;
}

#main-content .epf-sponsors .et_pb_text {
    color: #173e39;
    font-size: 18px;
    line-height: 1.7;
    text-align: center;
    overflow-wrap: anywhere;
}

.epf-sponsors h2,
.epf-sponsors h3,
.epf-sponsors p {
    padding: 0;
    margin: 0;
    color: inherit;
}

.epf-sponsors h2 {
    margin-bottom: 24px;
    font-size: clamp(32px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
}

#main-content .epf-sponsors .epf-sponsors-kicker {
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.epf-sponsors .epf-sponsors-intro {
    max-width: 860px;
    padding-top: 76px;
}

.epf-sponsors-intro::before {
    content: "";
    display: block;
    width: 48px;
    height: 8px;
    margin: 0 auto 28px;
    background: #36b5cd;
    transform: rotate(-8deg);
}

.epf-sponsors-intro h2 {
    font-size: clamp(40px, 4.8vw, 66px);
    line-height: 1.05;
    letter-spacing: -.035em;
}

#main-content .epf-sponsors.epf-sponsors-directory {
    width: 90%;
    max-width: 1180px;
    margin: 0 auto 40px;
    padding: 40px;
    border: 1px solid #c8d8d0;
    background: #fffdf0 !important;
}

#main-content .epf-sponsors.epf-sponsors-directory.epf-box-offices {
    background: #e3f2f0 !important;
}

.epf-sponsors-directory .et_pb_row {
    width: 100%;
}

.epf-sponsors .epf-box-offices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 720px;
    margin-top: 28px;
}

.epf-box-offices-grid::after {
    display: none;
}

.epf-sponsors .epf-box-offices-grid > .et_pb_column {
    width: auto !important;
    margin: 0 !important;
    border: 1px solid #c8d8d0;
    background: #fff;
}

.epf-sponsors .epf-sponsors-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.epf-sponsors-grid::after {
    display: none;
}

.epf-sponsors .epf-sponsors-grid > .et_pb_column {
    display: flex;
    flex-direction: column;
    width: auto !important;
    margin: 0 !important;
    border: 1px solid #c8d8d0;
    background: #fff;
}

.epf-sponsors .epf-sponsor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: 190px;
    padding: 24px 16px;
    margin: 0 !important;
}

.epf-sponsor-logo .et_pb_image_wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.epf-sponsor-logo img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: min(100%, var(--epf-sponsor-logo-width, 100%));
    max-height: 100%;
    object-fit: contain;
}

.epf-sponsor-logo img[src*="/bailiffscourt."],
.epf-sponsor-logo img[src*="/butcher-deli."],
.epf-sponsor-logo img[src*="/norfolk-arms."] {
    max-width: 100%;
}

#main-content .epf-sponsors .epf-sponsor-name {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 18px 16px;
    border-top: 5px solid #e3f2f0;
    background: #f6fdff;
}

.epf-sponsor-name h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

#main-content .epf-box-offices .epf-box-office-address {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
}

/* The individual thank-you uses the Box Offices panel treatment: a mint
   panel with a thin grey border, "Individual support" as the panel heading,
   the sentence below, then a sponsor-card sized card holding the festival
   logo above the supporter's name. The card matches one grid card at every
   breakpoint: the panel inner width equals the directory inner width, so the
   same grid gaps and column count apply. */
.epf-sponsors .epf-sponsors-individual {
    width: min(90%, 1180px);
    margin: 0 auto;
    padding: 40px;
    border: 1px solid #c8d8d0;
    background: #e3f2f0;
}

.epf-sponsors .epf-sponsors-individual .et_pb_column {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    background: transparent;
}

/* "Individual support" is the panel heading, styled like "Our Box Offices".
   The long selector out-specifies the site's 13px phone rule for text
   modules, which must never shrink a heading. */
body #page-container #main-content .epf-sponsors .epf-sponsors-individual .epf-sponsors-kicker {
    margin-bottom: 24px;
    font-family: "DIN Neuzeit Grotesk", Helvetica, Arial, Lucida, sans-serif;
    font-size: clamp(32px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
    text-transform: none;
}

/* Sentence, then the logo card, then the name. */
.epf-sponsors-individual .epf-sponsors-kicker {
    order: 1;
}

/* The thank-you sentence is capped at 560px so it always wraps onto two
   lines, breaking after "to the", exactly as in the approved design. The
   window is 542-581px at 18px; 560px sits inside it with room to spare.
   The long selector out-specifies Divi's `margin-bottom: 0` reset on
   modules, and the 28px bottom margin mirrors the Box Offices panel's
   subtitle-to-cards spacing. */
body #page-container #main-content .epf-sponsors-individual .et_pb_text:not(.epf-sponsors-kicker):not(:has(h2)) {
    order: 2;
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 28px;
}

.epf-sponsors-individual .et_pb_column::before {
    content: "";
    order: 3;
    display: block;
    height: 190px;
    border: 1px solid #c8d8d0;
    border-bottom: 0;
    background: #fff url("../uploads/2026/10/cropped-ep-logo-1.webp") center / auto 72% no-repeat;
}

.epf-sponsors-individual .et_pb_text:has(h2) {
    order: 4;
    padding: 18px 16px;
    border: 1px solid #c8d8d0;
    border-top: 5px solid #e3f2f0;
    background: #f6fdff;
}

.epf-sponsors .epf-sponsors-individual .et_pb_column::before,
.epf-sponsors-individual .et_pb_text:has(h2) {
    width: calc((100% - 72px) / 4);
    margin: 0 auto;
}

.epf-sponsors-individual p {
    font-size: clamp(32px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
}

.epf-sponsors-individual h2 {
    margin-bottom: 0;
    font-size: 24px;
}

.epf-sponsors .epf-sponsors-invitation {
    margin-top: 40px;
    padding: 40px;
    background: #173e39;
}

#main-content .epf-sponsors-invitation .et_pb_text {
    color: #fffdf0;
}

.epf-sponsors-invitation .et_pb_button_module_wrapper {
    margin-top: 24px;
    text-align: center;
}

#main-content .epf-sponsors .epf-sponsors-button,
#main-content .epf-sponsors .epf-sponsors-button:hover {
    padding: 12px 24px !important;
    border: 1px solid #a8c0b9 !important;
    border-radius: 0;
    background: #fffdf0;
    color: #173e39 !important;
    font-size: 16px;
    line-height: 1.5 !important;
    text-decoration: none;
}

#main-content .epf-sponsors .epf-sponsors-button:hover {
    background: #d8f0f4;
}

.epf-sponsors-button::after {
    display: none !important;
}

.epf-sponsors-button:focus-visible {
    outline: 3px solid #36b5cd;
    outline-offset: 4px;
}

@media (max-width: 980px) {
    #main-content .epf-sponsors.epf-sponsors-directory,
    .epf-sponsors .epf-sponsors-individual,
    .epf-sponsors .epf-sponsors-invitation {
        padding: 28px;
    }

    /* Two sponsor columns: the card matches one card of that grid. */
    .epf-sponsors .epf-sponsors-individual .et_pb_column::before,
    .epf-sponsors-individual .et_pb_text:has(h2) {
        width: calc((100% - 20px) / 2);
    }

    .epf-sponsors .epf-sponsors-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .epf-sponsors .epf-sponsors-intro {
        padding-top: 38px;
    }

    #main-content .epf-sponsors.et_pb_section {
        padding-bottom: 40px;
    }

    #main-content .epf-sponsors.epf-sponsors-directory,
    .epf-sponsors .epf-sponsors-individual,
    .epf-sponsors .epf-sponsors-invitation {
        padding: 24px 18px;
    }

    /* One sponsor column: the card fills the panel. */
    .epf-sponsors .epf-sponsors-individual .et_pb_column::before,
    .epf-sponsors-individual .et_pb_text:has(h2) {
        width: 100%;
    }

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

    .epf-sponsors .epf-box-offices-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}
