body[class*="drecha-events-template-"] {
    --drecha-public-accent: #1454a3;
    --drecha-public-accent-soft: #eef5ff;
    --drecha-public-field: #fff;
    --drecha-public-ink: #1f2937;
    --drecha-public-line: #d7e0ec;
    --drecha-public-muted: #526078;
    --drecha-public-padding: clamp(14px, 2.5vw, 20px);
    --drecha-public-shadow: 0 8px 24px rgba(23, 32, 44, .08);
    --drecha-public-surface: #fff;
    --drecha-public-text-size: 1rem;
}

body.drecha-events-template-readable {
    --drecha-public-accent: #174ea6;
    --drecha-public-accent-soft: #edf4ff;
    --drecha-public-padding: clamp(20px, 3.5vw, 30px);
    --drecha-public-shadow: 0 10px 30px rgba(23, 32, 44, .1);
    --drecha-public-text-size: 1.125rem;
}

body.drecha-events-template-warm {
    --drecha-public-accent: #b94719;
    --drecha-public-accent-soft: #fff0e5;
    --drecha-public-field: #fffdf9;
    --drecha-public-ink: #3d281d;
    --drecha-public-line: #e7cdbb;
    --drecha-public-muted: #765a49;
    --drecha-public-shadow: 0 10px 28px rgba(103, 58, 31, .1);
    --drecha-public-surface: #fffaf4;
}

body.drecha-events-template-midnight {
    --drecha-public-accent: #70b7ff;
    --drecha-public-accent-soft: #173352;
    --drecha-public-field: #13263d;
    --drecha-public-ink: #f4f8fc;
    --drecha-public-line: #38526d;
    --drecha-public-muted: #b7c8d9;
    --drecha-public-shadow: 0 12px 32px rgba(5, 15, 28, .28);
    --drecha-public-surface: #0d2035;
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-app,
    .drecha-component,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output
) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-block: 1rem;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    padding: var(--drecha-public-padding);
    background: var(--drecha-public-surface);
    box-shadow: var(--drecha-public-shadow);
    color: var(--drecha-public-ink);
    font-size: var(--drecha-public-text-size);
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-app,
    .drecha-component,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output
) {
    --drecha-accent: var(--drecha-public-accent);
    --drecha-blue: var(--drecha-public-accent);
    --drecha-customer-accent: var(--drecha-public-accent);
    --drecha-customer-border: var(--drecha-public-line);
    --drecha-customer-ink: var(--drecha-public-ink);
    --drecha-customer-muted: var(--drecha-public-muted);
    --drecha-ink: var(--drecha-public-ink);
    --drecha-line: var(--drecha-public-line);
    --drecha-muted: var(--drecha-public-muted);
    --drecha-soft: var(--drecha-public-accent-soft);
    --drecha-surface: var(--drecha-public-surface);
    --drecha-wash: var(--drecha-public-accent-soft);
}

body[class*="drecha-events-template-"] .drecha-component .drecha-component,
body[class*="drecha-events-template-"] .drecha-component :is(
    .drecha-events-app,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output
) {
    width: auto;
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-app,
    .drecha-component,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output,
    .drecha-waitlist
) :where(h1, h2, h3, h4, p, ul, ol, dl) {
    margin-block-start: 0;
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-app,
    .drecha-component,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output
) :where(p, li, dd, label, small) {
    line-height: 1.5;
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-app,
    .drecha-component,
    .drecha-booking-panel,
    .drecha-appointments,
    .drecha-customer-account,
    .drecha-public-output
) a:not(.drecha-button, .drecha-online-event-link) {
    color: var(--drecha-public-accent);
}

body[class*="drecha-events-template-"] .drecha-events-attribution {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    gap: .3rem;
    margin: 1.25rem 0 0 !important;
    border-top: 1px solid var(--drecha-public-line);
    padding-top: .75rem;
    color: var(--drecha-public-muted) !important;
    font-size: .75em;
    line-height: 1.4;
}

