/* COMMON MESSAGE OVERLAY STYLES */
/* VERSION: 0.7.12 */
/* z-index hierarchy: .HIG_overlay(9000) < admin custom overlay(9500) < admin link picker(9900) < messages(10000)
   In the admin, HIG_MODAL restacks every open dialog on the ladder in admin.css (:root --hig-z-*):
   dialogs (10000 + stack depth) < the assistant over an open dialog (15000)
   < dialogs and the menu only the assistant can open (HIG_MODAL aboveSurface), and dialogs stacked
     over them (16000 + depth); shared dialogs the assistant opens (media library) stay at 10000 + depth
   < questions on top of the stack (20000 + depth) < toasts while a dialog is open (21000). */

/* THEMING CONTRACT — read before adding a colour here.
   This file is linked for EVERY visitor (Page.php), but admin_color_scheme.css — which
   defines --surface-*, --text-*, --state-* — is linked only for admins and trial
   assistants. A bare var(--hig-surface-3) would therefore resolve to nothing on a public
   page and the declaration would be dropped, leaving public dialogs unstyled on the
   live sites.
   So every token here carries its previous literal as the fallback: public visitors
   render byte-identical to before, admins get the themed surface. Same pattern
   forms.css already uses for the same reason (it also renders publicly).
   Consequence: the fallback is the public design. Change both, or neither. */
.HIG_overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; padding-bottom: 100px; background-color: var(--hig-scrim, rgba(0, 0, 0, 0.3)); z-index: 9000;}

#default_static_overlay_info,
#default_static_overlay_error,
#default_static_overlay_confirm,
#default_static_overlay_confirm_unload,
#default_static_overlay_text_input { z-index: 10000;}

.HIG_overlay .wrapper { position: relative; overflow-y: auto; width: 100%; height: 100vh; height: 100dvh;}

