/* MALHUT: one radius for framed UI surfaces on every public page.
 * Keep this separate from page templates so legacy inline CSS cannot drift.
 * Dividers, page sections, artwork and native media controls are not boxes.
 */
:root {
  --malhut-radius: 4px;
  --malhut-button-radius: var(--malhut-radius);
  --malhut-radius-button: var(--malhut-radius);
  --malhut-field-radius: var(--malhut-radius);
}

/* The book fund has three real ID scopes. Matching that specificity also
 * overrides the older ID-scoped !important resets in donation widgets.
 * :not() excludes WordPress's own toolbar and editor UI.
 */
html:root body[class]:not(.wp-admin) :is(
  button, [role="button"], input:not([type="hidden"]):not([type="radio"]):not([type="range"]),
  select, textarea, fieldset, table,
  .button, .elementor-button, .e-button-base, .mbtn, .btn,
  .mlh-cta, .mli-picker summary, .mli-options,
  .mlp__langswitch, .mlp__langbtn, .mabout__btn, .mabh__link, .mabh__slot,
  .mabout__photo-outer, .jp-panel, .jp-channel, .jp-icon,
  .malhut-join-action, .malhut-account-login, .mjp__card, .mjp-socials a,
  .mlg-ecard, .mlg-ecard__ribbon, .mlg-egrid-empty, .mlg-egrid-all,
  .malhut-event-card, .malhut-event-tag, .malhut-event-badge, .malhut-event-button,
  .malhut-events-city, .malhut-events-empty, .malhut-event-hero,
  .malhut-registration-card, .malhut-event-notice, .malhut-event-route,
  .malhut-event-location__map, .malhut-order-confirmation,
  .malhut-album-card__photo, .malhut-album-card__media, .malhut-photo-card,
  .malhut-albums__all, .malhut-single-gallery__pager-link, .malhut-photo-viewer button,
  .mma-card, .mma-panel, .mma-empty, .mma-message, .mma-status,
  .mma-primary, .mma-secondary, .mma-resume, .mma-choice span, .mma-nav b,
  .mma-avatar, .mma-avatar--large, .mma-member > span,
  .ft-subscribe-form, .site-footer .ft-social a, .site-footer .malhut-footer-news a,
  .mlg-card, .mlg-card-num, .mlg-pill, .mlg-privacy, .mlg-upload-zone,
  .mlg-thumb, .mlg-agree-card, .mlg-agree-box, .mlg-err-bar, .mlg-wa-btn, .mlg-tel-btn,
  #mlg-tz .tog, #mlg-tz .tile, #mlg-tz .own, #mlg-tz .ded-box, #mlg-tz .ded-field,
  .tz-role, .tz-contact, .tz-perk__icon, .tz-esod__btn, .tz-hesed__btn,
  .mlg-rub-button, .tz-popup > div,
  #mlg-book #s-support #mlg-bookfund,
  #mlg-book .bf-tier, #mlg-book .sber, #mlg-book .geo-flag, #mlg-book .pill,
  #mlg-book .rabbi-card, #mlg-book .rabbi-seal, #mlg-book .tl-dot,
  #mlg-book .modal-box, #mlg-book .modal-iframe, #mlg-book .urgency,
  #mlg-book .mlg-sber-pay, #mlg-book .mlg-book-hero-cta,
  #mlg-book-share .mlg-share-button,
  #mlg-voices .slider-track, #mlg-voices .faq-icon, #mlg-voices .contact-block,
  #mlg-voices .btn-wa, #mlg-voices .btn-tg, #mlg-book-modal > div,
  #msh .msh-btn, #msh .msh-note, #msh .msh-empty, #msh .msh-tab,
  #msh .msh-card, #msh .msh-survey, #msh .msh-playlist, #msh .msh-donate-form,
  #msh .msh-freq label, #msh .msh-own,
  #msq .msq-step, #msq .msq-choice, #msq .msq-scale span, #msq .msq-success,
  .mcrown__card, .mcrown__button,
  .mbd-picker, .mbd-wheels::before,
  .woocommerce .shop_table, .woocommerce .woocommerce-info,
  .woocommerce .woocommerce-message, .woocommerce .woocommerce-error,
  .woocommerce #payment, .woocommerce .payment_box,
  .woocommerce-checkout-payment, .wc-block-components-radio-control-accordion-content,
  .woocommerce-checkout iframe[src*="cardcom"], .woocommerce-checkout iframe[src*="Cardcom"],
  .nsl-container .nsl-button
):not(#wpadminbar *):not(.wp-admin *) {
  border-radius: var(--malhut-radius) !important;
}

/* Clip cover images to the card's corners, keeping the entire card clickable. */
html:root body[class] :is(.mlg-ecard, .malhut-event-card, .msh-card, .mabout__photo-outer) {
  overflow: hidden;
}

/* Collapsed table borders ignore rounded corners in browsers. */
html:root body[class]:not(.wp-admin) table:not(#wpadminbar *) {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
html:root body[class]:not(.wp-admin) table > :first-child > tr:first-child > :first-child {
  border-start-start-radius: var(--malhut-radius);
}
html:root body[class]:not(.wp-admin) table > :first-child > tr:first-child > :last-child {
  border-start-end-radius: var(--malhut-radius);
}
html:root body[class]:not(.wp-admin) table > :last-child > tr:last-child > :first-child {
  border-end-start-radius: var(--malhut-radius);
}
html:root body[class]:not(.wp-admin) table > :last-child > tr:last-child > :last-child {
  border-end-end-radius: var(--malhut-radius);
}