body[class*="drecha-events-template-"] .drecha-events-attribution a {
    color: var(--drecha-public-accent) !important;
    font-weight: 800;
    text-decoration: none;
}

body[class*="drecha-events-template-"] .drecha-events-attribution a:hover {
    text-decoration: underline;
    text-underline-offset: .18em;
}

body[class*="drecha-events-template-"] .drecha-events-attribution a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--drecha-public-accent) 35%, transparent);
    outline-offset: 3px;
}

body[class*="drecha-events-template-"] :is(
    .drecha-event-card,
    .drecha-event-row,
    .drecha-events-list,
    .drecha-service-card,
    .drecha-profile-card,
    .drecha-customer-card,
    .drecha-customer-header,
    .drecha-customer-booking,
    .drecha-waitlist,
    .drecha-events-filter-panel
) {
    border-color: var(--drecha-public-line);
    background: var(--drecha-public-surface);
    color: var(--drecha-public-ink);
}

body[class*="drecha-events-template-"] :is(
    .drecha-events-views a:is(:hover, .is-active),
    .drecha-calendar-cell a,
    .drecha-calendar-heading a,
    .drecha-event-row-action a,
    .drecha-events-empty,
    .drecha-availability-panel,
    .drecha-customer-header,
    .drecha-customer-status
) {
    border-color: var(--drecha-public-line);
    background: var(--drecha-public-accent-soft);
    color: var(--drecha-public-ink);
}

body[class*="drecha-events-template-"] :is(
    .drecha-booking-form,
    .drecha-appointment-form,
    .drecha-appointment-reschedule,
    .drecha-customer-form,
    .drecha-waitlist-form,
    .drecha-events-filters,
    .drecha-events-quick-search
) :is(input, select, textarea) {
    border-color: var(--drecha-public-line);
    background: var(--drecha-public-field);
    color: var(--drecha-public-ink);
}

body[class*="drecha-events-template-"] :is(
    .drecha-booking-form,
    .drecha-booking-panel form,
    .drecha-appointment-manage,
    .drecha-customer-form,
    .drecha-customer-card #loginform,
    .drecha-waitlist-form
) button,
body[class*="drecha-events-template-"] .drecha-appointment-submit,
body[class*="drecha-events-template-"] :is(.drecha-button, .drecha-online-event-link) {
    border-color: var(--drecha-public-accent);
    background: var(--drecha-public-accent);
    color: #fff;
}

body.drecha-events-template-midnight :is(
    .drecha-booking-form,
    .drecha-booking-panel form,
    .drecha-appointment-manage,
    .drecha-customer-form,
    .drecha-customer-card #loginform,
    .drecha-waitlist-form
) button,
body.drecha-events-template-midnight .drecha-appointment-submit,
body.drecha-events-template-midnight :is(.drecha-button, .drecha-online-event-link) {
    color: #071526;
}

body.drecha-events-template-midnight :is(
    .drecha-events-filter-open,
    .drecha-events-quick-search button,
    .drecha-events-filters footer button
) {
    color: #071526;
}

body.drecha-events-template-readable :is(
    .drecha-booking-form,
    .drecha-appointment-form,
    .drecha-customer-form,
    .drecha-waitlist-form
) :is(input, select, textarea, button) {
    min-height: 3rem;
    font-size: 1em;
}

body[class*="drecha-events-template-"] .drecha-public-output {
    display: grid;
    gap: clamp(18px, 3vw, 30px);
    overflow: hidden;
}

body[class*="drecha-events-template-"] .drecha-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--drecha-public-line);
    padding-bottom: clamp(16px, 2.5vw, 24px);
}

