/* YMYL Page Changelog — public change history.
   Design language: hairtec.nl (deep navy #223558, soft gray #EEEFF2, pill
   shapes, rounded cards, soft shadows). The font is inherited from the
   theme. Every token is a CSS custom property so themes can override:

   .ypc-changelog { --ypc-primary: #0a5c36; }
*/

.ypc-changelog {
	--ypc-primary: #223558;
	--ypc-surface: #ffffff;
	--ypc-soft: #eeeff2;
	--ypc-text: #5c5c5c;
	--ypc-muted: #8a8f9c;
	--ypc-line: #dfe2e8;
	--ypc-radius: 20px;
	--ypc-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.05);

	margin: 2.5em 0;
	padding: 1.5em;
	background: var(--ypc-surface);
	border-radius: var(--ypc-radius);
	box-shadow: var(--ypc-shadow);
	color: var(--ypc-text);
	font-family: inherit;
}

/* Optional heading (rendered only when explicitly configured) — kept small
   and quiet on purpose: the design is minimal by default. */
.ypc-changelog__title {
	margin: 0 0 0.9em;
	font-size: 0.78em;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ypc-primary);
	opacity: 0.85;
}

/* "First published · Last updated" as pill chips */
.ypc-changelog__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 1.5em;
	font-size: 0.8em;
}

.ypc-changelog__meta-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.5em 1.1em;
	background: var(--ypc-soft);
	border-radius: 100px;
	color: var(--ypc-primary);
	font-weight: 700;
	white-space: nowrap;
}

.ypc-changelog__meta-chip time {
	font-weight: 400;
	color: var(--ypc-text);
}

.ypc-changelog__empty {
	margin: 0;
	font-size: 0.9em;
	color: var(--ypc-muted);
}

/* Collapsible history (native <details>, no JS) */
.ypc-changelog__details {
	margin: 0;
}

.ypc-changelog__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.7em 1.6em;
	background: var(--ypc-primary);
	color: #fff;
	border-radius: 100px;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	user-select: none;
	list-style: none;
	transition: opacity 0.15s ease;
}

.ypc-changelog__toggle:hover {
	opacity: 0.88;
}

.ypc-changelog .ypc-changelog__toggle:focus,
.ypc-changelog .ypc-changelog__toggle:focus-visible {
	outline: 2px solid var(--ypc-primary) !important;
	outline-offset: 3px;
	box-shadow: none !important;
}

.ypc-changelog__toggle::-webkit-details-marker,
.ypc-changelog__toggle::marker {
	display: none;
	content: "";
}

.ypc-changelog__chevron {
	width: 0.55em;
	height: 0.55em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-15%);
	transition: transform 0.15s ease;
}

.ypc-changelog__toggle-hide {
	display: none;
}

.ypc-changelog__details[open] .ypc-changelog__toggle-show {
	display: none;
}

.ypc-changelog__details[open] .ypc-changelog__toggle-hide {
	display: inline;
}

.ypc-changelog__details[open] .ypc-changelog__chevron {
	transform: rotate(225deg) translateY(-15%);
}

.ypc-changelog__details[open] .ypc-changelog__toggle {
	background: var(--ypc-soft);
	color: var(--ypc-primary);
	margin-bottom: 1.4em;
}

/* The expanded list is height-capped and scrolls internally, so opening the
   history never makes the page itself longer. Themes can override the cap:
   .ypc-changelog { --ypc-list-max-height: 30em; } */
.ypc-changelog__scroll {
	max-height: var(--ypc-list-max-height, 23em);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0.2em 1em 0.2em 0.8em;
	scrollbar-width: thin;
	scrollbar-color: var(--ypc-line) transparent;
}

.ypc-changelog__scroll:focus-visible {
	outline: 2px solid var(--ypc-primary);
	outline-offset: 2px;
	border-radius: 8px;
}

.ypc-changelog__scroll::-webkit-scrollbar {
	width: 8px;
}

.ypc-changelog__scroll::-webkit-scrollbar-thumb {
	background: var(--ypc-line);
	border-radius: 8px;
}

.ypc-changelog__scroll::-webkit-scrollbar-track {
	background: transparent;
}

/* Timeline */
.ypc-changelog__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ypc-entry {
	position: relative;
	margin: 0;
	padding: 0 0 1.6em 1.6em;
	border-left: 2px solid var(--ypc-soft);
}

.ypc-entry:last-child {
	padding-bottom: 0.2em;
}

.ypc-entry::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 0.3em;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ypc-primary);
	box-shadow: 0 0 0 3px var(--ypc-surface), 0 0 0 4px var(--ypc-line);
}

.ypc-entry__head {
	display: flex;
	align-items: center;
	gap: 0.7em;
	flex-wrap: wrap;
	margin-bottom: 0.35em;
}

.ypc-entry__date {
	font-weight: 700;
	font-size: 0.9em;
	color: var(--ypc-primary);
}

.ypc-entry__note {
	margin: 0 0 0.3em;
	line-height: 1.6;
}

.ypc-entry__author {
	font-size: 0.78em;
	color: var(--ypc-muted);
}

/* Type badges: uppercase pills, hairtec-style */
.ypc-badge {
	display: inline-block;
	padding: 0.32em 1em;
	border-radius: 100px;
	font-size: 0.68em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.4;
	background: var(--ypc-soft);
	color: var(--ypc-primary);
	white-space: nowrap;
}

.ypc-badge--update {
	background: rgba(34, 53, 88, 0.1);
	color: #223558;
}

.ypc-badge--add {
	background: rgba(0, 112, 23, 0.1);
	color: #006314;
}

