/*
 * The theme's own additions to the live CSS, loaded on every page after template_main.
 * Colours, spacing and radius come from template_main's variables; the one radius used here is
 * set once below.
 */

:root {
  --form-box-radius: 0.8rem; /* the buttons' radius in template_main */
  /* The two colours the live thank-you pages (HubSpot Flux) use that the site palette lacks. */
  --flux-teal: #1d9da7;
  --flux-button-hover: #053668;
}

/* Grey form boxes: a coloured column holding a form, and the post sidebar's subscribe box. */
.dnd-column.has-background:has(> .dnd-row > .row-fluid > .dnd-module > .regent-form-slot),
.blog-post__subscribe {
  border-radius: var(--form-box-radius);
}

/*
 * Pages built with Elementor: a container is a Regent section. A top-level container of standard
 * width (Elementor's "Boxed") takes the live section's padding and content width (template_main:
 * .dnd-section, from 992px the full vertical spacing); a full-width one has no padding, as the live
 * "force-full-width" section; a container inside another has none, as a HubSpot column. Side by
 * side items get the live grid's gap, stacked ones nothing, as HubSpot's rows. Padding, width or gap
 * set on a container in Elementor still wins.
 */
.elementor .e-con {
  --container-max-width: var(--container-width);
  --container-default-padding-top: 0px;
  --container-default-padding-bottom: 0px;
  --container-default-padding-left: 0px;
  --container-default-padding-right: 0px;
}
.elementor .e-con.e-parent.e-con-boxed {
  --container-default-padding-top: calc(var(--vertical-spacing) / 2);
  --container-default-padding-bottom: calc(var(--vertical-spacing) / 2);
  --container-default-padding-left: 2rem;  /* template_main's section side padding */
  --container-default-padding-right: 2rem;
}
.elementor .elementor-element {
  --widgets-spacing: 0px var(--gap);
  --widgets-spacing-row: 0px;
  --widgets-spacing-column: var(--gap);
}
@media (min-width: 992px) {
  .elementor .e-con.e-parent.e-con-boxed {
    --container-default-padding-top: var(--vertical-spacing);
    --container-default-padding-bottom: var(--vertical-spacing);
  }
}

/*
 * Link tiles: HubSpot's image grid of linked images (an Elementor container with the class
 * "regent-tile" holding an Image and a Text Editor "regent-tile__caption"). As live: a 16:9 image
 * with rounded corners, and the caption hidden until the tile is hovered or focused, then shown over
 * the blurred image on a near-white layer. A click on the caption still reaches the image's link.
 */