body[class*="drecha-events-template-"] .drecha-detail-header p,
body[class*="drecha-events-template-"] .drecha-profile-header p {
    margin-bottom: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-eyebrow {
    margin-bottom: .35rem !important;
    color: var(--drecha-public-accent);
    font-size: .7em;
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1.2;
    text-transform: uppercase;
}

body[class*="drecha-events-template-"] .drecha-detail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .45rem 0 .6rem;
    padding: 0;
    list-style: none;
}

body[class*="drecha-events-template-"] .drecha-detail-categories li {
    margin: 0;
    padding: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-categories a {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    padding: .3rem .55rem;
    background: var(--drecha-public-accent-soft);
    color: var(--drecha-public-accent) !important;
    font-size: .72em;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
}

body[class*="drecha-events-template-"] .drecha-detail-categories a:is(:hover, :focus-visible) {
    border-color: var(--drecha-public-accent);
    text-decoration: underline !important;
    text-underline-offset: .16em;
}

body[class*="drecha-events-template-"] .drecha-detail-intro,
body[class*="drecha-events-template-"] .drecha-profile-note {
    color: var(--drecha-public-muted);
    font-size: .9em;
}

body[class*="drecha-events-template-"] .drecha-detail-status {
    flex: 0 0 auto;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    padding: .45rem .65rem;
    background: var(--drecha-public-accent-soft);
    color: var(--drecha-public-ink);
    font-size: .72em;
    font-weight: 800;
}

body[class*="drecha-events-template-"] .drecha-detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    background: var(--drecha-public-line);
}

body[class*="drecha-events-template-"] .drecha-detail-facts > div {
    display: grid;
    gap: .3rem;
    padding: .9rem 1rem;
    background: var(--drecha-public-field);
}

body[class*="drecha-events-template-"] .drecha-detail-facts span {
    color: var(--drecha-public-muted);
    font-size: .68em;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body[class*="drecha-events-template-"] .drecha-detail-facts strong {
    color: var(--drecha-public-ink);
    font-size: .95em;
    line-height: 1.45;
}

body[class*="drecha-events-template-"] .drecha-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(16rem, .8fr);
    gap: clamp(20px, 4vw, 44px);
    align-items: start;
}

body[class*="drecha-events-template-"] .drecha-detail-layout > :is(main, aside) {
    display: grid;
    min-width: 0;
    gap: clamp(18px, 3vw, 28px);
}

