/*
 * Ride Guide Elementor widgets (Map, Alerts, Timetable).
 *
 * Alerts and Timetable: follow the iframe's own height. Elementor gives every
 * widget in a flex container `height: 100%` (`.e-con > .elementor-widget >
 * .elementor-widget-container`); for these two the iframe is resized to its
 * content by the autoHeight script, so a container forced to fill its parent
 * (which can be a tall or stretched one) leaves a large empty gap below the
 * content. Letting the container size to its content fixes that. The selector
 * is deliberately more specific than Elementor's.
 */
.elementor-widget-ride-guide_alerts > .elementor-widget-container,
.elementor-widget-ride-guide_timetable > .elementor-widget-container,
.e-con > .elementor-widget.elementor-widget-ride-guide_alerts > .elementor-widget-container,
.e-con > .elementor-widget.elementor-widget-ride-guide_timetable > .elementor-widget-container {
    height: auto;
}
.elementor-widget-ride-guide_alerts iframe,
.elementor-widget-ride-guide_timetable iframe {
    display: block;
    width: 100%;
}

/*
 * Map widget: fill the containing element.
 *
 * The map iframe has to be as tall as whatever it is placed in, however that
 * container's height was set in Elementor (Height, Min Height, or a viewport
 * height): an Atomic Div Block, or a classic Container (boxed or full width). A
 * plain `height: 100%` only works when every ancestor has a definite height,
 * which a container that only has a Min Height doesn't, so the widget, its
 * wrapper and the iframe are made a chain of growing flex items instead: they
 * then fill the container whether its height is definite or comes from a
 * minimum. With no container height at all the map keeps a 300px minimum
 * rather than collapsing.
 *
 * The shortcode and block versions don't use this: they take a `height`
 * option instead (see app/Embeds.php).
 */
.elementor-widget.elementor-widget-ride-guide_map {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}
.elementor-widget.elementor-widget-ride-guide_map > .elementor-widget-container,
.e-con > .elementor-widget.elementor-widget-ride-guide_map > .elementor-widget-container,
.e-con-inner > .elementor-widget.elementor-widget-ride-guide_map > .elementor-widget-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: auto;
}
.elementor-widget-ride-guide_map iframe {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    min-height: 300px;
}