.e-con.regent-tile {
  --tile-radius: 1.3rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--tile-radius);
}
.e-con.regent-tile .elementor-widget-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--tile-radius);
  transition: filter 0.3s;
}
.e-con.regent-tile .regent-tile__caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  text-align: center;
  background: color-mix(in srgb, var(--white) 90%, transparent);
  border-radius: var(--tile-radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.e-con.regent-tile .regent-tile__caption,
.e-con.regent-tile .regent-tile__caption * {
  font-family: var(--primary-font-family);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
}
.e-con.regent-tile:hover .regent-tile__caption,
.e-con.regent-tile:focus-within .regent-tile__caption {
  opacity: 1;
}
.e-con.regent-tile:hover img,
.e-con.regent-tile:focus-within img {
  filter: blur(2px);
}

/* The "Squared" style of the Social Icons block (inc/setup.php). */
.wp-block-social-links.is-style-squared .wp-social-link {
  border-radius: 0;
}

/*
 * The "Pill" style of the Button block (inc/setup.php): the purple button of the live thank-you
 * pages (HubSpot Flux: Montserrat 600 italic 20px, 17px 60px padding, as wide as its text). A page
 * that differs sets the button's own typography in the editor. On an Elementor page the same look
 * is an Elementor Button with the CSS class "is-style-pill" or "is-style-pill-plain" (Advanced).
 */
.wp-block-button.is-style-pill .wp-block-button__link,
.wp-block-button.is-style-pill-plain .wp-block-button__link,
.elementor-widget-button.is-style-pill .elementor-button,
.elementor-widget-button.is-style-pill-plain .elementor-button {
  background-color: var(--dark-magenta);
  border-radius: 999px;
  color: var(--white);
  font-family: Montserrat, sans-serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 600;
  padding: 17px 60px;
  text-align: center;
  transition: background-color 0.15s ease-in-out;
}
/* "Pill (purple, plain)": HubSpot's default button lettering, as on the live slides page. */
.wp-block-button.is-style-pill-plain .wp-block-button__link,
.elementor-widget-button.is-style-pill-plain .elementor-button {
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
}
.wp-block-button.is-style-pill .wp-block-button__link:hover,
.wp-block-button.is-style-pill .wp-block-button__link:focus,
.wp-block-button.is-style-pill-plain .wp-block-button__link:hover,
.wp-block-button.is-style-pill-plain .wp-block-button__link:focus,
.elementor-widget-button.is-style-pill .elementor-button:hover,
.elementor-widget-button.is-style-pill .elementor-button:focus,
.elementor-widget-button.is-style-pill-plain .elementor-button:hover,
.elementor-widget-button.is-style-pill-plain .elementor-button:focus {
  background-color: var(--flux-button-hover);
  color: var(--white);
}

/*
 * The thank-you pages, as the live Flux pages, built from blocks ("Thank-you" page starters): a
 * Section with the class "thank-you" holds the logo and content on its background photo in a 960px
 * column; a Section with the class "thank-you-footer" holds the year line and the Social Icons
 * block. Loaded in the editor too, so it looks the same there. The Elementor pages and templates are
 * the same: containers with those classes, the logo an Image with the class "wp-block-site-logo",
 * and Elementor's Button, Video and Social Icons widgets.
 *
 * Two kinds, as on live: a download page's heading is Arial, centred, at the page's own size; a
 * recording page ("thank-you--recording") has live's plain heading, the site font, left-aligned.
 *
 * Spacing (live's header row and column padding added up; on phones its mobile values) is set once
 * here and used by both the blocks' Section and Elementor's container. Elementor puts a boxed
 * container's top and bottom padding on its inner box, so the container gets it through its own
 * padding variables, which reach both boxes.
 */
.thank-you {
  --thank-you-padding-top: 130px;
  --thank-you-padding-x: 15px;
  --thank-you-padding-bottom: 115px;
}
.thank-you.dnd-section {
  padding: var(--thank-you-padding-top) var(--thank-you-padding-x) var(--thank-you-padding-bottom);
}
.elementor .e-con.e-parent.thank-you {
  --container-default-padding-top: var(--thank-you-padding-top);
  --container-default-padding-right: var(--thank-you-padding-x);
  --container-default-padding-bottom: var(--thank-you-padding-bottom);
  --container-default-padding-left: var(--thank-you-padding-x);
}
.thank-you .wp-block-site-logo {
  margin-bottom: 60px;
}
.thank-you h1,
.thank-you h2 {
  color: var(--flux-teal);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.18;
  margin: 18px 0 25px;
}
.thank-you h1 {
  font-size: 72px;
}
.thank-you--recording h1,
.thank-you--recording h2 {
  font-family: var(--primary-font-family);
}
.thank-you .wp-block-buttons,
.thank-you .wp-block-video,
.thank-you .elementor-widget-button,
.thank-you .elementor-widget-video {
  margin: 23px 0;
}
.thank-you-footer {
  --thank-you-footer-padding-y: 25px;
  --thank-you-footer-padding-x: 15px;
}
.thank-you-footer.dnd-section {
  padding: var(--thank-you-footer-padding-y) var(--thank-you-footer-padding-x);
}
.elementor .e-con.e-parent.thank-you-footer {
  --align-items: center;
  --container-default-padding-top: var(--thank-you-footer-padding-y);
  --container-default-padding-right: var(--thank-you-footer-padding-x);
  --container-default-padding-bottom: var(--thank-you-footer-padding-y);
  --container-default-padding-left: var(--thank-you-footer-padding-x);
}
.thank-you-footer .row-fluid {
  align-items: center;
}
.thank-you-footer p {
  font-size: 18px;
  margin: 0;
}
.thank-you-footer .wp-block-social-links {
  gap: 12px;
  justify-content: flex-end;
  margin: 0;
}
.thank-you-footer .wp-social-link {
  background-color: var(--flux-teal);
  color: var(--white);
  height: 25px;
  width: 25px;
}
.thank-you-footer .wp-social-link a {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 0;
  width: 100%;
}
.thank-you-footer .wp-social-link svg {
  fill: currentColor;
  height: 46%;
  width: 46%;
}
/*
 * The same footer icons from Elementor's Social Icons widget (round: its "Circle" shape): live's
 * 25px teal circles, 12px apart (6px either side), at the right; centred on phones. The widget's own
 * CSS sets its alignment and gap at three classes' strength, so these name the container too.
 */
.e-con.thank-you-footer .elementor-element.elementor-widget-social-icons {
  --grid-column-gap: 12px;
  --justify-content: flex-end;
  text-align: right;
}
.thank-you-footer .elementor-icon.elementor-social-icon {
  --e-social-icon-icon-color: var(--white);
  background-color: var(--flux-teal);
  font-size: 11.5px; /* 46% of the 25px circle, as the block's icon */
  height: 25px;
  line-height: 25px;
  width: 25px;
}
@media (max-width: 767px) {
  .thank-you {
    --thank-you-padding-top: 80px;
    --thank-you-padding-bottom: 40px;
  }
  .thank-you-footer .wp-block-social-links {
    justify-content: center;
  }
  .e-con.thank-you-footer .elementor-element.elementor-widget-social-icons {
    --justify-content: center;
    text-align: center;
  }
}

/*
 * The Blog / News listing bar's subscribe spot holds an Odoo form (Odoo Forms plugin). As on the
 * live site: labels hidden, fields on the left, the button beside them, white text on the bar.
 * The listing CSS already makes the form a two-column grid.
 */
[class*='-listing-bar__subscribe'] .eva-lead-widget {
  max-width: none;
}
[class*='-listing-bar__subscribe'] .eva-lead-form {
  align-items: start;
}
[class*='-listing-bar__subscribe'] .eva-lead-field {
  grid-column: 1;
  margin-bottom: 0;
}
[class*='-listing-bar__subscribe'] .eva-lead-submit {
  grid-column: 2;
  grid-row: 1;
}
[class*='-listing-bar__subscribe'] .eva-lead-optin,
[class*='-listing-bar__subscribe'] .eva-lead-message {
  grid-column: 1 / -1;
}
[class*='-listing-bar__subscribe'] .eva-lead-field:not(.eva-lead-optin) > .eva-lead-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[class*='-listing-bar__subscribe'] .eva-lead-optin,
[class*='-listing-bar__subscribe'] .eva-lead-message,
[class*='-listing-bar__subscribe'] .eva-lead-privacy-link {
  color: var(--white);
}
/* The thank-you after subscribing: the bar's white text on the bar itself, not in the widget's
   white box (white on white). Three classes deep to outrank the widget's own late <style>.
   It takes the height of the email field it replaces (the theme's form fields: min-height
   4.8rem), text centred, so it lines up with the topic select beside it. */
[class*='-listing-bar__subscribe'] .eva-lead-widget .eva-lead-confirmation {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 4.8rem;
  margin-bottom: 0;
  background: none;
  border: 0;
  padding: 0;
  color: var(--white);
}
