/* GF Forms Popup Hub - visual language taken from the IDCE "I need help" block */

.gfph {
	--gfph-accent: #3d5a80;
	--gfph-ink: #231f20;

	/* Derived from the accent so one hex drives the whole block */
	--gfph-accent-dark: #2c4460;
	--gfph-accent-dark: color-mix(in srgb, var(--gfph-accent) 80%, #000);
	--gfph-tint: #f4f7fa;
	--gfph-tint: color-mix(in srgb, var(--gfph-accent) 6%, #fff);
	--gfph-tint-hover: #e9eff6;
	--gfph-tint-hover: color-mix(in srgb, var(--gfph-accent) 12%, #fff);
	font-family: 'DIN Pro', 'DIN Next LT Pro', 'D-DIN', 'DIN Alternate', Arial, sans-serif;
	margin: 6px 0;
}

.gfph-box {
	border: 1px solid var(--gfph-accent);
	border-left: 5px solid var(--gfph-accent);
	background: var(--gfph-tint);
	border-radius: 6px;
	padding: 24px 28px;
	text-align: center;
}

.gfph-heading {
	margin: 0 0 6px;
	color: var(--gfph-accent);
	font-size: 22px;
}

.gfph-sub {
	margin: 0 0 18px;
	color: #555;
	font-size: 14px;
}

.gfph-btns {
	display: flex;
	gap: 14px;
	justify-content: center;
	flex-wrap: wrap;
}

.gfph-picker {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	align-items: center;
}

.gfph-picker .gfph-select {
	font: inherit;
	font-size: 15px;
	padding: 12px 14px;
	border-radius: 6px;
	border: 1px solid #d9dde3;
	background: #fff;
	min-width: 260px;
}

.gfph button.gfph-btn {
	font-family: inherit;
	cursor: pointer;
	font-size: 15px;
	font-weight: bold;
	padding: 13px 26px;
	border-radius: 6px;
	border: 2px solid var(--gfph-accent);
	background: var(--gfph-accent);
	color: #fff;
	line-height: 1.25;
	text-align: center;
}

.gfph button.gfph-btn:hover {
	background: var(--gfph-accent-dark);
	border-color: var(--gfph-accent-dark);
}

.gfph button.gfph-btn small {
	display: block;
	font-weight: normal;
	font-size: 12.5px;
	opacity: 0.9;
	margin-top: 3px;
}

.gfph button.gfph-btn:focus-visible {
	outline: 2px solid var(--gfph-ink);
	outline-offset: 3px;
}

/* Modal */
.gfph-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(35, 31, 32, 0.65);
	padding: 20px;
	align-items: center;
	justify-content: center;
}

.gfph-modal.gfph-open { display: flex; }

.gfph-card {
	background: #fff;
	border-radius: 10px;
	width: 100%;
	max-width: 720px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 30px;
	position: relative;
	-webkit-overflow-scrolling: touch;
}

.gfph-close {
	position: absolute;
	top: 12px;
	right: 14px;
	border: none;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: #999;
	cursor: pointer;
	padding: 6px;
}

.gfph-close:hover { color: var(--gfph-accent); }

.gfph-card-title {
	margin: 0 0 6px;
	color: var(--gfph-accent);
	font-size: 20px;
	padding-right: 30px;
}

.gfph-card-sub {
	margin: 0 0 18px;
	color: #555;
	font-size: 14px;
	line-height: 1.5;
}

.gfph-form { text-align: left; }

@media (max-width: 480px) {
	.gfph-btns { flex-direction: column; }
	.gfph button.gfph-btn { width: 100%; }
	.gfph-picker .gfph-select { width: 100%; min-width: 0; }
	.gfph-card { padding: 22px 18px; }
}

/* --------------------------------------------------------------------------
   style="list" - a plain numbered listing of form titles, for a forms index
   page. No download links, the title itself opens the form in the modal.
   -------------------------------------------------------------------------- */

.gfph-list {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: left;
	counter-reset: gfph;
}

.gfph-list li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid rgba(35, 31, 32, 0.1);
}

.gfph-list li:last-child { border-bottom: none; }

.gfph button.gfph-list-item {
	counter-increment: gfph;
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-radius: 0;
	padding: 14px 16px 14px 46px;
	position: relative;
	font-family: inherit;
	font-size: 16px;
	color: var(--gfph-ink);
	cursor: pointer;
	line-height: 1.4;
}

.gfph button.gfph-list-item::before {
	content: counter(gfph);
	position: absolute;
	left: 12px;
	top: 15px;
	width: 22px;
	text-align: right;
	font-size: 13px;
	font-weight: 700;
	color: var(--gfph-accent);
}

.gfph button.gfph-list-item:hover {
	background: var(--gfph-tint-hover);
	color: var(--gfph-accent);
}

.gfph button.gfph-list-item:focus-visible {
	outline: 2px solid var(--gfph-accent);
	outline-offset: -2px;
}

.gfph-list-title { display: block; font-weight: 600; }

.gfph-list-desc {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: #666;
	margin-top: 2px;
}

@media (max-width: 480px) {
	.gfph button.gfph-list-item { font-size: 15px; padding-left: 40px; }
}

/* --------------------------------------------------------------------------
   style="grid" - document icon above each form title, matching the existing
   PSPF downloads page. The title opens the form in the modal.
   -------------------------------------------------------------------------- */

.gfph-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 26px 18px;
	text-align: center;
}

