/* Load after page styles so shared responsive constraints apply consistently. */
body.site-background { min-width: 0; }
.site-background img, .site-background video, .site-background iframe { max-width: 100%; }
.micro-hero-grid > *, .homepage-header-inner > *,
.mp-two > *, .mp-about-grid > *, .overview-details > *,
.agenda-session-details > *, .hub-library-item > div { min-width: 0; }
.micro-intro, .micro-register, .micro-table-wrap, .mp-audit { max-width: 100%; }
.micro-table-wrap, .mp-audit { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.micro-field label { white-space: normal; }
.micro-schedule-hint { display: none; }
.micro-table-wrap:focus-visible { outline: 2px solid #e42128; outline-offset: 3px; }
.micro-consent span, .user-details, .agenda-session-details strong,
.mp-page, .learning-hub, .journey-dashboard { overflow-wrap: anywhere; }
.homepage-header-inner { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }

/* Flex and grid children must be allowed to shrink before their content wraps. */
.site-background .main-content,
.site-background .main-content > .container-fluid,
.pulce-reference-page, .programme-agenda,
.homepage-auth-panel, .micro-register form,
.mp-filters > *, .mp-resource > *, .mp-chapter-row > *,
.overview-journey > *, .journey-session > *, .journey-featured > * {
    min-width: 0;
}
.pulce-reference-page, .programme-agenda { overflow-wrap: anywhere; }
.mp-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); }
.mp-input { min-width: 0; }
.mp-chapter-thumb { max-width: 100%; }
.micro-consent span { min-width: 0; }

@media (max-width: 1100px) {
    .homepage-header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; }
    .homepage-header-actions { grid-column: 1 / -1; justify-content: center; }
    .dashboard-menu .navbar-nav { gap: 0 !important; }
    .dashboard-menu .dashboard-menu-link { padding-inline: .6rem; font-size: .8rem; }
}

@media (max-width: 900px) {
    /* A plain 1fr track keeps the table's intrinsic minimum width. */
    .micro-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .micro-register { position: static; max-width: 600px; }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .dashboard-menu .navbar-collapse, .dashboard-menu .navbar-nav { flex-wrap: wrap; }
    .dashboard-menu .navbar-nav { min-width: 0; }
}

@media (max-width: 767px) {
    .homepage-header { position: relative; }
    .dashboard-horizontal .top-header { flex-wrap: wrap; }
    .dashboard-horizontal .dashboard-brand { flex-shrink: 1 !important; min-width: 0; }
    .dashboard-horizontal .user-profile { min-width: 0; }
    .dashboard-horizontal .navbar-toggler { margin-right: .5rem !important; }
    .dashboard-horizontal .main-content > .container-fluid { padding: 24px 16px !important; }
    .mp-about-lockup { flex-wrap: wrap; }
    .mp-about-lockup img { max-width: 100%; height: auto; max-height: 92px; }
    .hub-read-tabs { flex-wrap: wrap; gap: 8px 20px; }
    .agenda-module-kicker { flex-wrap: wrap; }
    .journey-button, .hub-button { white-space: normal; text-align: center; }
    .mp-filters { grid-template-columns: minmax(0, 1fr); }
    .mp-cert-logos { flex-wrap: wrap; }
    .dashboard-horizontal .user-details { max-width: 180px; }
}

@media (max-width: 575px) {
    /* Keep every schedule detail visible without sideways scrolling on phones. */
    .micro-table-wrap { overflow: visible; border: 0; background: transparent; }
    .micro-table, .micro-table tbody { display: block; width: 100%; min-width: 0; }
    .micro-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .micro-table tr { display: block; margin-bottom: 12px; border: 1px solid #ded8cf; background: #fff; }
    .micro-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 10px; padding: 10px 12px; font-size: 12px; overflow-wrap: anywhere; }
    .micro-table td::before { content: attr(data-label); color: #758092; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
    .micro-table td:first-child { display: block; }
    .micro-table td:first-child::before { display: none; }
    .micro-table .micro-utc-time { grid-column: 2; white-space: normal; }
    .homepage-header-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .homepage-header-actions { justify-content: space-between; gap: 10px; }
    .homepage-esc-logo { width: 64px; height: 44px; }
    .homepage-register-button { padding: 12px 16px; }
    .homepage-countdown-units { gap: 8px; }
    .micro-register form { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .micro-field { font-size: 12px; }
    .micro-field input, .micro-field select { font-size: 16px; min-height: 46px; }
    .micro-mobile-group { grid-template-columns: 100px minmax(0, 1fr); }
    .micro-mobile-group select, .micro-mobile-group input { height: 46px !important; }
    .micro-series { font-size: 16px; }
    .micro-tagline { font-size: 11px; }
    .micro-tagline::before, .micro-tagline::after { display: none; }
    .micro-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .micro-facts > div { padding: 12px 4px; }
    .micro-facts b { font-size: 17px; }
    .micro-country-clocks { grid-template-columns: minmax(0, 1fr); }
    .micro-country-clocks time { font-size: 20px; }
    .micro-country-clocks span { font-size: 12px; }
    .micro-country-clocks small { font-size: 10px; }
    .micro-consent, .micro-login { font-size: 12px; }
    .micro-submit { min-height: 46px; }
    .micro-register { scroll-margin-top: 20px; }
    .custom-form-control, .mp-input { font-size: 16px; }
    .video-thumbnail { height: auto; aspect-ratio: 16 / 9; }
    .module-comment-replies { padding-left: .4rem; }
    .agenda-session-details { grid-template-columns: minmax(0, 1fr); }
    .agenda-session-details > div { border-right: 0; padding-right: 0; }
}

@media (max-width: 360px) {
    .homepage-header-inner { grid-template-columns: minmax(0, 1fr); }
    .homepage-header-inner > a { justify-self: center; }
    .homepage-header-actions { grid-column: 1; }
    .dashboard-horizontal .top-header { padding-inline: 10px !important; gap: 4px; }
    .member-header-logos .member-endorsement-strip { width: 115px; }
    .member-profile-hetero { width: 30px; margin-right: 4px; }
}

/* Keep the five endorsement logos readable at the strip's wider aspect ratio. */
.homepage-endorsement-logo,
.member-header-logos .member-endorsement-strip {
    width: 390px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
@media (max-width: 1100px) {
    .homepage-endorsement-logo,
    .member-header-logos .member-endorsement-strip { width: 340px; }
}
@media (max-width: 767px) {
    .homepage-endorsement-logo,
    .member-header-logos .member-endorsement-strip { width: 260px; }
}
@media (max-width: 575px) {
    .homepage-header .homepage-header-inner > a { grid-column: 1 / -1; justify-self: center; }
    .homepage-header .homepage-countdown { grid-column: 1 / -1; }
    .homepage-endorsement-logo { width: 300px; max-height: none; }
    .member-header-logos .member-endorsement-strip { width: 220px; }
}
@media (max-width: 360px) {
    .member-header-logos .member-endorsement-strip { width: 190px; }
}