.ypc-badge--fix {
	background: rgba(153, 104, 0, 0.12);
	color: #8a5d00;
}

.ypc-badge--remove {
	background: rgba(179, 45, 46, 0.1);
	color: #a32729;
}

.ypc-badge--review {
	background: rgba(90, 54, 150, 0.1);
	color: #533291;
}

.ypc-badge--publish,
.ypc-badge--auto {
	background: var(--ypc-soft);
	color: var(--ypc-muted);
}

/* Accent dot per type on the timeline */
.ypc-entry--add::before {
	background: #00781a;
}

.ypc-entry--fix::before {
	background: #b07c00;
}

.ypc-entry--remove::before {
	background: #b32d2e;
}

.ypc-entry--review::before {
	background: #5a3696;
}

.ypc-entry--publish::before,
.ypc-entry--auto::before {
	background: var(--ypc-muted);
}

/* ---------------------------------------------------------------------
   Inline style — one unboxed line for hero sections. The full history
   opens in a centered modal, so the surrounding layout never shifts.
   ------------------------------------------------------------------ */

.ypc-changelog--inline {
	margin: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em 0.7em;
	font-size: 0.85em;
}

.ypc-changelog--inline .ypc-inline__item {
	color: var(--ypc-text);
	white-space: nowrap;
}

.ypc-changelog--inline .ypc-inline__item time {
	color: var(--ypc-primary);
	font-weight: 700;
}

/* Separators live in CSS so a wrapped line can never end with a dangling
   "·" — the dot travels with the item that follows it. */
.ypc-changelog--inline .ypc-inline__item + .ypc-inline__item::before {
	content: "·";
	color: var(--ypc-muted);
	margin-right: 0.7em;
	font-weight: 400;
}

/* The trigger is a plain text link — NEVER a pill. Themes and Elementor
   kits style bare <button> elements globally (background, padding, radius,
   min-height), so every visual property is hard-reset here. */
.ypc-changelog--inline .ypc-inline__button {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	width: auto !important;
	min-height: 0 !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 1em !important;
	font-weight: 700 !important;
	line-height: inherit !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: var(--ypc-primary) !important;
	cursor: pointer;
	text-decoration: underline !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.ypc-changelog--inline .ypc-inline__button:hover,
.ypc-changelog--inline .ypc-inline__button:active,
.ypc-changelog--inline .ypc-inline__button:visited {
	opacity: 0.8;
	background: transparent !important;
	color: var(--ypc-primary) !important;
	text-decoration: underline !important;
}

.ypc-changelog--inline .ypc-inline__button:visited {
	opacity: 1;
}

.ypc-changelog--inline .ypc-inline__button:focus,
.ypc-changelog--inline .ypc-inline__button:focus-visible {
	outline: 2px solid var(--ypc-primary) !important;
	outline-offset: 3px;
	background: transparent !important;
	box-shadow: none !important;
}

.ypc-inline__chevron {
	width: 0.5em;
	height: 0.5em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-25%);
}

/* Modal */
html.ypc-modal-open {
	overflow: hidden;
}

.ypc-modal {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ypc-modal[hidden] {
	display: none;
}

.ypc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(34, 53, 88, 0.55);
}

.ypc-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: min(78vh, 620px);
	display: flex;
	flex-direction: column;
	background: var(--ypc-surface);
	color: var(--ypc-text);
	border-radius: var(--ypc-radius);
	box-shadow: 0 24px 64px rgba(34, 53, 88, 0.25);
	padding: 2.4em 1.5em 1.5em;
	outline: none;
	font-size: 1rem;
}

/* Hard-reset like the inline trigger: theme/kit button styles must not
   leak into the close control. */
.ypc-modal .ypc-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 30px !important;
	height: 30px !important;
	min-height: 0 !important;
	min-width: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 0 !important;
	background: var(--ypc-soft) !important;
	color: var(--ypc-primary) !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 18px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
}

.ypc-modal .ypc-modal__close:hover,
.ypc-modal .ypc-modal__close:active {
	opacity: 0.8;
	background: var(--ypc-soft) !important;
	color: var(--ypc-primary) !important;
}

.ypc-modal .ypc-modal__close:focus,
.ypc-modal .ypc-modal__close:focus-visible {
	outline: 2px solid var(--ypc-primary) !important;
	outline-offset: 2px;
	box-shadow: none !important;
}

.ypc-modal .ypc-modal__dialog:focus,
.ypc-modal .ypc-modal__dialog:focus-visible {
	outline: none !important;
	box-shadow: 0 24px 64px rgba(34, 53, 88, 0.25) !important;
}

.ypc-modal__scroll {
	max-height: none;
	flex: 1 1 auto;
	min-height: 0;
}

/* NOTE: no automatic prefers-color-scheme adaptation on purpose — the
   target sites are light-themed, and OS-level dark mode was flipping the
   palette (washed-out text, dark modal) on light pages. Dark themes can
   opt in by overriding the --ypc-* custom properties. */

@media (max-width: 600px) {
	.ypc-changelog {
		padding: 1.4em 1.2em;
	}

	/* Inline line on phones: one tidy centered column, no separators —
	   matches the centered mobile hero layout. */
	.ypc-changelog--inline {
		flex-direction: column;
		align-items: center;
		gap: 0.45em;
		padding: 0;
		text-align: center;
	}

	.ypc-changelog--inline .ypc-inline__item + .ypc-inline__item::before {
		content: none;
	}
}

@media print {
	.ypc-changelog {
		box-shadow: none;
		border: 1px solid #000;
	}
}
