/* Public portal presentation only. No visibility, content or business rules. */
body.erc-public-portal {
    --erc-public-radius: 14px;
    --erc-public-gap: 24px;
    --erc-public-ink: #183e64;
    --erc-public-accent: #075f7c;
    --erc-public-focus: #68b7db;
}

/* Keep theme banner text in normal flow; allow long titles to grow. */
body.erc-public-portal:not(.home) #header-image {
    height: auto;
    min-height: clamp(160px, 20vw, 240px);
    padding-block: 32px;
    background-size: cover;
    background-position: center;
}
body.erc-public-portal #header-image .itre-hero-area {
    position: relative;
    inset: auto;
    transform: none;
    min-width: 0;
    max-width: min(90%, 1120px);
    padding-block: 8px;
}
body.erc-public-portal #header-image .itre-hero-area h1 {
    height: auto;
    margin: 0 0 12px;
    padding-block: .1em;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}
body.erc-public-portal #header-image .itre-hero-area p { margin: 0; line-height: 1.6; }

/* Local and Events have their own content banners. */
body.erc-public-portal :is(.erc-events-archive-header, .erc-local-directory__header) {
    position: relative;
    inset: auto;
    height: auto;
    max-height: none;
    margin-bottom: 28px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid #dce6e5;
    border-radius: var(--erc-public-radius);
    background: linear-gradient(120deg, #e8f2f7, #f5faf9);
    overflow: visible;
}
body.erc-public-portal :is(.erc-events-archive-header, .erc-local-directory__header) :is(h1, h2) {
    position: static;
    height: auto;
    max-height: none;
    margin: 0 0 12px;
    padding-block: .1em;
    color: var(--erc-public-accent);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    transform: none;
}
body.erc-public-portal .erc-events-banner-copy > .erc-events-eyebrow {
    position: static;
    inset: auto;
    height: auto;
    margin: 0 0 8px;
    line-height: 1.5;
    transform: none;
}

/* Shared card geometry. Logos keep their existing contain policy. */
body.erc-public-portal :is(.hp-listing--view-block, .erc-event-archive-card, .erc-local-directory__card) {
    min-width: 0;
    border-radius: var(--erc-public-radius);
}
body.erc-public-portal :is(.hp-listing__content, .erc-immobilier-card__body,
    .erc-event-archive-body, .erc-local-directory__card-content) {
    min-width: 0;
    padding: 20px;
    overflow-wrap: anywhere;
}
/* The property body is nested in the HivePress content container. */
body.erc-public-portal .hp-listing__content:has(.erc-immobilier-card__body) { padding: 0; }
body.erc-public-portal :is(.hp-listing--view-block .hp-listing__title,
    .erc-immobilier-card__title, .erc-event-archive-body h3, .erc-local-directory__card-content h3) {
    height: auto;
    margin: 0 0 12px;
    font-size: 1.2rem;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}
body.erc-public-portal :is(.hp-listing__image, .erc-event-archive-image) { aspect-ratio: 16 / 10; }
body.erc-public-portal :is(.hp-listing__image, .erc-event-archive-image) img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
body.erc-public-portal :is(.erc-events-grid, .erc-local-directory__grid) { gap: var(--erc-public-gap); }

/* Detail copy and filter controls: shrink grid/flex children, never clip the page. */
body.erc-public-portal :is(.hp-page__content, .hp-page__sidebar, .erc-event-main, .erc-event-sidebar) { min-width: 0; }
body.erc-public-portal :is(.hp-listing--view-page .hp-listing__title, .erc-event-page-header .entry-title) {
    height: auto;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
body.erc-public-portal :is(.hp-listing__description, .erc-event-description-content) { line-height: 1.75; overflow-wrap: anywhere; }
body.erc-public-portal :is(.erc-events-filter-field, .erc-local-directory__filters label,
    .hp-form--listing-filter .hp-form__field) { min-width: 0; }
body.erc-public-portal :is(.erc-events-filters, .erc-local-directory__filters, .hp-form--listing-filter)
    :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 1rem;
}
body.erc-public-portal :is(.erc-events-submit-link, .erc-immobilier-card__button,
    .erc-event-archive-link, .erc-local-directory__link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
}
body.erc-public-portal #primary :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--erc-public-focus);
    outline-offset: 3px;
}
@media (max-width: 991px) {
    body.erc-public-portal { --erc-public-gap: 20px; }
    body.erc-public-portal .hp-page__topbar { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 767px) {
    body.erc-public-portal { --erc-public-gap: 16px; }
    body.erc-public-portal:not(.home) #header-image { min-height: 140px; padding-block: 24px; }
    body.erc-public-portal :is(.erc-events-archive-header, .erc-local-directory__header) { margin-bottom: 24px; }
    body.erc-public-portal :is(.hp-listing__content, .erc-immobilier-card__body,
        .erc-event-archive-body, .erc-local-directory__card-content) { padding: 16px; }
    body.erc-public-portal .hp-listing__content:has(.erc-immobilier-card__body) { padding: 0; }
}