body[class*="drecha-events-template-"] .drecha-detail-section,
body[class*="drecha-events-template-"] .drecha-detail-card {
    min-width: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-section + .drecha-detail-section {
    border-top: 1px solid var(--drecha-public-line);
    padding-top: clamp(18px, 3vw, 28px);
}

body[class*="drecha-events-template-"] :is(.drecha-detail-section, .drecha-detail-card) h2 {
    margin: 0 0 .8rem;
    color: var(--drecha-public-ink);
    font-size: clamp(1.15em, 2vw, 1.45em);
    line-height: 1.2;
}

body[class*="drecha-events-template-"] .drecha-detail-copy > :last-child {
    margin-bottom: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-card {
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    padding: clamp(14px, 2vw, 18px);
    background: var(--drecha-public-field);
}

body[class*="drecha-events-template-"] .drecha-detail-card > :last-child {
    margin-bottom: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-media {
    overflow: hidden;
    margin: 0;
    border-radius: 4px;
    background: var(--drecha-public-accent-soft);
}

body[class*="drecha-events-template-"] .drecha-detail-media img {
    display: block;
    width: 100%;
    max-height: 32rem;
    object-fit: cover;
}

body[class*="drecha-events-template-"] .drecha-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .9rem;
}

body[class*="drecha-events-template-"] .drecha-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border: 1px solid var(--drecha-public-accent);
    border-radius: 4px;
    padding: .55rem .8rem;
    background: var(--drecha-public-accent);
    color: #fff !important;
    font-size: .78em;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

body[class*="drecha-events-template-"] .drecha-detail-button.is-secondary {
    background: transparent;
    color: var(--drecha-public-accent) !important;
}

body.drecha-events-template-midnight .drecha-detail-button:not(.is-secondary) {
    color: #071526 !important;
}

body[class*="drecha-events-template-"] .drecha-detail-list {
    display: grid;
    grid-template-columns: minmax(6rem, max-content) 1fr;
    gap: .65rem 1rem;
    margin: 0;
}

body[class*="drecha-events-template-"] .drecha-detail-list dt {
    color: var(--drecha-public-muted);
    font-size: .75em;
    font-weight: 800;
}

body[class*="drecha-events-template-"] .drecha-detail-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

body[class*="drecha-events-template-"] .drecha-detail-list dd a {
    font-weight: 700;
    text-underline-offset: .16em;
}

body[class*="drecha-events-template-"] .drecha-profile-header {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(14rem, 1.25fr);
    gap: clamp(18px, 4vw, 40px);
    align-items: center;
    border-bottom: 1px solid var(--drecha-public-line);
    padding-bottom: clamp(18px, 3vw, 30px);
}

body[class*="drecha-events-template-"] .drecha-profile-cover {
    display: block;
    width: 100%;
    max-height: 22rem;
    border-radius: 4px;
    object-fit: cover;
}

body[class*="drecha-events-template-"] .drecha-profile-portrait {
    display: grid;
    place-items: center;
    width: min(12rem, 100%);
    aspect-ratio: 1;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    background: var(--drecha-public-accent-soft);
    color: var(--drecha-public-accent);
    font-size: 3rem;
    font-weight: 800;
    object-fit: cover;
}

body[class*="drecha-events-template-"] .drecha-profile-lead {
    color: var(--drecha-public-ink);
    font-size: clamp(1.05em, 2.2vw, 1.4em);
    font-weight: 700;
    line-height: 1.35;
}

body[class*="drecha-events-template-"] .drecha-map-preview {
    display: grid;
    gap: .55rem;
    margin-top: .9rem;
}

body[class*="drecha-events-template-"] .drecha-map-preview iframe {
    display: block;
    width: 100%;
    min-height: 22rem;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    background: var(--drecha-public-accent-soft);
}

body[class*="drecha-events-template-"] .drecha-map-preview.is-compact iframe {
    min-height: 13rem;
}

body[class*="drecha-events-template-"] .drecha-map-preview a {
    justify-self: start;
    font-size: .78em;
    font-weight: 800;
}

body[class*="drecha-events-template-"] .drecha-profile-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .75rem;
}

body[class*="drecha-events-template-"] .drecha-profile-links > a {
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    padding: .75rem;
    background: var(--drecha-public-field);
    text-decoration: none;
}

body[class*="drecha-events-template-"] .drecha-profile-links small {
    display: block;
    margin-top: .15rem;
    color: var(--drecha-public-muted);
}

body[class*="drecha-events-template-"] .drecha-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .75rem;
}

body[class*="drecha-events-template-"] .drecha-related-grid article {
    border: 1px solid var(--drecha-public-line);
    border-radius: 4px;
    background: var(--drecha-public-field);
}

body[class*="drecha-events-template-"] .drecha-related-grid a {
    display: grid;
    gap: .35rem;
    height: 100%;
    padding: .85rem;
    text-decoration: none;
}

body[class*="drecha-events-template-"] .drecha-related-grid time {
    color: var(--drecha-public-muted);
    font-size: .75em;
}

body[class*="drecha-events-template-"] .drecha-public-summary {
    width: min(100%, 64rem);
    max-width: 64rem;
    margin: clamp(1rem, 2.5vw, 1.75rem) auto;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
}

body[class*="drecha-events-template-"] .drecha-public-summary.has-media {
    grid-template-columns: minmax(9rem, 15rem) 1fr;
}