.HIG_overlay .inner { position: relative; width: 90%; max-width: 600px; margin: 60px auto 20px auto; box-sizing: border-box; padding: 15px; background-color: var(--hig-surface-3, #fff); border-radius: var(--hig-r-lg, 5px); box-shadow: var(--hig-elevation-3, 0px 0px 10px #fff);}

.HIG_overlay .caption { position: relative; margin: 0 auto 0 auto; line-height: 32px; font-size: 24px; font-weight: 700; color: var(--hig-text-1, #111); text-align: center;}

.HIG_overlay.message .message { width: 100%; margin-top: 10px; box-sizing: border-box; color: var(--hig-text-1, #111); font-size: 16px; line-height: 25px; min-height: 100px; text-align: center;}

.HIG_overlay.message .buttons { position: relative; text-align: center; margin-top: 40px; }

.HIG_overlay.message .buttons > * { display: inline-block; min-width: 120px; min-height: 44px; margin: 0 10px 0 10px; box-sizing: border-box; padding: 0 10px 0 10px; border: none; line-height: 35px; font: inherit; font-size: 16px; border-radius: var(--hig-r-sm, 5px); cursor: pointer;}

.HIG_overlay.message .buttons > *:focus-visible { outline: 3px solid var(--hig-accent-interactive, #005fcc); outline-offset: 3px;}


/* INFO MESSAGE OVERLAY */
#default_static_overlay_info .inner { border: 2px solid var(--hig-border-strong, #111);}

body:not(.hig_admin_ui_v2) #default_static_overlay_info .inner:focus-visible { outline: 2px solid #fff; outline-offset: 3px;}

#default_static_overlay_info .caption { color: var(--hig-text-1, #111); border-bottom: 2px solid var(--hig-border-strong, #111);}

#default_static_overlay_info .btn_close { background-color: var(--hig-btn-neutral-bg, #111); color: var(--hig-text-1, #fff); border: none;}

#default_static_overlay_info .btn_close:focus-visible { outline: 2px solid #000; outline-offset: 3px;}

#default_static_overlay_info .btn_close:hover { background-color: var(--hig-btn-neutral-bg-hover, #333);}

#default_static_overlay_info .btn_close_icon { display: none; background-color: transparent; border: none;}


/* ERROR MESSAGE OVERLAY */
#default_static_overlay_error .inner { border: 2px solid var(--hig-border-strong, #111); background-color: var(--hig-surface-3, #fff);/*#ffffbb;*/}

#default_static_overlay_error .message_more { margin-top: 0.75em; padding-top: 0.75em; border-top: 1px solid var(--hig-border-subtle, #ccc);}
#default_static_overlay_error .caption { color: var(--hig-text-1, #111); border-bottom: 2px solid var(--hig-border-strong, #111);}

#default_static_overlay_error .btn_close { background-color: var(--hig-btn-neutral-bg, #111); color: var(--hig-text-1, #fff);}

#default_static_overlay_error .btn_close:hover { background-color: var(--hig-btn-neutral-bg-hover, #333);}


/* CONFIRM MESSAGE OVERLAY */
#default_static_overlay_confirm .inner { border: 2px solid var(--hig-accent-solid, #144cb3); background-color: var(--hig-surface-3, #fff);}

#default_static_overlay_confirm .caption { color: var(--hig-accent-interactive, #144cb3); border-bottom: 2px solid var(--hig-accent-solid, #144cb3);}

#default_static_overlay_confirm .btn_confirm { background-color: var(--hig-accent-solid, #144cb3); color: var(--hig-on-accent, #fff);}

#default_static_overlay_confirm .btn_confirm:hover { background-color: var(--hig-accent-solid-hover, #2b6de8);}

#default_static_overlay_confirm .btn_cancel { background-color: var(--hig-btn-neutral-bg, #111); color: var(--hig-text-1, #fff);}

#default_static_overlay_confirm .btn_cancel:hover { background-color: var(--hig-btn-neutral-bg-hover, #333);}

#default_static_overlay_confirm .note { text-align: center; width: 100%; margin: 10px auto 10px auto; color: var(--hig-text-1, #111); font-size: 16px; line-height: 25px; font-weight: 700;}

/* CONFIRM MESSAGE OVERLAY -> WARNING MODE */
#default_static_overlay_confirm.warning_mode .inner { border: 2px solid var(--hig-state-danger-solid, #aa0000); background-color: var(--hig-surface-3, #fff);/*#ffffbb;*/}

#default_static_overlay_confirm.warning_mode .caption { color: var(--hig-state-danger, #aa0000); border-bottom: 2px solid var(--hig-state-danger-solid, #aa0000);}

#default_static_overlay_confirm.warning_mode .btn_confirm { background-color: var(--hig-state-danger-solid, #aa0000); color: var(--hig-on-state, #fff);}

#default_static_overlay_confirm.warning_mode .btn_confirm:hover { background-color: var(--hig-state-danger-solid-hover, #bb1111);}


/* CONFIRM UNLOAD MESSAGE OVERLAY */
#default_static_overlay_confirm_unload .inner { border: 2px solid var(--hig-state-danger-solid, #aa0000); background-color: var(--hig-surface-3, #fff);/*#ffffbb;*/}

#default_static_overlay_confirm_unload .caption { color: var(--hig-state-danger, #aa0000); border-bottom: 2px solid var(--hig-state-danger-solid, #aa0000);}

#default_static_overlay_confirm_unload .btn_confirm { background-color: var(--hig-state-danger-solid, #aa0000); color: var(--hig-on-state, #fff);}

#default_static_overlay_confirm_unload .btn_confirm:hover { background-color: var(--hig-state-danger-solid-hover, #bb1111);}

#default_static_overlay_confirm_unload .btn_cancel { background-color: var(--hig-btn-neutral-bg, #111); color: var(--hig-text-1, #fff);}

#default_static_overlay_confirm_unload .btn_cancel:hover { background-color: var(--hig-btn-neutral-bg-hover, #333);}


/*TODO: TESTEN*/
.HIG_overlay.message .message a { text-decoration: underline;}

.HIG_overlay.message .message ul { text-align: left; line-height: 22px; max-width: 300px; margin: 10px auto 30px auto; font-size: 14px;}


/*TODO: CUSTOM OVERLAYS AND TEXT INPUT OVERLAY*/
#default_static_overlay_text_input input { width: 360px; max-width: 100%; height: 30px; line-height: 30px; margin-bottom: 10px; box-sizing: border-box; padding: 0 5px 0 5px; font-size: 15px; outline: none;}

#default_static_overlay_text_input .default_form_checkbox_privacy_wrapper { display: none; position: relative; width: 360px; max-width: 100%; box-sizing: border-box; margin: 10px auto 10px auto; padding: 10px; border: 1px solid #ccc; border-radius: 5px; background-color: var(--hig-surface-3, #fff);}

#default_static_overlay_text_input .default_form_checkbox_privacy { display: block; float: left; margin: 3px; height: 25px; width: 25px;}

#default_static_overlay_text_input .default_form_checkbox_privacy_label { display: block; width: 80%; float: right; font-size: 11px; text-align: justify; line-height: 15px;}

#default_static_overlay_text_input .default_form_checkbox_privacy_label a{ text-decoration: underline;}

/* The cancel/confirm controls are native <button>s (dialog a11y contract) — without explicit
   colors they would render the UA's ButtonFace grey; mirrors the confirm overlay's palette.
   Declared BEFORE the .inactive rule so the equal-specificity inactive state wins the tie. */
#default_static_overlay_text_input .btn_confirm { background-color: var(--hig-accent-solid, #144cb3); color: var(--hig-on-accent, #fff);}

#default_static_overlay_text_input .btn_confirm:not(.inactive):hover { background-color: var(--hig-accent-solid-hover, #2b6de8);}

#default_static_overlay_text_input .btn_cancel { background-color: var(--hig-btn-neutral-bg, #111); color: var(--hig-text-1, #fff);}

#default_static_overlay_text_input .btn_cancel:hover { background-color: var(--hig-btn-neutral-bg-hover, #333);}

#default_static_overlay_text_input .btn_confirm.inactive { background-color: var(--hig-surface-2, #ccc); color: var(--hig-text-3, #999);}

/* content_intro — mobile image variant contract (blueprint field image_mobile).
   Lives here (fleet-synced, always loaded) so the core renderer's mobile <img>
   behaves on every installation regardless of the stage-owned custom.css.
   Inert until an editor sets a mobile variant (renderer adds .has_mobile_image). */
.content_intro img.mobile { display: none; }

@media (max-width: 800px) {
    .content_intro.has_mobile_image img.desktop { display: none; }
    .content_intro img.mobile { display: block; }
}

/* Content image width contract (blueprint field display_width -> wrapper class image_w{N}).
   The wrapper carries the chosen width; the picture must stay inside it. Without this guard
   an <img> keeps its intrinsic size (width attribute, or the srcset `sizes` hint) and overflows
   the wrapper, so 60 / 80 / 100 all look identical on the public page while the editor, which
   caps the picture, shows the difference. Lives here (fleet-synced, always loaded) so every
   installation honours the width regardless of its stage-owned custom.css. Placement
   (centered or flush left) stays with the project stylesheet.
   :where() keeps the specificity at zero: this file loads after custom.css, and a project's
   own, deliberately smaller cap (for example a portrait limited to 400px) must still win. */
:where(.image_wrapper.image_w60 img, .image_wrapper.image_w80 img, .image_wrapper.image_w100 img) { max-width: 100%; height: auto; }

/* Skip link (Page.php): the first element of every visitor page, off screen until it gets keyboard
   focus, then shown above the header. Fixed colours: admin_color_scheme.css is not linked for visitors. */
.hig_skip_link {
	position: absolute;
	left: 8px;
	top: -200px;
	z-index: 10001;
	padding: 10px 16px;
	background: #ffffff;
	color: #000000;
	border: 2px solid #000000;
	font-size: 16px;
	line-height: 1.3;
	text-decoration: underline;
}

.hig_skip_link:focus {
	top: 8px;
	outline: 3px solid #1a4fd8;
	outline-offset: 2px;
}

/* Menu button (#static_btn_nav, its three lines drawn by the stages' custom.css): with reduced motion
   the lines switch to the close cross without animating. Only the timing is touched here; how the lines
   look stays with each stage, which draws them in its own way. */
@media (prefers-reduced-motion: reduce) {
	#static_btn_nav::before,
	#static_btn_nav::after {
		transition: none;
	}
}

/* Select lists (base.js assign_hig_select_events_v2): the option the arrow keys are on carries .current. The stages'
   custom.css style only the mouse hover, so a keyboard user saw the list open and close but never which option was
   marked. Hover colour with a fallback plus a bar in the text colour; the admin's own lists keep their rule. */
.hig_select:not(.hig_admin_mask .hig_select, .hig_admin_overlay .hig_select, #default_static_overlay_custom .hig_select) .options .option.current {
	background-color: var(--color-bg-alt, #f0f0f0);
	box-shadow: inset 3px 0 0 currentColor;
}