.gfph button.gfph-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	background: none;
	border: none;
	border-radius: 8px;
	padding: 18px 10px;
	cursor: pointer;
	font-family: inherit;
	width: 100%;
}

.gfph .gfph-tile-icon {
	display: block;
	width: 52px;
	line-height: 0;
}

.gfph .gfph-tile-icon svg {
	width: 100%;
	height: auto;
	display: block;
	fill: var(--gfph-accent);
	transition: fill .15s ease, transform .15s ease;
}

.gfph .gfph-tile-title {
	display: block;
	font-size: 15px;
	line-height: 1.35;
	color: var(--gfph-accent);
	word-break: break-word;
}

.gfph .gfph-tile-desc {
	display: block;
	font-size: 12.5px;
	line-height: 1.4;
	color: #6b7280;
}

.gfph button.gfph-tile:hover .gfph-tile-icon svg {
	fill: var(--gfph-accent-dark);
	transform: translateY(-2px);
}

.gfph button.gfph-tile:hover .gfph-tile-title {
	color: var(--gfph-accent-dark);
	text-decoration: underline;
}

.gfph button.gfph-tile:focus-visible {
	outline: 2px solid var(--gfph-accent);
	outline-offset: 2px;
}

@media (max-width: 980px) {
	.gfph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
	.gfph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
	.gfph .gfph-tile-icon { width: 44px; }
	.gfph .gfph-tile-title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.gfph .gfph-tile-icon svg { transition: none; }
	.gfph button.gfph-tile:hover .gfph-tile-icon svg { transform: none; }
}

/* ---------------------------------------------------------------------------
   Keeping the modal above the theme

   The modal is moved to be a direct child of <body> when the page loads, so
   its z-index is measured against the page rather than against whichever
   section the hub happens to sit in. These rules hold a fixed header, footer
   or floating bar out of the way while a modal is open, and only then.
   --------------------------------------------------------------------------- */

.gfph-modal { z-index: 2147483000; }

body.gfph-modal-open #top-header,
body.gfph-modal-open #main-header,
body.gfph-modal-open #main-footer,
body.gfph-modal-open .et-fixed-header,
body.gfph-modal-open .et-l--header,
body.gfph-modal-open .et-l--footer,
body.gfph-modal-open .et_pb_sticky_module,
body.gfph-modal-open .et_pb_sticky {
	z-index: 1 !important;
}

/* A transformed ancestor creates a stacking context of its own, which is the
   other way a fixed header ends up painting over a modal. */
body.gfph-modal-open .et-l--header,
body.gfph-modal-open .et-l--footer {
	transform: none !important;
	filter: none !important;
}
