/*
 * AiProfile Inside: the block with the answers.
 *
 * Everything here is scoped to div.aiprofile-inside, the wrapper the
 * shortcode prints; nothing else on the page is touched. The theme keeps its
 * font, sizes and colours. Two things are ours (since 1.3.2):
 *
 * 1. Case. Some themes (Astra, for one) set text-transform: capitalize on the
 *    body, headings and buttons, which turns every question into Title Case
 *    ("Wat Is De Prijs Per Nacht?"). The answers are written in sentence case
 *    and stay that way. The selectors carry element names and two or three
 *    classes, so they outweigh theme rules such as `.entry-content h2` or
 *    `.ast-separate-container .entry-content h2` without !important.
 *
 * 2. Rhythm. Space above every group of questions but the first, a small gap
 *    under its title and even spacing between the questions, whatever margins
 *    the theme gives its headings and paragraphs (none, or large ones).
 */

div.aiprofile-inside,
div.aiprofile-inside section.aiprofile,
div.aiprofile-inside section.aiprofile *,
div.aiprofile-inside section.aiprofile h2.aiprofile-title,
div.aiprofile-inside section.aiprofile h2.aiprofile-theme-title,
div.aiprofile-inside section.aiprofile h3.aiprofile-theme-title,
div.aiprofile-inside details.aiprofile-qa summary.aiprofile-question,
div.aiprofile-inside details.aiprofile-qa p.aiprofile-answer,
div.aiprofile-inside details.aiprofile-qa p.aiprofile-sources,
div.aiprofile-inside section.aiprofile-stamp p,
div.aiprofile-inside section.aiprofile-stamp a {
	text-transform: none;
}

/* Our own title, only with titel="ja": the same gap as a group title. */
div.aiprofile-inside section.aiprofile h2.aiprofile-title {
	margin: 0 0 0.75em;
	padding: 0;
}

/* Groups: clear space above each one, none above the first. */
div.aiprofile-inside section.aiprofile section.aiprofile-theme {
	margin: 0;
	padding: 0;
}

div.aiprofile-inside section.aiprofile section.aiprofile-theme ~ section.aiprofile-theme {
	margin-top: 2em;
}

/* The group title: the theme's own heading margins do not count here. */
div.aiprofile-inside section.aiprofile section.aiprofile-theme h2.aiprofile-theme-title,
div.aiprofile-inside section.aiprofile section.aiprofile-theme h3.aiprofile-theme-title {
	margin: 0 0 0.6em;
	padding: 0;
}

/* The questions: even spacing between the rows, closed or open. */
div.aiprofile-inside section.aiprofile-theme details.aiprofile-qa {
	margin: 0;
	padding: 0;
}

div.aiprofile-inside section.aiprofile-theme details.aiprofile-qa + details.aiprofile-qa {
	margin-top: 0.75em;
}

div.aiprofile-inside details.aiprofile-qa summary.aiprofile-question {
	margin: 0;
	cursor: pointer;
}

div.aiprofile-inside details.aiprofile-qa p.aiprofile-answer {
	margin: 0.5em 0 0;
}

div.aiprofile-inside details.aiprofile-qa p.aiprofile-sources {
	margin: 0.35em 0 0;
}

/*
 * The stamp at the top of the answers (since 1.3.0).
 *
 * Scoped to .aiprofile-inside .aiprofile-stamp. A small white card, as a badge: the theme's font, its own fixed
 * small sizes (a theme with a large body text would make it wrap) and quiet
 * colours so it reads the same on a light and a dark theme. Left: "Verified
 * by ..." with a green check and "Optimized for AI agents". Right, only when
 * the owner switched the link on: "Powered by AiProfile" with the AiProfile
 * mark (assets/cdot.svg on the AiProfile blue).
 */

.aiprofile-inside .aiprofile-stamp {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: auto auto;
	align-items: center;
	column-gap: 18px;
	width: fit-content;
	max-width: 100%;
	margin: 0 0 2em;
	padding: 12px 18px;
	font-family: inherit;
	line-height: 1.4;
	color: #18222f;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(24, 34, 47, 0.06);
}

.aiprofile-inside .aiprofile-stamp p {
	grid-column: 1;
	margin: 0;
	padding: 0;
	max-width: none;
}

.aiprofile-inside .aiprofile-stamp small {
	font-size: inherit;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-verified {
	font-size: 15px;
	color: #18222f;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-check {
	margin-right: 0.15em;
	font-weight: 700;
	color: #1f8a5b;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-optimized {
	font-size: 12px;
	font-weight: 600;
	color: #556273;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-verified + .aiprofile-optimized {
	margin-top: 4px;
}

/* Right of a thin line, across both rows. */
.aiprofile-inside .aiprofile-stamp .aiprofile-credit {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: stretch;
	display: flex;
	align-items: center;
	padding-left: 18px;
	font-size: 12px;
	white-space: nowrap;
	border-left: 1px solid #e2e8f0;
}

.aiprofile-inside .aiprofile-stamp:not(:has(.aiprofile-verified)) .aiprofile-credit {
	grid-row: 1;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-credit a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: #556273;
	text-decoration: none;
	box-shadow: none;
	background: none;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-credit a::before {
	content: "";
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #2e5a8f url("cdot.svg") center / 12px 12px no-repeat;
}

.aiprofile-inside .aiprofile-stamp .aiprofile-credit a:hover,
.aiprofile-inside .aiprofile-stamp .aiprofile-credit a:focus {
	color: #18222f;
	text-decoration: underline;
}

/* Narrow screens: one column, the link under a line. */
@media (max-width: 480px) {
	.aiprofile-inside .aiprofile-stamp {
		grid-template-columns: 1fr;
	}

	.aiprofile-inside .aiprofile-stamp .aiprofile-credit,
	.aiprofile-inside .aiprofile-stamp:not(:has(.aiprofile-verified)) .aiprofile-credit {
		grid-column: 1;
		grid-row: auto;
		margin-top: 8px;
		padding: 8px 0 0;
		border-left: 0;
		border-top: 1px solid #e2e8f0;
	}
}