body[class*="drecha-events-template-"]:is(
    .tax-drecha_activity_category,
    .post-type-archive-drecha_location,
    .post-type-archive-drecha_teacher
) .wp-block-post-template > .wp-block-post > .wp-block-group {
    padding-block: 0 !important;
}

body[class*="drecha-events-template-"]:is(
    .tax-drecha_activity_category,
    .post-type-archive-drecha_location,
    .post-type-archive-drecha_teacher
) .wp-block-post-template .drecha-public-summary {
    margin-block: 0;
}

body[class*="drecha-events-template-"] .drecha-events-archive-attribution {
    width: min(100%, 64rem);
    max-width: 64rem;
    margin: clamp(.75rem, 2vw, 1.25rem) auto 0;
}

body[class*="drecha-events-template-"] .drecha-events-archive-attribution .drecha-events-attribution {
    margin-top: 0 !important;
}

body[class*="drecha-events-template-"] .drecha-summary-media {
    min-height: 100%;
    background: var(--drecha-public-accent-soft);
}

body[class*="drecha-events-template-"] .drecha-summary-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 13rem;
    object-fit: cover;
}

body[class*="drecha-events-template-"] .drecha-summary-body {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    padding: var(--drecha-public-padding);
}

body[class*="drecha-events-template-"] .drecha-summary-body h2 {
    margin: 0;
    font-size: clamp(1.25em, 2.5vw, 1.8em);
    line-height: 1.2;
}

body[class*="drecha-events-template-"] .drecha-summary-body h2 a {
    color: var(--drecha-public-ink) !important;
    text-decoration: none;
}

body[class*="drecha-events-template-"] .drecha-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .8rem;
    margin-top: .6rem;
    color: var(--drecha-public-muted);
    font-size: .8em;
}

body[class*="drecha-events-template-"] .drecha-summary-copy {
    margin-top: .8rem;
}

body[class*="drecha-events-template-"] .drecha-summary-copy > :last-child {
    margin-bottom: 0;
}

body[class*="drecha-events-template-"] .drecha-summary-link {
    margin-top: auto;
    padding-top: 1rem;
    font-size: .8em;
    font-weight: 800;
}

@media (max-width: 640px) {
    body[class*="drecha-events-template-"] :is(
        .drecha-events-app,
        .drecha-component,
        .drecha-booking-panel,
        .drecha-appointments,
        .drecha-customer-account,
        .drecha-public-output
    ) {
        padding: 14px;
    }

    body[class*="drecha-events-template-"] .drecha-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    body[class*="drecha-events-template-"] .drecha-detail-status {
        align-self: flex-start;
    }

    body[class*="drecha-events-template-"] :is(.drecha-detail-layout, .drecha-profile-header) {
        grid-template-columns: 1fr;
    }

    body[class*="drecha-events-template-"] .drecha-profile-portrait {
        width: 7rem;
    }

    body[class*="drecha-events-template-"] .drecha-detail-list {
        grid-template-columns: 1fr;
        gap: .25rem;
    }

    body[class*="drecha-events-template-"] .drecha-detail-list dd + dt {
        margin-top: .65rem;
    }

    body[class*="drecha-events-template-"] .drecha-map-preview iframe {
        min-height: 16rem;
    }

    body[class*="drecha-events-template-"] :is(
        .drecha-public-summary,
        .drecha-public-summary.has-media
    ) {
        grid-template-columns: 1fr;
        padding: 0;
    }

    body[class*="drecha-events-template-"] .drecha-summary-media img {
        max-height: 14rem;
        min-height: 0;
    }

    body[class*="drecha-events-template-"] .drecha-events-attribution {
        justify-content: flex-start;
    }
}

@media (forced-colors: active) {
    body[class*="drecha-events-template-"] :is(
        .drecha-events-app,
        .drecha-component,
        .drecha-booking-panel,
        .drecha-appointments,
        .drecha-customer-account,
        .drecha-public-output
    ) {
        border-color: CanvasText;
        box-shadow: none;
    }
}
