/*
 * Ovante event page embed for Chabad Suite sites.
 *
 * Every Chabad Suite snippet links this file, so a change here reaches every
 * site that pasted one on the next page load. Keep the class name
 * `ovante-suite-frame` and this path working: the snippets live on sites we
 * don't control for years. Written by buildChabadSuiteEventEmbedSnippet in
 * src/lib/urls.ts, which also puts a fallback height inline on the frame for
 * a site that strips the <link>.
 */

:root {
  /* The site's top bar (#hero). 130px on every Chabad Suite theme as of
     2026-11-04. If the theme changes, change this number. A site can also
     set its own after this file loads. */
  --ovante-suite-header: 130px;
}

/* 100vw counts the vertical scrollbar where a computer shows one, so a
   frame that breaks out with it hangs past the page by half the scrollbar
   on each side. Clipping the body alone left the page scrolling sideways;
   the root has to clip too (2026-11-15). */
html,
body {
  overflow-x: clip;
}

/* An Embed section with no title still prints an empty h2 with a 16px
   margin, a white strip between the header and the frame. The CiviCRM
   links are "Register Now" on a CiviCRM event page. */
.s-section.embed .section-title:empty,
.crm-actionlinks-top,
.crm-actionlinks-bottom {
  display: none !important;
}

/* !important to win over the inline fallback on the frame. */
iframe.ovante-suite-frame {
  display: block !important;
  border: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  height: calc(100vh - var(--ovante-suite-header)) !important;
  height: calc(100svh - var(--ovante-suite-header)) !important;
}

/* In a full-width Embed section, span the section exactly, with no 100vw
   breakout and so no overhang (2026-11-15). The section's wrapper,
   `.content`, scrolls (`overflow: auto`) and pads 16px a side on a phone:
   with the breakout's 8px overhang it drew its own sideways scrollbar under
   the frame and cut off the frame's own scrollbar. A section that isn't
   full width keeps the breakout above, clipped by the root. */
.s-section.embed .content:has(iframe.ovante-suite-frame) {
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible !important;
}

.s-section.s-width-full.embed iframe.ovante-suite-frame {
  width: 100% !important;
  margin-left: 0 !important;
}
