/* Midan theme: adjustments so editable blocks match the original layout exactly. */

/* Image blocks inside carried-over widgets behave like the original <img>. */
.elementor-widget-image .wp-block-image,
.elementor-widget-container > figure.wp-block-image {
	margin: 0;
	display: block;
}
.elementor-widget-image .wp-block-image img {
	vertical-align: middle;
	display: inline-block;
}
.elementor-widget-image .wp-block-image > a {
	display: inline-block;
}

/* Headings: no extra block spacing. */
.elementor-widget-heading .wp-block-heading { margin: 0; }

/* Top-level containers (the original matched these by a data attribute). */
.elementor > .e-con,
.elementor-section-wrap > .e-con {
	--margin-left: auto;
	--margin-right: auto;
	max-width: min(100%, var(--width));
}

/* Groups add no styling of their own. */
.wp-block-group.elementor-element,
.wp-block-group.elementor-widget-container,
.wp-block-group.e-con-inner,
.wp-block-group.elementor-container,
.wp-block-group.elementor-widget-wrap { box-sizing: border-box; }

/* Elementor's 'invisible until animated' state. */
.elementor-invisible { visibility: hidden; }

/* Form status message. */
.midan-form-message { margin-top: 10px; font-size: 14px; }
.midan-form-message:empty { display: none; }
.elementor-message-success { color: #5cb85c; }
.elementor-message-danger { color: #d9534f; }
.midan-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Video boxes keep a 16:9 frame. */
[data-midan-video] { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }
[data-midan-video] iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Popups (same structure as the original, styled by the popup's own rules). */
[data-midan-popup] { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9999; display: flex; }
[data-midan-popup][hidden] { display: none; }
[data-midan-popup] .dialog-widget-content { position: relative; max-height: 100%; overflow: auto; }
[data-midan-popup] .dialog-close-button { position: absolute; cursor: pointer; z-index: 2; font-size: 20px; line-height: 1; }
[data-midan-popup] .dialog-close-button svg { width: 1em; height: 1em; }

/* Posts, archives and search (pages built without the old layout). */
.midan-container { max-width: 1140px; margin: 0 auto; padding: 60px 20px; box-sizing: border-box; }
.midan-article-title, .midan-archive-title { font-family: "Josefin Sans", sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.midan-article-content img { max-width: 100%; height: auto; }
.midan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; }
.midan-card-image img { width: 100%; height: auto; display: block; }
.midan-card-title { font-size: 18px; margin: 14px 0 6px; }

/* Never allow sideways scrolling on small screens. */
body { max-width: 100%; overflow-x: clip; }
img, video, iframe { max-width: 100%; }
