/* School content includes legacy Websimon tables and editor-supplied dimensions.
 * Contain wide data locally; never hide horizontal overflow on the whole page.
 */
.entry-content .zg-table-scroll {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 24px;
}
.entry-content .zg-table-scroll > table { margin-bottom: 0; }
.entry-content .zg-table-hint {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px;
    color: #555;
}
.zg-table-hint[hidden] { display: none !important; }
.zg-table-scroll:focus-visible,
#page a:focus-visible,
#page button:focus-visible,
#page input:focus-visible,
#page select:focus-visible,
#page textarea:focus-visible {
    outline: 3px solid #075e87 !important;
    outline-offset: 3px;
}
.entry-content .zg-table-scroll > .zg-table-wide { max-width: none; }

/* Legacy BVI.off() clears inline display; keep initialized Quform uploads visible after FOUC setup. */
.entry-content .iphorm-input-wrap-file.zg-file-ready { display: block; }

@media screen and (max-width: 959px) {
    body { font-size: 16px; line-height: 1.6; }
    #page { width: 100%; max-width: 100%; margin: 0; overflow: visible; }
    #main.wrapper { padding: 0 16px; }
    #page #primary,
    #page #secondary {
        box-sizing: border-box;
        float: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
        border: 0;
    }
    #page #primary { margin: 24px 0; }
    #page #secondary { margin: 32px 0 0; }
    #content, .entry-content, .entry-header, .widget-area .widget {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .entry-content, .comment-content { line-height: 1.65; }
    .entry-header .entry-title { font-size: 26px; line-height: 1.3; }
    .entry-content h1 { font-size: 24px; line-height: 1.4; }
    .entry-content h2 { font-size: 22px; line-height: 1.4; }
    .entry-content h3 { font-size: 20px; line-height: 1.4; }
    .entry-content h4 { font-size: 18px; line-height: 1.5; }
    .entry-content p, .entry-content li { overflow-wrap: anywhere; }
    .entry-content fieldset {
        box-sizing: border-box;
        min-width: 0;
        min-inline-size: 0;
        max-width: 100%;
        padding: 12px;
    }
    .entry-content legend {
        box-sizing: border-box;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .entry-content .spoiler-tgl {
        display: inline-block;
        box-sizing: border-box;
        min-height: 44px;
        padding: 8px 0;
    }
    .entry-content a { text-underline-offset: 3px; }
    .entry-content blockquote { margin-left: 0; margin-right: 0; padding: 16px; }
    .entry-content pre { white-space: pre-wrap; overflow-wrap: anywhere; }
    .entry-content img,
    .entry-content .wp-caption,
    .widget-area img {
        box-sizing: border-box;
        max-width: 100% !important;
        height: auto !important;
    }
    .entry-content iframe,
    .entry-content object,
    .entry-content embed,
    .entry-content video,
    .widget-area iframe { max-width: 100%; }
    .entry-content video { height: auto; }
    .entry-content .wp-video,
    .entry-content .mejs-container,
    .entry-content .mejs-overlay,
    .entry-content .mejs-poster { max-width: 100%; }
    .entry-content .metaslider { max-width: 100% !important; }
    .entry-content .gallery { display: flex; flex-wrap: wrap; }
    .entry-content .gallery .gallery-item {
        box-sizing: border-box;
        float: none;
        width: 50% !important;
        padding: 6px;
        margin: 0 0 12px;
    }
    .entry-content .gallery .gallery-item img { border: 0 !important; }
    /* A usable CSS-only fallback if JavaScript is unavailable. */
    .entry-content table:not(.zg-table-ready) {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
    }
    /* One/two-column lists and portrait cards reflow; data matrices scroll. */
    #page .entry-content table.zg-table-simple {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed;
    }
    #page .entry-content table.zg-table-simple th,
    #page .entry-content table.zg-table-simple td {
        width: auto !important;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        padding: 10px 8px;
        box-sizing: border-box;
    }
    .entry-content table.zg-table-wide { min-width: 32rem; }
    #page .entry-content table td, #page .entry-content table th { line-height: 1.55; }
    .widget-area .widget { margin-bottom: 24px; }
    #secondary .widget a { overflow-wrap: anywhere; }
    #secondary .widget ul.menu a {
        box-sizing: border-box;
        min-height: 44px;
        line-height: 1.5;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    /* This official banner has a 293px minimum in its inline stylesheet. */
    #secondary #js-show-iframe-wrapper { min-width: 0; }
    #secondary #js-show-iframe-wrapper .pos-banner-btn_2 { max-width: 100%; }
    #secondary .gsInformer { max-width: 100%; }
    #bt_is_vervisually {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        max-width: 100%;
        min-height: 44px;
        padding: 8px 12px;
    }
    #bt_is_visually_settings { width: auto; margin: 0 12px; }
    #bt_is_visually a { display: inline-block; min-height: 32px; line-height: 2; }
    #page input, #page select, #page textarea, #page button { box-sizing: border-box; }
    #page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    #page select, #page textarea {
        max-width: 100%;
        min-height: 44px;
        font-size: 16px;
    }
    #page textarea { resize: vertical; }
    #page input[type="submit"], #page button { min-height: 44px; }
    #page .iphorm-outer,
    #page .iphorm-inner,
    #page .iphorm-elements,
    #page .iphorm-element-wrap,
    #page .iphorm-input-wrap {
        box-sizing: border-box;
        width: auto !important;
        max-width: 100%;
        min-width: 0;
    }
    #page .iphorm-element-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    #page .iphorm-element-wrap textarea,
    #page .iphorm-element-wrap select { width: 100%; }
    #page .iphorm-submit-wrap button span { height: auto; min-height: 44px; line-height: 44px; }
    #page .iphorm-group-row > div { float: none; width: 100%; }
    #page .iphorm-inner label { line-height: 1.5; }
    #page .iphorm-inner div.uploader {
        box-sizing: border-box;
        display: flex;
        width: 100%;
        max-width: 100%;
        height: 44px;
        background: #f1f1f1;
        border: 1px solid #999;
        border-radius: 4px;
    }
    #page .iphorm-inner div.uploader span.filename {
        box-sizing: border-box;
        flex: 1;
        min-width: 0;
        width: auto;
        height: 44px;
        line-height: 44px;
        padding: 0 8px;
        margin: 0;
    }
    #page .iphorm-inner div.uploader span.action {
        box-sizing: border-box;
        flex: 0 0 auto;
        width: auto;
        height: 44px;
        line-height: 44px;
        padding: 0 12px;
        margin: 0;
        background: #e2e2e2;
    }
    #page .iphorm-inner div.uploader input { height: 44px; cursor: pointer; }
    #page .iphorm-inner div.uploader:focus-within { outline: 3px solid #075e87; outline-offset: 2px; }
    #page .iphorm-inner input:focus,
    #page .iphorm-inner textarea:focus,
    #page .iphorm-inner select:focus { outline: 3px solid #075e87 !important; outline-offset: 2px; }
    .wrapper-search-form { padding: 12px; }
    footer[role="contentinfo"] { padding-left: 16px; padding-right: 16px; }
    footer[role="contentinfo"] .credits {
        box-sizing: border-box;
        float: none;
        width: 100%;
        text-align: left;
        margin: 0 0 16px;
        overflow-wrap: anywhere;
    }
    .ir-arriba { z-index: 10; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media screen and (max-width: 480px) {
    /* Websimon 18 contains portrait/biography pairs, not a comparison matrix. */
    #page .entry-content table#t18.zg-table-simple tr,
    #page .entry-content table#t18.zg-table-simple td {
        display: block;
        width: 100% !important;
    }
    #page .entry-content table#t18.zg-table-simple td:empty { display: none; }
    .entry-content img.alignleft,
    .entry-content img.alignright,
    .entry-content .wp-caption.alignleft,
    .entry-content .wp-caption.alignright {
        float: none;
        display: block;
        margin: 12px auto;
    }
    .entry-content .gallery-columns-1 .gallery-item { width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
@media print {
    .entry-content .zg-table-scroll { overflow: visible; }
    .entry-content .zg-table-hint { display: none; }
}
